@nebula-spatial/cad-loader 0.2.1 → 0.2.2
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/CHANGELOG.md +4 -0
- package/dist/index.js +218 -201
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.2
|
|
6
|
+
|
|
7
|
+
- Fixed INSERT bounding boxes being truncated when external variant delta content arrives incrementally.
|
|
8
|
+
|
|
5
9
|
## 0.2.1
|
|
6
10
|
|
|
7
11
|
- Added geometry Worker overrides to document sessions and external variant delta loading.
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@ var nn = (t) => {
|
|
|
5
5
|
var Lr = (t, n, e) => n in t ? Tr(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
6
6
|
var f = (t, n, e) => Lr(t, typeof n != "symbol" ? n + "" : n, e), tt = (t, n, e) => n.has(t) || nn("Cannot " + e);
|
|
7
7
|
var b = (t, n, e) => (tt(t, n, "read from private field"), e ? e.call(t) : n.get(t)), E = (t, n, e) => n.has(t) ? nn("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, e), F = (t, n, e, r) => (tt(t, n, "write to private field"), r ? r.call(t, e) : n.set(t, e), e), R = (t, n, e) => (tt(t, n, "access private method"), e);
|
|
8
|
-
import { CadPackError as O, normalizeGeometrySegments as Mr, normalizeViewportRect as Mt, cloneViewportRect as ze, mergeViewportRects as
|
|
9
|
-
import { readBlockAnnotationSidecar as
|
|
8
|
+
import { CadPackError as O, normalizeGeometrySegments as Mr, normalizeViewportRect as Mt, cloneViewportRect as ze, mergeViewportRects as fe, readGroup as Dr, transformBBoxByInstance as Fr, parseBinStreaming as Dt, isStrictTextRoundtripEnabled as Or, assertStrictTextRoundtrip as _r, computeViewportRectFromPositions as Fe, expandViewportRect as je, viewportRectEquals as Ur, viewportRectIntersects as zn, viewportRectContains as Ft, transformViewportRect as Gr, readExternalVariantDependencyPlan as He, readExternalAnnotationManifest as Ot, readExternalBlockAnnotations as _t, readSceneAnnotationSidecar as Nr, parseBinPayload as zr, parseBinBounds as Hr, readExternalVariantManifest as qr } from "./core/index.js";
|
|
9
|
+
import { readBlockAnnotationSidecar as Ho } from "./core/index.js";
|
|
10
10
|
import { BufferAttribute as Q, RawShaderMaterial as Kr, Color as Hn, Vector2 as qn, DoubleSide as Ct, BufferGeometry as Ut, LineSegments as Gt, InstancedInterleavedBuffer as rn, InstancedBufferGeometry as Kn, Float32BufferAttribute as Xn, InterleavedBufferAttribute as Le, Mesh as Nt, Vector3 as nt, Box3 as Xr, Sphere as Wr, Object3D as wt, InstancedBufferAttribute as ce, Points as Wn, Group as J, PointsMaterial as sn, LineBasicMaterial as an, MeshBasicMaterial as on } from "three";
|
|
11
11
|
import { BatchedText as ln, Text as Yr, preloadFont as qe } from "troika-three-text";
|
|
12
12
|
import Qr from "rbush";
|
|
@@ -415,7 +415,7 @@ function mi(t, n) {
|
|
|
415
415
|
let e = n ? ze(n) : null;
|
|
416
416
|
for (const r of ["line", "fill", "dot"])
|
|
417
417
|
for (const i of t[r].values())
|
|
418
|
-
e =
|
|
418
|
+
e = fe(e, i.bbox);
|
|
419
419
|
return e;
|
|
420
420
|
}
|
|
421
421
|
function xi(t) {
|
|
@@ -775,21 +775,21 @@ async function jt(t) {
|
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
|
-
var
|
|
778
|
+
var me, ie, xe, se;
|
|
779
779
|
class _i {
|
|
780
780
|
constructor(n) {
|
|
781
|
-
E(this,
|
|
781
|
+
E(this, me, []);
|
|
782
782
|
E(this, ie, []);
|
|
783
|
-
E(this,
|
|
783
|
+
E(this, xe);
|
|
784
784
|
E(this, se, !1);
|
|
785
|
-
F(this,
|
|
785
|
+
F(this, xe, n);
|
|
786
786
|
}
|
|
787
787
|
[Symbol.asyncIterator]() {
|
|
788
788
|
return this;
|
|
789
789
|
}
|
|
790
790
|
next() {
|
|
791
|
-
const n = b(this,
|
|
792
|
-
return n ? (b(this,
|
|
791
|
+
const n = b(this, me).shift();
|
|
792
|
+
return n ? (b(this, xe).call(this, n), Promise.resolve({ done: !1, value: n.event })) : b(this, se) ? Promise.resolve({ done: !0, value: void 0 }) : new Promise((e) => {
|
|
793
793
|
b(this, ie).push({ resolve: e });
|
|
794
794
|
});
|
|
795
795
|
}
|
|
@@ -797,10 +797,10 @@ class _i {
|
|
|
797
797
|
if (b(this, se)) return;
|
|
798
798
|
const e = b(this, ie).shift();
|
|
799
799
|
if (e) {
|
|
800
|
-
b(this,
|
|
800
|
+
b(this, xe).call(this, n), e.resolve({ done: !1, value: n.event });
|
|
801
801
|
return;
|
|
802
802
|
}
|
|
803
|
-
b(this,
|
|
803
|
+
b(this, me).push(n);
|
|
804
804
|
}
|
|
805
805
|
close() {
|
|
806
806
|
if (!b(this, se))
|
|
@@ -808,10 +808,10 @@ class _i {
|
|
|
808
808
|
b(this, ie).shift().resolve({ done: !0, value: void 0 });
|
|
809
809
|
}
|
|
810
810
|
clear() {
|
|
811
|
-
b(this,
|
|
811
|
+
b(this, me).length = 0, this.close();
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
|
|
814
|
+
me = new WeakMap(), ie = new WeakMap(), xe = new WeakMap(), se = new WeakMap();
|
|
815
815
|
function xn() {
|
|
816
816
|
let t, n;
|
|
817
817
|
return { promise: new Promise((r, i) => {
|
|
@@ -901,7 +901,7 @@ function Xi(t) {
|
|
|
901
901
|
dot: t.dot.map(lt)
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
|
-
var T, Re, Be, Ae,
|
|
904
|
+
var T, Re, Be, Ae, pe, te, G, ge, ne, be, Ee, Y, Ie, Se, Ve, _, Pe, ke, v, Jn, er, tr, ue, Bt, nr, ve, At, Oe, _e, Ue;
|
|
905
905
|
class Wi {
|
|
906
906
|
constructor(n, e) {
|
|
907
907
|
E(this, v);
|
|
@@ -911,15 +911,15 @@ class Wi {
|
|
|
911
911
|
E(this, Re);
|
|
912
912
|
E(this, Be);
|
|
913
913
|
E(this, Ae, new AbortController());
|
|
914
|
-
E(this,
|
|
914
|
+
E(this, pe, xn());
|
|
915
915
|
E(this, te, xn());
|
|
916
916
|
E(this, G);
|
|
917
|
-
E(this,
|
|
917
|
+
E(this, ge, []);
|
|
918
918
|
E(this, ne);
|
|
919
|
-
E(this,
|
|
919
|
+
E(this, be, /* @__PURE__ */ new Set());
|
|
920
920
|
E(this, Ee, []);
|
|
921
921
|
E(this, Y, null);
|
|
922
|
-
E(this,
|
|
922
|
+
E(this, Ie, null);
|
|
923
923
|
E(this, Se, 0);
|
|
924
924
|
E(this, Ve, !1);
|
|
925
925
|
E(this, _, !1);
|
|
@@ -927,7 +927,7 @@ class Wi {
|
|
|
927
927
|
E(this, ke, vt());
|
|
928
928
|
F(this, T, e);
|
|
929
929
|
const r = Je(n, b(this, Ae).signal);
|
|
930
|
-
F(this, Re, r.source), F(this, Be, r.sourceSignal), F(this, ne, new Qn(Gi(e.flowControl))), F(this, G, new _i((i) => R(this, v, nr).call(this, i))), this.events = b(this, G), this.ready = b(this,
|
|
930
|
+
F(this, Re, r.source), F(this, Be, r.sourceSignal), F(this, ne, new Qn(Gi(e.flowControl))), F(this, G, new _i((i) => R(this, v, nr).call(this, i))), this.events = b(this, G), this.ready = b(this, pe).promise, this.ready.catch(() => {
|
|
931
931
|
}), b(this, te).promise.catch(() => {
|
|
932
932
|
}), R(this, v, At).call(this, e.signal), R(this, v, At).call(this, b(this, Be)), b(this, _) || R(this, v, Jn).call(this);
|
|
933
933
|
}
|
|
@@ -945,7 +945,7 @@ class Wi {
|
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
|
-
T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(),
|
|
948
|
+
T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), pe = new WeakMap(), te = new WeakMap(), G = new WeakMap(), ge = new WeakMap(), ne = new WeakMap(), be = new WeakMap(), Ee = new WeakMap(), Y = new WeakMap(), Ie = new WeakMap(), Se = new WeakMap(), Ve = new WeakMap(), _ = new WeakMap(), Pe = new WeakMap(), ke = new WeakMap(), v = new WeakSet(), Jn = async function() {
|
|
949
949
|
var n, e;
|
|
950
950
|
try {
|
|
951
951
|
const r = await Promise.race([
|
|
@@ -968,17 +968,17 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
968
968
|
}, (o) => R(this, v, tr).call(this, o));
|
|
969
969
|
if (F(this, Y, s), s.completion.catch(() => {
|
|
970
970
|
}), (n = s.backgroundCompletion) == null || n.catch(() => {
|
|
971
|
-
}), R(this, v,
|
|
971
|
+
}), R(this, v, ve).call(this, b(this, ne).takeInitialGrant()), await Promise.race([s.completion, b(this, te).promise]), s.backgroundCompletion && await Promise.race([s.backgroundCompletion, b(this, te).promise]), b(this, _)) return;
|
|
972
972
|
if (!b(this, Ve))
|
|
973
973
|
throw new Error("CAD loader adapter completed without a done event");
|
|
974
|
-
if (!b(this,
|
|
974
|
+
if (!b(this, Ie))
|
|
975
975
|
throw new Error("CAD loader adapter completed without metadata");
|
|
976
976
|
const a = {
|
|
977
|
-
header: b(this,
|
|
978
|
-
chunks: b(this,
|
|
977
|
+
header: b(this, Ie),
|
|
978
|
+
chunks: b(this, ge),
|
|
979
979
|
rawBytes: b(this, Se)
|
|
980
980
|
};
|
|
981
|
-
F(this, _, !0), b(this, G).push({ event: { type: "ready", document: a } }), b(this, G).close(), b(this,
|
|
981
|
+
F(this, _, !0), b(this, G).push({ event: { type: "ready", document: a } }), b(this, G).close(), b(this, pe).resolve(a), R(this, v, Ue).call(this);
|
|
982
982
|
} catch (r) {
|
|
983
983
|
b(this, _) || R(this, v, Oe).call(this, Ui(r));
|
|
984
984
|
} finally {
|
|
@@ -992,7 +992,7 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
992
992
|
}, tr = async function(n) {
|
|
993
993
|
if (!b(this, _)) {
|
|
994
994
|
if (n.type === "header") {
|
|
995
|
-
F(this,
|
|
995
|
+
F(this, Ie, n.header), b(this, G).push({
|
|
996
996
|
event: { type: "meta", meta: n.header, header: n.header }
|
|
997
997
|
}), await R(this, v, ue).call(this);
|
|
998
998
|
return;
|
|
@@ -1000,7 +1000,7 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1000
1000
|
if (n.type === "geometry") {
|
|
1001
1001
|
const e = n.layers.map((r) => {
|
|
1002
1002
|
const i = qi(r);
|
|
1003
|
-
return b(this,
|
|
1003
|
+
return b(this, ge).push({ kind: n.kind, payload: i }), {
|
|
1004
1004
|
event: {
|
|
1005
1005
|
type: "geometry",
|
|
1006
1006
|
kind: n.kind,
|
|
@@ -1015,7 +1015,7 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1015
1015
|
return;
|
|
1016
1016
|
}
|
|
1017
1017
|
if (n.type === "text") {
|
|
1018
|
-
const e = n.texts.map((r) => (b(this,
|
|
1018
|
+
const e = n.texts.map((r) => (b(this, ge).push({ kind: "text", payload: r }), { event: { type: "text", chunk: r } }));
|
|
1019
1019
|
await R(this, v, Bt).call(this, e, "text", n.bytes), await R(this, v, ue).call(this);
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
@@ -1038,13 +1038,13 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1038
1038
|
}), F(this, ke, performance.now()));
|
|
1039
1039
|
}, Bt = function(n, e, r) {
|
|
1040
1040
|
if (n.length === 0) {
|
|
1041
|
-
R(this, v,
|
|
1041
|
+
R(this, v, ve).call(this, e === "geometry" ? { geometryCredits: 1, textCredits: 0 } : { geometryCredits: 0, textCredits: 1 });
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
const i = { kind: e, bytes: Math.max(0, r), creditReplaced: !1 };
|
|
1045
1045
|
b(this, ne).onQueued(e, i.bytes);
|
|
1046
1046
|
const s = b(this, ne).onConsumed(e, 0);
|
|
1047
|
-
if (i.creditReplaced = R(this, v,
|
|
1047
|
+
if (i.creditReplaced = R(this, v, ve).call(this, s), n.forEach((a, o) => {
|
|
1048
1048
|
b(this, G).push({
|
|
1049
1049
|
...a,
|
|
1050
1050
|
batch: i,
|
|
@@ -1052,13 +1052,13 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1052
1052
|
});
|
|
1053
1053
|
}), !!s.paused)
|
|
1054
1054
|
return new Promise((a) => {
|
|
1055
|
-
b(this,
|
|
1055
|
+
b(this, be).add(a);
|
|
1056
1056
|
});
|
|
1057
1057
|
}, nr = function(n) {
|
|
1058
1058
|
if (!n.batch || !n.accountsBatch) return;
|
|
1059
1059
|
const e = b(this, ne).onConsumed(n.batch.kind, n.batch.bytes);
|
|
1060
|
-
n.batch.creditReplaced || (n.batch.creditReplaced = R(this, v,
|
|
1061
|
-
},
|
|
1060
|
+
n.batch.creditReplaced || (n.batch.creditReplaced = R(this, v, ve).call(this, e)), e.paused || R(this, v, _e).call(this);
|
|
1061
|
+
}, ve = function(n) {
|
|
1062
1062
|
var e;
|
|
1063
1063
|
return !((e = b(this, Y)) != null && e.grant) || b(this, _) || n.geometryCredits <= 0 && n.textCredits <= 0 ? !1 : (b(this, Y).grant({
|
|
1064
1064
|
geometryCredits: n.geometryCredits,
|
|
@@ -1074,14 +1074,14 @@ T = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), x
|
|
|
1074
1074
|
n.addEventListener("abort", e, { once: !0 }), b(this, Ee).push(() => n.removeEventListener("abort", e));
|
|
1075
1075
|
}, Oe = function(n) {
|
|
1076
1076
|
var e, r, i;
|
|
1077
|
-
b(this, _) || (F(this, _, !0), b(this, Ae).abort(n), (r = (e = b(this, Y)) == null ? void 0 : e.cancel) == null || r.call(e), (i = b(this, Y)) == null || i.dispose(), b(this, te).reject(n), b(this,
|
|
1077
|
+
b(this, _) || (F(this, _, !0), b(this, Ae).abort(n), (r = (e = b(this, Y)) == null ? void 0 : e.cancel) == null || r.call(e), (i = b(this, Y)) == null || i.dispose(), b(this, te).reject(n), b(this, pe).reject(n), b(this, G).push({ event: { type: "error", error: n } }), b(this, G).close(), R(this, v, _e).call(this), R(this, v, Ue).call(this));
|
|
1078
1078
|
}, _e = function() {
|
|
1079
|
-
for (const n of b(this,
|
|
1080
|
-
b(this,
|
|
1079
|
+
for (const n of b(this, be)) n();
|
|
1080
|
+
b(this, be).clear();
|
|
1081
1081
|
}, Ue = function() {
|
|
1082
1082
|
for (const n of b(this, Ee).splice(0)) n();
|
|
1083
1083
|
};
|
|
1084
|
-
function
|
|
1084
|
+
function Ro(t, n = {}) {
|
|
1085
1085
|
return new Wi(t, n);
|
|
1086
1086
|
}
|
|
1087
1087
|
class Yi {
|
|
@@ -1762,7 +1762,7 @@ function Cn(t, n) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
function bs(t, n) {
|
|
1764
1764
|
const e = hr(n.theme), r = n.elementKind === "text" ? 4.5 : n.elementKind === "hatch" ? 1.6 : 2.2;
|
|
1765
|
-
return yr(t, e.background) >= r ?
|
|
1765
|
+
return yr(t, e.background) >= r ? Ce(t) : Bs(t, e.background, r, n.theme);
|
|
1766
1766
|
}
|
|
1767
1767
|
function Ge(t, n, e = 0) {
|
|
1768
1768
|
return e > gs ? n.fallbackColor ?? { kind: "aci", index: 7 } : t.kind === "bylayer" ? Ge(n.layerColor ?? n.fallbackColor ?? { kind: "aci", index: 7 }, n, e + 1) : t.kind === "byblock" ? Ge(
|
|
@@ -1781,19 +1781,19 @@ function Zt(t) {
|
|
|
1781
1781
|
return Math.abs(t[0] - 200) <= 2 && Math.abs(t[1] - 200) <= 2 && Math.abs(t[2] - 200) <= 2;
|
|
1782
1782
|
}
|
|
1783
1783
|
function Cs(t, n = {}) {
|
|
1784
|
-
return n.treatLegacyForegroundAsAci7 && Is(t) ? { kind: "aci", index: 7 } : { kind: "truecolor", rgb:
|
|
1784
|
+
return n.treatLegacyForegroundAsAci7 && Is(t) ? { kind: "aci", index: 7 } : { kind: "truecolor", rgb: Ce(t) };
|
|
1785
1785
|
}
|
|
1786
1786
|
function ws(t, n, e) {
|
|
1787
|
-
return t.kind === "truecolor" ?
|
|
1787
|
+
return t.kind === "truecolor" ? Ce(t.rgb) : t.kind === "aci" ? vs(t.index, n) : (t.kind === "none", e === "text" ? n.defaultText : n.defaultLine);
|
|
1788
1788
|
}
|
|
1789
1789
|
function vs(t, n) {
|
|
1790
1790
|
const e = fr(t);
|
|
1791
|
-
return
|
|
1791
|
+
return Ce(e === 7 || e === 0 || e === 256 ? n.foreground : ps[e] ?? n.defaultLine);
|
|
1792
1792
|
}
|
|
1793
1793
|
function fr(t) {
|
|
1794
1794
|
return Number.isFinite(t) ? Math.abs(Math.trunc(t)) : 7;
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function Ce(t) {
|
|
1797
1797
|
return [q(t[0]), q(t[1]), q(t[2])];
|
|
1798
1798
|
}
|
|
1799
1799
|
function Rs(t, n) {
|
|
@@ -1815,7 +1815,7 @@ function yr(t, n) {
|
|
|
1815
1815
|
}
|
|
1816
1816
|
function Bs(t, n, e, r) {
|
|
1817
1817
|
const i = As(t);
|
|
1818
|
-
let s = 0, a = 1, o =
|
|
1818
|
+
let s = 0, a = 1, o = Ce(t);
|
|
1819
1819
|
for (let c = 0; c < 16; c += 1) {
|
|
1820
1820
|
const l = (s + a) / 2, d = r === "light" ? i.l * (1 - l) : i.l + (1 - i.l) * l, u = Es(i.h, i.s, d);
|
|
1821
1821
|
yr(u, n) >= e ? (o = u, a = l) : s = l;
|
|
@@ -2488,11 +2488,11 @@ function Z(t, n, e) {
|
|
|
2488
2488
|
const ra = {
|
|
2489
2489
|
visibleVertexCount: 0,
|
|
2490
2490
|
zoom: 1
|
|
2491
|
-
}, Vn = /* @__PURE__ */ new Set(), ia = Object.freeze({ kind: "structure" }),
|
|
2491
|
+
}, Vn = /* @__PURE__ */ new Set(), ia = Object.freeze({ kind: "structure" }), Bo = Object.freeze({ kind: "visual" });
|
|
2492
2492
|
function sa(t) {
|
|
2493
2493
|
let n = null;
|
|
2494
2494
|
for (const e of t)
|
|
2495
|
-
Vt(e.bbox) && (n =
|
|
2495
|
+
Vt(e.bbox) && (n = fe(n, e.bbox));
|
|
2496
2496
|
return n;
|
|
2497
2497
|
}
|
|
2498
2498
|
function Vt(t) {
|
|
@@ -2513,7 +2513,7 @@ function ha() {
|
|
|
2513
2513
|
cachedFatCount: 0
|
|
2514
2514
|
};
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function we(t) {
|
|
2517
2517
|
return [t[0], t[1], t[2], t[3]];
|
|
2518
2518
|
}
|
|
2519
2519
|
function fa(t, n) {
|
|
@@ -2588,7 +2588,10 @@ function xa(t, n) {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
const s = new Map(i.inserts.map((o) => [o.instanceId, o]));
|
|
2590
2590
|
for (const o of r.inserts)
|
|
2591
|
-
s.set(
|
|
2591
|
+
s.set(
|
|
2592
|
+
o.instanceId,
|
|
2593
|
+
pa(s.get(o.instanceId), o)
|
|
2594
|
+
);
|
|
2592
2595
|
const a = Array.from(s.values()).sort((o, c) => o.instanceId - c.instanceId);
|
|
2593
2596
|
e.set(r.variantId, {
|
|
2594
2597
|
...i,
|
|
@@ -2600,7 +2603,21 @@ function xa(t, n) {
|
|
|
2600
2603
|
}
|
|
2601
2604
|
return Array.from(e.values()).sort((r, i) => i.instanceCount - r.instanceCount);
|
|
2602
2605
|
}
|
|
2603
|
-
function pa(t) {
|
|
2606
|
+
function pa(t, n) {
|
|
2607
|
+
const e = fe((t == null ? void 0 : t.bbox) ?? null, n.bbox ?? null);
|
|
2608
|
+
if (e)
|
|
2609
|
+
return {
|
|
2610
|
+
...n,
|
|
2611
|
+
canHighlight: !0,
|
|
2612
|
+
bbox: e
|
|
2613
|
+
};
|
|
2614
|
+
const { bbox: r, ...i } = n;
|
|
2615
|
+
return {
|
|
2616
|
+
...i,
|
|
2617
|
+
canHighlight: !1
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
function ga(t) {
|
|
2604
2621
|
return t.line.count > 0 || t.fill.count > 0 || t.dot.count > 0 || t.line.raw.byteLength > 0 || t.fill.raw.byteLength > 0 || t.dot.raw.byteLength > 0;
|
|
2605
2622
|
}
|
|
2606
2623
|
function Dn(t, n) {
|
|
@@ -2613,7 +2630,7 @@ function Dn(t, n) {
|
|
|
2613
2630
|
);
|
|
2614
2631
|
return e;
|
|
2615
2632
|
}
|
|
2616
|
-
function
|
|
2633
|
+
function ba(t, n, e) {
|
|
2617
2634
|
if (!n) return t;
|
|
2618
2635
|
if (!t)
|
|
2619
2636
|
return {
|
|
@@ -2623,7 +2640,7 @@ function ga(t, n, e) {
|
|
|
2623
2640
|
};
|
|
2624
2641
|
const r = t.variants.slice();
|
|
2625
2642
|
for (const s of n.variants)
|
|
2626
|
-
(!r[s.id] ||
|
|
2643
|
+
(!r[s.id] || ga(s)) && (r[s.id] = s);
|
|
2627
2644
|
const i = /* @__PURE__ */ new Map();
|
|
2628
2645
|
for (const [s, a] of t.textIndexesByInstanceId)
|
|
2629
2646
|
i.set(s, [...a]);
|
|
@@ -2640,7 +2657,7 @@ function ga(t, n, e) {
|
|
|
2640
2657
|
])
|
|
2641
2658
|
};
|
|
2642
2659
|
}
|
|
2643
|
-
function
|
|
2660
|
+
function Ia(t) {
|
|
2644
2661
|
return {
|
|
2645
2662
|
index: t.index,
|
|
2646
2663
|
name: t.name,
|
|
@@ -2649,11 +2666,11 @@ function ba(t) {
|
|
|
2649
2666
|
visible: t.visible
|
|
2650
2667
|
};
|
|
2651
2668
|
}
|
|
2652
|
-
function
|
|
2669
|
+
function Ca(t) {
|
|
2653
2670
|
const n = t >>> 0;
|
|
2654
2671
|
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
2655
2672
|
}
|
|
2656
|
-
function
|
|
2673
|
+
function wa(t) {
|
|
2657
2674
|
return t[0] << 16 | t[1] << 8 | t[2];
|
|
2658
2675
|
}
|
|
2659
2676
|
function yt(t) {
|
|
@@ -2661,7 +2678,7 @@ function yt(t) {
|
|
|
2661
2678
|
const n = Math.round(t);
|
|
2662
2679
|
return n < 0 ? 0 : n > 255 ? 255 : n;
|
|
2663
2680
|
}
|
|
2664
|
-
function
|
|
2681
|
+
function va(t) {
|
|
2665
2682
|
switch (t) {
|
|
2666
2683
|
case "fill":
|
|
2667
2684
|
return 1;
|
|
@@ -2678,8 +2695,8 @@ function wa(t) {
|
|
|
2678
2695
|
return 0;
|
|
2679
2696
|
}
|
|
2680
2697
|
}
|
|
2681
|
-
function
|
|
2682
|
-
return (n !== null && Zt(t) ? la : yt(t[0]) << 16 | yt(t[1]) << 8 | yt(t[2])) |
|
|
2698
|
+
function Ra(t, n, e, r, i) {
|
|
2699
|
+
return (n !== null && Zt(t) ? la : yt(t[0]) << 16 | yt(t[1]) << 8 | yt(t[2])) | va(e) << ca | (r === "light" ? 1 : 0) << ua | (i ? 1 : 0) << da;
|
|
2683
2700
|
}
|
|
2684
2701
|
function mt(t) {
|
|
2685
2702
|
return "color" in t && t.color instanceof Hn;
|
|
@@ -2699,7 +2716,7 @@ function xt(t) {
|
|
|
2699
2716
|
i && !n.has(i) && (n.add(i), i.dispose()), e !== t && ((s = e.dispose) == null || s.call(e));
|
|
2700
2717
|
});
|
|
2701
2718
|
}
|
|
2702
|
-
function
|
|
2719
|
+
function Ba(t) {
|
|
2703
2720
|
var i;
|
|
2704
2721
|
const n = t.userData;
|
|
2705
2722
|
if (n[ft] === !0)
|
|
@@ -2740,13 +2757,13 @@ function Ra(t) {
|
|
|
2740
2757
|
const r = (i = t.customProgramCacheKey) == null ? void 0 : i.bind(t);
|
|
2741
2758
|
t.customProgramCacheKey = () => `${r ? r() : ""}|${ft}`, n[ft] = !0, t.needsUpdate = !0;
|
|
2742
2759
|
}
|
|
2743
|
-
function
|
|
2760
|
+
function Aa(t) {
|
|
2744
2761
|
const n = t.userData[wr];
|
|
2745
2762
|
return n && typeof n == "object" ? n : null;
|
|
2746
2763
|
}
|
|
2747
|
-
function
|
|
2764
|
+
function Ea(t, n) {
|
|
2748
2765
|
var o;
|
|
2749
|
-
const e = t.userData, r =
|
|
2766
|
+
const e = t.userData, r = Aa(t);
|
|
2750
2767
|
if (r)
|
|
2751
2768
|
return r.uGeoPointWorldSize.value = n.pointWorldSize, r.uGeoPointViewportHeight.value = Math.max(1, Math.floor(n.viewportHeight) || 1), r.uGeoPointMinVisiblePixelSize.value = kn, r;
|
|
2752
2769
|
const i = {
|
|
@@ -2789,7 +2806,7 @@ const We = /* @__PURE__ */ new WeakMap();
|
|
|
2789
2806
|
function Ye(t, n) {
|
|
2790
2807
|
n ? We.set(t, n) : We.delete(t);
|
|
2791
2808
|
}
|
|
2792
|
-
class
|
|
2809
|
+
class ye extends J {
|
|
2793
2810
|
constructor(e = {}) {
|
|
2794
2811
|
super();
|
|
2795
2812
|
f(this, "meta", {
|
|
@@ -2902,7 +2919,7 @@ class fe extends J {
|
|
|
2902
2919
|
setLayerColor(e, r) {
|
|
2903
2920
|
const i = this.layerStatesByIndex.get(e), s = this.layerGroupsByIndex.get(e), a = this.originalLayerColorsByIndex.get(e);
|
|
2904
2921
|
if (!i || !s || !a) return;
|
|
2905
|
-
const o = r === null ? null :
|
|
2922
|
+
const o = r === null ? null : Ca(r);
|
|
2906
2923
|
o ? this.colorOverridesByIndex.set(e, U(o)) : this.colorOverridesByIndex.delete(e), this.displayHexMemo.clear(), i.color = U(o ?? a), this.layerStateRevision += 1, s.traverse((c) => {
|
|
2907
2924
|
var h;
|
|
2908
2925
|
const l = (h = c.userData) == null ? void 0 : h.kind;
|
|
@@ -2929,7 +2946,7 @@ class fe extends J {
|
|
|
2929
2946
|
if (((r = this.metaSnapshotCache) == null ? void 0 : r.revision) === this.metaRevision)
|
|
2930
2947
|
return this.metaSnapshotCache.value;
|
|
2931
2948
|
const e = Object.freeze({
|
|
2932
|
-
bounds:
|
|
2949
|
+
bounds: we(this.meta.bounds),
|
|
2933
2950
|
entityCount: this.meta.entityCount,
|
|
2934
2951
|
lineCount: this.meta.lineCount,
|
|
2935
2952
|
fillCount: this.meta.fillCount,
|
|
@@ -2943,7 +2960,7 @@ class fe extends J {
|
|
|
2943
2960
|
if (((r = this.layersSnapshotCache) == null ? void 0 : r.revision) === this.layerStateRevision)
|
|
2944
2961
|
return this.layersSnapshotCache.value;
|
|
2945
2962
|
const e = Object.freeze(
|
|
2946
|
-
this.layerOrder.map((i) => this.layerStatesByIndex.get(i)).filter((i) => i !== void 0).map((i) => Object.freeze(
|
|
2963
|
+
this.layerOrder.map((i) => this.layerStatesByIndex.get(i)).filter((i) => i !== void 0).map((i) => Object.freeze(Ia(i)))
|
|
2947
2964
|
);
|
|
2948
2965
|
return this.layersSnapshotCache = { revision: this.layerStateRevision, value: e }, e;
|
|
2949
2966
|
}
|
|
@@ -2981,7 +2998,7 @@ class fe extends J {
|
|
|
2981
2998
|
var r;
|
|
2982
2999
|
if (((r = this.boundsSnapshotCache) == null ? void 0 : r.revision) === this.metaRevision)
|
|
2983
3000
|
return this.boundsSnapshotCache.value;
|
|
2984
|
-
const e = Object.freeze(
|
|
3001
|
+
const e = Object.freeze(we(this.bounds));
|
|
2985
3002
|
return this.boundsSnapshotCache = { revision: this.metaRevision, value: e }, e;
|
|
2986
3003
|
}
|
|
2987
3004
|
getGeometryChunkStats() {
|
|
@@ -3182,8 +3199,8 @@ class fe extends J {
|
|
|
3182
3199
|
}
|
|
3183
3200
|
_initFromHeader(e) {
|
|
3184
3201
|
if (!this.disposed) {
|
|
3185
|
-
this.readySettled && this.startReadyCycle(), this.resetContent(), this.bounds =
|
|
3186
|
-
bounds:
|
|
3202
|
+
this.readySettled && this.startReadyCycle(), this.resetContent(), this.bounds = we(e.bounds), this.meta = {
|
|
3203
|
+
bounds: we(e.bounds),
|
|
3187
3204
|
entityCount: e.entityCount,
|
|
3188
3205
|
lineCount: e.lineCount,
|
|
3189
3206
|
fillCount: e.fillCount,
|
|
@@ -3332,7 +3349,7 @@ class fe extends J {
|
|
|
3332
3349
|
let s = null;
|
|
3333
3350
|
for (const c of i.byKind.values())
|
|
3334
3351
|
for (const l of c)
|
|
3335
|
-
s =
|
|
3352
|
+
s = fe(s, l.bbox);
|
|
3336
3353
|
if (!s) return null;
|
|
3337
3354
|
const a = Gr(s, r);
|
|
3338
3355
|
return Vt(a) ? a : null;
|
|
@@ -3364,13 +3381,13 @@ class fe extends J {
|
|
|
3364
3381
|
if (this.disposed) return;
|
|
3365
3382
|
const r = this.meta.textCount, i = fa(this.bounds, e.bounds);
|
|
3366
3383
|
this.bounds = i, this.meta = {
|
|
3367
|
-
bounds:
|
|
3384
|
+
bounds: we(i),
|
|
3368
3385
|
entityCount: this.meta.entityCount + e.entityCount,
|
|
3369
3386
|
lineCount: this.meta.lineCount + e.lineCount,
|
|
3370
3387
|
fillCount: this.meta.fillCount + e.fillCount,
|
|
3371
3388
|
dotCount: this.meta.dotCount + e.dotCount,
|
|
3372
3389
|
textCount: this.meta.textCount + e.textCount
|
|
3373
|
-
}, this.metaRevision += 1, this.layerBlockUsages = ma(this.layerBlockUsages, e.layerBlockUsages), this.insertRuntime =
|
|
3390
|
+
}, this.metaRevision += 1, this.layerBlockUsages = ma(this.layerBlockUsages, e.layerBlockUsages), this.insertRuntime = ba(this.insertRuntime, e.insertRuntime, r), this.rebuildInsertRuntimeInstanceIndex(), this.updateAutoQualityContext({
|
|
3374
3391
|
visibleVertexCount: this.meta.lineCount + this.meta.fillCount + this.meta.dotCount,
|
|
3375
3392
|
zoom: this.autoQualityContext.zoom
|
|
3376
3393
|
}), this.notifyInternalChange();
|
|
@@ -3425,7 +3442,7 @@ class fe extends J {
|
|
|
3425
3442
|
sizeAttenuation: !1,
|
|
3426
3443
|
depthTest: !1,
|
|
3427
3444
|
depthWrite: !1
|
|
3428
|
-
}), c =
|
|
3445
|
+
}), c = Ea(o, {
|
|
3429
3446
|
pointWorldSize: a,
|
|
3430
3447
|
viewportHeight: this.lineResolution.height
|
|
3431
3448
|
});
|
|
@@ -3456,7 +3473,7 @@ class fe extends J {
|
|
|
3456
3473
|
i.userData.annotationOverlay = !0, i.visible = this.annotationOverlayVisible, this.applyColorToTextRenderable(i, this.colorOverridesByIndex.get(e.li) ?? null), r.add(i), this.markTextBatchBoundsDirty(r);
|
|
3457
3474
|
const s = this.annotationTextRenderablesByLayerIndex.get(e.li) ?? [];
|
|
3458
3475
|
s.push(i), this.annotationTextRenderablesByLayerIndex.set(e.li, s);
|
|
3459
|
-
const a =
|
|
3476
|
+
const a = ye.getTextOwnerKey(e), o = {
|
|
3460
3477
|
renderable: i,
|
|
3461
3478
|
layerIndex: e.li,
|
|
3462
3479
|
ownerKey: a,
|
|
@@ -3684,7 +3701,7 @@ class fe extends J {
|
|
|
3684
3701
|
}
|
|
3685
3702
|
createRenderableTextChunk(e) {
|
|
3686
3703
|
const r = Yr, i = this.resolveTextFont(e.t), s = new r();
|
|
3687
|
-
s.text = i.text, s.fontSize = e.h, s.position.set(e.x, e.y, 0), s.rotation.z = (e.r || 0) * Math.PI / 180, s.color = this.resolveDisplayHexForRgb(e.c, e.li, "text"), s.anchorX =
|
|
3704
|
+
s.text = i.text, s.fontSize = e.h, s.position.set(e.x, e.y, 0), s.rotation.z = (e.r || 0) * Math.PI / 180, s.color = this.resolveDisplayHexForRgb(e.c, e.li, "text"), s.anchorX = ye.resolveTextAnchorX(e.ha), s.anchorY = ye.resolveTextAnchorY(e.va), i.fontUrl && (s.font = i.fontUrl), e.w && (s.maxWidth = e.w), e.lh && (s.lineHeight = e.lh);
|
|
3688
3705
|
const a = e.wf || 1;
|
|
3689
3706
|
return s.scale.x = (e.mx ? -1 : 1) * a, e.my && (s.scale.y = -1), this.commitTroikaTextTransform(s), s.name = "text-chunk", s.userData.kind = "text", s.userData.layerIndex = e.li, s.userData.text = { ...e, c: U(e.c) }, s.userData.renderedText = i.text, s.userData.fontKind = i.kind ?? "default", s.userData.replacedUnsupportedText = i.replacedUnsupported === !0, s;
|
|
3690
3707
|
}
|
|
@@ -3827,7 +3844,7 @@ class fe extends J {
|
|
|
3827
3844
|
for (const o of r) {
|
|
3828
3845
|
let c = 0, l = null;
|
|
3829
3846
|
for (const x of o.records)
|
|
3830
|
-
c += x.vertexCount, l =
|
|
3847
|
+
c += x.vertexCount, l = fe(l, x.bbox);
|
|
3831
3848
|
const d = o.canonicalKind === "xy" ? 2 : 3, u = new Float32Array(c * d), h = new Uint8Array(c * 3), y = [];
|
|
3832
3849
|
let p = !0, m = 0;
|
|
3833
3850
|
for (const x of o.records)
|
|
@@ -3896,7 +3913,7 @@ class fe extends J {
|
|
|
3896
3913
|
const P = Number(((w = C.userData) == null ? void 0 : w.vertexCount) || 0);
|
|
3897
3914
|
if (P <= 0) continue;
|
|
3898
3915
|
const M = B.userData.cadDisplaySourceColor, D = B.userData.cadDisplayColorRuns;
|
|
3899
|
-
D && D.length > 0 ? Ln(d, D, a) : u = !1, a += P, c.push(V.array), l.push(M instanceof Uint8Array ? M : ds(A)), o =
|
|
3916
|
+
D && D.length > 0 ? Ln(d, D, a) : u = !1, a += P, c.push(V.array), l.push(M instanceof Uint8Array ? M : ds(A)), o = fe(o, ((x = C.userData) == null ? void 0 : x.bbox) ?? null);
|
|
3900
3917
|
}
|
|
3901
3918
|
for (const C of s)
|
|
3902
3919
|
i.remove(C), xt(C);
|
|
@@ -4069,9 +4086,9 @@ class fe extends J {
|
|
|
4069
4086
|
this.colorRefreshStats.displayRefreshVertexTotal += e.vertexCount, this.colorRefreshStats.displayRefreshRunTotal += e.runCount, this.colorRefreshStats.displayRefreshUniqueColorTotal += e.uniqueColorCount, this.colorRefreshStats.displayRefreshCacheHitTotal += e.cacheHitCount, this.colorRefreshStats.displayRefreshRepeatedRunVertexTotal += e.repeatedRunVertexCount;
|
|
4070
4087
|
}
|
|
4071
4088
|
resolveDisplayHexForRgb(e, r, i) {
|
|
4072
|
-
const s =
|
|
4089
|
+
const s = Ra(e, r, i, this.displayThemeName, this.displayContrastEnhancement), a = this.displayHexMemo.get(s);
|
|
4073
4090
|
if (a !== void 0) return a;
|
|
4074
|
-
const o =
|
|
4091
|
+
const o = wa(this.resolveDisplayRgbForLegacyRgb(e, r, i));
|
|
4075
4092
|
return this.displayHexMemo.set(s, o), o;
|
|
4076
4093
|
}
|
|
4077
4094
|
resolveDisplayRgbForLegacyRgb(e, r, i) {
|
|
@@ -4124,7 +4141,7 @@ class fe extends J {
|
|
|
4124
4141
|
vertexColors: !0,
|
|
4125
4142
|
size: 2,
|
|
4126
4143
|
sizeAttenuation: !1
|
|
4127
|
-
}),
|
|
4144
|
+
}), Ba(r), r;
|
|
4128
4145
|
}
|
|
4129
4146
|
clearViewportInsertPresenter() {
|
|
4130
4147
|
var e, r;
|
|
@@ -4266,7 +4283,7 @@ async function Rr(t, n, e) {
|
|
|
4266
4283
|
throw new Error(`Scene annotation count mismatch for ${r}`);
|
|
4267
4284
|
return a;
|
|
4268
4285
|
}
|
|
4269
|
-
async function
|
|
4286
|
+
async function Sa(t, n, e, r, i) {
|
|
4270
4287
|
if (e.externalVariantFetchSource !== void 0 || e.externalVariantBuffers !== void 0 || e.requiredExternalVariantIds !== void 0 || e.externalVariantGeometryFetchIds !== void 0)
|
|
4271
4288
|
return { annotations: [] };
|
|
4272
4289
|
const s = vr(t);
|
|
@@ -4305,7 +4322,7 @@ function Fn(t) {
|
|
|
4305
4322
|
worldUnitsPerPixel: t.worldUnitsPerPixel
|
|
4306
4323
|
};
|
|
4307
4324
|
}
|
|
4308
|
-
async function
|
|
4325
|
+
async function Va(t, n, e) {
|
|
4309
4326
|
if (!e.externalVariantBuffers && !e.externalVariantFetchSource)
|
|
4310
4327
|
throw new Error("External variant delta requires buffers or fetch source");
|
|
4311
4328
|
await is(t, n, void 0, {
|
|
@@ -4321,31 +4338,31 @@ async function Sa(t, n, e) {
|
|
|
4321
4338
|
externalVariantDeltaOnly: !0
|
|
4322
4339
|
});
|
|
4323
4340
|
}
|
|
4324
|
-
function
|
|
4341
|
+
function Ao(t) {
|
|
4325
4342
|
return zr(t);
|
|
4326
4343
|
}
|
|
4327
|
-
const
|
|
4344
|
+
const Pa = {
|
|
4328
4345
|
deferExternalVariantGeometry: !0
|
|
4329
4346
|
};
|
|
4330
|
-
function
|
|
4331
|
-
return Dt(t,
|
|
4347
|
+
function ka(t) {
|
|
4348
|
+
return Dt(t, Pa).header;
|
|
4332
4349
|
}
|
|
4333
|
-
function
|
|
4350
|
+
function Eo(t) {
|
|
4334
4351
|
return Hr(t);
|
|
4335
4352
|
}
|
|
4336
|
-
function
|
|
4353
|
+
function So(t) {
|
|
4337
4354
|
return qr(t);
|
|
4338
4355
|
}
|
|
4339
|
-
function
|
|
4356
|
+
function Vo(t, n) {
|
|
4340
4357
|
return He(t, n);
|
|
4341
4358
|
}
|
|
4342
|
-
function
|
|
4359
|
+
function Po(t) {
|
|
4343
4360
|
return Ot(t);
|
|
4344
4361
|
}
|
|
4345
|
-
function
|
|
4362
|
+
function ko(t, n) {
|
|
4346
4363
|
return _t(t, n);
|
|
4347
4364
|
}
|
|
4348
|
-
function
|
|
4365
|
+
function To(t, n) {
|
|
4349
4366
|
if (!n.externalVariantBuffers && !n.externalVariantFetchSource)
|
|
4350
4367
|
throw new Error("External variant delta requires buffers or fetch source");
|
|
4351
4368
|
const e = Dt(t, {
|
|
@@ -4359,10 +4376,10 @@ function ko(t, n) {
|
|
|
4359
4376
|
chunks: Array.from(e.chunks)
|
|
4360
4377
|
};
|
|
4361
4378
|
}
|
|
4362
|
-
function
|
|
4379
|
+
function Lo(t) {
|
|
4363
4380
|
ei(t);
|
|
4364
4381
|
}
|
|
4365
|
-
function
|
|
4382
|
+
function Ta(t) {
|
|
4366
4383
|
return t instanceof Error ? t : typeof t == "string" ? new Error(t) : new Error(`Unknown geo load error: ${String(t)}`);
|
|
4367
4384
|
}
|
|
4368
4385
|
function Jt(t) {
|
|
@@ -4373,8 +4390,8 @@ function re(t) {
|
|
|
4373
4390
|
if (t !== void 0)
|
|
4374
4391
|
return new Set(t);
|
|
4375
4392
|
}
|
|
4376
|
-
function
|
|
4377
|
-
const e = new AbortController(), r = Je(t, e.signal), i = new
|
|
4393
|
+
function Mo(t, n = {}) {
|
|
4394
|
+
const e = new AbortController(), r = Je(t, e.signal), i = new ye({ resolveTextFont: n.resolveTextFont }), s = [
|
|
4378
4395
|
de(n.signal, e),
|
|
4379
4396
|
de(r.sourceSignal, e)
|
|
4380
4397
|
];
|
|
@@ -4389,7 +4406,7 @@ function Lo(t, n = {}) {
|
|
|
4389
4406
|
jt(r.source),
|
|
4390
4407
|
e.signal,
|
|
4391
4408
|
"CAD load aborted before decoding"
|
|
4392
|
-
), u = await
|
|
4409
|
+
), u = await Sa(
|
|
4393
4410
|
r.source,
|
|
4394
4411
|
d,
|
|
4395
4412
|
n,
|
|
@@ -4411,30 +4428,30 @@ function Lo(t, n = {}) {
|
|
|
4411
4428
|
...h
|
|
4412
4429
|
});
|
|
4413
4430
|
} catch (d) {
|
|
4414
|
-
i._fail(
|
|
4431
|
+
i._fail(Ta(d));
|
|
4415
4432
|
} finally {
|
|
4416
4433
|
for (const d of s) d();
|
|
4417
4434
|
Ye(i, null);
|
|
4418
4435
|
}
|
|
4419
4436
|
})(), i;
|
|
4420
4437
|
}
|
|
4421
|
-
const
|
|
4438
|
+
const La = 40;
|
|
4422
4439
|
function Br(t) {
|
|
4423
4440
|
return !!(t && Number.isFinite(t.minX) && Number.isFinite(t.minY) && Number.isFinite(t.maxX) && Number.isFinite(t.maxY) && t.maxX >= t.minX && t.maxY >= t.minY);
|
|
4424
4441
|
}
|
|
4425
|
-
function
|
|
4442
|
+
function Ma(t, n, e) {
|
|
4426
4443
|
return n.x >= t.minX - e && n.x <= t.maxX + e && n.y >= t.minY - e && n.y <= t.maxY + e;
|
|
4427
4444
|
}
|
|
4428
|
-
function
|
|
4445
|
+
function Da(t, n) {
|
|
4429
4446
|
return n.minX >= t.minX && n.maxX <= t.maxX && n.minY >= t.minY && n.maxY <= t.maxY;
|
|
4430
4447
|
}
|
|
4431
|
-
function
|
|
4448
|
+
function Do(t, n) {
|
|
4432
4449
|
return t.layerIndex === n.layerIndex && t.variantId === n.variantId && t.instanceId === n.instanceId;
|
|
4433
4450
|
}
|
|
4434
|
-
function
|
|
4451
|
+
function Fa(t, n, e = {}) {
|
|
4435
4452
|
var a;
|
|
4436
4453
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) return null;
|
|
4437
|
-
const r = Math.max(0, e.padding ??
|
|
4454
|
+
const r = Math.max(0, e.padding ?? La), i = t.getLayers();
|
|
4438
4455
|
let s = null;
|
|
4439
4456
|
for (let o = i.length - 1; o >= 0; o -= 1) {
|
|
4440
4457
|
const c = i[o];
|
|
@@ -4444,14 +4461,14 @@ function Da(t, n, e = {}) {
|
|
|
4444
4461
|
const u = l[d];
|
|
4445
4462
|
for (let h = u.inserts.length - 1; h >= 0; h -= 1) {
|
|
4446
4463
|
const y = u.inserts[h];
|
|
4447
|
-
if (!y.canHighlight || !Br(y.bbox) || ((a = e.isInstanceVisible) == null ? void 0 : a.call(e, y.instanceId)) === !1 || !
|
|
4464
|
+
if (!y.canHighlight || !Br(y.bbox) || ((a = e.isInstanceVisible) == null ? void 0 : a.call(e, y.instanceId)) === !1 || !Ma(y.bbox, n, r)) continue;
|
|
4448
4465
|
const p = {
|
|
4449
4466
|
kind: "insert",
|
|
4450
4467
|
layerIndex: c.index,
|
|
4451
4468
|
variantId: u.variantId,
|
|
4452
4469
|
instanceId: y.instanceId
|
|
4453
4470
|
};
|
|
4454
|
-
if (s || (s = p), !e.viewport ||
|
|
4471
|
+
if (s || (s = p), !e.viewport || Da(e.viewport, y.bbox)) return p;
|
|
4455
4472
|
}
|
|
4456
4473
|
}
|
|
4457
4474
|
}
|
|
@@ -4475,31 +4492,31 @@ function pt(t, n) {
|
|
|
4475
4492
|
bbox: Object.freeze({ ...r.bbox })
|
|
4476
4493
|
};
|
|
4477
4494
|
}
|
|
4478
|
-
const
|
|
4479
|
-
function
|
|
4480
|
-
const n = t.w ?? t.t.length * t.h *
|
|
4495
|
+
const Oa = 0.6;
|
|
4496
|
+
function _a(t) {
|
|
4497
|
+
const n = t.w ?? t.t.length * t.h * Oa, e = t.h * (t.lh || 1);
|
|
4481
4498
|
let r = 0;
|
|
4482
4499
|
t.ha === "center" ? r = -n / 2 : t.ha === "right" && (r = -n);
|
|
4483
4500
|
let i = 0;
|
|
4484
4501
|
return t.va === "middle" ? i = -e / 2 : t.va === "top" && (i = -e), { x0: r, y0: i, x1: r + n, y1: i + e };
|
|
4485
4502
|
}
|
|
4486
|
-
function
|
|
4503
|
+
function Ua(t, n, e) {
|
|
4487
4504
|
const r = t.x - n.x, i = t.y - n.y, s = (n.r || 0) * Math.PI / 180, a = Math.cos(-s), o = Math.sin(-s), c = r * a - i * o, l = r * o + i * a;
|
|
4488
4505
|
return c >= e.x0 && c <= e.x1 && l >= e.y0 && l <= e.y1;
|
|
4489
4506
|
}
|
|
4490
|
-
function
|
|
4507
|
+
function Ga(t, n, e = {}) {
|
|
4491
4508
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) return null;
|
|
4492
4509
|
const r = t.getTextEntries(), i = e.maxTextCount;
|
|
4493
4510
|
if (r.length === 0) return null;
|
|
4494
4511
|
const s = t.getLayers(), a = i === void 0 ? r.length - 1 : Math.min(r.length, Math.max(0, Math.floor(i))) - 1;
|
|
4495
4512
|
for (let o = a; o >= 0; o -= 1) {
|
|
4496
4513
|
const c = r[o], l = s.find((d) => d.index === c.li);
|
|
4497
|
-
if (!(l && l.visible === !1) &&
|
|
4514
|
+
if (!(l && l.visible === !1) && Ua(n, c, _a(c)))
|
|
4498
4515
|
return { kind: "text", textId: o };
|
|
4499
4516
|
}
|
|
4500
4517
|
return null;
|
|
4501
4518
|
}
|
|
4502
|
-
function
|
|
4519
|
+
function Na(t, n) {
|
|
4503
4520
|
if (n.kind !== "text" || !Number.isInteger(n.textId) || n.textId < 0) return null;
|
|
4504
4521
|
const e = t.getTextEntries()[n.textId];
|
|
4505
4522
|
if (!e) return null;
|
|
@@ -4515,10 +4532,10 @@ function Ga(t, n) {
|
|
|
4515
4532
|
layerIndex: e.li
|
|
4516
4533
|
};
|
|
4517
4534
|
}
|
|
4518
|
-
function
|
|
4535
|
+
function Fo(t, n) {
|
|
4519
4536
|
return (t == null ? void 0 : t.kind) === "text" && (n == null ? void 0 : n.kind) === "text" && t.textId === n.textId;
|
|
4520
4537
|
}
|
|
4521
|
-
const
|
|
4538
|
+
const Oo = [
|
|
4522
4539
|
"created",
|
|
4523
4540
|
"header-ready",
|
|
4524
4541
|
"initial-loading",
|
|
@@ -4526,7 +4543,7 @@ const Fo = [
|
|
|
4526
4543
|
"failed",
|
|
4527
4544
|
"disposed"
|
|
4528
4545
|
], kt = "insert:";
|
|
4529
|
-
function
|
|
4546
|
+
function za(t) {
|
|
4530
4547
|
return `${kt}${t.layerIndex}:${t.variantId}:${t.instanceId}`;
|
|
4531
4548
|
}
|
|
4532
4549
|
function Ar(t) {
|
|
@@ -4539,7 +4556,7 @@ function Ar(t) {
|
|
|
4539
4556
|
const n = Number(t);
|
|
4540
4557
|
return Number.isInteger(n) ? { instanceId: n } : null;
|
|
4541
4558
|
}
|
|
4542
|
-
function
|
|
4559
|
+
function Ha(t) {
|
|
4543
4560
|
const n = Ar(t);
|
|
4544
4561
|
return n ? n.instanceId : null;
|
|
4545
4562
|
}
|
|
@@ -4567,7 +4584,7 @@ function On(t, n) {
|
|
|
4567
4584
|
planar: t.planar && n.planar
|
|
4568
4585
|
} : t : n;
|
|
4569
4586
|
}
|
|
4570
|
-
function
|
|
4587
|
+
function qa(t) {
|
|
4571
4588
|
let n = 0, e = 0;
|
|
4572
4589
|
return t.traverse((r) => {
|
|
4573
4590
|
if (!Sr(r) || !Er(r)) return;
|
|
@@ -4576,14 +4593,14 @@ function Ha(t) {
|
|
|
4576
4593
|
Number.isFinite(i) && i > 0 && (e += i);
|
|
4577
4594
|
}), { renderableCount: n, submittedVertexRefs: e };
|
|
4578
4595
|
}
|
|
4579
|
-
const
|
|
4596
|
+
const Ka = {
|
|
4580
4597
|
line: "线",
|
|
4581
4598
|
fill: "填充",
|
|
4582
4599
|
dot: "点",
|
|
4583
4600
|
text: "文字",
|
|
4584
4601
|
insertPresenter: "INSERT Presenter",
|
|
4585
4602
|
other: "其它"
|
|
4586
|
-
},
|
|
4603
|
+
}, Xa = [
|
|
4587
4604
|
"line",
|
|
4588
4605
|
"fill",
|
|
4589
4606
|
"dot",
|
|
@@ -4591,19 +4608,19 @@ const qa = {
|
|
|
4591
4608
|
"insertPresenter",
|
|
4592
4609
|
"other"
|
|
4593
4610
|
];
|
|
4594
|
-
function
|
|
4611
|
+
function Wa(t) {
|
|
4595
4612
|
var e;
|
|
4596
4613
|
if (((e = t.userData) == null ? void 0 : e.insertPresenterMesh) === !0) return "insertPresenter";
|
|
4597
4614
|
const n = t.userData.kind;
|
|
4598
4615
|
return n === "line" ? "line" : n === "fill" ? "fill" : n === "dot" ? "dot" : n === "text" || n === "text-batch" || t.name === "text-batch" || t.name === "annotation-text-batch" || t.name === "text-chunk" ? "text" : "other";
|
|
4599
4616
|
}
|
|
4600
|
-
function
|
|
4617
|
+
function Ya(t) {
|
|
4601
4618
|
const n = /* @__PURE__ */ new Map();
|
|
4602
4619
|
return t.traverse((e) => {
|
|
4603
4620
|
if (!Sr(e) || !Er(e)) return;
|
|
4604
|
-
const r =
|
|
4621
|
+
const r = Wa(e), i = n.get(r) ?? {
|
|
4605
4622
|
kind: r,
|
|
4606
|
-
label:
|
|
4623
|
+
label: Ka[r],
|
|
4607
4624
|
renderables: 0,
|
|
4608
4625
|
submittedVertexRefs: 0
|
|
4609
4626
|
};
|
|
@@ -4611,7 +4628,7 @@ function Wa(t) {
|
|
|
4611
4628
|
const s = Number(e.userData.vertexCount);
|
|
4612
4629
|
Number.isFinite(s) && s > 0 && (i.submittedVertexRefs += s), n.set(r, i);
|
|
4613
4630
|
}), {
|
|
4614
|
-
renderDebugBreakdown:
|
|
4631
|
+
renderDebugBreakdown: Xa.map((e) => n.get(e)).filter((e) => e !== void 0)
|
|
4615
4632
|
};
|
|
4616
4633
|
}
|
|
4617
4634
|
function Er(t) {
|
|
@@ -4626,8 +4643,8 @@ function Sr(t) {
|
|
|
4626
4643
|
}
|
|
4627
4644
|
return !0;
|
|
4628
4645
|
}
|
|
4629
|
-
const
|
|
4630
|
-
function
|
|
4646
|
+
const Qa = 8;
|
|
4647
|
+
function $a(t) {
|
|
4631
4648
|
const n = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
|
|
4632
4649
|
for (const a of t.getLayers())
|
|
4633
4650
|
for (const o of t.getLayerBlockUsages(a.index)) {
|
|
@@ -4654,10 +4671,10 @@ function Qa(t) {
|
|
|
4654
4671
|
blockVariantCount: n.size,
|
|
4655
4672
|
blockInstanceCount: r.size,
|
|
4656
4673
|
splitBlockLayerGroupCount: s.length,
|
|
4657
|
-
splitBlockLayerDetails: s.slice(0,
|
|
4674
|
+
splitBlockLayerDetails: s.slice(0, Qa)
|
|
4658
4675
|
};
|
|
4659
4676
|
}
|
|
4660
|
-
function
|
|
4677
|
+
function ja(t) {
|
|
4661
4678
|
let n = 0, e = null, r = 0;
|
|
4662
4679
|
const { node: i, hiddenInstanceIds: s } = t, a = () => {
|
|
4663
4680
|
e && i.refreshInsertPresenter(
|
|
@@ -4673,7 +4690,7 @@ function $a(t) {
|
|
|
4673
4690
|
var y;
|
|
4674
4691
|
let h = !1;
|
|
4675
4692
|
for (const p of u) {
|
|
4676
|
-
const m =
|
|
4693
|
+
const m = Ha(p.insertId);
|
|
4677
4694
|
m !== null && (p.visible ? s.delete(m) && (h = !0) : s.has(m) || (s.add(m), h = !0));
|
|
4678
4695
|
}
|
|
4679
4696
|
h && (r += 1, i.invalidateInsertPresenterQueryCache(), a(), t.onInsertVisibilityChange(), (y = i._notifyStructureChange) == null || y.call(i));
|
|
@@ -4751,7 +4768,7 @@ function $a(t) {
|
|
|
4751
4768
|
} : null;
|
|
4752
4769
|
},
|
|
4753
4770
|
getDiagnostics() {
|
|
4754
|
-
const u = i.getMeta(), h =
|
|
4771
|
+
const u = i.getMeta(), h = qa(i), y = Ya(i), p = $a(i);
|
|
4755
4772
|
return {
|
|
4756
4773
|
entityCount: u.entityCount,
|
|
4757
4774
|
lineCount: u.lineCount,
|
|
@@ -4772,10 +4789,10 @@ function $a(t) {
|
|
|
4772
4789
|
}
|
|
4773
4790
|
};
|
|
4774
4791
|
}
|
|
4775
|
-
const
|
|
4792
|
+
const Za = 450, Vr = 250, Ja = 0.25;
|
|
4776
4793
|
function _n(t) {
|
|
4777
4794
|
return !t.manifestBBox || !t.viewport || !Number.isFinite(t.worldUnitsPerPixel) || t.worldUnitsPerPixel <= 0 || t.worldUnitsPerPixel > Vr ? !1 : zn(
|
|
4778
|
-
je(t.viewport,
|
|
4795
|
+
je(t.viewport, Ja),
|
|
4779
4796
|
t.manifestBBox
|
|
4780
4797
|
);
|
|
4781
4798
|
}
|
|
@@ -4789,7 +4806,7 @@ function gt(t) {
|
|
|
4789
4806
|
function Gn(t) {
|
|
4790
4807
|
return Number.isFinite(t) && t > 0 && t <= Vr;
|
|
4791
4808
|
}
|
|
4792
|
-
function
|
|
4809
|
+
function eo(t) {
|
|
4793
4810
|
const n = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Set();
|
|
4794
4811
|
let r = !1;
|
|
4795
4812
|
return {
|
|
@@ -4800,7 +4817,7 @@ function Ja(t) {
|
|
|
4800
4817
|
const c = { family: void 0 }, l = "";
|
|
4801
4818
|
if (e.has(l)) return a;
|
|
4802
4819
|
let d = n.get(l);
|
|
4803
|
-
return d || (d = { promise: o.resolve(c, t.signal).then((y) => (d && (d.resolved = y), y != null && y.fontUrl &&
|
|
4820
|
+
return d || (d = { promise: o.resolve(c, t.signal).then((y) => (d && (d.resolved = y), y != null && y.fontUrl && ro(y.fontUrl, a.text, t.signal).catch((p) => {
|
|
4804
4821
|
t.onNonFatalError(p instanceof Error ? p : new Error(String(p)));
|
|
4805
4822
|
}), y)).catch((y) => (e.add(l), t.onNonFatalError(y instanceof Error ? y : new Error(String(y))), null)), resolved: null }, n.set(l, d)), (u = d.resolved) != null && u.fontUrl ? { ...a, fontUrl: d.resolved.fontUrl, kind: d.resolved.family } : a;
|
|
4806
4823
|
},
|
|
@@ -4809,21 +4826,21 @@ function Ja(t) {
|
|
|
4809
4826
|
}
|
|
4810
4827
|
};
|
|
4811
4828
|
}
|
|
4812
|
-
const
|
|
4813
|
-
function
|
|
4829
|
+
const to = 8e3;
|
|
4830
|
+
function no(t) {
|
|
4814
4831
|
return typeof t == "object" && t !== null && typeof t.then == "function";
|
|
4815
4832
|
}
|
|
4816
|
-
function
|
|
4833
|
+
function ro(t, n, e) {
|
|
4817
4834
|
return typeof qe != "function" || e.aborted ? Promise.resolve() : new Promise((r, i) => {
|
|
4818
4835
|
let s = !1;
|
|
4819
4836
|
const a = (c) => {
|
|
4820
4837
|
s || (s = !0, globalThis.clearTimeout(o), c());
|
|
4821
4838
|
}, o = globalThis.setTimeout(() => {
|
|
4822
4839
|
a(() => i(new Error(`Troika font warmup timed out for ${t}`)));
|
|
4823
|
-
},
|
|
4840
|
+
}, to);
|
|
4824
4841
|
try {
|
|
4825
4842
|
const c = qe({ font: t, characters: n }, () => a(r));
|
|
4826
|
-
|
|
4843
|
+
no(c) && c.then(
|
|
4827
4844
|
() => a(r),
|
|
4828
4845
|
(l) => a(() => i(l instanceof Error ? l : new Error(String(l))))
|
|
4829
4846
|
);
|
|
@@ -4832,22 +4849,22 @@ function no(t, n, e) {
|
|
|
4832
4849
|
}
|
|
4833
4850
|
});
|
|
4834
4851
|
}
|
|
4835
|
-
const
|
|
4836
|
-
function
|
|
4852
|
+
const io = 600, so = 256, ao = 8e3, oo = 96;
|
|
4853
|
+
function lo(t) {
|
|
4837
4854
|
return [...new Set(t)].sort((n, e) => {
|
|
4838
4855
|
const r = n.codePointAt(0) ?? 0, i = e.codePointAt(0) ?? 0;
|
|
4839
4856
|
return r - i;
|
|
4840
4857
|
}).join("");
|
|
4841
4858
|
}
|
|
4842
|
-
function
|
|
4859
|
+
function co(t) {
|
|
4843
4860
|
return typeof t == "object" && t !== null && typeof t.then == "function";
|
|
4844
4861
|
}
|
|
4845
|
-
function
|
|
4862
|
+
function uo() {
|
|
4846
4863
|
return typeof globalThis.document < "u" && typeof qe == "function";
|
|
4847
4864
|
}
|
|
4848
|
-
function
|
|
4865
|
+
function ho(t) {
|
|
4849
4866
|
var w, x, C, S;
|
|
4850
|
-
const n = ((w = t.options) == null ? void 0 : w.idleDelayMs) ??
|
|
4867
|
+
const n = ((w = t.options) == null ? void 0 : w.idleDelayMs) ?? io, e = ((x = t.options) == null ? void 0 : x.maxUniqueCharsPerFont) ?? so, r = ((C = t.options) == null ? void 0 : C.timeoutMs) ?? ao, i = ((S = t.options) == null ? void 0 : S.signatureCacheLimit) ?? oo, s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
4851
4868
|
let c = null, l = !1;
|
|
4852
4869
|
const d = {
|
|
4853
4870
|
scheduledTexts: 0,
|
|
@@ -4874,7 +4891,7 @@ function uo(t) {
|
|
|
4874
4891
|
}, r);
|
|
4875
4892
|
try {
|
|
4876
4893
|
const L = qe({ font: B, characters: V }, () => D(A));
|
|
4877
|
-
|
|
4894
|
+
co(L) && L.then(
|
|
4878
4895
|
() => D(A),
|
|
4879
4896
|
(X) => D(() => P(X instanceof Error ? X : new Error(String(X))))
|
|
4880
4897
|
);
|
|
@@ -4906,10 +4923,10 @@ ${V}`;
|
|
|
4906
4923
|
const B = [...s.entries()];
|
|
4907
4924
|
s.clear();
|
|
4908
4925
|
for (const [V, A] of B)
|
|
4909
|
-
A.size !== 0 && y(V,
|
|
4926
|
+
A.size !== 0 && y(V, lo([...A].join("")));
|
|
4910
4927
|
}
|
|
4911
4928
|
function m(B) {
|
|
4912
|
-
if (!(l || B.length === 0) &&
|
|
4929
|
+
if (!(l || B.length === 0) && uo() && !t.signal.aborted) {
|
|
4913
4930
|
d.scheduledTexts += B.length;
|
|
4914
4931
|
for (const V of B) {
|
|
4915
4932
|
const A = t.resolveTextFont(V);
|
|
@@ -4940,7 +4957,7 @@ ${V}`;
|
|
|
4940
4957
|
};
|
|
4941
4958
|
}
|
|
4942
4959
|
const Pr = 0.25, Nn = 0.125;
|
|
4943
|
-
function
|
|
4960
|
+
function fo(t) {
|
|
4944
4961
|
const { viewport: n, worldUnitsPerPixel: e } = t;
|
|
4945
4962
|
if (!n || !Number.isFinite(e) || e <= 0 || !Number.isFinite(n.minX) || !Number.isFinite(n.minY) || !Number.isFinite(n.maxX) || !Number.isFinite(n.maxY) || n.maxX <= n.minX || n.maxY <= n.minY)
|
|
4946
4963
|
return null;
|
|
@@ -4961,10 +4978,10 @@ function kr(t, n) {
|
|
|
4961
4978
|
const e = n / t;
|
|
4962
4979
|
return e >= 1 - Nn && e <= 1 + Nn;
|
|
4963
4980
|
}
|
|
4964
|
-
function
|
|
4981
|
+
function yo(t) {
|
|
4965
4982
|
return !t.viewport || !t.coverage || !Ft(t.coverage, t.viewport) || !kr(t.coverageWorldUnitsPerPixel, t.worldUnitsPerPixel) ? !1 : t.coverageHiddenSignature === t.hiddenSignature;
|
|
4966
4983
|
}
|
|
4967
|
-
function
|
|
4984
|
+
function mo(t) {
|
|
4968
4985
|
return !t.latestViewport || !Ft(
|
|
4969
4986
|
je(t.requestedViewport, Pr),
|
|
4970
4987
|
t.latestViewport
|
|
@@ -4978,13 +4995,13 @@ function De(t, n, e) {
|
|
|
4978
4995
|
};
|
|
4979
4996
|
}
|
|
4980
4997
|
const Tt = /* @__PURE__ */ new WeakMap();
|
|
4981
|
-
function
|
|
4998
|
+
function _o(t) {
|
|
4982
4999
|
const n = Tt.get(t);
|
|
4983
5000
|
if (!n)
|
|
4984
5001
|
throw new Error("CAD document session has no render resource");
|
|
4985
5002
|
return n;
|
|
4986
5003
|
}
|
|
4987
|
-
function
|
|
5004
|
+
function Uo(t, n = {}) {
|
|
4988
5005
|
return new Lt(t, n);
|
|
4989
5006
|
}
|
|
4990
5007
|
const $e = class $e {
|
|
@@ -5043,18 +5060,18 @@ const $e = class $e {
|
|
|
5043
5060
|
f(this, "handleBeforeTextAppend", (n) => {
|
|
5044
5061
|
this.scheduleTextWarmup(n);
|
|
5045
5062
|
});
|
|
5046
|
-
this.sessionEpoch = $e.nextEpoch++, this.documentKey = e.documentKey ?? null, this.filename = e.filename ?? null, this.loadAnnotations = e.loadAnnotations !== !1, this.workerUrl = e.workerUrl, this.workerFactory = e.workerFactory, this.fontRuntime =
|
|
5063
|
+
this.sessionEpoch = $e.nextEpoch++, this.documentKey = e.documentKey ?? null, this.filename = e.filename ?? null, this.loadAnnotations = e.loadAnnotations !== !1, this.workerUrl = e.workerUrl, this.workerFactory = e.workerFactory, this.fontRuntime = eo({
|
|
5047
5064
|
fontResolver: e.fontResolver,
|
|
5048
5065
|
signal: this.sessionAbort.signal,
|
|
5049
5066
|
onNonFatalError: (i) => this.emit("non-fatal-error", { error: i })
|
|
5050
|
-
}), this.resolveTextFont = e.resolveTextFont ?? this.fontRuntime.resolveTextFont, this.textWarmup = e.textWarmup === !1 ? null :
|
|
5067
|
+
}), this.resolveTextFont = e.resolveTextFont ?? this.fontRuntime.resolveTextFont, this.textWarmup = e.textWarmup === !1 ? null : ho({
|
|
5051
5068
|
resolveTextFont: this.resolveTextFont,
|
|
5052
5069
|
signal: this.sessionAbort.signal,
|
|
5053
5070
|
options: typeof e.textWarmup == "object" ? e.textWarmup : void 0
|
|
5054
|
-
}), this.node = new
|
|
5071
|
+
}), this.node = new ye({
|
|
5055
5072
|
resolveTextFont: this.resolveTextFont
|
|
5056
5073
|
}), this.node.ready.catch(() => {
|
|
5057
|
-
}), this.renderNode =
|
|
5074
|
+
}), this.renderNode = ja({
|
|
5058
5075
|
node: this.node,
|
|
5059
5076
|
getHeaderBounds: () => this.headerBounds,
|
|
5060
5077
|
getUnmountedBounds: () => this.unmountedExternalBounds(),
|
|
@@ -5123,7 +5140,7 @@ const $e = class $e {
|
|
|
5123
5140
|
instanceId: i.instanceId
|
|
5124
5141
|
};
|
|
5125
5142
|
n.push({
|
|
5126
|
-
insertId:
|
|
5143
|
+
insertId: za(s),
|
|
5127
5144
|
blockName: r.blockName || `block#${r.variantId}`,
|
|
5128
5145
|
layerName: e.name,
|
|
5129
5146
|
layerIndex: e.index,
|
|
@@ -5141,7 +5158,7 @@ const $e = class $e {
|
|
|
5141
5158
|
return e ? "kind" in e ? pt(this.node, e) : this.findInsertDetailsByInstanceId(e.instanceId) : null;
|
|
5142
5159
|
}
|
|
5143
5160
|
pickInsertAtPoint(n, e) {
|
|
5144
|
-
const r =
|
|
5161
|
+
const r = Fa(
|
|
5145
5162
|
this.node,
|
|
5146
5163
|
{ x: n.x, y: n.y },
|
|
5147
5164
|
{
|
|
@@ -5156,11 +5173,11 @@ const $e = class $e {
|
|
|
5156
5173
|
} : null;
|
|
5157
5174
|
}
|
|
5158
5175
|
pickTextAtPoint(n) {
|
|
5159
|
-
const e =
|
|
5176
|
+
const e = Ga(this.node, { x: n.x, y: n.y });
|
|
5160
5177
|
return e ? {
|
|
5161
5178
|
documentKey: this.documentKey,
|
|
5162
5179
|
id: e,
|
|
5163
|
-
details:
|
|
5180
|
+
details: Na(this.node, e)
|
|
5164
5181
|
} : null;
|
|
5165
5182
|
}
|
|
5166
5183
|
abort(n) {
|
|
@@ -5186,8 +5203,8 @@ const $e = class $e {
|
|
|
5186
5203
|
"CAD load aborted before decoding"
|
|
5187
5204
|
);
|
|
5188
5205
|
if (!this.isCurrent(n)) return;
|
|
5189
|
-
this.mainBuffer = e, this.sourceFingerprint = this.documentKey ??
|
|
5190
|
-
const r =
|
|
5206
|
+
this.mainBuffer = e, this.sourceFingerprint = this.documentKey ?? xo(e), this.baseUrl = this.normalizedSource ? vr(this.normalizedSource) : null;
|
|
5207
|
+
const r = ka(e), i = this.toDocumentHeader(r);
|
|
5191
5208
|
if (this.header = i, this.headerBounds = i.bounds, this.annotationManifest = this.loadAnnotations ? Ot(e) : null, this.setPhase("header-ready"), this.emit("header", { header: i }), this.setPhase("initial-loading"), this.resolveHeader(i), await Promise.resolve(), !this.isCurrent(n)) return;
|
|
5192
5209
|
const s = this.latestDemand ?? this.pendingDemand, a = await this.prepareInitialExternalVariants(s);
|
|
5193
5210
|
if (!this.isCurrent(n) || (await ar(this.node, e.slice(0), void 0, {
|
|
@@ -5195,7 +5212,7 @@ const $e = class $e {
|
|
|
5195
5212
|
workerUrl: this.workerUrl,
|
|
5196
5213
|
workerFactory: this.workerFactory,
|
|
5197
5214
|
hiddenInstanceIds: this.hiddenInstanceIds.size > 0 ? this.hiddenInstanceIds : void 0,
|
|
5198
|
-
externalVariantBuffers:
|
|
5215
|
+
externalVariantBuffers: po(a.buffers),
|
|
5199
5216
|
requiredExternalVariantIds: a.requiredVariantIds,
|
|
5200
5217
|
beforeTextAppend: this.handleBeforeTextAppend
|
|
5201
5218
|
}), await this.node.ready, !this.isCurrent(n))) return;
|
|
@@ -5220,12 +5237,12 @@ const $e = class $e {
|
|
|
5220
5237
|
this.externalViewportQueued = !0;
|
|
5221
5238
|
return;
|
|
5222
5239
|
}
|
|
5223
|
-
if (!
|
|
5240
|
+
if (!fo({
|
|
5224
5241
|
viewport: e.documentRect,
|
|
5225
5242
|
worldUnitsPerPixel: e.worldUnitsPerPixel
|
|
5226
5243
|
})) return;
|
|
5227
5244
|
const i = bt(this.hiddenInstanceIds);
|
|
5228
|
-
if (n.force !== !0 && this.lastCoverage &&
|
|
5245
|
+
if (n.force !== !0 && this.lastCoverage && yo({
|
|
5229
5246
|
coverage: this.lastCoverage.coverage,
|
|
5230
5247
|
coverageWorldUnitsPerPixel: this.lastCoverage.worldUnitsPerPixel,
|
|
5231
5248
|
coverageHiddenSignature: this.lastCoverage.hiddenSignature,
|
|
@@ -5291,7 +5308,7 @@ const $e = class $e {
|
|
|
5291
5308
|
}
|
|
5292
5309
|
if (!this.isCurrent(r)) return;
|
|
5293
5310
|
const c = this.latestDemand;
|
|
5294
|
-
if (!c || c.interaction === "active" || !
|
|
5311
|
+
if (!c || c.interaction === "active" || !mo({
|
|
5295
5312
|
requestedViewport: n.documentRect,
|
|
5296
5313
|
requestedWorldUnitsPerPixel: n.worldUnitsPerPixel,
|
|
5297
5314
|
requestedHiddenSignature: e,
|
|
@@ -5314,7 +5331,7 @@ const $e = class $e {
|
|
|
5314
5331
|
throw this.variantCoverage.set(h, "rejected"), new Error(`External block ${h} 尚未加载。`);
|
|
5315
5332
|
d.set(h, y);
|
|
5316
5333
|
}
|
|
5317
|
-
if (await
|
|
5334
|
+
if (await Va(this.node, i, {
|
|
5318
5335
|
signal: this.demandAbort.signal,
|
|
5319
5336
|
workerUrl: this.workerUrl,
|
|
5320
5337
|
workerFactory: this.workerFactory,
|
|
@@ -5375,7 +5392,7 @@ const $e = class $e {
|
|
|
5375
5392
|
return;
|
|
5376
5393
|
}
|
|
5377
5394
|
this.shouldScheduleAnnotationLoad(r) && this.loadVisibleAnnotationsNow(r);
|
|
5378
|
-
},
|
|
5395
|
+
}, Za);
|
|
5379
5396
|
}
|
|
5380
5397
|
async loadVisibleAnnotationsNow(n) {
|
|
5381
5398
|
const e = this.sessionEpoch;
|
|
@@ -5544,7 +5561,7 @@ const $e = class $e {
|
|
|
5544
5561
|
};
|
|
5545
5562
|
f($e, "nextEpoch", 1);
|
|
5546
5563
|
let Lt = $e;
|
|
5547
|
-
function
|
|
5564
|
+
function xo(t) {
|
|
5548
5565
|
const n = new Uint8Array(t);
|
|
5549
5566
|
let e = n.byteLength >>> 0;
|
|
5550
5567
|
const r = Math.max(1, Math.floor(n.byteLength / 32));
|
|
@@ -5552,56 +5569,56 @@ function mo(t) {
|
|
|
5552
5569
|
e = Math.imul(e, 33) + (n[i] ?? 0);
|
|
5553
5570
|
return `${n.byteLength.toString(16)}-${(e >>> 0).toString(16)}`;
|
|
5554
5571
|
}
|
|
5555
|
-
function
|
|
5572
|
+
function po(t) {
|
|
5556
5573
|
return new Map(Array.from(t, ([n, e]) => [n, e.slice(0)]));
|
|
5557
5574
|
}
|
|
5558
5575
|
function It(t) {
|
|
5559
5576
|
return t instanceof Error ? t : typeof t == "string" ? new Error(t) : new Error(`Unknown CAD session error: ${String(t)}`);
|
|
5560
5577
|
}
|
|
5561
|
-
const
|
|
5578
|
+
const go = [
|
|
5562
5579
|
"updateTextEntry",
|
|
5563
5580
|
"updateInsertInstanceTransform",
|
|
5564
5581
|
"applyInsertTransform",
|
|
5565
5582
|
"editBlock"
|
|
5566
5583
|
];
|
|
5567
|
-
function
|
|
5568
|
-
return
|
|
5584
|
+
function Go(t) {
|
|
5585
|
+
return go.includes(t);
|
|
5569
5586
|
}
|
|
5570
5587
|
export {
|
|
5571
|
-
|
|
5572
|
-
|
|
5588
|
+
go as CAD_RENDER_NODE_EDIT_METHODS,
|
|
5589
|
+
Oo as CAD_SESSION_PHASES,
|
|
5573
5590
|
ia as GEO_NODE_STRUCTURE_CHANGE,
|
|
5574
|
-
|
|
5591
|
+
Bo as GEO_NODE_VISUAL_CHANGE,
|
|
5575
5592
|
O as GeoLoaderError,
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5593
|
+
ye as GeoNode,
|
|
5594
|
+
Va as appendExternalVariantDeltaToGeoNode,
|
|
5595
|
+
Lo as assertValidSourceOrThrow,
|
|
5596
|
+
Do as cadInsertSelectionEquals,
|
|
5597
|
+
Fo as cadTextSelectionEquals,
|
|
5598
|
+
Uo as createCadDocumentSession,
|
|
5599
|
+
Ro as createLoadSession,
|
|
5583
5600
|
je as expandViewportRect,
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5601
|
+
za as formatCadInsertId,
|
|
5602
|
+
_o as getCadDocumentRenderResource,
|
|
5603
|
+
Go as isCadRenderNodeEditMethod,
|
|
5604
|
+
To as loadExternalVariantDeltaFromBuffer,
|
|
5605
|
+
Mo as loadGeo,
|
|
5606
|
+
fe as mergeViewportRects,
|
|
5607
|
+
Ta as normalizeGeoError,
|
|
5608
|
+
Ao as parseBuffer,
|
|
5609
|
+
Eo as parseBufferBounds,
|
|
5610
|
+
ka as parseBufferHeader,
|
|
5594
5611
|
Ar as parseCadInsertId,
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5612
|
+
Fa as pickCadInsertAtPoint,
|
|
5613
|
+
Ga as pickCadTextAtPoint,
|
|
5614
|
+
Ho as readBlockAnnotationSidecar,
|
|
5615
|
+
Po as readBufferExternalAnnotationManifest,
|
|
5616
|
+
ko as readBufferExternalBlockAnnotations,
|
|
5617
|
+
Vo as readBufferExternalVariantDependencyPlan,
|
|
5618
|
+
So as readBufferExternalVariantManifest,
|
|
5602
5619
|
Nr as readSceneAnnotationSidecar,
|
|
5603
5620
|
pt as resolveCadInsertDetails,
|
|
5604
|
-
|
|
5621
|
+
Na as resolveCadTextDetails,
|
|
5605
5622
|
Fr as transformBBoxByInstance,
|
|
5606
5623
|
Ft as viewportRectContains,
|
|
5607
5624
|
zn as viewportRectIntersects
|