leiting-bim 2.2.63 → 2.2.65

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,39 +1,39 @@
1
- import { p as ht, c as Me, w as oe } from "./create-DynflqE1.js";
2
- import { defineComponent as le, computed as m, openBlock as E, createElementBlock as H, normalizeStyle as $, normalizeClass as w, unref as M, toDisplayString as mt, createCommentVNode as Q, createElementVNode as Te, h as P, markRaw as O, render as K, inject as dt, onMounted as we, watch as Y, onUnmounted as yt, renderSlot as pt, ref as G, nextTick as bt, onBeforeUnmount as vt, createBlock as xt, resolveDynamicComponent as Ct } from "vue";
3
- import { MaterialManager as Le, MarkerEventBus as ee, HtmlOverlayLabelPool as de, BufferedHierarchicalAggregator as Mt, EntityLayerManager as Tt, getPolylineFlowMaterialProperty as wt, getDynamicImgMaterial as Lt, getWallMaterial as Se, MarkerEventKey as J } from "leiting-bim/plugins-methods";
1
+ import { p as ht, c as Me, w as le } from "./create-DynflqE1.js";
2
+ import { defineComponent as se, computed as m, openBlock as E, createElementBlock as H, normalizeStyle as $, normalizeClass as T, unref as M, toDisplayString as dt, createCommentVNode as te, createElementVNode as we, h as O, markRaw as P, render as X, inject as mt, onMounted as Te, watch as z, onUnmounted as yt, renderSlot as pt, ref as G, nextTick as bt, onBeforeUnmount as vt, createBlock as xt, resolveDynamicComponent as Ct } from "vue";
3
+ import { MaterialManager as Se, MarkerEventBus as K, HtmlOverlayLabelPool as Q, BufferedHierarchicalAggregator as Mt, EntityLayerManager as wt, getPolylineFlowMaterialProperty as Tt, getDynamicImgMaterial as St, getWallMaterial as Le, MarkerEventKey as ee } from "leiting-bim/plugins-methods";
4
4
  import { CxCardCarousel as ye } from "./components/card-carousel.js";
5
- import { CxMarkerBubbleLine as Pe, CxMarkerBubble as Oe } from "./components/marker-bubble.js";
6
- import { CxMarkerDefault as te } from "./components/marker-default.js";
7
- import { CxMarkerHtml as St } from "./components/marker-html.js";
5
+ import { CxMarkerBubbleLine as Oe, CxMarkerBubble as Pe } from "./components/marker-bubble.js";
6
+ import { CxMarkerDefault as re } from "./components/marker-default.js";
7
+ import { CxMarkerHtml as Lt } from "./components/marker-html.js";
8
8
  import { CxMarkerText as Ee } from "./components/marker-text.js";
