@vcmap/viewshed 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- var Oe = Object.defineProperty;
2
- var Ie = (i, t, o) => t in i ? Oe(i, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[t] = o;
3
- var de = (i, t, o) => Ie(i, typeof t != "symbol" ? t + "" : t, o);
4
- import { VcsCameraPrimitive as Pe, VcsObject as Ae, VcsEvent as X, AbstractInteraction as Re, EventType as Y, Projection as z, SessionType as Ne, CesiumMap as $, startEditFeaturesSession as De, startEditGeometrySession as xe, VectorLayer as ke, wgs84Projection as Le, maxZIndex as Fe, markVolatile as je, Viewpoint as We, TransformationMode as Be, Category as Ue, moduleIdSymbol as $e } from "../../../assets/core.js";
5
- import { Color as Q, Matrix4 as He, Transforms as ze, Primitive as ce, GeometryInstance as ue, SphereGeometry as Ge, ColorGeometryInstanceAttribute as he, PerInstanceColorAppearance as fe, SphereOutlineGeometry as Ke, Math as x, Cartesian3 as W, ShadowMap as Ye, Camera as Xe, HeightReference as Je } from "../../../assets/cesium.js";
6
- import { shallowRef as Z, ref as U, nextTick as Ze, inject as me, computed as ve, reactive as ee, watchEffect as qe, watch as G, onMounted as Qe, onUnmounted as et, resolveComponent as b, openBlock as M, createElementBlock as B, createBlock as N, withCtx as h, createTextVNode as F, toDisplayString as A, createCommentVNode as H, createVNode as p, createElementVNode as tt, Fragment as pe, renderList as we, mergeProps as it } from "../../../assets/vue.js";
7
- import { ol$Observable$unByKey as ot, Feature as st, ol$geom$Point as nt, ol$style$Style as at } from "../../../assets/ol.js";
8
- import { VcsTextField as rt, VcsSlider as lt, VcsLabel as _e, VcsFormSection as Ce, VcsSelect as Ee, VcsFormButton as dt, VcsFeatureTransforms as ct, VcsHelp as ut, makeEditorCollectionComponentClass as ht, WindowSlot as ft, ToolboxType as mt, createSupportedMapMappingFunction as vt, createListExportAction as pt, downloadText as wt, createListImportAction as gt, NotificationType as J, AbstractConfigEditor as _t } from "../../../assets/ui.js";
9
- import { VContainer as ye, VRow as Ve, VCol as be, VDivider as Ct, VColorPicker as Et } from "../../../assets/vuetify.js";
10
- const Me = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyString"), re = /* @__PURE__ */ new Map();
1
+ var Ie = Object.defineProperty;
2
+ var Pe = (i, e, o) => e in i ? Ie(i, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[e] = o;
3
+ var de = (i, e, o) => Pe(i, typeof e != "symbol" ? e + "" : e, o);
4
+ import { VcsCameraPrimitive as Ae, VcsObject as Re, VcsEvent as X, AbstractInteraction as Ne, EventType as Y, Projection as z, SessionType as De, CesiumMap as U, startEditFeaturesSession as ke, startEditGeometrySession as xe, VectorLayer as Le, wgs84Projection as Fe, maxZIndex as je, markVolatile as We, Viewpoint as Be, TransformationMode as Ue, Category as $e, moduleIdSymbol as He } from "../../../assets/core.js";
5
+ import { Color as ee, Matrix4 as ze, Transforms as Ge, Primitive as ce, GeometryInstance as ue, SphereGeometry as Ke, ColorGeometryInstanceAttribute as he, PerInstanceColorAppearance as fe, SphereOutlineGeometry as Ye, Math as k, Cartesian3 as W, ShadowMap as Xe, Camera as Je, HeightReference as Ze } from "../../../assets/cesium.js";
6
+ import { shallowRef as q, ref as $, nextTick as qe, inject as me, computed as ve, reactive as J, watchEffect as Qe, watch as G, onMounted as et, onUnmounted as tt, resolveComponent as b, openBlock as M, createElementBlock as B, createBlock as N, withCtx as h, createTextVNode as F, toDisplayString as A, createCommentVNode as H, createVNode as p, createElementVNode as it, Fragment as pe, renderList as we, mergeProps as ot } from "../../../assets/vue.js";
7
+ import { ol$Observable$unByKey as st, Feature as nt, ol$geom$Point as at, ol$style$Style as rt } from "../../../assets/ol.js";
8
+ import { VcsTextField as lt, VcsSlider as dt, VcsLabel as Ce, VcsFormSection as Ee, VcsSelect as ye, VcsFormButton as ct, VcsFeatureTransforms as ut, VcsHelp as ht, makeEditorCollectionComponentClass as ft, WindowSlot as mt, ToolboxType as ge, createSupportedMapMappingFunction as vt, createListExportAction as pt, downloadText as wt, createListImportAction as gt, NotificationType as Z, AbstractConfigEditor as _t } from "../../../assets/ui.js";
9
+ import { VContainer as Ve, VRow as be, VCol as Me, VDivider as Ct, VColorPicker as Et } from "../../../assets/vuetify.js";
10
+ const Te = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyString"), re = /* @__PURE__ */ new Map();
11
11
  [
12
12
  [String, "string"],
13
13
  [Number, "number"],
@@ -15,31 +15,31 @@ const Me = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyStr
15
15
  [Function, "function"],
16
16
  [void 0, "undefined"],
17
17
  [Symbol, "symbol"]
18
- ].forEach(([i, t]) => {
19
- re.set(i, t);
18
+ ].forEach(([i, e]) => {
19
+ re.set(i, e);
20
20
  });
21
21
  function bt(i) {
22
- return i == null ? void 0 : i[Me];
22
+ return i == null ? void 0 : i[Te];
23
23
  }
24
24
  function oe(i) {
25
25
  if (!i || String(i) !== "[object Object]")
26
26
  return !1;
27
- const t = Object.getPrototypeOf(i);
28
- if (!t)
27
+ const e = Object.getPrototypeOf(i);
28
+ if (!e)
29
29
  return !0;
30
- const e = {}.hasOwnProperty.call(t, "constructor") && t.constructor;
31
- return typeof e == "function" && String(e) === String(Object);
30
+ const t = {}.hasOwnProperty.call(e, "constructor") && e.constructor;
31
+ return typeof t == "function" && String(t) === String(Object);
32
32
  }
33
- function R(i, t) {
33
+ function R(i, e) {
34
34
  if (i === null)
35
35
  return "null";
36
36
  if (typeof i > "u")
37
37
  return "undefined";
38
- if (t)
38
+ if (e)
39
39
  return typeof i;
40
40
  let o;
41
41
  if (Array.isArray(i))
42
- o = `[${i.map((s) => R(s, t)).join(",")}]`;
42
+ o = `[${i.map((s) => R(s, e)).join(",")}]`;
43
43
  else
44
44
  try {
45
45
  o = JSON.stringify(i);
@@ -48,143 +48,143 @@ function R(i, t) {
48
48
  }
49
49
  return o = o || typeof i, o.length > 20 ? `${o.substring(0, 20)}...` : o;
50
50
  }
51
- function Mt(i, t) {
52
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "symbol" ? i === t ? !1 : `Expected ${R(i)} to equal ${t.toString()}` : null;
51
+ function Mt(i, e) {
52
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? i === e ? !1 : `Expected ${R(i)} to equal ${e.toString()}` : null;
53
53
  }
54
- function Tt(i, t, o) {
55
- if (Array.isArray(t)) {
56
- if (t.length !== 1)
54
+ function Tt(i, e, o) {
55
+ if (Array.isArray(e)) {
56
+ if (e.length !== 1)
57
57
  throw new Error("Array patterns may only have one type");
58
58
  if (Array.isArray(i)) {
59
- let e = !1;
60
- return i.findIndex((n) => (e = o(n, t[0]), e)) > -1 ? `${String(e)} in ${R(i)}` : !1;
59
+ let t = !1;
60
+ return i.findIndex((n) => (t = o(n, e[0]), t)) > -1 ? `${String(t)} in ${R(i)}` : !1;
61
61
  }
62
62
  return `Expected ${R(i)} to be an Array`;
63
63
  }
64
64
  return null;
65
65
  }
66
- function se(i, t, o, e) {
67
- const s = e ? `${e}.` : "";
66
+ function se(i, e, o, t) {
67
+ const s = t ? `${t}.` : "";
68
68
  if (!oe(i))
69
69
  return `Expected ${R(i)} to be a plain Object`;
70
- let d = !1;
71
- const r = Object.keys(t).find((l) => {
72
- const _ = i[l];
73
- return oe(t[l]) ? d = se(_, t[l], o, s + l) : d = o(_, t[l]), d;
70
+ let r = !1;
71
+ const l = Object.keys(e).find((w) => {
72
+ const c = i[w];
73
+ return oe(e[w]) ? r = se(c, e[w], o, s + w) : r = o(c, e[w]), r;
74
74
  });
75
- return r ? `${String(d)} in object.${s}${r}` : !1;
75
+ return l ? `${String(r)} in object.${s}${l}` : !1;
76
76
  }
77
- function St(i, t) {
78
- if (t === Number)
77
+ function St(i, e) {
78
+ if (e === Number)
79
79
  return Number.isFinite(i) ? !1 : `expected ${R(i)} to be a number, excluding NaN`;
80
- if (t === yt)
80
+ if (e === yt)
81
81
  return Number.isInteger(i) ? !1 : `expected ${R(i)} to be an integer number`;
82
- if (t === Vt)
82
+ if (e === Vt)
83
83
  return typeof i == "string" && i.length > 0 ? !1 : `expected ${R(i)} to be a non-empty string`;
84
- const o = re.get(t);
84
+ const o = re.get(e);
85
85
  return o ? typeof i === o ? !1 : `expected ${R(i)} to be a ${String(o)}` : null;
86
86
  }
87
- function Te(i) {
87
+ function Se(i) {
88
88
  if (i === null)
89
89
  return "null";
90
- const t = re.get(i);
91
- if (t)
92
- return t;
90
+ const e = re.get(i);
91
+ if (e)
92
+ return e;
93
93
  const o = i == null ? void 0 : i.className;
94
94
  if (o)
95
95
  return o;
96
- let e = String(i);
97
- const s = e.match(/function (.*)\(/);
96
+ let t = String(i);
97
+ const s = t.match(/function (.*)\(/);
98
98
  if (s && s.length > 1) {
99
99
  const n = i == null ? void 0 : i.name;
100
100
  return n || s[1].substring(0, 20);
101
101
  }
102
102
  if (oe(i)) {
103
103
  const n = {};
104
- Object.keys(i).forEach((d) => {
105
- n[d] = Te(i[d]);
104
+ Object.keys(i).forEach((r) => {
105
+ n[r] = Se(i[r]);
106
106
  });
107
107
  try {
108
- e = `Object of ${JSON.stringify(n)}`;
108
+ t = `Object of ${JSON.stringify(n)}`;
109
109
  } catch {
110
- e = "Object";
110
+ t = "Object";
111
111
  }
112
112
  }
113
- return e;
113
+ return t;
114
114
  }
115
- function Ot(i, t) {
116
- const o = (e, s) => {
115
+ function Ot(i, e) {
116
+ const o = (t, s) => {
117
117
  if (bt(s))
118
- return s(e);
118
+ return s(t);
119
119
  if (s == null)
120
- return e === s ? !1 : `Expected ${R(e)} to be ${String(s)}`;
121
- const n = St(e, s);
120
+ return t === s ? !1 : `Expected ${R(t)} to be ${String(s)}`;
121
+ const n = St(t, s);
122
122
  if (n !== null)
123
123
  return n;
124
- const d = Mt(e, s);
125
- if (d !== null)
126
- return d;
124
+ const r = Mt(t, s);
125
+ if (r !== null)
126
+ return r;
127
127
  if (Array.isArray(s))
128
- return Tt(e, s, o);
128
+ return Tt(t, s, o);
129
129
  if (s === Object)
130
- return se(e, {}, o);
130
+ return se(t, {}, o);
131
131
  if (s instanceof Function)
132
- return e instanceof s ? !1 : `Expected ${R(e, !0)} to be of Type ${Te(s)}`;
132
+ return t instanceof s ? !1 : `Expected ${R(t, !0)} to be of Type ${Se(s)}`;
133
133
  if (typeof s == "object") {
134
- const r = se(e, s, o);
135
- return r || !1;
134
+ const l = se(t, s, o);
135
+ return l || !1;
136
136
  }
137
137
  throw new Error(`Cannot handle pattern ${String(s)}`);
138
138
  };
139
- return o(i, t);
139
+ return o(i, e);
140
140
  }
141
141
  let It = Error;
142
- function le(i, t) {
143
- const o = Ot(i, t);
142
+ function le(i, e) {
143
+ const o = Ot(i, e);
144
144
  if (o)
145
145
  throw new It(`Match failed: ${o}`);
146
146
  }
147
147
  function Pt(i) {
148
148
  le(i, Object);
149
- const t = Object.values(i), o = (e) => t.includes(e) ? !1 : `expected ${R(e)} to be of enum: ${t.join(", ")}`;
150
- return o[Me] = !0, o;
149
+ const e = Object.values(i), o = (t) => e.includes(t) ? !1 : `expected ${R(t)} to be of enum: ${e.join(", ")}`;
150
+ return o[Te] = !0, o;
151
151
  }
152
- function At(i, t, o) {
152
+ function At(i, e, o) {
153
153
  if (i != null) {
154
- const e = Object.values(t).find((s) => s == i);
155
- if (e != null)
156
- return e;
154
+ const t = Object.values(e).find((s) => s == i);
155
+ if (t != null)
156
+ return t;
157
157
  }
158
158
  return o;
159
159
  }
160
- const Rt = new Q(), te = new He();
161
- class Nt extends Pe {
162
- constructor(t) {
163
- super(t), this.spot = t.spot;
160
+ const Rt = new ee(), te = new ze();
161
+ class Nt extends Ae {
162
+ constructor(e) {
163
+ super(e), this.spot = e.spot;
164
164
  }
165
165
  /**
166
166
  * Updates the camera primitive.
167
167
  * @param {unknown} frameState
168
168
  */
169
- update(t) {
169
+ update(e) {
170
170
  if (this.show)
171
171
  if (this.spot)
172
- super.update(t);
172
+ super.update(e);
173
173
  else {
174
- const o = this._planesPrimitives, e = this._outlinePrimitives;
175
- o.length === 0 && (ze.eastNorthUpToFixedFrame(
174
+ const o = this._planesPrimitives, t = this._outlinePrimitives;
175
+ o.length === 0 && (Ge.eastNorthUpToFixedFrame(
176
176
  this._camera.positionWC,
177
177
  void 0,
178
178
  te
179
179
  ), o[0] = new ce({
180
180
  allowPicking: this.allowPicking,
181
181
  geometryInstances: new ue({
182
- geometry: new Ge({
182
+ geometry: new Ke({
183
183
  radius: 2
184
184
  }),
185
185
  attributes: {
186
186
  color: he.fromColor(
187
- Q.fromAlpha(this._color, 0.1, Rt)
187
+ ee.fromAlpha(this._color, 0.1, Rt)
188
188
  )
189
189
  },
190
190
  modelMatrix: te
@@ -194,10 +194,10 @@ class Nt extends Pe {
194
194
  flat: !0
195
195
  }),
196
196
  asynchronous: !1
197
- }), e[0] = new ce({
197
+ }), t[0] = new ce({
198
198
  allowPicking: this.allowPicking,
199
199
  geometryInstances: new ue({
200
- geometry: new Ke({
200
+ geometry: new Ye({
201
201
  radius: 2
202
202
  }),
203
203
  attributes: {
@@ -213,22 +213,22 @@ class Nt extends Pe {
213
213
  }));
214
214
  const { length: s } = o;
215
215
  for (let n = 0; n < s; ++n)
216
- e[n].update(t), o[n].update(t);
216
+ t[n].update(e), o[n].update(e);
217
217
  }
218
218
  }
219
219
  }
220
- const w = {
220
+ const g = {
221
221
  CONE: "cone",
222
222
  THREESIXTY: "360"
223
223
  };
224
- function Dt(i, t) {
225
- const o = new Xe(i), e = (
224
+ function Dt(i, e) {
225
+ const o = new Je(i), t = (
226
226
  /** @type {import("@vcmap-cesium/engine").PerspectiveFrustum} */
227
227
  o.frustum
228
228
  );
229
- return e.fov = t.fov, e.near = t.near, e.aspectRatio = t.aspectRatio, e.far = t.far, o;
229
+ return t.fov = e.fov, t.near = e.near, t.aspectRatio = e.aspectRatio, t.far = e.far, o;
230
230
  }
231
- const I = class I extends Ae {
231
+ const I = class I extends Re {
232
232
  static get className() {
233
233
  return "Viewshed";
234
234
  }
@@ -239,7 +239,7 @@ const I = class I extends Ae {
239
239
  static getDefaultOptions() {
240
240
  return {
241
241
  frustum: {
242
- fov: x.PI / 3,
242
+ fov: k.PI / 3,
243
243
  near: 1,
244
244
  aspectRatio: 1,
245
245
  far: 300
@@ -257,34 +257,34 @@ const I = class I extends Ae {
257
257
  /**
258
258
  * @param {ViewshedOptions} options The options for the viewshed.
259
259
  */
260
- constructor(t) {
261
- var o, e, s, n, d, r;
262
- super(t), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
263
- fov: ((o = t.frustumOptions) == null ? void 0 : o.fov) || I.getDefaultOptions().frustum.fov,
264
- far: ((e = t.frustumOptions) == null ? void 0 : e.far) || I.getDefaultOptions().frustum.far,
265
- near: ((s = t.frustumOptions) == null ? void 0 : s.near) || I.getDefaultOptions().frustum.near,
266
- aspectRatio: ((n = t.frustumOptions) == null ? void 0 : n.aspectRatio) || I.getDefaultOptions().frustum.aspectRatio
267
- }, this._headingPitchRollValues = t.orientation || {
260
+ constructor(e) {
261
+ var o, t, s, n, r, l;
262
+ super(e), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
263
+ fov: ((o = e.frustumOptions) == null ? void 0 : o.fov) || I.getDefaultOptions().frustum.fov,
264
+ far: ((t = e.frustumOptions) == null ? void 0 : t.far) || I.getDefaultOptions().frustum.far,
265
+ near: ((s = e.frustumOptions) == null ? void 0 : s.near) || I.getDefaultOptions().frustum.near,
266
+ aspectRatio: ((n = e.frustumOptions) == null ? void 0 : n.aspectRatio) || I.getDefaultOptions().frustum.aspectRatio
267
+ }, this._headingPitchRollValues = e.orientation || {
268
268
  ...I.getDefaultOptions().orientation
269
- }, this._position = t.position || I.getDefaultOptions().position, this._viewshedType = At(t.viewshedType, w), this._colors = {
270
- visibleColor: Q.fromCssColorString(
271
- ((d = t.colorOptions) == null ? void 0 : d.visibleColor) || I.getDefaultOptions().visibleColor
269
+ }, this._position = e.position || I.getDefaultOptions().position, this._viewshedType = At(e.viewshedType, g), this._colors = {
270
+ visibleColor: ee.fromCssColorString(
271
+ ((r = e.colorOptions) == null ? void 0 : r.visibleColor) || I.getDefaultOptions().visibleColor
272
272
  ),
273
- shadowColor: Q.fromCssColorString(
274
- ((r = t.colorOptions) == null ? void 0 : r.shadowColor) || I.getDefaultOptions().shadowColor
273
+ shadowColor: ee.fromCssColorString(
274
+ ((l = e.colorOptions) == null ? void 0 : l.shadowColor) || I.getDefaultOptions().shadowColor
275
275
  )
276
- }, this._heightOffset = t.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!t.showPrimitive, this._positionChanged = new X(), this._active = !1;
276
+ }, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this._positionChanged = new X(), this._active = !1;
277
277
  }
278
278
  /**
279
279
  * Sets a new position for the shadow map. If no shadow map was created yet, due to missing position, this method triggers the creation of a shadow map.
280
280
  * @param {import("ol/coordinate").Coordinate} coords The new positions coordinates in degrees
281
281
  */
282
- set position(t) {
283
- le(t, [Number]), this._position = t, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
284
- t[0],
285
- t[1],
286
- t[2] + this._heightOffset
287
- ), this._shadowCamera.setView({ orientation: this._headingPitchRollValues }), this._updatePrimitive()), this._positionChanged.raiseEvent(t);
282
+ set position(e) {
283
+ le(e, [Number]), this._position = e, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
284
+ e[0],
285
+ e[1],
286
+ e[2] + this._heightOffset
287
+ ), this._shadowCamera.setView({ orientation: this._headingPitchRollValues }), this._updatePrimitive()), this._positionChanged.raiseEvent(e);
288
288
  }
289
289
  /**
290
290
  * @returns {import("ol/coordinate").Coordinate} The current position of the viewshed source.
@@ -303,11 +303,11 @@ const I = class I extends Ae {
303
303
  * Sets the height offset of the viewshed.
304
304
  * @param {number} value the offset that is added to the position height.
305
305
  */
306
- set heightOffset(t) {
307
- this._heightOffset = t, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
306
+ set heightOffset(e) {
307
+ this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
308
308
  this.position[0],
309
309
  this.position[1],
310
- this.position[2] + t
310
+ this.position[2] + e
311
311
  ), this._updatePrimitive());
312
312
  }
313
313
  /**
@@ -321,8 +321,8 @@ const I = class I extends Ae {
321
321
  * Sets the reach of the viewshed.
322
322
  * @param {number} value The distance in meters.
323
323
  */
324
- set distance(t) {
325
- this._frustumOptions.far = t > I.MIN_DISTANCE ? t : I.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === w.THREESIXTY && this._updateShadowMap(), this._viewshedType === w.CONE && this._updatePrimitive());
324
+ set distance(e) {
325
+ this._frustumOptions.far = e > I.MIN_DISTANCE ? e : I.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === g.THREESIXTY && this._updateShadowMap(), this._viewshedType === g.CONE && this._updatePrimitive());
326
326
  }
327
327
  /**
328
328
  * Returns the reach of the viewshed.
@@ -335,44 +335,44 @@ const I = class I extends Ae {
335
335
  * Sets the field of view of a cone viewshed. Does not have a impact on 360 viewshed.
336
336
  * @param {number} value The field of view in degrees.
337
337
  */
338
- set fov(t) {
339
- this._frustumOptions.fov = t * x.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = t * x.RADIANS_PER_DEGREE, this._viewshedType === w.CONE && (this._updateShadowMap(), this._updatePrimitive()));
338
+ set fov(e) {
339
+ this._frustumOptions.fov = e * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = e * k.RADIANS_PER_DEGREE, this._viewshedType === g.CONE && (this._updateShadowMap(), this._updatePrimitive()));
340
340
  }
341
341
  /**
342
342
  * Returns the field of view.
343
343
  * @returns {number} The field of view in degrees.
344
344
  */
345
345
  get fov() {
346
- return this._frustumOptions.fov * x.DEGREES_PER_RADIAN;
346
+ return this._frustumOptions.fov * k.DEGREES_PER_RADIAN;
347
347
  }
348
348
  /**
349
349
  * Sets the heading of a cone viewshed. Does not have impact on 360 viewshed.
350
350
  * @param {number} value Heading in degrees.
351
351
  */
352
- set heading(t) {
353
- this._headingPitchRollValues.heading = t * x.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
352
+ set heading(e) {
353
+ this._headingPitchRollValues.heading = e * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
354
354
  orientation: {
355
- heading: t * x.RADIANS_PER_DEGREE,
355
+ heading: e * k.RADIANS_PER_DEGREE,
356
356
  pitch: this._shadowCamera.pitch,
357
357
  roll: 0
358
358
  }
359
- }), this._viewshedType === w.CONE && this._updatePrimitive());
359
+ }), this._viewshedType === g.CONE && this._updatePrimitive());
360
360
  }
361
361
  /**
362
362
  * Getter for the heading of a cone viewshed.
363
363
  * @returns {number} The heading in degress.
364
364
  */
365
365
  get heading() {
366
- return this._headingPitchRollValues.heading * x.DEGREES_PER_RADIAN;
366
+ return this._headingPitchRollValues.heading * k.DEGREES_PER_RADIAN;
367
367
  }
368
368
  /**
369
369
  * Sets the pitch of a cone viewshed. 0 is horizontal. Does not have impact on 360 viewshed.
370
370
  * @param {number} value The pitch in degrees.
371
371
  */
372
- set pitch(t) {
373
- if (this._headingPitchRollValues.pitch = t * x.RADIANS_PER_DEGREE, this._shadowCamera) {
374
- const o = t * x.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
375
- this._shadowCamera.lookUp(o), this._viewshedType === w.CONE && this._updatePrimitive();
372
+ set pitch(e) {
373
+ if (this._headingPitchRollValues.pitch = e * k.RADIANS_PER_DEGREE, this._shadowCamera) {
374
+ const o = e * k.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
375
+ this._shadowCamera.lookUp(o), this._viewshedType === g.CONE && this._updatePrimitive();
376
376
  }
377
377
  }
378
378
  /**
@@ -380,14 +380,14 @@ const I = class I extends Ae {
380
380
  * @returns {number} The pitch in degrees.
381
381
  */
382
382
  get pitch() {
383
- return this._headingPitchRollValues.pitch * x.DEGREES_PER_RADIAN;
383
+ return this._headingPitchRollValues.pitch * k.DEGREES_PER_RADIAN;
384
384
  }
385
385
  /**
386
386
  * Sets whether the primitive of the viewshed should be shown or not.
387
387
  * @param {boolean} value
388
388
  */
389
- set showPrimitive(t) {
390
- this._showPrimitive = t, this._updatePrimitive();
389
+ set showPrimitive(e) {
390
+ this._showPrimitive = e, this._updatePrimitive();
391
391
  }
392
392
  /**
393
393
  * Gets if the primitive of the viewshed is shown or not.
@@ -413,17 +413,17 @@ const I = class I extends Ae {
413
413
  * Deactivates the viewshed by removing primitive and removing shadowMap.
414
414
  */
415
415
  deactivate() {
416
- var t;
417
- this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (t = this._shadowMap) == null || t.destroy(), this._shadowCamera = null, this._scene = null, this._cesiumMap = null, this._shadowMap = null, this._active = !1);
416
+ var e;
417
+ this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (e = this._shadowMap) == null || e.destroy(), this._shadowCamera = null, this._scene = null, this._cesiumMap = null, this._shadowMap = null, this._active = !1);
418
418
  }
419
419
  /**
420
420
  * Activates viewshed.
421
421
  * @param {import("@vcmap/core").CesiumMap} cesiumMap The cesium map to which the shadow map of the viewshed is applied to.
422
422
  */
423
- activate(t) {
424
- if (this._active || (this._active = !0), t !== this._cesiumMap) {
425
- this._cesiumMap = t;
426
- const o = t.getScene();
423
+ activate(e) {
424
+ if (this._active || (this._active = !0), e !== this._cesiumMap) {
425
+ this._cesiumMap = e;
426
+ const o = e.getScene();
427
427
  if (o)
428
428
  this._shadowCamera = Dt(o, this._frustumOptions), this._position && (this.position = this._position), this._scene = o;
429
429
  else
@@ -435,13 +435,13 @@ const I = class I extends Ae {
435
435
  * Updates the shadow map by creating a new one and applying all the current parameters.
436
436
  */
437
437
  _updateShadowMap() {
438
- var t;
439
- !this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((t = this._shadowMap) == null || t.destroy(), this._shadowMap = new Ye({
438
+ var e;
439
+ !this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((e = this._shadowMap) == null || e.destroy(), this._shadowMap = new Xe({
440
440
  // @ts-ignore
441
441
  context: this._scene.context,
442
442
  lightCamera: this._shadowCamera,
443
443
  enabled: !0,
444
- isPointLight: this._viewshedType === w.THREESIXTY,
444
+ isPointLight: this._viewshedType === g.THREESIXTY,
445
445
  softShadows: !0,
446
446
  fromLightSource: !0,
447
447
  cascadesEnabled: !1,
@@ -451,30 +451,30 @@ const I = class I extends Ae {
451
451
  }), this._shadowMap.viewshed = this._colors, this._cesiumMap.setShadowMap(this._shadowMap));
452
452
  }
453
453
  _removePrimitive() {
454
- var t;
455
- this._primitive && !this._primitive.isDestroyed() && ((t = this._scene) == null || t.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
454
+ var e;
455
+ this._primitive && !this._primitive.isDestroyed() && ((e = this._scene) == null || e.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
456
456
  }
457
457
  _updatePrimitive() {
458
458
  this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new Nt({
459
459
  camera: this._shadowCamera,
460
460
  allowPicking: !1,
461
- spot: this._viewshedType === w.CONE
461
+ spot: this._viewshedType === g.CONE
462
462
  }), this._scene.primitives.add(this._primitive)) : this._removePrimitive();
463
463
  }
464
464
  /**
465
465
  * Sets distance and, in case of cone viewsheds, also heading and pitch. Only works when viewshed is **active**.
466
466
  * @param {number[]} target Point to calculate distance, heading and pitch from.
467
467
  */
468
- lookAt(t) {
468
+ lookAt(e) {
469
469
  if (!this._shadowCamera)
470
470
  return;
471
- const o = W.fromDegrees(t[0], t[1], t[2]);
472
- if (this.distance = W.distance(this._shadowCamera.position, o), this.type === w.CONE && !o.equals(this._shadowCamera.position)) {
473
- const e = new W();
474
- W.subtract(o, this._shadowCamera.position, o), W.normalize(o, o), W.normalize(this._shadowCamera.position, e), this._shadowCamera.setView({
471
+ const o = W.fromDegrees(e[0], e[1], e[2]);
472
+ if (this.distance = W.distance(this._shadowCamera.position, o), this.type === g.CONE && !o.equals(this._shadowCamera.position)) {
473
+ const t = new W();
474
+ W.subtract(o, this._shadowCamera.position, o), W.normalize(o, o), W.normalize(this._shadowCamera.position, t), this._shadowCamera.setView({
475
475
  orientation: {
476
476
  direction: o,
477
- up: e
477
+ up: t
478
478
  }
479
479
  }), this._headingPitchRollValues.heading = this._shadowCamera.heading, this._headingPitchRollValues.pitch = this._shadowCamera.pitch;
480
480
  }
@@ -503,20 +503,20 @@ const I = class I extends Ae {
503
503
  * Destroys the viewshed.
504
504
  */
505
505
  destroy() {
506
- var e;
507
- const t = this._cesiumMap, o = this._shadowMap;
508
- this.deactivate(), ((e = t == null ? void 0 : t.getScene()) == null ? void 0 : e.shadowMap) === o && t.setDefaultShadowMap();
506
+ var t;
507
+ const e = this._cesiumMap, o = this._shadowMap;
508
+ this.deactivate(), ((t = e == null ? void 0 : e.getScene()) == null ? void 0 : t.shadowMap) === o && e.setDefaultShadowMap();
509
509
  }
510
510
  };
511
511
  de(I, "MIN_DISTANCE", 10);
512
512
  let D = I;
513
- class xt extends Re {
513
+ class kt extends Ne {
514
514
  /**
515
515
  *
516
516
  * @param {import("./viewshed").default} viewshed
517
517
  */
518
- constructor(t) {
519
- super(Y.CLICKMOVE), this._viewshed = t, this._positioned = new X(), this._finished = new X(), this._position = !1, this.setActive();
518
+ constructor(e) {
519
+ super(Y.CLICKMOVE), this._viewshed = e, this._positioned = new X(), this._finished = new X(), this._position = !1, this.setActive();
520
520
  }
521
521
  get finished() {
522
522
  return this._finished;
@@ -524,8 +524,8 @@ class xt extends Re {
524
524
  get positioned() {
525
525
  return this._positioned;
526
526
  }
527
- async pipe(t) {
528
- return t.position && (this._position ? (this._viewshed.lookAt(z.mercatorToWgs84(t.position)), t.type & Y.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = z.mercatorToWgs84(t.position), t.type & Y.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), t;
527
+ async pipe(e) {
528
+ return e.position && (this._position ? (this._viewshed.lookAt(z.mercatorToWgs84(e.position)), e.type & Y.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = z.mercatorToWgs84(e.position), e.type & Y.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
529
529
  }
530
530
  destroy() {
531
531
  super.destroy(), this._finished.destroy(), this._positioned.destroy();
@@ -540,60 +540,60 @@ const P = {
540
540
  EDIT: "edit",
541
541
  MOVE: "move",
542
542
  MULTI_SELECT: "multiSelect"
543
- }, ge = 1.8;
544
- function kt(i) {
545
- const t = new ke({
546
- projection: Le.toJSON(),
547
- zIndex: Fe - 1
543
+ }, _e = 1.8;
544
+ function xt(i) {
545
+ const e = new Le({
546
+ projection: Fe.toJSON(),
547
+ zIndex: je - 1
548
548
  });
549
- je(t), t.activate();
550
- const o = new st(new nt(i));
551
- return o.setStyle(new at({})), t.addFeatures([o]), t.vectorProperties.altitudeMode = Je.NONE, {
552
- layer: t,
549
+ We(e), e.activate();
550
+ const o = new nt(new at(i));
551
+ return o.setStyle(new rt({})), e.addFeatures([o]), e.vectorProperties.altitudeMode = Ze.NONE, {
552
+ layer: e,
553
553
  feature: o,
554
554
  destroy() {
555
- o.dispose(), t.destroy();
555
+ o.dispose(), e.destroy();
556
556
  }
557
557
  };
558
558
  }
559
- function ie(i, t) {
560
- const o = t === P.ABSOLUTE ? Y.CLICKMOVE : Y.NONE;
559
+ function ie(i, e) {
560
+ const o = e === P.ABSOLUTE ? Y.CLICKMOVE : Y.NONE;
561
561
  i.setActive(o), i.pickPosition = o, i.pullPickedPosition = 1.8;
562
562
  }
563
- function Lt(i, t, o) {
564
- const e = Z(null), s = U(null), n = U(null), d = U(P.ABSOLUTE);
565
- let r = () => {
563
+ function Lt(i, e, o) {
564
+ const t = q(null), s = $(null), n = $(null), r = $(P.ABSOLUTE);
565
+ let l = () => {
566
566
  };
567
- const l = Z(null), _ = Z([]);
568
- let c = () => {
567
+ const w = q(null), c = q([]);
568
+ let d = () => {
569
569
  };
570
570
  function f() {
571
571
  var a;
572
- s.value && e.value ? (e.value.deactivate(), o.setVisibility(e.value.name, !1)) : (a = e.value) == null || a.destroy();
572
+ s.value && t.value ? (t.value.deactivate(), o.setVisibility(t.value.name, !1)) : (a = t.value) == null || a.destroy();
573
573
  }
574
574
  function m(a = !0) {
575
- c(), r(), f(), e.value = null, a && o.clearSelection(), s.value = null, n.value = null;
575
+ d(), l(), f(), t.value = null, a && o.clearSelection(), s.value = null, n.value = null;
576
576
  }
577
- function g(a) {
578
- c(), f(), i.maps.activeMap instanceof $ && (e.value = a, a.activate(i.maps.activeMap), c = i.maps.activeMap.shadowMapChanged.addEventListener((v) => {
577
+ function _(a) {
578
+ d(), f(), i.maps.activeMap instanceof U && (t.value = a, a.activate(i.maps.activeMap), d = i.maps.activeMap.shadowMapChanged.addEventListener((v) => {
579
579
  var u;
580
- v !== ((u = e.value) == null ? void 0 : u.shadowMap) && m(!1);
580
+ v !== ((u = t.value) == null ? void 0 : u.shadowMap) && m(!1);
581
581
  }));
582
582
  }
583
583
  async function y(a) {
584
- m(), await Ze();
584
+ m(), await qe();
585
585
  const { eventHandler: v } = i.maps, { featureInteraction: u } = v, C = new D({
586
586
  viewshedType: a,
587
587
  colorOptions: {
588
- visibleColor: t.visibleColor,
589
- shadowColor: t.shadowColor
588
+ visibleColor: e.visibleColor,
589
+ shadowColor: e.shadowColor
590
590
  },
591
- heightOffset: d.value === P.ABSOLUTE ? 0 : ge
591
+ heightOffset: r.value === P.ABSOLUTE ? 0 : _e
592
592
  });
593
- g(C);
594
- const V = new xt(e.value);
593
+ _(C);
594
+ const V = new kt(t.value);
595
595
  V.finished.addEventListener(() => {
596
- r(), e.value ? (e.value.showPrimitive = !0, n.value = E.EDIT) : m();
596
+ l(), t.value ? (t.value.showPrimitive = !0, n.value = E.EDIT) : m();
597
597
  });
598
598
  const O = v.addExclusiveInteraction(
599
599
  V,
@@ -601,47 +601,47 @@ function Lt(i, t, o) {
601
601
  V.destroy();
602
602
  }
603
603
  );
604
- ie(u, d.value), V.positioned.addEventListener(() => {
604
+ ie(u, r.value), V.positioned.addEventListener(() => {
605
605
  ie(u, P.ABSOLUTE);
606
- }), r = () => {
607
- O(), V.destroy(), u.setActive(), r = () => {
606
+ }), l = () => {
607
+ O(), V.destroy(), u.setActive(), l = () => {
608
608
  };
609
609
  }, n.value = E.CREATE;
610
610
  }
611
- function k(a) {
611
+ function x(a) {
612
612
  var v;
613
- if (e.value && a) {
614
- r();
613
+ if (t.value && a) {
614
+ l();
615
615
  const {
616
616
  layer: u,
617
617
  feature: C,
618
618
  destroy: V
619
- } = kt(e.value.position);
620
- i.layers.add(u), _.value = [C], d.value === P.ABSOLUTE ? (l.value = De(i, u), l.value.setFeatures([C])) : (l.value = xe(i, u), l.value.setFeature(C)), l.value.stopped.addEventListener(() => {
621
- r();
619
+ } = xt(t.value.position);
620
+ i.layers.add(u), c.value = [C], r.value === P.ABSOLUTE ? (w.value = ke(i, u), w.value.setFeatures([C])) : (w.value = xe(i, u), w.value.setFeature(C)), w.value.stopped.addEventListener(() => {
621
+ l();
622
622
  });
623
623
  const O = (v = C.getGeometry()) == null ? void 0 : v.on("change", () => {
624
- e.value ? e.value.position = z.mercatorToWgs84(
624
+ t.value ? t.value.position = z.mercatorToWgs84(
625
625
  /** @type {import("ol/geom").Point} */
626
626
  C.getGeometry().getCoordinates()
627
627
  ) : m();
628
628
  });
629
- n.value = E.MOVE, r = () => {
629
+ n.value = E.MOVE, l = () => {
630
630
  var K;
631
- r = () => {
632
- }, O && ot(O), (K = l.value) == null || K.stop(), l.value = null, _.value = [], i.layers.remove(u), V(), n.value = E.EDIT;
631
+ l = () => {
632
+ }, O && st(O), (K = w.value) == null || K.stop(), w.value = null, c.value = [], i.layers.remove(u), V(), n.value = E.EDIT;
633
633
  };
634
634
  } else
635
- r();
635
+ l();
636
636
  }
637
637
  function S(a, v) {
638
- r(), e.value !== v && (g(v), d.value = v.heightOffset ? P.RELATIVE : P.ABSOLUTE), s.value = !!v.properties.title, n.value = a, s.value && o.setVisibility(v.name, !0);
638
+ l(), t.value !== v && (_(v), r.value = v.heightOffset ? P.RELATIVE : P.ABSOLUTE), s.value = !!v.properties.title, n.value = a, s.value && o.setVisibility(v.name, !0);
639
639
  }
640
640
  const L = [
641
641
  o.collectionComponent.collection.removed.addEventListener(
642
642
  (a) => {
643
643
  var v;
644
- o.remove(a.name), ((v = e.value) == null ? void 0 : v.name) === a.name && m();
644
+ o.remove(a.name), ((v = t.value) == null ? void 0 : v.name) === a.name && m();
645
645
  }
646
646
  ),
647
647
  o.renamed.addEventListener(({ item: a, title: v }) => {
@@ -649,39 +649,39 @@ function Lt(i, t, o) {
649
649
  const u = i.windowManager.get(
650
650
  `${o.collectionComponent.id}-editor`
651
651
  );
652
- u && ((C = e.value) == null ? void 0 : C.name) === a.name && (u.state.headerTitle = v);
652
+ u && ((C = t.value) == null ? void 0 : C.name) === a.name && (u.state.headerTitle = v);
653
653
  }),
654
654
  o.visibilityChanged.addEventListener((a) => {
655
655
  var u;
656
- const v = ((u = e.value) == null ? void 0 : u.name) === a.name;
656
+ const v = ((u = t.value) == null ? void 0 : u.name) === a.name;
657
657
  v ? m() : (S(E.VIEW, a), o.clearSelection()), o.setVisibility(a.name, !v);
658
658
  })
659
659
  ];
660
660
  function T(a) {
661
- if (!(a === d.value || !e.value)) {
662
- if (d.value = a, n.value === E.MOVE && r(), n.value === E.CREATE)
661
+ if (!(a === r.value || !t.value)) {
662
+ if (r.value = a, n.value === E.MOVE && l(), n.value === E.CREATE)
663
663
  ie(
664
664
  i.maps.eventHandler.featureInteraction,
665
665
  a
666
- ), e.value.heightOffset = a === P.ABSOLUTE ? 0 : ge;
666
+ ), t.value.heightOffset = a === P.ABSOLUTE ? 0 : _e;
667
667
  else if (n.value === E.EDIT) {
668
- const { position: v, heightOffset: u } = e.value;
668
+ const { position: v, heightOffset: u } = t.value;
669
669
  a === P.RELATIVE ? i.maps.activeMap.getHeightFromTerrain([z.wgs84ToMercator(v)]).then((C) => {
670
670
  const V = z.mercatorToWgs84(C[0]);
671
- e.value && (e.value.heightOffset = v[2] - V[2], e.value.position = V);
672
- }) : (e.value.position = [
671
+ t.value && (t.value.heightOffset = v[2] - V[2], t.value.position = V);
672
+ }) : (t.value.position = [
673
673
  v[0],
674
674
  v[1],
675
675
  v[2] + u
676
- ], e.value.heightOffset = 0);
676
+ ], t.value.heightOffset = 0);
677
677
  }
678
678
  }
679
679
  }
680
680
  return {
681
- currentViewshed: e,
681
+ currentViewshed: t,
682
682
  currentIsPersisted: s,
683
- currentEditSession: l,
684
- currentFeatures: _,
683
+ currentEditSession: w,
684
+ currentFeatures: c,
685
685
  createViewshed: y,
686
686
  viewViewshed(a) {
687
687
  S(E.VIEW, a);
@@ -690,22 +690,22 @@ function Lt(i, t, o) {
690
690
  S(E.EDIT, a), s.value && (o.setSelection(a.name), o.collectionComponent.openEditorWindow(a));
691
691
  },
692
692
  persistCurrent() {
693
- e.value && (o.add(e.value), s.value = !0, o.setSelection(e.value.name), o.setVisibility(e.value.name, !0));
693
+ t.value && (o.add(t.value), s.value = !0, o.setSelection(t.value.name), o.setVisibility(t.value.name, !0));
694
694
  },
695
- moveCurrentViewshed: k,
695
+ moveCurrentViewshed: x,
696
696
  setupMultiSelect() {
697
- r(), n.value = E.MULTI_SELECT, f(), e.value = null;
697
+ l(), n.value = E.MULTI_SELECT, f(), t.value = null;
698
698
  },
699
699
  mode: n,
700
- heightMode: d,
700
+ heightMode: r,
701
701
  changeHeightMode: T,
702
702
  async placeCurrentFeaturesOnTerrain() {
703
703
  var a, v;
704
- if (e.value && ((a = l.value) == null ? void 0 : a.type) === Ne.EDIT_FEATURES && i.maps.activeMap instanceof $) {
704
+ if (t.value && ((a = w.value) == null ? void 0 : a.type) === De.EDIT_FEATURES && i.maps.activeMap instanceof U) {
705
705
  const C = (await i.maps.activeMap.getHeightFromTerrain([
706
- z.wgs84ToMercator((v = e.value) == null ? void 0 : v.position)
707
- ]))[0][2] - e.value.position[2];
708
- l.value.translate(0, 0, C);
706
+ z.wgs84ToMercator((v = t.value) == null ? void 0 : v.position)
707
+ ]))[0][2] - t.value.position[2];
708
+ w.value.translate(0, 0, C);
709
709
  }
710
710
  },
711
711
  stop: m,
@@ -714,10 +714,10 @@ function Lt(i, t, o) {
714
714
  }
715
715
  };
716
716
  }
717
- const Se = (i, t) => {
717
+ const Oe = (i, e) => {
718
718
  const o = i.__vccOpts || i;
719
- for (const [e, s] of t)
720
- o[e] = s;
719
+ for (const [t, s] of e)
720
+ o[t] = s;
721
721
  return o;
722
722
  }, Ft = {
723
723
  distance: [D.MIN_DISTANCE, 2e3],
@@ -726,18 +726,18 @@ const Se = (i, t) => {
726
726
  pitch: [-90, 90]
727
727
  }, jt = {
728
728
  components: {
729
- VcsTextField: rt,
730
- VContainer: ye,
731
- VRow: Ve,
732
- VCol: be,
733
- VcsSlider: lt,
734
- VcsLabel: _e,
735
- VcsFormSection: Ce,
729
+ VcsTextField: lt,
730
+ VContainer: Ve,
731
+ VRow: be,
732
+ VCol: Me,
733
+ VcsSlider: dt,
734
+ VcsLabel: Ce,
735
+ VcsFormSection: Ee,
736
736
  VDivider: Ct,
737
- VcsSelect: Ee,
738
- VcsFormButton: dt,
739
- VcsFeatureTransforms: ct,
740
- VcsHelp: ut
737
+ VcsSelect: ye,
738
+ VcsFormButton: ct,
739
+ VcsFeatureTransforms: ut,
740
+ VcsHelp: ht
741
741
  },
742
742
  name: "ViewshedWindow",
743
743
  props: {
@@ -754,58 +754,58 @@ const Se = (i, t) => {
754
754
  },
755
755
  setup(i) {
756
756
  var v;
757
- const t = (
757
+ const e = (
758
758
  /** @type {import("./viewshedManager.js").ViewshedManager} */
759
759
  me("manager")
760
760
  ), o = (
761
761
  /** @type {import("@vcmap/ui").VcsUiApp} */
762
762
  me("vcsApp")
763
763
  ), {
764
- currentViewshed: e,
764
+ currentViewshed: t,
765
765
  mode: s,
766
766
  currentIsPersisted: n
767
- } = t, d = U(
767
+ } = e, r = $(
768
768
  ((v = o.maps.activeMap) == null ? void 0 : v.movementApiCallsDisabled) ?? !1
769
769
  );
770
- let r = () => {
770
+ let l = () => {
771
771
  };
772
- const l = ve(() => i.selection);
773
- let _ = () => {
772
+ const w = ve(() => i.selection);
773
+ let c = () => {
774
774
  };
775
- const c = ee({
775
+ const d = J({
776
776
  X: void 0,
777
777
  Y: void 0,
778
778
  Z: void 0
779
- }), f = Z();
779
+ }), f = q();
780
780
  let m = () => {
781
781
  };
782
- const g = ee({
782
+ const _ = J({
783
783
  showPrimitive: !1,
784
784
  distance: void 0,
785
785
  fov: void 0,
786
786
  heading: void 0,
787
787
  pitch: void 0
788
- }), y = U();
789
- function k() {
790
- e.value && (c.X = e.value.position[0], c.Y = e.value.position[1], c.Z = t.heightMode.value === P.ABSOLUTE ? e.value.position[2] : e.value.heightOffset);
788
+ }), y = $();
789
+ function x() {
790
+ t.value && (d.X = t.value.position[0], d.Y = t.value.position[1], d.Z = e.heightMode.value === P.ABSOLUTE ? t.value.position[2] : t.value.heightOffset);
791
791
  }
792
792
  function S() {
793
- k(), e.value && (g.distance = e.value.distance, g.fov = e.value.fov, g.heading = e.value.heading, g.pitch = e.value.pitch, g.showPrimitive = e.value.showPrimitive, y.value = e.value.type);
793
+ x(), t.value && (_.distance = t.value.distance, _.fov = t.value.fov, _.heading = t.value.heading, _.pitch = t.value.pitch, _.showPrimitive = t.value.showPrimitive, y.value = t.value.type);
794
794
  }
795
- qe(() => {
796
- e.value && s.value !== E.CREATE && S();
795
+ Qe(() => {
796
+ t.value && s.value !== E.CREATE && S();
797
797
  }), G(
798
- e,
798
+ t,
799
799
  () => {
800
- e.value && (_(), _ = e.value.positionChanged.addEventListener(() => {
801
- k(), m();
800
+ t.value && (c(), c = t.value.positionChanged.addEventListener(() => {
801
+ x(), m();
802
802
  }));
803
803
  },
804
804
  { immediate: !0 }
805
805
  );
806
806
  async function L() {
807
807
  var V, O;
808
- (V = e.value) == null || V.deactivate();
808
+ (V = t.value) == null || V.deactivate();
809
809
  const u = (
810
810
  /** @type {import("@vcmap/core").CesiumMap} */
811
811
  (O = o.maps.activeMap.getScene()) == null ? void 0 : O.camera
@@ -814,46 +814,46 @@ const Se = (i, t) => {
814
814
  });
815
815
  m = () => {
816
816
  var K;
817
- C == null || C(), f.value = null, (K = e.value) == null || K.activate(o.maps.activeMap), m = () => {
817
+ C == null || C(), f.value = null, (K = t.value) == null || K.activate(o.maps.activeMap), m = () => {
818
818
  };
819
819
  };
820
820
  }
821
- Qe(() => {
821
+ et(() => {
822
822
  var C, V;
823
823
  const u = (C = i.getViewshed) == null ? void 0 : C.call(i);
824
- u && t.editViewshed(u), r = (V = o.maps.activeMap) == null ? void 0 : V.movementDisabledChanged.addEventListener(
824
+ u && e.editViewshed(u), l = (V = o.maps.activeMap) == null ? void 0 : V.movementDisabledChanged.addEventListener(
825
825
  (O) => {
826
- d.value = O.apiCalls;
826
+ r.value = O.apiCalls;
827
827
  }
828
828
  );
829
- }), et(() => {
830
- _(), m(), r(), n.value || ((s.value === E.EDIT || s.value === E.MOVE) && e.value ? t.viewViewshed(e.value) : s.value === E.CREATE && t.stop()), l.value && (l.value.length > 1 ? t.setupMultiSelect() : l.value.length === 1 && e.value ? t.viewViewshed(e.value) : (
829
+ }), tt(() => {
830
+ c(), m(), l(), n.value || ((s.value === E.EDIT || s.value === E.MOVE) && t.value ? e.viewViewshed(t.value) : s.value === E.CREATE && e.stop()), w.value && (w.value.length > 1 ? e.setupMultiSelect() : w.value.length === 1 && t.value ? e.viewViewshed(t.value) : (
831
831
  // when a persited viewshed is deselected, stops plugin
832
- !l.value.length && s.value === E.EDIT && t.stop(!1)
832
+ !w.value.length && s.value === E.EDIT && e.stop(!1)
833
833
  ));
834
834
  }), S();
835
835
  function T(u, C) {
836
- m(), e.value && (g[u] = C, e.value[u] = C);
836
+ m(), t.value && (_[u] = C, t.value[u] = C);
837
837
  }
838
838
  const a = ve(() => {
839
839
  const u = [];
840
- return y.value === w.CONE && u.push({
840
+ return y.value === g.CONE && u.push({
841
841
  name: "jumpToViewpoint",
842
842
  title: f.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
843
843
  icon: "mdi-human-male",
844
844
  active: !!f.value,
845
- disabled: d.value,
845
+ disabled: r.value,
846
846
  async callback() {
847
847
  var C, V, O;
848
- t.moveCurrentViewshed(!1), e.value && !f.value ? (f.value = await ((C = o.maps.activeMap) == null ? void 0 : C.getViewpoint()), await ((V = o.maps.activeMap) == null ? void 0 : V.gotoViewpoint(
849
- new We({
848
+ e.moveCurrentViewshed(!1), t.value && !f.value ? (f.value = await ((C = o.maps.activeMap) == null ? void 0 : C.getViewpoint()), await ((V = o.maps.activeMap) == null ? void 0 : V.gotoViewpoint(
849
+ new Be({
850
850
  groundPosition: [
851
- e.value.position[0],
852
- e.value.position[1],
853
- e.value.position[2] + e.value.heightOffset
851
+ t.value.position[0],
852
+ t.value.position[1],
853
+ t.value.position[2] + t.value.heightOffset
854
854
  ],
855
- heading: e.value.heading,
856
- pitch: e.value.pitch,
855
+ heading: t.value.heading,
856
+ pitch: t.value.pitch,
857
857
  distance: 0,
858
858
  animate: !0
859
859
  // if not animate, async does not work and the cameraChanged listener is triggered immediately. alternatively set timeout
@@ -863,10 +863,10 @@ const Se = (i, t) => {
863
863
  }), u.push({
864
864
  name: "moveViewshed",
865
865
  title: "viewshed.move",
866
- icon: t.heightMode.value === P.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
866
+ icon: e.heightMode.value === P.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
867
867
  active: s.value === E.MOVE,
868
868
  callback() {
869
- t.moveCurrentViewshed(
869
+ e.moveCurrentViewshed(
870
870
  s.value !== E.MOVE
871
871
  );
872
872
  }
@@ -874,42 +874,42 @@ const Se = (i, t) => {
874
874
  name: "showPrimitive",
875
875
  title: "viewshed.showPrimitive",
876
876
  icon: "mdi-eye",
877
- active: g.showPrimitive,
877
+ active: _.showPrimitive,
878
878
  callback() {
879
879
  this.active = !this.active, T("showPrimitive", this.active);
880
880
  }
881
881
  }), u;
882
882
  });
883
883
  return {
884
- position: c,
884
+ position: d,
885
885
  setPosition(u, C, V) {
886
- if (m(), !!e.value) {
887
- if (V === 2 && t.heightMode.value === P.RELATIVE)
888
- e.value.heightOffset = Number(u);
886
+ if (m(), !!t.value) {
887
+ if (V === 2 && e.heightMode.value === P.RELATIVE)
888
+ t.value.heightOffset = Number(u);
889
889
  else {
890
- const O = [...e.value.position];
891
- O[V] = Number(u), e.value.position = O;
890
+ const O = [...t.value.position];
891
+ O[V] = Number(u), t.value.position = O;
892
892
  }
893
- c[C] = Number(u);
893
+ d[C] = Number(u);
894
894
  }
895
895
  },
896
- parameters: g,
896
+ parameters: _,
897
897
  setParameter: T,
898
898
  parameterRanges: Ft,
899
899
  ViewshedPluginModes: E,
900
900
  viewshedMode: s,
901
901
  currentIsPersisted: n,
902
902
  viewshedType: y,
903
- ViewshedTypes: w,
903
+ ViewshedTypes: g,
904
904
  HeightModes: P,
905
- heightMode: t.heightMode,
906
- TransformationMode: Be,
907
- changeHeightMode: t.changeHeightMode,
905
+ heightMode: e.heightMode,
906
+ TransformationMode: Ue,
907
+ changeHeightMode: e.changeHeightMode,
908
908
  async createNewViewshed() {
909
- await t.createViewshed(y.value);
909
+ await e.createViewshed(y.value);
910
910
  },
911
- addToMyWorkspace: () => t.persistCurrent(),
912
- cancel: () => t.stop(),
911
+ addToMyWorkspace: () => e.persistCurrent(),
912
+ cancel: () => e.stop(),
913
913
  headerActions: a
914
914
  };
915
915
  }
@@ -920,11 +920,11 @@ const Se = (i, t) => {
920
920
  key: 4,
921
921
  class: "d-flex w-full justify-end px-2 pt-2 pb-1"
922
922
  };
923
- function Gt(i, t, o, e, s, n) {
924
- const d = b("VcsHelp"), r = b("v-row"), l = b("VcsFeatureTransforms"), _ = b("VcsTextField"), c = b("v-col"), f = b("v-container"), m = b("VcsFormSection"), g = b("v-divider"), y = b("VcsLabel"), k = b("VcsSelect"), S = b("VcsSlider"), L = b("VcsFormButton");
923
+ function Gt(i, e, o, t, s, n) {
924
+ const r = b("VcsHelp"), l = b("v-row"), w = b("VcsFeatureTransforms"), c = b("VcsTextField"), d = b("v-col"), f = b("v-container"), m = b("VcsFormSection"), _ = b("v-divider"), y = b("VcsLabel"), x = b("VcsSelect"), S = b("VcsSlider"), L = b("VcsFormButton");
925
925
  return M(), B("div", null, [
926
- e.viewshedMode === e.ViewshedPluginModes.CREATE ? (M(), B("div", Wt, [
927
- e.viewshedType === e.ViewshedTypes.CONE ? (M(), N(d, { key: 0 }, {
926
+ t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", Wt, [
927
+ t.viewshedType === t.ViewshedTypes.CONE ? (M(), N(r, { key: 0 }, {
928
928
  default: h(() => [
929
929
  F(
930
930
  A(i.$t("viewshed.createDescription")),
@@ -934,7 +934,7 @@ function Gt(i, t, o, e, s, n) {
934
934
  ]),
935
935
  _: 1
936
936
  /* STABLE */
937
- })) : e.viewshedType === e.ViewshedTypes.THREESIXTY ? (M(), N(d, { key: 1 }, {
937
+ })) : t.viewshedType === t.ViewshedTypes.THREESIXTY ? (M(), N(r, { key: 1 }, {
938
938
  default: h(() => [
939
939
  F(
940
940
  A(i.$t("viewshed.createThreeSixtyDescription")),
@@ -945,18 +945,18 @@ function Gt(i, t, o, e, s, n) {
945
945
  _: 1
946
946
  /* STABLE */
947
947
  })) : H("v-if", !0)
948
- ])) : e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (M(), N(m, {
948
+ ])) : t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(m, {
949
949
  key: 1,
950
- "header-actions": e.headerActions,
950
+ "header-actions": t.headerActions,
951
951
  heading: "viewshed.viewpoint",
952
952
  "action-button-list-overflow-count": 3
953
953
  }, {
954
954
  default: h(() => [
955
955
  p(f, { class: "px-1 py-0" }, {
956
956
  default: h(() => [
957
- p(r, { "no-gutters": "" }, {
957
+ p(l, { "no-gutters": "" }, {
958
958
  default: h(() => [
959
- tt(
959
+ it(
960
960
  "span",
961
961
  Bt,
962
962
  A(i.$t("viewshed.position")),
@@ -967,13 +967,13 @@ function Gt(i, t, o, e, s, n) {
967
967
  _: 1
968
968
  /* STABLE */
969
969
  }),
970
- e.viewshedMode === e.ViewshedPluginModes.MOVE && e.heightMode === e.HeightModes.ABSOLUTE ? (M(), N(r, {
970
+ t.viewshedMode === t.ViewshedPluginModes.MOVE && t.heightMode === t.HeightModes.ABSOLUTE ? (M(), N(l, {
971
971
  key: 0,
972
972
  "no-gutters": ""
973
973
  }, {
974
974
  default: h(() => [
975
- p(l, {
976
- "transformation-mode": e.TransformationMode.TRANSLATE,
975
+ p(w, {
976
+ "transformation-mode": t.TransformationMode.TRANSLATE,
977
977
  "feature-properties": { altitudeMode: "absolute" },
978
978
  "allow-z-input": !0,
979
979
  class: "w-100"
@@ -981,7 +981,7 @@ function Gt(i, t, o, e, s, n) {
981
981
  ]),
982
982
  _: 1
983
983
  /* STABLE */
984
- })) : (M(), N(r, {
984
+ })) : (M(), N(l, {
985
985
  key: 1,
986
986
  "no-gutters": ""
987
987
  }, {
@@ -989,23 +989,23 @@ function Gt(i, t, o, e, s, n) {
989
989
  (M(!0), B(
990
990
  pe,
991
991
  null,
992
- we(e.position, (T, a, v) => (M(), N(
993
- c,
992
+ we(t.position, (T, a, v) => (M(), N(
993
+ d,
994
994
  {
995
995
  key: v,
996
996
  class: "pb-1"
997
997
  },
998
998
  {
999
999
  default: h(() => [
1000
- p(_, {
1000
+ p(c, {
1001
1001
  "model-value": T,
1002
- "onUpdate:modelValue": (u) => e.setPosition(u, a, v),
1002
+ "onUpdate:modelValue": (u) => t.setPosition(u, a, v),
1003
1003
  type: "number",
1004
1004
  prefix: a,
1005
1005
  step: a === "Z" ? 1 : 1e-4,
1006
1006
  unit: a === "Z" ? "m" : "°",
1007
1007
  decimals: a === "Z" ? 2 : 8,
1008
- disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(a === "Z" && e.heightMode === e.HeightModes.RELATIVE),
1008
+ disabled: t.viewshedMode === t.ViewshedPluginModes.MOVE && !(a === "Z" && t.heightMode === t.HeightModes.RELATIVE),
1009
1009
  "hide-spin-buttons": !0
1010
1010
  }, null, 8, ["model-value", "onUpdate:modelValue", "prefix", "step", "unit", "decimals", "disabled"])
1011
1011
  ]),
@@ -1030,12 +1030,12 @@ function Gt(i, t, o, e, s, n) {
1030
1030
  _: 1
1031
1031
  /* STABLE */
1032
1032
  }, 8, ["header-actions"])) : H("v-if", !0),
1033
- p(g),
1033
+ p(_),
1034
1034
  p(f, { class: "px-1 py-0" }, {
1035
1035
  default: h(() => [
1036
- p(r, { "no-gutters": "" }, {
1036
+ p(l, { "no-gutters": "" }, {
1037
1037
  default: h(() => [
1038
- p(c, null, {
1038
+ p(d, null, {
1039
1039
  default: h(() => [
1040
1040
  p(y, { "html-for": "heightMode" }, {
1041
1041
  default: h(() => [
@@ -1052,16 +1052,16 @@ function Gt(i, t, o, e, s, n) {
1052
1052
  _: 1
1053
1053
  /* STABLE */
1054
1054
  }),
1055
- p(c, null, {
1055
+ p(d, null, {
1056
1056
  default: h(() => [
1057
- p(k, {
1057
+ p(x, {
1058
1058
  id: "heightMode",
1059
- items: Object.values(e.HeightModes).map((T) => ({
1059
+ items: Object.values(t.HeightModes).map((T) => ({
1060
1060
  value: T,
1061
1061
  title: `viewshed.${T}`
1062
1062
  })),
1063
- "model-value": e.heightMode,
1064
- "onUpdate:modelValue": e.changeHeightMode
1063
+ "model-value": t.heightMode,
1064
+ "onUpdate:modelValue": t.changeHeightMode
1065
1065
  }, null, 8, ["items", "model-value", "onUpdate:modelValue"])
1066
1066
  ]),
1067
1067
  _: 1
@@ -1075,7 +1075,7 @@ function Gt(i, t, o, e, s, n) {
1075
1075
  _: 1
1076
1076
  /* STABLE */
1077
1077
  }),
1078
- e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (M(), N(f, {
1078
+ t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(f, {
1079
1079
  key: 2,
1080
1080
  class: "px-1 pt-0 pb-2"
1081
1081
  }, {
@@ -1083,21 +1083,21 @@ function Gt(i, t, o, e, s, n) {
1083
1083
  (M(!0), B(
1084
1084
  pe,
1085
1085
  null,
1086
- we(e.parameters, (T, a) => (M(), N(
1087
- r,
1086
+ we(t.parameters, (T, a) => (M(), N(
1087
+ l,
1088
1088
  {
1089
1089
  "no-gutters": "",
1090
1090
  key: a
1091
1091
  },
1092
1092
  {
1093
1093
  default: h(() => [
1094
- a === "distance" || e.viewshedType === e.ViewshedTypes.CONE && a !== "showPrimitive" ? (M(), N(
1095
- c,
1094
+ a === "distance" || t.viewshedType === t.ViewshedTypes.CONE && a !== "showPrimitive" ? (M(), N(
1095
+ d,
1096
1096
  { key: 0 },
1097
1097
  {
1098
1098
  default: h(() => [
1099
1099
  p(
1100
- r,
1100
+ l,
1101
1101
  {
1102
1102
  "no-gutters": "",
1103
1103
  class: "px-1"
@@ -1105,7 +1105,7 @@ function Gt(i, t, o, e, s, n) {
1105
1105
  {
1106
1106
  default: h(() => [
1107
1107
  p(
1108
- c,
1108
+ d,
1109
1109
  null,
1110
1110
  {
1111
1111
  default: h(() => [
@@ -1131,7 +1131,7 @@ function Gt(i, t, o, e, s, n) {
1131
1131
  /* DYNAMIC_SLOTS */
1132
1132
  ),
1133
1133
  p(
1134
- c,
1134
+ d,
1135
1135
  { class: "d-flex justify-end align-center" },
1136
1136
  {
1137
1137
  default: h(() => [
@@ -1163,12 +1163,12 @@ function Gt(i, t, o, e, s, n) {
1163
1163
  /* DYNAMIC_SLOTS */
1164
1164
  ),
1165
1165
  p(
1166
- r,
1166
+ l,
1167
1167
  { "no-gutters": "" },
1168
1168
  {
1169
1169
  default: h(() => [
1170
1170
  p(
1171
- c,
1171
+ d,
1172
1172
  null,
1173
1173
  {
1174
1174
  default: h(() => [
@@ -1176,11 +1176,11 @@ function Gt(i, t, o, e, s, n) {
1176
1176
  id: a,
1177
1177
  class: "pa-0",
1178
1178
  "model-value": T,
1179
- "onUpdate:modelValue": (v) => e.setParameter(a, v),
1179
+ "onUpdate:modelValue": (v) => t.setParameter(a, v),
1180
1180
  type: "number",
1181
1181
  step: "1",
1182
- min: e.parameterRanges[a][0],
1183
- max: e.parameterRanges[a][1]
1182
+ min: t.parameterRanges[a][0],
1183
+ max: t.parameterRanges[a][1]
1184
1184
  }, null, 8, ["id", "model-value", "onUpdate:modelValue", "min", "max"])
1185
1185
  ]),
1186
1186
  _: 2
@@ -1217,16 +1217,16 @@ function Gt(i, t, o, e, s, n) {
1217
1217
  _: 1
1218
1218
  /* STABLE */
1219
1219
  })) : H("v-if", !0),
1220
- p(g),
1221
- e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (M(), B("div", Ht, [
1220
+ p(_),
1221
+ t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), B("div", Ht, [
1222
1222
  p(L, {
1223
- onClick: t[0] || (t[0] = (T) => e.addToMyWorkspace()),
1223
+ onClick: e[0] || (e[0] = (T) => t.addToMyWorkspace()),
1224
1224
  tooltip: "viewshed.addToMyWorkspace",
1225
1225
  icon: "$vcsComponentsPlus",
1226
- disabled: e.currentIsPersisted || void 0
1226
+ disabled: t.currentIsPersisted || void 0
1227
1227
  }, null, 8, ["disabled"]),
1228
1228
  p(L, {
1229
- onClick: t[1] || (t[1] = (T) => e.createNewViewshed()),
1229
+ onClick: e[1] || (e[1] = (T) => t.createNewViewshed()),
1230
1230
  variant: "filled"
1231
1231
  }, {
1232
1232
  default: h(() => [
@@ -1239,9 +1239,9 @@ function Gt(i, t, o, e, s, n) {
1239
1239
  _: 1
1240
1240
  /* STABLE */
1241
1241
  })
1242
- ])) : e.viewshedMode === e.ViewshedPluginModes.CREATE ? (M(), B("div", zt, [
1242
+ ])) : t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", zt, [
1243
1243
  p(L, {
1244
- onClick: t[2] || (t[2] = (T) => e.cancel()),
1244
+ onClick: e[2] || (e[2] = (T) => t.cancel()),
1245
1245
  variant: "outlined"
1246
1246
  }, {
1247
1247
  default: h(() => [
@@ -1257,146 +1257,166 @@ function Gt(i, t, o, e, s, n) {
1257
1257
  ])) : H("v-if", !0)
1258
1258
  ]);
1259
1259
  }
1260
- const Kt = /* @__PURE__ */ Se(jt, [["render", Gt]]), j = "@vcmap/viewshed", Yt = "3.0.3", Xt = "^6.0", ne = {
1261
- [w.CONE]: "$vcsViewshed",
1262
- [w.THREESIXTY]: "$vcsViewshedCone"
1260
+ const Kt = /* @__PURE__ */ Oe(jt, [["render", Gt]]), j = "@vcmap/viewshed", Yt = "3.0.5", Xt = "^6.0", ne = {
1261
+ [g.CONE]: "$vcsViewshed",
1262
+ [g.THREESIXTY]: "$vcsViewshedCone"
1263
1263
  };
1264
- function Jt(i, t, o) {
1265
- const e = U(), s = U(), n = `${o.id}-editor`, d = {
1264
+ function Jt(i, e, o) {
1265
+ const t = $(), s = $(), n = `${o.id}-editor`, r = {
1266
1266
  component: Kt,
1267
1267
  provides: {
1268
1268
  manager: i
1269
1269
  },
1270
1270
  state: {
1271
- headerTitle: e,
1271
+ headerTitle: t,
1272
1272
  headerIcon: s,
1273
1273
  styles: { width: "280px", height: "auto" },
1274
- infoUrlCallback: t.getHelpUrlCallback("tools/viewshed.html")
1274
+ infoUrlCallback: e.getHelpUrlCallback("tools/viewshed.html")
1275
1275
  }
1276
1276
  };
1277
- ht(t, o, {
1277
+ ft(e, o, {
1278
1278
  editor: (m) => ({
1279
- ...d,
1279
+ ...r,
1280
1280
  props: {
1281
1281
  selection: o.selection,
1282
1282
  getViewshed: () => o.collection.getByKey(m.name)
1283
1283
  }
1284
1284
  })
1285
1285
  });
1286
- function r() {
1287
- i.currentViewshed.value && (s.value = ne[i.currentViewshed.value.type], i.currentIsPersisted.value ? e.value = i.currentViewshed.value.properties.title : i.mode.value === E.CREATE ? e.value = `viewshed.create.${i.currentViewshed.value.type}` : e.value = [
1286
+ function l() {
1287
+ i.currentViewshed.value && (s.value = ne[i.currentViewshed.value.type], i.currentIsPersisted.value ? t.value = i.currentViewshed.value.properties.title : i.mode.value === E.CREATE ? t.value = `viewshed.create.${i.currentViewshed.value.type}` : t.value = [
1288
1288
  "viewshed.temporary",
1289
1289
  `viewshed.${i.currentViewshed.value.type}`
1290
1290
  ]);
1291
1291
  }
1292
- function l() {
1293
- r(), i.currentViewshed.value && !i.currentIsPersisted.value && (i.mode.value === E.EDIT || i.mode.value === E.MOVE || i.mode.value === E.CREATE) && (t.windowManager.has(n) || t.windowManager.add(
1292
+ function w() {
1293
+ l(), i.currentViewshed.value && !i.currentIsPersisted.value && (i.mode.value === E.EDIT || i.mode.value === E.MOVE || i.mode.value === E.CREATE) && (e.windowManager.has(n) || e.windowManager.add(
1294
1294
  {
1295
- ...d,
1295
+ ...r,
1296
1296
  id: n,
1297
1297
  parentId: "category-manager",
1298
- slot: ft.DYNAMIC_CHILD
1298
+ slot: mt.DYNAMIC_CHILD
1299
1299
  },
1300
1300
  j
1301
1301
  ));
1302
1302
  }
1303
- const _ = G(i.currentViewshed, (m) => {
1303
+ const c = G(i.currentViewshed, (m) => {
1304
+ m && w();
1305
+ }), d = G(i.currentIsPersisted, (m) => {
1304
1306
  m && l();
1305
- }), c = G(i.currentIsPersisted, (m) => {
1306
- m && r();
1307
1307
  }), f = G(i.mode, () => {
1308
- i.mode.value ? l() : t.windowManager.remove(n);
1308
+ i.mode.value ? w() : e.windowManager.remove(n);
1309
1309
  });
1310
1310
  return {
1311
1311
  destroy() {
1312
- t.windowManager.remove(n), _(), f(), c();
1312
+ e.windowManager.remove(n), c(), f(), d();
1313
1313
  }
1314
1314
  };
1315
1315
  }
1316
- function Zt(i, t, o, e) {
1317
- const s = {
1318
- type: mt.SELECT,
1319
- action: ee({
1320
- name: o,
1321
- currentIndex: 0,
1322
- active: !1,
1323
- background: !1,
1324
- disabled: !(i.maps.activeMap instanceof $),
1325
- callback() {
1326
- if (this.active)
1327
- this.background && t.currentViewshed.value ? t.editViewshed(t.currentViewshed.value) : t.stop();
1328
- else {
1329
- const l = this.tools[this.currentIndex].name;
1330
- t.createViewshed(l);
1316
+ function Zt(i, e, o, t) {
1317
+ function s(c) {
1318
+ return c === g.CONE ? {
1319
+ name: g.CONE,
1320
+ icon: ne[g.CONE],
1321
+ title: `viewshed.create.${g.CONE}`
1322
+ } : c === g.THREESIXTY ? {
1323
+ name: g.THREESIXTY,
1324
+ icon: ne[g.THREESIXTY],
1325
+ title: `viewshed.create.${g.THREESIXTY}`
1326
+ } : void 0;
1327
+ }
1328
+ let n, r;
1329
+ if (t.length === 1) {
1330
+ const c = s(t[0]);
1331
+ n = {
1332
+ type: ge.SINGLE,
1333
+ action: J({
1334
+ ...c,
1335
+ active: !1,
1336
+ background: !1,
1337
+ disabled: !(i.maps.activeMap instanceof U),
1338
+ callback() {
1339
+ this.active ? this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop() : e.createViewshed(c.name);
1331
1340
  }
1332
- },
1333
- selected(l) {
1334
- l !== this.currentIndex && (this.currentIndex = l);
1335
- const _ = this.tools[this.currentIndex].name;
1336
- t.createViewshed(_);
1337
- },
1338
- tools: e.flatMap((l) => l === w.CONE ? {
1339
- name: w.CONE,
1340
- icon: ne[w.CONE],
1341
- title: `viewshed.create.${w.CONE}`
1342
- } : l === w.THREESIXTY ? {
1343
- name: w.THREESIXTY,
1344
- icon: ne[w.THREESIXTY],
1345
- title: `viewshed.create.${w.THREESIXTY}`
1346
- } : [])
1347
- })
1348
- }, n = G(t.mode, (l) => {
1349
- l === E.VIEW ? (s.action.background = !0, s.action.active = !0) : l ? (s.action.background = !1, s.action.active = !0) : (s.action.background = !1, s.action.active = !1);
1350
- }), d = G(
1351
- t.currentViewshed,
1352
- (l) => {
1353
- l && (s.action.currentIndex = s.action.tools.findIndex(
1354
- (_) => _.name === l.type
1355
- ));
1356
- }
1357
- ), r = i.maps.mapActivated.addEventListener((l) => {
1358
- l instanceof $ ? s.action.disabled = !1 : s.action.disabled = !0;
1341
+ })
1342
+ };
1343
+ } else
1344
+ n = {
1345
+ type: ge.SELECT,
1346
+ action: J({
1347
+ name: o,
1348
+ currentIndex: 0,
1349
+ active: !1,
1350
+ background: !1,
1351
+ disabled: !(i.maps.activeMap instanceof U),
1352
+ callback() {
1353
+ if (this.active)
1354
+ this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop();
1355
+ else {
1356
+ const c = this.tools[this.currentIndex].name;
1357
+ e.createViewshed(c);
1358
+ }
1359
+ },
1360
+ selected(c) {
1361
+ c !== this.currentIndex && (this.currentIndex = c);
1362
+ const d = this.tools[this.currentIndex].name;
1363
+ e.createViewshed(d);
1364
+ },
1365
+ tools: t.flatMap(s)
1366
+ })
1367
+ }, r = G(
1368
+ e.currentViewshed,
1369
+ (c) => {
1370
+ c && (n.action.currentIndex = n.action.tools.findIndex(
1371
+ (d) => d.name === c.type
1372
+ ));
1373
+ }
1374
+ );
1375
+ const l = G(e.mode, (c) => {
1376
+ c === E.VIEW ? (n.action.background = !0, n.action.active = !0) : c ? (n.action.background = !1, n.action.active = !0) : (n.action.background = !1, n.action.active = !1);
1377
+ }), w = i.maps.mapActivated.addEventListener((c) => {
1378
+ c instanceof U ? n.action.disabled = !1 : n.action.disabled = !0;
1359
1379
  });
1360
1380
  return {
1361
1381
  destroy() {
1362
- n(), d(), r();
1382
+ l(), r == null || r(), w();
1363
1383
  },
1364
- toolbox: s
1384
+ toolbox: n
1365
1385
  };
1366
1386
  }
1367
- function qt(i, t, o, e) {
1368
- le(e, [Pt(w)]);
1369
- const { toolbox: s, destroy: n } = Zt(i, t, o, e), d = i.toolboxManager.add(s, o).id;
1387
+ function qt(i, e, o, t) {
1388
+ le(t, [Pt(g)]);
1389
+ const { toolbox: s, destroy: n } = Zt(i, e, o, t), r = i.toolboxManager.add(s, o).id;
1370
1390
  return () => {
1371
- i.toolboxManager.remove(d), n();
1391
+ i.toolboxManager.remove(r), n();
1372
1392
  };
1373
1393
  }
1374
- class ae extends Ue {
1394
+ class ae extends $e {
1375
1395
  static get className() {
1376
1396
  return "ViewshedCategory";
1377
1397
  }
1378
- async _deserializeItem(t) {
1379
- var e;
1398
+ async _deserializeItem(e) {
1399
+ var t;
1380
1400
  if (
1381
1401
  /** @type {import("@vcmap/core").CesiumMap | undefined} */
1382
- (e = this._app) == null ? void 0 : e.maps.getByType($.className)[0]
1402
+ (t = this._app) == null ? void 0 : t.maps.getByType(U.className)[0]
1383
1403
  )
1384
- return new D(t);
1404
+ return new D(e);
1385
1405
  throw new Error("No CesiumMap available");
1386
1406
  }
1387
1407
  }
1388
- function Qt(i, t) {
1389
- let o, e = 0;
1408
+ function Qt(i, e) {
1409
+ let o, t = 0;
1390
1410
  const s = new Set(
1391
- t.filter((n) => n.type === i).map((n) => n.properties.title)
1411
+ e.filter((n) => n.type === i).map((n) => n.properties.title)
1392
1412
  );
1393
1413
  do
1394
- e += 1, s.has(`${i}-${e}`) || (o = `${i}-${e}`);
1414
+ t += 1, s.has(`${i}-${t}`) || (o = `${i}-${t}`);
1395
1415
  while (!o);
1396
1416
  return o;
1397
1417
  }
1398
1418
  async function ei(i) {
1399
- const t = new X(), o = new X(), { collectionComponent: e, category: s } = await i.categoryManager.requestCategory(
1419
+ const e = new X(), o = new X(), { collectionComponent: t, category: s } = await i.categoryManager.requestCategory(
1400
1420
  {
1401
1421
  type: ae.className,
1402
1422
  name: "Viewsheds",
@@ -1409,22 +1429,22 @@ async function ei(i) {
1409
1429
  removable: !0
1410
1430
  }
1411
1431
  );
1412
- e.addItemMapping({
1432
+ t.addItemMapping({
1413
1433
  mappingFunction: vt(
1414
- [$.className],
1434
+ [U.className],
1415
1435
  i.maps
1416
1436
  ),
1417
1437
  owner: j
1418
1438
  });
1419
- const n = (c, f, m) => {
1420
- m.title = c.properties.title, m.titleChanged = (g) => {
1421
- c.properties.title = g, m.title = g, t.raiseEvent({ item: c, title: g });
1439
+ const n = (d, f, m) => {
1440
+ m.title = d.properties.title, m.titleChanged = (_) => {
1441
+ d.properties.title = _, m.title = _, e.raiseEvent({ item: d, title: _ });
1422
1442
  }, m.actions.push(
1423
- ee({
1443
+ J({
1424
1444
  name: "visibilityAction",
1425
1445
  icon: "$vcsCheckbox",
1426
1446
  callback() {
1427
- o.raiseEvent(c);
1447
+ o.raiseEvent(d);
1428
1448
  }
1429
1449
  })
1430
1450
  );
@@ -1433,27 +1453,27 @@ async function ei(i) {
1433
1453
  () => !0,
1434
1454
  n,
1435
1455
  j,
1436
- [e.id]
1456
+ [t.id]
1437
1457
  );
1438
- const { action: d, destroy: r } = pt(
1439
- e.selection,
1458
+ const { action: r, destroy: l } = pt(
1459
+ t.selection,
1440
1460
  () => {
1441
- const c = e.selection.value.map(
1442
- (f) => e.collection.getByKey(f.name)
1461
+ const d = t.selection.value.map(
1462
+ (f) => t.collection.getByKey(f.name)
1443
1463
  );
1444
- wt(JSON.stringify(c), "viewsheds.json");
1464
+ wt(JSON.stringify(d), "viewsheds.json");
1445
1465
  },
1446
1466
  j
1447
- ), { action: l, destroy: _ } = gt(
1448
- async (c) => {
1449
- const { vueI18n: f } = i, g = (await Promise.all(
1450
- c.map(async (S) => {
1467
+ ), { action: w, destroy: c } = gt(
1468
+ async (d) => {
1469
+ const { vueI18n: f } = i, _ = (await Promise.all(
1470
+ d.map(async (S) => {
1451
1471
  const L = await S.text();
1452
1472
  try {
1453
1473
  return JSON.parse(L).map((a) => new D(a));
1454
1474
  } catch {
1455
1475
  i.notifier.add({
1456
- type: J.ERROR,
1476
+ type: Z.ERROR,
1457
1477
  message: f.t("components.import.failure", {
1458
1478
  fileName: S.name
1459
1479
  })
@@ -1461,22 +1481,22 @@ async function ei(i) {
1461
1481
  }
1462
1482
  return [];
1463
1483
  })
1464
- )).flat(), y = g.map((S) => s.collection.add(S)).filter((S) => S != null), k = g.length - y.length;
1465
- if (k > 0)
1484
+ )).flat(), y = _.map((S) => s.collection.add(S)).filter((S) => S != null), x = _.length - y.length;
1485
+ if (x > 0)
1466
1486
  return i.notifier.add({
1467
- type: J.WARNING,
1468
- message: f.t("components.import.addFailure", [k])
1487
+ type: Z.WARNING,
1488
+ message: f.t("components.import.addFailure", [x])
1469
1489
  }), !1;
1470
1490
  if (y.length > 0)
1471
1491
  i.notifier.add({
1472
- type: J.SUCCESS,
1492
+ type: Z.SUCCESS,
1473
1493
  message: f.t("components.import.featuresAdded", [
1474
1494
  y.length
1475
1495
  ])
1476
1496
  });
1477
1497
  else
1478
1498
  return i.notifier.add({
1479
- type: J.ERROR,
1499
+ type: Z.ERROR,
1480
1500
  message: f.t("components.import.nothingAdded")
1481
1501
  }), !1;
1482
1502
  return !0;
@@ -1485,62 +1505,62 @@ async function ei(i) {
1485
1505
  j,
1486
1506
  "category-manager"
1487
1507
  );
1488
- return e.addActions([d, l]), {
1489
- renamed: t,
1508
+ return t.addActions([r, w]), {
1509
+ renamed: e,
1490
1510
  visibilityChanged: o,
1491
- setSelection(c) {
1492
- c && (e.selection.value = e.items.value.filter((f) => c === f.name));
1511
+ setSelection(d) {
1512
+ d && (t.selection.value = t.items.value.filter((f) => d === f.name));
1493
1513
  },
1494
1514
  clearSelection() {
1495
- e.selection.value.length && (e.selection.value = []);
1515
+ t.selection.value.length && (t.selection.value = []);
1496
1516
  },
1497
- setVisibility(c, f) {
1498
- const m = e.items.value.find(
1499
- (g) => c === g.name
1517
+ setVisibility(d, f) {
1518
+ const m = t.items.value.find(
1519
+ (_) => d === _.name
1500
1520
  );
1501
1521
  if (m) {
1502
- const g = m.actions.find(
1522
+ const _ = m.actions.find(
1503
1523
  (y) => y.name === "visibilityAction"
1504
1524
  );
1505
- g && (g.icon = f ? "$vcsCheckboxChecked" : "$vcsCheckbox");
1525
+ _ && (_.icon = f ? "$vcsCheckboxChecked" : "$vcsCheckbox");
1506
1526
  }
1507
1527
  },
1508
- add(c) {
1509
- c.properties.title = Qt(
1510
- c.type,
1528
+ add(d) {
1529
+ d.properties.title = Qt(
1530
+ d.type,
1511
1531
  /** @type {import("./viewshed.js").default[]} */
1512
1532
  [
1513
1533
  ...s.collection
1514
1534
  ]
1515
- ), s.collection.add(c);
1535
+ ), s.collection.add(d);
1516
1536
  },
1517
- remove(c) {
1518
- const f = s.collection.getByKey(c);
1537
+ remove(d) {
1538
+ const f = s.collection.getByKey(d);
1519
1539
  f && s.collection.remove(f);
1520
1540
  },
1521
- collectionComponent: e,
1541
+ collectionComponent: t,
1522
1542
  destroy() {
1523
- i.categoryManager.removeOwner(j), t.destroy(), o.destroy(), r(), _();
1543
+ i.categoryManager.removeOwner(j), e.destroy(), o.destroy(), l(), c();
1524
1544
  }
1525
1545
  };
1526
1546
  }
1527
- function q() {
1547
+ function Q() {
1528
1548
  return {
1529
1549
  visibleColor: D.getDefaultOptions().visibleColor,
1530
1550
  shadowColor: D.getDefaultOptions().shadowColor,
1531
- tools: [...Object.values(w)]
1551
+ tools: [...Object.values(g)]
1532
1552
  };
1533
1553
  }
1534
1554
  const ti = {
1535
1555
  name: "ViewshedConfigEditor",
1536
1556
  components: {
1537
1557
  AbstractConfigEditor: _t,
1538
- VcsFormSection: Ce,
1539
- VContainer: ye,
1540
- VRow: Ve,
1541
- VCol: be,
1542
- VcsLabel: _e,
1543
- VcsSelect: Ee,
1558
+ VcsFormSection: Ee,
1559
+ VContainer: Ve,
1560
+ VRow: be,
1561
+ VCol: Me,
1562
+ VcsLabel: Ce,
1563
+ VcsSelect: ye,
1544
1564
  VColorPicker: Et
1545
1565
  },
1546
1566
  props: {
@@ -1554,37 +1574,37 @@ const ti = {
1554
1574
  }
1555
1575
  },
1556
1576
  setup(i) {
1557
- const t = i.getConfig(), o = U({ ...q(), ...t });
1558
- function e() {
1577
+ const e = i.getConfig(), o = $({ ...Q(), ...e });
1578
+ function t() {
1559
1579
  i.setConfig(o.value);
1560
1580
  }
1561
1581
  return {
1562
1582
  localConfig: o,
1563
- ViewshedTypes: w,
1564
- apply: e,
1565
- toolItems: Object.values(w).map((s) => ({
1583
+ ViewshedTypes: g,
1584
+ apply: t,
1585
+ toolItems: Object.values(g).map((s) => ({
1566
1586
  value: s,
1567
1587
  title: `viewshed.${s}`
1568
1588
  }))
1569
1589
  };
1570
1590
  }
1571
1591
  };
1572
- function ii(i, t, o, e, s, n) {
1573
- const d = b("VcsLabel"), r = b("v-col"), l = b("VcsSelect"), _ = b("v-row"), c = b("VColorPicker"), f = b("v-container"), m = b("VcsFormSection"), g = b("AbstractConfigEditor");
1574
- return M(), N(g, it({ onSubmit: e.apply }, { ...i.$attrs, ...i.$props }), {
1592
+ function ii(i, e, o, t, s, n) {
1593
+ const r = b("VcsLabel"), l = b("v-col"), w = b("VcsSelect"), c = b("v-row"), d = b("VColorPicker"), f = b("v-container"), m = b("VcsFormSection"), _ = b("AbstractConfigEditor");
1594
+ return M(), N(_, ot({ onSubmit: t.apply }, { ...i.$attrs, ...i.$props }), {
1575
1595
  default: h(() => [
1576
- e.localConfig ? (M(), N(m, {
1596
+ t.localConfig ? (M(), N(m, {
1577
1597
  key: 0,
1578
1598
  heading: "viewshed.editor.general"
1579
1599
  }, {
1580
1600
  default: h(() => [
1581
1601
  p(f, { class: "px-1 py-0" }, {
1582
1602
  default: h(() => [
1583
- p(_, { "no-gutters": "" }, {
1603
+ p(c, { "no-gutters": "" }, {
1584
1604
  default: h(() => [
1585
- p(r, null, {
1605
+ p(l, null, {
1586
1606
  default: h(() => [
1587
- p(d, { "html-for": "viewshed-editor-tools" }, {
1607
+ p(r, { "html-for": "viewshed-editor-tools" }, {
1588
1608
  default: h(() => [
1589
1609
  F(
1590
1610
  A(i.$t("viewshed.editor.tools")),
@@ -1599,13 +1619,13 @@ function ii(i, t, o, e, s, n) {
1599
1619
  _: 1
1600
1620
  /* STABLE */
1601
1621
  }),
1602
- p(r, null, {
1622
+ p(l, null, {
1603
1623
  default: h(() => [
1604
- p(l, {
1624
+ p(w, {
1605
1625
  id: "viewshed-tools",
1606
- items: e.toolItems,
1607
- modelValue: e.localConfig.tools,
1608
- "onUpdate:modelValue": t[0] || (t[0] = (y) => e.localConfig.tools = y),
1626
+ items: t.toolItems,
1627
+ modelValue: t.localConfig.tools,
1628
+ "onUpdate:modelValue": e[0] || (e[0] = (y) => t.localConfig.tools = y),
1609
1629
  multiple: !0
1610
1630
  }, null, 8, ["items", "modelValue"])
1611
1631
  ]),
@@ -1616,11 +1636,11 @@ function ii(i, t, o, e, s, n) {
1616
1636
  _: 1
1617
1637
  /* STABLE */
1618
1638
  }),
1619
- p(_, { "no-gutters": "" }, {
1639
+ p(c, { "no-gutters": "" }, {
1620
1640
  default: h(() => [
1621
- p(r, null, {
1641
+ p(l, null, {
1622
1642
  default: h(() => [
1623
- p(d, { "html-for": "viewshed-editor-visible-color" }, {
1643
+ p(r, { "html-for": "viewshed-editor-visible-color" }, {
1624
1644
  default: h(() => [
1625
1645
  F(
1626
1646
  A(i.$t("viewshed.editor.visibleColor")),
@@ -1635,11 +1655,11 @@ function ii(i, t, o, e, s, n) {
1635
1655
  _: 1
1636
1656
  /* STABLE */
1637
1657
  }),
1638
- p(r, null, {
1658
+ p(l, null, {
1639
1659
  default: h(() => [
1640
- p(c, {
1641
- modelValue: e.localConfig.visibleColor,
1642
- "onUpdate:modelValue": t[1] || (t[1] = (y) => e.localConfig.visibleColor = y),
1660
+ p(d, {
1661
+ modelValue: t.localConfig.visibleColor,
1662
+ "onUpdate:modelValue": e[1] || (e[1] = (y) => t.localConfig.visibleColor = y),
1643
1663
  mode: "rgba"
1644
1664
  }, null, 8, ["modelValue"])
1645
1665
  ]),
@@ -1650,11 +1670,11 @@ function ii(i, t, o, e, s, n) {
1650
1670
  _: 1
1651
1671
  /* STABLE */
1652
1672
  }),
1653
- p(_, { "no-gutters": "" }, {
1673
+ p(c, { "no-gutters": "" }, {
1654
1674
  default: h(() => [
1655
- p(r, null, {
1675
+ p(l, null, {
1656
1676
  default: h(() => [
1657
- p(d, { "html-for": "viewshed-editor-shadow-color" }, {
1677
+ p(r, { "html-for": "viewshed-editor-shadow-color" }, {
1658
1678
  default: h(() => [
1659
1679
  F(
1660
1680
  A(i.$t("viewshed.editor.shadowColor")),
@@ -1669,11 +1689,11 @@ function ii(i, t, o, e, s, n) {
1669
1689
  _: 1
1670
1690
  /* STABLE */
1671
1691
  }),
1672
- p(r, null, {
1692
+ p(l, null, {
1673
1693
  default: h(() => [
1674
- p(c, {
1675
- modelValue: e.localConfig.shadowColor,
1676
- "onUpdate:modelValue": t[2] || (t[2] = (y) => e.localConfig.shadowColor = y),
1694
+ p(d, {
1695
+ modelValue: t.localConfig.shadowColor,
1696
+ "onUpdate:modelValue": e[2] || (e[2] = (y) => t.localConfig.shadowColor = y),
1677
1697
  mode: "rgba"
1678
1698
  }, null, 8, ["modelValue"])
1679
1699
  ]),
@@ -1697,9 +1717,9 @@ function ii(i, t, o, e, s, n) {
1697
1717
  /* STABLE */
1698
1718
  }, 16, ["onSubmit"]);
1699
1719
  }
1700
- const oi = /* @__PURE__ */ Se(ti, [["render", ii]]);
1720
+ const oi = /* @__PURE__ */ Oe(ti, [["render", ii]]);
1701
1721
  function ui(i) {
1702
- let t, o, e = () => {
1722
+ let e, o, t = () => {
1703
1723
  };
1704
1724
  return {
1705
1725
  get name() {
@@ -1718,55 +1738,55 @@ function ui(i) {
1718
1738
  */
1719
1739
  async initialize(s, n) {
1720
1740
  o = s, s.categoryClassRegistry.registerClass(
1721
- this[$e],
1741
+ this[He],
1722
1742
  ae.className,
1723
1743
  ae
1724
1744
  );
1725
- const d = await ei(s);
1726
- t = Lt(
1745
+ const r = await ei(s);
1746
+ e = Lt(
1727
1747
  s,
1728
1748
  i,
1729
- d
1749
+ r
1730
1750
  );
1731
- const r = qt(
1751
+ const l = qt(
1732
1752
  s,
1733
- t,
1753
+ e,
1734
1754
  j,
1735
- i.tools || q().tools
1736
- ), { destroy: l } = Jt(
1737
- t,
1755
+ i.tools || Q().tools
1756
+ ), { destroy: w } = Jt(
1757
+ e,
1738
1758
  s,
1739
- d.collectionComponent
1740
- ), { activeMap: _ } = s.maps;
1741
- function c(g) {
1742
- if (n != null && n.m && n.cv && g instanceof $) {
1759
+ r.collectionComponent
1760
+ ), { activeMap: c } = s.maps;
1761
+ function d(_) {
1762
+ if (n != null && n.m && n.cv && _ instanceof U) {
1743
1763
  const y = new D(n.cv);
1744
- n.m === E.VIEW ? t.viewViewshed(y) : t.editViewshed(y);
1764
+ n.m === E.VIEW ? e.viewViewshed(y) : e.editViewshed(y);
1745
1765
  }
1746
1766
  }
1747
1767
  let f = !1;
1748
- _ && (f = !0, c(_));
1768
+ c && (f = !0, d(c));
1749
1769
  const m = s.maps.mapActivated.addEventListener(
1750
- (g) => {
1751
- t.stop(), f || (c(g), f = !0);
1770
+ (_) => {
1771
+ e.stop(), f || (d(_), f = !0);
1752
1772
  }
1753
1773
  );
1754
- e = () => {
1755
- m(), r(), l(), d.destroy(), t.destroy();
1774
+ t = () => {
1775
+ m(), l(), w(), r.destroy(), e.destroy();
1756
1776
  };
1757
1777
  },
1758
1778
  /**
1759
1779
  * should return all default values of the configuration
1760
1780
  * @returns {ViewshedPluginOptions}
1761
1781
  */
1762
- getDefaultOptions: q,
1782
+ getDefaultOptions: Q,
1763
1783
  /**
1764
1784
  * should return the plugin's serialization excluding all default values
1765
1785
  * @returns {ViewshedPluginOptions}
1766
1786
  */
1767
1787
  toJSON() {
1768
1788
  const s = {};
1769
- return i.tools && q().tools.length !== i.tools.length && (s.tools = [...i.tools]), i.shadowColor && i.shadowColor !== D.getDefaultOptions().shadowColor && (s.shadowColor = i.shadowColor), i.visibleColor && i.visibleColor !== D.getDefaultOptions().visibleColor && (s.visibleColor = i.visibleColor), s;
1789
+ return i.tools && Q().tools.length !== i.tools.length && (s.tools = [...i.tools]), i.shadowColor && i.shadowColor !== D.getDefaultOptions().shadowColor && (s.shadowColor = i.shadowColor), i.visibleColor && i.visibleColor !== D.getDefaultOptions().visibleColor && (s.visibleColor = i.visibleColor), s;
1770
1790
  },
1771
1791
  /**
1772
1792
  * should return the plugins state
@@ -1774,9 +1794,9 @@ function ui(i) {
1774
1794
  * @returns {ViewshedPluginState}
1775
1795
  */
1776
1796
  getState(s) {
1777
- var l, _;
1778
- const n = {}, d = t.mode.value, r = (l = t.currentViewshed.value) == null ? void 0 : l.toJSON();
1779
- return d !== null && d !== "create" && r && (n.m = d, n.cv = r, s && ((_ = n.cv.properties) != null && _.title) && (Object.keys(n.properties).length === 1 ? delete n.cv.properties : delete n.cv.properties.title)), n;
1797
+ var w, c;
1798
+ const n = {}, r = e.mode.value, l = (w = e.currentViewshed.value) == null ? void 0 : w.toJSON();
1799
+ return r !== null && r !== "create" && l && (n.m = r, n.cv = l, s && ((c = n.cv.properties) != null && c.title) && (Object.keys(n.properties).length === 1 ? delete n.cv.properties : delete n.cv.properties.title)), n;
1780
1800
  },
1781
1801
  /**
1782
1802
  * components for configuring the plugin and/ or custom items defined by the plugin
@@ -1794,7 +1814,7 @@ function ui(i) {
1794
1814
  }
1795
1815
  ];
1796
1816
  },
1797
- destroy: () => e(),
1817
+ destroy: () => t(),
1798
1818
  i18n: {
1799
1819
  en: {
1800
1820
  viewshed: {
@@ -1811,11 +1831,11 @@ function ui(i) {
1811
1831
  absolute: "Absolute",
1812
1832
  new: "New",
1813
1833
  cancel: "Cancel",
1814
- [w.CONE]: "Cone viewshed analysis",
1815
- [w.THREESIXTY]: "360° viewshed analysis",
1834
+ [g.CONE]: "Cone viewshed analysis",
1835
+ [g.THREESIXTY]: "360° viewshed analysis",
1816
1836
  create: {
1817
- [w.CONE]: "Create cone viewshed analysis",
1818
- [w.THREESIXTY]: "Create 360° viewshed analysis"
1837
+ [g.CONE]: "Create cone viewshed analysis",
1838
+ [g.THREESIXTY]: "Create 360° viewshed analysis"
1819
1839
  },
1820
1840
  addToMyWorkspace: "Add to My Workspace",
1821
1841
  temporary: "Temporary",
@@ -1849,11 +1869,11 @@ function ui(i) {
1849
1869
  absolute: "Absolut",
1850
1870
  new: "Neu",
1851
1871
  cancel: "Abbrechen",
1852
- [w.CONE]: "Sichtkegelanalyse",
1853
- [w.THREESIXTY]: "360° Sichtsanalyse",
1872
+ [g.CONE]: "Sichtkegelanalyse",
1873
+ [g.THREESIXTY]: "360° Sichtsanalyse",
1854
1874
  create: {
1855
- [w.CONE]: "Sichtkegelanalyse erstellen",
1856
- [w.THREESIXTY]: "360° Sichtanalyse erstellen"
1875
+ [g.CONE]: "Sichtkegelanalyse erstellen",
1876
+ [g.THREESIXTY]: "360° Sichtanalyse erstellen"
1857
1877
  },
1858
1878
  addToMyWorkspace: "Zu Mein Arbeitsbereich hinzufügen",
1859
1879
  temporary: "Temporäre",