@vsleem-realsee-viewer/shared 2.0.4 → 2.0.6

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/index.mjs CHANGED
@@ -1,9 +1,6 @@
1
- var et = Object.defineProperty;
2
- var st = (i, t, e) => t in i ? et(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var o = (i, t, e) => st(i, typeof t != "symbol" ? t + "" : t, e);
4
- class y extends Error {
5
- constructor(t, e, s) {
6
- super(e), this.code = t, this.message = e, this.details = s, this.name = "Apprror", Object.setPrototypeOf(this, y.prototype);
1
+ class m extends Error {
2
+ constructor(t, e, i) {
3
+ super(e), this.code = t, this.message = e, this.details = i, this.name = "Apprror", Object.setPrototypeOf(this, m.prototype);
7
4
  }
8
5
  // 可选的:转换成 JSON 格式,方便返回给调用方
9
6
  toJSON() {
@@ -15,421 +12,421 @@ class y extends Error {
15
12
  };
16
13
  }
17
14
  }
18
- var N = /* @__PURE__ */ ((i) => (i[i.CADModel = 5] = "CADModel", i[i.BIMModel = 6] = "BIMModel", i[i.ForgeModel = 7] = "ForgeModel", i[i.ThreeDModel = 8] = "ThreeDModel", i[i.SkyMapModel = 9] = "SkyMapModel", i[i.ScaleModel = 10] = "ScaleModel", i))(N || {}), it = /* @__PURE__ */ ((i) => (i[i.Global = 0] = "Global", i))(it || {}), M = /* @__PURE__ */ ((i) => (i[i.Space = 0] = "Space", i[i.Model = 1] = "Model", i[i.Data = 2] = "Data", i))(M || {}), O = /* @__PURE__ */ ((i) => (i[i.Used = 0] = "Used", i[i.Enabled = 1] = "Enabled", i[i.Disabled = 2] = "Disabled", i))(O || {}), Y = /* @__PURE__ */ ((i) => (i[i.SUCCESS = 200] = "SUCCESS", i[i.ERROR = -1] = "ERROR", i[i.TIMEOUT = 401] = "TIMEOUT", i))(Y || {}), x = /* @__PURE__ */ ((i) => (i.GET = "GET", i.POST = "POST", i))(x || {}), R = /* @__PURE__ */ ((i) => (i.JSON = "application/json", i.FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8", i.FORM_DATA = "multipart/form-data;charset=UTF-8", i.OCTET_STREAM = "'application/octet-stream", i))(R || {}), nt = /* @__PURE__ */ ((i) => (i.Hw = "huawei", i.Ali = "aliyun", i.Hs = "hs", i.Aws = "amazon", i.Minio = "minio", i))(nt || {}), w = /* @__PURE__ */ ((i) => (i[i.GeoPointNoPlane = 9e3] = "GeoPointNoPlane", i[i.PointUnmappedGIS = 9010] = "PointUnmappedGIS", i[i.PointNoXYZ = 9011] = "PointNoXYZ", i[i.PointNoPlane = 9012] = "PointNoPlane", i[i.RelativePlaneUnmatch = 9020] = "RelativePlaneUnmatch", i[i.RelativeNoPlane = 9021] = "RelativeNoPlane", i[i.RelativeJsonError = 9022] = "RelativeJsonError", i[i.RequestCodeError = 9030] = "RequestCodeError", i[i.RequestResultError = 9031] = "RequestResultError", i[i.RequestUnknownError = 9032] = "RequestUnknownError", i))(w || {});
19
- const rt = {
15
+ var P = /* @__PURE__ */ ((s) => (s[s.CADModel = 5] = "CADModel", s[s.BIMModel = 6] = "BIMModel", s[s.ForgeModel = 7] = "ForgeModel", s[s.ThreeDModel = 8] = "ThreeDModel", s[s.SkyMapModel = 9] = "SkyMapModel", s[s.ScaleModel = 10] = "ScaleModel", s))(P || {}), K = /* @__PURE__ */ ((s) => (s[s.Global = 0] = "Global", s))(K || {}), M = /* @__PURE__ */ ((s) => (s[s.Space = 0] = "Space", s[s.Model = 1] = "Model", s[s.Data = 2] = "Data", s))(M || {}), D = /* @__PURE__ */ ((s) => (s[s.Used = 0] = "Used", s[s.Enabled = 1] = "Enabled", s[s.Disabled = 2] = "Disabled", s))(D || {}), F = /* @__PURE__ */ ((s) => (s[s.SUCCESS = 200] = "SUCCESS", s[s.ERROR = -1] = "ERROR", s[s.TIMEOUT = 401] = "TIMEOUT", s))(F || {}), x = /* @__PURE__ */ ((s) => (s.GET = "GET", s.POST = "POST", s))(x || {}), I = /* @__PURE__ */ ((s) => (s.JSON = "application/json", s.FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8", s.FORM_DATA = "multipart/form-data;charset=UTF-8", s.OCTET_STREAM = "'application/octet-stream", s))(I || {}), tt = /* @__PURE__ */ ((s) => (s.Hw = "huawei", s.Ali = "aliyun", s.Hs = "hs", s.Aws = "amazon", s.Minio = "minio", s))(tt || {}), y = /* @__PURE__ */ ((s) => (s[s.GeoPointNoPlane = 9e3] = "GeoPointNoPlane", s[s.PointUnmappedGIS = 9010] = "PointUnmappedGIS", s[s.PointNoXYZ = 9011] = "PointNoXYZ", s[s.PointNoPlane = 9012] = "PointNoPlane", s[s.RelativePlaneUnmatch = 9020] = "RelativePlaneUnmatch", s[s.RelativeNoPlane = 9021] = "RelativeNoPlane", s[s.RelativeJsonError = 9022] = "RelativeJsonError", s[s.RequestCodeError = 9030] = "RequestCodeError", s[s.RequestResultError = 9031] = "RequestResultError", s[s.RequestUnknownError = 9032] = "RequestUnknownError", s))(y || {});
16
+ const et = {
20
17
  baseUrl: "https://vsleem.com/api",
21
18
  obsType: "hs"
22
- }, ot = {
19
+ }, st = {
23
20
  isTransformResponse: !0,
24
21
  joinBaseUrl: !0,
25
22
  withAuthorize: !0
26
- }, at = {
23
+ }, it = {
27
24
  url: "",
28
25
  method: x.GET,
29
26
  headers: {}
30
- }, B = { ...rt };
31
- function ht(i) {
32
- Object.assign(B, i);
27
+ }, U = { ...et };
28
+ function nt(s) {
29
+ Object.assign(U, s);
33
30
  }
34
- async function T(i, t) {
35
- const e = { ...ot, ...t }, s = { ...at, ...i };
31
+ async function b(s, t) {
32
+ const e = { ...st, ...t }, i = { ...it, ...s };
36
33
  try {
37
- const n = ct(s, e), { url: r, ...a } = n, c = await (await window.fetch(r, a)).json();
38
- return lt(c, e);
34
+ const n = ot(i, e), { url: o, ...r } = n, h = await (await window.fetch(o, r)).json();
35
+ return rt(h, e);
39
36
  } catch (n) {
40
- return ut(n);
37
+ return at(n);
41
38
  }
42
39
  }
43
- function ct(i, t) {
44
- const { baseUrl: e, authorizeCode: s } = B, { joinBaseUrl: n, withAuthorize: r } = t;
45
- let { url: a, method: h, headers: c = {}, params: u, data: f } = i;
46
- n && e && (a = `${e}${a}`), h = h == null ? void 0 : h.toUpperCase();
47
- const l = { ...c };
48
- if (/^https?:\/\/.+$/i.test(e ?? "") ? l.PlatForm = new URL(e ?? "").host : l.PlatForm = new URL(window.location.href).host, r && s && (l.AuthorizationCode = s), h === x.POST && !l["Content-Type"] && (l["Content-Type"] = R.JSON), h === x.GET && u) {
49
- const b = new URLSearchParams(u);
50
- a += `?${b.toString()}`;
40
+ function ot(s, t) {
41
+ const { baseUrl: e, authorizeCode: i } = U, { joinBaseUrl: n, withAuthorize: o } = t;
42
+ let { url: r, method: a, headers: h = {}, params: l, data: c } = s;
43
+ n && e && (r = `${e}${r}`), a = a?.toUpperCase();
44
+ const u = { ...h };
45
+ if (/^https?:\/\/.+$/i.test(e ?? "") ? u.PlatForm = new URL(e ?? "").host : u.PlatForm = new URL(window.location.href).host, o && i && (u.AuthorizationCode = i), a === x.POST && !u["Content-Type"] && (u["Content-Type"] = I.JSON), a === x.GET && l) {
46
+ const p = new URLSearchParams(l);
47
+ r += `?${p.toString()}`;
51
48
  }
52
49
  let d;
53
- return h === x.POST && (d = l["Content-Type"] === R.JSON ? JSON.stringify(f || {}) : f), {
54
- url: a,
55
- method: h,
56
- headers: l,
50
+ return a === x.POST && (d = u["Content-Type"] === I.JSON ? JSON.stringify(c || {}) : c), {
51
+ url: r,
52
+ method: a,
53
+ headers: u,
57
54
  body: d
58
55
  };
59
56
  }
60
- function lt(i, t) {
57
+ function rt(s, t) {
61
58
  if (!t.isTransformResponse)
62
- return i;
63
- if (!i)
64
- throw new y(w.RequestResultError, "请求返回的结果错误");
65
- const { code: e, data: s, msg: n } = i;
66
- if (e === Y.SUCCESS)
67
59
  return s;
68
- throw new y(w.RequestCodeError, n || "请求返回的Code错误");
60
+ if (!s)
61
+ throw new m(y.RequestResultError, "请求返回的结果错误");
62
+ const { code: e, data: i, msg: n } = s;
63
+ if (e === F.SUCCESS)
64
+ return i;
65
+ throw new m(y.RequestCodeError, n || "请求返回的Code错误");
69
66
  }
70
- function ut(i) {
71
- throw i instanceof Error ? i : new y(
72
- w.RequestUnknownError,
73
- typeof i == "string" ? i : "未知的请求错误"
67
+ function at(s) {
68
+ throw s instanceof Error ? s : new m(
69
+ y.RequestUnknownError,
70
+ typeof s == "string" ? s : "未知的请求错误"
74
71
  );
75
72
  }
76
73
  const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
77
74
  __proto__: null,
78
- request: T,
79
- setRequestGlobalConfig: ht
75
+ request: b,
76
+ setRequestGlobalConfig: nt
80
77
  }, Symbol.toStringTag, { value: "Module" }));
81
- function G(i, t) {
82
- return T(
78
+ function Y(s, t) {
79
+ return b(
83
80
  {
84
81
  url: "/project/jssdk/cs/list",
85
82
  method: x.GET,
86
- params: i
83
+ params: s
87
84
  },
88
85
  t
89
86
  );
90
87
  }
91
- function $(i, t) {
92
- return T(
88
+ function B(s, t) {
89
+ return b(
93
90
  {
94
91
  url: "/project/jssdk/cs/bind",
95
92
  method: x.POST,
96
- data: i
93
+ data: s
97
94
  },
98
95
  t
99
96
  );
100
97
  }
101
- function L(i, t) {
102
- return T(
98
+ function C(s, t) {
99
+ return b(
103
100
  {
104
101
  url: "/project/jssdk/cs/save",
105
102
  method: x.POST,
106
- data: i
103
+ data: s
107
104
  },
108
105
  t
109
106
  );
110
107
  }
111
- function _(i, t) {
112
- return T(
108
+ function G(s, t) {
109
+ return b(
113
110
  {
114
111
  url: "/project/jssdk/cs/delete",
115
112
  method: x.POST,
116
- data: i
113
+ data: s
117
114
  },
118
115
  t
119
116
  );
120
117
  }
121
- function Z(i, t) {
122
- return T(
118
+ function $(s, t) {
119
+ return b(
123
120
  {
124
121
  url: "/project/jssdk/cs/mapping",
125
122
  method: x.POST,
126
- data: i
123
+ data: s
127
124
  },
128
125
  t
129
126
  );
130
127
  }
131
- function q(i, t) {
132
- return T(
128
+ function _(s, t) {
129
+ return b(
133
130
  {
134
131
  url: "/project/jssdk/cs/mapping/query",
135
132
  method: x.GET,
136
- params: i
133
+ params: s
137
134
  },
138
135
  t
139
136
  );
140
137
  }
141
- function ft(i, t = {
138
+ function ht(s, t = {
142
139
  isTransformResponse: !1,
143
140
  joinBaseUrl: !1,
144
141
  withAuthorize: !1
145
142
  }) {
146
- return T(
143
+ return b(
147
144
  {
148
- url: i,
145
+ url: s,
149
146
  method: x.GET
150
147
  },
151
148
  t
152
149
  );
153
150
  }
154
- const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
151
+ const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
155
152
  __proto__: null,
156
- bindCoordinate: $,
157
- getCoordinateList: G,
158
- getImageInfo: ft,
159
- getMappingRelation: q,
160
- mapingCoordinate: Z,
161
- removeCoordinate: _,
162
- saveCoordinate: L
163
- }, Symbol.toStringTag, { value: "Module" })), dt = typeof window < "u", mt = Object.prototype.toString;
164
- function v(i, t) {
165
- return mt.call(i) === `[object ${t}]`;
153
+ bindCoordinate: B,
154
+ getCoordinateList: Y,
155
+ getImageInfo: ht,
156
+ getMappingRelation: _,
157
+ mapingCoordinate: $,
158
+ removeCoordinate: G,
159
+ saveCoordinate: C
160
+ }, Symbol.toStringTag, { value: "Module" })), ct = typeof window < "u", lt = Object.prototype.toString;
161
+ function v(s, t) {
162
+ return lt.call(s) === `[object ${t}]`;
166
163
  }
167
- function J(i) {
168
- return typeof i < "u";
164
+ function Z(s) {
165
+ return typeof s < "u";
169
166
  }
170
- function H(i) {
171
- return !J(i);
167
+ function q(s) {
168
+ return !Z(s);
172
169
  }
173
- function A(i) {
174
- return i !== null && v(i, "Object");
170
+ function j(s) {
171
+ return s !== null && v(s, "Object");
175
172
  }
176
- function V(i) {
177
- return i === null;
173
+ function J(s) {
174
+ return s === null;
178
175
  }
179
- function yt(i) {
180
- return v(i, "Date");
176
+ function ut(s) {
177
+ return v(s, "Date");
181
178
  }
182
- function wt(i) {
183
- return v(i, "String");
179
+ function dt(s) {
180
+ return v(s, "String");
184
181
  }
185
- function j(i) {
186
- return typeof i == "function";
182
+ function O(s) {
183
+ return typeof s == "function";
187
184
  }
188
- function gt(i) {
189
- return v(i, "Boolean");
185
+ function ft(s) {
186
+ return v(s, "Boolean");
190
187
  }
191
- function pt(i) {
192
- return v(i, "RegExp");
188
+ function mt(s) {
189
+ return v(s, "RegExp");
193
190
  }
194
- function P(i) {
195
- return i && Array.isArray(i);
191
+ function S(s) {
192
+ return s && Array.isArray(s);
196
193
  }
197
- function xt(i) {
198
- return typeof window < "u" && v(i, "Window");
194
+ function yt(s) {
195
+ return typeof window < "u" && v(s, "Window");
199
196
  }
200
- function Mt(i) {
201
- return A(i) && !!i.tagName;
197
+ function wt(s) {
198
+ return j(s) && !!s.tagName;
202
199
  }
203
- function vt(i) {
204
- return typeof i == "number" || /^\d+(\.\d+)?$/.test(i);
200
+ function pt(s) {
201
+ return typeof s == "number" || /^\d+(\.\d+)?$/.test(s);
205
202
  }
206
- function z(i) {
207
- return v(Number(i), "Number");
203
+ function E(s) {
204
+ return v(Number(s), "Number");
208
205
  }
209
- function bt(i, t) {
210
- return JSON.stringify(i) === JSON.stringify(t);
206
+ function gt(s, t) {
207
+ return JSON.stringify(s) === JSON.stringify(t);
211
208
  }
212
- function St(i) {
213
- return H(i) || V(i);
209
+ function xt(s) {
210
+ return q(s) || J(s);
214
211
  }
215
- function Tt(i) {
216
- return v(i, "Promise") && A(i) && j(i.then) && j(i.catch);
212
+ function Mt(s) {
213
+ return v(s, "Promise") && j(s) && O(s.then) && O(s.catch);
217
214
  }
218
- function W(i) {
219
- return E(i, /* @__PURE__ */ new WeakMap());
215
+ function H(s) {
216
+ return T(s, /* @__PURE__ */ new WeakMap());
220
217
  }
221
- function E(i, t) {
222
- if (typeof i != "object" || i === null)
223
- return i;
224
- if (t.has(i))
225
- return t.get(i);
218
+ function T(s, t) {
219
+ if (typeof s != "object" || s === null)
220
+ return s;
221
+ if (t.has(s))
222
+ return t.get(s);
226
223
  let e;
227
- if (i instanceof Date)
228
- return e = new Date(i), t.set(i, e), e;
229
- if (i instanceof RegExp)
230
- return e = new RegExp(i), t.set(i, e), e;
231
- if (i instanceof Map)
232
- return e = /* @__PURE__ */ new Map(), t.set(i, e), i.forEach((n, r) => {
233
- e.set(r, E(n, t));
224
+ if (s instanceof Date)
225
+ return e = new Date(s), t.set(s, e), e;
226
+ if (s instanceof RegExp)
227
+ return e = new RegExp(s), t.set(s, e), e;
228
+ if (s instanceof Map)
229
+ return e = /* @__PURE__ */ new Map(), t.set(s, e), s.forEach((n, o) => {
230
+ e.set(o, T(n, t));
234
231
  }), e;
235
- if (i instanceof Set)
236
- return e = /* @__PURE__ */ new Set(), t.set(i, e), i.forEach((n) => {
237
- e.add(E(n, t));
232
+ if (s instanceof Set)
233
+ return e = /* @__PURE__ */ new Set(), t.set(s, e), s.forEach((n) => {
234
+ e.add(T(n, t));
238
235
  }), e;
239
- if (ArrayBuffer.isView(i))
240
- return e = new i.constructor(
241
- i.buffer.slice(0),
242
- i.byteOffset,
243
- i.byteLength
244
- ), t.set(i, e), e;
245
- if (i instanceof ArrayBuffer)
246
- return e = i.slice(0), t.set(i, e), e;
247
- if (Array.isArray(i)) {
248
- e = [], t.set(i, e);
249
- for (let n = 0; n < i.length; n++)
250
- n in i && (e[n] = E(i[n], t));
236
+ if (ArrayBuffer.isView(s))
237
+ return e = new s.constructor(
238
+ s.buffer.slice(0),
239
+ s.byteOffset,
240
+ s.byteLength
241
+ ), t.set(s, e), e;
242
+ if (s instanceof ArrayBuffer)
243
+ return e = s.slice(0), t.set(s, e), e;
244
+ if (Array.isArray(s)) {
245
+ e = [], t.set(s, e);
246
+ for (let n = 0; n < s.length; n++)
247
+ n in s && (e[n] = T(s[n], t));
251
248
  return e;
252
249
  }
253
- e = Object.create(Object.getPrototypeOf(i)), t.set(i, e);
254
- for (const n in i)
255
- Object.prototype.hasOwnProperty.call(i, n) && (e[n] = E(i[n], t));
256
- const s = Object.getOwnPropertySymbols(i);
257
- for (const n of s)
258
- Object.prototype.propertyIsEnumerable.call(i, n) && (e[n] = E(i[n], t));
250
+ e = Object.create(Object.getPrototypeOf(s)), t.set(s, e);
251
+ for (const n in s)
252
+ Object.prototype.hasOwnProperty.call(s, n) && (e[n] = T(s[n], t));
253
+ const i = Object.getOwnPropertySymbols(s);
254
+ for (const n of i)
255
+ Object.prototype.propertyIsEnumerable.call(s, n) && (e[n] = T(s[n], t));
259
256
  return e;
260
257
  }
261
- function Pt(i, t, e = !1) {
262
- let s;
263
- const n = function(...r) {
264
- const a = this, h = e && !s;
265
- s && clearTimeout(s), s = setTimeout(() => {
266
- s = void 0, e || i.apply(a, r);
267
- }, t), h && i.apply(a, r);
258
+ function vt(s, t, e = !1) {
259
+ let i;
260
+ const n = function(...o) {
261
+ const r = this, a = e && !i;
262
+ i && clearTimeout(i), i = setTimeout(() => {
263
+ i = void 0, e || s.apply(r, o);
264
+ }, t), a && s.apply(r, o);
268
265
  };
269
266
  return n.cancel = () => {
270
- s && clearTimeout(s), s = void 0;
267
+ i && clearTimeout(i), i = void 0;
271
268
  }, n;
272
269
  }
273
- function Et(i, t, e = !1) {
274
- let s, n;
275
- const r = function(...a) {
276
- const h = this;
277
- n ? (clearTimeout(s), s = setTimeout(
270
+ function bt(s, t, e = !1) {
271
+ let i, n;
272
+ const o = function(...r) {
273
+ const a = this;
274
+ n ? (clearTimeout(i), i = setTimeout(
278
275
  () => {
279
- Date.now() - n >= t && (i.apply(h, a), n = Date.now());
276
+ Date.now() - n >= t && (s.apply(a, r), n = Date.now());
280
277
  },
281
278
  t - (Date.now() - n)
282
- )) : (e && i.apply(h, a), n = Date.now());
279
+ )) : (e && s.apply(a, r), n = Date.now());
283
280
  };
284
- return r.cancel = () => {
285
- clearTimeout(s), s = void 0, n = void 0;
286
- }, r;
281
+ return o.cancel = () => {
282
+ clearTimeout(i), i = void 0, n = void 0;
283
+ }, o;
287
284
  }
288
- function k(i, ...t) {
289
- if (!t.length) return i;
285
+ function R(s, ...t) {
286
+ if (!t.length) return s;
290
287
  const e = t.shift();
291
- return e === void 0 ? i : (I(i) && I(e) && Object.keys(e).forEach((s) => {
292
- const n = i[s], r = e[s];
293
- Array.isArray(n) && Array.isArray(r) ? i[s] = [...n, ...r] : I(n) && I(r) ? i[s] = k({ ...n }, r) : r !== void 0 && (i[s] = r);
294
- }), k(i, ...t));
288
+ return e === void 0 ? s : (z(s) && z(e) && Object.keys(e).forEach((i) => {
289
+ const n = s[i], o = e[i];
290
+ Array.isArray(n) && Array.isArray(o) ? s[i] = [...n, ...o] : z(n) && z(o) ? s[i] = R({ ...n }, o) : o !== void 0 && (s[i] = o);
291
+ }), R(s, ...t));
295
292
  }
296
- function I(i) {
297
- return i !== null && typeof i == "object" && !Array.isArray(i);
293
+ function z(s) {
294
+ return s !== null && typeof s == "object" && !Array.isArray(s);
298
295
  }
299
- function Q(i, ...t) {
300
- if (!t.length) return i;
296
+ function V(s, ...t) {
297
+ if (!t.length) return s;
301
298
  for (const e of t)
302
- e != null && typeof e == "object" && Object.keys(e).forEach((s) => {
303
- const n = e[s], r = i[s];
304
- n !== null && typeof n == "object" && !Array.isArray(n) ? ((!r || typeof r != "object") && (i[s] = {}), Q(i[s], n)) : i[s] = n;
299
+ e != null && typeof e == "object" && Object.keys(e).forEach((i) => {
300
+ const n = e[i], o = s[i];
301
+ n !== null && typeof n == "object" && !Array.isArray(n) ? ((!o || typeof o != "object") && (s[i] = {}), V(s[i], n)) : s[i] = n;
305
302
  });
306
- return i;
303
+ return s;
307
304
  }
308
- function Nt(i, t = {}) {
309
- return new Promise((e, s) => {
310
- const n = C(i);
311
- if (zt(n)) {
305
+ function St(s, t = {}) {
306
+ return new Promise((e, i) => {
307
+ const n = L(s);
308
+ if (Tt(n)) {
312
309
  e(!0);
313
310
  return;
314
311
  }
315
- const r = document.createElement("script");
316
- r.src = i, Object.entries(t).forEach(([a, h]) => {
317
- h !== !1 && r.setAttribute(a, h === !0 ? "" : String(h));
318
- }), r.onload = () => {
312
+ const o = document.createElement("script");
313
+ o.src = s, Object.entries(t).forEach(([r, a]) => {
314
+ a !== !1 && o.setAttribute(r, a === !0 ? "" : String(a));
315
+ }), o.onload = () => {
319
316
  e(!0);
320
- }, r.onerror = () => {
321
- document.head.removeChild(r), s(new Error(`Failed to load script: ${i}`));
322
- }, document.head.appendChild(r);
317
+ }, o.onerror = () => {
318
+ document.head.removeChild(o), i(new Error(`Failed to load script: ${s}`));
319
+ }, document.head.appendChild(o);
323
320
  });
324
321
  }
325
- function zt(i) {
326
- const t = C(i);
327
- return Array.from(document.scripts).some((e) => C(e.src) === t);
322
+ function Tt(s) {
323
+ const t = L(s);
324
+ return Array.from(document.scripts).some((e) => L(e.src) === t);
328
325
  }
329
- function C(i) {
326
+ function L(s) {
330
327
  try {
331
- const t = new URL(i, window.location.href);
328
+ const t = new URL(s, window.location.href);
332
329
  return `${t.origin}${t.pathname}`;
333
330
  } catch {
334
- return i;
331
+ return s;
335
332
  }
336
333
  }
337
- function Dt(i, t, e, s) {
338
- const n = Math.min(i / e, t / s), r = e * n, a = s * n;
334
+ function Pt(s, t, e, i) {
335
+ const n = Math.min(s / e, t / i), o = e * n, r = i * n;
339
336
  return {
340
337
  scale: n,
341
- x: (i - r) / 2,
338
+ x: (s - o) / 2,
342
339
  // 居中计算的X起点
343
- y: (t - a) / 2,
340
+ y: (t - r) / 2,
344
341
  // 居中计算的Y起点
345
- sw: r,
346
- sh: a
342
+ sw: o,
343
+ sh: r
347
344
  };
348
345
  }
349
- function It(i, t, e) {
346
+ function Et(s, t, e) {
350
347
  return {
351
- x: i * e.scale + e.x,
348
+ x: s * e.scale + e.x,
352
349
  // 缩放后加上偏移量
353
350
  y: t * e.scale + e.y
354
351
  };
355
352
  }
356
- function Ot(i, t, e) {
353
+ function Nt(s, t, e) {
357
354
  return {
358
- x: (i - e.x) / e.scale,
355
+ x: (s - e.x) / e.scale,
359
356
  // 减去偏移量后缩放到模型尺寸
360
357
  y: (t - e.y) / e.scale
361
358
  };
362
359
  }
363
- function Rt(i) {
364
- console.warn(`[warn]:${i}`);
360
+ function zt(s) {
361
+ console.warn(`[warn]:${s}`);
365
362
  }
366
- function Lt(i) {
367
- throw new Error(`[error]:${i}`);
363
+ function Dt(s) {
364
+ throw new Error(`[error]:${s}`);
368
365
  }
369
- const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
366
+ const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
370
367
  __proto__: null,
371
- cloneDeep: W,
372
- debounce: Pt,
373
- deepMerge: k,
374
- deepMergeProps: Q,
375
- error: Lt,
376
- getImageTransform: Dt,
377
- inBrowser: dt,
368
+ cloneDeep: H,
369
+ debounce: vt,
370
+ deepMerge: R,
371
+ deepMergeProps: V,
372
+ error: Dt,
373
+ getImageTransform: Pt,
374
+ inBrowser: ct,
378
375
  is: v,
379
- isArray: P,
380
- isBoolean: gt,
381
- isDate: yt,
382
- isDef: J,
383
- isElement: Mt,
384
- isFunction: j,
385
- isNull: V,
386
- isNullOrUnDef: St,
387
- isNumber: z,
388
- isNumeric: vt,
389
- isObject: A,
390
- isPromise: Tt,
391
- isRegExp: pt,
392
- isSameValue: bt,
393
- isString: wt,
394
- isUnDef: H,
395
- isWindow: xt,
396
- loadScript: Nt,
397
- throttle: Et,
398
- toCanvasCoord: It,
399
- toModelCoord: Ot,
400
- warn: Rt
376
+ isArray: S,
377
+ isBoolean: ft,
378
+ isDate: ut,
379
+ isDef: Z,
380
+ isElement: wt,
381
+ isFunction: O,
382
+ isNull: J,
383
+ isNullOrUnDef: xt,
384
+ isNumber: E,
385
+ isNumeric: pt,
386
+ isObject: j,
387
+ isPromise: Mt,
388
+ isRegExp: mt,
389
+ isSameValue: gt,
390
+ isString: dt,
391
+ isUnDef: q,
392
+ isWindow: yt,
393
+ loadScript: St,
394
+ throttle: bt,
395
+ toCanvasCoord: Et,
396
+ toModelCoord: Nt,
397
+ warn: zt
401
398
  }, Symbol.toStringTag, { value: "Module" }));
402
- class m {
399
+ class f {
400
+ // 直角坐标系坐标
401
+ x = 0;
402
+ y = 0;
403
+ z = 0;
404
+ // 地理坐标系坐标
405
+ lat = 0;
406
+ // 经度 (longitude)
407
+ lon = 0;
408
+ // 纬度 (latitude)
409
+ alt = 0;
410
+ // 高度 (altitude)
411
+ // 欧拉角
412
+ yaw = 0;
413
+ // 偏航角
414
+ pitch = 0;
415
+ // 俯仰角
416
+ roll = 0;
417
+ // 翻滚角
418
+ // 状态标志
419
+ hasXYZ = !1;
420
+ // 是否有直角坐标
421
+ hasGeo = !1;
422
+ // 是否有地理坐标
423
+ hasAngle = !1;
424
+ // 是否有角度信息
425
+ plane = "xy";
403
426
  // 默认平面 ('xy' 或 'xz')
404
427
  constructor(t) {
405
- // 直角坐标系坐标
406
- o(this, "x", 0);
407
- o(this, "y", 0);
408
- o(this, "z", 0);
409
- // 地理坐标系坐标
410
- o(this, "lat", 0);
411
- // 经度 (longitude)
412
- o(this, "lon", 0);
413
- // 纬度 (latitude)
414
- o(this, "alt", 0);
415
- // 高度 (altitude)
416
- // 欧拉角
417
- o(this, "yaw", 0);
418
- // 偏航角
419
- o(this, "pitch", 0);
420
- // 俯仰角
421
- o(this, "roll", 0);
422
- // 翻滚角
423
- // 状态标志
424
- o(this, "hasXYZ", !1);
425
- // 是否有直角坐标
426
- o(this, "hasGeo", !1);
427
- // 是否有地理坐标
428
- o(this, "hasAngle", !1);
429
- // 是否有角度信息
430
- o(this, "plane", "xy");
431
- const { x: e, y: s, z: n, lat: r, lon: a, alt: h, yaw: c, pitch: u, roll: f, plane: l = "xy" } = t || {};
432
- z(e) && z(s) && (this.x = Number(e) || 0, this.y = Number(s) || 0, this.z = Number(n) || 0, this.plane = l, this.hasXYZ = !0), z(r) && z(a) && Number(r) !== 0 && Number(a) !== 0 && (this.lat = Number(r) || 0, this.lon = Number(a) || 0, this.alt = Number(h) || 0, this.hasGeo = !0), (c !== void 0 || u !== void 0 || f !== void 0) && (this.yaw = Number(c) || 0, this.pitch = Number(u) || 0, this.roll = Number(f) || 0, this.hasAngle = !0);
428
+ const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: h, pitch: l, roll: c, plane: u = "xy" } = t || {};
429
+ E(e) && E(i) && (this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, this.plane = u, this.hasXYZ = !0), E(o) && E(r) && Number(o) !== 0 && Number(r) !== 0 && (this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, this.hasGeo = !0), (h !== void 0 || l !== void 0 || c !== void 0) && (this.yaw = Number(h) || 0, this.pitch = Number(l) || 0, this.roll = Number(c) || 0, this.hasAngle = !0);
433
430
  }
434
431
  /**
435
432
  * 计算两点之间的三维距离
@@ -481,9 +478,9 @@ class m {
481
478
  * @param pc 点C
482
479
  * @returns 夹角角度 (0-180度)
483
480
  */
484
- static angleXZ(t, e, s) {
485
- const n = { x: t.x - e.x, z: t.z - e.z }, r = { x: s.x - e.x, z: s.z - e.z }, a = n.x * r.x + n.z * r.z, h = Math.sqrt(n.x ** 2 + n.z ** 2), c = Math.sqrt(r.x ** 2 + r.z ** 2), u = Math.max(-1, Math.min(1, a / (h * c))), l = Math.acos(u) * 180 / Math.PI;
486
- return Math.min(l, 360 - l);
481
+ static angleXZ(t, e, i) {
482
+ const n = { x: t.x - e.x, z: t.z - e.z }, o = { x: i.x - e.x, z: i.z - e.z }, r = n.x * o.x + n.z * o.z, a = Math.sqrt(n.x ** 2 + n.z ** 2), h = Math.sqrt(o.x ** 2 + o.z ** 2), l = Math.max(-1, Math.min(1, r / (a * h))), u = Math.acos(l) * 180 / Math.PI;
483
+ return Math.min(u, 360 - u);
487
484
  }
488
485
  /**
489
486
  * 从字符串解析点坐标 ("x,y,z")
@@ -492,8 +489,8 @@ class m {
492
489
  */
493
490
  static toParse(t) {
494
491
  if (t) {
495
- const e = t == null ? void 0 : t.split(",").map((s) => Number(s) || 0);
496
- return new m({ x: e[0], y: e[1], z: e[2] });
492
+ const e = t?.split(",").map((i) => Number(i) || 0);
493
+ return new f({ x: e[0], y: e[1], z: e[2] });
497
494
  }
498
495
  }
499
496
  /**
@@ -512,25 +509,25 @@ class m {
512
509
  * @returns 转换后的点
513
510
  * @throws AppError 当转换失败时抛出异常
514
511
  */
515
- projection(t, e, s) {
512
+ projection(t, e, i) {
516
513
  try {
517
- if ((e == null ? void 0 : e.id) === (s == null ? void 0 : s.id))
518
- return new m(this);
519
- if ((e == null ? void 0 : e.modelType) === N.SkyMapModel) {
520
- const { refPoint: n } = (e == null ? void 0 : e.relativeMap) || {};
514
+ if (e?.id === i?.id)
515
+ return new f(this);
516
+ if (e?.modelType === P.SkyMapModel) {
517
+ const { refPoint: n } = e?.relativeMap || {};
521
518
  if (this.hasGeo && n) {
522
- const r = D.LLHToXYZ(this, n);
523
- return this.x = r.x, this.y = r.y, this.z = r.z, this.hasXYZ = !0, this.project(t);
519
+ const o = N.LLHToXYZ(this, n);
520
+ return this.x = o.x, this.y = o.y, this.z = o.z, this.hasXYZ = !0, this.project(t);
524
521
  }
525
- throw new y(w.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
522
+ throw new m(y.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
526
523
  }
527
- if ((s == null ? void 0 : s.modelType) === N.SkyMapModel) {
528
- const { refPoint: n } = (s == null ? void 0 : s.relativeMap) || {}, r = this.project(t);
529
- if (r != null && r.hasXYZ && n) {
530
- const a = D.XYZToLLH(r, n);
531
- return r.lat = a.lat, r.lon = a.lon, r.alt = a.alt, r.hasGeo = !0, r;
524
+ if (i?.modelType === P.SkyMapModel) {
525
+ const { refPoint: n } = i?.relativeMap || {}, o = this.project(t);
526
+ if (o?.hasXYZ && n) {
527
+ const r = N.XYZToLLH(o, n);
528
+ return o.lat = r.lat, o.lon = r.lon, o.alt = r.alt, o.hasGeo = !0, o;
532
529
  }
533
- throw new y(w.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
530
+ throw new m(y.PointUnmappedGIS, "没有完成GIS与其他空间的映射");
534
531
  }
535
532
  return this.project(t);
536
533
  } catch {
@@ -545,12 +542,12 @@ class m {
545
542
  */
546
543
  project(t) {
547
544
  if (!this.hasXYZ)
548
- throw new y(w.PointNoXYZ, "点没有xxz坐标信息");
545
+ throw new m(y.PointNoXYZ, "点没有xxz坐标信息");
549
546
  if (this.plane === "xz")
550
547
  return this.projectXZ(t);
551
548
  if (this.plane === "xy")
552
549
  return this.projectXY(t);
553
- throw new y(w.PointNoPlane, "点的plane应为xz或xy");
550
+ throw new m(y.PointNoPlane, "点的plane应为xz或xy");
554
551
  }
555
552
  /**
556
553
  * XZ平面投影转换
@@ -558,10 +555,10 @@ class m {
558
555
  * @returns 转换后的点
559
556
  */
560
557
  projectXZ(t) {
561
- const e = new m(this);
558
+ const e = new f(this);
562
559
  e.x *= t.scale, e.y *= t.scale, e.z *= t.scale, e.yaw !== void 0 && (e.yaw += t.yaw);
563
- const s = e.x * Math.cos(t.yaw) - e.z * Math.sin(t.yaw), n = e.x * Math.sin(t.yaw) + e.z * Math.cos(t.yaw);
564
- return e.x = s + t.x, e.y += t.y, e.z = n + t.z, e;
560
+ const i = e.x * Math.cos(t.yaw) - e.z * Math.sin(t.yaw), n = e.x * Math.sin(t.yaw) + e.z * Math.cos(t.yaw);
561
+ return e.x = i + t.x, e.y += t.y, e.z = n + t.z, e;
565
562
  }
566
563
  /**
567
564
  * XY平面投影转换
@@ -569,73 +566,73 @@ class m {
569
566
  * @returns 转换后的点
570
567
  */
571
568
  projectXY(t) {
572
- const e = new m(this);
569
+ const e = new f(this);
573
570
  e.x *= t.scale, e.y *= t.scale, e.z *= t.scale, e.yaw !== void 0 && (e.yaw += t.yaw);
574
- const s = e.x * Math.cos(t.yaw) - e.y * Math.sin(t.yaw), n = e.x * Math.sin(t.yaw) + e.y * Math.cos(t.yaw);
575
- return e.x = s + t.x, e.y = n + t.y, e.z += t.z, e;
571
+ const i = e.x * Math.cos(t.yaw) - e.y * Math.sin(t.yaw), n = e.x * Math.sin(t.yaw) + e.y * Math.cos(t.yaw);
572
+ return e.x = i + t.x, e.y = n + t.y, e.z += t.z, e;
576
573
  }
577
574
  }
578
- class D {
575
+ class N {
576
+ lat = 0;
577
+ //经度
578
+ lon = 0;
579
+ //纬度
580
+ alt = 0;
579
581
  //高度
580
582
  constructor(t) {
581
- o(this, "lat", 0);
582
- //经度
583
- o(this, "lon", 0);
584
- //纬度
585
- o(this, "alt", 0);
586
- const { lat: e = 0, lon: s = 0, alt: n = 0 } = t || {};
587
- this.lat = e, this.lon = s, this.alt = n;
583
+ const { lat: e = 0, lon: i = 0, alt: n = 0 } = t || {};
584
+ this.lat = e, this.lon = i, this.alt = n;
588
585
  }
589
586
  static XYZToLLH(t, e) {
590
- const n = 0.0033528106647474805, r = n * (2 - n), a = m.toRadians(e.lat), h = 6378137 / Math.sqrt(1 - r * Math.sin(a) ** 2) + e.alt;
591
- let c, u, f;
587
+ const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt;
588
+ let h, l, c;
592
589
  if (t.plane === "xz") {
593
- const l = t.x / 1e3 / (h * Math.cos(a)), d = t.z / 1e3 / h;
594
- c = e.lon + m.toDegrees(l), u = e.lat - m.toDegrees(d), f = e.alt + t.y / 1e3;
590
+ const u = t.x / 1e3 / (a * Math.cos(r)), d = t.z / 1e3 / a;
591
+ h = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), c = e.alt + t.y / 1e3;
595
592
  } else if (t.plane === "xy") {
596
- const l = t.x / 1e3 / (h * Math.cos(a)), d = t.y / 1e3 / h;
597
- c = e.lon + m.toDegrees(l), u = e.lat - m.toDegrees(d), f = e.alt + t.z / 1e3;
593
+ const u = t.x / 1e3 / (a * Math.cos(r)), d = t.y / 1e3 / a;
594
+ h = e.lon + f.toDegrees(u), l = e.lat - f.toDegrees(d), c = e.alt + t.z / 1e3;
598
595
  } else
599
- throw new y(w.GeoPointNoPlane, "点的plane应为xz或xy");
600
- return new D({
601
- lat: u,
602
- lon: c,
603
- alt: f
596
+ throw new m(y.GeoPointNoPlane, "点的plane应为xz或xy");
597
+ return new N({
598
+ lat: l,
599
+ lon: h,
600
+ alt: c
604
601
  });
605
602
  }
606
603
  static LLHToXYZ(t, e) {
607
- const n = 0.0033528106647474805, r = n * (2 - n), a = m.toRadians(e.lat), h = 6378137 / Math.sqrt(1 - r * Math.sin(a) ** 2) + e.alt, c = m.toRadians(t.lon - e.lon), u = m.toRadians(e.lat - t.lat), f = h * c * Math.cos(a), l = h * u;
604
+ const n = 0.0033528106647474805, o = n * (2 - n), r = f.toRadians(e.lat), a = 6378137 / Math.sqrt(1 - o * Math.sin(r) ** 2) + e.alt, h = f.toRadians(t.lon - e.lon), l = f.toRadians(e.lat - t.lat), c = a * h * Math.cos(r), u = a * l;
608
605
  if (t.plane === "xz")
609
- return new m({
610
- x: f * 1e3,
606
+ return new f({
607
+ x: c * 1e3,
611
608
  y: (t.alt - e.alt) * 1e3,
612
- z: l * 1e3,
609
+ z: u * 1e3,
613
610
  plane: "xz"
614
611
  });
615
612
  if (t.plane === "xy")
616
- return new m({
617
- x: f * 1e3,
618
- y: l * 1e3,
613
+ return new f({
614
+ x: c * 1e3,
615
+ y: u * 1e3,
619
616
  z: (t.alt - e.alt) * 1e3,
620
617
  plane: "xy"
621
618
  });
622
- throw new y(w.GeoPointNoPlane, "点的plane应为xz或xy");
619
+ throw new m(y.GeoPointNoPlane, "点的plane应为xz或xy");
623
620
  }
624
621
  }
625
- class p {
622
+ class g {
623
+ scale = 1;
624
+ yaw = 0;
625
+ x = 0;
626
+ y = 0;
627
+ z = 0;
628
+ start = 0;
629
+ end = -1;
630
+ plane = "xy";
631
+ refPoint;
626
632
  //参考点
627
633
  constructor(t) {
628
- o(this, "scale", 1);
629
- o(this, "yaw", 0);
630
- o(this, "x", 0);
631
- o(this, "y", 0);
632
- o(this, "z", 0);
633
- o(this, "start", 0);
634
- o(this, "end", -1);
635
- o(this, "plane", "xy");
636
- o(this, "refPoint");
637
- const { refPoint: e, ...s } = t || {};
638
- e && (this.refPoint = new D(e)), Object.assign(this, s);
634
+ const { refPoint: e, ...i } = t || {};
635
+ e && (this.refPoint = new N(e)), Object.assign(this, i);
639
636
  }
640
637
  /**
641
638
  * 合并两个相对坐标系的映射关系
@@ -645,23 +642,23 @@ class p {
645
642
  */
646
643
  static addRelativeMap(t, e) {
647
644
  if (t.plane !== e.plane)
648
- throw new y(w.RelativePlaneUnmatch, "两个映射关系的plane应该相同");
649
- const s = t.scale * e.scale, n = t.yaw + e.yaw, r = Math.cos(e.yaw), a = Math.sin(e.yaw);
650
- let h = 0, c = 0, u = 0;
645
+ throw new m(y.RelativePlaneUnmatch, "两个映射关系的plane应该相同");
646
+ const i = t.scale * e.scale, n = t.yaw + e.yaw, o = Math.cos(e.yaw), r = Math.sin(e.yaw);
647
+ let a = 0, h = 0, l = 0;
651
648
  if (t.plane === "xz") {
652
- const f = t.x * r - t.z * a, l = t.y, d = t.x * a + t.z * r;
653
- h = e.x + f * e.scale, c = e.y + l * e.scale, u = e.z + d * e.scale;
649
+ const c = t.x * o - t.z * r, u = t.y, d = t.x * r + t.z * o;
650
+ a = e.x + c * e.scale, h = e.y + u * e.scale, l = e.z + d * e.scale;
654
651
  } else if (t.plane === "xy") {
655
- const f = t.x * r - t.y * a, l = t.x * a + t.y * r, d = t.z;
656
- h = e.x + f * e.scale, c = e.y + l * e.scale, u = e.z + d * e.scale;
652
+ const c = t.x * o - t.y * r, u = t.x * r + t.y * o, d = t.z;
653
+ a = e.x + c * e.scale, h = e.y + u * e.scale, l = e.z + d * e.scale;
657
654
  } else
658
- throw new y(w.RelativeNoPlane, "映射关系的plane应为xz或xy");
659
- return new p({
660
- scale: s,
655
+ throw new m(y.RelativeNoPlane, "映射关系的plane应为xz或xy");
656
+ return new g({
657
+ scale: i,
661
658
  yaw: n,
662
- x: h,
663
- y: c,
664
- z: u,
659
+ x: a,
660
+ y: h,
661
+ z: l,
665
662
  start: t.start,
666
663
  end: t.end,
667
664
  plane: t.plane
@@ -673,20 +670,20 @@ class p {
673
670
  * @returns 逆映射
674
671
  */
675
672
  static inverseRelativeMap(t) {
676
- const e = 1 / t.scale, s = -t.yaw, n = Math.cos(-s), r = Math.sin(-s);
677
- let a = 0, h = 0, c = 0;
673
+ const e = 1 / t.scale, i = -t.yaw, n = Math.cos(-i), o = Math.sin(-i);
674
+ let r = 0, a = 0, h = 0;
678
675
  if (t.plane === "xz")
679
- a = -(t.x * n + t.z * r) * e, h = -t.y * e, c = -(t.z * n - t.x * r) * e;
676
+ r = -(t.x * n + t.z * o) * e, a = -t.y * e, h = -(t.z * n - t.x * o) * e;
680
677
  else if (t.plane === "xy")
681
- a = -(t.x * n + t.y * r) * e, h = -(t.y * n - t.x * r) * e, c = -t.z * e;
678
+ r = -(t.x * n + t.y * o) * e, a = -(t.y * n - t.x * o) * e, h = -t.z * e;
682
679
  else
683
- throw new y(w.RelativeNoPlane, "映射关系的plane应为xz或xy");
684
- return new p({
680
+ throw new m(y.RelativeNoPlane, "映射关系的plane应为xz或xy");
681
+ return new g({
685
682
  scale: e,
686
- yaw: s,
687
- x: a,
688
- y: h,
689
- z: c,
683
+ yaw: i,
684
+ x: r,
685
+ y: a,
686
+ z: h,
690
687
  start: t.start,
691
688
  end: t.end,
692
689
  plane: t.plane
@@ -695,27 +692,27 @@ class p {
695
692
  static toParse(t) {
696
693
  try {
697
694
  let e = t ? JSON.parse(t) : void 0;
698
- const { reference_point: s } = e || {};
699
- return s && (e = { refPoint: s }), e ? new p(e) : void 0;
695
+ const { reference_point: i } = e || {};
696
+ return i && (e = { refPoint: i }), e ? new g(e) : void 0;
700
697
  } catch {
701
- throw new y(w.RelativeJsonError, "relativeMap格式化失败");
698
+ throw new m(y.RelativeJsonError, "relativeMap格式化失败");
702
699
  }
703
700
  }
704
701
  static toStringify(t) {
705
702
  return t ? JSON.stringify(t) : void 0;
706
703
  }
707
704
  }
708
- class g {
705
+ class w {
709
706
  /**
710
707
  * 获取坐标系树
711
708
  * @param projectId 项目id
712
709
  * @returns
713
710
  */
714
711
  static async getCoordinateTree(t) {
715
- const e = await G({ projectId: t });
712
+ const e = await Y({ projectId: t });
716
713
  if (e.length) {
717
- const s = g.handleCoordinateList(e);
718
- return g.buildCoordinateTree(s, 0);
714
+ const i = w.handleCoordinateList(e);
715
+ return w.buildCoordinateTree(i, 0);
719
716
  }
720
717
  }
721
718
  /**
@@ -725,18 +722,18 @@ class g {
725
722
  * @returns
726
723
  */
727
724
  static async addCoordinate(t, e) {
728
- const { projectId: s, id: n } = t, r = e.map((h) => {
729
- const { type: c, modelType: u, relativeMap: f, level: l, ...d } = h, b = f ? JSON.stringify(f) : void 0;
725
+ const { projectId: i, id: n } = t, o = e.map((a) => {
726
+ const { type: h, modelType: l, relativeMap: c, level: u, ...d } = a, p = c ? JSON.stringify(c) : void 0;
730
727
  return {
731
728
  ...d,
732
- projectId: s,
729
+ projectId: i,
733
730
  parentId: n,
734
- coordinateType: c,
735
- renderType: u,
736
- relativePosition: b
731
+ coordinateType: h,
732
+ renderType: l,
733
+ relativePosition: p
737
734
  };
738
- }), a = await L(r);
739
- return g.handleCoordinateList(a);
735
+ }), r = await C(o);
736
+ return w.handleCoordinateList(r);
740
737
  }
741
738
  /**
742
739
  * 删除坐标系
@@ -745,8 +742,8 @@ class g {
745
742
  * @returns
746
743
  */
747
744
  static async removeCoordinate(t, e) {
748
- const s = e.map((n) => n.id ?? -1);
749
- return await _(s);
745
+ const i = e.map((n) => n.id ?? -1);
746
+ return await G(i);
750
747
  }
751
748
  /**
752
749
  * 更新坐标系
@@ -755,11 +752,11 @@ class g {
755
752
  * @returns
756
753
  */
757
754
  static async updateCoordinate(t, e) {
758
- const { projectId: s, id: n } = t, r = e.map((h) => {
759
- const { type: c, relativeMap: u, level: f, ...l } = h, d = p.toStringify(u);
760
- return { ...l, relativePosition: d, projectId: s, parentId: n };
761
- }), a = await L(r);
762
- return g.handleCoordinateList(a);
755
+ const { projectId: i, id: n } = t, o = e.map((a) => {
756
+ const { type: h, relativeMap: l, level: c, ...u } = a, d = g.toStringify(l);
757
+ return { ...u, relativePosition: d, projectId: i, parentId: n };
758
+ }), r = await C(o);
759
+ return w.handleCoordinateList(r);
763
760
  }
764
761
  /**
765
762
  * 绑定坐标系
@@ -768,11 +765,11 @@ class g {
768
765
  * @returns
769
766
  */
770
767
  static async bindCoordinate(t, e) {
771
- const { projectId: s, id: n } = t, r = e.map((h) => {
772
- const { modelId: c } = h;
773
- return { modelId: c, parentId: n, projectId: s };
774
- }), a = await $(r);
775
- return g.handleCoordinateList(a);
768
+ const { projectId: i, id: n } = t, o = e.map((a) => {
769
+ const { modelId: h } = a;
770
+ return { modelId: h, parentId: n, projectId: i };
771
+ }), r = await B(o);
772
+ return w.handleCoordinateList(r);
776
773
  }
777
774
  /**
778
775
  * 处理坐标系数据
@@ -780,20 +777,20 @@ class g {
780
777
  * @returns 处理后的坐标系数据
781
778
  */
782
779
  static handleCoordinateList(t) {
783
- return t == null ? void 0 : t.map((e) => {
780
+ return t?.map((e) => {
784
781
  const {
785
- coordinateType: s,
782
+ coordinateType: i,
786
783
  modelKey: n,
787
- renderType: r,
788
- relativePosition: a,
789
- ...h
790
- } = e, c = p.toParse(a);
791
- return new jt({
792
- ...h,
793
- type: s,
794
- modelType: r,
784
+ renderType: o,
785
+ relativePosition: r,
786
+ ...a
787
+ } = e, h = g.toParse(r);
788
+ return new It({
789
+ ...a,
790
+ type: i,
791
+ modelType: o,
795
792
  modelValue: n,
796
- relativeMap: c
793
+ relativeMap: h
797
794
  });
798
795
  });
799
796
  }
@@ -804,20 +801,19 @@ class g {
804
801
  * @returns
805
802
  */
806
803
  static buildCoordinateTree(t, e) {
807
- const s = /* @__PURE__ */ new Map(), n = [];
808
- return t.forEach((r) => {
809
- s.set(String(r.id), r);
810
- }), t.forEach((r) => {
811
- var h;
812
- const a = s.get(String(r.id));
813
- if (a)
814
- if (r.parentId === e)
815
- a.level = 0, n.push(a);
804
+ const i = /* @__PURE__ */ new Map(), n = [];
805
+ return t.forEach((o) => {
806
+ i.set(String(o.id), o);
807
+ }), t.forEach((o) => {
808
+ const r = i.get(String(o.id));
809
+ if (r)
810
+ if (o.parentId === e)
811
+ r.level = 0, n.push(r);
816
812
  else {
817
- const c = s.get(String(r.parentId ?? -1));
818
- c && (a.level = (Number(c.level) || 0) + 1, a.parent = c, (h = c.children) == null || h.push(a));
813
+ const a = i.get(String(o.parentId ?? -1));
814
+ a && (r.level = (Number(a.level) || 0) + 1, r.parent = a, a.children?.push(r));
819
815
  }
820
- }), n.forEach(g.sortCoordinateTree), n[0];
816
+ }), n.forEach(w.sortCoordinateTree), n[0];
821
817
  }
822
818
  /**
823
819
  * 对子节点进行排序,首先按 status=0 升序,然后按 type=0 升序,最后按 createTime 降序
@@ -825,14 +821,13 @@ class g {
825
821
  * @returns 无返回值
826
822
  */
827
823
  static sortCoordinateTree(t) {
828
- t.children && (t.children.sort((e, s) => {
829
- var n, r;
824
+ t.children && (t.children.sort((e, i) => {
830
825
  if (e.type === M.Space) {
831
- const a = Number((n = s == null ? void 0 : s.relativeMap) == null ? void 0 : n.z) - Number((r = e == null ? void 0 : e.relativeMap) == null ? void 0 : r.z);
832
- return a !== 0 ? a : Number(s.createTime) - Number(e.createTime);
826
+ const n = Number(i?.relativeMap?.z) - Number(e?.relativeMap?.z);
827
+ return n !== 0 ? n : Number(i.createTime) - Number(e.createTime);
833
828
  } else
834
- return e.status === 0 && s.status !== 0 ? -1 : s.status === 0 && e.status !== 0 ? 1 : Number(s.createTime) - Number(e.createTime);
835
- }), t.children.forEach(g.sortCoordinateTree));
829
+ return e.status === 0 && i.status !== 0 ? -1 : i.status === 0 && e.status !== 0 ? 1 : Number(i.createTime) - Number(e.createTime);
830
+ }), t.children.forEach(w.sortCoordinateTree));
836
831
  }
837
832
  /**
838
833
  * 过滤空间坐标系树
@@ -840,51 +835,51 @@ class g {
840
835
  */
841
836
  static filterSpaceTree(t) {
842
837
  const e = [];
843
- return t.forEach((s) => {
844
- const n = g.filterSpaceTree(s.children);
845
- s.children = n, s.disabled = s.disabled ?? !1, s.type !== M.Model && e.push(s);
838
+ return t.forEach((i) => {
839
+ const n = w.filterSpaceTree(i.children);
840
+ i.children = n, i.disabled = i.disabled ?? !1, i.type !== M.Model && e.push(i);
846
841
  }), e;
847
842
  }
848
843
  }
849
- class jt {
844
+ class It {
845
+ id = 0;
846
+ //id
847
+ type = 0;
848
+ //0空间,1模型
849
+ children = [];
850
+ //子节点
851
+ level;
852
+ //空间的层级
853
+ relativeMap;
854
+ //相对位置关系
855
+ no;
856
+ //坐标系编号
857
+ name;
858
+ //名称
859
+ shortName;
860
+ //简称
861
+ status;
862
+ //使用状态
863
+ modelId;
864
+ // 模型ID
865
+ modelType;
866
+ //模型的类型
867
+ modelValue;
868
+ // 模型value
869
+ projectId;
870
+ //项目id
871
+ parentId;
872
+ //父节点id
873
+ parent;
874
+ //父节点
875
+ groupUuid;
876
+ //分组uuid
877
+ z;
878
+ //坐标系高度
879
+ createTime;
880
+ // 创建时间
881
+ disabled;
850
882
  constructor(t) {
851
- o(this, "id", 0);
852
- //id
853
- o(this, "type", 0);
854
- //0空间,1模型
855
- o(this, "children", []);
856
- //子节点
857
- o(this, "level");
858
- //空间的层级
859
- o(this, "relativeMap");
860
- //相对位置关系
861
- o(this, "no");
862
- //坐标系编号
863
- o(this, "name");
864
- //名称
865
- o(this, "shortName");
866
- //简称
867
- o(this, "status");
868
- //使用状态
869
- o(this, "modelId");
870
- // 模型ID
871
- o(this, "modelType");
872
- //模型的类型
873
- o(this, "modelValue");
874
- // 模型value
875
- o(this, "projectId");
876
- //项目id
877
- o(this, "parentId");
878
- //父节点id
879
- o(this, "parent");
880
- //父节点
881
- o(this, "groupUuid");
882
- //分组uuid
883
- o(this, "z");
884
- //坐标系高度
885
- o(this, "createTime");
886
- // 创建时间
887
- o(this, "disabled");
888
883
  this.setOptions(t);
889
884
  }
890
885
  get spaceList() {
@@ -899,58 +894,58 @@ class jt {
899
894
  }
900
895
  //设置参数
901
896
  setOptions(t) {
902
- const { relativeMap: e, parent: s, children: n, ...r } = t || {};
903
- e && (this.relativeMap = new p(e)), s && (this.parent = s), n != null && n.length && (this.children = n), Object.assign(this, r);
897
+ const { relativeMap: e, parent: i, children: n, ...o } = t || {};
898
+ e && (this.relativeMap = new g(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
904
899
  }
905
900
  //添加子节点
906
901
  async addChild(t) {
907
- const e = P(t) ? t : [t], s = await g.addCoordinate(this, e);
908
- this.mergeChild(s);
902
+ const e = S(t) ? t : [t], i = await w.addCoordinate(this, e);
903
+ this.mergeChild(i);
909
904
  }
910
905
  //删除子节点
911
906
  async removeChild(t) {
912
- const e = P(t) ? t : [t];
913
- await g.removeCoordinate(this, e);
914
- for (const s of e) {
915
- const n = this.children.findIndex((r) => r.id === s.id);
907
+ const e = S(t) ? t : [t];
908
+ await w.removeCoordinate(this, e);
909
+ for (const i of e) {
910
+ const n = this.children.findIndex((o) => o.id === i.id);
916
911
  n !== -1 && this.children.splice(n, 1);
917
912
  }
918
913
  }
919
914
  //更新子节点
920
915
  async updateChild(t) {
921
- const e = P(t) ? t : [t], s = await g.updateCoordinate(this, e);
922
- this.mergeChild(s);
916
+ const e = S(t) ? t : [t], i = await w.updateCoordinate(this, e);
917
+ this.mergeChild(i);
923
918
  }
924
919
  //绑定子节点,不建立映射关系
925
920
  async bindChild(t) {
926
- const e = P(t) ? t : [t], s = await g.bindCoordinate(this, e);
927
- this.mergeChild(s);
921
+ const e = S(t) ? t : [t], i = await w.bindCoordinate(this, e);
922
+ this.mergeChild(i);
928
923
  }
929
924
  // 合并子节点,没有查询到节点就插入
930
925
  async mergeChild(t) {
931
- t != null && t.length && t.forEach((e) => {
932
- const s = this.children.find((n) => n.id === e.id);
933
- if (s) {
934
- const { relativeMap: n, no: r, name: a, shortName: h, status: c, modelId: u, modelValue: f } = e;
935
- Object.assign(s, {
926
+ t?.length && t.forEach((e) => {
927
+ const i = this.children.find((n) => n.id === e.id);
928
+ if (i) {
929
+ const { relativeMap: n, no: o, name: r, shortName: a, status: h, modelId: l, modelValue: c } = e;
930
+ Object.assign(i, {
936
931
  relativeMap: n,
937
- no: r,
938
- name: a,
939
- shortName: h,
940
- status: c,
941
- modelId: u,
942
- modelValue: f
932
+ no: o,
933
+ name: r,
934
+ shortName: a,
935
+ status: h,
936
+ modelId: l,
937
+ modelValue: c
943
938
  });
944
939
  } else this.id === e.parentId && (e.parent = this, this.children.unshift(e));
945
940
  });
946
941
  }
947
942
  //映射到(模型映射到空间,空间映射到空间)
948
943
  async mappingTo(t) {
949
- await Z(t);
944
+ await $(t);
950
945
  }
951
946
  // 来自映射(被映射过的源坐标系关系)
952
947
  async fromMapping() {
953
- const t = await q({ srcCsId: this.id });
948
+ const t = await _({ srcCsId: this.id });
954
949
  return t[t.length - 1];
955
950
  }
956
951
  /**
@@ -969,13 +964,9 @@ class jt {
969
964
  * @param mapped 是否被映射
970
965
  * @returns
971
966
  */
972
- findChildModel(t = [N.CADModel, N.SkyMapModel], e = !0) {
973
- var h, c;
974
- const s = P(t) ? t : [t];
975
- if (s.includes(this.modelType ?? -1) && this.status !== O.Disabled)
976
- return this;
977
- const r = [M.Data, M.Model].includes(this.type) ? this.findParentSpace() : this, a = (c = (h = r == null ? void 0 : r.modelList) == null ? void 0 : h.filter((u) => s.includes(u.modelType ?? -1) ? e ? !!u.relativeMap : !0 : !1)) == null ? void 0 : c.sort((u, f) => Number(u.status) - Number(f.status));
978
- return a == null ? void 0 : a[0];
967
+ findChildModel(t = [P.CADModel, P.SkyMapModel], e = !0) {
968
+ const i = S(t) ? t : [t];
969
+ return i.includes(this.modelType ?? -1) && this.status !== D.Disabled ? this : ([M.Data, M.Model].includes(this.type) ? this.findParentSpace() : this)?.modelList?.filter((a) => i.includes(a.modelType ?? -1) ? e ? !!a.relativeMap : !0 : !1)?.sort((a, h) => Number(a.status) - Number(h.status))?.[0];
979
970
  }
980
971
  /**
981
972
  * 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
@@ -983,37 +974,36 @@ class jt {
983
974
  * @param excludeNodes //排除的坐标系
984
975
  * @returns
985
976
  */
986
- findClosestModel(t = N.CADModel, e) {
987
- var u;
988
- const s = /* @__PURE__ */ new Set();
989
- for (const f of e ?? [])
990
- s.add(String(f.id));
991
- const n = [{ node: this, distance: 0 }], r = P(t) ? t : [t], a = /* @__PURE__ */ new Set();
992
- let h, c = 1 / 0;
977
+ findClosestModel(t = P.CADModel, e) {
978
+ const i = /* @__PURE__ */ new Set();
979
+ for (const l of e ?? [])
980
+ i.add(String(l.id));
981
+ const n = [{ node: this, distance: 0 }], o = S(t) ? t : [t], r = /* @__PURE__ */ new Set();
982
+ let a, h = 1 / 0;
993
983
  for (; n.length > 0; ) {
994
- const f = n.shift();
995
- if (!f) break;
996
- const { node: l, distance: d } = f;
997
- if (s.has(String(l.id)))
984
+ const l = n.shift();
985
+ if (!l) break;
986
+ const { node: c, distance: u } = l;
987
+ if (i.has(String(c.id)))
998
988
  continue;
999
- if (r.includes(l.modelType ?? -1)) {
1000
- if (d < c && (h = l, c = d, d <= 1))
989
+ if (o.includes(c.modelType ?? -1)) {
990
+ if (u < h && (a = c, h = u, u <= 1))
1001
991
  break;
1002
992
  continue;
1003
993
  }
1004
- a.add(l);
1005
- const b = [];
1006
- if ((u = l.parent) != null && u.children)
1007
- for (const S of l.parent.children)
1008
- S !== l && !a.has(S) && b.push(S);
1009
- if (l.children)
1010
- for (const S of l.children)
1011
- a.has(S) || b.push(S);
1012
- l.parent && !a.has(l.parent) && b.push(l.parent);
1013
- for (const S of b)
1014
- n.push({ node: S, distance: d + 1 });
994
+ r.add(c);
995
+ const d = [];
996
+ if (c.children)
997
+ for (const p of c.children)
998
+ r.has(p) || d.push(p);
999
+ if (c.parent?.children)
1000
+ for (const p of c.parent.children)
1001
+ p !== c && !r.has(p) && d.push(p);
1002
+ c.parent && !r.has(c.parent) && d.push(c.parent);
1003
+ for (const p of d)
1004
+ n.push({ node: p, distance: u + 1 });
1015
1005
  }
1016
- return h;
1006
+ return a;
1017
1007
  }
1018
1008
  /**
1019
1009
  *向上寻找到子节点的空间坐标系
@@ -1032,16 +1022,15 @@ class jt {
1032
1022
  */
1033
1023
  findParentSpaceNames(t = 2) {
1034
1024
  const e = [];
1035
- let s = this;
1036
- for (; s && t > 0; )
1037
- s.type === M.Space && (e.unshift(s.fullName), t--), s = s.parent;
1025
+ let i = this;
1026
+ for (; i && t > 0; )
1027
+ i.type === M.Space && (e.unshift(i.fullName), t--), i = i.parent;
1038
1028
  return e;
1039
1029
  }
1040
1030
  // 寻找坐标系组, 有groupUuid表示坐标系组
1041
1031
  findCsGroup() {
1042
- var s;
1043
1032
  const { groupUuid: t, parent: e } = this;
1044
- return t ? ((s = e == null ? void 0 : e.children) == null ? void 0 : s.filter((n) => n.groupUuid === t)) || [] : [this];
1033
+ return t ? e?.children?.filter((i) => i.groupUuid === t) || [] : [this];
1045
1034
  }
1046
1035
  /**
1047
1036
  * 递归寻找到相应的层级
@@ -1053,9 +1042,9 @@ class jt {
1053
1042
  return this;
1054
1043
  if (this.children.length)
1055
1044
  for (const e of this.children) {
1056
- const s = e.findCsByLevel(t);
1057
- if (s)
1058
- return s;
1045
+ const i = e.findCsByLevel(t);
1046
+ if (i)
1047
+ return i;
1059
1048
  }
1060
1049
  }
1061
1050
  /**
@@ -1067,8 +1056,8 @@ class jt {
1067
1056
  if (t) {
1068
1057
  if (this.id === t) return this;
1069
1058
  for (const e of this.children) {
1070
- const s = e.findCsById(t);
1071
- if (s) return s;
1059
+ const i = e.findCsById(t);
1060
+ if (i) return i;
1072
1061
  }
1073
1062
  }
1074
1063
  }
@@ -1079,10 +1068,10 @@ class jt {
1079
1068
  */
1080
1069
  getCsRoutes(t = !1) {
1081
1070
  let e = this;
1082
- const s = [e];
1083
- for (; e != null && e.parent && !(t && !e.relativeMap); )
1084
- e = e.parent, e && s.push(e);
1085
- return s;
1071
+ const i = [e];
1072
+ for (; e?.parent && !(t && !e.relativeMap); )
1073
+ e = e.parent, e && i.push(e);
1074
+ return i;
1086
1075
  }
1087
1076
  /**
1088
1077
  * 通过当前坐标系,获取新的映射坐标树
@@ -1090,11 +1079,10 @@ class jt {
1090
1079
  */
1091
1080
  getMappedCsTree() {
1092
1081
  function t(n) {
1093
- var r;
1094
- return (r = n.children) != null && r.length && (n.children = n.children.filter((a) => !!(a != null && a.relativeMap) && a.status !== O.Disabled).map((a) => t(a))), n;
1082
+ return n.children?.length && (n.children = n.children.filter((o) => !!o?.relativeMap && o.status !== D.Disabled).map((o) => t(o))), n;
1095
1083
  }
1096
- const e = W(this.findRoot(!0)), s = t(e);
1097
- return s.parentId = 0, s.parent = void 0, s;
1084
+ const e = H(this.findRoot(!0)), i = t(e);
1085
+ return i.parentId = 0, i.parent = void 0, i;
1098
1086
  }
1099
1087
  /**
1100
1088
  * 获取该坐标系到目标坐标系的映射关系,两个坐标系必须是同一树的坐标系
@@ -1102,15 +1090,14 @@ class jt {
1102
1090
  * @returns
1103
1091
  */
1104
1092
  getDestRelativeMap(t) {
1105
- var r;
1106
1093
  if (this.id === t.id)
1107
- return new p();
1108
- const e = this.getRelativeMaps(), s = t.getRelativeMaps();
1109
- let n = new p();
1110
- return e == null || e.forEach((a) => {
1111
- n = p.addRelativeMap(n, a);
1112
- }), (r = s == null ? void 0 : s.reverse()) == null || r.forEach((a) => {
1113
- n = p.addRelativeMap(n, p.inverseRelativeMap(a));
1094
+ return new g();
1095
+ const e = this.getRelativeMaps(), i = t.getRelativeMaps();
1096
+ let n = new g();
1097
+ return e?.forEach((o) => {
1098
+ n = g.addRelativeMap(n, o);
1099
+ }), i?.reverse()?.forEach((o) => {
1100
+ n = g.addRelativeMap(n, g.inverseRelativeMap(o));
1114
1101
  }), n;
1115
1102
  }
1116
1103
  /**
@@ -1120,7 +1107,7 @@ class jt {
1120
1107
  getRelativeMaps() {
1121
1108
  let t = this;
1122
1109
  const e = [];
1123
- for (; t != null && t.parent && t.relativeMap; )
1110
+ for (; t?.parent && t.relativeMap; )
1124
1111
  e.push(t.relativeMap), t = t.parent;
1125
1112
  return e;
1126
1113
  }
@@ -1131,11 +1118,10 @@ class jt {
1131
1118
  * @param excludeTypes 要排除的模型Type数组 (可选)
1132
1119
  * @returns
1133
1120
  */
1134
- static filterCoordinateTree(t, e = [], s = []) {
1135
- var r;
1136
- if (s.includes(t.id) || e.includes(t.type))
1121
+ static filterCoordinateTree(t, e = [], i = []) {
1122
+ if (i.includes(t.id) || e.includes(t.type))
1137
1123
  return;
1138
- const n = (r = t.children) == null ? void 0 : r.map((a) => this.filterCoordinateTree(a, e, s)).filter((a) => a !== void 0);
1124
+ const n = t.children?.map((o) => this.filterCoordinateTree(o, e, i)).filter((o) => o !== void 0);
1139
1125
  return { ...t, children: n };
1140
1126
  }
1141
1127
  /**
@@ -1145,10 +1131,10 @@ class jt {
1145
1131
  */
1146
1132
  static getCommonCoordinate(t) {
1147
1133
  let e;
1148
- const s = t.map((n) => n.getCsRoutes(!0).filter((a) => a.id && a.type === M.Space));
1149
- for (; this.checkSameCoordinate(s); ) {
1150
- const r = s.shift();
1151
- r != null && r.length && (e = r[0]);
1134
+ const i = t.map((n) => n.getCsRoutes(!0).filter((r) => r.id && r.type === M.Space));
1135
+ for (; this.checkSameCoordinate(i); ) {
1136
+ const o = i.shift();
1137
+ o?.length && (e = o[0]);
1152
1138
  }
1153
1139
  return e;
1154
1140
  }
@@ -1162,124 +1148,124 @@ class jt {
1162
1148
  if (t.length === 1)
1163
1149
  return !0;
1164
1150
  for (let e = 0; e < t.length - 1; e++) {
1165
- const s = t[e];
1166
- if (!(s != null && s.length))
1151
+ const i = t[e];
1152
+ if (!i?.length)
1167
1153
  return !1;
1168
1154
  const n = t[e + 1];
1169
- if (!(n != null && n.length) || s[0].id !== n[0].id)
1155
+ if (!n?.length || i[0].id !== n[0].id)
1170
1156
  return !1;
1171
1157
  }
1172
1158
  return !0;
1173
1159
  } else return !1;
1174
1160
  }
1175
1161
  }
1176
- class K {
1162
+ class W {
1163
+ yaw = 0;
1164
+ //偏航角
1165
+ pitch = 0;
1166
+ //俯仰角
1167
+ roll = 0;
1177
1168
  //横滚角
1178
1169
  constructor(t) {
1179
- o(this, "yaw", 0);
1180
- //偏航角
1181
- o(this, "pitch", 0);
1182
- //俯仰角
1183
- o(this, "roll", 0);
1184
- const { yaw: e = 0, pitch: s = 0, roll: n = 0 } = t || {};
1185
- this.yaw = Number(e) || 0, this.pitch = Number(s) || 0, this.roll = Number(n) || 0;
1170
+ const { yaw: e = 0, pitch: i = 0, roll: n = 0 } = t || {};
1171
+ this.yaw = Number(e) || 0, this.pitch = Number(i) || 0, this.roll = Number(n) || 0;
1186
1172
  }
1187
1173
  static toParse(t) {
1188
1174
  if (t) {
1189
- const e = t == null ? void 0 : t.split(",").map((s) => Number(s) || 0);
1190
- return new K({ yaw: e[0], pitch: e[1], roll: e[2] });
1175
+ const e = t?.split(",").map((i) => Number(i) || 0);
1176
+ return new W({ yaw: e[0], pitch: e[1], roll: e[2] });
1191
1177
  }
1192
1178
  }
1193
1179
  static toStringify(t) {
1194
1180
  return t ? `${t.yaw},${t.pitch},${t.roll}` : "";
1195
1181
  }
1196
1182
  }
1197
- class tt {
1183
+ class Q {
1184
+ x = 0;
1185
+ //x轴
1186
+ y = 0;
1187
+ //y轴
1188
+ z = 0;
1198
1189
  //z轴
1199
1190
  constructor(t) {
1200
- o(this, "x", 0);
1201
- //x
1202
- o(this, "y", 0);
1203
- //y轴
1204
- o(this, "z", 0);
1205
- const { x: e = 0, y: s = 0, z: n = 0 } = t || {};
1206
- this.x = Number(e) || 0, this.y = Number(s) || 0, this.z = Number(n) || 0;
1191
+ const { x: e = 0, y: i = 0, z: n = 0 } = t || {};
1192
+ this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0;
1207
1193
  }
1208
1194
  static toParse(t) {
1209
1195
  if (t) {
1210
- const e = t == null ? void 0 : t.split(",").map((s) => Number(s) || 0);
1211
- return new tt({ x: e[0], y: e[1], z: e[2] });
1196
+ const e = t?.split(",").map((i) => Number(i) || 0);
1197
+ return new Q({ x: e[0], y: e[1], z: e[2] });
1212
1198
  }
1213
1199
  }
1214
1200
  static toStringify(t) {
1215
1201
  return t ? `${t.x},${t.y},${t.z}` : "";
1216
1202
  }
1217
1203
  }
1218
- class Ft {
1204
+ class Lt {
1205
+ canvas;
1206
+ ctx;
1207
+ options;
1208
+ offset = { x: 0, y: 0 };
1209
+ // 拖动偏移
1210
+ curOffset = { x: 0, y: 0 };
1211
+ // 记录上一次的偏移量
1212
+ mousePosition = { x: -1, y: -1 };
1213
+ // 记录鼠标坐标位置
1214
+ // 缩放
1215
+ MAX_SCALE = 60;
1216
+ MIN_SCALE = 1;
1217
+ STEP_SCALE = 0.5;
1218
+ // 暂存缩放值
1219
+ scale = 1;
1220
+ preScale = 1;
1221
+ // 画布大小
1222
+ width = 0;
1223
+ height = 0;
1224
+ x = 0;
1225
+ // 记录鼠标点击时的横坐标
1226
+ y = 0;
1227
+ // 记录鼠标点击时的纵坐标
1228
+ timeout = 0;
1229
+ // 单击
1230
+ // 移动端相关参数
1231
+ lastTouch;
1232
+ initialDistance = 0;
1233
+ //初始距离
1234
+ touchMode = 0;
1235
+ isMouseover = !1;
1236
+ //鼠标是否在元素上
1237
+ isBindEvent = !0;
1238
+ // 是否绘制辅助线
1239
+ isDrawAssist = !1;
1240
+ // 是否绑定事件
1241
+ customDrawAssist;
1242
+ // 绘制辅助线的方法
1243
+ isMoveRedrawing;
1244
+ // 移动过程中是否重绘
1245
+ afterDraw;
1246
+ screenPos = { screenX: 0, screenY: 0 };
1219
1247
  //屏幕位置
1220
1248
  constructor(t) {
1221
- o(this, "canvas");
1222
- o(this, "ctx");
1223
- o(this, "options");
1224
- o(this, "offset", { x: 0, y: 0 });
1225
- // 拖动偏移
1226
- o(this, "curOffset", { x: 0, y: 0 });
1227
- // 记录上一次的偏移量
1228
- o(this, "mousePosition", { x: -1, y: -1 });
1229
- // 记录鼠标坐标位置
1230
- // 缩放
1231
- o(this, "MAX_SCALE", 60);
1232
- o(this, "MIN_SCALE", 1);
1233
- o(this, "STEP_SCALE", 0.5);
1234
- // 暂存缩放值
1235
- o(this, "scale", 1);
1236
- o(this, "preScale", 1);
1237
- // 画布大小
1238
- o(this, "width", 0);
1239
- o(this, "height", 0);
1240
- o(this, "x", 0);
1241
- // 记录鼠标点击时的横坐标
1242
- o(this, "y", 0);
1243
- // 记录鼠标点击时的纵坐标
1244
- o(this, "timeout", 0);
1245
- // 单击
1246
- // 移动端相关参数
1247
- o(this, "lastTouch");
1248
- o(this, "initialDistance", 0);
1249
- //初始距离
1250
- o(this, "touchMode", 0);
1251
- o(this, "isMouseover", !1);
1252
- //鼠标是否在元素上
1253
- o(this, "isBindEvent", !0);
1254
- // 是否绘制辅助线
1255
- o(this, "isDrawAssist", !1);
1256
- // 是否绑定事件
1257
- o(this, "customDrawAssist");
1258
- // 绘制辅助线的方法
1259
- o(this, "isMoveRedrawing");
1260
- // 移动过程中是否重绘
1261
- o(this, "afterDraw");
1262
- o(this, "screenPos", { screenX: 0, screenY: 0 });
1263
1249
  const {
1264
1250
  container: e,
1265
- width: s = 300,
1251
+ width: i = 300,
1266
1252
  height: n = 300,
1267
- isBindEvent: r = !0,
1268
- isDrawAssist: a = !1,
1269
- isMoveRedrawing: h,
1270
- customDrawAssist: c,
1271
- afterDraw: u,
1272
- ...f
1253
+ isBindEvent: o = !0,
1254
+ isDrawAssist: r = !1,
1255
+ isMoveRedrawing: a,
1256
+ customDrawAssist: h,
1257
+ afterDraw: l,
1258
+ ...c
1273
1259
  } = t;
1274
- this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.width = s, this.height = n, this.canvas.width = s, this.canvas.height = n, this.isBindEvent = r, this.isDrawAssist = a, this.customDrawAssist = c, this.isMoveRedrawing = h ?? a, this.options = f, this.onMousedown = this.onMousedown.bind(this), this.onMousemove = this.onMousemove.bind(this), this.onMousemoveTemp = this.onMousemoveTemp.bind(this), this.onMouseup = this.onMouseup.bind(this), this.onMousewheel = this.onMousewheel.bind(this), this.onDblclick = this.onDblclick.bind(this), this.onTouchstart = this.onTouchstart.bind(this), this.onTouchmove = this.onTouchmove.bind(this), this.onTouchend = this.onTouchend.bind(this), this.onMouseout = this.onMouseout.bind(this), this.afterDraw = this.afterDraw, r && (this.canvas.addEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.addEventListener("mousewheel", this.onMousewheel), this.canvas.addEventListener("mousedown", this.onMousedown), this.canvas.addEventListener("mousemove", this.onMousemove), this.canvas.addEventListener("mouseout", this.onMouseout), this.canvas.addEventListener("dblclick", this.onDblclick), this.canvas.addEventListener("touchstart", this.onTouchstart));
1260
+ this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.width = i, this.height = n, this.canvas.width = i, this.canvas.height = n, this.isBindEvent = o, this.isDrawAssist = r, this.customDrawAssist = h, this.isMoveRedrawing = a ?? r, this.options = c, this.onMousedown = this.onMousedown.bind(this), this.onMousemove = this.onMousemove.bind(this), this.onMousemoveTemp = this.onMousemoveTemp.bind(this), this.onMouseup = this.onMouseup.bind(this), this.onMousewheel = this.onMousewheel.bind(this), this.onDblclick = this.onDblclick.bind(this), this.onTouchstart = this.onTouchstart.bind(this), this.onTouchmove = this.onTouchmove.bind(this), this.onTouchend = this.onTouchend.bind(this), this.onMouseout = this.onMouseout.bind(this), this.afterDraw = this.afterDraw, o && (this.canvas.addEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.addEventListener("mousewheel", this.onMousewheel), this.canvas.addEventListener("mousedown", this.onMousedown), this.canvas.addEventListener("mousemove", this.onMousemove), this.canvas.addEventListener("mouseout", this.onMouseout), this.canvas.addEventListener("dblclick", this.onDblclick), this.canvas.addEventListener("touchstart", this.onTouchstart));
1275
1261
  }
1276
1262
  onClick(t) {
1277
- const { screenX: e, screenY: s } = t;
1263
+ const { screenX: e, screenY: i } = t;
1278
1264
  this.timeout && clearTimeout(this.timeout);
1279
1265
  const n = this.getPos(t);
1280
- this.x = n.x, this.y = n.y, this.screenPos = { screenX: e, screenY: s }, this.options.onClick && (this.timeout = setTimeout(() => {
1281
- const r = parseFloat(((this.x - this.offset.x) / this.scale).toFixed(2)), a = parseFloat(((this.y - this.offset.y) / this.scale).toFixed(2));
1282
- this.options.onClick(r, a);
1266
+ this.x = n.x, this.y = n.y, this.screenPos = { screenX: e, screenY: i }, this.options.onClick && (this.timeout = setTimeout(() => {
1267
+ const o = parseFloat(((this.x - this.offset.x) / this.scale).toFixed(2)), r = parseFloat(((this.y - this.offset.y) / this.scale).toFixed(2));
1268
+ this.options.onClick(o, r);
1283
1269
  }, 200));
1284
1270
  }
1285
1271
  onMouseout(t) {
@@ -1293,12 +1279,12 @@ class Ft {
1293
1279
  }
1294
1280
  onBothTouchstart(t) {
1295
1281
  t.preventDefault();
1296
- const e = { x: t.touches[0].clientX, y: t.touches[0].clientY }, s = { x: t.touches[1].clientX, y: t.touches[1].clientY }, n = this.getPos({
1297
- clientX: (e.x + s.x) / 2,
1298
- clientY: (e.y + s.y) / 2
1282
+ const e = { x: t.touches[0].clientX, y: t.touches[0].clientY }, i = { x: t.touches[1].clientX, y: t.touches[1].clientY }, n = this.getPos({
1283
+ clientX: (e.x + i.x) / 2,
1284
+ clientY: (e.y + i.y) / 2
1299
1285
  });
1300
1286
  this.x = n.x, this.y = n.y, this.curOffset.x = this.offset.x, this.curOffset.y = this.offset.y, this.initialDistance = Math.sqrt(
1301
- Math.pow(s.x - e.x, 2) + Math.pow(s.y - e.y, 2)
1287
+ Math.pow(i.x - e.x, 2) + Math.pow(i.y - e.y, 2)
1302
1288
  );
1303
1289
  }
1304
1290
  onTouchmove(t) {
@@ -1311,13 +1297,13 @@ class Ft {
1311
1297
  }
1312
1298
  // 监听点击的持久move
1313
1299
  onMousemoveTemp(t) {
1314
- const { screenX: e, screenY: s } = this.screenPos;
1315
- (Math.abs(e - t.screenX) > 10 || Math.abs(s - t.screenY) > 10) && (this.timeout && clearTimeout(this.timeout), this.offset.x = this.curOffset.x + (this.mousePosition.x - this.x), this.offset.y = this.curOffset.y + (this.mousePosition.y - this.y), !this.isMoveRedrawing && this.draw());
1300
+ const { screenX: e, screenY: i } = this.screenPos;
1301
+ (Math.abs(e - t.screenX) > 10 || Math.abs(i - t.screenY) > 10) && (this.timeout && clearTimeout(this.timeout), this.offset.x = this.curOffset.x + (this.mousePosition.x - this.x), this.offset.y = this.curOffset.y + (this.mousePosition.y - this.y), !this.isMoveRedrawing && this.draw());
1316
1302
  }
1317
1303
  onBothTouchmove(t) {
1318
1304
  if (t.preventDefault(), this.initialDistance) {
1319
- const e = { x: t.touches[0].clientX, y: t.touches[0].clientY }, s = { x: t.touches[1].clientX, y: t.touches[1].clientY }, n = Math.sqrt(
1320
- Math.pow(s.x - e.x, 2) + Math.pow(s.y - e.y, 2)
1305
+ const e = { x: t.touches[0].clientX, y: t.touches[0].clientY }, i = { x: t.touches[1].clientX, y: t.touches[1].clientY }, n = Math.sqrt(
1306
+ Math.pow(i.x - e.x, 2) + Math.pow(i.y - e.y, 2)
1321
1307
  );
1322
1308
  if (this.scale += (n - this.initialDistance) / 30 * this.STEP_SCALE, this.initialDistance = n, this.scale > this.MAX_SCALE) {
1323
1309
  this.scale = this.MAX_SCALE;
@@ -1340,8 +1326,8 @@ class Ft {
1340
1326
  this.timeout && clearTimeout(this.timeout), t.preventDefault();
1341
1327
  const e = this.getPos(t);
1342
1328
  this.x = e.x, this.y = e.y;
1343
- const s = t.wheelDelta > 0 || t.detail < 0 ? this.STEP_SCALE : -this.STEP_SCALE;
1344
- if (this.scale = parseFloat((this.scale + s).toFixed(2)), this.scale > this.MAX_SCALE) {
1329
+ const i = t.wheelDelta > 0 || t.detail < 0 ? this.STEP_SCALE : -this.STEP_SCALE;
1330
+ if (this.scale = parseFloat((this.scale + i).toFixed(2)), this.scale > this.MAX_SCALE) {
1345
1331
  this.scale = this.MAX_SCALE;
1346
1332
  return;
1347
1333
  }
@@ -1353,8 +1339,8 @@ class Ft {
1353
1339
  }
1354
1340
  // 触摸
1355
1341
  onTouch(t) {
1356
- const e = Date.now(), { lastTouchTime: s = 0, lastTouchX: n = 0, lastTouchY: r = 0 } = this.lastTouch || {};
1357
- e - s < 300 && Math.abs(t.clientX - n) < 30 && Math.abs(t.clientY - r) < 30 ? (this.onDblclick(t), this.lastTouch = {
1342
+ const e = Date.now(), { lastTouchTime: i = 0, lastTouchX: n = 0, lastTouchY: o = 0 } = this.lastTouch || {};
1343
+ e - i < 300 && Math.abs(t.clientX - n) < 30 && Math.abs(t.clientY - o) < 30 ? (this.onDblclick(t), this.lastTouch = {
1358
1344
  lastTouchTime: 0,
1359
1345
  lastTouchX: 0,
1360
1346
  lastTouchY: 0
@@ -1374,13 +1360,13 @@ class Ft {
1374
1360
  reset(t) {
1375
1361
  const {
1376
1362
  width: e = this.width,
1377
- height: s = this.height,
1363
+ height: i = this.height,
1378
1364
  scale: n = 1,
1379
- preScale: r = 1,
1380
- offset: a = { x: 0, y: 0 },
1381
- curOffset: h = { x: 0, y: 0 }
1365
+ preScale: o = 1,
1366
+ offset: r = { x: 0, y: 0 },
1367
+ curOffset: a = { x: 0, y: 0 }
1382
1368
  } = t || {};
1383
- this.width = e, this.height = s, this.canvas.width = e, this.canvas.height = s, this.scale = n, this.preScale = r, this.offset = a, this.curOffset = h;
1369
+ this.width = e, this.height = i, this.canvas.width = e, this.canvas.height = i, this.scale = n, this.preScale = o, this.offset = r, this.curOffset = a;
1384
1370
  }
1385
1371
  // 辅助内容
1386
1372
  drawAssist() {
@@ -1389,45 +1375,42 @@ class Ft {
1389
1375
  }
1390
1376
  // 绘制
1391
1377
  draw() {
1392
- var t;
1393
- this.ctx.clearRect(0, 0, this.width, this.height), this.ctx.save(), this.ctx.translate(this.offset.x, this.offset.y), this.ctx.scale(this.scale, this.scale), this.options.draw(this.ctx, this), this.ctx.restore(), this.isDrawAssist && this.isMouseover && (this.customDrawAssist ? this.customDrawAssist() : this.drawAssist()), (t = this.afterDraw) == null || t.call(this, this.ctx, this);
1378
+ this.ctx.clearRect(0, 0, this.width, this.height), this.ctx.save(), this.ctx.translate(this.offset.x, this.offset.y), this.ctx.scale(this.scale, this.scale), this.options.draw(this.ctx, this), this.ctx.restore(), this.isDrawAssist && this.isMouseover && (this.customDrawAssist ? this.customDrawAssist() : this.drawAssist()), this.afterDraw?.(this.ctx, this);
1394
1379
  }
1395
1380
  getPos(t) {
1396
1381
  const e = this.canvas.getBoundingClientRect();
1397
- let s = parseFloat((t.clientX - e.left).toFixed(2)), n = parseFloat((t.clientY - e.top).toFixed(2));
1398
- return s = s < 0 ? 0 : s, n = n < 0 ? 0 : n, { x: s, y: n };
1382
+ let i = parseFloat((t.clientX - e.left).toFixed(2)), n = parseFloat((t.clientY - e.top).toFixed(2));
1383
+ return i = i < 0 ? 0 : i, n = n < 0 ? 0 : n, { x: i, y: n };
1399
1384
  }
1400
1385
  unBindEvent() {
1401
1386
  this.isBindEvent && (this.canvas.removeEventListener("mousemove", this.onMousemove), this.canvas.removeEventListener("DOMMouseScroll", this.onMousewheel), this.canvas.removeEventListener("mousewheel", this.onMousewheel), this.canvas.removeEventListener("mousedown", this.onMousedown), this.canvas.removeEventListener("mouseout", this.onMouseout), this.canvas.removeEventListener("dblclick", this.onDblclick));
1402
1387
  }
1403
1388
  }
1404
- const X = {};
1405
- class Ut {
1389
+ const k = {};
1390
+ class jt {
1391
+ type = "image";
1392
+ // 修改为更通用的名称
1393
+ x;
1394
+ y;
1395
+ width;
1396
+ height;
1397
+ img;
1398
+ src;
1399
+ redraw;
1406
1400
  constructor(t) {
1407
- o(this, "type", "image");
1408
- // 修改为更通用的名称
1409
- o(this, "x");
1410
- o(this, "y");
1411
- o(this, "width");
1412
- o(this, "height");
1413
- o(this, "img");
1414
- o(this, "src");
1415
- o(this, "redraw");
1416
1401
  this.x = t.x || 0, this.y = t.y || 0, this.width = t.width || 0, this.height = t.height || 0, this.src = t.src, this.redraw = t.redraw, this.img = this.loadImage(t.onload);
1417
1402
  }
1418
1403
  loadImage(t) {
1419
- const e = X[this.src];
1404
+ const e = k[this.src];
1420
1405
  if (e)
1421
1406
  return queueMicrotask(() => {
1422
- var s;
1423
- t == null || t(e), (s = this.redraw) == null || s.call(this);
1407
+ t?.(e), this.redraw?.();
1424
1408
  }), e;
1425
1409
  {
1426
- const s = new Image();
1427
- return s.crossOrigin = "anonymous", s.src = this.src, s.onload = () => {
1428
- var n;
1429
- X[this.src] = s, t == null || t(s), (n = this.redraw) == null || n.call(this);
1430
- }, s;
1410
+ const i = new Image();
1411
+ return i.crossOrigin = "anonymous", i.src = this.src, i.onload = () => {
1412
+ k[this.src] = i, t?.(i), this.redraw?.();
1413
+ }, i;
1431
1414
  }
1432
1415
  }
1433
1416
  draw(t) {
@@ -1439,215 +1422,208 @@ class Ut {
1439
1422
  }
1440
1423
  }
1441
1424
  }
1442
- class Yt {
1425
+ class kt {
1426
+ id = "";
1427
+ type = "point";
1428
+ x;
1429
+ y;
1430
+ r;
1431
+ text;
1432
+ backgroundColor;
1433
+ index;
1434
+ pIndex;
1435
+ parentId;
1443
1436
  constructor(t) {
1444
- o(this, "id", "");
1445
- o(this, "type", "point");
1446
- o(this, "x");
1447
- o(this, "y");
1448
- o(this, "r");
1449
- o(this, "text");
1450
- o(this, "backgroundColor");
1451
- o(this, "index");
1452
- o(this, "pIndex");
1453
- o(this, "parentId");
1454
1437
  this.id = t.id, this.x = t.x, this.y = t.y, this.r = t.r || 15, this.text = t.text || "", this.index = t.index, this.pIndex = t.pIndex, this.parentId = t.parentId, this.backgroundColor = t.backgroundColor || "rgba(91, 179, 111, 0.8)";
1455
1438
  }
1456
1439
  draw(t, e) {
1457
1440
  t.save();
1458
- const s = 1 / e.scale;
1459
- t.beginPath(), t.arc(this.x, this.y, this.r * s, 0, 2 * Math.PI), t.fillStyle = this.backgroundColor, t.fill(), t.font = `${this.r * s}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.text, this.x, this.y + this.r * s / 3), t.restore();
1441
+ const i = 1 / e.scale;
1442
+ t.beginPath(), t.arc(this.x, this.y, this.r * i, 0, 2 * Math.PI), t.fillStyle = this.backgroundColor, t.fill(), t.font = `${this.r * i}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.text, this.x, this.y + this.r * i / 3), t.restore();
1460
1443
  }
1461
1444
  }
1462
- const F = {};
1463
- class Bt {
1445
+ const A = {};
1446
+ class At {
1447
+ id = "";
1448
+ type = "issue";
1449
+ //轨迹点上的事件
1450
+ x;
1451
+ y;
1452
+ width;
1453
+ height;
1454
+ src;
1455
+ img;
1456
+ index;
1457
+ pIndex;
1458
+ parentId;
1459
+ count;
1460
+ badgeR;
1461
+ redraw;
1464
1462
  constructor(t) {
1465
- o(this, "id", "");
1466
- o(this, "type", "issue");
1467
- //轨迹点上的事件
1468
- o(this, "x");
1469
- o(this, "y");
1470
- o(this, "width");
1471
- o(this, "height");
1472
- o(this, "src");
1473
- o(this, "img");
1474
- o(this, "index");
1475
- o(this, "pIndex");
1476
- o(this, "parentId");
1477
- o(this, "count");
1478
- o(this, "badgeR");
1479
- o(this, "redraw");
1480
1463
  this.id = t.id, this.x = t.x, this.y = t.y, this.width = t.width || 0, this.height = t.height || 0, this.index = t.index, this.pIndex = t.pIndex, this.parentId = t.parentId, this.count = t.count || 0, this.badgeR = 3, this.src = t.src, this.redraw = t.redraw, this.img = this.loadImage(t.onload);
1481
1464
  }
1482
1465
  loadImage(t) {
1483
- const e = F[this.src];
1466
+ const e = A[this.src];
1484
1467
  if (e)
1485
1468
  return queueMicrotask(() => {
1486
- var s;
1487
- t == null || t(e), (s = this.redraw) == null || s.call(this);
1469
+ t?.(e), this.redraw?.();
1488
1470
  }), e;
1489
1471
  {
1490
- const s = new Image();
1491
- return s.src = this.src, s.crossOrigin = "anonymous", s.onload = () => {
1492
- var n;
1493
- F[this.src] = s, t == null || t(s), (n = this.redraw) == null || n.call(this);
1494
- }, s;
1472
+ const i = new Image();
1473
+ return i.src = this.src, i.crossOrigin = "anonymous", i.onload = () => {
1474
+ A[this.src] = i, t?.(i), this.redraw?.();
1475
+ }, i;
1495
1476
  }
1496
1477
  }
1497
1478
  draw(t, e) {
1498
1479
  if (!this.img.complete) return;
1499
- const s = 1 / e.scale, n = this.width * s, r = this.height * s, a = this.x - n / 2, h = this.y - r, c = this.badgeR * s, u = c * 1.5;
1500
- t.save(), t.drawImage(this.img, a, h, n, r), t.beginPath(), this.count > 1 && (t.arc(this.x + n * 0.3, this.y - r * 0.8, c, 0, 2 * Math.PI), t.fillStyle = "red", t.fill(), t.font = `${u}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.count.toString(), this.x + n * 0.3, this.y - r * 0.8 + c / 2)), t.restore();
1480
+ const i = 1 / e.scale, n = this.width * i, o = this.height * i, r = this.x - n / 2, a = this.y - o, h = this.badgeR * i, l = h * 1.5;
1481
+ t.save(), t.drawImage(this.img, r, a, n, o), t.beginPath(), this.count > 1 && (t.arc(this.x + n * 0.3, this.y - o * 0.8, h, 0, 2 * Math.PI), t.fillStyle = "red", t.fill(), t.font = `${l}px Microsoft YaHei`, t.textAlign = "center", t.fillStyle = "#FFFFFF", t.fillText(this.count.toString(), this.x + n * 0.3, this.y - o * 0.8 + h / 2)), t.restore();
1501
1482
  }
1502
1483
  }
1503
- const U = {};
1504
- class Gt {
1484
+ const X = {};
1485
+ class Xt {
1486
+ type = "marker";
1487
+ x;
1488
+ y;
1489
+ url;
1490
+ width;
1491
+ height;
1492
+ anchor;
1493
+ img;
1494
+ scale;
1495
+ redraw;
1496
+ beforeDraw;
1505
1497
  constructor(t) {
1506
- o(this, "type", "marker");
1507
- o(this, "x");
1508
- o(this, "y");
1509
- o(this, "url");
1510
- o(this, "width");
1511
- o(this, "height");
1512
- o(this, "anchor");
1513
- o(this, "img");
1514
- o(this, "scale");
1515
- o(this, "redraw");
1516
- o(this, "beforeDraw");
1517
1498
  this.x = t.x, this.y = t.y, this.url = t.url, this.width = t.width ?? 0, this.height = t.height ?? 0, this.anchor = t.anchor, this.scale = t.scale ?? 1, t.redraw && (this.redraw = t.redraw), t.beforeDraw && (this.beforeDraw = t.beforeDraw), this.img = this.loadImage(t.onload);
1518
1499
  }
1519
1500
  loadImage(t) {
1520
- const e = U[this.url];
1501
+ const e = X[this.url];
1521
1502
  if (e)
1522
1503
  return queueMicrotask(() => {
1523
- var s;
1524
- t == null || t(e), (s = this.redraw) == null || s.call(this);
1504
+ t?.(e), this.redraw?.();
1525
1505
  }), e;
1526
1506
  {
1527
- const s = new Image();
1528
- return s.src = this.url, s.crossOrigin = "anonymous", s.onload = () => {
1529
- var n;
1530
- U[this.url] = s, t == null || t(s), (n = this.redraw) == null || n.call(this);
1531
- }, s;
1507
+ const i = new Image();
1508
+ return i.src = this.url, i.crossOrigin = "anonymous", i.onload = () => {
1509
+ X[this.url] = i, t?.(i), this.redraw?.();
1510
+ }, i;
1532
1511
  }
1533
1512
  }
1534
1513
  calculateIconPosition() {
1535
- var s, n;
1536
- const t = ((s = this.anchor) == null ? void 0 : s.x) ?? this.width / 2, e = ((n = this.anchor) == null ? void 0 : n.y) ?? this.height / 2;
1514
+ const t = this.anchor?.x ?? this.width / 2, e = this.anchor?.y ?? this.height / 2;
1537
1515
  return {
1538
1516
  iconStartX: this.x - t * this.scale,
1539
1517
  iconStartY: this.y - e * this.scale
1540
1518
  };
1541
1519
  }
1542
1520
  draw(t, e) {
1543
- var r, a;
1544
- if ((r = this.beforeDraw) == null || r.call(this, t, e), !((a = this.img) != null && a.complete)) return;
1545
- const { iconStartX: s, iconStartY: n } = this.calculateIconPosition();
1521
+ if (this.beforeDraw?.(t, e), !this.img?.complete) return;
1522
+ const { iconStartX: i, iconStartY: n } = this.calculateIconPosition();
1546
1523
  t.save();
1547
1524
  try {
1548
1525
  t.drawImage(
1549
1526
  this.img,
1550
- s,
1527
+ i,
1551
1528
  n,
1552
1529
  this.width * this.scale,
1553
1530
  this.height * this.scale
1554
1531
  );
1555
- } catch (h) {
1556
- console.error("绘制标记时出错:", h);
1532
+ } catch (o) {
1533
+ console.error("绘制标记时出错:", o);
1557
1534
  } finally {
1558
1535
  t.restore();
1559
1536
  }
1560
1537
  }
1561
1538
  }
1562
- class $t {
1539
+ class Ft {
1540
+ type = "radar";
1541
+ x;
1542
+ y;
1543
+ r;
1544
+ angle;
1545
+ text;
1546
+ hFov = 90;
1547
+ beforeDraw;
1563
1548
  constructor(t) {
1564
- o(this, "type", "radar");
1565
- o(this, "x");
1566
- o(this, "y");
1567
- o(this, "r");
1568
- o(this, "angle");
1569
- o(this, "text");
1570
- o(this, "hFov", 90);
1571
- o(this, "beforeDraw");
1572
1549
  this.x = t.x, this.y = t.y, this.r = t.r || 15, this.angle = t.angle || 0, this.text = t.text || "", this.hFov = t.fovh || 90, this.beforeDraw = t.beforeDraw;
1573
1550
  }
1574
1551
  draw(t, e) {
1575
- var h;
1576
- (h = this.beforeDraw) == null || h.call(this, t, e);
1577
- const s = 1 / e.scale, [n, r] = [
1552
+ this.beforeDraw?.(t, e);
1553
+ const i = 1 / e.scale, [n, o] = [
1578
1554
  (this.angle - this.hFov / 2) / 180 * Math.PI,
1579
1555
  (this.angle + this.hFov / 2) / 180 * Math.PI
1580
1556
  ];
1581
1557
  t.save();
1582
- const a = t.createRadialGradient(
1558
+ const r = t.createRadialGradient(
1583
1559
  this.x,
1584
1560
  this.y,
1585
1561
  0,
1586
1562
  this.x,
1587
1563
  this.y,
1588
- this.r * s
1564
+ this.r * i
1589
1565
  );
1590
- a.addColorStop(0, "rgba(180, 42, 42, 1)"), a.addColorStop(1, "rgba(180, 42, 42, 0.5)"), t.beginPath(), t.moveTo(this.x, this.y), t.arc(this.x, this.y, this.r * s, n, r), t.closePath(), t.fillStyle = a, t.fill(), t.restore();
1566
+ r.addColorStop(0, "rgba(180, 42, 42, 1)"), r.addColorStop(1, "rgba(180, 42, 42, 0.5)"), t.beginPath(), t.moveTo(this.x, this.y), t.arc(this.x, this.y, this.r * i, n, o), t.closePath(), t.fillStyle = r, t.fill(), t.restore();
1591
1567
  }
1592
1568
  }
1593
- class _t {
1569
+ class Ut {
1570
+ type = "region";
1571
+ x;
1572
+ y;
1573
+ shape;
1574
+ areaPoints;
1575
+ backgroundColor;
1594
1576
  constructor(t) {
1595
- o(this, "type", "region");
1596
- o(this, "x");
1597
- o(this, "y");
1598
- o(this, "shape");
1599
- o(this, "areaPoints");
1600
- o(this, "backgroundColor");
1601
1577
  if (this.x = t.x, this.y = t.y, this.shape = t.shape || "", this.backgroundColor = t.backgroundColor, t.areaPoints.length === 2) {
1602
- const [{ x: e, y: s }, {}, { x: n, y: r }] = t.areaPoints;
1578
+ const [{ x: e, y: i }, {}, { x: n, y: o }] = t.areaPoints;
1603
1579
  this.areaPoints = [
1604
- { x: Math.min(e, n), y: Math.min(s, r) },
1605
- { x: Math.max(e, n), y: Math.min(s, r) },
1606
- { x: Math.max(e, n), y: Math.max(s, r) },
1607
- { x: Math.min(e, n), y: Math.max(s, r) }
1580
+ { x: Math.min(e, n), y: Math.min(i, o) },
1581
+ { x: Math.max(e, n), y: Math.min(i, o) },
1582
+ { x: Math.max(e, n), y: Math.max(i, o) },
1583
+ { x: Math.min(e, n), y: Math.max(i, o) }
1608
1584
  ];
1609
1585
  } else
1610
1586
  this.areaPoints = t.areaPoints;
1611
1587
  }
1612
1588
  draw(t, e) {
1613
1589
  if (t.save(), t.beginPath(), t.globalAlpha = 0.3, t.fillStyle = this.backgroundColor, this.shape === "circle") {
1614
- const [{ x: s, y: n }, {}, { x: r, y: a }] = this.areaPoints, h = Math.abs(r - s) / 2, c = s + (r - s) / 2, u = n + (a - n) / 2;
1615
- t.arc(c, u, h, 0, 2 * Math.PI);
1590
+ const [{ x: i, y: n }, {}, { x: o, y: r }] = this.areaPoints, a = Math.abs(o - i) / 2, h = i + (o - i) / 2, l = n + (r - n) / 2;
1591
+ t.arc(h, l, a, 0, 2 * Math.PI);
1616
1592
  } else
1617
- this.areaPoints.forEach((s, n) => {
1618
- const { x: r, y: a } = s;
1619
- n === 0 ? t.moveTo(r, a) : t.lineTo(r, a);
1593
+ this.areaPoints.forEach((i, n) => {
1594
+ const { x: o, y: r } = i;
1595
+ n === 0 ? t.moveTo(o, r) : t.lineTo(o, r);
1620
1596
  });
1621
1597
  t.fill(), t.restore();
1622
1598
  }
1623
1599
  }
1624
1600
  export {
1625
- rt as APP_SETTING,
1626
- y as AppError,
1627
- w as AppErrorCode,
1628
- nt as AppObsType,
1629
- Ft as CanvasElement,
1630
- Ut as CanvasImageElement,
1631
- Bt as CanvasIssueElement,
1632
- Gt as CanvasMarkerElement,
1633
- Yt as CanvasPointElement,
1634
- $t as CanvasRadarElement,
1635
- _t as CanvasRegionElement,
1636
- jt as Coordinate,
1637
- it as CoordinateLevel,
1638
- N as CoordinateModelType,
1639
- O as CoordinateStatus,
1601
+ et as APP_SETTING,
1602
+ m as AppError,
1603
+ y as AppErrorCode,
1604
+ tt as AppObsType,
1605
+ Lt as CanvasElement,
1606
+ jt as CanvasImageElement,
1607
+ At as CanvasIssueElement,
1608
+ Xt as CanvasMarkerElement,
1609
+ kt as CanvasPointElement,
1610
+ Ft as CanvasRadarElement,
1611
+ Ut as CanvasRegionElement,
1612
+ It as Coordinate,
1613
+ K as CoordinateLevel,
1614
+ P as CoordinateModelType,
1615
+ D as CoordinateStatus,
1640
1616
  M as CoordinateType,
1641
- g as DataSource,
1642
- D as GeoPoint,
1643
- m as Point,
1644
- K as Position,
1645
- p as RelativeMap,
1646
- R as RequestContentType,
1617
+ w as DataSource,
1618
+ N as GeoPoint,
1619
+ f as Point,
1620
+ W as Position,
1621
+ g as RelativeMap,
1622
+ I as RequestContentType,
1647
1623
  x as RequestMethod,
1648
- Y as RequestResultCode,
1649
- tt as Vector3,
1650
- At as api,
1624
+ F as RequestResultCode,
1625
+ Q as Vector3,
1626
+ Ot as api,
1651
1627
  Ct as http,
1652
- Xt as utils
1628
+ Rt as utils
1653
1629
  };