@giro3d/piero 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,76 +1,175 @@
1
- var Ie = Object.defineProperty;
2
- var Se = (a, t, e) => t in a ? Ie(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var p = (a, t, e) => Se(a, typeof t != "symbol" ? t + "" : t, e);
4
- import { V as j, J as ue, i as de, $ as se, F as A, s as Te, P as Ee, o as X, n as pe, j as G, G as me, f as ee, M as Fe, u as Me, q as Be, r as Le, L as oe, T as J, U as ke, _ as te, w as De, W as Ne, a0 as he, a1 as Ae, a2 as ze, a3 as Oe, b as z, C as fe, a4 as ie, a5 as Re, a6 as je, h as Ve } from "./Components.es.js";
5
- import { a7 as qn } from "./Components.es.js";
6
- import { ref as R, defineComponent as Y, createElementBlock as D, openBlock as k, createElementVNode as x, createVNode as N, unref as B, Fragment as ne, resolveComponent as Ue, createCommentVNode as W, createBlock as ae, normalizeClass as re, toDisplayString as $e, withCtx as le, renderList as ge, shallowRef as Ge, onMounted as Ye, onUnmounted as He } from "vue";
7
- import { defineStore as ye } from "pinia";
8
- import Z from "@giro3d/giro3d/core/geographic/Coordinates";
9
- import be, { isEntity3D as ve } from "@giro3d/giro3d/entities/Entity3D";
10
- import { HttpError as We } from "@giro3d/giro3d/utils/Fetcher";
11
- import qe from "@giro3d/giro3d/gui/EntityPanel";
12
- import { Components as Ze, SimpleScene as Je, SimpleRenderer as Xe, SimpleCamera as Qe, SimpleRaycaster as Ke, IfcPropertiesUtils as O, FragmentBoundingBox as et, FragmentManager as tt, FragmentClassifier as nt, FragmentIfcLoader as st, toCompositeID as ot, IfcCategoryMap as it } from "openbim-components";
13
- import at from "@giro3d/giro3d/gui/EntityInspector";
14
- import { Map as rt, View as lt } from "ol";
15
- import ct from "ol/layer/Tile";
16
- import { fromLonLat as ce } from "ol/proj";
17
- import { OSM as ut } from "ol/source";
18
- import dt from "@giro3d/giro3d/entities/PointCloud";
19
- import pt from "@giro3d/giro3d/sources/PotreeSource";
20
- import F from "shepherd.js";
21
- const _e = ye("crossSection", () => {
22
- const a = R(0), t = R(new j(0, 0, 0)), e = R(!1);
23
- function n(s) {
24
- e.value = s;
25
- }
26
- function o(s) {
27
- a.value = s;
28
- }
29
- function i(s) {
30
- t.value = s;
1
+ var Ce = Object.defineProperty;
2
+ var xe = (a, t, e) => t in a ? Ce(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var c = (a, t, e) => xe(a, typeof t != "symbol" ? t + "" : t, e);
4
+ import { K as Ie, a1 as se, P as Pe, V as F, I as q, O as Ee, a2 as K, a3 as ce, a4 as R, a5 as Se, i as J, a6 as oe, F as k, l as Te, t as $, G as ue, f as ee, M as Fe, n as ke, J as Me, a7 as Le, N as ie, U as W, W as De, _ as te, r as Be, X as Ne, a8 as de, a9 as Oe, aa as Ae, ab as ze, C as je, h as $e } from "./Components.es.js";
5
+ import { ac as Wn } from "./Components.es.js";
6
+ import { defineComponent as D, ref as I, createElementBlock as P, openBlock as v, createElementVNode as m, toDisplayString as pe, createCommentVNode as L, createBlock as V, shallowRef as Z, Fragment as Y, createVNode as T, unref as b, resolveComponent as He, normalizeClass as ae, withCtx as re, renderList as he, onMounted as Re, onUnmounted as Ve } from "vue";
7
+ import H from "@giro3d/giro3d/core/geographic/Coordinates";
8
+ import { defineStore as me } from "pinia";
9
+ import fe, { isEntity3D as ge } from "@giro3d/giro3d/entities/Entity3D";
10
+ import { HttpError as Ue } from "@giro3d/giro3d/utils/Fetcher";
11
+ import Ye from "@giro3d/giro3d/gui/EntityPanel";
12
+ import { Components as Ge, SimpleScene as We, SimpleRenderer as qe, SimpleCamera as Je, SimpleRaycaster as Ze, IfcPropertiesUtils as M, FragmentBoundingBox as Qe, FragmentManager as Xe, FragmentClassifier as Ke, FragmentIfcLoader as et, toCompositeID as tt, IfcCategoryMap as nt } from "openbim-components";
13
+ import st from "@giro3d/giro3d/gui/EntityInspector";
14
+ import { Map as ot, View as it } from "ol";
15
+ import at from "ol/layer/Tile";
16
+ import { fromLonLat as le } from "ol/proj";
17
+ import { OSM as rt } from "ol/source";
18
+ import lt from "@giro3d/giro3d/entities/PointCloud";
19
+ import ct from "@giro3d/giro3d/sources/PotreeSource";
20
+ import w from "shepherd.js";
21
+ const ut = { class: "input-group" }, dt = { class: "form-label" }, pt = { class: "input-group" }, ht = ["value"], mt = ["value"], ft = ["value"], gt = /* @__PURE__ */ D({
22
+ __name: "CoordinateInput",
23
+ props: {
24
+ cursorManager: {},
25
+ initialValue: {},
26
+ instance: {},
27
+ label: {},
28
+ showZ: { type: Boolean }
29
+ },
30
+ emits: ["update:coordinates"],
31
+ setup(a, { emit: t }) {
32
+ var g, C, _;
33
+ const e = a, n = I(((g = e.initialValue) == null ? void 0 : g.x) ?? 0), s = I(((C = e.initialValue) == null ? void 0 : C.y) ?? 0), o = I(((_ = e.initialValue) == null ? void 0 : _.z) ?? 0), i = t, l = new Pe(), d = I(!1), p = () => {
34
+ i(
35
+ "update:coordinates",
36
+ new H(se(e.instance).referenceCrs, n.value, s.value, o.value)
37
+ );
38
+ }, r = () => {
39
+ const y = se(e.instance);
40
+ d.value = !0;
41
+ const x = (G) => {
42
+ var B, N, O, ne;
43
+ const S = (N = (B = l.getFirstFeatureAt(y, G)) == null ? void 0 : B.at(0)) == null ? void 0 : N.point;
44
+ S && (n.value = S.x, s.value = S.y, o.value = S.z, (O = e.cursorManager) == null || O.setCursor("location"), (ne = e.cursorManager) == null || ne.setCursorLocation(S));
45
+ }, E = (G) => {
46
+ var B, N, O;
47
+ (B = e.cursorManager) == null || B.setCursor(null), y.domElement.removeEventListener("click", E), y.domElement.removeEventListener("mousemove", x), d.value = !1;
48
+ const S = (O = (N = l.getFirstFeatureAt(y, G)) == null ? void 0 : N.at(0)) == null ? void 0 : O.point;
49
+ S && (n.value = S.x, s.value = S.y, o.value = S.z, p());
50
+ };
51
+ y.domElement.addEventListener("mousemove", x), y.domElement.addEventListener("click", E);
52
+ };
53
+ function u(y) {
54
+ n.value = y, p();
55
+ }
56
+ function h(y) {
57
+ s.value = y, p();
58
+ }
59
+ function f(y) {
60
+ o.value = y, p();
61
+ }
62
+ return (y, x) => (v(), P("div", ut, [
63
+ m("label", dt, pe(e.label), 1),
64
+ m("div", pt, [
65
+ m("input", {
66
+ type: "number",
67
+ class: "form-control",
68
+ id: "plane-center-x",
69
+ value: n.value.toFixed(2),
70
+ onInput: x[0] || (x[0] = (E) => u(Number.parseFloat(E.target.value)))
71
+ }, null, 40, ht),
72
+ m("input", {
73
+ type: "number",
74
+ class: "form-control",
75
+ id: "plane-center-y",
76
+ value: s.value.toFixed(2),
77
+ onInput: x[1] || (x[1] = (E) => h(Number.parseFloat(E.target.value)))
78
+ }, null, 40, mt),
79
+ e.showZ === !0 ? (v(), P("input", {
80
+ key: 0,
81
+ type: "number",
82
+ class: "form-control",
83
+ id: "plane-center-z",
84
+ value: o.value.toFixed(2),
85
+ onInput: x[2] || (x[2] = (E) => f(Number.parseFloat(E.target.value)))
86
+ }, null, 40, ft)) : L("", !0),
87
+ e.instance != null ? (v(), V(Ie, {
88
+ key: 1,
89
+ title: "Pick point in scene",
90
+ icon: "fg-location",
91
+ disabled: d.value,
92
+ onClick: r,
93
+ class: "btn-primary"
94
+ }, null, 8, ["disabled"])) : L("", !0)
95
+ ])
96
+ ]));
97
+ }
98
+ }), ye = me("crossSection", () => {
99
+ const a = I(0), t = Z(), e = Z(), n = I(new F(0, 0, 0)), s = I(!1), o = I(!1);
100
+ function i(h) {
101
+ s.value = h;
102
+ }
103
+ function l(h) {
104
+ a.value = h;
105
+ }
106
+ function d(h) {
107
+ n.value = h;
108
+ }
109
+ function p(h) {
110
+ o.value = h;
111
+ }
112
+ function r(h) {
113
+ t.value = h;
114
+ }
115
+ function u(h) {
116
+ e.value = h;
31
117
  }
32
118
  return {
33
- center: t,
34
- enable: e,
119
+ center: n,
120
+ cursorManager: e,
121
+ enable: s,
122
+ instance: t,
35
123
  orientation: a,
36
- setCenter: i,
37
- setEnabled: n,
38
- setOrientation: o
124
+ setCenter: d,
125
+ setCursorManager: u,
126
+ setEnabled: i,
127
+ setInstance: r,
128
+ setOrientation: l,
129
+ setShowHelper: p,
130
+ showHelper: o
39
131
  };
40
- }), mt = { class: "input-group mb-3" }, ht = { class: "input-group mb-3" }, ft = ["value"], gt = { class: "input-group mb-3" }, yt = ["value"], bt = { class: "input-group" }, vt = { class: "input-group" }, _t = ["value"], wt = ["value"], xt = /* @__PURE__ */ Y({
132
+ }), yt = { class: "input-group" }, bt = { class: "input-group" }, vt = { class: "input-group my-3" }, _t = ["value"], wt = { class: "input-group mb-3" }, Ct = ["value"], xt = /* @__PURE__ */ D({
41
133
  __name: "CrossSection",
42
134
  setup(a) {
43
- const t = _e();
44
- function e(i) {
45
- t.setOrientation(i);
135
+ const t = ye();
136
+ function e(s) {
137
+ t.setOrientation(s);
46
138
  }
47
- function n(i) {
48
- const s = t.center.clone();
49
- s.setX(i), t.setCenter(s);
50
- }
51
- function o(i) {
52
- const s = t.center.clone();
53
- s.setY(i), t.setCenter(s);
54
- }
55
- return (i, s) => (k(), D("div", null, [
56
- x("div", mt, [
57
- N(ue, {
58
- "model-value": B(t).enable,
59
- "onUpdate:modelValue": s[0] || (s[0] = (l) => B(t).setEnabled(l)),
139
+ const n = (s) => {
140
+ t.setCenter(s.toVector3());
141
+ };
142
+ return (s, o) => (v(), P(Y, null, [
143
+ m("div", yt, [
144
+ T(q, {
145
+ "model-value": b(t).enable,
146
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => b(t).setEnabled(i)),
60
147
  id: "cross-section-enable",
61
- title: "foo"
148
+ title: "Enable cross-section"
62
149
  }, null, 8, ["model-value"]),
63
- s[5] || (s[5] = x("label", {
150
+ o[4] || (o[4] = m("label", {
64
151
  for: "cross-section-enable",
65
- class: "form-label"
152
+ class: "form-check-label"
66
153
  }, "Enable cross section", -1))
67
154
  ]),
68
- x("div", ht, [
69
- s[6] || (s[6] = x("label", {
155
+ m("div", bt, [
156
+ T(q, {
157
+ "model-value": b(t).showHelper,
158
+ "onUpdate:modelValue": o[1] || (o[1] = (i) => b(t).setShowHelper(i)),
159
+ id: "cross-section-helper-enable",
160
+ title: "Show plane helper"
161
+ }, null, 8, ["model-value"]),
162
+ o[5] || (o[5] = m("label", {
163
+ for: "cross-section-helper-enable",
164
+ class: "form-check-label"
165
+ }, "Show plane helper", -1))
166
+ ]),
167
+ m("div", vt, [
168
+ o[6] || (o[6] = m("label", {
70
169
  for: "plane-orientation-range",
71
- class: "form-label"
170
+ class: "form-check-label"
72
171
  }, "Plane orientation (0-360°)", -1)),
73
- x("input", {
172
+ m("input", {
74
173
  id: "plane-orientation-range",
75
174
  title: "Altitude",
76
175
  type: "range",
@@ -78,95 +177,116 @@ const _e = ye("crossSection", () => {
78
177
  min: "0",
79
178
  step: "0.1",
80
179
  max: "360",
81
- value: B(t).orientation,
82
- onInput: s[1] || (s[1] = (l) => e(Number.parseFloat(l.target.value)))
83
- }, null, 40, ft)
180
+ value: b(t).orientation,
181
+ onInput: o[2] || (o[2] = (i) => e(Number.parseFloat(i.target.value)))
182
+ }, null, 40, _t)
84
183
  ]),
85
- x("div", gt, [
86
- x("input", {
184
+ m("div", wt, [
185
+ m("input", {
87
186
  type: "number",
88
187
  class: "form-control",
89
188
  id: "plane-orientation-number",
90
189
  step: "0.1",
91
- value: B(t).orientation,
92
- onInput: s[2] || (s[2] = (l) => e(Number.parseFloat(l.target.value)))
93
- }, null, 40, yt)
190
+ value: b(t).orientation,
191
+ onInput: o[3] || (o[3] = (i) => e(Number.parseFloat(i.target.value)))
192
+ }, null, 40, Ct)
94
193
  ]),
95
- s[8] || (s[8] = x("hr", null, null, -1)),
96
- x("div", bt, [
97
- s[7] || (s[7] = x("label", { class: "form-label" }, "Center (x, y)", -1)),
98
- x("div", vt, [
99
- x("input", {
100
- type: "number",
101
- class: "form-control",
102
- id: "plane-center-x",
103
- value: B(t).center.x,
104
- onInput: s[3] || (s[3] = (l) => n(Number.parseFloat(l.target.value)))
105
- }, null, 40, _t),
106
- x("input", {
107
- type: "number",
108
- class: "form-control",
109
- id: "plane-center-y",
110
- value: B(t).center.y,
111
- onInput: s[4] || (s[4] = (l) => o(Number.parseFloat(l.target.value)))
112
- }, null, 40, wt)
113
- ])
114
- ])
115
- ]));
194
+ o[7] || (o[7] = m("hr", null, null, -1)),
195
+ b(t).instance != null ? (v(), V(gt, {
196
+ key: 0,
197
+ label: "Center",
198
+ "initial-value": b(t).center,
199
+ instance: b(t).instance,
200
+ "cursor-manager": b(t).cursorManager,
201
+ "onUpdate:coordinates": n
202
+ }, null, 8, ["initial-value", "instance", "cursor-manager"])) : L("", !0)
203
+ ], 64));
116
204
  }
117
205
  });
118
- class Ct {
206
+ class It extends Ee {
207
+ constructor() {
208
+ super();
209
+ const t = new K(
210
+ new ce(50, 100, 1, 10),
211
+ new R({
212
+ color: "#6bf904",
213
+ depthTest: !1,
214
+ depthWrite: !1,
215
+ wireframe: !0
216
+ })
217
+ ), e = new Se(new F(0, 1, 0), new F(0, 0, 0), 200);
218
+ t.renderOrder = 999, t.rotateY(Math.PI / 2), this.add(t), this.add(e), this.updateMatrixWorld(!0);
219
+ }
220
+ }
221
+ class Pt {
119
222
  constructor(t) {
120
- p(this, "_store", _e());
223
+ c(this, "_clippingPlanes", null);
224
+ c(this, "_helper");
225
+ c(this, "_instance");
226
+ c(this, "_store", ye());
121
227
  this.context = t, t.events.addEventListener("ready", () => {
228
+ this._instance = t.view.getInstance();
122
229
  const e = t.configuration.default_crs, n = t.configuration.analysis.cross_section;
123
- this._store.setOrientation(n.orientation);
124
- const o = n.pivot, i = new Z(o.crs ?? e, o.x, o.y, 0).as(
230
+ this._store.setCursorManager(t.view.getSceneCursorManager()), this._store.setInstance(t.view.getInstance()), this._store.setOrientation(n.orientation);
231
+ const s = n.pivot, o = new H(s.crs ?? e, s.x, s.y, 0).as(
125
232
  e
126
233
  );
127
- this._store.setCenter(i.toVector3()), this._store.$onAction(({ after: s, name: l }) => {
128
- s(() => {
234
+ this._store.setCenter(o.toVector3()), this._instance.addEventListener("entity-added", this.updateCrossSection.bind(this)), this._store.$onAction(({ after: i, name: l }) => {
235
+ i(() => {
129
236
  switch (l) {
130
237
  case "setCenter":
131
238
  case "setEnabled":
132
239
  case "setOrientation":
133
- this.updateCrossSection();
240
+ case "setShowHelper":
241
+ this.updateCrossSection(), this.updateHelper(), this.showHelper(this._store.showHelper);
134
242
  break;
135
243
  }
136
244
  });
137
- }), this.updateCrossSection();
245
+ }), this.updateCrossSection(), this.updateHelper(), this.showHelper(this._store.showHelper);
138
246
  });
139
247
  }
140
248
  dispose() {
141
249
  }
250
+ createHelperIfNecessary() {
251
+ this._store.showHelper && this._helper == null && this._instance && (this._helper = new It(), this._instance.add(this._helper).catch(console.error));
252
+ }
253
+ showHelper(t) {
254
+ this.createHelperIfNecessary(), this._helper && (this._helper.visible = t), this.updateHelper();
255
+ }
142
256
  updateCrossSection() {
143
- const t = [];
144
257
  if (this._store.enable) {
145
- const n = de.DEG2RAD * this._store.orientation, o = Math.cos(n), i = Math.sin(n), s = new j(o, i, 0), l = new se(s, 0).distanceToPoint(this._store.center), f = new se(s, -l);
146
- t.push(f);
147
- }
148
- const e = this.context.view.getInstance();
149
- e.renderer.clippingPlanes = t;
150
- for (const n of this.context.view.getInstance().getEntities())
151
- ve(n) && n.dispatchEvent({
152
- clippingPlanes: t,
153
- type: "clippingPlanes-property-changed"
154
- });
155
- e.notifyChange();
258
+ const t = [], e = J.DEG2RAD * this._store.orientation, n = Math.cos(e), s = Math.sin(e), o = new F(n, s, 0), i = new oe(o, 0).distanceToPoint(this._store.center), l = new oe(o, -i);
259
+ t.push(l), this._clippingPlanes = t;
260
+ } else
261
+ this._clippingPlanes = null;
262
+ this.updateEntities();
263
+ }
264
+ updateEntities() {
265
+ const t = this.context.view.getInstance();
266
+ for (const e of t.getEntities())
267
+ ge(e) && (e.clippingPlanes = this._clippingPlanes);
268
+ t.notifyChange();
269
+ }
270
+ updateHelper() {
271
+ var t, e, n, s;
272
+ this.createHelperIfNecessary(), (t = this._helper) == null || t.position.copy(this._store.center), (e = this._helper) == null || e.updateMatrixWorld(!0), (n = this._helper) == null || n.setRotationFromAxisAngle(
273
+ new F(0, 0, 1),
274
+ J.degToRad(this._store.orientation)
275
+ ), (s = this._instance) == null || s.notifyChange();
156
276
  }
157
277
  }
158
- class Dn {
278
+ class Bn {
159
279
  constructor() {
160
- p(this, "id", "builtin-cross-section-analysis");
161
- p(this, "name", "Cross section");
162
- p(this, "_manager", null);
280
+ c(this, "id", "builtin-cross-section-analysis");
281
+ c(this, "name", "Cross section");
282
+ c(this, "_manager", null);
163
283
  }
164
284
  initialize(t) {
165
285
  t.analysis.registerTool({
166
286
  component: xt,
167
287
  icon: "bi-circle-half",
168
288
  name: "Cross section"
169
- }), this._manager = new Ct(t);
289
+ }), this._manager = new Pt(t);
170
290
  }
171
291
  }
172
292
  function Q(a) {
@@ -175,20 +295,20 @@ function Q(a) {
175
295
  if ("source" in a.config && typeof a.config.source == "object" && "url" in a.config.source && typeof a.config.source.url == "string")
176
296
  return a.config.source.url;
177
297
  }
178
- function Pt(a) {
298
+ function Et(a) {
179
299
  return Q(a) != null;
180
300
  }
181
301
  class Nn {
182
302
  constructor() {
183
- p(this, "id", "builtin-download-dataset");
184
- p(this, "name", "Download dataset");
185
- p(this, "_context", null);
303
+ c(this, "id", "builtin-download-dataset");
304
+ c(this, "name", "Download dataset");
305
+ c(this, "_context", null);
186
306
  }
187
307
  initialize(t) {
188
308
  this._context = t, t.datasets.registerDatasetAction({
189
309
  action: this.download.bind(this),
190
310
  icon: "bi-download",
191
- predicate: Pt,
311
+ predicate: Et,
192
312
  title: "Download dataset"
193
313
  });
194
314
  }
@@ -198,20 +318,20 @@ class Nn {
198
318
  console.warn("invalid");
199
319
  return;
200
320
  }
201
- const n = this._context, o = new URL(e).pathname.split("/"), i = o[o.length - 1];
202
- console.info(`download ${Q(t)}`), A.fetch(e).then((s) => {
203
- if (!s.ok)
204
- throw new Error(`${s.status} ${s.statusText}`);
205
- return s.blob();
206
- }).then((s) => {
207
- Te.downloadBlob(s, i), n.notifications.pushNotification({
321
+ const n = this._context, s = new URL(e).pathname.split("/"), o = s[s.length - 1];
322
+ console.info(`download ${Q(t)}`), k.fetch(e).then((i) => {
323
+ if (!i.ok)
324
+ throw new Error(`${i.status} ${i.statusText}`);
325
+ return i.blob();
326
+ }).then((i) => {
327
+ Te.downloadBlob(i, o), n.notifications.pushNotification({
208
328
  level: "success",
209
- text: i,
329
+ text: o,
210
330
  title: "Download successful"
211
331
  });
212
- }).catch((s) => {
213
- console.error(s);
214
- const l = s instanceof Error ? s.message : "Download failed";
332
+ }).catch((i) => {
333
+ console.error(i);
334
+ const l = i instanceof Error ? i.message : "Download failed";
215
335
  n.notifications.pushNotification({
216
336
  level: "error",
217
337
  text: l,
@@ -220,44 +340,44 @@ class Nn {
220
340
  });
221
341
  }
222
342
  }
223
- const we = ye("floodingPlane", () => {
224
- const a = R(0), t = R(!1);
343
+ const be = me("floodingPlane", () => {
344
+ const a = I(0), t = I(!1);
225
345
  function e() {
226
346
  return a.value;
227
347
  }
228
- function n(i) {
229
- a.value = i;
348
+ function n(o) {
349
+ a.value = o;
230
350
  }
231
- function o(i) {
232
- t.value = i;
351
+ function s(o) {
352
+ t.value = o;
233
353
  }
234
- return { enable: t, getHeight: e, setEnabled: o, setHeight: n };
235
- }), It = { class: "input-group mb-3" }, St = { class: "input-group mb-3" }, Tt = ["value"], Et = { class: "input-group mb-3" }, Ft = ["value"], Mt = /* @__PURE__ */ Y({
354
+ return { enable: t, getHeight: e, setEnabled: s, setHeight: n };
355
+ }), St = { class: "input-group mb-3" }, Tt = { class: "input-group mb-3" }, Ft = ["value"], kt = { class: "input-group mb-3" }, Mt = ["value"], Lt = /* @__PURE__ */ D({
236
356
  __name: "FloodingPlane",
237
357
  setup(a) {
238
- const t = we();
358
+ const t = be();
239
359
  function e(n) {
240
360
  t.setHeight(n);
241
361
  }
242
- return (n, o) => (k(), D(ne, null, [
243
- x("div", It, [
244
- N(ue, {
245
- "model-value": B(t).enable,
246
- "onUpdate:modelValue": o[0] || (o[0] = (i) => B(t).setEnabled(i)),
362
+ return (n, s) => (v(), P(Y, null, [
363
+ m("div", St, [
364
+ T(q, {
365
+ "model-value": b(t).enable,
366
+ "onUpdate:modelValue": s[0] || (s[0] = (o) => b(t).setEnabled(o)),
247
367
  id: "flooding-plane-enable",
248
368
  title: "foo"
249
369
  }, null, 8, ["model-value"]),
250
- o[3] || (o[3] = x("label", {
370
+ s[3] || (s[3] = m("label", {
251
371
  for: "flooding-plane-enable",
252
372
  class: "form-label"
253
373
  }, "Enable flooding plane", -1))
254
374
  ]),
255
- x("div", St, [
256
- o[5] || (o[5] = x("label", {
375
+ m("div", Tt, [
376
+ s[5] || (s[5] = m("label", {
257
377
  for: "flooding-altitude-range",
258
378
  class: "form-label"
259
379
  }, "Altitude", -1)),
260
- x("input", {
380
+ m("input", {
261
381
  id: "flooding-altitude-range",
262
382
  title: "Altitude",
263
383
  type: "range",
@@ -265,31 +385,31 @@ const we = ye("floodingPlane", () => {
265
385
  min: "0",
266
386
  step: "0.1",
267
387
  max: "500",
268
- value: B(t).getHeight(),
269
- onInput: o[1] || (o[1] = (i) => e(Number.parseFloat(i.target.value)))
270
- }, null, 40, Tt),
271
- x("div", Et, [
272
- x("input", {
388
+ value: b(t).getHeight(),
389
+ onInput: s[1] || (s[1] = (o) => e(Number.parseFloat(o.target.value)))
390
+ }, null, 40, Ft),
391
+ m("div", kt, [
392
+ m("input", {
273
393
  type: "number",
274
394
  class: "form-control",
275
395
  id: "flooding-altitude-number",
276
396
  step: "0.1",
277
- value: B(t).getHeight(),
278
- onInput: o[2] || (o[2] = (i) => e(Number.parseFloat(i.target.value)))
279
- }, null, 40, Ft),
280
- o[4] || (o[4] = x("span", { class: "input-group-text" }, "m", -1))
397
+ value: b(t).getHeight(),
398
+ onInput: s[2] || (s[2] = (o) => e(Number.parseFloat(o.target.value)))
399
+ }, null, 40, Mt),
400
+ s[4] || (s[4] = m("span", { class: "input-group-text" }, "m", -1))
281
401
  ])
282
402
  ])
283
403
  ], 64));
284
404
  }
285
405
  });
286
- class Bt {
406
+ class Dt {
287
407
  constructor() {
288
- p(this, "geometry");
289
- p(this, "material");
290
- p(this, "object3D");
291
- p(this, "_height");
292
- this.geometry = new Ee(1, 1, 1, 1), this.material = new X({ color: 43690, opacity: 0.5, transparent: !0 }), this.object3D = new pe(this.geometry, this.material), this.object3D.renderOrder = 2, this.visible = !1, this._height = 0;
408
+ c(this, "geometry");
409
+ c(this, "material");
410
+ c(this, "object3D");
411
+ c(this, "_height");
412
+ this.geometry = new ce(1, 1, 1, 1), this.material = new R({ color: 43690, opacity: 0.5, transparent: !0 }), this.object3D = new K(this.geometry, this.material), this.object3D.renderOrder = 2, this.visible = !1, this._height = 0;
293
413
  }
294
414
  set height(t) {
295
415
  this._height = t;
@@ -306,15 +426,15 @@ class Bt {
306
426
  dispose() {
307
427
  this.object3D.removeFromParent(), this.geometry.dispose(), this.material.dispose();
308
428
  }
309
- setPosition(t, e, n, o, i) {
310
- this.object3D.scale.set(o, i, 1), this.object3D.position.set(t, e, n), this.object3D.updateMatrixWorld();
429
+ setPosition(t, e, n, s, o) {
430
+ this.object3D.scale.set(s, o, 1), this.object3D.position.set(t, e, n), this.object3D.updateMatrixWorld();
311
431
  }
312
432
  }
313
- class Lt {
433
+ class Bt {
314
434
  constructor(t) {
315
- p(this, "_context");
316
- p(this, "_plane");
317
- p(this, "_store", we());
435
+ c(this, "_context");
436
+ c(this, "_plane");
437
+ c(this, "_store", be());
318
438
  this._context = t, this._plane = null, t.events.addEventListener("ready", () => {
319
439
  this._store.$onAction(({ after: e, name: n }) => {
320
440
  e(() => {
@@ -334,142 +454,142 @@ class Lt {
334
454
  this._plane && (this._context.view.getInstance().remove(this._plane.object3D), this._plane.dispose());
335
455
  }
336
456
  async updatePlane() {
337
- this._plane || (this._plane = new Bt(), await this._context.view.getInstance().add(this._plane.object3D));
338
- const t = this._context.view.getBoundingBox(), e = t.getCenter(new j()), n = t.getSize(new j());
457
+ this._plane || (this._plane = new Dt(), await this._context.view.getInstance().add(this._plane.object3D));
458
+ const t = this._context.view.getBoundingBox(), e = t.getCenter(new F()), n = t.getSize(new F());
339
459
  this._plane.visible = this._store.enable, this._plane.setPosition(e.x, e.y, this._store.getHeight(), n.x, n.y), this._context.view.getInstance().notifyChange();
340
460
  }
341
461
  }
342
- class An {
462
+ class On {
343
463
  constructor() {
344
- p(this, "id", "builtin-flooding-plane-analysis");
345
- p(this, "name", "Flooding plane");
346
- p(this, "_manager", null);
464
+ c(this, "id", "builtin-flooding-plane-analysis");
465
+ c(this, "name", "Flooding plane");
466
+ c(this, "_manager", null);
347
467
  }
348
468
  initialize(t) {
349
469
  t.analysis.registerTool({
350
- component: Mt,
470
+ component: Lt,
351
471
  icon: "bi-layers-half",
352
472
  name: "Flooding plane"
353
- }), this._manager = new Lt(t);
473
+ }), this._manager = new Bt(t);
354
474
  }
355
475
  }
356
- const kt = /^(\d+\.\d+)\s*,\s*(\d+\.\d+)$/;
357
- class Dt {
476
+ const Nt = /^(\d+\.\d+)\s*,\s*(\d+\.\d+)$/;
477
+ class Ot {
358
478
  constructor() {
359
- p(this, "name", "Go to coordinates");
479
+ c(this, "name", "Go to coordinates");
360
480
  }
361
481
  search(t) {
362
- const e = kt.exec(t);
482
+ const e = Nt.exec(t);
363
483
  if (e) {
364
- const n = Number.parseFloat(e[1]), o = Number.parseFloat(e[2]), s = {
365
- coordinates: Z.WGS84(n, o),
366
- label: `${n.toFixed(6)}, ${o.toFixed(6)}`,
484
+ const n = Number.parseFloat(e[1]), s = Number.parseFloat(e[2]), i = {
485
+ coordinates: H.WGS84(n, s),
486
+ label: `${n.toFixed(6)}, ${s.toFixed(6)}`,
367
487
  provider: this
368
488
  };
369
- return Promise.resolve([s]);
489
+ return Promise.resolve([i]);
370
490
  } else
371
491
  return Promise.resolve([]);
372
492
  }
373
493
  }
374
- class zn {
494
+ class An {
375
495
  constructor() {
376
- p(this, "id", "builtin-coordinates-search");
377
- p(this, "name", "Coordinates search");
496
+ c(this, "id", "builtin-coordinates-search");
497
+ c(this, "name", "Coordinates search");
378
498
  }
379
499
  initialize(t) {
380
- t.search.registerProvider(new Dt());
500
+ t.search.registerProvider(new Ot());
381
501
  }
382
502
  }
383
- const Nt = /[a-z]{3}/;
384
- class At {
503
+ const At = /[a-z]{3}/;
504
+ class zt {
385
505
  constructor() {
386
- p(this, "name", "Base adresse nationale (BAN)");
506
+ c(this, "name", "Base adresse nationale (BAN)");
387
507
  }
388
508
  async search(t) {
389
- if (!Nt.test(t))
509
+ if (!At.test(t))
390
510
  return [];
391
511
  try {
392
- const n = (await A.fetchJson(
512
+ const n = (await k.fetchJson(
393
513
  `https://api-adresse.data.gouv.fr/search/?q=${t}`
394
- )).features.map((o) => {
395
- const i = o.properties, s = o.geometry, [l, f] = s.coordinates;
514
+ )).features.map((s) => {
515
+ const o = s.properties, i = s.geometry, [l, d] = i.coordinates;
396
516
  return {
397
- coordinates: new Z("EPSG:4326", l, f, 0),
398
- label: i.label,
517
+ coordinates: new H("EPSG:4326", l, d, 0),
518
+ label: o.label,
399
519
  provider: this
400
520
  };
401
521
  });
402
- return await zt(n.map((o) => o.coordinates)), n;
522
+ return await jt(n.map((s) => s.coordinates)), n;
403
523
  } catch (e) {
404
- if (e instanceof We)
524
+ if (e instanceof Ue)
405
525
  return [];
406
526
  throw e;
407
527
  }
408
528
  }
409
529
  }
410
- async function zt(a) {
530
+ async function jt(a) {
411
531
  const t = new URL("https://data.geopf.fr/altimetrie/1.0/calcul/alti/rest/elevation.json");
412
532
  t.searchParams.append("lon", a.map((n) => n.longitude).join("|")), t.searchParams.append("lat", a.map((n) => n.latitude).join("|")), t.searchParams.append("zonly", "true"), t.searchParams.append("resource", "ign_rge_alti_wld"), t.searchParams.append("delimiter", "|"), t.searchParams.append("indent", "false");
413
- const e = await A.fetchJson(t.toString());
533
+ const e = await k.fetchJson(t.toString());
414
534
  for (let n = 0; n < a.length; n++)
415
535
  a[n].setAltitude(e.elevations[n]);
416
536
  return e;
417
537
  }
418
- class On {
538
+ class zn {
419
539
  constructor() {
420
- p(this, "id", "builtin-geocoding-ban");
421
- p(this, "name", "Base adresse nationale");
540
+ c(this, "id", "builtin-geocoding-ban");
541
+ c(this, "name", "Base adresse nationale");
422
542
  }
423
543
  initialize(t) {
424
- t.search.registerProvider(new At());
544
+ t.search.registerProvider(new zt());
425
545
  }
426
546
  }
427
- const V = new Fe(), Ot = {
428
- bbox: new X({
547
+ const A = new Fe(), $t = {
548
+ bbox: new R({
429
549
  color: "#FFFF00",
430
550
  depthTest: !0,
431
551
  opacity: 0.2,
432
552
  transparent: !0
433
553
  }),
434
- selection: new X({
554
+ selection: new R({
435
555
  color: "#FF0000",
436
556
  depthTest: !1,
437
557
  opacity: 0.6,
438
558
  transparent: !0
439
559
  })
440
- }, Rt = 4186316022, jt = 781010003, Vt = 2655215786, Ut = 3242617779, $t = 919958153, Gt = 1307041759, xe = 1451395588, Ce = 1883228015, Yt = [xe, Ce], Ht = [
560
+ }, Ht = 4186316022, Rt = 781010003, Vt = 2655215786, Ut = 3242617779, Yt = 919958153, Gt = 1307041759, ve = 1451395588, _e = 1883228015, Wt = [ve, _e], qt = [
561
+ Ht,
441
562
  Rt,
442
- jt,
443
563
  Vt,
444
564
  Ut,
445
- $t,
565
+ Yt,
446
566
  Gt
447
- ], Pe = (a) => G(a) && a.isIFCPickResult, U = class U extends be {
567
+ ], we = (a) => $(a) && a.isIFCPickResult, z = class z extends fe {
448
568
  constructor(e) {
449
- super(new me());
450
- p(this, "isIfcEntity", !0);
451
- p(this, "isPickableFeatures", !0);
452
- p(this, "type", "IfcEntity");
453
- p(this, "_classificationCache");
454
- p(this, "_components");
455
- p(this, "_fragmentBoundingBox");
456
- p(this, "_fragmentClassifier");
457
- p(this, "_fragmentManager");
458
- p(this, "_ifcSelection");
569
+ super(new ue());
570
+ c(this, "isIfcEntity", !0);
571
+ c(this, "isPickableFeatures", !0);
572
+ c(this, "type", "IfcEntity");
573
+ c(this, "_classificationCache");
574
+ c(this, "_components");
575
+ c(this, "_fragmentBoundingBox");
576
+ c(this, "_fragmentClassifier");
577
+ c(this, "_fragmentManager");
578
+ c(this, "_ifcSelection");
459
579
  // Currently selected fragments
460
- p(this, "_indexMap");
580
+ c(this, "_indexMap");
461
581
  // Properties relationships
462
- p(this, "_model");
463
- p(this, "_source");
464
- this._source = e, this._components = new Ze(), this._components.ui.enabled = !1, this._components.scene = new Je(this._components), this._components.renderer = new Xe(
582
+ c(this, "_model");
583
+ c(this, "_source");
584
+ this._source = e, this._components = new Ge(), this._components.ui.enabled = !1, this._components.scene = new We(this._components), this._components.renderer = new qe(
465
585
  this._components,
466
586
  document.createElement("div")
467
- ), this._components.camera = new Qe(this._components), this._components.raycaster = new Ke(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
587
+ ), this._components.camera = new Je(this._components), this._components.raycaster = new Ze(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
468
588
  }
469
589
  clearHighlight(e = "selection") {
470
590
  for (const n of Object.keys(this._ifcSelection[e])) {
471
- const o = this._fragmentManager.list[n], i = o == null ? void 0 : o.fragments[e];
472
- i != null && i.mesh.removeFromParent();
591
+ const s = this._fragmentManager.list[n], o = s == null ? void 0 : s.fragments[e];
592
+ o != null && o.mesh.removeFromParent();
473
593
  }
474
594
  this.notifyChange(this), this._ifcSelection[e] = {};
475
595
  }
@@ -478,17 +598,17 @@ const V = new Fe(), Ot = {
478
598
  const n = this._fragmentBoundingBox;
479
599
  if (n === null)
480
600
  throw new Error("Must call initClassification before getBoundingBoxById");
481
- const o = this._fragmentManager;
601
+ const s = this._fragmentManager;
482
602
  n.reset();
483
- const i = this._ifcSelection.bbox;
484
- if (!Object.keys(i).length)
603
+ const o = this._ifcSelection.bbox;
604
+ if (!Object.keys(o).length)
485
605
  return;
486
- for (const m of Object.keys(i)) {
487
- const I = o.list[m].fragments.bbox;
488
- n.addMesh(I.mesh);
606
+ for (const u of Object.keys(o)) {
607
+ const f = s.list[u].fragments.bbox;
608
+ n.addMesh(f.mesh);
489
609
  }
490
- const s = n.get(), { y: l, z: f } = s.min, { y: v, z: c } = s.max;
491
- return s.min.y = -c, s.max.y = -f, s.min.z = l, s.max.z = v, s.translate(this._model.position), this.clearHighlight("bbox"), s;
610
+ const i = n.get(), { y: l, z: d } = i.min, { y: p, z: r } = i.max;
611
+ return i.min.y = -r, i.max.y = -d, i.min.z = l, i.max.z = p, i.translate(this._model.position), this.clearHighlight("bbox"), i;
492
612
  }
493
613
  getClassification() {
494
614
  if (this._classificationCache === null)
@@ -496,44 +616,44 @@ const V = new Fe(), Ot = {
496
616
  return this._classificationCache;
497
617
  }
498
618
  getProperties(e) {
499
- const n = [], o = this._model.properties;
500
- if (!o)
619
+ const n = [], s = this._model.properties;
620
+ if (!s)
501
621
  return [];
502
- for (const i of this._indexMap[e]) {
503
- const s = o[i];
504
- if (s == null)
622
+ for (const o of this._indexMap[e]) {
623
+ const i = s[o];
624
+ if (i == null)
505
625
  continue;
506
- const { name: l } = O.getEntityName(o, i);
626
+ const { name: l } = M.getEntityName(s, o);
507
627
  if (l !== null) {
508
- if (s.type === xe) {
509
- const f = O.getPsetProps(o, i);
510
- if (f !== null)
511
- for (const v of f) {
512
- if (o[v] == null)
628
+ if (i.type === ve) {
629
+ const d = M.getPsetProps(s, o);
630
+ if (d !== null)
631
+ for (const p of d) {
632
+ if (s[p] == null)
513
633
  continue;
514
- const m = this.getProperty(v);
515
- m !== null && n.push({
634
+ const u = this.getProperty(p);
635
+ u !== null && n.push({
516
636
  parentName: l,
517
- ...m
637
+ ...u
518
638
  });
519
639
  }
520
- } else if (s.type === Ce) {
521
- const f = O.getQsetQuantities(
522
- o,
523
- i
640
+ } else if (i.type === _e) {
641
+ const d = M.getQsetQuantities(
642
+ s,
643
+ o
524
644
  );
525
- if (f !== null)
526
- for (const v of f) {
527
- const { key: c } = O.getQuantityValue(
528
- o,
529
- v
645
+ if (d !== null)
646
+ for (const p of d) {
647
+ const { key: r } = M.getQuantityValue(
648
+ s,
649
+ p
530
650
  );
531
- if (c === null)
651
+ if (r === null)
532
652
  continue;
533
- const m = this.getProperty(v);
534
- m !== null && n.push({
653
+ const u = this.getProperty(p);
654
+ u !== null && n.push({
535
655
  parentName: l,
536
- ...m
656
+ ...u
537
657
  });
538
658
  }
539
659
  }
@@ -545,55 +665,55 @@ const V = new Fe(), Ot = {
545
665
  const n = this._model.properties;
546
666
  if (n === void 0)
547
667
  return null;
548
- const { name: o } = O.getEntityName(n, e);
549
- if (o === null)
668
+ const { name: s } = M.getEntityName(n, e);
669
+ if (s === null)
550
670
  return null;
551
- const { value: i } = O.getQuantityValue(n, e);
552
- return { name: o, value: i };
671
+ const { value: o } = M.getQuantityValue(n, e);
672
+ return { name: s, value: o };
553
673
  }
554
- highlight(e, n, o) {
674
+ highlight(e, n, s) {
555
675
  this._ifcSelection[e][n.uuid] = /* @__PURE__ */ new Set();
556
- const i = parseInt(o, 10);
557
- this._ifcSelection[e][n.uuid].add(o), this.addComposites(e, n, i), this.regenerate(e, n.uuid);
558
- const s = n.fragment.group;
559
- if (s) {
560
- const l = s.data[i][0];
561
- for (let f = 0; f < l.length; f++) {
562
- const v = l[f], c = s.keyFragments[v], m = this._fragmentManager.list[c];
563
- c in this._ifcSelection[e] || (this._ifcSelection[e][c] = /* @__PURE__ */ new Set()), this._ifcSelection[e][c].add(o), this.addComposites(e, m.mesh, i), this.regenerate(e, c);
676
+ const o = parseInt(s, 10);
677
+ this._ifcSelection[e][n.uuid].add(s), this.addComposites(e, n, o), this.regenerate(e, n.uuid);
678
+ const i = n.fragment.group;
679
+ if (i) {
680
+ const l = i.data[o][0];
681
+ for (let d = 0; d < l.length; d++) {
682
+ const p = l[d], r = i.keyFragments[p], u = this._fragmentManager.list[r];
683
+ r in this._ifcSelection[e] || (this._ifcSelection[e][r] = /* @__PURE__ */ new Set()), this._ifcSelection[e][r].add(s), this.addComposites(e, u.mesh, o), this.regenerate(e, r);
564
684
  }
565
685
  }
566
686
  this.notifyChange(this);
567
687
  }
568
688
  highlightById(e, n = "selection") {
569
- for (const o of Object.keys(e)) {
570
- o in this._ifcSelection[n] || (this._ifcSelection[n][o] = /* @__PURE__ */ new Set());
571
- const i = this._fragmentManager.list[o], s = /* @__PURE__ */ new Set();
572
- for (const l of e[o])
573
- this._ifcSelection[n][o].add(l), s.add(parseInt(l, 10));
574
- for (const l of s)
575
- this.addComposites(n, i.mesh, l);
576
- this.regenerate(n, o);
689
+ for (const s of Object.keys(e)) {
690
+ s in this._ifcSelection[n] || (this._ifcSelection[n][s] = /* @__PURE__ */ new Set());
691
+ const o = this._fragmentManager.list[s], i = /* @__PURE__ */ new Set();
692
+ for (const l of e[s])
693
+ this._ifcSelection[n][s].add(l), i.add(parseInt(l, 10));
694
+ for (const l of i)
695
+ this.addComposites(n, o.mesh, l);
696
+ this.regenerate(n, s);
577
697
  }
578
698
  this.notifyChange(this);
579
699
  }
580
700
  pick(e, n) {
581
- return super.pick(e, n).map((o) => ({
582
- ...o,
701
+ return super.pick(e, n).map((s) => ({
702
+ ...s,
583
703
  entity: this,
584
- features: o.features,
704
+ features: s.features,
585
705
  isIFCPickResult: !0,
586
- object: o.object
706
+ object: s.object
587
707
  }));
588
708
  }
589
709
  pickFeaturesFrom(e) {
590
- var o, i, s;
710
+ var s, o, i;
591
711
  const n = e.object;
592
712
  if (n.fragment != null && e.instanceId != null && e.face) {
593
- const l = n.fragment.getVertexBlockID(n.geometry, e.face.a), f = (o = n.fragment.getItemID(e.instanceId, l)) == null ? void 0 : o.replace(/\..*/, "");
594
- if (f && ((s = (i = n.fragment.group) == null ? void 0 : i.properties) == null ? void 0 : s[f]) != null) {
595
- const c = n.fragment.group.properties[f], w = [{ ifcProperties: this.getProperties(f), itemProperties: c }];
596
- return e.features = w, w;
713
+ const l = n.fragment.getVertexBlockID(n.geometry, e.face.a), d = (s = n.fragment.getItemID(e.instanceId, l)) == null ? void 0 : s.replace(/\..*/, "");
714
+ if (d && ((i = (o = n.fragment.group) == null ? void 0 : o.properties) == null ? void 0 : i[d]) != null) {
715
+ const r = n.fragment.group.properties[d], h = [{ ifcProperties: this.getProperties(d), itemProperties: r }];
716
+ return e.features = h, h;
597
717
  }
598
718
  }
599
719
  return [];
@@ -606,225 +726,225 @@ const V = new Fe(), Ot = {
606
726
  ]), this._classificationCache.length === 0 && (this._classificationCache = await this.regenerateClassification([
607
727
  "entities"
608
728
  /* ENTITY */
609
- ])), this._fragmentBoundingBox = await this._components.tools.get(et);
729
+ ])), this._fragmentBoundingBox = await this._components.tools.get(Qe);
610
730
  }
611
731
  async preprocess() {
612
- const e = await A.fetchArrayBuffer(this._source.url);
613
- this._fragmentManager = await this._components.tools.get(tt), this._fragmentClassifier = await this._components.tools.get(nt);
614
- const n = new st(this._components);
732
+ const e = await k.fetchArrayBuffer(this._source.url);
733
+ this._fragmentManager = await this._components.tools.get(Xe), this._fragmentClassifier = await this._components.tools.get(Ke);
734
+ const n = new et(this._components);
615
735
  n.settings.webIfc.COORDINATE_TO_ORIGIN = !0, n.settings.webIfc.OPTIMIZE_PROFILES = !0;
616
- const o = new Uint8Array(e);
617
- this._model = await n.load(o, this._source.name), this._model.rotateX(Math.PI / 2);
618
- const i = new j();
736
+ const s = new Uint8Array(e);
737
+ this._model = await n.load(s, this._source.name), this._model.rotateX(Math.PI / 2);
738
+ const o = new F();
619
739
  if (this._source.at)
620
- this._source.at.toVector3(i), this._model.position.copy(i);
740
+ this._source.at.toVector3(o), this._model.position.copy(o);
621
741
  else {
622
742
  const l = this._model.coordinationMatrix.clone().invert();
623
- i.applyMatrix4(l), this._model.position.set(i.x, -i.z, i.y);
743
+ o.applyMatrix4(l), this._model.position.set(o.x, -o.z, o.y);
624
744
  }
625
745
  this._model.updateWorldMatrix(!0, !0), this._model.updateMatrix(), this._model.updateMatrixWorld(!0), this.initializeEntityIndexes(), this._fragmentClassifier.byStorey(this._model), this._fragmentClassifier.byEntity(this._model), await this.initClassification(), this.object3d.add(this._model), this.onObjectCreated(this._model);
626
- const s = A.getContext(this._source.url);
627
- ee(this, { filename: s.filename }), this.notifyChange(this.object3d);
746
+ const i = k.getContext(this._source.url);
747
+ ee(this, { filename: i.filename }), this.notifyChange(this.object3d);
628
748
  }
629
- addComposites(e, n, o) {
749
+ addComposites(e, n, s) {
630
750
  this.addHighlightToFragment(e, n.fragment);
631
- const i = n.fragment.composites[o];
632
- if (i)
633
- for (let s = 1; s < i; s++) {
634
- const l = ot(o, s);
751
+ const o = n.fragment.composites[s];
752
+ if (o)
753
+ for (let i = 1; i < o; i++) {
754
+ const l = tt(s, i);
635
755
  this._ifcSelection[e][n.uuid].add(l);
636
756
  }
637
757
  }
638
758
  addHighlightToFragment(e, n) {
639
759
  if (!(e in n.fragments)) {
640
- const o = n.addFragment(e, [Ot[e]]);
641
- n.blocks.count > 1 && (o.setInstance(0, {
760
+ const s = n.addFragment(e, [$t[e]]);
761
+ n.blocks.count > 1 && (s.setInstance(0, {
642
762
  ids: Array.from(n.ids),
643
- transform: V
644
- }), o.blocks.setVisibility(!1)), this._model.add(o.mesh), o.mesh.renderOrder = 30, o.mesh.frustumCulled = !1, o.mesh.name = e, o.mesh.updateMatrixWorld(!0);
763
+ transform: A
764
+ }), s.blocks.setVisibility(!1)), this._model.add(s.mesh), s.mesh.renderOrder = 30, s.mesh.frustumCulled = !1, s.mesh.name = e, s.mesh.updateMatrixWorld(!0);
645
765
  }
646
766
  }
647
767
  initializeEntityIndexes() {
648
768
  this._indexMap = {};
649
769
  const e = this._model.properties;
650
770
  if (e !== void 0)
651
- for (const n of Ht)
652
- O.getRelationMap(e, n, (o, i) => {
653
- const s = e[o];
654
- Yt.includes(s.type) || this.setEntityIndex(o);
655
- for (const l of i)
656
- this.setEntityIndex(l).add(o);
771
+ for (const n of qt)
772
+ M.getRelationMap(e, n, (s, o) => {
773
+ const i = e[s];
774
+ Wt.includes(i.type) || this.setEntityIndex(s);
775
+ for (const l of o)
776
+ this.setEntityIndex(l).add(s);
657
777
  });
658
778
  }
659
779
  regenerate(e, n) {
660
780
  this.updateFragmentFill(e, n);
661
781
  }
662
782
  async regenerateClassification(e, n = {}) {
663
- const o = this._fragmentClassifier.get(), i = [], s = e[0], l = o[s];
664
- if (s == null || l == null)
665
- return i;
666
- for (const f of Object.keys(l)) {
667
- const v = { ...n, [s]: [f] }, c = await this._fragmentClassifier.find(v);
668
- if (Object.keys(c).length > 0) {
669
- const I = s[0].toUpperCase() + s.slice(1), P = await this.regenerateClassification(
783
+ const s = this._fragmentClassifier.get(), o = [], i = e[0], l = s[i];
784
+ if (i == null || l == null)
785
+ return o;
786
+ for (const d of Object.keys(l)) {
787
+ const p = { ...n, [i]: [d] }, r = await this._fragmentClassifier.find(p);
788
+ if (Object.keys(r).length > 0) {
789
+ const f = i[0].toUpperCase() + i.slice(1), g = await this.regenerateClassification(
670
790
  e.slice(1),
671
- v
791
+ p
672
792
  );
673
- i.push({ children: P, fragments: c, name: f, treeItemName: I });
793
+ o.push({ children: g, fragments: r, name: d, treeItemName: f });
674
794
  }
675
795
  }
676
- return i;
796
+ return o;
677
797
  }
678
798
  setEntityIndex(e) {
679
799
  return e in this._indexMap || (this._indexMap[e] = /* @__PURE__ */ new Set()), this._indexMap[e];
680
800
  }
681
801
  updateFragmentFill(e, n) {
682
- const o = this._ifcSelection[e][n], i = this._fragmentManager.list[n];
683
- if (i == null)
802
+ const s = this._ifcSelection[e][n], o = this._fragmentManager.list[n];
803
+ if (o == null)
684
804
  return;
685
- const s = i.fragments[e];
686
- if (s == null)
805
+ const i = o.fragments[e];
806
+ if (i == null)
687
807
  return;
688
- const l = i.mesh.parent;
808
+ const l = o.mesh.parent;
689
809
  if (l == null)
690
810
  return;
691
- if (l.add(s.mesh), s.blocks.count > 1)
692
- i.getInstance(0, V), s.setInstance(0, {
693
- ids: Array.from(i.ids),
694
- transform: V
695
- }), s.blocks.setVisibility(!0, o, !0);
811
+ if (l.add(i.mesh), i.blocks.count > 1)
812
+ o.getInstance(0, A), i.setInstance(0, {
813
+ ids: Array.from(o.ids),
814
+ transform: A
815
+ }), i.blocks.setVisibility(!0, s, !0);
696
816
  else {
697
- let v = 0;
698
- for (const c of o) {
699
- s.mesh.count = v + 1;
700
- const { instanceID: m } = i.getInstanceAndBlockID(c);
701
- i.getInstance(m, V), s.setInstance(v, { ids: [c], transform: V }), v++;
817
+ let p = 0;
818
+ for (const r of s) {
819
+ i.mesh.count = p + 1;
820
+ const { instanceID: u } = o.getInstanceAndBlockID(r);
821
+ o.getInstance(u, A), i.setInstance(p, { ids: [r], transform: A }), p++;
702
822
  }
703
823
  }
704
824
  }
705
825
  };
706
- p(U, "isIFCEntity", (e) => G(e) && e.isIfcEntity), p(U, "isIFCPickResult", (e) => G(e) && U.isIFCEntity(e.entity));
707
- let K = U;
708
- class Wt extends at {
826
+ c(z, "isIFCEntity", (e) => $(e) && e.isIfcEntity), c(z, "isIFCPickResult", (e) => $(e) && z.isIFCEntity(e.entity));
827
+ let X = z;
828
+ class Jt extends st {
709
829
  constructor(t, e, n) {
710
830
  super(t, e, n, { visibility: !0 });
711
831
  }
712
832
  }
713
- const qt = { class: "d-flex" }, Zt = ["title"], Jt = ["id"], Xt = { class: "list-unstyled border-start" }, Qt = /* @__PURE__ */ Y({
833
+ const Zt = { class: "d-flex" }, Qt = ["title"], Xt = ["id"], Kt = { class: "list-unstyled border-start" }, en = /* @__PURE__ */ D({
714
834
  __name: "IfcSubtree",
715
835
  props: {
716
836
  classificationElement: {},
717
837
  ifcEntity: {}
718
838
  },
719
839
  setup(a) {
720
- const t = a, e = de.generateUUID(), n = `#${e}`, o = R(!1), i = Me(), l = Be().getModule(Le);
721
- function f() {
840
+ const t = a, e = J.generateUUID(), n = `#${e}`, s = I(!1), o = ke(), l = Me().getModule(Le);
841
+ function d() {
722
842
  if (l == null) {
723
843
  console.warn("Cannot clip IFC element, ClippingBoxAnalysis module is not present");
724
844
  return;
725
845
  }
726
- const m = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
727
- m && !m.isEmpty() && l.setClippingBox(m);
846
+ const u = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
847
+ u && !u.isEmpty() && l.setClippingBox(u);
728
848
  }
729
- function v() {
730
- o.value = !0, t.ifcEntity.clearHighlight(), t.ifcEntity.highlightById(t.classificationElement.fragments), setTimeout(() => o.value = !1, 2e3);
849
+ function p() {
850
+ s.value = !0, t.ifcEntity.clearHighlight(), t.ifcEntity.highlightById(t.classificationElement.fragments), setTimeout(() => s.value = !1, 2e3);
731
851
  }
732
- function c() {
733
- const m = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
734
- m && !m.isEmpty() && i.lookTopDownAt(m);
852
+ function r() {
853
+ const u = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
854
+ u && !u.isEmpty() && o.lookTopDownAt(u);
735
855
  }
736
- return (m, w) => {
737
- const I = Ue("IfcSubtree", !0);
738
- return k(), D("div", null, [
739
- x("div", qt, [
740
- x("span", {
741
- class: re([
856
+ return (u, h) => {
857
+ const f = He("IfcSubtree", !0);
858
+ return v(), P("div", null, [
859
+ m("div", Zt, [
860
+ m("span", {
861
+ class: ae([
742
862
  "border rounded px-1 py-0 fw-normal",
743
- o.value ? "text-danger border-danger" : "text-secondary border-secondary"
863
+ s.value ? "text-danger border-danger" : "text-secondary border-secondary"
744
864
  ]),
745
- title: m.classificationElement.treeItemName
746
- }, $e(m.classificationElement.treeItemName), 11, Zt),
747
- m.classificationElement.children.length > 0 ? (k(), ae(oe, { key: 0 }, {
748
- default: le(() => [
749
- N(J, {
865
+ title: u.classificationElement.treeItemName
866
+ }, pe(u.classificationElement.treeItemName), 11, Qt),
867
+ u.classificationElement.children.length > 0 ? (v(), V(ie, { key: 0 }, {
868
+ default: re(() => [
869
+ T(W, {
750
870
  title: "Expand group",
751
871
  icon: "bi-chevron-down",
752
872
  "data-bs-toggle": "collapse",
753
873
  "data-bs-target": n,
754
- "aria-controls": B(e),
874
+ "aria-controls": b(e),
755
875
  "aria-expanded": "true"
756
876
  }, null, 8, ["aria-controls"])
757
877
  ]),
758
878
  _: 1
759
- })) : W("", !0),
760
- N(ke, {
761
- class: re(["label", o.value ? "text-danger-emphasis" : "text-muted"]),
762
- text: m.classificationElement.name,
763
- title: `Zoom to ${m.classificationElement.name}`,
764
- onClick: c
879
+ })) : L("", !0),
880
+ T(De, {
881
+ class: ae(["label", s.value ? "text-danger-emphasis" : "text-muted"]),
882
+ text: u.classificationElement.name,
883
+ title: `Zoom to ${u.classificationElement.name}`,
884
+ onClick: r
765
885
  }, null, 8, ["class", "text", "title"]),
766
- N(oe, { class: "ms-1" }, {
767
- default: le(() => [
768
- N(J, {
886
+ T(ie, { class: "ms-1" }, {
887
+ default: re(() => [
888
+ T(W, {
769
889
  title: "Highlight",
770
890
  icon: "bi-highlighter",
771
- onClick: v
891
+ onClick: p
772
892
  }),
773
- B(l) != null ? (k(), ae(J, {
893
+ b(l) != null ? (v(), V(W, {
774
894
  key: 0,
775
895
  title: "Clip to",
776
896
  icon: "bi-bounding-box",
777
- onClick: f
778
- })) : W("", !0)
897
+ onClick: d
898
+ })) : L("", !0)
779
899
  ]),
780
900
  _: 1
781
901
  })
782
902
  ]),
783
- m.classificationElement.children.length > 0 ? (k(), D("div", {
903
+ u.classificationElement.children.length > 0 ? (v(), P("div", {
784
904
  key: 0,
785
- id: B(e),
905
+ id: b(e),
786
906
  class: "collapse show"
787
907
  }, [
788
- x("ul", Xt, [
789
- (k(!0), D(ne, null, ge(m.classificationElement.children, (P, T) => (k(), D("li", { key: T }, [
790
- N(I, {
908
+ m("ul", Kt, [
909
+ (v(!0), P(Y, null, he(u.classificationElement.children, (g, C) => (v(), P("li", { key: C }, [
910
+ T(f, {
791
911
  "ifc-entity": t.ifcEntity,
792
- "classification-element": P
912
+ "classification-element": g
793
913
  }, null, 8, ["ifc-entity", "classification-element"])
794
914
  ]))), 128))
795
915
  ])
796
- ], 8, Jt)) : W("", !0)
916
+ ], 8, Xt)) : L("", !0)
797
917
  ]);
798
918
  };
799
919
  }
800
- }), Kt = /* @__PURE__ */ te(Qt, [["__scopeId", "data-v-804ca598"]]), en = { key: 0 }, tn = /* @__PURE__ */ Y({
920
+ }), tn = /* @__PURE__ */ te(en, [["__scopeId", "data-v-804ca598"]]), nn = { key: 0 }, sn = /* @__PURE__ */ D({
801
921
  __name: "IfcPropertyView",
802
922
  props: {
803
923
  dataset: {}
804
924
  },
805
925
  setup(a) {
806
- const t = De(), e = a, n = Ne(e.dataset, "isPreloaded");
807
- function o() {
808
- const s = i();
809
- return s == null ? null : s.getClassification();
926
+ const t = Be(), e = a, n = Ne(e.dataset, "isPreloaded");
927
+ function s() {
928
+ const i = o();
929
+ return i == null ? null : i.getClassification();
810
930
  }
811
- function i() {
812
- const s = t.getEntity(e.dataset);
813
- return s ?? null;
931
+ function o() {
932
+ const i = t.getEntity(e.dataset);
933
+ return i ?? null;
814
934
  }
815
- return (s, l) => B(n) ? (k(), D("div", en, [
816
- x("ul", null, [
817
- (k(!0), D(ne, null, ge(o(), (f, v) => (k(), D("li", { key: v }, [
818
- N(Kt, {
819
- "ifc-entity": i(),
820
- "classification-element": f
935
+ return (i, l) => b(n) ? (v(), P("div", nn, [
936
+ m("ul", null, [
937
+ (v(!0), P(Y, null, he(s(), (d, p) => (v(), P("li", { key: p }, [
938
+ T(tn, {
939
+ "ifc-entity": o(),
940
+ "classification-element": d
821
941
  }, null, 8, ["ifc-entity", "classification-element"])
822
942
  ]))), 128))
823
943
  ])
824
- ])) : W("", !0);
944
+ ])) : L("", !0);
825
945
  }
826
- }), nn = /* @__PURE__ */ te(tn, [["__scopeId", "data-v-d2d82ae7"]]), sn = (a) => {
827
- if (Pe(a)) {
946
+ }), on = /* @__PURE__ */ te(sn, [["__scopeId", "data-v-d2d82ae7"]]), an = (a) => {
947
+ if (we(a)) {
828
948
  const t = a.object;
829
949
  if (t.fragment != null && a.face && a.instanceId != null) {
830
950
  const e = t.fragment.getVertexBlockID(t.geometry, a.face.a), n = t.fragment.getItemID(a.instanceId, e).replace(/\..*/, "");
@@ -832,483 +952,195 @@ const qt = { class: "d-flex" }, Zt = ["title"], Jt = ["id"], Xt = { class: "list
832
952
  }
833
953
  }
834
954
  return null;
835
- }, on = (a) => ({
955
+ }, rn = (a) => ({
836
956
  name: a.filename,
837
957
  source: {
838
958
  url: a.file
839
959
  },
840
960
  type: "ifc",
841
961
  visible: !0
842
- }), an = (a, t) => {
843
- var f, v, c, m, w, I, P, T, r;
844
- if (!Pe(a))
962
+ }), ln = (a, t) => {
963
+ var d, p, r, u, h, f, g, C, _;
964
+ if (!we(a))
845
965
  return;
846
- const e = (f = a.features) == null ? void 0 : f.at(0);
966
+ const e = (d = a.features) == null ? void 0 : d.at(0);
847
967
  if (!e)
848
968
  return;
849
969
  t.has("IFC") || t.set("IFC", []);
850
- const n = t.get("IFC"), { ifcProperties: o, itemProperties: i } = e, s = "NULL", l = ((v = i.Name) == null ? void 0 : v.value) ?? s;
970
+ const n = t.get("IFC"), { ifcProperties: s, itemProperties: o } = e, i = "NULL", l = ((p = o.Name) == null ? void 0 : p.value) ?? i;
851
971
  n.push({
852
972
  key: "Site",
853
- value: ((m = (c = a.entity.object3d.userData) == null ? void 0 : c.dataset) == null ? void 0 : m.name) ?? s
973
+ value: ((u = (r = a.entity.object3d.userData) == null ? void 0 : r.dataset) == null ? void 0 : u.name) ?? i
854
974
  }), n.push({
855
975
  key: "IFCType",
856
- value: it[i.type] ?? s
857
- }), n.push({ key: "Name", value: l }), n.push({ key: "ID", value: i.expressID }), n.push({ key: "GlobalId", value: ((w = i.GlobalId) == null ? void 0 : w.value) ?? s }), ((I = i.Description) == null ? void 0 : I.value) != null && n.push({ key: "Description", value: i.Description.value }), ((P = i.PredefinedType) == null ? void 0 : P.value) != null && n.push({ key: "PredefinedType", value: i.PredefinedType.value }), ((T = i.ObjectType) == null ? void 0 : T.value) != null && n.push({ key: "ObjectType", value: i.ObjectType.value });
858
- for (const { name: h, parentName: d, value: u } of o)
859
- t.has(d) || t.set(d, []), (r = t.get(d)) == null || r.push({ key: h, value: u });
860
- }, rn = (a) => {
861
- const t = a.dataset, e = t.config, n = he(e.source.position ?? t.get("position")), o = new K({
976
+ value: nt[o.type] ?? i
977
+ }), n.push({ key: "Name", value: l }), n.push({ key: "ID", value: o.expressID }), n.push({ key: "GlobalId", value: ((h = o.GlobalId) == null ? void 0 : h.value) ?? i }), ((f = o.Description) == null ? void 0 : f.value) != null && n.push({ key: "Description", value: o.Description.value }), ((g = o.PredefinedType) == null ? void 0 : g.value) != null && n.push({ key: "PredefinedType", value: o.PredefinedType.value }), ((C = o.ObjectType) == null ? void 0 : C.value) != null && n.push({ key: "ObjectType", value: o.ObjectType.value });
978
+ for (const { name: y, parentName: x, value: E } of s)
979
+ t.has(x) || t.set(x, []), (_ = t.get(x)) == null || _.push({ key: y, value: E });
980
+ }, cn = (a) => {
981
+ const t = a.dataset, e = t.config, n = de(e.source.position ?? t.get("position")), s = new X({
862
982
  ...e.source,
863
983
  at: n,
864
984
  name: t.name
865
985
  });
866
- return Promise.resolve(o);
986
+ return Promise.resolve(s);
867
987
  };
868
- class Rn {
988
+ class jn {
869
989
  constructor() {
870
- p(this, "id", "builtin-ifc-loader");
871
- p(this, "name", "IFC");
990
+ c(this, "id", "builtin-ifc-loader");
991
+ c(this, "name", "IFC");
872
992
  }
873
993
  async initialize(t) {
874
994
  t.datasets.registerDatasetType("ifc", {
875
- attributeExtractor: an,
876
- entityBuilder: rn,
995
+ attributeExtractor: ln,
996
+ entityBuilder: cn,
877
997
  fileExtensions: ["ifc"],
878
- highlight: sn,
998
+ highlight: an,
879
999
  icon: "bi-building",
880
- loader: on,
1000
+ loader: rn,
881
1001
  name: "IFC",
882
- propertyView: nn
883
- }), qe.registerInspector("IfcEntity", Wt), await A.fetch("web-ifc.wasm").catch((e) => {
1002
+ propertyView: on
1003
+ }), Ye.registerInspector("IfcEntity", Jt), await k.fetch("web-ifc.wasm").catch((e) => {
884
1004
  console.warn("Could not load web-ifc.wasm", e);
885
1005
  });
886
1006
  }
887
1007
  }
888
- const ln = /* @__PURE__ */ Y({
1008
+ const un = /* @__PURE__ */ D({
889
1009
  __name: "OpenLayersMinimapComponent",
890
1010
  props: {
891
1011
  context: {}
892
1012
  },
893
1013
  setup(a) {
894
- const t = R(), e = Ge(), n = a, o = [
1014
+ const t = I(), e = Z(), n = a, s = [
895
1015
  [3e4, 12],
896
1016
  [5e4, 10],
897
1017
  [1e5, 8],
898
1018
  [4e5, 6],
899
1019
  [8e5, 4]
900
1020
  ];
901
- function i(s) {
902
- for (const [l, f] of o)
903
- if (s < l)
904
- return f;
905
- return o[o.length - 1][1];
1021
+ function o(i) {
1022
+ for (const [l, d] of s)
1023
+ if (i < l)
1024
+ return d;
1025
+ return s[s.length - 1][1];
906
1026
  }
907
- return Ye(() => {
908
- e.value = new rt({
1027
+ return Re(() => {
1028
+ e.value = new ot({
909
1029
  controls: [],
910
- layers: [new ct({ source: new ut() })],
1030
+ layers: [new at({ source: new rt() })],
911
1031
  target: t.value,
912
- view: new lt({
913
- center: ce([4, 44]),
1032
+ view: new it({
1033
+ center: le([4, 44]),
914
1034
  projection: "EPSG:3857",
915
1035
  zoom: 5
916
1036
  })
917
1037
  });
918
- let s = new j();
1038
+ let i = new F();
919
1039
  const l = () => {
920
- var I;
921
- const v = n.context.view.getInstance(), m = n.context.view.getCameraController().getCameraPosition(), w = m.camera.z;
922
- if (!m.camera.equals(s)) {
923
- s = m.camera.clone();
924
- const P = new Z(
925
- v.referenceCrs,
926
- s.x,
927
- s.y
928
- ).as("EPSG:4326"), T = i(w), r = (I = e.value) == null ? void 0 : I.getView();
929
- r == null || r.setCenter(ce([P.longitude, P.latitude])), r == null || r.setZoom(T);
1040
+ var f;
1041
+ const p = n.context.view.getInstance(), u = n.context.view.getCameraController().getCameraPosition(), h = u.camera.z;
1042
+ if (!u.camera.equals(i)) {
1043
+ i = u.camera.clone();
1044
+ const g = new H(
1045
+ p.referenceCrs,
1046
+ i.x,
1047
+ i.y
1048
+ ).as("EPSG:4326"), C = o(h), _ = (f = e.value) == null ? void 0 : f.getView();
1049
+ _ == null || _.setCenter(le([g.longitude, g.latitude])), _ == null || _.setZoom(C);
930
1050
  }
931
1051
  };
932
1052
  n.context.events.addEventListener("updated", l);
933
- let f = !1;
1053
+ let d = !1;
934
1054
  t.value && (t.value.onclick = () => {
935
- var v, c, m, w;
936
- f = !f, f ? ((v = t.value) == null || v.classList.add("collapsed"), (c = t.value) == null || c.classList.remove("expanded")) : ((m = t.value) == null || m.classList.remove("collapsed"), (w = t.value) == null || w.classList.add("expanded"));
1055
+ var p, r, u, h;
1056
+ d = !d, d ? ((p = t.value) == null || p.classList.add("collapsed"), (r = t.value) == null || r.classList.remove("expanded")) : ((u = t.value) == null || u.classList.remove("collapsed"), (h = t.value) == null || h.classList.add("expanded"));
937
1057
  });
938
- }), He(() => {
939
- var s;
940
- (s = e.value) == null || s.dispose(), e.value = void 0;
941
- }), (s, l) => (k(), D("div", {
1058
+ }), Ve(() => {
1059
+ var i;
1060
+ (i = e.value) == null || i.dispose(), e.value = void 0;
1061
+ }), (i, l) => (v(), P("div", {
942
1062
  ref_key: "target",
943
1063
  ref: t,
944
1064
  title: "Toggle minimap",
945
1065
  class: "minimap expanded"
946
1066
  }, null, 512));
947
1067
  }
948
- }), cn = /* @__PURE__ */ te(ln, [["__scopeId", "data-v-38ee3c04"]]);
949
- class jn {
1068
+ }), dn = /* @__PURE__ */ te(un, [["__scopeId", "data-v-38ee3c04"]]);
1069
+ class $n {
950
1070
  constructor() {
951
- p(this, "id", "builtin-minimap-openlayers");
952
- p(this, "name", "Minimap");
1071
+ c(this, "id", "builtin-minimap-openlayers");
1072
+ c(this, "name", "Minimap");
953
1073
  }
954
1074
  initialize(t) {
955
1075
  t.widgets.addWidget({
956
- component: cn,
1076
+ component: dn,
957
1077
  id: "minimap-ol"
958
1078
  });
959
1079
  }
960
1080
  }
961
- const M = new fe();
962
- let un = class extends Ae {
963
- constructor(t) {
964
- super(t), this.propertyNameMapping = {}, this.customPropertyMapping = {};
965
- }
966
- load(t, e, n, o) {
967
- const i = this, s = new ze(this.manager);
968
- s.setPath(this.path), s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(t, function(l) {
969
- try {
970
- e(i.parse(l));
971
- } catch (f) {
972
- o ? o(f) : console.error(f), i.manager.itemError(t);
973
- }
974
- }, n, o);
975
- }
976
- setPropertyNameMapping(t) {
977
- this.propertyNameMapping = t;
978
- }
979
- setCustomPropertyNameMapping(t) {
980
- this.customPropertyMapping = t;
981
- }
982
- parse(t) {
983
- function e(r, h = 0) {
984
- const d = /^ply([\s\S]*)end_header(\r\n|\r|\n)/;
985
- let u = "";
986
- const g = d.exec(r);
987
- g !== null && (u = g[1]);
988
- const y = {
989
- comments: [],
990
- elements: [],
991
- headerLength: h,
992
- objInfo: ""
993
- }, _ = u.split(/\r\n|\r|\n/);
994
- let b;
995
- function L(S, E) {
996
- const C = { type: S[0] };
997
- return C.type === "list" ? (C.name = S[3], C.countType = S[1], C.itemType = S[2]) : C.name = S[1], C.name in E && (C.name = E[C.name]), C;
998
- }
999
- for (let S = 0; S < _.length; S++) {
1000
- let E = _[S];
1001
- if (E = E.trim(), E === "") continue;
1002
- const C = E.split(/\s+/), H = C.shift();
1003
- switch (E = C.join(" "), H) {
1004
- case "format":
1005
- y.format = C[0], y.version = C[1];
1006
- break;
1007
- case "comment":
1008
- y.comments.push(E);
1009
- break;
1010
- case "element":
1011
- b !== void 0 && y.elements.push(b), b = {}, b.name = C[0], b.count = parseInt(C[1]), b.properties = [];
1012
- break;
1013
- case "property":
1014
- b.properties.push(L(C, T.propertyNameMapping));
1015
- break;
1016
- case "obj_info":
1017
- y.objInfo = E;
1018
- break;
1019
- default:
1020
- console.log("unhandled", H, C);
1021
- }
1022
- }
1023
- return b !== void 0 && y.elements.push(b), y;
1024
- }
1025
- function n(r, h) {
1026
- switch (h) {
1027
- case "char":
1028
- case "uchar":
1029
- case "short":
1030
- case "ushort":
1031
- case "int":
1032
- case "uint":
1033
- case "int8":
1034
- case "uint8":
1035
- case "int16":
1036
- case "uint16":
1037
- case "int32":
1038
- case "uint32":
1039
- return parseInt(r);
1040
- case "float":
1041
- case "double":
1042
- case "float32":
1043
- case "float64":
1044
- return parseFloat(r);
1045
- }
1046
- }
1047
- function o(r, h) {
1048
- const d = {};
1049
- for (let u = 0; u < r.length; u++) {
1050
- if (h.empty()) return null;
1051
- if (r[u].type === "list") {
1052
- const g = [], y = n(h.next(), r[u].countType);
1053
- for (let _ = 0; _ < y; _++) {
1054
- if (h.empty()) return null;
1055
- g.push(n(h.next(), r[u].itemType));
1056
- }
1057
- d[r[u].name] = g;
1058
- } else
1059
- d[r[u].name] = n(h.next(), r[u].type);
1060
- }
1061
- return d;
1062
- }
1063
- function i() {
1064
- const r = {
1065
- indices: [],
1066
- vertices: [],
1067
- normals: [],
1068
- uvs: [],
1069
- faceVertexUvs: [],
1070
- colors: [],
1071
- faceVertexColors: []
1072
- };
1073
- for (const h of Object.keys(T.customPropertyMapping))
1074
- r[h] = [];
1075
- return r;
1076
- }
1077
- function s(r) {
1078
- const h = r.map((u) => u.name);
1079
- function d(u) {
1080
- for (let g = 0, y = u.length; g < y; g++) {
1081
- const _ = u[g];
1082
- if (h.includes(_)) return _;
1083
- }
1084
- return null;
1085
- }
1086
- return {
1087
- attrX: d(["x", "px", "posx"]) || "x",
1088
- attrY: d(["y", "py", "posy"]) || "y",
1089
- attrZ: d(["z", "pz", "posz"]) || "z",
1090
- attrNX: d(["nx", "normalx"]),
1091
- attrNY: d(["ny", "normaly"]),
1092
- attrNZ: d(["nz", "normalz"]),
1093
- attrS: d(["s", "u", "texture_u", "tx"]),
1094
- attrT: d(["t", "v", "texture_v", "ty"]),
1095
- attrR: d(["red", "diffuse_red", "r", "diffuse_r"]),
1096
- attrG: d(["green", "diffuse_green", "g", "diffuse_g"]),
1097
- attrB: d(["blue", "diffuse_blue", "b", "diffuse_b"])
1098
- };
1099
- }
1100
- function l(r, h) {
1101
- const d = i(), u = /end_header\s+(\S[\s\S]*\S|\S)\s*$/;
1102
- let g, y;
1103
- (y = u.exec(r)) !== null ? g = y[1].split(/\s+/) : g = [];
1104
- const _ = new dn(g);
1105
- e: for (let b = 0; b < h.elements.length; b++) {
1106
- const L = h.elements[b], S = s(L.properties);
1107
- for (let E = 0; E < L.count; E++) {
1108
- const C = o(L.properties, _);
1109
- if (!C) break e;
1110
- v(d, L.name, C, S);
1111
- }
1112
- }
1113
- return f(d);
1114
- }
1115
- function f(r) {
1116
- let h = new Oe();
1117
- r.indices.length > 0 && h.setIndex(r.indices), h.setAttribute("position", new z(r.vertices, 3)), r.normals.length > 0 && h.setAttribute("normal", new z(r.normals, 3)), r.uvs.length > 0 && h.setAttribute("uv", new z(r.uvs, 2)), r.colors.length > 0 && h.setAttribute("color", new z(r.colors, 3)), (r.faceVertexUvs.length > 0 || r.faceVertexColors.length > 0) && (h = h.toNonIndexed(), r.faceVertexUvs.length > 0 && h.setAttribute("uv", new z(r.faceVertexUvs, 2)), r.faceVertexColors.length > 0 && h.setAttribute("color", new z(r.faceVertexColors, 3)));
1118
- for (const d of Object.keys(T.customPropertyMapping))
1119
- r[d].length > 0 && h.setAttribute(
1120
- d,
1121
- new z(
1122
- r[d],
1123
- T.customPropertyMapping[d].length
1124
- )
1125
- );
1126
- return h.computeBoundingSphere(), h;
1127
- }
1128
- function v(r, h, d, u) {
1129
- if (h === "vertex") {
1130
- r.vertices.push(d[u.attrX], d[u.attrY], d[u.attrZ]), u.attrNX !== null && u.attrNY !== null && u.attrNZ !== null && r.normals.push(d[u.attrNX], d[u.attrNY], d[u.attrNZ]), u.attrS !== null && u.attrT !== null && r.uvs.push(d[u.attrS], d[u.attrT]), u.attrR !== null && u.attrG !== null && u.attrB !== null && (M.setRGB(
1131
- d[u.attrR] / 255,
1132
- d[u.attrG] / 255,
1133
- d[u.attrB] / 255,
1134
- ie
1135
- ), r.colors.push(M.r, M.g, M.b));
1136
- for (const g of Object.keys(T.customPropertyMapping))
1137
- for (const y of T.customPropertyMapping[g])
1138
- r[g].push(d[y]);
1139
- } else if (h === "face") {
1140
- const g = d.vertex_indices || d.vertex_index, y = d.texcoord;
1141
- g.length === 3 ? (r.indices.push(g[0], g[1], g[2]), y && y.length === 6 && (r.faceVertexUvs.push(y[0], y[1]), r.faceVertexUvs.push(y[2], y[3]), r.faceVertexUvs.push(y[4], y[5]))) : g.length === 4 && (r.indices.push(g[0], g[1], g[3]), r.indices.push(g[1], g[2], g[3])), u.attrR !== null && u.attrG !== null && u.attrB !== null && (M.setRGB(
1142
- d[u.attrR] / 255,
1143
- d[u.attrG] / 255,
1144
- d[u.attrB] / 255,
1145
- ie
1146
- ), r.faceVertexColors.push(M.r, M.g, M.b), r.faceVertexColors.push(M.r, M.g, M.b), r.faceVertexColors.push(M.r, M.g, M.b));
1147
- }
1148
- }
1149
- function c(r, h) {
1150
- const d = {};
1151
- let u = 0;
1152
- for (let g = 0; g < h.length; g++) {
1153
- const y = h[g], _ = y.valueReader;
1154
- if (y.type === "list") {
1155
- const b = [], L = y.countReader.read(r + u);
1156
- u += y.countReader.size;
1157
- for (let S = 0; S < L; S++)
1158
- b.push(_.read(r + u)), u += _.size;
1159
- d[y.name] = b;
1160
- } else
1161
- d[y.name] = _.read(r + u), u += _.size;
1162
- }
1163
- return [d, u];
1164
- }
1165
- function m(r, h, d) {
1166
- function u(g, y, _) {
1167
- switch (y) {
1168
- // corespondences for non-specific length types here match rply:
1169
- case "int8":
1170
- case "char":
1171
- return { read: (b) => g.getInt8(b), size: 1 };
1172
- case "uint8":
1173
- case "uchar":
1174
- return { read: (b) => g.getUint8(b), size: 1 };
1175
- case "int16":
1176
- case "short":
1177
- return { read: (b) => g.getInt16(b, _), size: 2 };
1178
- case "uint16":
1179
- case "ushort":
1180
- return { read: (b) => g.getUint16(b, _), size: 2 };
1181
- case "int32":
1182
- case "int":
1183
- return { read: (b) => g.getInt32(b, _), size: 4 };
1184
- case "uint32":
1185
- case "uint":
1186
- return { read: (b) => g.getUint32(b, _), size: 4 };
1187
- case "float32":
1188
- case "float":
1189
- return { read: (b) => g.getFloat32(b, _), size: 4 };
1190
- case "float64":
1191
- case "double":
1192
- return { read: (b) => g.getFloat64(b, _), size: 8 };
1193
- }
1194
- }
1195
- for (let g = 0, y = r.length; g < y; g++) {
1196
- const _ = r[g];
1197
- _.type === "list" ? (_.countReader = u(h, _.countType, d), _.valueReader = u(h, _.itemType, d)) : _.valueReader = u(h, _.type, d);
1198
- }
1199
- }
1200
- function w(r, h) {
1201
- const d = i(), u = h.format === "binary_little_endian", g = new DataView(r, h.headerLength);
1202
- let y, _ = 0;
1203
- for (let b = 0; b < h.elements.length; b++) {
1204
- const L = h.elements[b], S = L.properties, E = s(S);
1205
- m(S, g, u);
1206
- for (let C = 0; C < L.count; C++) {
1207
- y = c(_, S), _ += y[1];
1208
- const H = y[0];
1209
- v(d, L.name, H, E);
1210
- }
1211
- }
1212
- return f(d);
1213
- }
1214
- function I(r) {
1215
- let h = 0, d = !0, u = "";
1216
- const g = [], y = new TextDecoder().decode(r.subarray(0, 5)), _ = /^ply\r\n/.test(y);
1217
- do {
1218
- const b = String.fromCharCode(r[h++]);
1219
- b !== `
1220
- ` && b !== "\r" ? u += b : (u === "end_header" && (d = !1), u !== "" && (g.push(u), u = ""));
1221
- } while (d && h < r.length);
1222
- return _ === !0 && h++, { headerText: g.join("\r") + "\r", headerLength: h };
1223
- }
1224
- let P;
1225
- const T = this;
1226
- if (t instanceof ArrayBuffer) {
1227
- const r = new Uint8Array(t), { headerText: h, headerLength: d } = I(r), u = e(h, d);
1228
- if (u.format === "ascii") {
1229
- const g = new TextDecoder().decode(r);
1230
- P = l(g, u);
1231
- } else
1232
- P = w(t, u);
1233
- } else
1234
- P = l(t, e(t));
1235
- return P;
1236
- }
1237
- };
1238
- class dn {
1239
- constructor(t) {
1240
- this.arr = t, this.i = 0;
1241
- }
1242
- empty() {
1243
- return this.i >= this.arr.length;
1244
- }
1245
- next() {
1246
- return this.arr[this.i++];
1247
- }
1248
- }
1249
- const $ = class $ extends pe {
1081
+ const j = class j extends K {
1250
1082
  constructor() {
1251
1083
  super(...arguments);
1252
- p(this, "isPickableFeatures", !0);
1253
- p(this, "isPlyMesh", !0);
1084
+ c(this, "isPickableFeatures", !0);
1085
+ c(this, "isPlyMesh", !0);
1254
1086
  }
1255
1087
  pickFeaturesFrom(e) {
1256
1088
  if (this.geometry.hasAttribute("color") && e.face) {
1257
- const n = this.geometry.getAttribute("color").array, o = e.face, s = [{ color: new fe(
1258
- n[o.a * 3],
1259
- n[o.a * 3 + 1],
1260
- n[o.a * 3 + 2]
1089
+ const n = this.geometry.getAttribute("color").array, s = e.face, i = [{ color: new je(
1090
+ n[s.a * 3],
1091
+ n[s.a * 3 + 1],
1092
+ n[s.a * 3 + 2]
1261
1093
  ) }];
1262
- return e.features = s, s;
1094
+ return e.features = i, i;
1263
1095
  }
1264
1096
  return [];
1265
1097
  }
1266
1098
  };
1267
- p($, "isPlyMesh", (e) => G(e) && e.isPlyMesh), p($, "isPlyPickResult", (e) => G(e) && $.isPlyMesh(e == null ? void 0 : e.object));
1268
- let q = $;
1269
- class pn extends be {
1099
+ c(j, "isPlyMesh", (e) => $(e) && e.isPlyMesh), c(j, "isPlyPickResult", (e) => $(e) && j.isPlyMesh(e == null ? void 0 : e.object));
1100
+ let U = j;
1101
+ class pn extends fe {
1270
1102
  constructor(e) {
1271
- super(new me());
1272
- p(this, "isPlyEntity", !0);
1273
- p(this, "source");
1103
+ super(new ue());
1104
+ c(this, "isPlyEntity", !0);
1105
+ c(this, "source");
1274
1106
  this.source = e;
1275
1107
  }
1276
1108
  async preprocess() {
1277
- const e = await A.fetchArrayBuffer(this.source.url), n = this.source.at.as(this.source.featureProjection).toVector3(), i = new un().parse(e), s = new Re({
1278
- side: je
1109
+ const e = await k.fetchArrayBuffer(this.source.url), n = this.source.at.as(this.source.featureProjection).toVector3(), o = new Oe().parse(e), i = new Ae({
1110
+ side: ze
1279
1111
  });
1280
- i.hasAttribute("color") && (s.vertexColors = !0), i.computeVertexNormals();
1281
- const l = new q(i, s);
1282
- l.name = "plyModel", i.computeBoundingBox(), l.position.copy(n), l.updateWorldMatrix(!0, !0), this.object3d.add(l), this.onObjectCreated(l);
1283
- const f = A.getContext(this.source.url);
1284
- ee(this, { filename: f.filename }), this.notifyChange(this.object3d);
1112
+ o.hasAttribute("color") && (i.vertexColors = !0), o.computeVertexNormals();
1113
+ const l = new U(o, i);
1114
+ l.name = "plyModel", o.computeBoundingBox(), l.position.copy(n), l.updateWorldMatrix(!0, !0), this.object3d.add(l), this.onObjectCreated(l);
1115
+ const d = k.getContext(this.source.url);
1116
+ ee(this, { filename: d.filename }), this.notifyChange(this.object3d);
1285
1117
  }
1286
1118
  }
1287
- const mn = (a) => {
1288
- const { dataset: t, instance: e } = a, n = t.config, o = he(n.source.position ?? t.get("position")), i = new pn({
1119
+ const hn = (a) => {
1120
+ const { dataset: t, instance: e } = a, n = t.config, s = de(n.source.position ?? t.get("position")), o = new pn({
1289
1121
  ...n.source,
1290
- at: o,
1122
+ at: s,
1291
1123
  featureProjection: e.referenceCrs
1292
1124
  });
1293
- return Promise.resolve(i);
1294
- }, hn = (a, t) => {
1295
- var o;
1296
- if (!q.isPlyPickResult(a))
1125
+ return Promise.resolve(o);
1126
+ }, mn = (a, t) => {
1127
+ var s;
1128
+ if (!U.isPlyPickResult(a))
1297
1129
  return;
1298
- const e = (o = a.features) == null ? void 0 : o.at(0);
1130
+ const e = (s = a.features) == null ? void 0 : s.at(0);
1299
1131
  if (!e)
1300
1132
  return;
1301
1133
  t.has("PLY") || t.set("PLY", []), t.get("PLY").push({ key: "Color", value: e.color });
1302
1134
  };
1303
- class Un {
1135
+ class Hn {
1304
1136
  constructor() {
1305
- p(this, "id", "builtin-ply-loader");
1306
- p(this, "name", "PLY");
1137
+ c(this, "id", "builtin-ply-loader");
1138
+ c(this, "name", "PLY");
1307
1139
  }
1308
1140
  initialize(t) {
1309
1141
  t.datasets.registerDatasetType("ply", {
1310
- attributeExtractor: hn,
1311
- entityBuilder: mn,
1142
+ attributeExtractor: mn,
1143
+ entityBuilder: hn,
1312
1144
  icon: "bi-file-earmark-binary",
1313
1145
  name: "PLY"
1314
1146
  });
@@ -1317,17 +1149,17 @@ class Un {
1317
1149
  const fn = (a) => {
1318
1150
  a.addEventListener("object-created", (t) => {
1319
1151
  t.obj.traverse((n) => {
1320
- var o;
1321
- ((o = n.userData) == null ? void 0 : o.class) === "IfcSpace" && (n.visible = !1);
1152
+ var s;
1153
+ ((s = n.userData) == null ? void 0 : s.class) === "IfcSpace" && (n.visible = !1);
1322
1154
  });
1323
1155
  });
1324
1156
  };
1325
- class $n {
1157
+ class Rn {
1326
1158
  constructor() {
1327
- p(this, "id", "builtin-post-process-entities");
1328
- p(this, "name", "Post-process 3D Tiles");
1329
- p(this, "_alreadyProcessedEntities", /* @__PURE__ */ new Set());
1330
- p(this, "_processings", [fn]);
1159
+ c(this, "id", "builtin-post-process-entities");
1160
+ c(this, "name", "Post-process 3D Tiles");
1161
+ c(this, "_alreadyProcessedEntities", /* @__PURE__ */ new Set());
1162
+ c(this, "_processings", [fn]);
1331
1163
  }
1332
1164
  initialize(t) {
1333
1165
  t.events.addEventListener("ready", () => {
@@ -1337,26 +1169,26 @@ class $n {
1337
1169
  }
1338
1170
  processEntities(t) {
1339
1171
  for (const e of t.getEntities())
1340
- this._alreadyProcessedEntities.has(e.id) || (ve(e) && this.processEntity(e, t), this._alreadyProcessedEntities.add(e.id));
1172
+ this._alreadyProcessedEntities.has(e.id) || (ge(e) && this.processEntity(e, t), this._alreadyProcessedEntities.add(e.id));
1341
1173
  }
1342
1174
  processEntity(t, e) {
1343
1175
  const n = { instance: e };
1344
- for (const o of this._processings)
1345
- o(t, n);
1176
+ for (const s of this._processings)
1177
+ s(t, n);
1346
1178
  }
1347
1179
  }
1348
1180
  const gn = (a) => {
1349
- const t = a.dataset.config, e = new dt({
1350
- source: new pt({ url: `${t.source.url}/${t.source.filename}` })
1181
+ const t = a.dataset.config, e = new lt({
1182
+ source: new ct({ url: `${t.source.url}/${t.source.filename}` })
1351
1183
  });
1352
1184
  return ee(e, {
1353
1185
  filename: t.source.url
1354
1186
  }), Promise.resolve(e);
1355
1187
  };
1356
- class Gn {
1188
+ class Vn {
1357
1189
  constructor() {
1358
- p(this, "id", "builtin-potree-loader");
1359
- p(this, "name", "Potree");
1190
+ c(this, "id", "builtin-potree-loader");
1191
+ c(this, "name", "Potree");
1360
1192
  }
1361
1193
  initialize(t) {
1362
1194
  t.datasets.registerDatasetType("potree", {
@@ -1366,54 +1198,54 @@ class Gn {
1366
1198
  });
1367
1199
  }
1368
1200
  }
1369
- class Yn {
1201
+ class Un {
1370
1202
  constructor() {
1371
- p(this, "id", "builtin-tour");
1372
- p(this, "name", "Tour");
1373
- p(this, "_camera", null);
1374
- p(this, "_cameraCallback", null);
1375
- p(this, "_context", null);
1376
- p(this, "_tours", null);
1203
+ c(this, "id", "builtin-tour");
1204
+ c(this, "name", "Tour");
1205
+ c(this, "_camera", null);
1206
+ c(this, "_cameraCallback", null);
1207
+ c(this, "_context", null);
1208
+ c(this, "_tours", null);
1377
1209
  }
1378
1210
  initialize(t) {
1379
1211
  this._context = t, t.events.addEventListener("ready", this.start.bind(this));
1380
1212
  }
1381
1213
  buildTours() {
1382
- const t = this._camera, e = new F.Tour({
1214
+ const t = this._camera, e = new w.Tour({
1383
1215
  tourName: "main",
1384
1216
  useModalOverlay: !0
1385
- }), n = new F.Tour({
1217
+ }), n = new w.Tour({
1386
1218
  tourName: "navigating",
1387
1219
  useModalOverlay: !0
1388
- }), o = new F.Tour({
1220
+ }), s = new w.Tour({
1389
1221
  tourName: "analyzing",
1390
1222
  useModalOverlay: !0
1391
- }), i = [
1223
+ }), o = [
1392
1224
  { action: () => {
1393
- var c;
1394
- return (c = F.activeTour) == null ? void 0 : c.next();
1225
+ var r;
1226
+ return (r = w.activeTour) == null ? void 0 : r.next();
1395
1227
  }, text: "Next" },
1396
1228
  { action: () => {
1397
- var c;
1398
- return (c = F.activeTour) == null ? void 0 : c.cancel();
1229
+ var r;
1230
+ return (r = w.activeTour) == null ? void 0 : r.cancel();
1399
1231
  }, secondary: !0, text: "Exit" }
1400
- ], s = () => {
1401
- var r, h;
1402
- const c = (r = F.activeTour) == null ? void 0 : r.getCurrentStep(), m = c == null ? void 0 : c.getElement(), w = m == null ? void 0 : m.querySelector(".shepherd-text"), I = (h = F.activeTour) == null ? void 0 : h.steps;
1403
- if (c == null || m == null || w == null || I == null)
1232
+ ], i = () => {
1233
+ var _, y;
1234
+ const r = (_ = w.activeTour) == null ? void 0 : _.getCurrentStep(), u = r == null ? void 0 : r.getElement(), h = u == null ? void 0 : u.querySelector(".shepherd-text"), f = (y = w.activeTour) == null ? void 0 : y.steps;
1235
+ if (r == null || u == null || h == null || f == null)
1404
1236
  return;
1405
- const P = document.createElement("div");
1406
- P.className = "progress mt-3", P.setAttribute("role", "progressbar"), P.style.height = "2px";
1407
- const T = document.createElement("div");
1408
- T.className = "progress-bar bg-success", T.style.width = `${100 * (I.indexOf(c) / I.length)}%`, P.appendChild(T), w.appendChild(P);
1409
- }, l = async (c, m) => new Promise((w) => {
1410
- const I = document.getElementById(c);
1411
- if (I && !I.classList.contains("active") && I.click(), document.querySelector(m))
1412
- return w(document.querySelector(m));
1413
- const P = new MutationObserver(() => {
1414
- document.querySelector(m) && (P.disconnect(), w(document.querySelector(m)));
1237
+ const g = document.createElement("div");
1238
+ g.className = "progress mt-3", g.setAttribute("role", "progressbar"), g.style.height = "2px";
1239
+ const C = document.createElement("div");
1240
+ C.className = "progress-bar bg-success", C.style.width = `${100 * (f.indexOf(r) / f.length)}%`, g.appendChild(C), h.appendChild(g);
1241
+ }, l = async (r, u) => new Promise((h) => {
1242
+ const f = document.getElementById(r);
1243
+ if (f && !f.classList.contains("active") && f.click(), document.querySelector(u))
1244
+ return h(document.querySelector(u));
1245
+ const g = new MutationObserver(() => {
1246
+ document.querySelector(u) && (g.disconnect(), h(document.querySelector(u)));
1415
1247
  });
1416
- P.observe(document.body, {
1248
+ g.observe(document.body, {
1417
1249
  childList: !0,
1418
1250
  subtree: !0
1419
1251
  });
@@ -1422,22 +1254,22 @@ class Yn {
1422
1254
  buttons: [
1423
1255
  {
1424
1256
  action: () => {
1425
- var c;
1426
- (c = F.activeTour) == null || c.complete(), n.show(0);
1257
+ var r;
1258
+ (r = w.activeTour) == null || r.complete(), n.show(0);
1427
1259
  },
1428
1260
  text: "Navigating"
1429
1261
  },
1430
1262
  {
1431
1263
  action: () => {
1432
- var c;
1433
- (c = F.activeTour) == null || c.complete(), o.show(0);
1264
+ var r;
1265
+ (r = w.activeTour) == null || r.complete(), s.show(0);
1434
1266
  },
1435
1267
  text: "Analyzing data"
1436
1268
  },
1437
1269
  {
1438
1270
  action: () => {
1439
- var c;
1440
- return (c = F.activeTour) == null ? void 0 : c.cancel();
1271
+ var r;
1272
+ return (r = w.activeTour) == null ? void 0 : r.cancel();
1441
1273
  },
1442
1274
  secondary: !0,
1443
1275
  text: "Exit"
@@ -1448,25 +1280,25 @@ class Yn {
1448
1280
  text: "<p>Welcome to <strong>Piero</strong>, the Giro3D application.<br/>We can guide you through the different features.</p>",
1449
1281
  title: "Welcome!",
1450
1282
  when: {
1451
- show: s
1283
+ show: i
1452
1284
  }
1453
1285
  }), n.addStep({
1454
1286
  attachTo: {
1455
1287
  element: "#main-view",
1456
1288
  on: "bottom"
1457
1289
  },
1458
- buttons: i,
1290
+ buttons: o,
1459
1291
  id: "view",
1460
1292
  text: "<p>This is the <b>main view</b>.</p><p>Giro3D natively supports a broad range of data sources, from 2D raster and vector data, to 3D point clouds and tilesets.</p><p>Piero adds support for CityJSON and IFC files.</p>",
1461
1293
  when: {
1462
- show: s
1294
+ show: i
1463
1295
  }
1464
1296
  }), n.addStep({
1465
1297
  attachTo: {
1466
1298
  element: "#main-view",
1467
1299
  on: "bottom"
1468
1300
  },
1469
- buttons: i,
1301
+ buttons: o,
1470
1302
  id: "navigate",
1471
1303
  text: '<p>This application integrates <a href="https://github.com/yomotsu/camera-controls">camera-controls</a>, a camera control for three.js.</p><p><b>Click</b> to move the camera. <b>Right-click</b> to rotate around a point. <b>Scroll</b> to zoom in or out.</p>',
1472
1304
  when: {
@@ -1474,11 +1306,11 @@ class Yn {
1474
1306
  this._cameraCallback && t.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
1475
1307
  },
1476
1308
  show: () => {
1477
- let c = 0;
1309
+ let r = 0;
1478
1310
  this._cameraCallback = () => {
1479
- var m;
1480
- c += 1, c > 2 && ((m = F.activeTour) == null || m.next());
1481
- }, t.addEventListener("interaction-end", this._cameraCallback), s();
1311
+ var u;
1312
+ r += 1, r > 2 && ((u = w.activeTour) == null || u.next());
1313
+ }, t.addEventListener("interaction-end", this._cameraCallback), i();
1482
1314
  }
1483
1315
  }
1484
1316
  }), n.addStep({
@@ -1487,11 +1319,11 @@ class Yn {
1487
1319
  on: "right"
1488
1320
  },
1489
1321
  beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1490
- buttons: i,
1322
+ buttons: o,
1491
1323
  id: "toolbar-layers",
1492
1324
  text: "<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>",
1493
1325
  when: {
1494
- show: s
1326
+ show: i
1495
1327
  }
1496
1328
  }), n.addStep({
1497
1329
  attachTo: {
@@ -1499,11 +1331,11 @@ class Yn {
1499
1331
  on: "right"
1500
1332
  },
1501
1333
  beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1502
- buttons: i,
1334
+ buttons: o,
1503
1335
  id: "basemaps",
1504
1336
  text: "<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>",
1505
1337
  when: {
1506
- show: s
1338
+ show: i
1507
1339
  }
1508
1340
  }), n.addStep({
1509
1341
  attachTo: {
@@ -1511,11 +1343,11 @@ class Yn {
1511
1343
  on: "right"
1512
1344
  },
1513
1345
  beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1514
- buttons: i,
1346
+ buttons: o,
1515
1347
  id: "overlays",
1516
1348
  text: "<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>",
1517
1349
  when: {
1518
- show: s
1350
+ show: i
1519
1351
  }
1520
1352
  }), n.addStep({
1521
1353
  attachTo: {
@@ -1523,11 +1355,11 @@ class Yn {
1523
1355
  on: "right"
1524
1356
  },
1525
1357
  beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1526
- buttons: i,
1358
+ buttons: o,
1527
1359
  id: "layers",
1528
1360
  text: "<p>The <b>Datasets</b> panel contains all 3D objects in the scene.</><p>You can toggle their visibility and delete them.<p><p>Most objects leverage Giro3D's adaptive resolution to optimize their display.</p>",
1529
1361
  when: {
1530
- show: s
1362
+ show: i
1531
1363
  }
1532
1364
  }), n.addStep({
1533
1365
  attachTo: {
@@ -1535,22 +1367,22 @@ class Yn {
1535
1367
  on: "right"
1536
1368
  },
1537
1369
  beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1538
- buttons: i,
1370
+ buttons: o,
1539
1371
  id: "adddata",
1540
1372
  text: "<p>You can add your own data from your computer by <b>dragging the file</b> into this page.</p><p>While you won't benefit from Giro3D's tiling mechanism, this can be a great way to quickly visualize datasets up to 100MB.</p><p>This application supports CityJSONs, IFCs, LAS/LAZs, CSV pointclouds, and simple GeoJSON features.</p>",
1541
1373
  when: {
1542
- show: s
1374
+ show: i
1543
1375
  }
1544
1376
  }), n.addStep({
1545
1377
  attachTo: {
1546
1378
  element: "#main-view",
1547
1379
  on: "bottom"
1548
1380
  },
1549
- buttons: i,
1381
+ buttons: o,
1550
1382
  id: "attributes",
1551
1383
  text: "<p>By clicking on any feature on the map, you can see its <strong>Attribute table</strong>. Clickable features display a cursor when hovered.</p>",
1552
1384
  when: {
1553
- show: s
1385
+ show: i
1554
1386
  }
1555
1387
  }), n.addStep({
1556
1388
  attachTo: {
@@ -1560,15 +1392,15 @@ class Yn {
1560
1392
  buttons: [
1561
1393
  {
1562
1394
  action: () => {
1563
- var c;
1564
- (c = F.activeTour) == null || c.complete(), o.show(0);
1395
+ var r;
1396
+ (r = w.activeTour) == null || r.complete(), s.show(0);
1565
1397
  },
1566
1398
  text: "Analyzing data"
1567
1399
  },
1568
1400
  {
1569
1401
  action: () => {
1570
- var c;
1571
- return (c = F.activeTour) == null ? void 0 : c.complete();
1402
+ var r;
1403
+ return (r = w.activeTour) == null ? void 0 : r.complete();
1572
1404
  },
1573
1405
  secondary: !0,
1574
1406
  text: "Exit"
@@ -1577,69 +1409,69 @@ class Yn {
1577
1409
  id: "widgets",
1578
1410
  text: "Giro3D is highly extensible. Here we added a widget to search and navigate to locations based on the French address database.",
1579
1411
  when: {
1580
- show: s
1412
+ show: i
1581
1413
  }
1582
- }), o.addStep({
1414
+ }), s.addStep({
1583
1415
  attachTo: {
1584
1416
  element: "#annotations-fieldset",
1585
1417
  on: "right"
1586
1418
  },
1587
1419
  beforeShowPromise: () => l("toolbar-annotations", "#annotations-fieldset"),
1588
- buttons: i,
1420
+ buttons: o,
1589
1421
  id: "annotation",
1590
1422
  text: "<p>You can <strong>annotate</strong> any data displayed using Giro3D native tools.<br>Select the <strong>geometry</strong> of your annotation, and <strong>click</strong> on the scene to add points. <strong>Right-click</strong> to end the shape.</p>",
1591
1423
  when: {
1592
- show: s
1424
+ show: i
1593
1425
  }
1594
- }), o.addStep({
1426
+ }), s.addStep({
1595
1427
  attachTo: {
1596
1428
  element: "#annotations-fieldset",
1597
1429
  on: "right"
1598
1430
  },
1599
1431
  beforeShowPromise: () => l("toolbar-annotations", "#annotations-fieldset"),
1600
- buttons: i,
1432
+ buttons: o,
1601
1433
  id: "annotations",
1602
1434
  text: "You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.",
1603
1435
  when: {
1604
- show: s
1436
+ show: i
1605
1437
  }
1606
- }), Ve("measurements") && o.addStep({
1438
+ }), $e("measurements") && s.addStep({
1607
1439
  attachTo: {
1608
1440
  element: "#panel-container",
1609
1441
  on: "right"
1610
1442
  },
1611
1443
  beforeShowPromise: () => l("toolbar-measures", "#measures-fieldset"),
1612
- buttons: i,
1444
+ buttons: o,
1613
1445
  id: "measurements",
1614
1446
  text: "You can add <strong>measurements</strong> to easily get distances betwween objects.<br>Once started, moving the mouse will display the measure. <strong>Click</strong> to save the measurement. <strong>Right-click</strong> to end.",
1615
1447
  when: {
1616
- show: s
1448
+ show: i
1617
1449
  }
1618
- }), o.addStep({
1450
+ }), s.addStep({
1619
1451
  attachTo: {
1620
1452
  element: "#panel-container",
1621
1453
  on: "right"
1622
1454
  },
1623
1455
  beforeShowPromise: () => l("toolbar-analysis", "#panel-container .card"),
1624
1456
  buttons: [{ action: () => {
1625
- var c;
1626
- return (c = F.activeTour) == null ? void 0 : c.complete();
1457
+ var r;
1458
+ return (r = w.activeTour) == null ? void 0 : r.complete();
1627
1459
  }, text: "Done!" }],
1628
1460
  id: "analysis",
1629
1461
  text: "In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.",
1630
1462
  when: {
1631
- show: s
1463
+ show: i
1632
1464
  }
1633
1465
  });
1634
- const f = () => {
1635
- const c = new URL(document.URL);
1636
- c.searchParams.delete("tourStep"), c.searchParams.set("tour", "none"), window.history.replaceState({}, "", c.toString());
1637
- }, v = (c) => {
1638
- const m = new URL(document.URL);
1639
- let w = "main";
1640
- c.tour.id.startsWith("navigating") ? w = "navigating" : c.tour.id.startsWith("analyzing") && (w = "analyzing"), m.searchParams.set("tour", w), m.searchParams.set("tourStep", c.step.id), window.history.replaceState({}, "", m.toString());
1466
+ const d = () => {
1467
+ const r = new URL(document.URL);
1468
+ r.searchParams.delete("tourStep"), r.searchParams.set("tour", "none"), window.history.replaceState({}, "", r.toString());
1469
+ }, p = (r) => {
1470
+ const u = new URL(document.URL);
1471
+ let h = "main";
1472
+ r.tour.id.startsWith("navigating") ? h = "navigating" : r.tour.id.startsWith("analyzing") && (h = "analyzing"), u.searchParams.set("tour", h), u.searchParams.set("tourStep", r.step.id), window.history.replaceState({}, "", u.toString());
1641
1473
  };
1642
- return e.on("cancel", f), e.on("complete", f), e.on("show", v), n.on("cancel", f), n.on("complete", f), n.on("show", v), o.on("cancel", f), o.on("complete", f), o.on("show", v), { analyzingTour: o, mainTour: e, navigatingTour: n };
1474
+ return e.on("cancel", d), e.on("complete", d), e.on("show", p), n.on("cancel", d), n.on("complete", d), n.on("show", p), s.on("cancel", d), s.on("complete", d), s.on("show", p), { analyzingTour: s, mainTour: e, navigatingTour: n };
1643
1475
  }
1644
1476
  getTours() {
1645
1477
  return this._tours || (this._tours = this.buildTours()), this._tours;
@@ -1653,25 +1485,25 @@ class Yn {
1653
1485
  throw new Error("module is not initialized");
1654
1486
  const { analyzingTour: t, mainTour: e, navigatingTour: n } = this.getTours();
1655
1487
  this._camera = this._context.view.getCameraController();
1656
- const o = new URL(document.URL), i = o.searchParams.get("tour") ?? "main";
1657
- if (i !== "none") {
1658
- const s = o.searchParams.get("tourStep") ?? 0;
1659
- i === "navigating" ? n.show(s) : i === "analyzing" ? t.show(s) : e.show(s);
1488
+ const s = new URL(document.URL), o = s.searchParams.get("tour") ?? "main";
1489
+ if (o !== "none") {
1490
+ const i = s.searchParams.get("tourStep") ?? 0;
1491
+ o === "navigating" ? n.show(i) : o === "analyzing" ? t.show(i) : e.show(i);
1660
1492
  }
1661
1493
  }
1662
1494
  }
1663
1495
  export {
1664
- qn as ClippingBoxAnalysis,
1665
- zn as CoordinatesSearch,
1666
- Dn as CrossSectionAnalysis,
1496
+ Wn as ClippingBoxAnalysis,
1497
+ An as CoordinatesSearch,
1498
+ Bn as CrossSectionAnalysis,
1667
1499
  Nn as DownloadDataset,
1668
- An as FloodingPlaneAnalysis,
1669
- On as FrenchBanGeocoder,
1670
- Rn as IFCLoader,
1671
- jn as OpenLayersMinimap,
1672
- Un as PLYLoader,
1673
- $n as PostProcessEntities,
1674
- Gn as PotreeLoader,
1675
- Yn as Tour
1500
+ On as FloodingPlaneAnalysis,
1501
+ zn as FrenchBanGeocoder,
1502
+ jn as IFCLoader,
1503
+ $n as OpenLayersMinimap,
1504
+ Hn as PLYLoader,
1505
+ Rn as PostProcessEntities,
1506
+ Vn as PotreeLoader,
1507
+ Un as Tour
1676
1508
  };
1677
1509
  //# sourceMappingURL=modules.es.js.map