@soonspacejs/plugin-cps-soonmanager 2.15.1 → 2.15.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/dist/constants.d.ts +6 -0
- package/dist/gis-plot.utils.d.ts +7 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.esm.js +293 -141
- package/dist/index.esm.js.map +1 -0
- package/dist/semantic.utils.d.ts +4 -0
- package/dist/types.d.ts +77 -1
- package/dist/utils.d.ts +1 -0
- package/package.json +12 -9
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,8 @@ import SoonSpace, { BaseObject3D } from "soonspacejs";
|
|
|
2
2
|
import PoiRendererPlugin from "@soonspacejs/plugin-poi-renderer";
|
|
3
3
|
import EffectPlugin from "@soonspacejs/plugin-effect";
|
|
4
4
|
import AtmospherePlugin from "@soonspacejs/plugin-atmosphere";
|
|
5
|
-
import {
|
|
5
|
+
import { FdsManager } from "@soonspacejs/plugin-fds";
|
|
6
|
+
import { TerrainTilesRenderer, OverlayType, TerrainType } from "@soonspacejs/plugin-tiles";
|
|
6
7
|
import { AnimationPlayer } from "umanager-animation-parser";
|
|
7
8
|
import { Vector4, Object3D, Vector2, OrthographicCamera, MeshBasicMaterial, Mesh, PlaneGeometry, RepeatWrapping, Group, MeshStandardMaterial, BoxGeometry, Vector3, BufferGeometry, LineBasicMaterial, Line, EventDispatcher, Matrix4 } from "three";
|
|
8
9
|
import GS3DLoaderPlugin from "@soonspacejs/plugin-gs3d-loader";
|
|
@@ -24747,8 +24748,82 @@ function map(v, e) {
|
|
|
24747
24748
|
function flatMapDepth(v, e, _) {
|
|
24748
24749
|
return _ = _ === void 0 ? 1 : toInteger(_), baseFlatten(map(v, e), _);
|
|
24749
24750
|
}
|
|
24750
|
-
const META_DATA_FILE_PATH = "/SceneMetadata.json", dbBase = "/db", TREE_DATA_FILE_PATH = `${dbBase}/tree_models`, FLAT_DATA_FILE_PATH = `${dbBase}/flat_models`, POI_DATA_FILE_PATH = `${dbBase}/pois`, DATA_SOURCE_FILE_PATH = `${dbBase}/data_source`, TOPOLOGY_DATA_FILE_PATH = `${dbBase}/topology_paths`, PROPERTIES_DATA_FLEE_PATH = `${dbBase}/properties`, ANIMATIONS_DATA_FILE_PATH = `${dbBase}/animations`, MODEL_VISIONS_DATA_FILE_PATH = `${dbBase}/model_visions`, SPACES_DATA_FILE_PATH = `${dbBase}/spaces`, FLOWS_DATA_FILE_PATH = `${dbBase}/flows2`, GIS_DATA_FILE_PATH = `${dbBase}/gis_nodes`, SEMANTIC_DATA_FILE_PATH = `${dbBase}/semantic_model`, PROPERTIES_KEY = "properties", POI_PLUGIN_NAME = "poiRenderer";
|
|
24751
|
+
const META_DATA_FILE_PATH = "/SceneMetadata.json", dbBase = "/db", assetBase = "/assets", TREE_DATA_FILE_PATH = `${dbBase}/tree_models`, FLAT_DATA_FILE_PATH = `${dbBase}/flat_models`, POI_DATA_FILE_PATH = `${dbBase}/pois`, DATA_SOURCE_FILE_PATH = `${dbBase}/data_source`, TOPOLOGY_DATA_FILE_PATH = `${dbBase}/topology_paths`, PROPERTIES_DATA_FLEE_PATH = `${dbBase}/properties`, ANIMATIONS_DATA_FILE_PATH = `${dbBase}/animations`, MODEL_VISIONS_DATA_FILE_PATH = `${dbBase}/model_visions`, SPACES_DATA_FILE_PATH = `${dbBase}/spaces`, FLOWS_DATA_FILE_PATH = `${dbBase}/flows2`, GIS_DATA_FILE_PATH = `${dbBase}/gis_nodes`, GIS_PLOTS_DATA_FILE_PATH = `${dbBase}/gis_plots`, SEMANTIC_DATA_FILE_PATH = `${dbBase}/semantic_model`, SCENE_NODE_FDS_DATA_FILE_PATH = `${dbBase}/scene_node_fds`, FDS_DATA_FILE_PATH = `${assetBase}/attachment_1`, PROPERTIES_KEY = "properties", POI_PLUGIN_NAME = "poiRenderer";
|
|
24751
24752
|
var PoiContentTypeEnum = /* @__PURE__ */ ((v) => (v.PANEL = "PANEL", v.VIDEO = "VIDEO", v.VIDEO_STREAM = "VIDEO_STREAM", v))(PoiContentTypeEnum || {}), LoadSceneAlgorithm = /* @__PURE__ */ ((v) => (v.BFS = "BFS", v.DFS = "DFS", v))(LoadSceneAlgorithm || {});
|
|
24753
|
+
const plotTypeToCategory = {
|
|
24754
|
+
"circle-point": "point",
|
|
24755
|
+
"square-point": "point",
|
|
24756
|
+
"fire-hydrant": "point",
|
|
24757
|
+
line: "line",
|
|
24758
|
+
"fire-lane": "line",
|
|
24759
|
+
polygon: "polygon",
|
|
24760
|
+
"elevated-surface": "polygon",
|
|
24761
|
+
rectangle: "rectangle",
|
|
24762
|
+
sector: "sector",
|
|
24763
|
+
"fine-arrow": "arrow",
|
|
24764
|
+
"curved-arrow": "arrow",
|
|
24765
|
+
"attack-arrow": "arrow",
|
|
24766
|
+
text: "text"
|
|
24767
|
+
};
|
|
24768
|
+
function flatCoordinatesToPoints(v) {
|
|
24769
|
+
if (!v || v.length < 2) return [];
|
|
24770
|
+
const e = [];
|
|
24771
|
+
for (let _ = 0; _ + 1 < v.length; _ += 3)
|
|
24772
|
+
e.push([v[_], v[_ + 1]]);
|
|
24773
|
+
return e;
|
|
24774
|
+
}
|
|
24775
|
+
function toSdkOptions(v) {
|
|
24776
|
+
const e = { ...v };
|
|
24777
|
+
return typeof e.strokeOpacity == "number" && (e.strokeOpacity = e.strokeOpacity * 100), typeof e.fillOpacity == "number" && (e.fillOpacity = e.fillOpacity * 100), e;
|
|
24778
|
+
}
|
|
24779
|
+
function gisPlotToAddOptions(v) {
|
|
24780
|
+
const e = v.properties, _ = e?.plotType;
|
|
24781
|
+
if (!_) return null;
|
|
24782
|
+
const A = plotTypeToCategory[_];
|
|
24783
|
+
if (!A) return null;
|
|
24784
|
+
const R = flatCoordinatesToPoints(v.geometry?.coordinates), E = v.visible !== !1, T = {
|
|
24785
|
+
points: R,
|
|
24786
|
+
visible: E,
|
|
24787
|
+
...e
|
|
24788
|
+
};
|
|
24789
|
+
let q = null;
|
|
24790
|
+
switch (A) {
|
|
24791
|
+
case "point": {
|
|
24792
|
+
q = { type: "point", ...e };
|
|
24793
|
+
break;
|
|
24794
|
+
}
|
|
24795
|
+
case "line": {
|
|
24796
|
+
q = { type: "line", ...T };
|
|
24797
|
+
break;
|
|
24798
|
+
}
|
|
24799
|
+
case "polygon": {
|
|
24800
|
+
q = { type: "polygon", ...e };
|
|
24801
|
+
break;
|
|
24802
|
+
}
|
|
24803
|
+
case "rectangle": {
|
|
24804
|
+
q = { type: "rectangle", ...e };
|
|
24805
|
+
break;
|
|
24806
|
+
}
|
|
24807
|
+
case "sector": {
|
|
24808
|
+
q = { type: "sector", ...e };
|
|
24809
|
+
break;
|
|
24810
|
+
}
|
|
24811
|
+
case "arrow": {
|
|
24812
|
+
q = { type: "arrow", ...e };
|
|
24813
|
+
break;
|
|
24814
|
+
}
|
|
24815
|
+
case "text": {
|
|
24816
|
+
q = { type: "text", ...{
|
|
24817
|
+
...T,
|
|
24818
|
+
layoutDirection: e.textLayout
|
|
24819
|
+
} };
|
|
24820
|
+
break;
|
|
24821
|
+
}
|
|
24822
|
+
default:
|
|
24823
|
+
return null;
|
|
24824
|
+
}
|
|
24825
|
+
return toSdkOptions(q);
|
|
24826
|
+
}
|
|
24752
24827
|
const encryptInfo = {
|
|
24753
24828
|
// verifyKey:'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxKqQyl4uc99WxJ3CGNz/2AF3lMj4yCHebEG6MP+XM+r0oqV7EuLTL26AlpGxWMBxshMS+IQOnuSiteVdMe8oVJexd9GBrfeBlkwo5yqOrcUtVTwfq8z/NdcSsb4oDKx1Qec3AB9abnFLChP0dZCaKADB+FKrarXI1mw3SQjfLLwIDAQAB',
|
|
24754
24829
|
verifyKey: "",
|
|
@@ -24893,6 +24968,20 @@ function createDoor(v, e, _) {
|
|
|
24893
24968
|
}]
|
|
24894
24969
|
});
|
|
24895
24970
|
}
|
|
24971
|
+
function createWindow(v, e, _) {
|
|
24972
|
+
const { name: A, extra: R } = e, E = R?.color || "#38bdf8", T = R?.alpha || 0.99;
|
|
24973
|
+
return v.createCanvas3D({
|
|
24974
|
+
id: _,
|
|
24975
|
+
name: A,
|
|
24976
|
+
points: [{
|
|
24977
|
+
id: `${_}/point`,
|
|
24978
|
+
position: { x: 0, y: 0, z: 0 },
|
|
24979
|
+
radius: 0.3,
|
|
24980
|
+
color: E,
|
|
24981
|
+
opacity: T
|
|
24982
|
+
}]
|
|
24983
|
+
});
|
|
24984
|
+
}
|
|
24896
24985
|
function createStairsAnchorsFromPoints(v, e, _) {
|
|
24897
24986
|
const A = new Group();
|
|
24898
24987
|
A.name = "anchors";
|
|
@@ -32546,7 +32635,7 @@ function requireMqtt() {
|
|
|
32546
32635
|
}, Se = class bf {
|
|
32547
32636
|
// options that cannot be changed without disaster
|
|
32548
32637
|
#t;
|
|
32549
|
-
#
|
|
32638
|
+
#u;
|
|
32550
32639
|
#o;
|
|
32551
32640
|
#y;
|
|
32552
32641
|
#l;
|
|
@@ -32615,17 +32704,17 @@ function requireMqtt() {
|
|
|
32615
32704
|
#n;
|
|
32616
32705
|
#m;
|
|
32617
32706
|
#s;
|
|
32618
|
-
#
|
|
32707
|
+
#i;
|
|
32619
32708
|
#e;
|
|
32620
|
-
#
|
|
32709
|
+
#p;
|
|
32621
32710
|
#w;
|
|
32622
32711
|
#g;
|
|
32623
32712
|
#c;
|
|
32624
32713
|
#_;
|
|
32625
32714
|
#h;
|
|
32626
|
-
#
|
|
32627
|
-
#
|
|
32628
|
-
#
|
|
32715
|
+
#d;
|
|
32716
|
+
#f;
|
|
32717
|
+
#r;
|
|
32629
32718
|
#S;
|
|
32630
32719
|
#E;
|
|
32631
32720
|
#v;
|
|
@@ -32641,13 +32730,13 @@ function requireMqtt() {
|
|
|
32641
32730
|
static unsafeExposeInternals(ae) {
|
|
32642
32731
|
return {
|
|
32643
32732
|
// properties
|
|
32644
|
-
starts: ae.#
|
|
32645
|
-
ttls: ae.#
|
|
32646
|
-
sizes: ae.#
|
|
32733
|
+
starts: ae.#f,
|
|
32734
|
+
ttls: ae.#r,
|
|
32735
|
+
sizes: ae.#d,
|
|
32647
32736
|
keyMap: ae.#s,
|
|
32648
|
-
keyList: ae.#
|
|
32737
|
+
keyList: ae.#i,
|
|
32649
32738
|
valList: ae.#e,
|
|
32650
|
-
next: ae.#
|
|
32739
|
+
next: ae.#p,
|
|
32651
32740
|
prev: ae.#w,
|
|
32652
32741
|
get head() {
|
|
32653
32742
|
return ae.#g;
|
|
@@ -32676,7 +32765,7 @@ function requireMqtt() {
|
|
|
32676
32765
|
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
32677
32766
|
*/
|
|
32678
32767
|
get maxSize() {
|
|
32679
|
-
return this.#
|
|
32768
|
+
return this.#u;
|
|
32680
32769
|
}
|
|
32681
32770
|
/**
|
|
32682
32771
|
* The total computed size of items in the cache (read-only)
|
|
@@ -32718,8 +32807,8 @@ function requireMqtt() {
|
|
|
32718
32807
|
const vt = Te ? H(Te) : Array;
|
|
32719
32808
|
if (!vt)
|
|
32720
32809
|
throw new Error("invalid max value: " + Te);
|
|
32721
|
-
if (this.#t = Te, this.#
|
|
32722
|
-
if (!this.#
|
|
32810
|
+
if (this.#t = Te, this.#u = ct, this.maxEntrySize = Nt || this.#u, this.sizeCalculation = et, this.sizeCalculation) {
|
|
32811
|
+
if (!this.#u && !this.maxEntrySize)
|
|
32723
32812
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
32724
32813
|
if (typeof this.sizeCalculation != "function")
|
|
32725
32814
|
throw new TypeError("sizeCalculation set to non-function");
|
|
@@ -32728,8 +32817,8 @@ function requireMqtt() {
|
|
|
32728
32817
|
throw new TypeError("memoMethod must be a function if defined");
|
|
32729
32818
|
if (this.#b = pt, ut !== void 0 && typeof ut != "function")
|
|
32730
32819
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
32731
|
-
if (this.#l = ut, this.#E = !!ut, this.#s = /* @__PURE__ */ new Map(), this.#
|
|
32732
|
-
if (this.#
|
|
32820
|
+
if (this.#l = ut, this.#E = !!ut, this.#s = /* @__PURE__ */ new Map(), this.#i = new Array(Te).fill(void 0), this.#e = new Array(Te).fill(void 0), this.#p = new vt(Te), this.#w = new vt(Te), this.#g = 0, this.#c = 0, this.#_ = he.create(Te), this.#n = 0, this.#m = 0, typeof ke == "function" && (this.#o = ke), typeof Me == "function" ? (this.#y = Me, this.#h = []) : (this.#y = void 0, this.#h = void 0), this.#S = !!this.#o, this.#v = !!this.#y, this.noDisposeOnSet = !!Xe, this.noUpdateTTL = !!gt, this.noDeleteOnFetchRejection = !!lt, this.allowStaleOnFetchRejection = !!jt, this.allowStaleOnFetchAbort = !!Et, this.ignoreFetchAbort = !!Yt, this.maxEntrySize !== 0) {
|
|
32821
|
+
if (this.#u !== 0 && !W(this.#u))
|
|
32733
32822
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
32734
32823
|
if (!W(this.maxEntrySize))
|
|
32735
32824
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
@@ -32740,9 +32829,9 @@ function requireMqtt() {
|
|
|
32740
32829
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
32741
32830
|
this.#P();
|
|
32742
32831
|
}
|
|
32743
|
-
if (this.#t === 0 && this.ttl === 0 && this.#
|
|
32832
|
+
if (this.#t === 0 && this.ttl === 0 && this.#u === 0)
|
|
32744
32833
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
32745
|
-
if (!this.ttlAutopurge && !this.#t && !this.#
|
|
32834
|
+
if (!this.ttlAutopurge && !this.#t && !this.#u) {
|
|
32746
32835
|
const qt = "LRU_CACHE_UNBOUNDED";
|
|
32747
32836
|
U(qt) && (ne.add(qt), fe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", qt, bf));
|
|
32748
32837
|
}
|
|
@@ -32756,10 +32845,10 @@ function requireMqtt() {
|
|
|
32756
32845
|
}
|
|
32757
32846
|
#P() {
|
|
32758
32847
|
const ae = new se(this.#t), Te = new se(this.#t);
|
|
32759
|
-
this.#
|
|
32848
|
+
this.#r = ae, this.#f = Te, this.#D = (ye, Oe, $e = pe.now()) => {
|
|
32760
32849
|
if (Te[ye] = Oe !== 0 ? $e : 0, ae[ye] = Oe, Oe !== 0 && this.ttlAutopurge) {
|
|
32761
32850
|
const Ae = setTimeout(() => {
|
|
32762
|
-
this.#A(ye) && this.#T(this.#
|
|
32851
|
+
this.#A(ye) && this.#T(this.#i[ye], "expire");
|
|
32763
32852
|
}, Oe + 1);
|
|
32764
32853
|
Ae.unref && Ae.unref();
|
|
32765
32854
|
}
|
|
@@ -32810,7 +32899,7 @@ function requireMqtt() {
|
|
|
32810
32899
|
#A = () => !1;
|
|
32811
32900
|
#F() {
|
|
32812
32901
|
const ae = new se(this.#t);
|
|
32813
|
-
this.#m = 0, this.#
|
|
32902
|
+
this.#m = 0, this.#d = ae, this.#O = (Te) => {
|
|
32814
32903
|
this.#m -= ae[Te], ae[Te] = 0;
|
|
32815
32904
|
}, this.#$ = (Te, we, Ie, ye) => {
|
|
32816
32905
|
if (this.#a(we))
|
|
@@ -32825,8 +32914,8 @@ function requireMqtt() {
|
|
|
32825
32914
|
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
32826
32915
|
return Ie;
|
|
32827
32916
|
}, this.#M = (Te, we, Ie) => {
|
|
32828
|
-
if (ae[Te] = we, this.#
|
|
32829
|
-
const ye = this.#
|
|
32917
|
+
if (ae[Te] = we, this.#u) {
|
|
32918
|
+
const ye = this.#u - ae[Te];
|
|
32830
32919
|
for (; this.#m > ye; )
|
|
32831
32920
|
this.#C(!0);
|
|
32832
32921
|
}
|
|
@@ -32850,10 +32939,10 @@ function requireMqtt() {
|
|
|
32850
32939
|
*#R({ allowStale: ae = this.allowStale } = {}) {
|
|
32851
32940
|
if (this.#n)
|
|
32852
32941
|
for (let Te = this.#g; !(!this.#N(Te) || ((ae || !this.#A(Te)) && (yield Te), Te === this.#c)); )
|
|
32853
|
-
Te = this.#
|
|
32942
|
+
Te = this.#p[Te];
|
|
32854
32943
|
}
|
|
32855
32944
|
#N(ae) {
|
|
32856
|
-
return ae !== void 0 && this.#s.get(this.#
|
|
32945
|
+
return ae !== void 0 && this.#s.get(this.#i[ae]) === ae;
|
|
32857
32946
|
}
|
|
32858
32947
|
/**
|
|
32859
32948
|
* Return a generator yielding `[key, value]` pairs,
|
|
@@ -32861,7 +32950,7 @@ function requireMqtt() {
|
|
|
32861
32950
|
*/
|
|
32862
32951
|
*entries() {
|
|
32863
32952
|
for (const ae of this.#x())
|
|
32864
|
-
this.#e[ae] !== void 0 && this.#
|
|
32953
|
+
this.#e[ae] !== void 0 && this.#i[ae] !== void 0 && !this.#a(this.#e[ae]) && (yield [this.#i[ae], this.#e[ae]]);
|
|
32865
32954
|
}
|
|
32866
32955
|
/**
|
|
32867
32956
|
* Inverse order version of {@link LRUCache.entries}
|
|
@@ -32871,7 +32960,7 @@ function requireMqtt() {
|
|
|
32871
32960
|
*/
|
|
32872
32961
|
*rentries() {
|
|
32873
32962
|
for (const ae of this.#R())
|
|
32874
|
-
this.#e[ae] !== void 0 && this.#
|
|
32963
|
+
this.#e[ae] !== void 0 && this.#i[ae] !== void 0 && !this.#a(this.#e[ae]) && (yield [this.#i[ae], this.#e[ae]]);
|
|
32875
32964
|
}
|
|
32876
32965
|
/**
|
|
32877
32966
|
* Return a generator yielding the keys in the cache,
|
|
@@ -32879,7 +32968,7 @@ function requireMqtt() {
|
|
|
32879
32968
|
*/
|
|
32880
32969
|
*keys() {
|
|
32881
32970
|
for (const ae of this.#x()) {
|
|
32882
|
-
const Te = this.#
|
|
32971
|
+
const Te = this.#i[ae];
|
|
32883
32972
|
Te !== void 0 && !this.#a(this.#e[ae]) && (yield Te);
|
|
32884
32973
|
}
|
|
32885
32974
|
}
|
|
@@ -32891,7 +32980,7 @@ function requireMqtt() {
|
|
|
32891
32980
|
*/
|
|
32892
32981
|
*rkeys() {
|
|
32893
32982
|
for (const ae of this.#R()) {
|
|
32894
|
-
const Te = this.#
|
|
32983
|
+
const Te = this.#i[ae];
|
|
32895
32984
|
Te !== void 0 && !this.#a(this.#e[ae]) && (yield Te);
|
|
32896
32985
|
}
|
|
32897
32986
|
}
|
|
@@ -32933,8 +33022,8 @@ function requireMqtt() {
|
|
|
32933
33022
|
find(ae, Te = {}) {
|
|
32934
33023
|
for (const we of this.#x()) {
|
|
32935
33024
|
const Ie = this.#e[we], ye = this.#a(Ie) ? Ie.__staleWhileFetching : Ie;
|
|
32936
|
-
if (ye !== void 0 && ae(ye, this.#
|
|
32937
|
-
return this.get(this.#
|
|
33025
|
+
if (ye !== void 0 && ae(ye, this.#i[we], this))
|
|
33026
|
+
return this.get(this.#i[we], Te);
|
|
32938
33027
|
}
|
|
32939
33028
|
}
|
|
32940
33029
|
/**
|
|
@@ -32951,7 +33040,7 @@ function requireMqtt() {
|
|
|
32951
33040
|
forEach(ae, Te = this) {
|
|
32952
33041
|
for (const we of this.#x()) {
|
|
32953
33042
|
const Ie = this.#e[we], ye = this.#a(Ie) ? Ie.__staleWhileFetching : Ie;
|
|
32954
|
-
ye !== void 0 && ae.call(Te, ye, this.#
|
|
33043
|
+
ye !== void 0 && ae.call(Te, ye, this.#i[we], this);
|
|
32955
33044
|
}
|
|
32956
33045
|
}
|
|
32957
33046
|
/**
|
|
@@ -32961,7 +33050,7 @@ function requireMqtt() {
|
|
|
32961
33050
|
rforEach(ae, Te = this) {
|
|
32962
33051
|
for (const we of this.#R()) {
|
|
32963
33052
|
const Ie = this.#e[we], ye = this.#a(Ie) ? Ie.__staleWhileFetching : Ie;
|
|
32964
|
-
ye !== void 0 && ae.call(Te, ye, this.#
|
|
33053
|
+
ye !== void 0 && ae.call(Te, ye, this.#i[we], this);
|
|
32965
33054
|
}
|
|
32966
33055
|
}
|
|
32967
33056
|
/**
|
|
@@ -32971,7 +33060,7 @@ function requireMqtt() {
|
|
|
32971
33060
|
purgeStale() {
|
|
32972
33061
|
let ae = !1;
|
|
32973
33062
|
for (const Te of this.#R({ allowStale: !0 }))
|
|
32974
|
-
this.#A(Te) && (this.#T(this.#
|
|
33063
|
+
this.#A(Te) && (this.#T(this.#i[Te], "expire"), ae = !0);
|
|
32975
33064
|
return ae;
|
|
32976
33065
|
}
|
|
32977
33066
|
/**
|
|
@@ -32994,14 +33083,14 @@ function requireMqtt() {
|
|
|
32994
33083
|
if (Ie === void 0)
|
|
32995
33084
|
return;
|
|
32996
33085
|
const ye = { value: Ie };
|
|
32997
|
-
if (this.#
|
|
32998
|
-
const Oe = this.#
|
|
33086
|
+
if (this.#r && this.#f) {
|
|
33087
|
+
const Oe = this.#r[Te], $e = this.#f[Te];
|
|
32999
33088
|
if (Oe && $e) {
|
|
33000
33089
|
const Ae = Oe - (pe.now() - $e);
|
|
33001
33090
|
ye.ttl = Ae, ye.start = Date.now();
|
|
33002
33091
|
}
|
|
33003
33092
|
}
|
|
33004
|
-
return this.#
|
|
33093
|
+
return this.#d && (ye.size = this.#d[Te]), ye;
|
|
33005
33094
|
}
|
|
33006
33095
|
/**
|
|
33007
33096
|
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
@@ -33019,16 +33108,16 @@ function requireMqtt() {
|
|
|
33019
33108
|
dump() {
|
|
33020
33109
|
const ae = [];
|
|
33021
33110
|
for (const Te of this.#x({ allowStale: !0 })) {
|
|
33022
|
-
const we = this.#
|
|
33111
|
+
const we = this.#i[Te], Ie = this.#e[Te], ye = this.#a(Ie) ? Ie.__staleWhileFetching : Ie;
|
|
33023
33112
|
if (ye === void 0 || we === void 0)
|
|
33024
33113
|
continue;
|
|
33025
33114
|
const Oe = { value: ye };
|
|
33026
|
-
if (this.#
|
|
33027
|
-
Oe.ttl = this.#
|
|
33028
|
-
const $e = pe.now() - this.#
|
|
33115
|
+
if (this.#r && this.#f) {
|
|
33116
|
+
Oe.ttl = this.#r[Te];
|
|
33117
|
+
const $e = pe.now() - this.#f[Te];
|
|
33029
33118
|
Oe.start = Math.floor(Date.now() - $e);
|
|
33030
33119
|
}
|
|
33031
|
-
this.#
|
|
33120
|
+
this.#d && (Oe.size = this.#d[Te]), ae.unshift([we, Oe]);
|
|
33032
33121
|
}
|
|
33033
33122
|
return ae;
|
|
33034
33123
|
}
|
|
@@ -33091,7 +33180,7 @@ function requireMqtt() {
|
|
|
33091
33180
|
return Ae && (Ae.set = "miss", Ae.maxEntrySizeExceeded = !0), this.#T(ae, "set"), this;
|
|
33092
33181
|
let Xe = this.#n === 0 ? void 0 : this.#s.get(ae);
|
|
33093
33182
|
if (Xe === void 0)
|
|
33094
|
-
Xe = this.#n === 0 ? this.#c : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#t ? this.#C(!1) : this.#n, this.#
|
|
33183
|
+
Xe = this.#n === 0 ? this.#c : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#t ? this.#C(!1) : this.#n, this.#i[Xe] = ae, this.#e[Xe] = Te, this.#s.set(ae, Xe), this.#p[this.#c] = Xe, this.#w[Xe] = this.#c, this.#c = Xe, this.#n++, this.#M(Xe, Me, Ae), Ae && (Ae.set = "add"), ke = !1;
|
|
33095
33184
|
else {
|
|
33096
33185
|
this.#q(Xe);
|
|
33097
33186
|
const gt = this.#e[Xe];
|
|
@@ -33108,7 +33197,7 @@ function requireMqtt() {
|
|
|
33108
33197
|
}
|
|
33109
33198
|
} else Ae && (Ae.set = "update");
|
|
33110
33199
|
}
|
|
33111
|
-
if (Ie !== 0 && !this.#
|
|
33200
|
+
if (Ie !== 0 && !this.#r && this.#P(), this.#r && (ke || this.#D(Xe, Ie, ye), Ae && this.#I(Ae, Xe)), !Oe && this.#v && this.#h) {
|
|
33112
33201
|
const gt = this.#h;
|
|
33113
33202
|
let ct;
|
|
33114
33203
|
for (; ct = gt?.shift(); )
|
|
@@ -33140,8 +33229,8 @@ function requireMqtt() {
|
|
|
33140
33229
|
}
|
|
33141
33230
|
}
|
|
33142
33231
|
#C(ae) {
|
|
33143
|
-
const Te = this.#g, we = this.#
|
|
33144
|
-
return this.#E && this.#a(Ie) ? Ie.__abortController.abort(new Error("evicted")) : (this.#S || this.#v) && (this.#S && this.#o?.(Ie, we, "evict"), this.#v && this.#h?.push([Ie, we, "evict"])), this.#O(Te), ae && (this.#
|
|
33232
|
+
const Te = this.#g, we = this.#i[Te], Ie = this.#e[Te];
|
|
33233
|
+
return this.#E && this.#a(Ie) ? Ie.__abortController.abort(new Error("evicted")) : (this.#S || this.#v) && (this.#S && this.#o?.(Ie, we, "evict"), this.#v && this.#h?.push([Ie, we, "evict"])), this.#O(Te), ae && (this.#i[Te] = void 0, this.#e[Te] = void 0, this.#_.push(Te)), this.#n === 1 ? (this.#g = this.#c = 0, this.#_.length = 0) : this.#g = this.#p[Te], this.#s.delete(we), this.#n--, Te;
|
|
33145
33234
|
}
|
|
33146
33235
|
/**
|
|
33147
33236
|
* Check if a key is in the cache, without updating the recency of use.
|
|
@@ -33325,10 +33414,10 @@ function requireMqtt() {
|
|
|
33325
33414
|
} else Oe && (Oe.get = "miss");
|
|
33326
33415
|
}
|
|
33327
33416
|
#L(ae, Te) {
|
|
33328
|
-
this.#w[Te] = ae, this.#
|
|
33417
|
+
this.#w[Te] = ae, this.#p[ae] = Te;
|
|
33329
33418
|
}
|
|
33330
33419
|
#q(ae) {
|
|
33331
|
-
ae !== this.#c && (ae === this.#g ? this.#g = this.#
|
|
33420
|
+
ae !== this.#c && (ae === this.#g ? this.#g = this.#p[ae] : this.#L(this.#w[ae], this.#p[ae]), this.#L(this.#c, ae), this.#c = ae);
|
|
33332
33421
|
}
|
|
33333
33422
|
/**
|
|
33334
33423
|
* Deletes a key out of the cache.
|
|
@@ -33348,14 +33437,14 @@ function requireMqtt() {
|
|
|
33348
33437
|
else {
|
|
33349
33438
|
this.#O(Ie);
|
|
33350
33439
|
const ye = this.#e[Ie];
|
|
33351
|
-
if (this.#a(ye) ? ye.__abortController.abort(new Error("deleted")) : (this.#S || this.#v) && (this.#S && this.#o?.(ye, ae, Te), this.#v && this.#h?.push([ye, ae, Te])), this.#s.delete(ae), this.#
|
|
33440
|
+
if (this.#a(ye) ? ye.__abortController.abort(new Error("deleted")) : (this.#S || this.#v) && (this.#S && this.#o?.(ye, ae, Te), this.#v && this.#h?.push([ye, ae, Te])), this.#s.delete(ae), this.#i[Ie] = void 0, this.#e[Ie] = void 0, Ie === this.#c)
|
|
33352
33441
|
this.#c = this.#w[Ie];
|
|
33353
33442
|
else if (Ie === this.#g)
|
|
33354
|
-
this.#g = this.#
|
|
33443
|
+
this.#g = this.#p[Ie];
|
|
33355
33444
|
else {
|
|
33356
33445
|
const Oe = this.#w[Ie];
|
|
33357
|
-
this.#
|
|
33358
|
-
const $e = this.#
|
|
33446
|
+
this.#p[Oe] = this.#p[Ie];
|
|
33447
|
+
const $e = this.#p[Ie];
|
|
33359
33448
|
this.#w[$e] = this.#w[Ie];
|
|
33360
33449
|
}
|
|
33361
33450
|
this.#n--, this.#_.push(Ie);
|
|
@@ -33381,11 +33470,11 @@ function requireMqtt() {
|
|
|
33381
33470
|
if (this.#a(we))
|
|
33382
33471
|
we.__abortController.abort(new Error("deleted"));
|
|
33383
33472
|
else {
|
|
33384
|
-
const Ie = this.#
|
|
33473
|
+
const Ie = this.#i[Te];
|
|
33385
33474
|
this.#S && this.#o?.(we, Ie, ae), this.#v && this.#h?.push([we, Ie, ae]);
|
|
33386
33475
|
}
|
|
33387
33476
|
}
|
|
33388
|
-
if (this.#s.clear(), this.#e.fill(void 0), this.#
|
|
33477
|
+
if (this.#s.clear(), this.#e.fill(void 0), this.#i.fill(void 0), this.#r && this.#f && (this.#r.fill(0), this.#f.fill(0)), this.#d && this.#d.fill(0), this.#g = 0, this.#c = 0, this.#_.length = 0, this.#m = 0, this.#n = 0, this.#v && this.#h) {
|
|
33389
33478
|
const Te = this.#h;
|
|
33390
33479
|
let we;
|
|
33391
33480
|
for (; we = Te?.shift(); )
|
|
@@ -42321,13 +42410,13 @@ class DataSource {
|
|
|
42321
42410
|
}
|
|
42322
42411
|
// 接口实例存储
|
|
42323
42412
|
#t = {};
|
|
42324
|
-
#
|
|
42413
|
+
#u = void 0;
|
|
42325
42414
|
#o = void 0;
|
|
42326
42415
|
#y() {
|
|
42327
42416
|
this.#t = {};
|
|
42328
42417
|
}
|
|
42329
42418
|
on(e, _) {
|
|
42330
|
-
e === "onStatus" ? this.#
|
|
42419
|
+
e === "onStatus" ? this.#u = _ : e === "onMessage" && (this.#o = _);
|
|
42331
42420
|
}
|
|
42332
42421
|
// 获取接口实例
|
|
42333
42422
|
getClientById(e) {
|
|
@@ -42335,7 +42424,7 @@ class DataSource {
|
|
|
42335
42424
|
}
|
|
42336
42425
|
// 接口状态改变
|
|
42337
42426
|
#l(e) {
|
|
42338
|
-
console.log("onStatus", e), this.#
|
|
42427
|
+
console.log("onStatus", e), this.#u && this.#u(e);
|
|
42339
42428
|
}
|
|
42340
42429
|
// 接收消息
|
|
42341
42430
|
#b(e) {
|
|
@@ -42369,14 +42458,14 @@ class DataSource {
|
|
|
42369
42458
|
}
|
|
42370
42459
|
#m(e) {
|
|
42371
42460
|
for (let _ = 0; _ < e.length; _++) {
|
|
42372
|
-
const A = e[_], R = this.#
|
|
42461
|
+
const A = e[_], R = this.#p(A.sid);
|
|
42373
42462
|
if (A.nodeArray && A.nodeArray.length > 0 && R)
|
|
42374
42463
|
switch (A.protocol) {
|
|
42375
42464
|
case ProtocolEnum.HTTP:
|
|
42376
42465
|
this.#s(A, R);
|
|
42377
42466
|
break;
|
|
42378
42467
|
case ProtocolEnum.MQTT:
|
|
42379
|
-
this.#
|
|
42468
|
+
this.#i(A, R);
|
|
42380
42469
|
break;
|
|
42381
42470
|
case ProtocolEnum.WEBSOCKET:
|
|
42382
42471
|
this.#e(A, R);
|
|
@@ -42394,7 +42483,7 @@ class DataSource {
|
|
|
42394
42483
|
this.#b.bind(this)
|
|
42395
42484
|
), this.#t[e.id] = A;
|
|
42396
42485
|
}
|
|
42397
|
-
#
|
|
42486
|
+
#i(e, _) {
|
|
42398
42487
|
let A = this.#t[e.id];
|
|
42399
42488
|
if (A) return A.reconnect();
|
|
42400
42489
|
A = requestMqtt(
|
|
@@ -42414,7 +42503,7 @@ class DataSource {
|
|
|
42414
42503
|
this.#b.bind(this)
|
|
42415
42504
|
), this.#t[e.id] = A;
|
|
42416
42505
|
}
|
|
42417
|
-
#
|
|
42506
|
+
#p(e) {
|
|
42418
42507
|
return this.sourceEnv.find((_) => _.id === e);
|
|
42419
42508
|
}
|
|
42420
42509
|
}
|
|
@@ -42477,10 +42566,10 @@ const regenerateNodes = (v) => {
|
|
|
42477
42566
|
};
|
|
42478
42567
|
class BatchUpdatePoi {
|
|
42479
42568
|
constructor(e, _, A, R) {
|
|
42480
|
-
this.treeList = e, this.poiList = _, this.plugin = A, this.cpsPlugin = R, this.#
|
|
42569
|
+
this.treeList = e, this.poiList = _, this.plugin = A, this.cpsPlugin = R, this.#u();
|
|
42481
42570
|
}
|
|
42482
42571
|
#t = {};
|
|
42483
|
-
#
|
|
42572
|
+
#u() {
|
|
42484
42573
|
if (this.treeList) {
|
|
42485
42574
|
const e = regenerateNodes(this.treeList);
|
|
42486
42575
|
this.#t = e.flatNodes;
|
|
@@ -42549,7 +42638,7 @@ class UpdatePoi {
|
|
|
42549
42638
|
const _ = this.cpsPlugin.poiData?.find((A, R, E) => A.nodeId === e?.target?.modelId);
|
|
42550
42639
|
if (_) {
|
|
42551
42640
|
const A = this.#t(e, _);
|
|
42552
|
-
this.#
|
|
42641
|
+
this.#u([A]);
|
|
42553
42642
|
}
|
|
42554
42643
|
}
|
|
42555
42644
|
#t(e, _) {
|
|
@@ -42566,7 +42655,7 @@ class UpdatePoi {
|
|
|
42566
42655
|
/**
|
|
42567
42656
|
* @description: poi更新,删除后重建
|
|
42568
42657
|
*/
|
|
42569
|
-
#
|
|
42658
|
+
#u(e) {
|
|
42570
42659
|
this.plugin && this.plugin.batchRender({
|
|
42571
42660
|
dataSource: e.map(this.cpsPlugin.formatPoiData)
|
|
42572
42661
|
});
|
|
@@ -42661,12 +42750,24 @@ const { groupBy, warn, getExtension } = SoonSpace.utils, defaultLoadSceneOptions
|
|
|
42661
42750
|
loadTopologies: !1,
|
|
42662
42751
|
refreshPoiByDataSource: !1,
|
|
42663
42752
|
loadFlowData: !1,
|
|
42753
|
+
loadFDS: !1,
|
|
42664
42754
|
objectPrefixId: "",
|
|
42665
42755
|
asId: "sid"
|
|
42666
42756
|
};
|
|
42667
42757
|
class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
42668
42758
|
constructor(e, _) {
|
|
42669
|
-
super(), this.ssp = e, this.effectPlugin = new EffectPlugin(this.ssp), this.atmospherePlugin = new AtmospherePlugin(this.ssp), this.
|
|
42759
|
+
super(), this.ssp = e, this.effectPlugin = new EffectPlugin(this.ssp), this.atmospherePlugin = new AtmospherePlugin(this.ssp), this.fdsManager = new FdsManager(this.ssp, {
|
|
42760
|
+
resolveUrl: (A) => this.#d(A),
|
|
42761
|
+
resolveParent: (A) => A?.nodeId ? this.ssp.getObjectById(A.nodeId) || this.ssp.getObjectByUserDataProperty("id", A.nodeId)[0] || this.ssp.getObjectByUserDataProperty("sid", A.nodeId)[0] || this.sceneGroup : this.sceneGroup,
|
|
42762
|
+
getSources: async () => {
|
|
42763
|
+
try {
|
|
42764
|
+
return await this.fetchFDSData();
|
|
42765
|
+
} catch {
|
|
42766
|
+
return null;
|
|
42767
|
+
}
|
|
42768
|
+
},
|
|
42769
|
+
fallbackUrl: FDS_DATA_FILE_PATH
|
|
42770
|
+
}), this.soonflow = new d$1(N, {
|
|
42670
42771
|
ssp: this.ssp,
|
|
42671
42772
|
cpsManager: this
|
|
42672
42773
|
}), this.#y = new WaterMark(this.ssp.viewport), _?.key && this.setKey(_.key), _?.path && this.setPath(_.path);
|
|
@@ -42675,17 +42776,22 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42675
42776
|
/**
|
|
42676
42777
|
* 是否需要执行解密流程
|
|
42677
42778
|
*/
|
|
42678
|
-
#
|
|
42779
|
+
#u = !0;
|
|
42679
42780
|
get path() {
|
|
42680
42781
|
return this.#t;
|
|
42681
42782
|
}
|
|
42682
42783
|
set path(e) {
|
|
42683
|
-
this.#t !== e && (this.#
|
|
42784
|
+
this.#t !== e && (this.#u = !0, this.#t = e, this.progress.loaded = 0, this.progress.total = 0);
|
|
42684
42785
|
}
|
|
42685
42786
|
progress = {
|
|
42686
42787
|
loaded: 0,
|
|
42687
42788
|
total: 0
|
|
42688
42789
|
};
|
|
42790
|
+
async loadFDS(e, _ = {}) {
|
|
42791
|
+
return this.fdsManager.load(e, {
|
|
42792
|
+
field: _.field
|
|
42793
|
+
});
|
|
42794
|
+
}
|
|
42689
42795
|
/**
|
|
42690
42796
|
* 场景 group 包裹
|
|
42691
42797
|
*/
|
|
@@ -42745,6 +42851,8 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42745
42851
|
* 语义化对象
|
|
42746
42852
|
*/
|
|
42747
42853
|
semanticObjects = null;
|
|
42854
|
+
fdsData = null;
|
|
42855
|
+
fdsManager;
|
|
42748
42856
|
/**
|
|
42749
42857
|
* effect 插件
|
|
42750
42858
|
*/
|
|
@@ -42790,11 +42898,11 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42790
42898
|
#s(e) {
|
|
42791
42899
|
if (!e) return;
|
|
42792
42900
|
const _ = (A) => {
|
|
42793
|
-
this.#
|
|
42901
|
+
this.#i(A), Reflect.deleteProperty(A, "path"), A.children && A.children.forEach(_);
|
|
42794
42902
|
};
|
|
42795
42903
|
e.forEach(_), this.treeData = e;
|
|
42796
42904
|
}
|
|
42797
|
-
#
|
|
42905
|
+
#i(e) {
|
|
42798
42906
|
e.path && this.#m.set(e.sid, e.path);
|
|
42799
42907
|
}
|
|
42800
42908
|
#e(e) {
|
|
@@ -42805,7 +42913,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42805
42913
|
*
|
|
42806
42914
|
* 由于私有化部署中,验证服务器的resourceUrl 为’‘,使用_treeDataMaps缓存会导致服务器地址一样读到缓存场景问题
|
|
42807
42915
|
*/
|
|
42808
|
-
async #
|
|
42916
|
+
async #p() {
|
|
42809
42917
|
let e;
|
|
42810
42918
|
const { resource: _ } = await this.fetchMetaData();
|
|
42811
42919
|
if (this.#o.verifyKey) {
|
|
@@ -42837,7 +42945,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42837
42945
|
signingScheme: "pkcs1-md5",
|
|
42838
42946
|
encryptionScheme: "pkcs1"
|
|
42839
42947
|
}), E = R.encrypt(_, "base64"), T = await this.#g(
|
|
42840
|
-
this.#
|
|
42948
|
+
this.#d(e),
|
|
42841
42949
|
E
|
|
42842
42950
|
), { license: q, serverEnc: P } = T;
|
|
42843
42951
|
return P ? R.decryptPublic(P, "utf8") !== _ ? "forbid" : q : "noServerEnc";
|
|
@@ -42886,17 +42994,17 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42886
42994
|
* 验证公有版本(调试包)
|
|
42887
42995
|
*/
|
|
42888
42996
|
async #_(e) {
|
|
42889
|
-
const _ = await this.#
|
|
42997
|
+
const _ = await this.#r(e), A = decodeString(this.#o.debugKey), { verifiedRes: R, dec: E } = this.#c(_, A);
|
|
42890
42998
|
this.#b = R, this.#b && this.#s(E);
|
|
42891
42999
|
}
|
|
42892
43000
|
/**
|
|
42893
43001
|
* 验证应用(安装包)
|
|
42894
43002
|
*/
|
|
42895
43003
|
async #h(e) {
|
|
42896
|
-
const _ = await this.#
|
|
43004
|
+
const _ = await this.#r(e), A = this.#o.key, { verifiedRes: R, dec: E } = this.#c(_, A);
|
|
42897
43005
|
return this.#n = R, this.#b = R, this.#n && this.#s(E), { verifiedRes: R, dec: E };
|
|
42898
43006
|
}
|
|
42899
|
-
#
|
|
43007
|
+
#d(e) {
|
|
42900
43008
|
const _ = this.#t;
|
|
42901
43009
|
if (_) {
|
|
42902
43010
|
const A = /\?([^/?&#:]+=[^?&]+&)*[^/?&#:]+=.*$/;
|
|
@@ -42904,19 +43012,19 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42904
43012
|
}
|
|
42905
43013
|
return `${_}${e}`;
|
|
42906
43014
|
}
|
|
42907
|
-
async #
|
|
43015
|
+
async #f(e) {
|
|
42908
43016
|
const { resource: _ } = await this.fetchMetaData(), A = getExtension(_) || "json";
|
|
42909
43017
|
return `${e}.${A}`;
|
|
42910
43018
|
}
|
|
42911
|
-
async #
|
|
43019
|
+
async #r(e) {
|
|
42912
43020
|
const { utils: _ } = this.ssp;
|
|
42913
|
-
return _.fetchFile(this.#
|
|
43021
|
+
return _.fetchFile(this.#d(e), "json");
|
|
42914
43022
|
}
|
|
42915
43023
|
/**
|
|
42916
43024
|
* 获取场景元数据
|
|
42917
43025
|
*/
|
|
42918
43026
|
async fetchMetaData() {
|
|
42919
|
-
const e = await this.#
|
|
43027
|
+
const e = await this.#r(META_DATA_FILE_PATH);
|
|
42920
43028
|
return this.metaData = e, e;
|
|
42921
43029
|
}
|
|
42922
43030
|
/**
|
|
@@ -42924,14 +43032,14 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42924
43032
|
* @returns
|
|
42925
43033
|
*/
|
|
42926
43034
|
async fetchTreeData() {
|
|
42927
|
-
const e = await this.#
|
|
43035
|
+
const e = await this.#r(await this.#f(TREE_DATA_FILE_PATH));
|
|
42928
43036
|
return this.#s(e), e;
|
|
42929
43037
|
}
|
|
42930
43038
|
async fetchSemanticData() {
|
|
42931
|
-
return await this.#
|
|
43039
|
+
return await this.#r(await this.#f(SEMANTIC_DATA_FILE_PATH));
|
|
42932
43040
|
}
|
|
42933
43041
|
async fetchFlatData() {
|
|
42934
|
-
const e = await this.#
|
|
43042
|
+
const e = await this.#r(await this.#f(FLAT_DATA_FILE_PATH));
|
|
42935
43043
|
return this.flatData = e, this.faltDataMap = groupBy(e, "id"), e;
|
|
42936
43044
|
}
|
|
42937
43045
|
/**
|
|
@@ -42939,7 +43047,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42939
43047
|
* @returns
|
|
42940
43048
|
*/
|
|
42941
43049
|
async fetchPoiData() {
|
|
42942
|
-
const e = await this.#
|
|
43050
|
+
const e = await this.#r(await this.#f(POI_DATA_FILE_PATH));
|
|
42943
43051
|
return this.poiData = e.map((_) => ({
|
|
42944
43052
|
..._,
|
|
42945
43053
|
contentData: JSON.parse(_.content || "{}")
|
|
@@ -42950,7 +43058,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42950
43058
|
* @returns
|
|
42951
43059
|
*/
|
|
42952
43060
|
async fetchDataSourceData() {
|
|
42953
|
-
const e = await this.#
|
|
43061
|
+
const e = await this.#r(await this.#f(DATA_SOURCE_FILE_PATH));
|
|
42954
43062
|
return this.dataSourceData = e, e;
|
|
42955
43063
|
}
|
|
42956
43064
|
/**
|
|
@@ -42958,8 +43066,8 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42958
43066
|
* @returns
|
|
42959
43067
|
*/
|
|
42960
43068
|
async fetchTopologyData() {
|
|
42961
|
-
const e = await this.#
|
|
42962
|
-
await this.#
|
|
43069
|
+
const e = await this.#r(
|
|
43070
|
+
await this.#f(TOPOLOGY_DATA_FILE_PATH)
|
|
42963
43071
|
).then((_) => {
|
|
42964
43072
|
const A = {
|
|
42965
43073
|
linkWidth: 0.1,
|
|
@@ -42979,8 +43087,8 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
42979
43087
|
* @returns
|
|
42980
43088
|
*/
|
|
42981
43089
|
async fetchPropertiesData() {
|
|
42982
|
-
const e = await this.#
|
|
42983
|
-
await this.#
|
|
43090
|
+
const e = await this.#r(
|
|
43091
|
+
await this.#f(PROPERTIES_DATA_FLEE_PATH)
|
|
42984
43092
|
).then((_) => _.map((R) => {
|
|
42985
43093
|
const E = this.ssp.utils.propertiesCtx;
|
|
42986
43094
|
return new Proxy(R, {
|
|
@@ -43001,8 +43109,8 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43001
43109
|
* @returns
|
|
43002
43110
|
*/
|
|
43003
43111
|
async fetchAnimationsData() {
|
|
43004
|
-
const e = await this.#
|
|
43005
|
-
await this.#
|
|
43112
|
+
const e = await this.#r(
|
|
43113
|
+
await this.#f(ANIMATIONS_DATA_FILE_PATH)
|
|
43006
43114
|
).then((_) => groupBy(_, "modelId"));
|
|
43007
43115
|
return this.animationsData = e, e;
|
|
43008
43116
|
}
|
|
@@ -43011,7 +43119,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43011
43119
|
* @returns
|
|
43012
43120
|
*/
|
|
43013
43121
|
async fetchModelVisionsData() {
|
|
43014
|
-
const e = await this.#
|
|
43122
|
+
const e = await this.#r(await this.#f(MODEL_VISIONS_DATA_FILE_PATH)).then((_) => new Map(Object.entries(_)));
|
|
43015
43123
|
return this.modelVisionsData = e, e;
|
|
43016
43124
|
}
|
|
43017
43125
|
/**
|
|
@@ -43019,21 +43127,32 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43019
43127
|
* @returns
|
|
43020
43128
|
*/
|
|
43021
43129
|
async fetchSpacesData() {
|
|
43022
|
-
const e = await this.#
|
|
43023
|
-
await this.#
|
|
43130
|
+
const e = await this.#r(
|
|
43131
|
+
await this.#f(SPACES_DATA_FILE_PATH)
|
|
43024
43132
|
).then((_) => mapTreeNodeByKey(_, "sid"));
|
|
43025
43133
|
return this.spacesData = e, e;
|
|
43026
43134
|
}
|
|
43027
43135
|
async fetchFlowsData() {
|
|
43028
|
-
const e = await this.#
|
|
43029
|
-
await this.#
|
|
43136
|
+
const e = await this.#r(
|
|
43137
|
+
await this.#f(FLOWS_DATA_FILE_PATH)
|
|
43030
43138
|
);
|
|
43031
43139
|
return this.flowsData = e, e;
|
|
43032
43140
|
}
|
|
43033
43141
|
async fetchGisData() {
|
|
43034
|
-
const e = await this.#
|
|
43142
|
+
const e = await this.#r(await this.#f(GIS_DATA_FILE_PATH));
|
|
43035
43143
|
return this.gisData = e, e;
|
|
43036
43144
|
}
|
|
43145
|
+
async fetchGisPlotsData() {
|
|
43146
|
+
return await this.#r(
|
|
43147
|
+
await this.#f(GIS_PLOTS_DATA_FILE_PATH)
|
|
43148
|
+
);
|
|
43149
|
+
}
|
|
43150
|
+
async fetchFDSData() {
|
|
43151
|
+
const e = await this.#r(
|
|
43152
|
+
await this.#f(SCENE_NODE_FDS_DATA_FILE_PATH)
|
|
43153
|
+
);
|
|
43154
|
+
return this.fdsData = e, e;
|
|
43155
|
+
}
|
|
43037
43156
|
/**
|
|
43038
43157
|
* 格式化 Poi 数据完成 Poi Renderer 插件使用
|
|
43039
43158
|
*/
|
|
@@ -43099,7 +43218,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43099
43218
|
},
|
|
43100
43219
|
style: de,
|
|
43101
43220
|
dataSource: _(_e),
|
|
43102
|
-
fileUrl: !T?.assetId && !T?.fileId ? T?.url : T?.url ? this.#
|
|
43221
|
+
fileUrl: !T?.assetId && !T?.fileId ? T?.url : T?.url ? this.#d(T.url) : void 0
|
|
43103
43222
|
};
|
|
43104
43223
|
};
|
|
43105
43224
|
/**
|
|
@@ -43172,7 +43291,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43172
43291
|
Z = await $.loadModel(
|
|
43173
43292
|
{
|
|
43174
43293
|
id: k,
|
|
43175
|
-
url: this.#
|
|
43294
|
+
url: this.#d(J)
|
|
43176
43295
|
}
|
|
43177
43296
|
);
|
|
43178
43297
|
} catch (_e) {
|
|
@@ -43208,9 +43327,9 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43208
43327
|
opacity: 0.5
|
|
43209
43328
|
// temporary
|
|
43210
43329
|
})), Z = _e;
|
|
43211
|
-
} else isSpace(e.renderType) ? Z = createSpace(this.ssp, e, k) : q === "DOOR" ? Z = createDoor(this.ssp, e, k) : q === "STAIRCASE" ? Z = createStaircase(this.ssp, e, k) : q === "ELEVATOR" ? Z = createElevator(this.ssp, e, k) : q === "WATER_SURFACE" ? Z = createWaterSurface(this, e, k) : q === "DECAL" ? Z = await createDecal(this.ssp, e, k, J) : q === "GS" && J && (Z = await createGs3d(this.ssp, e, this.#
|
|
43330
|
+
} else isSpace(e.renderType) ? Z = createSpace(this.ssp, e, k) : q === "DOOR" ? Z = createDoor(this.ssp, e, k) : q === "STAIRCASE" ? Z = createStaircase(this.ssp, e, k) : q === "ELEVATOR" || q === "VENT" ? Z = createElevator(this.ssp, e, k) : q === "WINDOW" ? Z = createWindow(this.ssp, e, k) : q === "WATER_SURFACE" ? Z = createWaterSurface(this, e, k) : q === "DECAL" ? Z = await createDecal(this.ssp, e, k, J) : q === "GS" && J && (Z = await createGs3d(this.ssp, e, this.#d(J)));
|
|
43212
43331
|
if (Z) {
|
|
43213
|
-
de === !1 && Z.hide(), Z.name = T, Z.extraIds = C, F.decompose(Z.position, Z.quaternion, Z.scale);
|
|
43332
|
+
de === !1 && Z.hide(), Z.name = T, Z.extraIds = C, F.decompose(Z.position, Z.quaternion, Z.scale), (q === "ELEVATOR" || q === "VENT") && (Z.position.y = 0);
|
|
43214
43333
|
const _e = { ...e };
|
|
43215
43334
|
if (Reflect.deleteProperty(_e, "children"), Z.userData = _e, A && this.propertiesData) {
|
|
43216
43335
|
const Ce = this.propertiesData.get(M);
|
|
@@ -43295,6 +43414,24 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43295
43414
|
setPath(e) {
|
|
43296
43415
|
this.path = e;
|
|
43297
43416
|
}
|
|
43417
|
+
clearFDS() {
|
|
43418
|
+
return this.fdsManager.clear();
|
|
43419
|
+
}
|
|
43420
|
+
getFDSState() {
|
|
43421
|
+
return this.fdsManager.getState();
|
|
43422
|
+
}
|
|
43423
|
+
playFDS() {
|
|
43424
|
+
return this.fdsManager.play();
|
|
43425
|
+
}
|
|
43426
|
+
pauseFDS() {
|
|
43427
|
+
return this.fdsManager.pause();
|
|
43428
|
+
}
|
|
43429
|
+
toggleFDSPlay() {
|
|
43430
|
+
return this.fdsManager.togglePlay();
|
|
43431
|
+
}
|
|
43432
|
+
setFDSTime(e, _ = {}) {
|
|
43433
|
+
return this.fdsManager.setTime(e, _);
|
|
43434
|
+
}
|
|
43298
43435
|
/**
|
|
43299
43436
|
* 加载整个场景
|
|
43300
43437
|
*/
|
|
@@ -43303,9 +43440,9 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43303
43440
|
if (_ && this.setKey(_), A && this.setPath(A), !this.path) return Promise.reject("请设置 path");
|
|
43304
43441
|
this.flatData || await this.fetchFlatData(), this.progress.total = this.flatData?.length ?? 0;
|
|
43305
43442
|
const { version: R } = await this.fetchMetaData();
|
|
43306
|
-
if (R >= 1.2 && this.#
|
|
43307
|
-
if (await this.#
|
|
43308
|
-
!this.#l && this.#b && (this.#n || this.#y.addToViewport()), this.#
|
|
43443
|
+
if (R >= 1.2 && this.#u) {
|
|
43444
|
+
if (await this.#p(), !this.#l && !this.#b) return Promise.reject(`未授权的场景包:${this.path}`);
|
|
43445
|
+
!this.#l && this.#b && (this.#n || this.#y.addToViewport()), this.#u = !1;
|
|
43309
43446
|
} else R < 1.2 && await this.fetchTreeData();
|
|
43310
43447
|
const E = {
|
|
43311
43448
|
...defaultLoadSceneOptions,
|
|
@@ -43326,7 +43463,11 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43326
43463
|
const q = [
|
|
43327
43464
|
this.presetGis()
|
|
43328
43465
|
];
|
|
43329
|
-
E.applyPresetEffects && q.push(this.presetEffects()), E.loadPoi && q.push(this.loadPoi(E.refreshPoiByDataSource)), E.loadTopologies && q.push(this.loadTopologies()), E.loadFlowData && q.push(this.loadFlowData()),
|
|
43466
|
+
if (E.applyPresetEffects && q.push(this.presetEffects()), E.loadPoi && q.push(this.loadPoi(E.refreshPoiByDataSource)), E.loadTopologies && q.push(this.loadTopologies()), E.loadFlowData && q.push(this.loadFlowData()), E.loadFDS) {
|
|
43467
|
+
const P = typeof E.loadFDS == "string" ? E.loadFDS : E.fdsUrl;
|
|
43468
|
+
q.push(this.loadFDS(P));
|
|
43469
|
+
}
|
|
43470
|
+
await Promise.allSettled(q), E.needsModelsBoundsTree && this.ssp.computeModelsBoundsTree();
|
|
43330
43471
|
}
|
|
43331
43472
|
/**
|
|
43332
43473
|
* 加载场景并且加载语义化对象
|
|
@@ -43363,39 +43504,46 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43363
43504
|
if (!T || !T.length) return;
|
|
43364
43505
|
T.sort((x, M) => x.order - M.order);
|
|
43365
43506
|
const B = T.findLast((x) => x.url && x.visible === !0);
|
|
43366
|
-
|
|
43367
|
-
|
|
43368
|
-
|
|
43369
|
-
|
|
43370
|
-
|
|
43371
|
-
|
|
43372
|
-
|
|
43373
|
-
|
|
43374
|
-
|
|
43375
|
-
|
|
43376
|
-
|
|
43377
|
-
|
|
43378
|
-
|
|
43379
|
-
|
|
43380
|
-
|
|
43381
|
-
|
|
43382
|
-
|
|
43383
|
-
|
|
43384
|
-
|
|
43385
|
-
|
|
43386
|
-
|
|
43387
|
-
|
|
43388
|
-
|
|
43389
|
-
})
|
|
43390
|
-
|
|
43391
|
-
|
|
43392
|
-
|
|
43393
|
-
|
|
43394
|
-
|
|
43395
|
-
|
|
43396
|
-
|
|
43397
|
-
|
|
43398
|
-
|
|
43507
|
+
if (B) {
|
|
43508
|
+
this.terrainTilesRenderer = new TerrainTilesRenderer(this.ssp), q && (q.sort((C, k) => C.order - k.order), q.forEach((C) => {
|
|
43509
|
+
let k = OverlayType.XYZ;
|
|
43510
|
+
C.imageryType === "TMS" ? k = OverlayType.TMS : C.imageryType === "WMTS" && (k = OverlayType.WMTS), this.terrainTilesRenderer.addOverlay({
|
|
43511
|
+
id: C.id,
|
|
43512
|
+
type: k,
|
|
43513
|
+
url: C.url,
|
|
43514
|
+
opacity: C.visible ? 1 : 0,
|
|
43515
|
+
order: C.order
|
|
43516
|
+
});
|
|
43517
|
+
})), P && (P.sort((C, k) => C.order - k.order), P.forEach((C) => {
|
|
43518
|
+
const k = _(C.content);
|
|
43519
|
+
this.terrainTilesRenderer.addOverlay({
|
|
43520
|
+
id: C.id,
|
|
43521
|
+
type: OverlayType.GEOJSON,
|
|
43522
|
+
url: k.url ? this.#d(k.url) : void 0,
|
|
43523
|
+
geojson: k.geojson,
|
|
43524
|
+
strokeStyle: C.lineColor || "#5B8FF9",
|
|
43525
|
+
fillStyle: C.fillColor || "#1D4ED8",
|
|
43526
|
+
strokeWidth: C.lineWidth || 3,
|
|
43527
|
+
order: C.order || 0,
|
|
43528
|
+
opacity: C.visible ? 1 : 0
|
|
43529
|
+
});
|
|
43530
|
+
})), this.terrainTilesRenderer.setTerrain({
|
|
43531
|
+
id: B.id,
|
|
43532
|
+
url: B.url,
|
|
43533
|
+
type: TerrainType.QUANTIZED_MESH
|
|
43534
|
+
}), this.terrainTilesRenderer.enable(), this.terrainTilesRenderer.invalidate(
|
|
43535
|
+
A.longitude,
|
|
43536
|
+
A.latitude,
|
|
43537
|
+
A.altitude
|
|
43538
|
+
), this.terrainTilesRenderer.setOverlayVisible(this.terrainTilesRenderer.defaultImageryId, !1);
|
|
43539
|
+
const x = await this.fetchGisPlotsData().catch(() => []), M = this.terrainTilesRenderer.groundDecalManager;
|
|
43540
|
+
if (M && x && x.length)
|
|
43541
|
+
for (const C of x) {
|
|
43542
|
+
if (!C) continue;
|
|
43543
|
+
const k = gisPlotToAddOptions(C);
|
|
43544
|
+
k && M.addPlot(k);
|
|
43545
|
+
}
|
|
43546
|
+
}
|
|
43399
43547
|
}
|
|
43400
43548
|
}
|
|
43401
43549
|
}
|
|
@@ -43414,7 +43562,7 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43414
43562
|
$ && $.enabled && (this.atmospherePlugin.longitude = $.longitude, this.atmospherePlugin.latitude = $.latitude, this.atmospherePlugin.altitude = $.altitude), Object.assign(this.atmospherePlugin, { castShadow: it }), this.atmospherePlugin.target.copy(x), this.atmospherePlugin.distance = M.length(), this.atmospherePlugin.date.setMonth(Ce), this.atmospherePlugin.date.setDate(Ne), this.atmospherePlugin.date.setHours(Ke / 60), this.atmospherePlugin.date.setMinutes(Ke % 60), this.atmospherePlugin.start(), this.atmospherePlugin.updateModelLightingMask();
|
|
43415
43563
|
}
|
|
43416
43564
|
if (A && C && F.environment?.HDR !== "default" && !J && await this.ssp.setEnvironment({
|
|
43417
|
-
file: this.#
|
|
43565
|
+
file: this.#d(C),
|
|
43418
43566
|
background: F.environment?.background ?? !0
|
|
43419
43567
|
}), R && F.ssao && (this.ssp.setSSAO(F.ssao), F.ssao.enabled && warn("环境光遮蔽已开启,如卡顿请使用 ssp.setSSAO 关闭")), E && !J) {
|
|
43420
43568
|
const Ce = `${this.path}_directionalLight`;
|
|
@@ -43645,15 +43793,17 @@ class CpsSoonmanagerPlugin extends EventDispatcher {
|
|
|
43645
43793
|
}), _;
|
|
43646
43794
|
}
|
|
43647
43795
|
dispose() {
|
|
43648
|
-
this.sceneGroup && (this.ssp.removeObject(this.sceneGroup), this.sceneGroup = null), this.atmospherePlugin.dispose(), this.terrainTilesRenderer?.dispose();
|
|
43796
|
+
this.fdsManager.dispose(), this.sceneGroup && (this.ssp.removeObject(this.sceneGroup), this.sceneGroup = null), this.atmospherePlugin.dispose(), this.terrainTilesRenderer?.dispose();
|
|
43649
43797
|
}
|
|
43650
43798
|
}
|
|
43651
43799
|
export {
|
|
43652
43800
|
ANIMATIONS_DATA_FILE_PATH,
|
|
43653
43801
|
DATA_SOURCE_FILE_PATH,
|
|
43802
|
+
FDS_DATA_FILE_PATH,
|
|
43654
43803
|
FLAT_DATA_FILE_PATH,
|
|
43655
43804
|
FLOWS_DATA_FILE_PATH,
|
|
43656
43805
|
GIS_DATA_FILE_PATH,
|
|
43806
|
+
GIS_PLOTS_DATA_FILE_PATH,
|
|
43657
43807
|
LoadSceneAlgorithm,
|
|
43658
43808
|
META_DATA_FILE_PATH,
|
|
43659
43809
|
MODEL_VISIONS_DATA_FILE_PATH,
|
|
@@ -43662,9 +43812,11 @@ export {
|
|
|
43662
43812
|
PROPERTIES_DATA_FLEE_PATH,
|
|
43663
43813
|
PROPERTIES_KEY,
|
|
43664
43814
|
PoiContentTypeEnum,
|
|
43815
|
+
SCENE_NODE_FDS_DATA_FILE_PATH,
|
|
43665
43816
|
SEMANTIC_DATA_FILE_PATH,
|
|
43666
43817
|
SPACES_DATA_FILE_PATH,
|
|
43667
43818
|
TOPOLOGY_DATA_FILE_PATH,
|
|
43668
43819
|
TREE_DATA_FILE_PATH,
|
|
43669
43820
|
CpsSoonmanagerPlugin as default
|
|
43670
43821
|
};
|
|
43822
|
+
//# sourceMappingURL=index.esm.js.map
|