9
- import { i as se, b as Ie, a as L, S as z, d as pe, c as ce, e as _e, f as Pt, g as Ae, M as Ne, h as re, j as Ot, k as Et, l as It, m as ke, n as He, o as _t, p as At, q as Nt, r as kt, s as Ht, t as De, u as Dt, v as Ft, w as Wt, x as Rt } from "./index-DcRdyqU6.js";
9
+ import { i as ce, b as Ie, a as S, S as V, d as pe, c as ue, e as _e, f as Ot, g as Ae, M as Ne, h as ae, j as Pt, k as Et, l as It, m as ke, n as He, o as _t, p as At, q as Nt, r as kt, s as Ht, t as Fe, u as Ft, v as Dt, w as Rt, x as Wt } from "./index-DcRdyqU6.js";
10
10
  const Bt = {
11
11
  text: { type: String, default: "" },
12
12
  svg: { type: Object, default: () => ({}) },
13
13
  textStyle: { type: Object, default: () => ({}) },
14
14
  textPosition: { type: String, default: "top" },
15
15
  textGap: { type: Number, default: 8 }
16
- }, Gt = /* @__PURE__ */ le({
16
+ }, Gt = /* @__PURE__ */ se({
17
17
  name: `${ht}-marker-svg`,
18
18
  __name: "MarkerSvg",
19
19
  props: Bt,
20
20
  setup(t) {
21
- const e = t, r = Me("marker"), a = (u, y, b, p) => {
22
- const T = Number(u);
23
- return Number.isFinite(T) ? Math.min(p, Math.max(b, T)) : y;
24
- }, n = m(() => a(e.svg.height, 48, 16, 160)), o = m(() => a(e.svg.width, n.value, 1, 320)), i = m(() => a(e.textGap, 8, 0, 80)), s = m(
21
+ const e = t, r = Me("marker"), a = (u, h, b, p) => {
22
+ const w = Number(u);
23
+ return Number.isFinite(w) ? Math.min(p, Math.max(b, w)) : h;
24
+ }, n = m(() => a(e.svg.height, 48, 16, 160)), i = m(() => a(e.svg.width, n.value, 1, 320)), o = m(() => a(e.textGap, 8, 0, 80)), l = m(
25
25
  () => ["top", "bottom", "left", "right"].includes(e.textPosition) ? e.textPosition : "top"
26
26
  ), c = m(() => ({
27
- width: `${o.value}px`,
27
+ width: `${i.value}px`,
28
28
  height: `${n.value}px`
29
29
  })), f = m(() => ({
30
- width: `${o.value}px`,
30
+ width: `${i.value}px`,
31
31
  height: `${n.value}px`,
32
32
  backgroundColor: e.svg.fill || "#1890ff",
33
33
  opacity: a(e.svg.opacity, 1, 0, 1),
34
34
  WebkitMaskImage: e.svg.src ? `url("${e.svg.src}")` : "none",
35
35
  maskImage: e.svg.src ? `url("${e.svg.src}")` : "none"
36
- })), l = m(() => ({
36
+ })), s = m(() => ({
37
37
  position: "absolute",
38
38
  width: "max-content",
39
39
  maxWidth: "none",
@@ -44,30 +44,30 @@ const Bt = {
44
44
  textAlign: "center",
45
45
  fontFamily: 'Arial, "Microsoft YaHei", sans-serif',
46
46
  ...{
47
- top: { left: "50%", bottom: `calc(100% + ${i.value}px)`, transform: "translateX(-50%)" },
48
- bottom: { left: "50%", top: `calc(100% + ${i.value}px)`, transform: "translateX(-50%)" },
49
- left: { right: `calc(100% + ${i.value}px)`, top: "50%", transform: "translateY(-50%)" },
50
- right: { left: `calc(100% + ${i.value}px)`, top: "50%", transform: "translateY(-50%)" }
51
- }[s.value],
47
+ top: { left: "50%", bottom: `calc(100% + ${o.value}px)`, transform: "translateX(-50%)" },
48
+ bottom: { left: "50%", top: `calc(100% + ${o.value}px)`, transform: "translateX(-50%)" },
49
+ left: { right: `calc(100% + ${o.value}px)`, top: "50%", transform: "translateY(-50%)" },
50
+ right: { left: `calc(100% + ${o.value}px)`, top: "50%", transform: "translateY(-50%)" }
51
+ }[l.value],
52
52
  ...e.textStyle
53
53
  }));
54
- return (u, y) => (E(), H("div", {
55
- class: w(M(r).b("svg")),
54
+ return (u, h) => (E(), H("div", {
55
+ class: T(M(r).b("svg")),
56
56
  style: $(c.value)
57
57
  }, [
58
58
  u.text && u.textStyle.display !== "none" ? (E(), H("span", {
59
59
  key: 0,
60
- class: w(M(r).be("svg", "text")),
61
- style: $(l.value)
62
- }, mt(u.text), 7)) : Q("", !0),
63
- Te("span", {
64
- class: w(M(r).be("svg", "image")),
60
+ class: T(M(r).be("svg", "text")),
61
+ style: $(s.value)
62
+ }, dt(u.text), 7)) : te("", !0),
63
+ we("span", {
64
+ class: T(M(r).be("svg", "image")),
65
65
  style: $(f.value),
66
66
  "aria-hidden": "true"
67
67
  }, null, 6)
68
68
  ], 6));
69
69
  }
70
- }), Fe = oe(Gt), $t = {
70
+ }), De = le(Gt), $t = {
71
71
  id: { type: String, default: "marker" },
72
72
  Cesium: { type: Object },
73
73
  viewer: { type: Object },
@@ -78,22 +78,22 @@ const Bt = {
78
78
  themeConfig: { type: Object }
79
79
  // Optional override
80
80
  };
81
- var X = /* @__PURE__ */ ((t) => (t.左建选中模型 = "MODEL_LEFT_CLICK", t.标记左键点击 = "TAG_LEFT_CLICK", t.标记移入 = "TAG_MOUSEENTER", t.标记移出 = "TAG_MOUSELEAVE", t.模型位置保存 = "SAVE_REGION", t.模型加载完成 = "MODEL_READY", t))(X || {}), Kt = "[object Symbol]";
82
- function ue(t) {
83
- return typeof t == "symbol" || se(t) && Ie(t) == Kt;
81
+ var Y = /* @__PURE__ */ ((t) => (t.左建选中模型 = "MODEL_LEFT_CLICK", t.标记左键点击 = "TAG_LEFT_CLICK", t.标记移入 = "TAG_MOUSEENTER", t.标记移出 = "TAG_MOUSELEAVE", t.模型位置保存 = "SAVE_REGION", t.模型加载完成 = "MODEL_READY", t))(Y || {}), Xt = "[object Symbol]";
82
+ function fe(t) {
83
+ return typeof t == "symbol" || ce(t) && Ie(t) == Xt;
84
84
  }
85
- function We(t, e) {
85
+ function Re(t, e) {
86
86
  for (var r = -1, a = t == null ? 0 : t.length, n = Array(a); ++r < a; )
87
87
  n[r] = e(t[r], r, t);
88
88
  return n;
89
89
  }
90
- var be = z ? z.prototype : void 0, ve = be ? be.toString : void 0;
91
- function Re(t) {
90
+ var be = V ? V.prototype : void 0, ve = be ? be.toString : void 0;
91
+ function We(t) {
92
92
  if (typeof t == "string")
93
93
  return t;
94
- if (L(t))
95
- return We(t, Re) + "";
96
- if (ue(t))
94
+ if (S(t))
95
+ return Re(t, We) + "";
96
+ if (fe(t))
97
97
  return ve ? ve.call(t) : "";
98
98
  var e = t + "";
99
99
  return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
@@ -101,7 +101,7 @@ function Re(t) {
101
101
  function Be(t) {
102
102
  return t;
103
103
  }
104
- function Xt(t, e, r) {
104
+ function Kt(t, e, r) {
105
105
  switch (r.length) {
106
106
  case 0:
107
107
  return t.call(e);
@@ -115,7 +115,7 @@ function Xt(t, e, r) {
115
115
  return t.apply(e, r);
116
116
  }
117
117
  var Yt = 800, zt = 16, Vt = Date.now;
118
- function Ut(t) {
118
+ function qt(t) {
119
119
  var e = 0, r = 0;
120
120
  return function() {
121
121
  var a = Vt(), n = zt - (a - r);
@@ -127,7 +127,7 @@ function Ut(t) {
127
127
  return t.apply(void 0, arguments);
128
128
  };
129
129
  }
130
- function qt(t) {
130
+ function Ut(t) {
131
131
  return function() {
132
132
  return t;
133
133
  };
@@ -136,100 +136,100 @@ var jt = pe ? function(t, e) {
136
136
  return pe(t, "toString", {
137
137
  configurable: !0,
138
138
  enumerable: !1,
139
- value: qt(e),
139
+ value: Ut(e),
140
140
  writable: !0
141
141
  });
142
- } : Be, Ge = Ut(jt), xe = Math.max;
142
+ } : Be, Ge = qt(jt), xe = Math.max;
143
143
  function $e(t, e, r) {
144
144
  return e = xe(e === void 0 ? t.length - 1 : e, 0), function() {
145
- for (var a = arguments, n = -1, o = xe(a.length - e, 0), i = Array(o); ++n < o; )
146
- i[n] = a[e + n];
145
+ for (var a = arguments, n = -1, i = xe(a.length - e, 0), o = Array(i); ++n < i; )
146
+ o[n] = a[e + n];
147
147
  n = -1;
148
- for (var s = Array(e + 1); ++n < e; )
149
- s[n] = a[n];
150
- return s[e] = r(i), Xt(t, this, s);
148
+ for (var l = Array(e + 1); ++n < e; )
149
+ l[n] = a[n];
150
+ return l[e] = r(o), Kt(t, this, l);
151
151
  };
152
152
  }
153
153
  function Zt(t, e) {
154
154
  return Ge($e(t, e, Be), t + "");
155
155
  }
156
156
  function Jt(t, e, r) {
157
- if (!ce(r))
157
+ if (!ue(r))
158
158
  return !1;
159
159
  var a = typeof e;
160
- return (a == "number" ? _e(r) && Pt(e, r.length) : a == "string" && e in r) ? Ae(r[e], t) : !1;
160
+ return (a == "number" ? _e(r) && Ot(e, r.length) : a == "string" && e in r) ? Ae(r[e], t) : !1;
161
161
  }
162
162
  function Qt(t) {
163
163
  return Zt(function(e, r) {
164
- var a = -1, n = r.length, o = n > 1 ? r[n - 1] : void 0, i = n > 2 ? r[2] : void 0;
165
- for (o = t.length > 3 && typeof o == "function" ? (n--, o) : void 0, i && Jt(r[0], r[1], i) && (o = n < 3 ? void 0 : o, n = 1), e = Object(e); ++a < n; ) {
166
- var s = r[a];
167
- s && t(e, s, a, o);
164
+ var a = -1, n = r.length, i = n > 1 ? r[n - 1] : void 0, o = n > 2 ? r[2] : void 0;
165
+ for (i = t.length > 3 && typeof i == "function" ? (n--, i) : void 0, o && Jt(r[0], r[1], o) && (i = n < 3 ? void 0 : i, n = 1), e = Object(e); ++a < n; ) {
166
+ var l = r[a];
167
+ l && t(e, l, a, i);
168
168
  }
169
169
  return e;
170
170
  });
171
171
  }
172
172
  var er = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, tr = /^\w*$/;
173
173
  function rr(t, e) {
174
- if (L(t))
174
+ if (S(t))
175
175
  return !1;
176
176
  var r = typeof t;
177
- return r == "number" || r == "symbol" || r == "boolean" || t == null || ue(t) ? !0 : tr.test(t) || !er.test(t) || e != null && t in Object(e);
177
+ return r == "number" || r == "symbol" || r == "boolean" || t == null || fe(t) ? !0 : tr.test(t) || !er.test(t) || e != null && t in Object(e);
178
178
  }
179
179
  var ar = "Expected a function";
180
- function fe(t, e) {
180
+ function ge(t, e) {
181
181
  if (typeof t != "function" || e != null && typeof e != "function")
182
182
  throw new TypeError(ar);
183
183
  var r = function() {
184
- var a = arguments, n = e ? e.apply(this, a) : a[0], o = r.cache;
185
- if (o.has(n))
186
- return o.get(n);
187
- var i = t.apply(this, a);
188
- return r.cache = o.set(n, i) || o, i;
184
+ var a = arguments, n = e ? e.apply(this, a) : a[0], i = r.cache;
185
+ if (i.has(n))
186
+ return i.get(n);
187
+ var o = t.apply(this, a);
188
+ return r.cache = i.set(n, o) || i, o;
189
189
  };
190
- return r.cache = new (fe.Cache || Ne)(), r;
190
+ return r.cache = new (ge.Cache || Ne)(), r;
191
191
  }
192
- fe.Cache = Ne;
192
+ ge.Cache = Ne;
193
193
  var nr = 500;
194
194
  function ir(t) {
195
- var e = fe(t, function(a) {
195
+ var e = ge(t, function(a) {
196
196
  return r.size === nr && r.clear(), a;
197
197
  }), r = e.cache;
198
198
  return e;
199
199
  }
200
200
  var or = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, lr = /\\(\\)?/g, sr = ir(function(t) {
201
201
  var e = [];
202
- return t.charCodeAt(0) === 46 && e.push(""), t.replace(or, function(r, a, n, o) {
203
- e.push(n ? o.replace(lr, "$1") : a || r);
202
+ return t.charCodeAt(0) === 46 && e.push(""), t.replace(or, function(r, a, n, i) {
203
+ e.push(n ? i.replace(lr, "$1") : a || r);
204
204
  }), e;
205
205
  });
206
206
  function cr(t) {
207
- return t == null ? "" : Re(t);
207
+ return t == null ? "" : We(t);
208
208
  }
209
- function ge(t, e) {
210
- return L(t) ? t : rr(t, e) ? [t] : sr(cr(t));
209
+ function he(t, e) {
210
+ return S(t) ? t : rr(t, e) ? [t] : sr(cr(t));
211
211
  }
212
- function ae(t) {
213
- if (typeof t == "string" || ue(t))
212
+ function ne(t) {
213
+ if (typeof t == "string" || fe(t))
214
214
  return t;
215
215
  var e = t + "";
216
216
  return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
217
217
  }
218
218
  function ur(t, e) {
219
- e = ge(e, t);
219
+ e = he(e, t);
220
220
  for (var r = 0, a = e.length; t != null && r < a; )
221
- t = t[ae(e[r++])];
221
+ t = t[ne(e[r++])];
222
222
  return r && r == a ? t : void 0;
223
223
  }
224
- var Ce = z ? z.isConcatSpreadable : void 0;
224
+ var Ce = V ? V.isConcatSpreadable : void 0;
225
225
  function fr(t) {
226
- return L(t) || re(t) || !!(Ce && t && t[Ce]);
226
+ return S(t) || ae(t) || !!(Ce && t && t[Ce]);
227
227
  }
228
228
  function gr(t, e, r, a, n) {
229
- var o = -1, i = t.length;
230
- for (r || (r = fr), n || (n = []); ++o < i; ) {
231
- var s = t[o];
232
- r(s) ? Ot(n, s) : n[n.length] = s;
229
+ var i = -1, o = t.length;
230
+ for (r || (r = fr), n || (n = []); ++i < o; ) {
231
+ var l = t[i];
232
+ r(l) ? Pt(n, l) : n[n.length] = l;
233
233
  }
234
234
  return n;
235
235
  }
@@ -237,150 +237,253 @@ function hr(t) {
237
237
  var e = t == null ? 0 : t.length;
238
238
  return e ? gr(t) : [];
239
239
  }
240
- function mr(t) {
240
+ function dr(t) {
241
241
  return Ge($e(t, void 0, hr), t + "");
242
242
  }
243
- var dr = "[object Object]", yr = Function.prototype, pr = Object.prototype, Ke = yr.toString, br = pr.hasOwnProperty, vr = Ke.call(Object);
244
- function Xe(t) {
245
- if (!se(t) || Ie(t) != dr)
243
+ var mr = "[object Object]", yr = Function.prototype, pr = Object.prototype, Xe = yr.toString, br = pr.hasOwnProperty, vr = Xe.call(Object);
244
+ function Ke(t) {
245
+ if (!ce(t) || Ie(t) != mr)
246
246
  return !1;
247
247
  var e = Et(t);
248
248
  if (e === null)
249
249
  return !0;
250
250
  var r = br.call(e, "constructor") && e.constructor;
251
- return typeof r == "function" && r instanceof r && Ke.call(r) == vr;
251
+ return typeof r == "function" && r instanceof r && Xe.call(r) == vr;
252
252
  }
253
253
  function xr(t, e, r) {
254
254
  var a = -1, n = t.length;
255
255
  e < 0 && (e = -e > n ? 0 : n + e), r = r > n ? n : r, r < 0 && (r += n), n = e > r ? 0 : r - e >>> 0, e >>>= 0;
256
- for (var o = Array(n); ++a < n; )
257
- o[a] = t[a + e];
258
- return o;
256
+ for (var i = Array(n); ++a < n; )
257
+ i[a] = t[a + e];
258
+ return i;
259
259
  }
260
260
  function Cr(t) {
261
261
  return function(e, r, a) {
262
- for (var n = -1, o = Object(e), i = a(e), s = i.length; s--; ) {
263
- var c = i[++n];
264
- if (r(o[c], c, o) === !1)
262
+ for (var n = -1, i = Object(e), o = a(e), l = o.length; l--; ) {
263
+ var c = o[++n];
264
+ if (r(i[c], c, i) === !1)
265
265
  break;
266
266
  }
267
267
  return e;
268
268
  };
269
269
  }
270
270
  var Mr = Cr();
271
- function ne(t, e, r) {
271
+ function ie(t, e, r) {
272
272
  (r !== void 0 && !Ae(t[e], r) || r === void 0 && !(e in t)) && It(t, e, r);
273
273
  }
274
- function Tr(t) {
275
- return se(t) && _e(t);
274
+ function wr(t) {
275
+ return ce(t) && _e(t);
276
276
  }
277
- function ie(t, e) {
277
+ function oe(t, e) {
278
278
  if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__")
279
279
  return t[e];
280
280
  }
281
- function wr(t) {
281
+ function Tr(t) {
282
282
  return ke(t, He(t));
283
283
  }
284
- function Lr(t, e, r, a, n, o, i) {
285
- var s = ie(t, r), c = ie(e, r), f = i.get(c);
284
+ function Sr(t, e, r, a, n, i, o) {
285
+ var l = oe(t, r), c = oe(e, r), f = o.get(c);
286
286
  if (f) {
287
- ne(t, r, f);
287
+ ie(t, r, f);
288
288
  return;
289
289
  }
290
- var l = o ? o(s, c, r + "", t, e, i) : void 0, u = l === void 0;
290
+ var s = i ? i(l, c, r + "", t, e, o) : void 0, u = s === void 0;
291
291
  if (u) {
292
- var y = L(c), b = !y && _t(c), p = !y && !b && At(c);
293
- l = c, y || b || p ? L(s) ? l = s : Tr(s) ? l = Nt(s) : b ? (u = !1, l = kt(c, !0)) : p ? (u = !1, l = Ht(c, !0)) : l = [] : Xe(c) || re(c) ? (l = s, re(s) ? l = wr(s) : (!ce(s) || De(s)) && (l = Dt(c))) : u = !1;
292
+ var h = S(c), b = !h && _t(c), p = !h && !b && At(c);
293
+ s = c, h || b || p ? S(l) ? s = l : wr(l) ? s = Nt(l) : b ? (u = !1, s = kt(c, !0)) : p ? (u = !1, s = Ht(c, !0)) : s = [] : Ke(c) || ae(c) ? (s = l, ae(l) ? s = Tr(l) : (!ue(l) || Fe(l)) && (s = Ft(c))) : u = !1;
294
294
  }
295
- u && (i.set(c, l), n(l, c, a, o, i), i.delete(c)), ne(t, r, l);
295
+ u && (o.set(c, s), n(s, c, a, i, o), o.delete(c)), ie(t, r, s);
296
296
  }
297
297
  function Ye(t, e, r, a, n) {
298
- t !== e && Mr(e, function(o, i) {
299
- if (n || (n = new Ft()), ce(o))
300
- Lr(t, e, i, r, Ye, a, n);
298
+ t !== e && Mr(e, function(i, o) {
299
+ if (n || (n = new Dt()), ue(i))
300
+ Sr(t, e, o, r, Ye, a, n);
301
301
  else {
302
- var s = a ? a(ie(t, i), o, i + "", t, e, n) : void 0;
303
- s === void 0 && (s = o), ne(t, i, s);
302
+ var l = a ? a(oe(t, o), i, o + "", t, e, n) : void 0;
303
+ l === void 0 && (l = i), ie(t, o, l);
304
304
  }
305
305
  }, He);
306
306
  }
307
- function Sr(t) {
307
+ function Lr(t) {
308
308
  var e = t == null ? 0 : t.length;
309
309
  return e ? t[e - 1] : void 0;
310
310
  }
311
- function Pr(t, e) {
311
+ function Or(t, e) {
312
312
  return e.length < 2 ? t : ur(t, xr(e, 0, -1));
313
313
  }
314
- var Or = Qt(function(t, e, r) {
314
+ var Pr = Qt(function(t, e, r) {
315
315
  Ye(t, e, r);
316
316
  }), Er = Object.prototype, Ir = Er.hasOwnProperty;
317
317
  function _r(t, e) {
318
- e = ge(e, t);
318
+ e = he(e, t);
319
319
  var r = -1, a = e.length;
320
320
  if (!a)
321
321
  return !0;
322
322
  for (; ++r < a; ) {
323
- var n = ae(e[r]);
323
+ var n = ne(e[r]);
324
324
  if (n === "__proto__" && !Ir.call(t, "__proto__") || (n === "constructor" || n === "prototype") && r < a - 1)
325
325
  return !1;
326
326
  }
327
- var o = Pr(t, e);
328
- return o == null || delete o[ae(Sr(e))];
327
+ var i = Or(t, e);
328
+ return i == null || delete i[ne(Lr(e))];
329
329
  }
330
330
  function Ar(t) {
331
- return Xe(t) ? void 0 : t;
331
+ return Ke(t) ? void 0 : t;
332
332
  }
333
- var Nr = 1, kr = 2, Hr = 4, Dr = mr(function(t, e) {
333
+ var Nr = 1, kr = 2, Hr = 4, Fr = dr(function(t, e) {
334
334
  var r = {};
335
335
  if (t == null)
336
336
  return r;
337
337
  var a = !1;
338
- e = We(e, function(o) {
339
- return o = ge(o, t), a || (a = o.length > 1), o;
340
- }), ke(t, Wt(t), r), a && (r = Rt(r, Nr | kr | Hr, Ar));
338
+ e = Re(e, function(i) {
339
+ return i = he(i, t), a || (a = i.length > 1), i;
340
+ }), ke(t, Rt(t), r), a && (r = Wt(r, Nr | kr | Hr, Ar));
341
341
  for (var n = e.length; n--; )
342
342
  _r(r, e[n]);
343
343
  return r;
344
344
  });
345
- class Fr {
345
+ const Dr = "__cx_overlay__:";
346
+ class Rr {
347
+ constructor(e) {
348
+ this.pool = e;
349
+ }
350
+ renderers = /* @__PURE__ */ new Map();
351
+ records = /* @__PURE__ */ new Map();
352
+ mounted = /* @__PURE__ */ new Map();
353
+ themes = /* @__PURE__ */ new Set();
354
+ registerRenderer(e, r) {
355
+ const a = String(e || "").trim();
356
+ if (!a) throw new Error("Overlay renderer name is required");
357
+ this.renderers.set(a, r), this.ensureTheme(a);
358
+ }
359
+ add(e) {
360
+ const r = String(e.id || "").trim(), a = String(e.renderer || "").trim();
361
+ if (!r) throw new Error("Overlay id is required");
362
+ if (!a || !this.renderers.has(a)) throw new Error(`Overlay renderer "${a}" is not registered`);
363
+ const n = this.records.get(r), i = {
364
+ ...n,
365
+ ...e,
366
+ id: r,
367
+ renderer: a,
368
+ position: { ...n?.position, ...e.position },
369
+ visible: e.visible !== !1,
370
+ offset: {
371
+ x: this.number(e.offset?.x, n?.offset?.x ?? 0),
372
+ y: this.number(e.offset?.y, n?.offset?.y ?? 0)
373
+ },
374
+ anchor: e.anchor || n?.anchor || "top-left"
375
+ };
376
+ this.records.set(r, i), this.ensureTheme(a), this.pool.add(i.data, {
377
+ id: r,
378
+ lon: i.position.longitude,
379
+ lat: i.position.latitude,
380
+ height: i.position.height || 0,
381
+ theme: this.themeName(a),
382
+ show: i.visible,
383
+ offset: i.offset,
384
+ anchor: i.anchor,
385
+ style: { zIndex: String(i.zIndex ?? 1) }
386
+ }), i.visible || this.pool.hideByIds([r]);
387
+ }
388
+ update(e, r) {
389
+ const a = this.records.get(e);
390
+ a && this.add({ ...a, ...r, id: e, renderer: a.renderer, data: r.data ?? a.data });
391
+ }
392
+ remove(e) {
393
+ const r = Array.isArray(e) ? e : [e];
394
+ for (const a of r)
395
+ this.records.has(a) && (this.pool.removeByIds([a]), this.records.delete(a), this.mounted.delete(a));
396
+ }
397
+ clear() {
398
+ this.remove([...this.records.keys()]);
399
+ }
400
+ destroy() {
401
+ this.clear(), this.renderers.clear(), this.themes.clear();
402
+ }
403
+ ensureTheme(e) {
404
+ const r = this.themeName(e);
405
+ this.themes.has(r) || (this.themes.add(r), this.pool.registerTheme(r, {
406
+ createElement: (a, n) => {
407
+ const i = this.records.get(n.id);
408
+ if (!i) return;
409
+ const o = this.renderers.get(i.renderer);
410
+ if (!o) return;
411
+ const l = this.context(i);
412
+ if (this.mounted.get(i.id))
413
+ o.update?.(a, l);
414
+ else {
415
+ const f = o.mount?.(a, l);
416
+ this.mounted.set(i.id, { container: a, cleanup: typeof f == "function" ? f : void 0 });
417
+ }
418
+ return () => this.unmount(i.id);
419
+ }
420
+ }));
421
+ }
422
+ unmount(e) {
423
+ const r = this.records.get(e), a = this.mounted.get(e);
424
+ if (!r || !a) return;
425
+ const n = this.renderers.get(r.renderer);
426
+ a.cleanup?.(), n?.unmount?.(a.container, this.context(r)), this.mounted.delete(e);
427
+ }
428
+ context(e) {
429
+ return {
430
+ id: e.id,
431
+ data: e.data,
432
+ position: e.position,
433
+ visible: e.visible,
434
+ anchor: e.anchor,
435
+ offset: e.offset
436
+ };
437
+ }
438
+ themeName(e) {
439
+ return `${Dr}${e}`;
440
+ }
441
+ number(e, r) {
442
+ const a = Number(e);
443
+ return Number.isFinite(a) ? a : r;
444
+ }
445
+ }
446
+ class Wr {
346
447
  labelId;
347
448
  cardId;
348
449
  opt;
349
450
  entityList = /* @__PURE__ */ new Map();
350
451
  MaterialManager;
351
452
  instance;
453
+ /** 不进入实体图层的通用地图内容容器。 */
454
+ overlays;
352
455
  constructor(e) {
353
- this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new Le(), this.instance = this.initCore(e, e.eventBus, e.cardEventBus);
456
+ this.labelId = e.labelId, this.cardId = e.cardId, this.opt = e, this.MaterialManager = e.MaterialManager || new Se(), this.instance = this.initCore(e, e.eventBus, e.cardEventBus), this.overlays = new Rr(this.instance.overlayPool);
354
457
  }
355
458
  //初始化标记管理
356
459
  initCore(e, r, a) {
357
- let { Cesium: n, viewer: o, aggregatorOptions: i } = e;
358
- r || (r = new ee()), a || (a = new ee());
359
- const s = new de(n, o, this.labelId, r);
360
- s.setOcclusionOptions({ distanceEpsilon: 1 }), s.setOcclusionEnabled(!1);
361
- const c = new de(n, o, this.cardId, a, !1), f = new Mt(n, o, {
460
+ let { Cesium: n, viewer: i, aggregatorOptions: o } = e;
461
+ r || (r = new K()), a || (a = new K());
462
+ const l = new Q(n, i, this.labelId, r);
463
+ l.setOcclusionOptions({ distanceEpsilon: 1 }), l.setOcclusionEnabled(!1);
464
+ const c = new Q(n, i, this.cardId, a, !1), f = new Q(n, i, `${this.labelId}-overlay`, new K(), !1), s = new Mt(n, i, {
362
465
  //聚合
363
- threshold: i?.threshold || 16,
364
- displayLimit: i?.displayLimit || 300,
365
- maxLevel: i?.maxLevel || 20,
366
- debugCurrentGrids: i?.debugCurrentGrids || !1,
367
- groupByTheme: i?.groupByTheme ?? !0,
466
+ threshold: o?.threshold || 16,
467
+ displayLimit: o?.displayLimit || 300,
468
+ maxLevel: o?.maxLevel || 20,
469
+ debugCurrentGrids: o?.debugCurrentGrids || !1,
470
+ groupByTheme: o?.groupByTheme ?? !0,
368
471
  //clusterTheme: aggregatorOptions?.clusterTheme || 'Tag1007', // 这里可以改成你自定义的默认聚合点主题k
369
- pointTheme: i?.pointTheme || "Tag1001",
472
+ pointTheme: o?.pointTheme || "Tag1001",
370
473
  // 普通点的默认主题
371
- centralPointMode: i?.centralPointMode || "firstPoint",
474
+ centralPointMode: o?.centralPointMode || "firstPoint",
372
475
  // 普通点的默认主题
373
- ...i,
374
- labelPool: s
375
- }), l = this.MaterialManager, u = new Tt(
476
+ ...o,
477
+ labelPool: l
478
+ }), u = this.MaterialManager, h = new wt(
376
479
  //实体图层管理
377
480
  n,
378
- o,
379
- l,
380
- f,
481
+ i,
482
+ u,
483
+ s,
381
484
  c
382
485
  );
383
- return { materialManager: l, entityLayerManager: u, cardPool: c, labelPool: s, aggregator: f, eventBus: r, cardEventBus: a };
486
+ return { materialManager: u, entityLayerManager: h, cardPool: c, overlayPool: f, labelPool: l, aggregator: s, eventBus: r, cardEventBus: a };
384
487
  }
385
488
  //添加标记
386
489
  set(e) {
@@ -394,19 +497,19 @@ class Fr {
394
497
  //添加
395
498
  add(e) {
396
499
  let r = [];
397
- L(e) ? r = e : r.push(e), r.forEach((a) => {
500
+ S(e) ? r = e : r.push(e), r.forEach((a) => {
398
501
  this.entityList.set(a.id, a);
399
502
  }), this.instance.entityLayerManager.getLayer("Layer_default") || this.instance.entityLayerManager.addLayer("Layer_default"), this.instance.entityLayerManager.addGroupsToLayer("Layer_default", r);
400
503
  }
401
504
  //更新标记
402
505
  update(e, r = !0) {
403
506
  let a = [];
404
- L(e) ? a = e : a.push(e);
405
- const n = a.map((o) => {
406
- const i = this.entityList.get(o.id);
407
- if (!i) return;
408
- let s = Or({}, i, o);
409
- return this.entityList.set(o.id, s), s;
507
+ S(e) ? a = e : a.push(e);
508
+ const n = a.map((i) => {
509
+ const o = this.entityList.get(i.id);
510
+ if (!o) return;
511
+ let l = Pr({}, o, i);
512
+ return this.entityList.set(i.id, l), l;
410
513
  }).filter(Boolean);
411
514
  r && this.instance.entityLayerManager.updateGroupToLayer("Layer_default", n);
412
515
  }
@@ -424,7 +527,7 @@ class Fr {
424
527
  //删除标记
425
528
  delete(e) {
426
529
  let r = [];
427
- L(e) ? r = e : r.push(e), r.forEach((a) => {
530
+ S(e) ? r = e : r.push(e), r.forEach((a) => {
428
531
  this.entityList.delete(a);
429
532
  }), this.instance.entityLayerManager.removeGroups("Layer_default", r);
430
533
  }
@@ -457,27 +560,27 @@ const I = {
457
560
  polygonTileWidth: 2,
458
561
  polygonTileHeight: 2
459
562
  };
460
- function d(t, e) {
563
+ function y(t, e) {
461
564
  const r = Number(t);
462
565
  return Number.isFinite(r) ? r : e;
463
566
  }
464
567
  function C(t) {
465
568
  return Number.isFinite(t) ? Math.max(1, t) : 1;
466
569
  }
467
- function Wr(t, e) {
570
+ function Br(t, e) {
468
571
  return Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : e;
469
572
  }
470
- function Rr(t) {
573
+ function Gr(t) {
471
574
  const e = t?.repeat;
472
575
  if (Array.isArray(e) && e.length >= 2)
473
576
  return {
474
- x: C(d(e[0], 1)),
475
- y: C(d(e[1], 1))
577
+ x: C(y(e[0], 1)),
578
+ y: C(y(e[1], 1))
476
579
  };
477
580
  if (e && typeof e == "object")
478
581
  return {
479
- x: C(d(e.x, 1)),
480
- y: C(d(e.y, 1))
582
+ x: C(y(e.x, 1)),
583
+ y: C(y(e.y, 1))
481
584
  };
482
585
  const r = Number(t?.repeatX), a = Number(t?.repeatY);
483
586
  return Number.isFinite(r) && Number.isFinite(a) ? {
@@ -490,86 +593,86 @@ function ze(t, e) {
490
593
  if (r.length < 2) return 1;
491
594
  let a = 0;
492
595
  for (let n = 1; n < r.length; n++) {
493
- const o = r[n - 1], i = r[n];
494
- if (!Array.isArray(o) || !Array.isArray(i)) continue;
495
- const s = t.Cartesian3.fromDegrees(
496
- d(o[0], 0),
497
- d(o[1], 0),
498
- d(o[2], 0)
596
+ const i = r[n - 1], o = r[n];
597
+ if (!Array.isArray(i) || !Array.isArray(o)) continue;
598
+ const l = t.Cartesian3.fromDegrees(
599
+ y(i[0], 0),
600
+ y(i[1], 0),
601
+ y(i[2], 0)
499
602
  ), c = t.Cartesian3.fromDegrees(
500
- d(i[0], 0),
501
- d(i[1], 0),
502
- d(i[2], 0)
603
+ y(o[0], 0),
604
+ y(o[1], 0),
605
+ y(o[2], 0)
503
606
  );
504
- a += t.Cartesian3.distance(s, c);
607
+ a += t.Cartesian3.distance(l, c);
505
608
  }
506
609
  return a > 0 ? a : 1;
507
610
  }
508
611
  function Ve(t) {
509
612
  const e = t?.maximumHeights, r = t?.minimumHeights;
510
613
  if (Array.isArray(e) && Array.isArray(r) && e.length > 0 && e.length === r.length) {
511
- let o = 0, i = 0;
512
- for (let s = 0; s < e.length; s++) {
513
- const c = Number(e[s]) - Number(r[s]);
514
- Number.isFinite(c) && c > 0 && (o += c, i++);
614
+ let i = 0, o = 0;
615
+ for (let l = 0; l < e.length; l++) {
616
+ const c = Number(e[l]) - Number(r[l]);
617
+ Number.isFinite(c) && c > 0 && (i += c, o++);
515
618
  }
516
- if (i > 0) return o / i;
619
+ if (o > 0) return i / o;
517
620
  }
518
- const a = Math.abs(d(t?.minHeight, 0)), n = Math.abs(d(t?.maxHeight, 0));
621
+ const a = Math.abs(y(t?.minHeight, 0)), n = Math.abs(y(t?.maxHeight, 0));
519
622
  return a > 0 || n > 0 ? a + n : 3;
520
623
  }
521
- function Ue(t, e) {
624
+ function qe(t, e) {
522
625
  const r = e?.hierarchy;
523
626
  if (!Array.isArray(r) || r.length < 3)
524
627
  return { width: 1, height: 1 };
525
628
  const a = Array.isArray(r[0]) ? r.flat() : r;
526
629
  if (!Array.isArray(a) || a.length < 3) return { width: 1, height: 1 };
527
- let n = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY;
630
+ let n = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY;
528
631
  for (let p = 0; p < a.length; p += 3) {
529
- const T = Number(a[p]), x = Number(a[p + 1]);
530
- !Number.isFinite(T) || !Number.isFinite(x) || (n = Math.min(n, T), o = Math.max(o, T), i = Math.min(i, x), s = Math.max(s, x));
632
+ const w = Number(a[p]), x = Number(a[p + 1]);
633
+ !Number.isFinite(w) || !Number.isFinite(x) || (n = Math.min(n, w), i = Math.max(i, w), o = Math.min(o, x), l = Math.max(l, x));
531
634
  }
532
- if (!Number.isFinite(n) || !Number.isFinite(i))
635
+ if (!Number.isFinite(n) || !Number.isFinite(o))
533
636
  return { width: 1, height: 1 };
534
- const c = (i + s) / 2, f = t.Ellipsoid.WGS84.maximumRadius, l = t.Math.toRadians(Math.abs(o - n)), u = t.Math.toRadians(Math.abs(s - i)), y = l * f * Math.cos(t.Math.toRadians(c)), b = u * f;
637
+ const c = (o + l) / 2, f = t.Ellipsoid.WGS84.maximumRadius, s = t.Math.toRadians(Math.abs(i - n)), u = t.Math.toRadians(Math.abs(l - o)), h = s * f * Math.cos(t.Math.toRadians(c)), b = u * f;
535
638
  return {
536
- width: y > 0 ? y : 1,
639
+ width: h > 0 ? h : 1,
537
640
  height: b > 0 ? b : 1
538
641
  };
539
642
  }
540
- function qe({
643
+ function Ue({
541
644
  Cesium: t,
542
645
  themeOptions: e,
543
646
  entityOptions: r,
544
647
  category: a
545
648
  }) {
546
- const n = Rr(e);
649
+ const n = Gr(e);
547
650
  if (n) return n;
548
651
  if (e?.autoRepeat === !1)
549
652
  return { x: 1, y: 1 };
550
653
  if (a === "wall") {
551
- const c = ze(t, r), f = Ve(r), l = d(
654
+ const c = ze(t, r), f = Ve(r), s = y(
552
655
  e?.tileWidth ?? e?.textureWidth,
553
656
  I.wallTileWidth
554
- ), u = d(
657
+ ), u = y(
555
658
  e?.tileHeight ?? e?.textureHeight,
556
659
  I.wallTileHeight
557
660
  );
558
661
  return {
559
- x: C(c / Math.max(l, 0.01)),
662
+ x: C(c / Math.max(s, 0.01)),
560
663
  y: C(f / Math.max(u, 0.01))
561
664
  };
562
665
  }
563
- const o = Ue(t, r), i = d(
666
+ const i = qe(t, r), o = y(
564
667
  e?.tileWidth ?? e?.textureWidth,
565
668
  I.polygonTileWidth
566
- ), s = d(
669
+ ), l = y(
567
670
  e?.tileHeight ?? e?.textureHeight,
568
671
  I.polygonTileHeight
569
672
  );
570
673
  return {
571
- x: C(o.width / Math.max(i, 0.01)),
572
- y: C(o.height / Math.max(s, 0.01))
674
+ x: C(i.width / Math.max(o, 0.01)),
675
+ y: C(i.height / Math.max(l, 0.01))
573
676
  };
574
677
  }
575
678
  function je({
@@ -579,30 +682,30 @@ function je({
579
682
  category: a,
580
683
  freely: n
581
684
  }) {
582
- const o = Number(e?.count);
583
- if (Number.isFinite(o) && o > 0) return o;
685
+ const i = Number(e?.count);
686
+ if (Number.isFinite(i) && i > 0) return i;
584
687
  if (e?.autoRepeat === !1)
585
688
  return 1;
586
689
  if (a === "wall") {
587
- const l = ze(t, r), u = Ve(r), y = d(
690
+ const s = ze(t, r), u = Ve(r), h = y(
588
691
  e?.tileWidth ?? e?.textureWidth,
589
692
  I.wallTileWidth
590
- ), b = d(
693
+ ), b = y(
591
694
  e?.tileHeight ?? e?.textureHeight,
592
695
  I.wallTileHeight
593
- ), p = n === "vertical" ? u / Math.max(b, 0.01) : l / Math.max(y, 0.01);
696
+ ), p = n === "vertical" ? u / Math.max(b, 0.01) : s / Math.max(h, 0.01);
594
697
  return C(Number(p.toFixed(2)));
595
698
  }
596
- const i = Ue(t, r), s = d(
699
+ const o = qe(t, r), l = y(
597
700
  e?.tileWidth ?? e?.textureWidth,
598
701
  I.polygonTileWidth
599
- ), c = d(
702
+ ), c = y(
600
703
  e?.tileHeight ?? e?.textureHeight,
601
704
  I.polygonTileHeight
602
- ), f = n === "vertical" ? i.height / Math.max(c, 0.01) : i.width / Math.max(s, 0.01);
705
+ ), f = n === "vertical" ? o.height / Math.max(c, 0.01) : o.width / Math.max(l, 0.01);
603
706
  return C(Number(f.toFixed(2)));
604
707
  }
605
- function V(t) {
708
+ function q(t) {
606
709
  const e = t;
607
710
  return e.__materialFactory = !0, e;
608
711
  }
@@ -610,12 +713,12 @@ function Ze(t) {
610
713
  const e = String(t?.wallVerticalMode ?? t?.verticalMode ?? "stretch");
611
714
  return e === "repeat" || e === "bottom" || e === "stretch" ? e : "stretch";
612
715
  }
613
- function Br({
716
+ function $r({
614
717
  Cesium: t,
615
718
  themeOptions: e,
616
719
  entityOptions: r
617
720
  }) {
618
- const a = qe({
721
+ const a = Ue({
619
722
  Cesium: t,
620
723
  themeOptions: e,
621
724
  entityOptions: r,
@@ -623,7 +726,7 @@ function Br({
623
726
  });
624
727
  return Ze(e) === "repeat" ? a : { x: a.x, y: 1 };
625
728
  }
626
- function Gr(t, e) {
729
+ function Xr(t, e) {
627
730
  const r = "WallBottomImageMaterial_" + Date.now() + "_" + Math.floor(Math.random() * 1e3);
628
731
  function a(n) {
629
732
  this._definitionChanged = new t.Event(), this._color = n.color, this.color = n.color;
@@ -642,13 +745,13 @@ function Gr(t, e) {
642
745
  color: t.createPropertyDescriptor("color")
643
746
  }), a.prototype.getType = function() {
644
747
  return r;
645
- }, a.prototype.getValue = function(n, o) {
646
- return t.defined(o) || (o = {}), o.image = e.image, o.repeatX = e.repeatX, o.bottomHeightRatio = e.bottomHeightRatio, o.color = t.Property.getValueOrClonedDefault(
748
+ }, a.prototype.getValue = function(n, i) {
749
+ return t.defined(i) || (i = {}), i.image = e.image, i.repeatX = e.repeatX, i.bottomHeightRatio = e.bottomHeightRatio, i.color = t.Property.getValueOrClonedDefault(
647
750
  this._color,
648
751
  n,
649
752
  t.Color.WHITE,
650
- o.color
651
- ), o;
753
+ i.color
754
+ ), i;
652
755
  }, a.prototype.equals = function(n) {
653
756
  return this === n || n instanceof a && t.Property.equals(this._color, n._color);
654
757
  }, t.Material._materialCache.addMaterial(r, {
@@ -682,7 +785,7 @@ function Gr(t, e) {
682
785
  }
683
786
  }), new a(e);
684
787
  }
685
- function $r({
788
+ function Kr({
686
789
  Cesium: t,
687
790
  options: e,
688
791
  MaterialManager: r,
@@ -690,7 +793,7 @@ function $r({
690
793
  }) {
691
794
  if (e.data?.theme) {
692
795
  if (e.data?.lineType == "1") {
693
- let n = wt(t, {
796
+ let n = Tt(t, {
694
797
  color: t.Color.fromCssColorString(e?.options?.color || "#ffffff"),
695
798
  duration: 100
696
799
  });
@@ -733,7 +836,7 @@ function $r({
733
836
  category: "polyline"
734
837
  });
735
838
  } else if (e.data?.lineType == "5") {
736
- let n = Lt(t, {
839
+ let n = St(t, {
737
840
  image: e.img,
738
841
  color: t.Color.fromCssColorString(e?.options?.color || "#ffffff"),
739
842
  duration: 5e3,
@@ -750,7 +853,7 @@ function $r({
750
853
  }
751
854
  }
752
855
  }
753
- function Kr({
856
+ function Yr({
754
857
  Cesium: t,
755
858
  options: e,
756
859
  MaterialManager: r,
@@ -771,16 +874,16 @@ function Kr({
771
874
  themeKey: e.data?.theme,
772
875
  category: "polygon",
773
876
  force: a,
774
- material: V((o = {}) => {
775
- const i = qe({
877
+ material: q((i = {}) => {
878
+ const o = Ue({
776
879
  Cesium: t,
777
880
  themeOptions: n,
778
- entityOptions: o,
881
+ entityOptions: i,
779
882
  category: "polygon"
780
883
  });
781
884
  return new t.ImageMaterialProperty({
782
885
  image: e.img,
783
- repeat: new t.Cartesian2(i.x, i.y)
886
+ repeat: new t.Cartesian2(o.x, o.y)
784
887
  });
785
888
  })
786
889
  });
@@ -790,28 +893,28 @@ function Kr({
790
893
  themeKey: e.data?.theme,
791
894
  category: "polygon",
792
895
  force: a,
793
- material: V((o = {}) => {
794
- const i = e.data?.freely || "vertical", s = je({
896
+ material: q((i = {}) => {
897
+ const o = e.data?.freely || "vertical", l = je({
795
898
  Cesium: t,
796
899
  themeOptions: n,
797
- entityOptions: o,
900
+ entityOptions: i,
798
901
  category: "polygon",
799
- freely: i
902
+ freely: o
800
903
  });
801
- return Se(t, {
904
+ return Le(t, {
802
905
  image: e.img,
803
906
  color: t.Color.fromCssColorString(n?.color || "#ffffff"),
804
- duration: d(n?.duration, 5e3),
805
- freely: i,
907
+ duration: y(n?.duration, 5e3),
908
+ freely: o,
806
909
  direction: n?.direction || "+",
807
- count: s
910
+ count: l
808
911
  });
809
912
  })
810
913
  });
811
914
  }
812
915
  }
813
916
  }
814
- function Xr({
917
+ function zr({
815
918
  Cesium: t,
816
919
  options: e,
817
920
  MaterialManager: r,
@@ -824,27 +927,27 @@ function Xr({
824
927
  themeKey: e.data?.theme,
825
928
  category: "wall",
826
929
  force: a,
827
- material: V((o = {}) => {
828
- const i = Ze(n), s = Br({
930
+ material: q((i = {}) => {
931
+ const o = Ze(n), l = $r({
829
932
  Cesium: t,
830
933
  themeOptions: n,
831
- entityOptions: o
934
+ entityOptions: i
832
935
  });
833
- if (i === "bottom") {
834
- const c = Wr(
835
- d(n?.bottomHeightRatio, 0.3),
936
+ if (o === "bottom") {
937
+ const c = Br(
938
+ y(n?.bottomHeightRatio, 0.3),
836
939
  0.3
837
940
  );
838
- return Gr(t, {
941
+ return Xr(t, {
839
942
  image: e.img,
840
- repeatX: s.x,
943
+ repeatX: l.x,
841
944
  bottomHeightRatio: c,
842
945
  color: t.Color.fromCssColorString(n?.color || "#ffffff")
843
946
  });
844
947
  }
845
948
  return new t.ImageMaterialProperty({
846
949
  image: e.img,
847
- repeat: new t.Cartesian2(s.x, s.y),
950
+ repeat: new t.Cartesian2(l.x, l.y),
848
951
  transparent: !0
849
952
  });
850
953
  })
@@ -855,28 +958,28 @@ function Xr({
855
958
  themeKey: e.data?.theme,
856
959
  category: "wall",
857
960
  force: a,
858
- material: V((o = {}) => {
859
- const i = e.data?.freely || "vertical", s = je({
961
+ material: q((i = {}) => {
962
+ const o = e.data?.freely || "vertical", l = je({
860
963
  Cesium: t,
861
964
  themeOptions: n,
862
- entityOptions: o,
965
+ entityOptions: i,
863
966
  category: "wall",
864
- freely: i
967
+ freely: o
865
968
  });
866
- return Se(t, {
969
+ return Le(t, {
867
970
  image: e.img,
868
971
  color: t.Color.fromCssColorString(n?.color || "#ffffff"),
869
- duration: d(n?.duration, 5e3),
870
- freely: i,
972
+ duration: y(n?.duration, 5e3),
973
+ freely: o,
871
974
  direction: n?.direction || "+",
872
- count: s
975
+ count: l
873
976
  });
874
977
  })
875
978
  });
876
979
  }
877
980
  }
878
981
  }
879
- class Yr extends Fr {
982
+ class Vr extends Wr {
880
983
  getCurrentBillboard(e) {
881
984
  return e?.__currentBillboard || e?.billboard?.[0];
882
985
  }
@@ -885,13 +988,13 @@ class Yr extends Fr {
885
988
  labelId: r = "report-marker",
886
989
  cardId: a = "report-marker",
887
990
  tagThemeConfig: n = [],
888
- lineThemeConfig: o = [],
889
- cardThemeConfig: i = [],
890
- runListener: s = () => {
991
+ lineThemeConfig: i = [],
992
+ cardThemeConfig: o = [],
993
+ runListener: l = () => {
891
994
  },
892
- MaterialManager: c = new Le(),
995
+ MaterialManager: c = new Se(),
893
996
  aggregatorOptions: f
894
- } = e, l = [...n], u = [...o], y = [...i], b = {
997
+ } = e, s = [...n], u = [...i], h = [...o], b = {
895
998
  clusterTheme: "Tag1007",
896
999
  pointTheme: "Tag1001",
897
1000
  centralPointMode: "firstPoint",
@@ -903,9 +1006,9 @@ class Yr extends Fr {
903
1006
  cardId: a,
904
1007
  MaterialManager: c,
905
1008
  aggregatorOptions: b,
906
- eventBus: new ee()
1009
+ eventBus: new K()
907
1010
  };
908
- super(p), this.opt = { ...this.opt, ...p }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(l), this.loadLineThemeConfig(u), this.loadCardThemeConfig(y), this.initDefaultLineMaterials(), this.initDefaultTagTheme();
1011
+ super(p), this.opt = { ...this.opt, ...p }, this.initTagListener(this.instance.eventBus, this.opt), this.loadTabThemeConfig(s), this.loadLineThemeConfig(u), this.loadCardThemeConfig(h), this.initDefaultLineMaterials(), this.initDefaultTagTheme();
909
1012
  }
910
1013
  initDefaultTagTheme() {
911
1014
  this.setTagTheme({
@@ -1017,25 +1120,25 @@ class Yr extends Fr {
1017
1120
  e.tag && this.loadTabThemeConfig(e.tag), e.card && this.loadCardThemeConfig(e.card);
1018
1121
  const a = this.opt.Cesium, n = this.instance.materialManager || this.opt.MaterialManager;
1019
1122
  if (e.line?.length > 0)
1020
- for (let o of e.line)
1021
- $r({
1022
- options: o,
1123
+ for (let i of e.line)
1124
+ Kr({
1125
+ options: i,
1023
1126
  Cesium: a,
1024
1127
  MaterialManager: n,
1025
1128
  force: r
1026
1129
  });
1027
1130
  if (e.polygon?.length > 0)
1028
- for (let o of e.polygon)
1029
- Kr({
1030
- options: o,
1131
+ for (let i of e.polygon)
1132
+ Yr({
1133
+ options: i,
1031
1134
  Cesium: a,
1032
1135
  MaterialManager: n,
1033
1136
  force: r
1034
1137
  });
1035
1138
  if (e.wall?.length > 0)
1036
- for (let o of e.wall)
1037
- Xr({
1038
- options: o,
1139
+ for (let i of e.wall)
1140
+ zr({
1141
+ options: i,
1039
1142
  Cesium: a,
1040
1143
  MaterialManager: n,
1041
1144
  force: r
@@ -1069,10 +1172,10 @@ class Yr extends Fr {
1069
1172
  let r = this.instance.cardPool;
1070
1173
  e.forEach((a) => {
1071
1174
  r.registerTheme(a.data.theme, {
1072
- createElement(n, o) {
1073
- let i = o.data.data, s;
1074
- return a.comType == 1 ? s = P(O(ye), {
1075
- data: i || {},
1175
+ createElement(n, i) {
1176
+ let o = i.data.data, l;
1177
+ return a.comType == 1 ? l = O(P(ye), {
1178
+ data: o || {},
1076
1179
  imgSrc: a.data.img,
1077
1180
  styleConfig: {
1078
1181
  paddingTop: "50px",
@@ -1092,8 +1195,8 @@ class Yr extends Fr {
1092
1195
  top: "0px"
1093
1196
  },
1094
1197
  bgClass: [a.data.theme]
1095
- }) : a.comType == 3 && (s = P(O(ye), {
1096
- data: i || {},
1198
+ }) : a.comType == 3 && (l = O(P(ye), {
1199
+ data: o || {},
1097
1200
  imgSrc: a.data.img,
1098
1201
  styleConfig: {
1099
1202
  paddingTop: "55px",
@@ -1115,7 +1218,7 @@ class Yr extends Fr {
1115
1218
  bgClass: [a.data.theme]
1116
1219
  // titleConfig: themeOptions.options.titleConfig,
1117
1220
  // pageInfoConfig: themeOptions.options.pageInfoConfig,
1118
- })), K(s, n), () => K(null, n);
1221
+ })), X(l, n), () => X(null, n);
1119
1222
  },
1120
1223
  options: {
1121
1224
  offset: a.data.pixelOffset,
@@ -1129,12 +1232,12 @@ class Yr extends Fr {
1129
1232
  let { labelPool: r } = this.instance;
1130
1233
  const a = (n) => this.getCurrentBillboard(n);
1131
1234
  r.registerTheme(e.data.theme, {
1132
- createElement(n, o) {
1133
- let i = a(o.data);
1134
- const s = Dr(i, ["position", "options"]);
1235
+ createElement(n, i) {
1236
+ let o = a(i.data);
1237
+ const l = Fr(o, ["position", "options"]);
1135
1238
  let c, f = {
1136
- ...s,
1137
- text: i?.options?.text,
1239
+ ...l,
1240
+ text: o?.options?.text,
1138
1241
  isFullLink: e?.isFullLink ?? !1,
1139
1242
  img: e?.data?.options?.img,
1140
1243
  textStyle: e?.data?.options?.textStyle,
@@ -1143,9 +1246,9 @@ class Yr extends Fr {
1143
1246
  textPosition: e?.data?.options?.textPosition || "top",
1144
1247
  textGap: e?.data?.options?.textGap
1145
1248
  };
1146
- if (o.data?.gridKey)
1147
- c = P(O(te), {
1148
- text: o.data?.count,
1249
+ if (i.data?.gridKey)
1250
+ c = O(P(re), {
1251
+ text: i.data?.count,
1149
1252
  isFullLink: e.isFullLink ?? !1,
1150
1253
  img: e?.data.options.img,
1151
1254
  imgStyle: e?.data.options?.imgStyle,
@@ -1166,37 +1269,37 @@ class Yr extends Fr {
1166
1269
  }
1167
1270
  });
1168
1271
  else if (e.comType == 4)
1169
- c = P(O(St), f);
1272
+ c = O(P(Lt), f);
1170
1273
  else if (e.comType == 5 || e.comType == 8) {
1171
- const l = i?.options || {}, u = e?.data?.options || {}, y = i?.pixelOffset || e?.data?.pixelOffset || { x: 0, y: 0 }, b = l.otherOffset ?? u.otherOffset ?? { x: 0, y: -0 }, p = l.isCanDraggable ?? u.isCanDraggable ?? e?.isCanDraggable ?? !1, T = e.comType == 8 ? Pe : Oe;
1172
- c = P(O(T), {
1274
+ const s = o?.options || {}, u = e?.data?.options || {}, h = o?.pixelOffset || e?.data?.pixelOffset || { x: 0, y: 0 }, b = s.otherOffset ?? u.otherOffset ?? { x: 0, y: -0 }, p = s.isCanDraggable ?? u.isCanDraggable ?? e?.isCanDraggable ?? !1, w = e.comType == 8 ? Oe : Pe;
1275
+ c = O(P(w), {
1173
1276
  ...f,
1174
- pixelOffset: y,
1175
- textStyle: l.textStyle || u.textStyle,
1176
- lineStyle: l.lineStyle || u.lineStyle,
1277
+ pixelOffset: h,
1278
+ textStyle: s.textStyle || u.textStyle,
1279
+ lineStyle: s.lineStyle || u.lineStyle,
1177
1280
  otherOffset: b,
1178
1281
  isCanDraggable: p,
1179
- onCanDraggable: l.onCanDraggable || e?.onCanDraggable,
1282
+ onCanDraggable: s.onCanDraggable || e?.onCanDraggable,
1180
1283
  onSetOtherOffset: (x) => {
1181
- const _ = a(o.data);
1182
- _?.options && (_.options.otherOffset = x), l.onSetOtherOffset?.(x), e?.onSetOtherOffset?.(o.data, x);
1284
+ const _ = a(i.data);
1285
+ _?.options && (_.options.otherOffset = x), s.onSetOtherOffset?.(x), e?.onSetOtherOffset?.(i.data, x);
1183
1286
  },
1184
1287
  onSetLineStake: (x) => {
1185
- const _ = a(o.data);
1186
- _?.options && (_.options.lineStake = x), l.onSetLineStake?.(x), e?.onSetLineStake?.(o.data, x);
1288
+ const _ = a(i.data);
1289
+ _?.options && (_.options.lineStake = x), s.onSetLineStake?.(x), e?.onSetLineStake?.(i.data, x);
1187
1290
  }
1188
1291
  });
1189
- } else e.comType == 6 || e.comType == 7 ? c = P(O(Ee), {
1292
+ } else e.comType == 6 || e.comType == 7 ? c = O(P(Ee), {
1190
1293
  text: f.text,
1191
1294
  textStyle: f.textStyle
1192
- }) : e.comType == 9 ? c = P(O(Fe), {
1295
+ }) : e.comType == 9 ? c = O(P(De), {
1193
1296
  text: f.text,
1194
1297
  svg: f.svg,
1195
1298
  textStyle: f.textStyle,
1196
1299
  textPosition: f.textPosition || "top",
1197
1300
  textGap: f.textGap
1198
- }) : c = P(O(te), f);
1199
- return K(c, n), () => K(null, n);
1301
+ }) : c = O(P(re), f);
1302
+ return X(c, n), () => X(null, n);
1200
1303
  },
1201
1304
  options: {
1202
1305
  offset: e.comType == 5 || e.comType == 8 ? {} : e?.data?.pixelOffset || {}
@@ -1206,120 +1309,121 @@ class Yr extends Fr {
1206
1309
  //标记监听事件
1207
1310
  initTagListener(e, r) {
1208
1311
  let { viewer: a, tagListeningOptions: n } = r;
1209
- e.addListener(J.Click, {
1312
+ e.addListener(ee.Click, {
1210
1313
  name: "marker:click",
1211
- fn: (o) => {
1212
- r.runListener?.(X.标记左键点击, o.data), De(o.data?.onClick) && o.data?.onClick(o.data), o.data?.cameraPoint && this.getCurrentBillboard(o.data)?.isFlyToCameraPoint && a?.camera?.flyTo({
1314
+ fn: (i) => {
1315
+ r.runListener?.(Y.标记左键点击, i.data), Fe(i.data?.onClick) && i.data?.onClick(i.data), i.data?.cameraPoint && this.getCurrentBillboard(i.data)?.isFlyToCameraPoint && a?.camera?.flyTo({
1213
1316
  duration: 1,
1214
- ...o.data?.cameraPoint
1317
+ ...i.data?.cameraPoint
1215
1318
  });
1216
1319
  }
1217
- }), e.addListener(J.MouseEnter, {
1320
+ }), e.addListener(ee.MouseEnter, {
1218
1321
  name: "marker:mouseenter",
1219
- fn: (o) => {
1220
- let i = this.opt.Cesium, s = { x: 0, y: 0 };
1322
+ fn: (i) => {
1323
+ let o = this.opt.Cesium, l = { x: 0, y: 0 };
1221
1324
  try {
1222
- const c = this.getCurrentBillboard(o.data);
1325
+ const c = this.getCurrentBillboard(i.data);
1223
1326
  if (c?.position?.length > 2) {
1224
- let f = c.position, l = i.Cartesian3.fromDegrees(f[0], f[1], f[3] || 0), u = this.instance.labelPool.toWindowCoordinates(l);
1225
- s.x = u.x, s.y = u.y;
1327
+ let f = c.position, s = o.Cartesian3.fromDegrees(f[0], f[1], f[3] || 0), u = this.instance.labelPool.toWindowCoordinates(s);
1328
+ l.x = u.x, l.y = u.y;
1226
1329
  }
1227
1330
  } catch (c) {
1228
1331
  console.log(c);
1229
1332
  }
1230
- r.runListener?.(X.标记移入, o.data, s);
1333
+ r.runListener?.(Y.标记移入, i.data, l);
1231
1334
  }
1232
- }), e.addListener(J.MouseLeave, {
1335
+ }), e.addListener(ee.MouseLeave, {
1233
1336
  name: "marker:mouseleave",
1234
- fn: (o) => {
1235
- let i = this.opt.Cesium, s = { x: 0, y: 0 };
1337
+ fn: (i) => {
1338
+ let o = this.opt.Cesium, l = { x: 0, y: 0 };
1236
1339
  try {
1237
- const c = this.getCurrentBillboard(o.data);
1340
+ const c = this.getCurrentBillboard(i.data);
1238
1341
  if (c?.position?.length > 2) {
1239
- let f = c.position, l = i.Cartesian3.fromDegrees(f[0], f[1], f[3] || 0), u = this.instance.labelPool.toWindowCoordinates(l);
1240
- s.x = u.x, s.y = u.y;
1342
+ let f = c.position, s = o.Cartesian3.fromDegrees(f[0], f[1], f[3] || 0), u = this.instance.labelPool.toWindowCoordinates(s);
1343
+ l.x = u.x, l.y = u.y;
1241
1344
  }
1242
1345
  } catch (c) {
1243
1346
  console.log(c);
1244
1347
  }
1245
- r.runListener?.(X.标记移出, o.data, s);
1348
+ r.runListener?.(Y.标记移出, i.data, l);
1246
1349
  }
1247
- }), n?.forEach((o) => {
1248
- e.addListener(o.key, o.ListenerItem, o.overwrite);
1350
+ }), n?.forEach((i) => {
1351
+ e.addListener(i.key, i.ListenerItem, i.overwrite);
1249
1352
  });
1250
1353
  }
1251
1354
  // 兼容旧模式的材质注册
1252
1355
  setMaterial(e) {
1253
- const { type: r, material: a, materialKey: n, cover: o } = e, i = r ? r.toLowerCase() : "default";
1356
+ const { type: r, material: a, materialKey: n, cover: i } = e, o = r ? r.toLowerCase() : "default";
1254
1357
  this.MaterialManager.register({
1255
1358
  themeKey: n,
1256
1359
  // 兼容传入的是 { material: ... } 结构或者直接是材质对象
1257
1360
  material: a?.material || a,
1258
- force: o,
1259
- category: i
1361
+ force: i,
1362
+ category: o
1260
1363
  });
1261
1364
  }
1262
1365
  }
1263
- const zr = /* @__PURE__ */ le({
1366
+ const qr = /* @__PURE__ */ se({
1264
1367
  __name: "MarkerManage",
1265
1368
  props: $t,
1266
1369
  emits: ["register", "load", "marker-event"],
1267
1370
  setup(t, { expose: e, emit: r }) {
1268
- const a = t, n = r, o = dt("leitingMethods");
1269
- let i = null;
1270
- const s = (l = {}) => {
1271
- if (i) return i;
1371
+ const a = t, n = r, i = mt("leitingMethods");
1372
+ let o = null;
1373
+ const l = (s = {}) => {
1374
+ if (o) return o;
1272
1375
  const u = {
1273
1376
  ...a,
1274
- ...l,
1275
- Cesium: l.Cesium || a.Cesium,
1276
- viewer: l.viewer || a.viewer,
1277
- runListener: (y, b, ...p) => {
1278
- n("marker-event", { key: y, data: b, args: p });
1377
+ ...s,
1378
+ Cesium: s.Cesium || a.Cesium,
1379
+ viewer: s.viewer || a.viewer,
1380
+ runListener: (h, b, ...p) => {
1381
+ n("marker-event", { key: h, data: b, args: p });
1279
1382
  }
1280
1383
  };
1281
- return !u.Cesium || !u.viewer ? null : (i = new Yr(u), l.methods && (l.methods.setTagTheme = i.setTagTheme.bind(i), l.methods.setMaterial = i.setMaterial.bind(i), l.methods.setEntityList = i.set.bind(i), l.methods.addComItem = i.add.bind(i), l.methods.deleteComItem = i.delete.bind(i), l.methods.updateComItem = i.update.bind(i), l.methods.getEntityByID = i.getById.bind(i), l.methods.getOptions = i.getOptions.bind(i)), n("load", i), i);
1384
+ return !u.Cesium || !u.viewer ? null : (o = new Vr(u), s.methods && (s.methods.setTagTheme = o.setTagTheme.bind(o), s.methods.setMaterial = o.setMaterial.bind(o), s.methods.setEntityList = o.set.bind(o), s.methods.addComItem = o.add.bind(o), s.methods.deleteComItem = o.delete.bind(o), s.methods.updateComItem = o.update.bind(o), s.methods.getEntityByID = o.getById.bind(o), s.methods.getOptions = o.getOptions.bind(o)), n("load", o), o);
1282
1385
  }, c = {
1283
- init: s,
1284
- set: (l) => i?.set(l),
1285
- add: (l) => i?.add(l),
1286
- update: (l, u) => i?.update(l, u),
1287
- getById: (l) => i?.getById(l),
1288
- getOptions: () => i?.getOptions(),
1289
- delete: (l) => i?.delete(l),
1290
- setMarkerAggregationEnabled: (l, u) => i?.setMarkerAggregationEnabled(l, u),
1291
- setDebugCurrentGridsEnabled: (l) => i?.setDebugCurrentGridsEnabled(l),
1292
- setLabelOcclusionEnabled: (l) => i?.setLabelOcclusionEnabled(l),
1293
- setLabelOcclusionDistanceEpsilon: (l) => i?.setLabelOcclusionDistanceEpsilon(l),
1294
- setLabelOcclusionOptions: (l) => i?.setLabelOcclusionOptions(l),
1295
- getLabelOcclusionOptions: () => i?.getLabelOcclusionOptions(),
1296
- initThemes: (l) => i?.initThemes(l),
1297
- setTagTheme: (l) => i?.setTagTheme(l),
1298
- setMaterial: (l) => i?.setMaterial(l)
1386
+ init: l,
1387
+ set: (s) => o?.set(s),
1388
+ add: (s) => o?.add(s),
1389
+ update: (s, u) => o?.update(s, u),
1390
+ getById: (s) => o?.getById(s),
1391
+ getOptions: () => o?.getOptions(),
1392
+ overlays: () => o?.overlays,
1393
+ delete: (s) => o?.delete(s),
1394
+ setMarkerAggregationEnabled: (s, u) => o?.setMarkerAggregationEnabled(s, u),
1395
+ setDebugCurrentGridsEnabled: (s) => o?.setDebugCurrentGridsEnabled(s),
1396
+ setLabelOcclusionEnabled: (s) => o?.setLabelOcclusionEnabled(s),
1397
+ setLabelOcclusionDistanceEpsilon: (s) => o?.setLabelOcclusionDistanceEpsilon(s),
1398
+ setLabelOcclusionOptions: (s) => o?.setLabelOcclusionOptions(s),
1399
+ getLabelOcclusionOptions: () => o?.getLabelOcclusionOptions(),
1400
+ initThemes: (s) => o?.initThemes(s),
1401
+ setTagTheme: (s) => o?.setTagTheme(s),
1402
+ setMaterial: (s) => o?.setMaterial(s)
1299
1403
  };
1300
1404
  e(c), n("register", c);
1301
1405
  function f() {
1302
- if (i) return i;
1303
- const l = M(o), u = l?.getCesium?.(), y = l?.getViewer?.();
1304
- u && y ? s({ Cesium: u, viewer: y, methods: l }) : a.Cesium && a.viewer && s({ methods: l });
1406
+ if (o) return o;
1407
+ const s = M(i), u = s?.getCesium?.(), h = s?.getViewer?.();
1408
+ u && h ? l({ Cesium: u, viewer: h, methods: s }) : a.Cesium && a.viewer && l({ methods: s });
1305
1409
  }
1306
- return we(() => {
1410
+ return Te(() => {
1307
1411
  f();
1308
- }), Y(
1412
+ }), z(
1309
1413
  () => [a.Cesium, a.viewer],
1310
- ([l, u]) => {
1311
- l && u && !i && f();
1414
+ ([s, u]) => {
1415
+ s && u && !o && f();
1312
1416
  }
1313
- ), Y(
1314
- () => o?.value,
1315
- (l, u) => {
1417
+ ), z(
1418
+ () => i?.value,
1419
+ (s, u) => {
1316
1420
  f();
1317
1421
  },
1318
1422
  { deep: !1 }
1319
1423
  ), yt(() => {
1320
- }), (l, u) => pt(l.$slots, "default");
1424
+ }), (s, u) => pt(s.$slots, "default");
1321
1425
  }
1322
- }), Vr = /* @__PURE__ */ le({
1426
+ }), Ur = /* @__PURE__ */ se({
1323
1427
  name: "CxMarkerPreview",
1324
1428
  __name: "MarkerPreview",
1325
1429
  props: {
@@ -1330,100 +1434,100 @@ const zr = /* @__PURE__ */ le({
1330
1434
  },
1331
1435
  emits: ["imageSize", "pixelOffsetSelect"],
1332
1436
  setup(t, { emit: e }) {
1333
- const r = t, a = e, n = Me("marker"), o = G(), i = G(), s = m(() => r.config?.data?.options || {}), c = m(() => Number(r.config?.comType ?? 2)), f = m(() => c.value === 5 ? Oe : c.value === 8 ? Pe : [6, 7].includes(c.value) ? Ee : c.value === 9 ? Fe : te), l = m(() => c.value === 2), u = m(() => r.img ?? s.value.img ?? r.config?.img ?? ""), y = m(() => s.value.textStyle || {}), b = m(() => s.value.imgStyle || {}), p = m(() => s.value.lineStyle || {}), T = m(() => s.value.svg || {}), x = m(() => String(s.value.textPosition || "top")), _ = m(() => Number(s.value.textGap ?? 8)), U = m(() => r.config?.data?.pixelOffset || { x: 0, y: 0 }), Je = m(() => s.value.otherOffset || { x: 0, y: 0 }), Qe = m(
1437
+ const r = t, a = e, n = Me("marker"), i = G(), o = G(), l = m(() => r.config?.data?.options || {}), c = m(() => Number(r.config?.comType ?? 2)), f = m(() => c.value === 5 ? Pe : c.value === 8 ? Oe : [6, 7].includes(c.value) ? Ee : c.value === 9 ? De : re), s = m(() => c.value === 2), u = m(() => r.img ?? l.value.img ?? r.config?.img ?? ""), h = m(() => l.value.textStyle || {}), b = m(() => l.value.imgStyle || {}), p = m(() => l.value.lineStyle || {}), w = m(() => l.value.svg || {}), x = m(() => String(l.value.textPosition || "top")), _ = m(() => Number(l.value.textGap ?? 8)), U = m(() => r.config?.data?.pixelOffset || { x: 0, y: 0 }), Je = m(() => l.value.otherOffset || { x: 0, y: 0 }), Qe = m(
1334
1438
  () => JSON.stringify({
1335
1439
  comType: c.value,
1336
1440
  image: u.value,
1337
1441
  text: r.text,
1338
- options: s.value
1442
+ options: l.value
1339
1443
  })
1340
- ), R = G(!1), B = G(!1), S = G({ scale: 1, shiftX: 0, shiftY: 0 }), et = m(() => ({
1341
- transform: `translate(${S.value.shiftX}px, ${S.value.shiftY}px) scale(${S.value.scale})`,
1342
- visibility: R.value || l.value && (!u.value || !B.value) ? "hidden" : "visible"
1343
- })), q = m(
1444
+ ), W = G(!1), B = G(!1), L = G({ scale: 1, shiftX: 0, shiftY: 0 }), et = m(() => ({
1445
+ transform: `translate(${L.value.shiftX}px, ${L.value.shiftY}px) scale(${L.value.scale})`,
1446
+ visibility: W.value || s.value && (!u.value || !B.value) ? "hidden" : "visible"
1447
+ })), j = m(
1344
1448
  () => r.offsetSelectable && c.value === 2 && !!u.value && B.value
1345
1449
  ), tt = m(() => {
1346
- const h = Number(U.value.x), g = Number(U.value.y);
1450
+ const d = Number(U.value.x), g = Number(U.value.y);
1347
1451
  return {
1348
- left: `${Number.isFinite(h) ? -h : 0}px`,
1452
+ left: `${Number.isFinite(d) ? -d : 0}px`,
1349
1453
  top: `${Number.isFinite(g) ? -g : 0}px`
1350
1454
  };
1351
1455
  });
1352
1456
  function rt() {
1353
- if (!o.value || !i.value || o.value.clientWidth <= 0 || o.value.clientHeight <= 0) return;
1354
- const h = Array.from(i.value.querySelectorAll("*")).filter((v) => !v.classList.contains(n.be("preview", "anchor"))).map((v) => v.getBoundingClientRect()).filter((v) => v.width || v.height);
1355
- if (!h.length) return;
1356
- const g = o.value.getBoundingClientRect(), N = Math.min(...h.map((v) => v.left)), k = Math.max(...h.map((v) => v.right)), F = Math.min(...h.map((v) => v.top)), W = Math.max(...h.map((v) => v.bottom)), ot = k - N, lt = W - F, me = S.value.scale || 1, st = Math.min(
1457
+ if (!i.value || !o.value || i.value.clientWidth <= 0 || i.value.clientHeight <= 0) return;
1458
+ const d = Array.from(o.value.querySelectorAll("*")).filter((v) => !v.classList.contains(n.be("preview", "anchor"))).map((v) => v.getBoundingClientRect()).filter((v) => v.width || v.height);
1459
+ if (!d.length) return;
1460
+ const g = i.value.getBoundingClientRect(), N = Math.min(...d.map((v) => v.left)), k = Math.max(...d.map((v) => v.right)), D = Math.min(...d.map((v) => v.top)), R = Math.max(...d.map((v) => v.bottom)), ot = k - N, lt = R - D, me = L.value.scale || 1, st = Math.min(
1357
1461
  1,
1358
1462
  Math.max(1, g.width - 8) / Math.max(ot / me, 1),
1359
1463
  Math.max(1, g.height - 8) / Math.max(lt / me, 1)
1360
- ), ct = (N + k) / 2, ut = (F + W) / 2, ft = g.left + g.width / 2, gt = g.top + g.height / 2;
1361
- S.value = {
1464
+ ), ct = (N + k) / 2, ut = (D + R) / 2, ft = g.left + g.width / 2, gt = g.top + g.height / 2;
1465
+ L.value = {
1362
1466
  scale: st,
1363
- shiftX: S.value.shiftX + ft - ct,
1364
- shiftY: S.value.shiftY + gt - ut
1467
+ shiftX: L.value.shiftX + ft - ct,
1468
+ shiftY: L.value.shiftY + gt - ut
1365
1469
  };
1366
1470
  }
1367
- function at(h) {
1368
- const g = h.target;
1369
- !(g instanceof HTMLImageElement) || !i.value?.contains(g) || (B.value = !0, R.value = !1, a("imageSize", g.naturalHeight > 0 ? g.naturalWidth / g.naturalHeight : void 0), Z());
1471
+ function at(d) {
1472
+ const g = d.target;
1473
+ !(g instanceof HTMLImageElement) || !o.value?.contains(g) || (B.value = !0, W.value = !1, a("imageSize", g.naturalHeight > 0 ? g.naturalWidth / g.naturalHeight : void 0), J());
1370
1474
  }
1371
- function nt(h) {
1372
- !(h.target instanceof HTMLImageElement) || !i.value?.contains(h.target) || (R.value = !0, a("imageSize", void 0));
1475
+ function nt(d) {
1476
+ !(d.target instanceof HTMLImageElement) || !o.value?.contains(d.target) || (W.value = !0, a("imageSize", void 0));
1373
1477
  }
1374
- function it(h) {
1375
- if (!q.value || !i.value) return;
1376
- const g = i.value.querySelector(`.${n.b("default")}`);
1478
+ function it(d) {
1479
+ if (!j.value || !o.value) return;
1480
+ const g = o.value.querySelector(`.${n.b("default")}`);
1377
1481
  if (!g) return;
1378
- const N = g.getBoundingClientRect(), k = S.value.scale || 1, F = (h.clientX - N.left) / k, W = (h.clientY - N.top) / k;
1379
- F < 0 || W < 0 || F > N.width / k || W > N.height / k || a("pixelOffsetSelect", { x: -Math.round(F), y: -Math.round(W) });
1482
+ const N = g.getBoundingClientRect(), k = L.value.scale || 1, D = (d.clientX - N.left) / k, R = (d.clientY - N.top) / k;
1483
+ D < 0 || R < 0 || D > N.width / k || R > N.height / k || a("pixelOffsetSelect", { x: -Math.round(D), y: -Math.round(R) });
1380
1484
  }
1381
- Y(
1485
+ z(
1382
1486
  u,
1383
1487
  () => {
1384
- B.value = !1, R.value = !1, a("imageSize", void 0);
1488
+ B.value = !1, W.value = !1, a("imageSize", void 0);
1385
1489
  },
1386
1490
  { flush: "sync" }
1387
1491
  );
1388
- let D, j = /* @__PURE__ */ new Set(), A;
1389
- function Z() {
1492
+ let F, Z = /* @__PURE__ */ new Set(), A;
1493
+ function J() {
1390
1494
  A !== void 0 && cancelAnimationFrame(A);
1391
- let h = 0;
1495
+ let d = 0;
1392
1496
  const g = () => {
1393
- A = void 0, rt(), h += 1, h < 3 && (A = requestAnimationFrame(g));
1497
+ A = void 0, rt(), d += 1, d < 3 && (A = requestAnimationFrame(g));
1394
1498
  };
1395
1499
  A = requestAnimationFrame(g);
1396
1500
  }
1397
- function he() {
1398
- const h = new Set(Array.from(i.value?.querySelectorAll("*") || []));
1399
- for (const g of j) h.has(g) || D?.unobserve(g);
1400
- for (const g of h) j.has(g) || D?.observe(g);
1401
- j = h, Z();
1501
+ function de() {
1502
+ const d = new Set(Array.from(o.value?.querySelectorAll("*") || []));
1503
+ for (const g of Z) d.has(g) || F?.unobserve(g);
1504
+ for (const g of d) Z.has(g) || F?.observe(g);
1505
+ Z = d, J();
1402
1506
  }
1403
- return Y(Qe, () => bt(he)), we(() => {
1404
- D = new ResizeObserver(Z), o.value && D.observe(o.value), i.value && D.observe(i.value), he();
1507
+ return z(Qe, () => bt(de)), Te(() => {
1508
+ F = new ResizeObserver(J), i.value && F.observe(i.value), o.value && F.observe(o.value), de();
1405
1509
  }), vt(() => {
1406
- D?.disconnect(), A !== void 0 && cancelAnimationFrame(A);
1407
- }), (h, g) => (E(), H("div", {
1510
+ F?.disconnect(), A !== void 0 && cancelAnimationFrame(A);
1511
+ }), (d, g) => (E(), H("div", {
1408
1512
  ref_key: "host",
1409
- ref: o,
1410
- class: w([M(n).b("preview"), q.value ? M(n).bm("preview", "offset-picker") : ""]),
1513
+ ref: i,
1514
+ class: T([M(n).b("preview"), j.value ? M(n).bm("preview", "offset-picker") : ""]),
1411
1515
  "aria-hidden": "true"
1412
1516
  }, [
1413
- R.value ? (E(), H("div", {
1517
+ W.value ? (E(), H("div", {
1414
1518
  key: 0,
1415
- class: w(M(n).be("preview", "message"))
1416
- }, "图片不可用", 2)) : l.value && !u.value ? (E(), H("div", {
1519
+ class: T(M(n).be("preview", "message"))
1520
+ }, "图片不可用", 2)) : s.value && !u.value ? (E(), H("div", {
1417
1521
  key: 1,
1418
- class: w(M(n).be("preview", "message"))
1419
- }, "请选择图片", 2)) : l.value && !B.value ? (E(), H("div", {
1522
+ class: T(M(n).be("preview", "message"))
1523
+ }, "请选择图片", 2)) : s.value && !B.value ? (E(), H("div", {
1420
1524
  key: 2,
1421
- class: w(M(n).be("preview", "message"))
1422
- }, "图片加载中…", 2)) : Q("", !0),
1423
- Te("div", {
1525
+ class: T(M(n).be("preview", "message"))
1526
+ }, "图片加载中…", 2)) : te("", !0),
1527
+ we("div", {
1424
1528
  ref_key: "content",
1425
- ref: i,
1426
- class: w(M(n).be("preview", "content")),
1529
+ ref: o,
1530
+ class: T(M(n).be("preview", "content")),
1427
1531
  style: $(et.value),
1428
1532
  onLoadCapture: at,
1429
1533
  onErrorCapture: nt,
@@ -1433,30 +1537,31 @@ const zr = /* @__PURE__ */ le({
1433
1537
  key: u.value,
1434
1538
  text: t.text,
1435
1539
  img: u.value,
1436
- "text-style": y.value,
1540
+ "text-style": h.value,
1437
1541
  "img-style": b.value,
1438
1542
  "line-style": p.value,
1439
1543
  "pixel-offset": U.value,
1440
1544
  "other-offset": Je.value,
1441
- svg: T.value,
1545
+ svg: w.value,
1442
1546
  "text-position": x.value,
1443
1547
  "text-gap": _.value
1444
1548
  }, null, 8, ["text", "img", "text-style", "img-style", "line-style", "pixel-offset", "other-offset", "svg", "text-position", "text-gap"])),
1445
- q.value ? (E(), H("span", {
1549
+ j.value ? (E(), H("span", {
1446
1550
  key: 0,
1447
- class: w(M(n).be("preview", "anchor")),
1551
+ class: T(M(n).be("preview", "anchor")),
1448
1552
  style: $(tt.value)
1449
- }, null, 6)) : Q("", !0)
1553
+ }, null, 6)) : te("", !0)
1450
1554
  ], 38)
1451
1555
  ], 2));
1452
1556
  }
1453
- }), aa = oe(zr), na = oe(Vr);
1557
+ }), ia = le(qr), oa = le(Ur);
1454
1558
  export {
1455
- Fe as C,
1456
- Fr as M,
1457
- X as R,
1458
- aa as a,
1459
- na as b,
1460
- Yr as c,
1559
+ De as C,
1560
+ Wr as M,
1561
+ Y as R,
1562
+ ia as a,
1563
+ oa as b,
1564
+ Rr as c,
1565
+ Vr as d,
1461
1566
  $t as m
1462
1567
  };