@realsee/dnalogel 3.72.4-alpha.2 → 3.72.5-alpha.1

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.
@@ -1,76 +1,76 @@
1
- var K = Object.defineProperty, Q = Object.defineProperties;
2
- var Y = Object.getOwnPropertyDescriptors;
3
- var x = Object.getOwnPropertySymbols;
4
- var A = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
- var I = Math.pow, w = (g, e, i) => e in g ? K(g, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : g[e] = i, b = (g, e) => {
6
- for (var i in e || (e = {}))
7
- A.call(e, i) && w(g, i, e[i]);
8
- if (x)
9
- for (var i of x(e))
10
- E.call(e, i) && w(g, i, e[i]);
11
- return g;
12
- }, U = (g, e) => Q(g, Y(e));
13
- var O = (g, e) => {
14
- var i = {};
15
- for (var t in g)
16
- A.call(g, t) && e.indexOf(t) < 0 && (i[t] = g[t]);
17
- if (g != null && x)
18
- for (var t of x(g))
19
- e.indexOf(t) < 0 && E.call(g, t) && (i[t] = g[t]);
20
- return i;
1
+ var Q = Object.defineProperty, Y = Object.defineProperties;
2
+ var ee = Object.getOwnPropertyDescriptors;
3
+ var w = Object.getOwnPropertySymbols;
4
+ var E = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
5
+ var T = Math.pow, V = (m, i, e) => i in m ? Q(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e, y = (m, i) => {
6
+ for (var e in i || (i = {}))
7
+ E.call(i, e) && V(m, e, i[e]);
8
+ if (w)
9
+ for (var e of w(i))
10
+ O.call(i, e) && V(m, e, i[e]);
11
+ return m;
12
+ }, S = (m, i) => Y(m, ee(i));
13
+ var R = (m, i) => {
14
+ var e = {};
15
+ for (var t in m)
16
+ E.call(m, t) && i.indexOf(t) < 0 && (e[t] = m[t]);
17
+ if (m != null && w)
18
+ for (var t of w(m))
19
+ i.indexOf(t) < 0 && O.call(m, t) && (e[t] = m[t]);
20
+ return e;
21
21
  };
22
- var l = (g, e, i) => (w(g, typeof e != "symbol" ? e + "" : e, i), i);
23
- var T = (g, e, i) => new Promise((t, o) => {
22
+ var a = (m, i, e) => (V(m, typeof i != "symbol" ? i + "" : i, e), e);
23
+ var B = (m, i, e) => new Promise((t, o) => {
24
24
  var s = (n) => {
25
25
  try {
26
- a(i.next(n));
26
+ l(e.next(n));
27
27
  } catch (f) {
28
28
  o(f);
29
29
  }
30
30
  }, r = (n) => {
31
31
  try {
32
- a(i.throw(n));
32
+ l(e.throw(n));
33
33
  } catch (f) {
34
34
  o(f);
35
35
  }
36
- }, a = (n) => n.done ? t(n.value) : Promise.resolve(n.value).then(s, r);
37
- a((i = i.apply(g, e)).next());
36
+ }, l = (n) => n.done ? t(n.value) : Promise.resolve(n.value).then(s, r);
37
+ l((e = e.apply(m, i)).next());
38
38
  });
39
- import { Subscribe as ee } from "../../../shared-utils/Subscribe.js";
40
- import { calculateTagConfig as S } from "../../utils/tag/calculateTagConfig.js";
41
- import { getTagStickType as ie } from "../../utils/tag/format.js";
39
+ import { Subscribe as ie } from "../../../shared-utils/Subscribe.js";
40
+ import { calculateTagConfig as F } from "../../utils/tag/calculateTagConfig.js";
41
+ import { getTagStickType as te } from "../../utils/tag/format.js";
42
42
  import "../../../shared-utils/tag.js";
43
- import { isPanoramaLike as V, isModelLike as M } from "../../../shared-utils/five/mode.js";
44
- import * as y from "three";
43
+ import { isPanoramaLike as A, isModelLike as U } from "../../../shared-utils/five/mode.js";
44
+ import * as P from "three";
45
45
  import "../../../vendor/hammerjs/hammer.js";
46
46
  import "../../../shared-utils/three/PointSelector/index.js";
47
- import { centerPoint as te } from "../../../shared-utils/three/centerPoint.js";
47
+ import { centerPoint as ne } from "../../../shared-utils/three/centerPoint.js";
48
48
  import "../../../shared-utils/three/CSS3DRenderer/index.js";
49
49
  import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
50
- import { anyPositionToVector3 as R } from "../../../shared-utils/positionToVector3.js";
51
- import { toArray as ne } from "../../../shared-utils/util.js";
50
+ import { anyPositionToVector3 as _ } from "../../../shared-utils/positionToVector3.js";
51
+ import { toArray as se } from "../../../shared-utils/util.js";
52
52
  import "@realsee/five/line";
53
- import { isNil as _, notNil as L } from "../../../shared-utils/isNil.js";
53
+ import { isNil as $, notNil as N } from "../../../shared-utils/isNil.js";
54
54
  import "../../../shared-utils/three/core/Five_LineMaterial2.js";
55
55
  import "../../../shared-utils/three/core/Sphere.js";
56
- import { blink as se, reblink as oe } from "../../../shared-utils/three/blink.js";
56
+ import { blink as oe, reblink as re } from "../../../shared-utils/three/blink.js";
57
57
  import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
58
58
  import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
59
- import { vectorToCoordinates as re } from "../../../shared-utils/vectorToCoordinate.js";
60
- import { transformPosition as $ } from "../../../shared-utils/five/transformPosition.js";
59
+ import { vectorToCoordinates as le } from "../../../shared-utils/vectorToCoordinate.js";
60
+ import { transformPosition as z } from "../../../shared-utils/five/transformPosition.js";
61
61
  import { lookPoint as ae } from "../../../shared-utils/five/lookPoint.js";
62
- import { uuid as le } from "../../../shared-utils/uuid.js";
62
+ import { uuid as fe } from "../../../shared-utils/uuid.js";
63
63
  import "../../../shared-utils/five/FivePuppet.js";
64
- import { objectAssignDeepExports as P } from "../../../vendor/object-assign-deep/objectAssignDeep.js";
65
- import { getTagPosition as N, getTagCenterPosition as z } from "../../utils/tagPosition.js";
66
- import { checkRange as k } from "../../utils/checkRange.js";
67
- import { isMediaPlaneTag as W, isMediaModelTag as B } from "../../utils/tag/tagCheck.js";
68
- import { getUrlExt as J } from "../../../shared-utils/url/getUrl.js";
69
- import { getFloorIndex as fe } from "../../../shared-utils/five/getFloorIndex.js";
70
- import { safeObj as H } from "../../../shared-utils/safeObj.js";
71
- import { Cache as ce } from "../../utils/Cache.js";
72
- import { _raycaster as D } from "../../../shared-utils/three/temp.js";
73
- import { withResolvers as de } from "../../../shared-utils/promise/withResolvers.js";
64
+ import { objectAssignDeepExports as x } from "../../../vendor/object-assign-deep/objectAssignDeep.js";
65
+ import { getTagPosition as W, getTagCenterPosition as J } from "../../utils/tagPosition.js";
66
+ import { checkRange as M } from "../../utils/checkRange.js";
67
+ import { isMediaPlaneTag as H, isMediaModelTag as D } from "../../utils/tag/tagCheck.js";
68
+ import { getUrlExt as q } from "../../../shared-utils/url/getUrl.js";
69
+ import { getFloorIndex as ce } from "../../../shared-utils/five/getFloorIndex.js";
70
+ import { safeObj as X } from "../../../shared-utils/safeObj.js";
71
+ import { Cache as de } from "../../utils/Cache.js";
72
+ import { _raycaster as j } from "../../../shared-utils/three/temp.js";
73
+ import { withResolvers as ue } from "../../../shared-utils/promise/withResolvers.js";
74
74
  import "../../../shared-utils/typescript/entries.js";
75
75
  import "../../utils/tag/adaptConfig.js";
76
76
  import "../../typings/tag/TagConfig.js";
@@ -122,89 +122,96 @@ import "../../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
122
122
  import "../../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
123
123
  import "../../../shared-utils/formatRad.js";
124
124
  class Wi {
125
- constructor(e, i) {
126
- l(this, "plugin");
127
- l(this, "id");
128
- l(this, "contentType");
129
- l(this, "stickType");
130
- l(this, "enabled");
131
- l(this, "config");
132
- l(this, "data");
133
- l(this, "state");
134
- l(this, "temporaryState", { visible: !0 });
135
- l(this, "originPosition");
136
- l(this, "position");
137
- l(this, "fiveState");
138
- l(this, "model");
139
- l(this, "matrix");
140
- l(this, "screenPosition");
141
- l(this, "normal");
142
- l(this, "mediaPlane");
143
- l(this, "hooks");
144
- l(this, "zIndex");
145
- l(this, "manuallyOperated", !1);
146
- l(this, "play");
147
- l(this, "pause");
148
- l(this, "tag3DContentSvelte");
149
- l(this, "rectanglePlane");
150
- l(this, "dom");
151
- l(this, "contentDom");
152
- l(this, "initialConfig");
153
- l(this, "computedConfig");
125
+ constructor(i, e) {
126
+ a(this, "plugin");
127
+ a(this, "id");
128
+ a(this, "contentType");
129
+ a(this, "stickType");
130
+ a(this, "enabled");
131
+ a(this, "config");
132
+ a(this, "data");
133
+ a(this, "state");
134
+ a(this, "temporaryState", { visible: !0 });
135
+ a(this, "originPosition");
136
+ a(this, "position");
137
+ a(this, "fiveState");
138
+ a(this, "model");
139
+ a(this, "matrix");
140
+ a(this, "screenPosition");
141
+ a(this, "normal");
142
+ a(this, "mediaPlane");
143
+ a(this, "tagNormalLine");
144
+ a(this, "hooks");
145
+ a(this, "zIndex");
146
+ a(this, "manuallyOperated", !1);
147
+ a(this, "normalLineLength");
148
+ a(this, "play");
149
+ a(this, "pause");
150
+ a(this, "tag3DContentSvelte");
151
+ a(this, "rectanglePlane");
152
+ a(this, "dom");
153
+ a(this, "contentDom");
154
+ a(this, "initialConfig");
155
+ a(this, "computedConfig");
154
156
  /**
155
157
  * 存储当前的闪烁动画实例
156
158
  * @private
157
159
  */
158
- l(this, "_currentBlinkInstance");
159
- l(this, "cache");
160
- l(this, "entryFromModel");
161
- l(this, "_updating", !1);
160
+ a(this, "_currentBlinkInstance");
161
+ a(this, "cache");
162
+ a(this, "entryFromModel");
163
+ a(this, "_updating", !1);
162
164
  /**
163
165
  * 是否启用 hover 行为,默认 为config.popoverConfig.enabled
164
166
  */
165
- l(this, "hoverEnabled");
166
- l(this, "ready", () => {
167
- const { promise: e, resolve: i } = de();
167
+ a(this, "hoverEnabled");
168
+ a(this, "ready", () => {
169
+ const { promise: i, resolve: e } = ue();
168
170
  if (!this._updating)
169
- i();
171
+ e();
170
172
  else {
171
173
  const t = setInterval(() => {
172
- this._updating || (clearInterval(t), i());
174
+ this._updating || (clearInterval(t), e());
173
175
  }, 17);
174
176
  setTimeout(() => {
175
- clearInterval(t), i();
177
+ clearInterval(t), e();
176
178
  }, 300);
177
179
  }
178
- return e;
180
+ return i;
179
181
  });
180
- var f, m, p, c, u, h;
181
- this.plugin = e;
182
- const t = ie(i);
183
- i.stickType = t;
184
- const o = JSON.parse(JSON.stringify(i.data)), s = (f = i.initialConfig) != null ? f : i.config ? JSON.parse(JSON.stringify(i.config)) : {};
185
- i.initialConfig = s;
186
- const r = S(i, e.config), a = this.getConfig(i);
187
- i.config = a, this.id = (m = i.id) != null ? m : le(), this.enabled = (p = i.enabled) != null ? p : !0, this.contentType = i.contentType, this.hoverEnabled = (u = (c = a.popoverConfig) == null ? void 0 : c.enabled) != null ? u : !0, this.data = (h = a.initialData) != null && h.important ? P(i.data, o, a.initialData) : P(i.data, a.initialData, o);
182
+ var f, p, h, c, d, u, v, b;
183
+ this.plugin = i;
184
+ const t = te(e);
185
+ e.stickType = t;
186
+ const o = JSON.parse(JSON.stringify(e.data)), s = (f = e.initialConfig) != null ? f : e.config ? JSON.parse(JSON.stringify(e.config)) : {};
187
+ e.initialConfig = s;
188
+ const r = F(e, i.config), l = this.getConfig(e);
189
+ e.config = l, this.id = (p = e.id) != null ? p : fe(), this.enabled = (h = e.enabled) != null ? h : !0, this.contentType = e.contentType, this.hoverEnabled = (d = (c = l.popoverConfig) == null ? void 0 : c.enabled) != null ? d : !0, this.data = (u = l.initialData) != null && u.important ? x(e.data, o, l.initialData) : x(e.data, l.initialData, o);
188
190
  let n;
189
- typeof a.unfoldedConfig == "object" ? a.unfoldedConfig.keep === "unfolded" ? n = !0 : a.unfoldedConfig.keep === "folded" ? n = !1 : n = !this.can("fold") : n = !this.can("fold"), this.state = b({
191
+ typeof l.unfoldedConfig == "object" ? l.unfoldedConfig.keep === "unfolded" ? n = !0 : l.unfoldedConfig.keep === "folded" ? n = !1 : n = !this.can("fold") : n = !this.can("fold"), this.state = y({
190
192
  visible: void 0,
191
193
  unfolded: n
192
- }, a.initialState), this.isPopoverConfigEnabled() && (this.state.unfolded = !1), this.originPosition = i.position, i.originPosition = this.originPosition, this.position = (() => {
193
- const d = i.originPosition;
194
- if (!d)
194
+ }, l.initialState), this.isPopoverConfigEnabled() && (this.state.unfolded = !1), this.normalLineLength = (b = (v = e.style) == null ? void 0 : v.point) == null ? void 0 : b.normalLen, this.originPosition = e.position, e.originPosition = this.originPosition, this.position = (() => {
195
+ const g = e.originPosition;
196
+ if (!g)
195
197
  return;
196
- const v = e.workUtil.transform;
197
- return Array.isArray(d) && d.length === 4 ? d.map(R).map((C) => $(C, v).toArray()) : $(R(d), v).toArray();
198
- })(), this.matrix = i.matrix ? (() => {
199
- const d = new y.Matrix4().fromArray(i.matrix);
200
- return d.premultiply(e.workUtil.transform), d.elements;
201
- })() : i.matrix, this.initialConfig = s, this.computedConfig = r, this.stickType = t, this.config = i.config, this.fiveState = i.fiveState, this.normal = i.normal, this.cache = new ce(), this.hooks = new ee(), Object.keys(i).forEach((d) => {
202
- this[d] === void 0 && i[d] !== void 0 && (this[d] = i[d]);
198
+ const k = i.workUtil.transform;
199
+ let C = g;
200
+ if (Array.isArray(g) && g.length === 4 ? C = g.map(_).map((I) => z(I, k).toArray()) : C = z(_(g), k).toArray(), (e.stickType === "2DPoint" || e.stickType === "3DPoint") && e.normal && this.normalLineLength) {
201
+ const I = new P.Vector3().fromArray(e.normal);
202
+ C = new P.Vector3().fromArray(C).clone().add(I.clone().setLength(this.normalLineLength)).toArray();
203
+ }
204
+ return C;
205
+ })(), this.matrix = e.matrix ? (() => {
206
+ const g = new P.Matrix4().fromArray(e.matrix);
207
+ return g.premultiply(i.workUtil.transform), g.elements;
208
+ })() : e.matrix, this.initialConfig = s, this.computedConfig = r, this.stickType = t, this.config = e.config, this.fiveState = e.fiveState, this.normal = e.normal, this.cache = new de(), this.hooks = new ie(), Object.keys(e).forEach((g) => {
209
+ this[g] === void 0 && e[g] !== void 0 && (this[g] = e[g]);
203
210
  });
204
211
  }
205
212
  get visible() {
206
- var e;
207
- return ((e = this.temporaryState) == null ? void 0 : e.visible) !== !1 && this.state.visible !== !1 && this.enabled !== !1;
213
+ var i;
214
+ return ((i = this.temporaryState) == null ? void 0 : i.visible) !== !1 && this.state.visible !== !1 && this.enabled !== !1;
208
215
  }
209
216
  get five() {
210
217
  return this.plugin.five;
@@ -216,13 +223,13 @@ class Wi {
216
223
  return this.plugin.workUtil;
217
224
  }
218
225
  get centerPosition() {
219
- const e = N(this);
220
- return te(...Array.isArray(e) ? e : [e]);
226
+ const i = W(this);
227
+ return ne(...Array.isArray(i) ? i : [i]);
221
228
  }
222
229
  get currentConfig() {
223
230
  var o, s;
224
- const e = S(this, this.plugin.config, { useCache: !0 }), i = this.five.getCurrentState().mode, t = (o = e.configWithFiveMode) == null ? void 0 : o[i];
225
- return (s = t != null ? t : e) != null ? s : {};
231
+ const i = F(this, this.plugin.config, { useCache: !0 }), e = this.five.getCurrentState().mode, t = (o = i.configWithFiveMode) == null ? void 0 : o[e];
232
+ return (s = t != null ? t : i) != null ? s : {};
226
233
  }
227
234
  get currentVisible() {
228
235
  return !(!this.plugin.state.enabled || !this.plugin.state.visible || !this.enabled || !this.state.visible);
@@ -239,79 +246,92 @@ class Wi {
239
246
  /**
240
247
  * @description 找到标签
241
248
  */
242
- find(e) {
243
- return T(this, null, function* () {
249
+ find(i) {
250
+ return B(this, null, function* () {
244
251
  var o;
245
- const i = this.fiveState;
252
+ const e = this.fiveState;
246
253
  if (!this.fiveState)
247
254
  return this;
248
- const t = (o = e == null ? void 0 : e.targetMode) != null ? o : this.five.state.mode;
255
+ const t = (o = i == null ? void 0 : i.targetMode) != null ? o : this.five.state.mode;
249
256
  if (t === "Panorama") {
250
- const s = i == null ? void 0 : i.panoIndex;
251
- if (_(s))
257
+ const s = e == null ? void 0 : e.panoIndex;
258
+ if ($(s))
252
259
  return this;
253
- const r = this.workUtil.getObserverPosition(s), a = this.centerPosition.clone().sub(r).normalize();
254
- this.five.setState(b({
260
+ const r = this.workUtil.getObserverPosition(s), l = this.centerPosition.clone().sub(r).normalize();
261
+ this.five.setState(y({
255
262
  mode: "Panorama",
256
263
  workCode: this.workUtil.workCode,
257
264
  panoIndex: s
258
- }, re(a))), yield this.five.ready();
265
+ }, le(l))), yield this.five.ready();
259
266
  } else
260
- t === "Mapview" && (yield ae(this.five, this.centerPosition, e == null ? void 0 : e.pointConfig));
267
+ t === "Mapview" && (yield ae(this.five, this.centerPosition, i == null ? void 0 : i.pointConfig));
261
268
  return this;
262
269
  });
263
270
  }
271
+ /**
272
+ * @description 获取额外的闪烁目标(子类可以重写此方法添加额外的闪烁目标,如法线等)
273
+ * @returns 额外的闪烁目标或目标数组,返回 null/undefined 表示没有额外目标
274
+ */
275
+ getAdditionalBlinkTargets() {
276
+ return null;
277
+ }
264
278
  /**
265
279
  * @description 闪烁
266
280
  */
267
- blink(e) {
268
- return T(this, null, function* () {
269
- var a, n, f, m, p, c;
270
- yield this.ready(), this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((n = (a = this._currentBlinkInstance).preComplete) == null || n.call(a), this._currentBlinkInstance = void 0);
271
- const i = (f = this.enabled) != null ? f : !0, t = (m = this.state) == null ? void 0 : m.visible, o = i && t;
272
- o === !1 && (this.state.visible = !0, this.enabled = !0, this.applyVisible(), this.plugin.render(), this.computeRenderType() !== "Mesh" ? yield new Promise((u) => {
281
+ blink(i) {
282
+ return B(this, null, function* () {
283
+ var l, n, f, p, h, c;
284
+ yield this.ready(), this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((n = (l = this._currentBlinkInstance).preComplete) == null || n.call(l), this._currentBlinkInstance = void 0);
285
+ const e = (f = this.enabled) != null ? f : !0, t = (p = this.state) == null ? void 0 : p.visible, o = e && t;
286
+ o === !1 && (this.state.visible = !0, this.enabled = !0, this.applyVisible(), this.plugin.render(), this.computeRenderType() !== "Mesh" ? yield new Promise((d) => {
273
287
  if (this.dom || this.contentDom) {
274
- u();
288
+ d();
275
289
  return;
276
290
  }
277
- const h = setInterval(() => {
278
- (this.dom || this.contentDom) && (u(), clearInterval(h));
291
+ const u = setInterval(() => {
292
+ (this.dom || this.contentDom) && (d(), clearInterval(u));
279
293
  }, 16.7);
280
- }) : this.stickType === "Model" && !((p = this.model) != null && p.object) ? yield (c = this.model) == null ? void 0 : c.promise : this.stickType === "Plane" && (yield new Promise((u) => {
294
+ }) : this.stickType === "Model" && !((h = this.model) != null && h.object) ? yield (c = this.model) == null ? void 0 : c.promise : this.stickType === "Plane" && (yield new Promise((d) => {
281
295
  if (this.mediaPlane) {
282
- u();
296
+ d();
283
297
  return;
284
298
  }
285
- const h = setInterval(() => {
286
- this.mediaPlane && (u(), clearInterval(h));
299
+ const u = setInterval(() => {
300
+ this.mediaPlane && (d(), clearInterval(u));
287
301
  }, 16.7);
288
302
  })), this.dom && (this.dom.style.visibility = "hidden"), this.contentDom && (this.contentDom.style.visibility = "hidden"));
289
303
  const s = (() => {
290
- var h, d, v;
291
- const u = [];
292
- return u.push(this.dom), u.push((d = (h = this.tag3DContentSvelte) == null ? void 0 : h.css3DInstance) == null ? void 0 : d.container), u.push((v = this.model) == null ? void 0 : v.object), u.push(this.mediaPlane), u.filter(Boolean);
304
+ var v, b, g;
305
+ const d = [];
306
+ d.push(this.dom), d.push((b = (v = this.tag3DContentSvelte) == null ? void 0 : v.css3DInstance) == null ? void 0 : b.container), d.push((g = this.model) == null ? void 0 : g.object), d.push(this.mediaPlane);
307
+ const u = this.getAdditionalBlinkTargets();
308
+ if (u) {
309
+ const k = Array.isArray(u) ? u : [u];
310
+ d.push(...k);
311
+ }
312
+ return d.filter(Boolean);
293
313
  })();
294
314
  if (!s.length) {
295
315
  console.warn("tagDom is empty");
296
316
  return;
297
317
  }
298
- const r = o ? se : oe;
299
- this._currentBlinkInstance = r(s, b({
318
+ const r = o ? oe : re;
319
+ this._currentBlinkInstance = r(s, y({
300
320
  begin: () => {
301
321
  o === !1 && (this.dom && (this.dom.style.visibility = ""), this.contentDom && (this.contentDom.style.visibility = ""));
302
322
  },
303
323
  updateRender: () => {
304
324
  this.five.needsRender = !0;
305
325
  }
306
- }, e));
326
+ }, i));
307
327
  try {
308
328
  yield this._currentBlinkInstance.finished;
309
- } catch (u) {
310
- console.debug("Blink animation interrupted:", u);
329
+ } catch (d) {
330
+ console.debug("Blink animation interrupted:", d);
311
331
  } finally {
312
332
  this._currentBlinkInstance = void 0;
313
333
  }
314
- i === !1 && (this.enabled = !1, this.updateVisible()), t === !1 && this.updateVisible(), o === !1 && (this.dom && (this.dom.style.visibility = ""), this.contentDom && (this.contentDom.style.visibility = ""));
334
+ e === !1 && (this.enabled = !1, this.updateVisible()), t === !1 && this.updateVisible(), o === !1 && (this.dom && (this.dom.style.visibility = ""), this.contentDom && (this.contentDom.style.visibility = ""));
315
335
  });
316
336
  }
317
337
  /**
@@ -339,49 +359,49 @@ class Wi {
339
359
  * @description 禁用
340
360
  */
341
361
  disable() {
342
- var e;
343
- this.enabled = !1, this.hooks.emit("disable"), (e = this.rectanglePlane) == null || e.delete(), this.applyVisible();
362
+ var i;
363
+ this.enabled = !1, this.hooks.emit("disable"), (i = this.rectanglePlane) == null || i.delete(), this.applyVisible();
344
364
  }
345
365
  /**
346
366
  * @deprecated use `setData` instead
347
367
  */
348
- changeData(e, i = !0) {
349
- return this.setData(e, i);
368
+ changeData(i, e = !0) {
369
+ return this.setData(i, e);
350
370
  }
351
371
  /**
352
372
  * @deprecated use `setPosition` instead
353
373
  */
354
- changePosition(e) {
355
- return this.setPosition(e);
374
+ changePosition(i) {
375
+ return this.setPosition(i);
356
376
  }
357
377
  /**
358
378
  * @description 修改标签数据
359
379
  * @param deepMerge 是否深度合并 data,默认为 true
360
380
  */
361
- setData(e, i = !0) {
362
- i ? this.data = P(this.data, e) : this.data = b(b({}, this.data), e), this.hooks.emit("dataChanged", this.data);
381
+ setData(i, e = !0) {
382
+ e ? this.data = x(this.data, i) : this.data = y(y({}, this.data), i), this.hooks.emit("dataChanged", this.data);
363
383
  }
364
384
  /**
365
385
  * @description 修改标签位置
366
386
  */
367
- setPosition(e) {
387
+ setPosition(i) {
368
388
  throw new Error("Method not implemented.");
369
389
  }
370
390
  /**
371
391
  * @description 设置标签实例的属性
372
392
  * @param deepMerge 是否深度合并 data,默认为 true
373
393
  */
374
- set(e, i = !0) {
375
- this.plugin.tagsLengthWillUpdate = !0, i ? P(this, e) : Object.assign(this, e), this.cache.clear();
394
+ set(i, e = !0) {
395
+ this.plugin.tagsLengthWillUpdate = !0, e ? x(this, i) : Object.assign(this, i), this.cache.clear();
376
396
  }
377
397
  updateConfig() {
378
398
  var t;
379
- const e = this.getConfig(void 0, { useCache: !1 });
380
- this.computedConfig = e;
381
- const i = this.getConfig();
382
- if (this.config = i, this.config.initialData) {
399
+ const i = this.getConfig(void 0, { useCache: !1 });
400
+ this.computedConfig = i;
401
+ const e = this.getConfig();
402
+ if (this.config = e, this.config.initialData) {
383
403
  const o = JSON.parse(JSON.stringify(this.data));
384
- this.data = (t = i.initialData) != null && t.important ? P(this.data, o, i.initialData) : P(this.data, i.initialData, o);
404
+ this.data = (t = e.initialData) != null && t.important ? x(this.data, o, e.initialData) : x(this.data, e.initialData, o);
385
405
  }
386
406
  this.cache.clear();
387
407
  }
@@ -389,97 +409,97 @@ class Wi {
389
409
  this.enabled ? (this.state.visible = this.getVisible(), this.applyVisible()) : this.applyVisible(), this._updating = !1;
390
410
  }
391
411
  updateZIndex() {
392
- const e = this.getSquaredDistance();
393
- this.zIndex = Math.round((1e4 - (e != null ? e : 0)) * 100);
412
+ const i = this.getSquaredDistance();
413
+ this.zIndex = Math.round((1e4 - (i != null ? i : 0)) * 100);
394
414
  }
395
- getConfig(e, i) {
396
- var r, a, n;
397
- const t = S(e != null ? e : this, this.plugin.config, { useCache: i == null ? void 0 : i.useCache }), o = (r = i == null ? void 0 : i.fiveMode) != null ? r : this.five.getCurrentState().mode, s = (a = t.configWithFiveMode) == null ? void 0 : a[o];
415
+ getConfig(i, e) {
416
+ var r, l, n;
417
+ const t = F(i != null ? i : this, this.plugin.config, { useCache: e == null ? void 0 : e.useCache }), o = (r = e == null ? void 0 : e.fiveMode) != null ? r : this.five.getCurrentState().mode, s = (l = t.configWithFiveMode) == null ? void 0 : l[o];
398
418
  return (n = s != null ? s : t) != null ? n : {};
399
419
  }
400
- getDistance(e, i = 3) {
401
- const t = b(b({}, this.five.getCurrentState()), e), { panoIndex: o, mode: s } = t, r = s === "Panorama" ? this.workUtil.getObserverPosition(o) : this.five.camera.position, a = this.centerPosition;
402
- return !r || !a ? -1 : r.distanceTo(a);
420
+ getDistance(i, e = 3) {
421
+ const t = y(y({}, this.five.getCurrentState()), i), { panoIndex: o, mode: s } = t, r = s === "Panorama" ? this.workUtil.getObserverPosition(o) : this.five.camera.position, l = this.centerPosition;
422
+ return !r || !l ? -1 : r.distanceTo(l);
403
423
  }
404
424
  /**
405
425
  * @description 用于排序的距离,性能更好
406
426
  */
407
427
  getSquaredDistance() {
408
- const e = this.five.camera.position;
409
- let i;
410
- return Array.isArray(this.position[0]) ? i = this.position[0] : i = this.position, I(i[0] - e.x, 2) + I(i[1] - e.y, 2) + I(i[2] - e.z, 2);
428
+ const i = this.five.camera.position;
429
+ let e;
430
+ return Array.isArray(this.position[0]) ? e = this.position[0] : e = this.position, T(e[0] - i.x, 2) + T(e[1] - i.y, 2) + T(e[2] - i.z, 2);
411
431
  }
412
- getVisible(e) {
432
+ getVisible(i) {
413
433
  if (!this.enabled || !this.plugin.state.enabled || !this.fiveUtil.model)
414
434
  return !1;
415
- const i = b(b({}, this.five.getCurrentState()), e);
416
- let t = this.cache.getVisible(this, i);
417
- return _(t) && (t = this.computeVisible(i).value, this.cache.setVisible(this, i, t)), t;
435
+ const e = y(y({}, this.five.getCurrentState()), i);
436
+ let t = this.cache.getVisible(this, e);
437
+ return $(t) && (t = this.computeVisible(e).value, this.cache.setVisible(this, e, t)), t;
418
438
  }
419
- getUnfoldedByPanoIndex(e) {
439
+ getUnfoldedByPanoIndex(i) {
420
440
  if (!this.currentVisible)
421
441
  return;
422
- const t = this.computeUnfoldedByPanoIndex(e);
442
+ const t = this.computeUnfoldedByPanoIndex(i);
423
443
  return t && this.getUnfoldedByCamera();
424
444
  }
425
445
  getUnfoldedByCamera() {
426
446
  return this.currentVisible ? this.computeUnfoldedByCamera() : void 0;
427
447
  }
428
- can(e) {
448
+ can(i) {
429
449
  var t, o;
430
- if ((e === "fold" || e === "unfold") && ((o = (t = this.currentConfig) == null ? void 0 : t.popoverConfig) == null ? void 0 : o.enabled) === !0)
450
+ if ((i === "fold" || i === "unfold") && ((o = (t = this.currentConfig) == null ? void 0 : t.popoverConfig) == null ? void 0 : o.enabled) === !0)
431
451
  return !1;
432
- const i = this.currentConfig;
433
- if (!i || typeof i != "object")
452
+ const e = this.currentConfig;
453
+ if (!e || typeof e != "object")
434
454
  return !0;
435
- if (e === "show" || e === "hide") {
436
- if (!i.visibleConfig || typeof i.visibleConfig != "object")
455
+ if (i === "show" || i === "hide") {
456
+ if (!e.visibleConfig || typeof e.visibleConfig != "object")
437
457
  return !0;
438
- if (e === "show" && i.visibleConfig.keep === "hidden" || e === "hide" && i.visibleConfig.keep === "visible")
458
+ if (i === "show" && e.visibleConfig.keep === "hidden" || i === "hide" && e.visibleConfig.keep === "visible")
439
459
  return !1;
440
460
  }
441
- if (e === "fold" || e === "unfold") {
442
- if (!i.unfoldedConfig || typeof i.unfoldedConfig != "object")
461
+ if (i === "fold" || i === "unfold") {
462
+ if (!e.unfoldedConfig || typeof e.unfoldedConfig != "object")
443
463
  return !0;
444
- if (e === "fold" && i.unfoldedConfig.keep === "unfolded" || e === "unfold" && i.unfoldedConfig.keep === "folded")
464
+ if (i === "fold" && e.unfoldedConfig.keep === "unfolded" || i === "unfold" && e.unfoldedConfig.keep === "folded")
445
465
  return !1;
446
466
  }
447
467
  return !0;
448
468
  }
449
- onClick(e) {
469
+ onClick(i) {
450
470
  }
451
471
  computeRenderType() {
452
- const e = (() => {
472
+ const i = (() => {
453
473
  if (this.stickType === "3DPoint")
454
474
  return "Dom";
455
- const i = this.getConfig();
456
- if (!i || typeof i != "object" || !i.renderType)
475
+ const e = this.getConfig();
476
+ if (!e || typeof e != "object" || !e.renderType)
457
477
  return;
458
478
  const t = this.data.mediaData;
459
- if ((!t || t.length === 0) && W(this))
460
- return i.renderType;
461
- if (i.renderType === "Mesh") {
462
- if (W(this)) {
479
+ if ((!t || t.length === 0) && H(this))
480
+ return e.renderType;
481
+ if (e.renderType === "Mesh") {
482
+ if (H(this)) {
463
483
  if (t.length === 1) {
464
484
  if (t[0].type === "Video")
465
485
  return navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && navigator.userAgent.toLowerCase().indexOf("mobile") > -1 ? "Dom" : "Mesh";
466
486
  if (t[0].type === "Image")
467
- return J(t[0].url) === "gif" ? "Dom" : "Mesh";
487
+ return q(t[0].url) === "gif" ? "Dom" : "Mesh";
468
488
  }
469
- } else if (B(this))
470
- return t.length === 1 && t[0].type === "Image" ? J(t[0].url) === "gif" ? "Dom" : "Mesh" : "BehindDom";
489
+ } else if (D(this))
490
+ return t.length === 1 && t[0].type === "Image" ? q(t[0].url) === "gif" ? "Dom" : "Mesh" : "BehindDom";
471
491
  }
472
492
  })();
473
- return e != null ? e : "Dom";
493
+ return i != null ? i : "Dom";
474
494
  }
475
- computeVisible(e) {
476
- const i = b(b({}, this.five.getCurrentState()), e), { panoIndex: t, mode: o } = i, s = [];
495
+ computeVisible(i) {
496
+ const e = y(y({}, this.five.getCurrentState()), i), { panoIndex: t, mode: o } = e, s = [];
477
497
  return (() => {
478
- var f, p, c, u;
498
+ var f, h, c, d;
479
499
  const n = (f = this.getConfig().visibleConfig) != null ? f : {};
480
500
  if (typeof n == "function")
481
501
  return {
482
- value: n(this.five, { tag: this, distance: this.getDistance(i, void 0) }),
502
+ value: n(this.five, { tag: this, distance: this.getDistance(e, void 0) }),
483
503
  checkedList: s,
484
504
  reason: "config function result"
485
505
  };
@@ -488,22 +508,22 @@ class Wi {
488
508
  return { value: !1, checkedList: s, reason: "config.keep is hidden" };
489
509
  if (n.keep === "visible")
490
510
  return { value: !0, checkedList: s, reason: "config.keep is visible" };
491
- const h = this.computeVisibleByFiveMode(n, o);
492
- if ((h == null ? void 0 : h.value) === !1)
493
- return h;
511
+ const u = this.computeVisibleByFiveMode(n, o);
512
+ if ((u == null ? void 0 : u.value) === !1)
513
+ return u;
494
514
  if (n.followModelVisibility === !0 && ["poincare", "aerophoto", "sand"].includes(this.workUtil.fromType) && (o === "Floorplan" || o === "Mapview")) {
495
- const m = this.computeVisibleByFloorIndex(), { value: d } = m, v = O(m, ["value"]);
496
- if (d === !1)
497
- return b({ value: !1, checkedList: s, reason: "followModelVisibility check failed" }, v);
515
+ const p = this.computeVisibleByFloorIndex(), { value: v } = p, b = R(p, ["value"]);
516
+ if (v === !1)
517
+ return y({ value: !1, checkedList: s, reason: "followModelVisibility check failed" }, b);
498
518
  }
499
- if (V(o) && n.visiblePanoIndex !== void 0 && n.visiblePanoIndex !== "all" && t !== void 0) {
519
+ if (A(o) && n.visiblePanoIndex !== void 0 && n.visiblePanoIndex !== "all" && t !== void 0) {
500
520
  if (s.push("visiblePanoIndex"), Array.isArray(n.visiblePanoIndex) && !n.visiblePanoIndex.includes(t))
501
521
  return {
502
522
  value: !1,
503
523
  checkedList: s,
504
524
  reason: `current panoIndex is not included in visiblePano. currentPanoIndex: ${t}, visiblePanoIndex: ${n.visiblePanoIndex}`
505
525
  };
506
- if (n.visiblePanoIndex === "current" && t !== ((p = this.fiveState) == null ? void 0 : p.panoIndex))
526
+ if (n.visiblePanoIndex === "current" && t !== ((h = this.fiveState) == null ? void 0 : h.panoIndex))
507
527
  return {
508
528
  value: !1,
509
529
  checkedList: s,
@@ -511,14 +531,14 @@ class Wi {
511
531
  };
512
532
  }
513
533
  if (n.visibleDistance !== void 0 && (s.push("visibleDistance"), n.visibleDistance !== "unLimited")) {
514
- const d = this.getDistance(i, 1);
515
- if (k(d, n.visibleDistance) === !1)
534
+ const v = this.getDistance(e, 1);
535
+ if (M(v, n.visibleDistance) === !1)
516
536
  return {
517
537
  value: !1,
518
538
  checkedList: s,
519
539
  panoIndex: t,
520
540
  visibleDistance: n.visibleDistance,
521
- reason: `distance is not in visibleDistance. distance: ${d}, visibleDistance: ${n.visibleDistance.min} - ${n.visibleDistance.max}`
541
+ reason: `distance is not in visibleDistance. distance: ${v}, visibleDistance: ${n.visibleDistance.min} - ${n.visibleDistance.max}`
522
542
  };
523
543
  }
524
544
  if (n.intersectRaycaster !== !1 && (typeof n.intersectRaycaster != "object" || n.intersectRaycaster.enabled !== !1)) {
@@ -528,12 +548,12 @@ class Wi {
528
548
  checkedList: s,
529
549
  reason: `intersectRaycaster check failed: panoIndex is ${t}`
530
550
  };
531
- if (t === ((u = this.fiveState) == null ? void 0 : u.panoIndex))
551
+ if (t === ((d = this.fiveState) == null ? void 0 : d.panoIndex))
532
552
  s.push("intersectCheckSkiped");
533
553
  else {
534
- const d = this.computeVisibleByIntersect(t);
535
- if (d.value === !1)
536
- return Object.assign(d, { checkedList: s });
554
+ const v = this.computeVisibleByIntersect(t);
555
+ if (v.value === !1)
556
+ return Object.assign(v, { checkedList: s });
537
557
  }
538
558
  }
539
559
  return {
@@ -547,26 +567,26 @@ class Wi {
547
567
  /**
548
568
  * @description 计算标签可见性
549
569
  */
550
- computeVisibleByFiveMode(e, i) {
570
+ computeVisibleByFiveMode(i, e) {
551
571
  const t = () => {
552
- var r, a;
553
- let s = typeof e.visibleFiveMode == "function" ? e.visibleFiveMode(this) : e.visibleFiveMode;
554
- if (s || (s = (a = (r = this.fiveState) == null ? void 0 : r.mode) != null ? a : this.workUtil.observers.length ? "Panorama" : "ModelLike"), Array.isArray(s))
555
- return s.includes(i);
572
+ var r, l;
573
+ let s = typeof i.visibleFiveMode == "function" ? i.visibleFiveMode(this) : i.visibleFiveMode;
574
+ if (s || (s = (l = (r = this.fiveState) == null ? void 0 : r.mode) != null ? l : this.workUtil.observers.length ? "Panorama" : "ModelLike"), Array.isArray(s))
575
+ return s.includes(e);
556
576
  if (s === "ModelLike")
557
- return M(i);
577
+ return U(e);
558
578
  if (s === "PanoramaLike")
559
- return !V(i);
579
+ return !A(e);
560
580
  if (s === "all")
561
581
  return !0;
562
582
  if (typeof s == "string")
563
- return s === i;
583
+ return s === e;
564
584
  };
565
585
  if ((() => {
566
586
  var r;
567
587
  const s = t();
568
- if (L((r = this.fiveState) == null ? void 0 : r.panoIndex) && e.entryFromModel) {
569
- if (M(i) && s ? this.entryFromModel = !1 : this.entryFromModel = !0, M(i))
588
+ if (N((r = this.fiveState) == null ? void 0 : r.panoIndex) && i.entryFromModel) {
589
+ if (U(e) && s ? this.entryFromModel = !1 : this.entryFromModel = !0, U(e))
570
590
  return !0;
571
591
  } else
572
592
  this.entryFromModel = !1;
@@ -575,213 +595,213 @@ class Wi {
575
595
  return {
576
596
  value: !1,
577
597
  reason: "current mode is not included in visibleFiveMode",
578
- visibleFiveMode: e.visibleFiveMode,
579
- mode: i
598
+ visibleFiveMode: i.visibleFiveMode,
599
+ mode: e
580
600
  };
581
601
  }
582
602
  /** 通过射线检测标签可用性 */
583
- computeVisibleByIntersect(e) {
584
- var n, f, m, p;
585
- const i = H(H((n = this.getConfig().visibleConfig) != null ? n : {}).intersectRaycaster), t = e != null ? e : this.five.getCurrentState().panoIndex, o = V(this.five.getCurrentState().mode) ? this.workUtil.getObserverPosition(t) : this.five.camera.position;
603
+ computeVisibleByIntersect(i) {
604
+ var n, f, p, h;
605
+ const e = X(X((n = this.getConfig().visibleConfig) != null ? n : {}).intersectRaycaster), t = i != null ? i : this.five.getCurrentState().panoIndex, o = A(this.five.getCurrentState().mode) ? this.workUtil.getObserverPosition(t) : this.five.camera.position;
586
606
  if (o === void 0)
587
607
  return { value: !1, reason: { type: "startPosition is undefined", fivePanoIndex: t } };
588
- const s = ne(
608
+ const s = se(
589
609
  (() => {
590
- var u;
591
- const c = (u = i.checkPoints) != null ? u : "center";
592
- return c === "center" ? z(this) : c === "corner" ? N(this) : Array.isArray(c) ? c : [];
610
+ var d;
611
+ const c = (d = e.checkPoints) != null ? d : "center";
612
+ return c === "center" ? J(this) : c === "corner" ? W(this) : Array.isArray(c) ? c : [];
593
613
  })()
594
614
  );
595
- let r = 0, a = 0;
615
+ let r = 0, l = 0;
596
616
  for (const c of s) {
597
- const u = new y.Vector3().subVectors(c, o).normalize();
598
- let h;
599
- D.set(o, u);
600
- const [d] = this.fiveUtil.model.intersectRaycaster(D);
601
- h = d == null ? void 0 : d.distance;
602
- const v = (() => {
603
- if (!B(this))
617
+ const d = new P.Vector3().subVectors(c, o).normalize();
618
+ let u;
619
+ j.set(o, d);
620
+ const [v] = this.fiveUtil.model.intersectRaycaster(j);
621
+ u = v == null ? void 0 : v.distance;
622
+ const b = (() => {
623
+ if (!D(this))
604
624
  return;
605
- const X = this.plugin.tags.filter(B).map((G) => {
606
- var j;
607
- return (j = G.model) == null ? void 0 : j.object;
608
- }).filter(L), [Z] = D.intersectObjects(X, !0);
609
- return Z;
610
- })(), C = o.distanceTo(c), F = (f = i.distanceAccuracy) != null ? f : 0.01;
611
- h = Math.min(h != null ? h : 1 / 0, (m = v == null ? void 0 : v.distance) != null ? m : 1 / 0), h + F >= C ? r++ : a++;
612
- const q = (p = i.needPassed) != null ? p : 1;
613
- if (r >= q)
625
+ const Z = this.plugin.tags.filter(D).map((K) => {
626
+ var L;
627
+ return (L = K.model) == null ? void 0 : L.object;
628
+ }).filter(N), [G] = j.intersectObjects(Z, !0);
629
+ return G;
630
+ })(), g = o.distanceTo(c), k = (f = e.distanceAccuracy) != null ? f : 0.01;
631
+ u = Math.min(u != null ? u : 1 / 0, (p = b == null ? void 0 : b.distance) != null ? p : 1 / 0), u + k >= g ? r++ : l++;
632
+ const I = (h = e.needPassed) != null ? h : 1;
633
+ if (r >= I)
614
634
  return { value: !0 };
615
635
  }
616
- return a === 0 ? { value: !0 } : {
636
+ return l === 0 ? { value: !0 } : {
617
637
  value: !1,
618
638
  reason: {
619
639
  type: "intersectRaycaster check failed",
620
640
  passedCount: r,
621
- needPassed: i.needPassed,
641
+ needPassed: e.needPassed,
622
642
  model: this.fiveUtil.model.name
623
643
  }
624
644
  };
625
645
  }
626
646
  computeVisibleByFloorIndex() {
627
- var o, s, r, a, n, f, m;
628
- let e = 0;
629
- const i = (o = this.fiveState) == null ? void 0 : o.panoIndex;
630
- i !== void 0 ? e = (s = this.workUtil.getObserver(i)) == null ? void 0 : s.floorIndex : e = fe(
647
+ var o, s, r, l, n, f, p;
648
+ let i = 0;
649
+ const e = (o = this.fiveState) == null ? void 0 : o.panoIndex;
650
+ e !== void 0 ? i = (s = this.workUtil.getObserver(e)) == null ? void 0 : s.floorIndex : i = ce(
631
651
  this.workUtil.work,
632
- (m = (f = (a = (r = this.model) == null ? void 0 : r.object) == null ? void 0 : a.position) != null ? f : (n = this.mediaPlane) == null ? void 0 : n.position) != null ? m : z(this)
652
+ (p = (f = (l = (r = this.model) == null ? void 0 : r.object) == null ? void 0 : l.position) != null ? f : (n = this.mediaPlane) == null ? void 0 : n.position) != null ? p : J(this)
633
653
  );
634
654
  const t = this.fiveUtil.model.shownFloor;
635
655
  return {
636
- value: t === null || t === e,
656
+ value: t === null || t === i,
637
657
  currentFiveFloorIndex: t,
638
- tagFloorIndex: e
658
+ tagFloorIndex: i
639
659
  };
640
660
  }
641
661
  /**
642
662
  * @description 获取是否展开
643
663
  */
644
- computeUnfoldedByPanoIndex(e) {
645
- const i = this.getConfig().unfoldedConfig;
646
- if (i) {
647
- if (typeof i == "function")
648
- return i(this.five, { tag: this, distance: this.getDistance({ panoIndex: e }) });
649
- if (i.keep === "folded")
664
+ computeUnfoldedByPanoIndex(i) {
665
+ const e = this.getConfig().unfoldedConfig;
666
+ if (e) {
667
+ if (typeof e == "function")
668
+ return e(this.five, { tag: this, distance: this.getDistance({ panoIndex: i }) });
669
+ if (e.keep === "folded")
650
670
  return !1;
651
- if (i.keep === "unfolded")
671
+ if (e.keep === "unfolded")
652
672
  return !0;
653
- if (i.unfoldDistance && k(this.getDistance({ panoIndex: e }), i.unfoldDistance) === !1)
673
+ if (e.unfoldDistance && M(this.getDistance({ panoIndex: i }), e.unfoldDistance) === !1)
654
674
  return !1;
655
675
  }
656
676
  }
657
677
  // 该方法有很大优化空间,这个检测显示方法不应该挂在tagBase下,做了多次不必要计算(MinimumDistance,ScreenCenter)。
658
678
  computeUnfoldedByCamera() {
659
- var i, t;
660
- if (this.entryFromModel && M(this.five.state.mode))
679
+ var e, t;
680
+ if (this.entryFromModel && U(this.five.state.mode))
661
681
  return !1;
662
- const e = this.getConfig().unfoldedConfig;
663
- if (e) {
664
- if (typeof e == "function")
665
- return e(this.five, { tag: this, distance: this.getDistance() });
666
- if (e.keep === "folded")
682
+ const i = this.getConfig().unfoldedConfig;
683
+ if (i) {
684
+ if (typeof i == "function")
685
+ return i(this.five, { tag: this, distance: this.getDistance() });
686
+ if (i.keep === "folded")
667
687
  return !1;
668
- if (e.keep === "unfolded")
688
+ if (i.keep === "unfolded")
669
689
  return !0;
670
- if (typeof e != "object" || e.autoUnfold === void 0 || e.autoUnfold === !1 || e.autoUnfold.enable === !1 || !e.autoUnfold.strategy)
690
+ if (typeof i != "object" || i.autoUnfold === void 0 || i.autoUnfold === !1 || i.autoUnfold.enable === !1 || !i.autoUnfold.strategy)
671
691
  return;
672
- if (e.autoUnfold.strategy === "ScreenPostion") {
692
+ if (i.autoUnfold.strategy === "ScreenPostion") {
673
693
  const o = this.computeTagProject();
674
- if (o && k(o.x, e.autoUnfold.autoUnfoldProjectX) === !1)
694
+ if (o && M(o.x, i.autoUnfold.autoUnfoldProjectX) === !1)
675
695
  return !1;
676
696
  }
677
- if (e.autoUnfold.strategy === "MinimumDistance") {
697
+ if (i.autoUnfold.strategy === "MinimumDistance") {
678
698
  const r = this.plugin.filterPointTag.filter((n) => n.currentVisible).filter((n) => {
679
699
  const f = this.computeTagProject();
680
700
  if (!f)
681
701
  return !1;
682
- const { x: m, y: p, z: c } = f;
683
- return !(Math.abs(c) > 1 || Math.abs(m) > 1 || Math.abs(p) > 1);
702
+ const { x: p, y: h, z: c } = f;
703
+ return !(Math.abs(c) > 1 || Math.abs(p) > 1 || Math.abs(h) > 1);
684
704
  }).map((n) => ({ tag: n, id: n.id, tagConfig: n.getConfig().unfoldedConfig })).filter(({ tagConfig: n }) => {
685
- var f, m;
686
- return !(typeof n == "function" || n.keep || n.autoUnfold === !1 || ((f = n.autoUnfold) == null ? void 0 : f.enable) === !1 || ((m = n.autoUnfold) == null ? void 0 : m.strategy) !== "MinimumDistance");
687
- }).map((n) => U(b({}, n), { distance: n.tag.getDistance() })).filter(({ distance: n, tagConfig: f }) => {
688
- const m = f.autoUnfold.distance;
689
- return !(m && k(n, m) === !1);
705
+ var f, p;
706
+ return !(typeof n == "function" || n.keep || n.autoUnfold === !1 || ((f = n.autoUnfold) == null ? void 0 : f.enable) === !1 || ((p = n.autoUnfold) == null ? void 0 : p.strategy) !== "MinimumDistance");
707
+ }).map((n) => S(y({}, n), { distance: n.tag.getDistance() })).filter(({ distance: n, tagConfig: f }) => {
708
+ const p = f.autoUnfold.distance;
709
+ return !(p && M(n, p) === !1);
690
710
  }).sort((n, f) => n.distance - f.distance).findIndex((n) => n.id === this.id);
691
- if (r === -1 || r <= ((i = e.autoUnfold.maxNumber) != null ? i : 1) - 1 === !1)
711
+ if (r === -1 || r <= ((e = i.autoUnfold.maxNumber) != null ? e : 1) - 1 === !1)
692
712
  return !1;
693
713
  }
694
- if (e.autoUnfold.strategy === "FoldWhenMove")
714
+ if (i.autoUnfold.strategy === "FoldWhenMove")
695
715
  return !1;
696
- if (e.autoUnfold.strategy === "ScreenCenter") {
697
- const o = this.plugin.filterPointTag, s = new y.Matrix4();
716
+ if (i.autoUnfold.strategy === "ScreenCenter") {
717
+ const o = this.plugin.filterPointTag, s = new P.Matrix4();
698
718
  s.multiplyMatrices(this.five.camera.projectionMatrix, this.five.camera.matrixWorldInverse);
699
- const r = new y.Frustum();
719
+ const r = new P.Frustum();
700
720
  r.setFromProjectionMatrix(s);
701
- const a = this.five.camera.getWorldDirection(new y.Vector3()), f = o.filter((p) => {
702
- var d, v;
703
- if (!p.currentVisible)
721
+ const l = this.five.camera.getWorldDirection(new P.Vector3()), f = o.filter((h) => {
722
+ var v, b;
723
+ if (!h.currentVisible)
704
724
  return !1;
705
- const c = p.getConfig().unfoldedConfig;
706
- if (p.manuallyOperated || typeof c != "object" || (c == null ? void 0 : c.autoUnfold) === !1 || ((d = c == null ? void 0 : c.autoUnfold) == null ? void 0 : d.strategy) !== "ScreenCenter" || c.keep || ((v = c.autoUnfold) == null ? void 0 : v.enable) === !1 || !r.containsPoint(new y.Vector3().fromArray(p.position)))
725
+ const c = h.getConfig().unfoldedConfig;
726
+ if (h.manuallyOperated || typeof c != "object" || (c == null ? void 0 : c.autoUnfold) === !1 || ((v = c == null ? void 0 : c.autoUnfold) == null ? void 0 : v.strategy) !== "ScreenCenter" || c.keep || ((b = c.autoUnfold) == null ? void 0 : b.enable) === !1 || !r.containsPoint(new P.Vector3().fromArray(h.position)))
707
727
  return !1;
708
- const h = c.autoUnfold.distance;
709
- if (h) {
710
- const C = p.getDistance();
711
- if (k(C, h) === !1)
728
+ const u = c.autoUnfold.distance;
729
+ if (u) {
730
+ const g = h.getDistance();
731
+ if (M(g, u) === !1)
712
732
  return !1;
713
733
  }
714
734
  return !0;
715
- }).sort((p, c) => {
716
- const u = new y.Vector3().fromArray(p.position), h = new y.Vector3().fromArray(c.position);
717
- return a.angleTo(u.sub(this.five.camera.position)) - a.angleTo(h.sub(this.five.camera.position));
718
- }).findIndex((p) => p.id === this.id);
719
- if (f === -1 || f <= ((t = e.autoUnfold.maxNumber) != null ? t : 1) - 1 === !1)
735
+ }).sort((h, c) => {
736
+ const d = new P.Vector3().fromArray(h.position), u = new P.Vector3().fromArray(c.position);
737
+ return l.angleTo(d.sub(this.five.camera.position)) - l.angleTo(u.sub(this.five.camera.position));
738
+ }).findIndex((h) => h.id === this.id);
739
+ if (f === -1 || f <= ((t = i.autoUnfold.maxNumber) != null ? t : 1) - 1 === !1)
720
740
  return !1;
721
741
  }
722
742
  return !0;
723
743
  }
724
744
  }
725
745
  computeTagProject() {
726
- const e = this.centerPosition;
727
- if (!e)
746
+ const i = this.centerPosition;
747
+ if (!i)
728
748
  return;
729
- const { x: i, y: t, z: o } = e.project(this.five.camera);
749
+ const { x: e, y: t, z: o } = i.project(this.five.camera);
730
750
  if (!(o > 1))
731
- return { x: i, y: t, z: o };
751
+ return { x: e, y: t, z: o };
732
752
  }
733
- addObjectClickHandler(e, i, t) {
734
- if (!i || !this.plugin.domEvents)
753
+ addObjectClickHandler(i, e, t) {
754
+ if (!e || !this.plugin.domEvents)
735
755
  return () => {
736
756
  };
737
- const o = () => !(!e.currentVisible || e.loading), s = (r) => {
757
+ const o = () => !(!i.currentVisible || i.loading), s = (r) => {
738
758
  if (!o())
739
759
  return !1;
740
760
  t(r.origDomEvent);
741
761
  };
742
- return this.plugin.domEvents.addEventListener(i, "click", s), () => {
762
+ return this.plugin.domEvents.addEventListener(e, "click", s), () => {
743
763
  var r;
744
- (r = this.plugin.domEvents) == null || r.removeEventListener(i, "click", s);
764
+ (r = this.plugin.domEvents) == null || r.removeEventListener(e, "click", s);
745
765
  };
746
766
  }
747
767
  whyHide() {
748
- var i;
768
+ var e;
749
769
  if (!this.plugin.state.enabled)
750
770
  return { reason: `plugin.state.enabled is ${this.plugin.state.enabled}` };
751
771
  if (!this.plugin.state.visible)
752
772
  return { reason: `plugin.state.visible is ${this.plugin.state.visible}` };
753
773
  if (!this.enabled)
754
774
  return { reason: `tag ${this.id} enabled is: ${this.enabled}` };
755
- const e = U(b({}, this.computeVisible()), {
775
+ const i = S(y({}, this.computeVisible()), {
756
776
  tagInstance: this
757
777
  });
758
- return e.value !== this.state.visible ? { reason: "插件故障,请联系维护人员, err: 0", info: e } : this.state.visible ? { reason: "应该是能看见才对", info: e } : e.value === !0 ? { reason: "插件故障,请联系维护人员, err: 1", info: e } : { reason: (i = e.reason.type) != null ? i : e.reason, info: e };
778
+ return i.value !== this.state.visible ? { reason: "插件故障,请联系维护人员, err: 0", info: i } : this.state.visible ? { reason: "应该是能看见才对", info: i } : i.value === !0 ? { reason: "插件故障,请联系维护人员, err: 1", info: i } : { reason: (e = i.reason.type) != null ? e : i.reason, info: i };
759
779
  }
760
780
  /**
761
781
  * @description 销毁并移除
762
782
  */
763
783
  destroy() {
764
- var i, t, o, s;
765
- const e = this.plugin.tags.findIndex((r) => r.id === this.id);
766
- if (e === -1) {
784
+ var e, t, o, s;
785
+ const i = this.plugin.tags.findIndex((r) => r.id === this.id);
786
+ if (i === -1) {
767
787
  console.warn(`Destroy failed: tag ${this.id} not found`);
768
788
  return;
769
789
  }
770
- this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((t = (i = this._currentBlinkInstance).preComplete) == null || t.call(i), this._currentBlinkInstance = void 0), this.disable(), (s = (o = this.tag3DContentSvelte) == null ? void 0 : o.dispose) == null || s.call(o), this.hooks.off(), this.cache.clear(), this.plugin.tags.splice(e, 1), this.plugin.tagsLengthWillUpdate = !0, this.plugin.hooks.emit("tagsLengthChange");
790
+ this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((t = (e = this._currentBlinkInstance).preComplete) == null || t.call(e), this._currentBlinkInstance = void 0), this.disable(), (s = (o = this.tag3DContentSvelte) == null ? void 0 : o.dispose) == null || s.call(o), this.hooks.off(), this.cache.clear(), this.plugin.tags.splice(i, 1), this.plugin.tagsLengthWillUpdate = !0, this.plugin.hooks.emit("tagsLengthChange");
771
791
  }
772
792
  /**
773
793
  * @description 判断 popover 是否在配置上启用(永久配置)
774
794
  */
775
795
  isPopoverConfigEnabled() {
776
- var e, i;
777
- return ((i = (e = this.currentConfig) == null ? void 0 : e.popoverConfig) == null ? void 0 : i.enabled) === !0;
796
+ var i, e;
797
+ return ((e = (i = this.currentConfig) == null ? void 0 : i.popoverConfig) == null ? void 0 : e.enabled) === !0;
778
798
  }
779
799
  /**
780
800
  * @description 判断当前标签是否允许临时 hover 弹出 popover(临时控制)
781
801
  */
782
802
  isHoverEnabled() {
783
- var e;
784
- return !(((e = this.plugin) == null ? void 0 : e.globalHoverEnabled) === !1 || this.hoverEnabled === !1);
803
+ var i;
804
+ return !(((i = this.plugin) == null ? void 0 : i.globalHoverEnabled) === !1 || this.hoverEnabled === !1);
785
805
  }
786
806
  }
787
807
  export {