baselode 0.1.21 → 0.1.23

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,120 +1,120 @@
1
- import * as f from "three";
2
- import { OrbitControls as it } from "three/examples/jsm/controls/OrbitControls";
3
- import { FlyControls as st } from "three/examples/jsm/controls/FlyControls";
4
- import { ViewportGizmo as at } from "three-viewport-gizmo";
5
- import { EffectComposer as lt } from "three/examples/jsm/postprocessing/EffectComposer.js";
6
- import { RenderPass as ct } from "three/examples/jsm/postprocessing/RenderPass.js";
7
- import { OutlinePass as ut } from "three/examples/jsm/postprocessing/OutlinePass.js";
8
- import mt from "papaparse";
9
- const lr = "datasource", H = "hole_id", dt = "_collar_id", we = "datasource_hole_id", cr = "hole_type", ur = "max_depth", mr = "surface_sample_id", ft = "surface_sample_type", ht = "datasource_surface_sample_id", xe = "project_id", bt = "report_number", ue = "latitude", me = "longitude", de = "elevation", fe = "easting", he = "northing", be = "crs", dr = "date_start", fr = "date_end", W = "azimuth", K = "dip", hr = "survey_type", pt = "sample_id", br = "datasource_sample_id", ne = "from", Q = "to", pe = "mid", ge = "depth", gt = "strike", Fe = "alpha", ve = "beta", Ie = "geology_code", Ce = "geology_description", yt = "comments", G = "extra", pr = -999.25, gr = -999.25, yr = {
1
+ import * as d from "three";
2
+ import { OrbitControls as ct } from "three/examples/jsm/controls/OrbitControls";
3
+ import { FlyControls as ut } from "three/examples/jsm/controls/FlyControls";
4
+ import { ViewportGizmo as mt } from "three-viewport-gizmo";
5
+ import { EffectComposer as dt } from "three/examples/jsm/postprocessing/EffectComposer.js";
6
+ import { RenderPass as ft } from "three/examples/jsm/postprocessing/RenderPass.js";
7
+ import { OutlinePass as ht } from "three/examples/jsm/postprocessing/OutlinePass.js";
8
+ import bt from "papaparse";
9
+ const hr = "datasource", H = "hole_id", pt = "_collar_id", xe = "datasource_hole_id", br = "hole_type", pr = "max_depth", gr = "surface_sample_id", gt = "surface_sample_type", yt = "datasource_surface_sample_id", ve = "project_id", _t = "report_number", me = "latitude", de = "longitude", fe = "elevation", he = "easting", be = "northing", pe = "crs", yr = "date_start", _r = "date_end", K = "azimuth", J = "dip", Mr = "survey_type", Mt = "sample_id", Er = "datasource_sample_id", re = "from", ee = "to", ge = "mid", ye = "depth", Et = "strike", Fe = "alpha", Ce = "beta", Ie = "geology_code", Te = "geology_description", zt = "comments", G = "extra", zr = -999.25, Nr = -999.25, Or = {
10
10
  // A unique hole identifier across the entire dataset and all future data sets
11
11
  [H]: "string",
12
12
  // The hole ID from the original collar source
13
- [we]: "string",
14
- // The project ID or project code from the original collar source, if available
15
13
  [xe]: "string",
14
+ // The project ID or project code from the original collar source, if available
15
+ [ve]: "string",
16
16
  // The latitude of the collar, in decimal degrees (WGS84)
17
- [ue]: "number",
18
- // The longitude of the collar, in decimal degrees (WGS84)
19
17
  [me]: "number",
20
- // The elevation of the collar, in meters above sea level (WGS84)
18
+ // The longitude of the collar, in decimal degrees (WGS84)
21
19
  [de]: "number",
22
- // The easting coordinate of the collar, in meters (projected CRS)
20
+ // The elevation of the collar, in meters above sea level (WGS84)
23
21
  [fe]: "number",
24
- // The northing coordinate of the collar, in meters (projected CRS)
22
+ // The easting coordinate of the collar, in meters (projected CRS)
25
23
  [he]: "number",
24
+ // The northing coordinate of the collar, in meters (projected CRS)
25
+ [be]: "number",
26
26
  // The coordinate reference system of the collar coordinates for easting/northing,
27
27
  // as an EPSG code or proj string
28
- [be]: "string",
28
+ [pe]: "string",
29
29
  // Internal join key used by source schemas (e.g. raw_gswa) — distinct from
30
30
  // the public hole_id.
31
- [dt]: "string",
31
+ [pt]: "string",
32
32
  // Per-row dict of source-specific fields outside the canonical schema
33
33
  // (populated by `bundleExtras`; empty object when the source had nothing extra).
34
34
  [G]: "object"
35
- }, _r = {
35
+ }, Lr = {
36
36
  // The unique hole id that maps to the collar and any other data tables
37
37
  [H]: "string",
38
38
  // The depth along the hole where the survey measurement was taken / started
39
- [ge]: "number",
39
+ [ye]: "number",
40
40
  // The depth along the hole where the survey measurement ended, if applicable
41
41
  // (some surveys are point measurements and may not have a 'to' depth)
42
- [Q]: "number",
42
+ [ee]: "number",
43
43
  // The azimuth of the hole at the survey depth, in degrees from north
44
- [W]: "number",
44
+ [K]: "number",
45
45
  // The dip of the hole at the survey depth, in degrees from horizontal
46
46
  // (negative values indicate downward inclination)
47
- [K]: "number",
47
+ [J]: "number",
48
48
  // Per-row dict of source-specific fields outside the canonical schema.
49
49
  [G]: "object"
50
- }, Mr = {
50
+ }, Ar = {
51
51
  // The unique hole id that maps to the collar and any other data tables
52
52
  [H]: "string",
53
53
  // The depth along the hole where the assay interval starts
54
- [ne]: "number",
54
+ [re]: "number",
55
55
  // The depth along the hole where the assay interval ends
56
- [Q]: "number",
56
+ [ee]: "number",
57
57
  // The midpoint depth of the assay interval
58
- [pe]: "number",
58
+ [ge]: "number",
59
59
  // assay value columns are variable and not standardized here.
60
60
  // Assays may be flattened (one column per assay type) or long
61
61
  // (one row per assay type with an additional 'assay_type' column).
62
62
  // Per-row dict of source-specific fields outside the canonical schema
63
63
  // (sample identifiers, lab metadata, detection-limit flags, etc.).
64
64
  [G]: "object"
65
- }, Er = {
65
+ }, kr = {
66
66
  [H]: "string",
67
- [ne]: "number",
68
- [Q]: "number",
69
- [pe]: "number",
67
+ [re]: "number",
68
+ [ee]: "number",
69
+ [ge]: "number",
70
70
  [Ie]: "string",
71
- [Ce]: "string",
71
+ [Te]: "string",
72
72
  // Per-row dict of source-specific fields outside the canonical schema.
73
73
  [G]: "object"
74
- }, zr = {
74
+ }, Dr = {
75
75
  [H]: "string",
76
- [ge]: "number",
76
+ [ye]: "number",
77
+ [J]: "number",
77
78
  [K]: "number",
78
- [W]: "number",
79
79
  [Fe]: "number",
80
- [ve]: "number",
81
- [yt]: "string",
80
+ [Ce]: "number",
81
+ [zt]: "string",
82
82
  // Per-row dict of source-specific fields outside the canonical schema.
83
83
  [G]: "object"
84
- }, Nr = {
84
+ }, Sr = {
85
85
  [H]: "string",
86
- [ne]: "number",
87
- [Q]: "number",
88
- [pe]: "number",
86
+ [re]: "number",
87
+ [ee]: "number",
88
+ [ge]: "number",
89
89
  // value columns are variable — not standardized here
90
90
  // Per-row dict of source-specific fields outside the canonical schema.
91
91
  [G]: "object"
92
- }, Or = {
93
- [pt]: "string",
94
- [ht]: "string",
95
- [bt]: "string",
96
- [ue]: "number",
92
+ }, wr = {
93
+ [Mt]: "string",
94
+ [yt]: "string",
95
+ [_t]: "string",
97
96
  [me]: "number",
98
97
  [de]: "number",
99
98
  [fe]: "number",
100
99
  [he]: "number",
101
- [be]: "string",
102
- [ft]: "string",
100
+ [be]: "number",
101
+ [pe]: "string",
102
+ [gt]: "string",
103
103
  // Per-row dict of source-specific fields outside the canonical schema
104
104
  // (analyte values, lab metadata, detection-limit flags, anumber, ...).
105
105
  [G]: "object"
106
- }, _t = {
106
+ }, Nt = {
107
107
  [H]: ["hole_id", "holeid", "hole id", "hole-id"],
108
- [we]: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
109
- [xe]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
110
- [ue]: ["latitude", "lat"],
111
- [me]: ["longitude", "lon"],
112
- [de]: ["elevation", "rl", "elev", "z"],
113
- [fe]: ["easting", "x"],
114
- [he]: ["northing", "y"],
115
- [be]: ["crs", "epsg", "projection"],
116
- [ne]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
117
- [Q]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
108
+ [xe]: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
109
+ [ve]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
110
+ [me]: ["latitude", "lat"],
111
+ [de]: ["longitude", "lon"],
112
+ [fe]: ["elevation", "rl", "elev", "z"],
113
+ [he]: ["easting", "x"],
114
+ [be]: ["northing", "y"],
115
+ [pe]: ["crs", "epsg", "projection"],
116
+ [re]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
117
+ [ee]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
118
118
  [Ie]: [
119
119
  "geology_code",
120
120
  "geologycode",
@@ -125,7 +125,7 @@ const lr = "datasource", H = "hole_id", dt = "_collar_id", we = "datasource_hole
125
125
  "plot_lithology",
126
126
  "rock1"
127
127
  ],
128
- [Ce]: [
128
+ [Te]: [
129
129
  "geology_description",
130
130
  "geologydescription",
131
131
  "geology_comment",
@@ -136,57 +136,57 @@ const lr = "datasource", H = "hole_id", dt = "_collar_id", we = "datasource_hole
136
136
  "description",
137
137
  "comments"
138
138
  ],
139
- [W]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
140
- [K]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
139
+ [K]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
140
+ [J]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
141
141
  [Fe]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
142
- [ve]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
142
+ [Ce]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
143
143
  declination: ["declination", "dec"],
144
- [ge]: ["depth", "survey_depth", "surveydepth", "md", "measured_depth", "dept"],
145
- [gt]: ["strike", "str"]
146
- }, Mt = {};
147
- for (const [e, t] of Object.entries(_t))
144
+ [ye]: ["depth", "survey_depth", "surveydepth", "md", "measured_depth", "dept"],
145
+ [Et]: ["strike", "str"]
146
+ }, Ot = {};
147
+ for (const [e, t] of Object.entries(Nt))
148
148
  for (const n of t) {
149
149
  const r = n.toLowerCase().trim();
150
- Mt[r] = e;
150
+ Ot[r] = e;
151
151
  }
152
- const ie = "[baselode:data]";
153
- function Et(e, t = "Unknown error") {
152
+ const se = "[baselode:data]";
153
+ function Lt(e, t = "Unknown error") {
154
154
  if (e instanceof Error) return e;
155
155
  const n = typeof e == "string" && e.trim() ? e : t;
156
156
  return new Error(n);
157
157
  }
158
- function se(e, t, n = "Operation failed") {
159
- const r = Et(t, n), o = new Error(`${e}: ${r.message}`);
158
+ function ae(e, t, n = "Operation failed") {
159
+ const r = Lt(t, n), o = new Error(`${e}: ${r.message}`);
160
160
  return o.cause = r, o;
161
161
  }
162
- function kr(e, t) {
162
+ function xr(e, t) {
163
163
  if (t !== void 0) {
164
- console.warn(`${ie} ${e}`, t);
164
+ console.warn(`${se} ${e}`, t);
165
165
  return;
166
166
  }
167
- console.warn(`${ie} ${e}`);
167
+ console.warn(`${se} ${e}`);
168
168
  }
169
- function Lr(e) {
170
- console.info(`${ie} ${e}`);
169
+ function vr(e) {
170
+ console.info(`${se} ${e}`);
171
171
  }
172
- const J = "numeric", ae = "categorical", le = "comment", ee = "hidden", zt = "tadpole", ze = {
173
- [J]: [
172
+ const Q = "numeric", le = "categorical", ce = "comment", te = "hidden", At = "tadpole", Ne = {
173
+ [Q]: [
174
174
  { value: "bar", label: "Bars" },
175
175
  { value: "markers", label: "Markers" },
176
176
  { value: "markers+line", label: "Markers + Line" },
177
177
  { value: "line", label: "Line only" }
178
178
  ],
179
- [ae]: [
179
+ [le]: [
180
180
  { value: "categorical", label: "Categorical bands" }
181
181
  ],
182
- [le]: [
182
+ [ce]: [
183
183
  { value: "comment", label: "Comments" }
184
184
  ],
185
- [zt]: [
185
+ [At]: [
186
186
  { value: "tadpole", label: "Tadpole" }
187
187
  ],
188
- [ee]: []
189
- }, Ne = /* @__PURE__ */ new Set([
188
+ [te]: []
189
+ }, Oe = /* @__PURE__ */ new Set([
190
190
  // Hole identifiers
191
191
  "hole_id",
192
192
  "holeid",
@@ -241,7 +241,7 @@ const J = "numeric", ae = "categorical", le = "comment", ee = "hidden", zt = "ta
241
241
  "data_source",
242
242
  "_hole_key",
243
243
  "_hole_id_key"
244
- ]), Nt = /* @__PURE__ */ new Set([
244
+ ]), kt = /* @__PURE__ */ new Set([
245
245
  "comments",
246
246
  "comment",
247
247
  "notes",
@@ -254,99 +254,99 @@ const J = "numeric", ae = "categorical", le = "comment", ee = "hidden", zt = "ta
254
254
  "structcomment",
255
255
  "geology_description"
256
256
  ]);
257
- function Ar(e) {
257
+ function Fr(e) {
258
258
  if (!(e != null && e.length))
259
259
  return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
260
260
  const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
261
261
  for (const r of t) {
262
262
  const o = r.toLowerCase().trim();
263
- if (Ne.has(o) || Ne.has(r)) {
264
- n[r] = ee;
263
+ if (Oe.has(o) || Oe.has(r)) {
264
+ n[r] = te;
265
265
  continue;
266
266
  }
267
- if (Nt.has(o)) {
268
- const c = e.some((l) => {
269
- const s = l[r];
267
+ if (kt.has(o)) {
268
+ const l = e.some((c) => {
269
+ const s = c[r];
270
270
  return s != null && String(s).trim() !== "" && String(s) !== "null";
271
271
  });
272
- n[r] = c ? le : ee;
272
+ n[r] = l ? ce : te;
273
273
  continue;
274
274
  }
275
275
  let i = !1, a = !1;
276
- for (const c of e) {
277
- const l = c[r];
278
- if (!(l == null || typeof l == "string" && l.trim() === "") && (a = !0, typeof l == "number" && Number.isFinite(l))) {
276
+ for (const l of e) {
277
+ const c = l[r];
278
+ if (!(c == null || typeof c == "string" && c.trim() === "") && (a = !0, typeof c == "number" && Number.isFinite(c))) {
279
279
  i = !0;
280
280
  break;
281
281
  }
282
282
  }
283
- a ? i ? n[r] = J : n[r] = ae : n[r] = ee;
283
+ a ? i ? n[r] = Q : n[r] = le : n[r] = te;
284
284
  }
285
285
  return {
286
286
  byType: n,
287
- numericCols: Object.entries(n).filter(([, r]) => r === J).map(([r]) => r),
288
- categoricalCols: Object.entries(n).filter(([, r]) => r === ae).map(([r]) => r),
289
- commentCols: Object.entries(n).filter(([, r]) => r === le).map(([r]) => r)
287
+ numericCols: Object.entries(n).filter(([, r]) => r === Q).map(([r]) => r),
288
+ categoricalCols: Object.entries(n).filter(([, r]) => r === le).map(([r]) => r),
289
+ commentCols: Object.entries(n).filter(([, r]) => r === ce).map(([r]) => r)
290
290
  };
291
291
  }
292
- function Ot(e) {
293
- return ze[e] ?? ze[J];
292
+ function Dt(e) {
293
+ return Ne[e] ?? Ne[Q];
294
294
  }
295
- function Dr(e) {
296
- const t = Ot(e);
297
- return t.length ? e === J ? "line" : t[0].value : "markers+line";
295
+ function Cr(e) {
296
+ const t = Dt(e);
297
+ return t.length ? e === Q ? "line" : t[0].value : "markers+line";
298
298
  }
299
- const Te = ["x", "y", "z", "dx", "dy", "dz"], kt = {
299
+ const Pe = ["x", "y", "z", "dx", "dy", "dz"], St = {
300
300
  x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
301
301
  y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
302
302
  z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
303
303
  dx: ["dx", "size_x", "sx", "sizex", "dim_x", "block_size_x"],
304
304
  dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
305
305
  dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
306
- }, Pe = {};
307
- Object.entries(kt).forEach(([e, t]) => {
306
+ }, Be = {};
307
+ Object.entries(St).forEach(([e, t]) => {
308
308
  t.forEach((n) => {
309
- Pe[n.toLowerCase()] = e;
309
+ Be[n.toLowerCase()] = e;
310
310
  });
311
311
  });
312
- function Lt(e) {
312
+ function wt(e) {
313
313
  const t = {};
314
314
  return Object.entries(e).forEach(([n, r]) => {
315
- const o = Pe[n.toLowerCase().trim()] || n;
315
+ const o = Be[n.toLowerCase().trim()] || n;
316
316
  t[o] = r;
317
317
  }), t;
318
318
  }
319
- function Sr(e) {
319
+ function Ir(e) {
320
320
  return new Promise((t, n) => {
321
- mt.parse(e, {
321
+ bt.parse(e, {
322
322
  header: !0,
323
323
  dynamicTyping: !0,
324
324
  skipEmptyLines: !0,
325
325
  complete: (r) => {
326
- const i = (r.data || []).map(Lt).filter(
327
- (c) => c.x !== null && c.y !== null && c.z !== null
326
+ const i = (r.data || []).map(wt).filter(
327
+ (l) => l.x !== null && l.y !== null && l.z !== null
328
328
  ), a = Object.keys(i[0] || {}).filter(
329
- (c) => !Te.includes(c)
329
+ (l) => !Pe.includes(l)
330
330
  );
331
331
  t({ data: i, properties: a });
332
332
  },
333
333
  error: (r) => {
334
- n(se("parseBlockModelCSV", r));
334
+ n(ae("parseBlockModelCSV", r));
335
335
  }
336
336
  });
337
337
  });
338
338
  }
339
- function wr(e) {
339
+ function Tr(e) {
340
340
  if (typeof e == "string")
341
341
  try {
342
342
  return JSON.parse(e);
343
343
  } catch (t) {
344
- throw se("loadBlockModelMetadata", t);
344
+ throw ae("loadBlockModelMetadata", t);
345
345
  }
346
346
  if (e && typeof e == "object") return e;
347
- throw se("loadBlockModelMetadata", new Error("Invalid metadata source"));
347
+ throw ae("loadBlockModelMetadata", new Error("Invalid metadata source"));
348
348
  }
349
- function At(e, t) {
349
+ function xt(e, t) {
350
350
  const n = e.map((i) => i[t]).filter((i) => i != null);
351
351
  if (n.length > 0 && n.every((i) => typeof i == "number")) {
352
352
  const i = Math.min(...n), a = Math.max(...n);
@@ -354,16 +354,16 @@ function At(e, t) {
354
354
  }
355
355
  return { type: "categorical", categories: [...new Set(n)], values: n };
356
356
  }
357
- function xr(e) {
357
+ function Pr(e) {
358
358
  if (!e || e.length === 0) return {};
359
359
  const t = Object.keys(e[0]).filter(
360
- (r) => !Te.includes(r)
360
+ (r) => !Pe.includes(r)
361
361
  ), n = {};
362
362
  return t.forEach((r) => {
363
- n[r] = At(e, r);
363
+ n[r] = xt(e, r);
364
364
  }), n;
365
365
  }
366
- function Dt(e, t) {
366
+ function vt(e, t) {
367
367
  return !t || typeof t != "object" ? e : e.filter(
368
368
  (n) => Object.entries(t).every(([r, o]) => {
369
369
  const i = n[r];
@@ -371,85 +371,85 @@ function Dt(e, t) {
371
371
  })
372
372
  );
373
373
  }
374
- function Fr(e, t = null) {
375
- return (t ? Dt(e, t) : e).reduce((r, o) => {
376
- const i = Number(o.dx) || 0, a = Number(o.dy) || 0, c = Number(o.dz) || 0;
377
- return r + i * a * c;
374
+ function Br(e, t = null) {
375
+ return (t ? vt(e, t) : e).reduce((r, o) => {
376
+ const i = Number(o.dx) || 0, a = Number(o.dy) || 0, l = Number(o.dz) || 0;
377
+ return r + i * a * l;
378
378
  }, 0);
379
379
  }
380
- function St(e, t, n) {
380
+ function Ft(e, t, n) {
381
381
  if (!t) return new n.Color("#888888");
382
382
  if (t.type === "numeric") {
383
- const i = t.max - t.min, c = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
384
- return new n.Color().setHSL(c / 360, 0.8, 0.5);
383
+ const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
384
+ return new n.Color().setHSL(l / 360, 0.8, 0.5);
385
385
  }
386
386
  const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
387
387
  return new n.Color().setHSL(o / 360, 0.7, 0.5);
388
388
  }
389
- function wt(e, t) {
389
+ function Ct(e, t) {
390
390
  if (!e || e.length === 0 || !Number.isFinite(t)) return null;
391
391
  const n = e.length;
392
392
  if (n === 1) {
393
- const b = e[0];
394
- return { x: Number(b.x), y: Number(b.y), z: Number(b.z), dx: 0, dy: 0, dz: -1 };
393
+ const f = e[0];
394
+ return { x: Number(f.x), y: Number(f.y), z: Number(f.z), dx: 0, dy: 0, dz: -1 };
395
395
  }
396
396
  let r = -1;
397
- for (let b = 0; b < n - 1; b++) {
398
- const L = Number(e[b].md), y = Number(e[b + 1].md);
399
- if (t >= L && t <= y) {
400
- r = b;
397
+ for (let f = 0; f < n - 1; f++) {
398
+ const A = Number(e[f].md), _ = Number(e[f + 1].md);
399
+ if (t >= A && t <= _) {
400
+ r = f;
401
401
  break;
402
402
  }
403
403
  }
404
404
  let o, i, a;
405
405
  if (r === -1) {
406
406
  t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
407
- const b = Number(o.md), y = Number(i.md) - b;
408
- a = y > 0 ? (t - b) / y : t < b ? 0 : 1;
407
+ const f = Number(o.md), _ = Number(i.md) - f;
408
+ a = _ > 0 ? (t - f) / _ : t < f ? 0 : 1;
409
409
  } else {
410
410
  o = e[r], i = e[r + 1];
411
- const b = Number(o.md), y = Number(i.md) - b;
412
- a = y > 0 ? (t - b) / y : 0;
413
- }
414
- const c = Number(o.x) + a * (Number(i.x) - Number(o.x)), l = Number(o.y) + a * (Number(i.y) - Number(o.y)), s = Number(o.z) + a * (Number(i.z) - Number(o.z));
415
- let u, p, m;
416
- const h = Number(o.azimuth), d = Number(o.dip), g = Number(i.azimuth), N = Number(i.dip);
417
- if (Number.isFinite(h) && Number.isFinite(d)) {
418
- const b = Number.isFinite(g) && Number.isFinite(N) ? h + a * (g - h) : h, L = Number.isFinite(g) && Number.isFinite(N) ? d + a * (N - d) : d, y = b * Math.PI / 180, E = L * Math.PI / 180;
419
- u = Math.cos(E) * Math.sin(y), p = Math.cos(E) * Math.cos(y), m = -Math.sin(E);
411
+ const f = Number(o.md), _ = Number(i.md) - f;
412
+ a = _ > 0 ? (t - f) / _ : 0;
413
+ }
414
+ const l = Number(o.x) + a * (Number(i.x) - Number(o.x)), c = Number(o.y) + a * (Number(i.y) - Number(o.y)), s = Number(o.z) + a * (Number(i.z) - Number(o.z));
415
+ let u, h, p;
416
+ const b = Number(o.azimuth), m = Number(o.dip), g = Number(i.azimuth), y = Number(i.dip);
417
+ if (Number.isFinite(b) && Number.isFinite(m)) {
418
+ const f = Number.isFinite(g) && Number.isFinite(y) ? b + a * (g - b) : b, A = Number.isFinite(g) && Number.isFinite(y) ? m + a * (y - m) : m, _ = f * Math.PI / 180, z = A * Math.PI / 180;
419
+ u = Math.cos(z) * Math.sin(_), h = Math.cos(z) * Math.cos(_), p = -Math.sin(z);
420
420
  } else {
421
- const b = Number(i.x) - Number(o.x), L = Number(i.y) - Number(o.y), y = Number(i.z) - Number(o.z), E = Math.sqrt(b * b + L * L + y * y);
422
- if (E < 1e-10) return { x: c, y: l, z: s, dx: 0, dy: 0, dz: -1 };
423
- u = b / E, p = L / E, m = y / E;
421
+ const f = Number(i.x) - Number(o.x), A = Number(i.y) - Number(o.y), _ = Number(i.z) - Number(o.z), z = Math.sqrt(f * f + A * A + _ * _);
422
+ if (z < 1e-10) return { x: l, y: c, z: s, dx: 0, dy: 0, dz: -1 };
423
+ u = f / z, h = A / z, p = _ / z;
424
424
  }
425
- const O = Math.sqrt(u * u + p * p + m * m);
426
- return O < 1e-10 ? { x: c, y: l, z: s, dx: 0, dy: 0, dz: -1 } : { x: c, y: l, z: s, dx: u / O, dy: p / O, dz: m / O };
425
+ const O = Math.sqrt(u * u + h * h + p * p);
426
+ return O < 1e-10 ? { x: l, y: c, z: s, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: s, dx: u / O, dy: h / O, dz: p / O };
427
427
  }
428
- function xt(e, t, n, r = {}) {
429
- const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: a, dy: c, dz: l } = n, s = [a, c, l];
428
+ function It(e, t, n, r = {}) {
429
+ const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: a, dy: l, dz: c } = n, s = [a, l, c];
430
430
  let u = [0, 0, 1];
431
- const p = s[0] * u[0] + s[1] * u[1] + s[2] * u[2];
432
- Math.abs(p) > 0.99 && (u = [0, 1, 0]);
433
- const m = [
431
+ const h = s[0] * u[0] + s[1] * u[1] + s[2] * u[2];
432
+ Math.abs(h) > 0.99 && (u = [0, 1, 0]);
433
+ const p = [
434
434
  u[1] * s[2] - u[2] * s[1],
435
435
  u[2] * s[0] - u[0] * s[2],
436
436
  u[0] * s[1] - u[1] * s[0]
437
- ], h = Math.sqrt(m[0] ** 2 + m[1] ** 2 + m[2] ** 2), d = h > 1e-10 ? [m[0] / h, m[1] / h, m[2] / h] : [1, 0, 0], g = [
438
- s[1] * d[2] - s[2] * d[1],
439
- s[2] * d[0] - s[0] * d[2],
440
- s[0] * d[1] - s[1] * d[0]
441
- ], N = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), O = N > 1e-10 ? [g[0] / N, g[1] / N, g[2] / N] : [0, 1, 0], b = o === "R" ? d : O, L = t * Math.PI / 180 * i, y = Math.cos(L), E = Math.sin(L), k = b[0] * s[0] + b[1] * s[1] + b[2] * s[2], D = [
442
- s[1] * b[2] - s[2] * b[1],
443
- s[2] * b[0] - s[0] * b[2],
444
- s[0] * b[1] - s[1] * b[0]
437
+ ], b = Math.sqrt(p[0] ** 2 + p[1] ** 2 + p[2] ** 2), m = b > 1e-10 ? [p[0] / b, p[1] / b, p[2] / b] : [1, 0, 0], g = [
438
+ s[1] * m[2] - s[2] * m[1],
439
+ s[2] * m[0] - s[0] * m[2],
440
+ s[0] * m[1] - s[1] * m[0]
441
+ ], y = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), O = y > 1e-10 ? [g[0] / y, g[1] / y, g[2] / y] : [0, 1, 0], f = o === "R" ? m : O, A = t * Math.PI / 180 * i, _ = Math.cos(A), z = Math.sin(A), L = f[0] * s[0] + f[1] * s[1] + f[2] * s[2], D = [
442
+ s[1] * f[2] - s[2] * f[1],
443
+ s[2] * f[0] - s[0] * f[2],
444
+ s[0] * f[1] - s[1] * f[0]
445
445
  ], w = [
446
- b[0] * y + D[0] * E + s[0] * k * (1 - y),
447
- b[1] * y + D[1] * E + s[1] * k * (1 - y),
448
- b[2] * y + D[2] * E + s[2] * k * (1 - y)
449
- ], A = (90 - e) * Math.PI / 180, x = Math.cos(A), S = Math.sin(A), v = x * w[0] + S * s[0], C = x * w[1] + S * s[1], I = x * w[2] + S * s[2], P = Math.sqrt(v * v + C * C + I * I);
450
- return P < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: v / P, ny: C / P, nz: I / P };
446
+ f[0] * _ + D[0] * z + s[0] * L * (1 - _),
447
+ f[1] * _ + D[1] * z + s[1] * L * (1 - _),
448
+ f[2] * _ + D[2] * z + s[2] * L * (1 - _)
449
+ ], k = (90 - e) * Math.PI / 180, x = Math.cos(k), S = Math.sin(k), F = x * w[0] + S * s[0], I = x * w[1] + S * s[1], C = x * w[2] + S * s[2], P = Math.sqrt(F * F + I * I + C * C);
450
+ return P < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: F / P, ny: I / P, nz: C / P };
451
451
  }
452
- function Ft(e, t, n = {}) {
452
+ function Tt(e, t, n = {}) {
453
453
  if (!(e != null && e.length) || !(t != null && t.length)) return [];
454
454
  const r = /* @__PURE__ */ new Map();
455
455
  for (const i of t) {
@@ -457,34 +457,34 @@ function Ft(e, t, n = {}) {
457
457
  a && (r.has(a) || r.set(a, []), r.get(a).push(i));
458
458
  }
459
459
  for (const [, i] of r)
460
- i.sort((a, c) => Number(a.md) - Number(c.md));
460
+ i.sort((a, l) => Number(a.md) - Number(l.md));
461
461
  const o = [];
462
462
  for (const i of e) {
463
463
  const a = i.hole_id != null ? `${i.hole_id}`.trim().toLowerCase() : "";
464
464
  if (!a) continue;
465
- const c = r.get(a);
466
- if (!c || c.length === 0) continue;
467
- const l = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
468
- if (!Number.isFinite(l)) continue;
469
- const s = wt(c, l);
465
+ const l = r.get(a);
466
+ if (!l || l.length === 0) continue;
467
+ const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
468
+ if (!Number.isFinite(c)) continue;
469
+ const s = Ct(l, c);
470
470
  if (!s) continue;
471
- const { x: u, y: p, z: m, dx: h, dy: d, dz: g } = s;
472
- let N, O, b;
473
- const L = i.alpha != null ? Number(i.alpha) : null, y = i.beta != null ? Number(i.beta) : null;
474
- if (Number.isFinite(L)) {
475
- const E = Number.isFinite(y) ? y : 0, k = xt(L, E, { dx: h, dy: d, dz: g }, n);
476
- N = k.nx, O = k.ny, b = k.nz;
471
+ const { x: u, y: h, z: p, dx: b, dy: m, dz: g } = s;
472
+ let y, O, f;
473
+ const A = i.alpha != null ? Number(i.alpha) : null, _ = i.beta != null ? Number(i.beta) : null;
474
+ if (Number.isFinite(A)) {
475
+ const z = Number.isFinite(_) ? _ : 0, L = It(A, z, { dx: b, dy: m, dz: g }, n);
476
+ y = L.nx, O = L.ny, f = L.nz;
477
477
  } else {
478
- const E = i.dip != null ? Number(i.dip) : null, k = i.azimuth != null ? Number(i.azimuth) : null;
479
- if (!Number.isFinite(E) || !Number.isFinite(k)) continue;
480
- const D = E * Math.PI / 180, w = k * Math.PI / 180;
481
- N = Math.sin(w) * Math.sin(D), O = Math.cos(w) * Math.sin(D), b = Math.cos(D);
478
+ const z = i.dip != null ? Number(i.dip) : null, L = i.azimuth != null ? Number(i.azimuth) : null;
479
+ if (!Number.isFinite(z) || !Number.isFinite(L)) continue;
480
+ const D = z * Math.PI / 180, w = L * Math.PI / 180;
481
+ y = Math.sin(w) * Math.sin(D), O = Math.cos(w) * Math.sin(D), f = Math.cos(D);
482
482
  }
483
- o.push({ ...i, x: u, y: p, z: m, nx: N, ny: O, nz: b });
483
+ o.push({ ...i, x: u, y: h, z: p, nx: y, ny: O, nz: f });
484
484
  }
485
485
  return o;
486
486
  }
487
- const vt = "baselode", vr = vt, It = [
487
+ const Pt = "baselode", Rr = Pt, Bt = [
488
488
  "#8b1e3f",
489
489
  "#2563eb",
490
490
  "#16a34a",
@@ -495,7 +495,7 @@ const vt = "baselode", vr = vt, It = [
495
495
  "#10b981",
496
496
  "#f97316",
497
497
  "#8b5cf6"
498
- ], M = {
498
+ ], E = {
499
499
  bg: "#ffffff",
500
500
  panel: "#f8fafc",
501
501
  ink: "#1e293b",
@@ -509,31 +509,31 @@ const vt = "baselode", vr = vt, It = [
509
509
  muted_3: "#e2e8f0",
510
510
  primary: "#8b1e3f",
511
511
  primary_2: "#a8324f"
512
- }, ye = {
512
+ }, _e = {
513
513
  layout: {
514
- paper_bgcolor: M.bg,
515
- plot_bgcolor: M.bg,
516
- colorway: It,
514
+ paper_bgcolor: E.bg,
515
+ plot_bgcolor: E.bg,
516
+ colorway: Bt,
517
517
  font: {
518
518
  family: "Inter, system-ui, sans-serif",
519
519
  size: 12,
520
- color: M.ink
520
+ color: E.ink
521
521
  },
522
522
  title: {
523
- font: { size: 14, color: M.ink },
523
+ font: { size: 14, color: E.ink },
524
524
  x: 0.05
525
525
  },
526
526
  hovermode: "x unified",
527
527
  hoverlabel: {
528
- bgcolor: M.bg,
529
- bordercolor: M.line,
530
- font: { size: 12, color: M.ink }
528
+ bgcolor: E.bg,
529
+ bordercolor: E.line,
530
+ font: { size: 12, color: E.ink }
531
531
  },
532
532
  legend: {
533
533
  bgcolor: "rgba(255,255,255,0.9)",
534
- bordercolor: M.muted_3,
534
+ bordercolor: E.muted_3,
535
535
  borderwidth: 1,
536
- font: { size: 11, color: M.ink },
536
+ font: { size: 11, color: E.ink },
537
537
  orientation: "h",
538
538
  yanchor: "bottom",
539
539
  y: 1.02,
@@ -543,34 +543,34 @@ const vt = "baselode", vr = vt, It = [
543
543
  xaxis: {
544
544
  showline: !0,
545
545
  linewidth: 1,
546
- linecolor: M.line,
546
+ linecolor: E.line,
547
547
  mirror: !1,
548
548
  ticks: "outside",
549
549
  tickwidth: 1,
550
- tickcolor: M.line,
550
+ tickcolor: E.line,
551
551
  ticklen: 4,
552
552
  showgrid: !0,
553
- gridcolor: M.grid,
553
+ gridcolor: E.grid,
554
554
  gridwidth: 1,
555
555
  zeroline: !1,
556
- title_font: { color: M.ink, size: 12 },
557
- tickfont: { color: M.ink_soft, size: 10 }
556
+ title_font: { color: E.ink, size: 12 },
557
+ tickfont: { color: E.ink_soft, size: 10 }
558
558
  },
559
559
  yaxis: {
560
560
  showline: !0,
561
561
  linewidth: 1,
562
- linecolor: M.line,
562
+ linecolor: E.line,
563
563
  mirror: !1,
564
564
  ticks: "outside",
565
565
  tickwidth: 1,
566
- tickcolor: M.line,
566
+ tickcolor: E.line,
567
567
  ticklen: 4,
568
568
  showgrid: !0,
569
- gridcolor: M.grid,
569
+ gridcolor: E.grid,
570
570
  gridwidth: 1,
571
571
  zeroline: !1,
572
- title_font: { color: M.ink, size: 12 },
573
- tickfont: { color: M.ink_soft, size: 10 }
572
+ title_font: { color: E.ink, size: 12 },
573
+ tickfont: { color: E.ink_soft, size: 10 }
574
574
  },
575
575
  modebar: {
576
576
  remove: ["select2d", "lasso2d", "autoScale2d"]
@@ -581,34 +581,34 @@ const vt = "baselode", vr = vt, It = [
581
581
  data: {
582
582
  scatter: [{
583
583
  mode: "lines+markers",
584
- line: { width: 2, color: M.primary },
584
+ line: { width: 2, color: E.primary },
585
585
  marker: {
586
586
  size: 7,
587
- color: M.primary_2,
588
- line: { width: 1.5, color: M.bg }
587
+ color: E.primary_2,
588
+ line: { width: 1.5, color: E.bg }
589
589
  }
590
590
  }],
591
591
  bar: [{
592
592
  marker: {
593
- color: M.primary,
594
- line: { color: M.bg, width: 0 }
593
+ color: E.primary,
594
+ line: { color: E.bg, width: 0 }
595
595
  }
596
596
  }],
597
597
  histogram: [{
598
598
  marker: {
599
- color: M.primary,
600
- line: { color: M.bg, width: 0 }
599
+ color: E.primary,
600
+ line: { color: E.bg, width: 0 }
601
601
  }
602
602
  }],
603
603
  box: [{
604
- fillcolor: M.accent,
605
- line: { color: M.ink, width: 1.5 },
606
- marker: { color: M.ink }
604
+ fillcolor: E.accent,
605
+ line: { color: E.ink, width: 1.5 },
606
+ marker: { color: E.ink }
607
607
  }],
608
608
  violin: [{
609
- fillcolor: M.accent,
610
- line: { color: M.ink, width: 1.5 },
611
- marker: { color: M.ink }
609
+ fillcolor: E.accent,
610
+ line: { color: E.ink, width: 1.5 },
611
+ marker: { color: E.ink }
612
612
  }],
613
613
  heatmap: [{
614
614
  colorscale: [
@@ -620,9 +620,9 @@ const vt = "baselode", vr = vt, It = [
620
620
  [1, "#1e293b"]
621
621
  ],
622
622
  colorbar: {
623
- outlinecolor: M.line,
624
- tickcolor: M.line,
625
- tickfont: { color: M.ink_soft }
623
+ outlinecolor: E.line,
624
+ tickcolor: E.line,
625
+ tickfont: { color: E.ink_soft }
626
626
  }
627
627
  }],
628
628
  contour: [{
@@ -634,13 +634,13 @@ const vt = "baselode", vr = vt, It = [
634
634
  [1, "#1e293b"]
635
635
  ],
636
636
  colorbar: {
637
- outlinecolor: M.line,
638
- tickcolor: M.line,
639
- tickfont: { color: M.ink_soft }
637
+ outlinecolor: E.line,
638
+ tickcolor: E.line,
639
+ tickfont: { color: E.ink_soft }
640
640
  }
641
641
  }]
642
642
  }
643
- }, Ir = ye, _ = {
643
+ }, Vr = _e, M = {
644
644
  bg: "#1b1b1f",
645
645
  panel: "#25252a",
646
646
  ink: "#f0f0e4",
@@ -652,11 +652,11 @@ const vt = "baselode", vr = vt, It = [
652
652
  muted_1: "#8a8a80",
653
653
  muted_2: "#5e5e56",
654
654
  muted_3: "#3a3a34"
655
- }, Cr = "baselode-dark", Tr = {
655
+ }, Hr = "baselode-dark", Gr = {
656
656
  layout: {
657
657
  font: {
658
658
  family: "Inter, system-ui, sans-serif",
659
- color: _.ink,
659
+ color: M.ink,
660
660
  size: 12
661
661
  },
662
662
  title: {
@@ -664,37 +664,37 @@ const vt = "baselode", vr = vt, It = [
664
664
  font: {
665
665
  family: "Inter, system-ui, sans-serif",
666
666
  size: 14,
667
- color: _.ink
667
+ color: M.ink
668
668
  }
669
669
  },
670
- paper_bgcolor: _.bg,
671
- plot_bgcolor: _.bg,
670
+ paper_bgcolor: M.bg,
671
+ plot_bgcolor: M.bg,
672
672
  colorway: [
673
- _.ink,
674
- _.accent,
675
- _.muted_1,
676
- _.accent_2,
677
- _.muted_2,
678
- _.muted_3
673
+ M.ink,
674
+ M.accent,
675
+ M.muted_1,
676
+ M.accent_2,
677
+ M.muted_2,
678
+ M.muted_3
679
679
  ],
680
680
  margin: { l: 70, r: 30, t: 70, b: 60 },
681
681
  hovermode: "x unified",
682
682
  hoverlabel: {
683
- bgcolor: _.panel,
684
- bordercolor: _.accent,
683
+ bgcolor: M.panel,
684
+ bordercolor: M.accent,
685
685
  font: {
686
686
  family: "Inter, system-ui, sans-serif",
687
- color: _.ink,
687
+ color: M.ink,
688
688
  size: 12
689
689
  }
690
690
  },
691
691
  legend: {
692
692
  bgcolor: "rgba(37,37,42,0.88)",
693
- bordercolor: _.line,
693
+ bordercolor: M.line,
694
694
  borderwidth: 1,
695
695
  font: {
696
696
  family: "Inter, system-ui, sans-serif",
697
- color: _.ink,
697
+ color: M.ink,
698
698
  size: 11
699
699
  },
700
700
  orientation: "h",
@@ -706,34 +706,34 @@ const vt = "baselode", vr = vt, It = [
706
706
  xaxis: {
707
707
  showline: !0,
708
708
  linewidth: 1,
709
- linecolor: _.line,
709
+ linecolor: M.line,
710
710
  mirror: !1,
711
711
  ticks: "outside",
712
712
  tickwidth: 1,
713
- tickcolor: _.muted_1,
713
+ tickcolor: M.muted_1,
714
714
  ticklen: 6,
715
715
  showgrid: !0,
716
- gridcolor: _.grid,
716
+ gridcolor: M.grid,
717
717
  gridwidth: 1,
718
718
  zeroline: !1,
719
- title_font: { color: _.ink, size: 12 },
720
- tickfont: { color: _.ink_soft, size: 10 }
719
+ title_font: { color: M.ink, size: 12 },
720
+ tickfont: { color: M.ink_soft, size: 10 }
721
721
  },
722
722
  yaxis: {
723
723
  showline: !0,
724
724
  linewidth: 1,
725
- linecolor: _.line,
725
+ linecolor: M.line,
726
726
  mirror: !1,
727
727
  ticks: "outside",
728
728
  tickwidth: 1,
729
- tickcolor: _.muted_1,
729
+ tickcolor: M.muted_1,
730
730
  ticklen: 6,
731
731
  showgrid: !0,
732
- gridcolor: _.grid,
732
+ gridcolor: M.grid,
733
733
  gridwidth: 1,
734
734
  zeroline: !1,
735
- title_font: { color: _.ink, size: 12 },
736
- tickfont: { color: _.ink_soft, size: 10 }
735
+ title_font: { color: M.ink, size: 12 },
736
+ tickfont: { color: M.ink_soft, size: 10 }
737
737
  },
738
738
  bargap: 0.18,
739
739
  bargroupgap: 0.08
@@ -741,34 +741,34 @@ const vt = "baselode", vr = vt, It = [
741
741
  data: {
742
742
  scatter: [{
743
743
  mode: "lines+markers",
744
- line: { width: 2.5, color: _.ink },
744
+ line: { width: 2.5, color: M.ink },
745
745
  marker: {
746
746
  size: 7,
747
- color: _.ink,
748
- line: { width: 1.5, color: _.bg }
747
+ color: M.ink,
748
+ line: { width: 1.5, color: M.bg }
749
749
  }
750
750
  }],
751
751
  bar: [{
752
752
  marker: {
753
- color: _.ink,
754
- line: { color: _.bg, width: 0 }
753
+ color: M.ink,
754
+ line: { color: M.bg, width: 0 }
755
755
  }
756
756
  }],
757
757
  histogram: [{
758
758
  marker: {
759
- color: _.ink,
760
- line: { color: _.bg, width: 0 }
759
+ color: M.ink,
760
+ line: { color: M.bg, width: 0 }
761
761
  }
762
762
  }],
763
763
  box: [{
764
- fillcolor: _.accent,
765
- line: { color: _.ink, width: 1.5 },
766
- marker: { color: _.ink }
764
+ fillcolor: M.accent,
765
+ line: { color: M.ink, width: 1.5 },
766
+ marker: { color: M.ink }
767
767
  }],
768
768
  violin: [{
769
- fillcolor: _.accent,
770
- line: { color: _.ink, width: 1.5 },
771
- marker: { color: _.ink }
769
+ fillcolor: M.accent,
770
+ line: { color: M.ink, width: 1.5 },
771
+ marker: { color: M.ink }
772
772
  }],
773
773
  heatmap: [{
774
774
  colorscale: [
@@ -780,9 +780,9 @@ const vt = "baselode", vr = vt, It = [
780
780
  [1, "#ffffbb"]
781
781
  ],
782
782
  colorbar: {
783
- outlinecolor: _.ink,
784
- tickcolor: _.ink,
785
- tickfont: { color: _.ink_soft }
783
+ outlinecolor: M.ink,
784
+ tickcolor: M.ink,
785
+ tickfont: { color: M.ink_soft }
786
786
  }
787
787
  }],
788
788
  contour: [{
@@ -794,13 +794,13 @@ const vt = "baselode", vr = vt, It = [
794
794
  [1, "#ffffbb"]
795
795
  ],
796
796
  colorbar: {
797
- outlinecolor: _.ink,
798
- tickcolor: _.ink,
799
- tickfont: { color: _.ink_soft }
797
+ outlinecolor: M.ink,
798
+ tickcolor: M.ink,
799
+ tickfont: { color: M.ink_soft }
800
800
  }
801
801
  }]
802
802
  }
803
- }, Ct = "#7f7f7f", te = {
803
+ }, Rt = "#7f7f7f", ne = {
804
804
  Au: "#FFD700",
805
805
  // gold
806
806
  Ag: "#C0C0C0",
@@ -837,7 +837,7 @@ const vt = "baselode", vr = vt, It = [
837
837
  // aluminium / yellow
838
838
  U: "#8BC34A"
839
839
  // uranium / lime green
840
- }, Tt = {
840
+ }, Vt = {
841
841
  // Sedimentary
842
842
  shale: "#607D8B",
843
843
  mudstone: "#78909C",
@@ -876,11 +876,11 @@ const vt = "baselode", vr = vt, It = [
876
876
  calcite: "#F9FBE7",
877
877
  vein: "#FFFFFF",
878
878
  unknown: "#9E9E9E"
879
- }, re = {
880
- commodity: te,
881
- lithology: Tt
879
+ }, oe = {
880
+ commodity: ne,
881
+ lithology: Vt
882
882
  };
883
- function Pt(e, t, n = Ct) {
883
+ function Ht(e, t, n = Rt) {
884
884
  if (!t || e == null) return n;
885
885
  const r = String(e).trim();
886
886
  if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
@@ -889,13 +889,13 @@ function Pt(e, t, n = Ct) {
889
889
  if (String(i).trim().toLowerCase() === o) return a;
890
890
  return n;
891
891
  }
892
- function Bt(e) {
892
+ function Gt(e) {
893
893
  if (e == null) return {};
894
894
  if (typeof e == "string") {
895
895
  const t = e.trim().toLowerCase();
896
- if (Object.prototype.hasOwnProperty.call(re, t))
897
- return re[t];
898
- const n = Object.keys(re).sort().join(", ");
896
+ if (Object.prototype.hasOwnProperty.call(oe, t))
897
+ return oe[t];
898
+ const n = Object.keys(oe).sort().join(", ");
899
899
  throw new RangeError(
900
900
  `Unknown built-in colour map '${e}'. Available maps: ${n}`
901
901
  );
@@ -905,40 +905,96 @@ function Bt(e) {
905
905
  `colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
906
906
  );
907
907
  }
908
- const Rt = "#8b1e3f", Vt = "#a8324f";
909
- function Ht(e) {
908
+ const jt = "analysis_uom", Ut = "analyte_attribute";
909
+ function $(e) {
910
+ if (e == null) return null;
911
+ const t = `${e}`.trim();
912
+ return t === "" ? null : t;
913
+ }
914
+ function Re(e, t) {
915
+ const n = $(t == null ? void 0 : t.label) ?? $(e) ?? "", r = $(t == null ? void 0 : t.unit), o = $(t == null ? void 0 : t.sourceAttribute), i = o && o.toLowerCase() !== n.toLowerCase() ? o : null;
916
+ return { label: n, unit: r, source: i };
917
+ }
918
+ function Ve(e, t) {
919
+ const { label: n, unit: r, source: o } = Re(e, t);
920
+ return n && (r && o ? `${n} (${r}, source: ${o})` : r ? `${n} (${r})` : o ? `${n} (source: ${o})` : n);
921
+ }
922
+ function jr(e, t, {
923
+ unitColumn: n = jt,
924
+ attributeColumn: r = Ut
925
+ } = {}) {
926
+ const o = {};
927
+ if (!Array.isArray(e) || !Array.isArray(t)) return o;
928
+ const i = t.filter(Boolean);
929
+ if (!i.length) return o;
930
+ const a = new Map(
931
+ i.map((l) => [l, { units: /* @__PURE__ */ new Set(), attributes: /* @__PURE__ */ new Set() }])
932
+ );
933
+ return e.forEach((l) => {
934
+ if (!l || typeof l != "object") return;
935
+ let c = null, s = !1;
936
+ for (const b of i) {
937
+ const m = l[b];
938
+ if (!(m == null || m === "")) {
939
+ if (c !== null) {
940
+ s = !0;
941
+ break;
942
+ }
943
+ c = b;
944
+ }
945
+ }
946
+ if (!c || s) return;
947
+ const u = a.get(c), h = $(l[n]);
948
+ h && u.units.add(h);
949
+ const p = $(l[r]);
950
+ p && u.attributes.add(p);
951
+ }), a.forEach((l, c) => {
952
+ const s = {};
953
+ l.units.size === 1 && ([s.unit] = l.units), l.attributes.size === 1 && ([s.sourceAttribute] = l.attributes), (s.unit || s.sourceAttribute) && (o[c] = s);
954
+ }), o;
955
+ }
956
+ function He(e, t) {
957
+ const { label: n, unit: r, source: o } = Re(e, t);
958
+ return {
959
+ label: n,
960
+ unitSuffix: r ? ` ${r}` : "",
961
+ sourceLine: o ? `Source: ${o}<br>` : ""
962
+ };
963
+ }
964
+ const $t = "#8b1e3f", Yt = "#a8324f";
965
+ function Xt(e) {
910
966
  if (!e) return null;
911
967
  const t = e.split(/[_\-/\s]+/);
912
968
  for (const n of t) {
913
- if (Object.prototype.hasOwnProperty.call(te, n))
914
- return te[n];
969
+ if (Object.prototype.hasOwnProperty.call(ne, n))
970
+ return ne[n];
915
971
  const r = n.toLowerCase();
916
- for (const [o, i] of Object.entries(te))
972
+ for (const [o, i] of Object.entries(ne))
917
973
  if (o.toLowerCase() === r) return i;
918
974
  }
919
975
  return null;
920
976
  }
921
- const Gt = "#6b7280", jt = { l: 42, r: 4, t: 4, b: 36 }, Oe = 10, ke = 11, Ut = 6;
922
- function Le(e) {
977
+ const qt = "#6b7280", Zt = { l: 42, r: 4, t: 4, b: 36 }, Le = 10, Ae = 11, Wt = 6;
978
+ function ke(e) {
923
979
  return e ? typeof e == "string" ? { text: e } : e : {};
924
980
  }
925
- function Be(e = {}) {
926
- const t = Le(e.xaxis && e.xaxis.title), n = Le(e.yaxis && e.yaxis.title);
981
+ function Ge(e = {}) {
982
+ const t = ke(e.xaxis && e.xaxis.title), n = ke(e.yaxis && e.yaxis.title);
927
983
  return {
928
984
  ...e,
929
- margin: jt,
985
+ margin: Zt,
930
986
  autosize: !0,
931
987
  width: void 0,
932
988
  xaxis: {
933
989
  ...e.xaxis || {},
934
990
  tickfont: {
935
991
  ...e.xaxis && e.xaxis.tickfont || {},
936
- size: Oe
992
+ size: Le
937
993
  },
938
994
  title: {
939
995
  ...t,
940
- font: { ...t.font || {}, size: ke },
941
- standoff: t.standoff ?? Ut
996
+ font: { ...t.font || {}, size: Ae },
997
+ standoff: t.standoff ?? Wt
942
998
  }
943
999
  },
944
1000
  yaxis: {
@@ -946,16 +1002,16 @@ function Be(e = {}) {
946
1002
  automargin: !0,
947
1003
  tickfont: {
948
1004
  ...e.yaxis && e.yaxis.tickfont || {},
949
- size: Oe
1005
+ size: Le
950
1006
  },
951
1007
  title: {
952
1008
  ...n,
953
- font: { ...n.font || {}, size: ke }
1009
+ font: { ...n.font || {}, size: Ae }
954
1010
  }
955
1011
  }
956
1012
  };
957
1013
  }
958
- function Pr(e, t) {
1014
+ function Ur(e, t) {
959
1015
  var r;
960
1016
  if (!e || !t) return !1;
961
1017
  const n = e.points || [];
@@ -966,40 +1022,40 @@ function Pr(e, t) {
966
1022
  }
967
1023
  return !1;
968
1024
  }
969
- function Br(e, t, n) {
1025
+ function $r(e, t, n) {
970
1026
  if (!e || !t) return [];
971
1027
  const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
972
1028
  return r.forEach((a) => {
973
- let c = Number(
1029
+ let l = Number(
974
1030
  a.from ?? a.samp_from ?? a.sample_from ?? a.fromdepth ?? a.from_depth ?? a.depth_from
975
- ), l = Number(
1031
+ ), c = Number(
976
1032
  a.to ?? a.samp_to ?? a.sample_to ?? a.todepth ?? a.to_depth ?? a.depth_to
977
1033
  );
978
- if (!Number.isFinite(c) || !Number.isFinite(l)) {
979
- const h = Number(a.depth ?? a.md);
980
- Number.isFinite(h) && (c = h, l = h);
1034
+ if (!Number.isFinite(l) || !Number.isFinite(c)) {
1035
+ const b = Number(a.depth ?? a.md);
1036
+ Number.isFinite(b) && (l = b, c = b);
981
1037
  }
982
1038
  const s = a == null ? void 0 : a[t];
983
- if (!Number.isFinite(c) || !Number.isFinite(l) || l < c || s == null || s === "" || n && typeof s == "string" && /^(nan|null|none)$/i.test(s.trim())) return;
984
- const u = `${t}:${c}-${l}:${String(s)}`;
1039
+ if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || s == null || s === "" || n && typeof s == "string" && /^(nan|null|none)$/i.test(s.trim())) return;
1040
+ const u = `${t}:${l}-${c}:${String(s)}`;
985
1041
  if (i.has(u)) return;
986
1042
  i.add(u);
987
- const p = (c + l) / 2, m = n ? s : Number(s);
988
- !n && !Number.isFinite(m) || o.push({
989
- z: p,
990
- val: m,
991
- from: c,
992
- to: l,
993
- errorPlus: l - p,
994
- errorMinus: p - c
1043
+ const h = (l + c) / 2, p = n ? s : Number(s);
1044
+ !n && !Number.isFinite(p) || o.push({
1045
+ z: h,
1046
+ val: p,
1047
+ from: l,
1048
+ to: c,
1049
+ errorPlus: c - h,
1050
+ errorMinus: h - l
995
1051
  });
996
- }), o.sort((a, c) => c.z - a.z);
1052
+ }), o.sort((a, l) => l.z - a.z);
997
1053
  }
998
- function Yt(e, t, n, r) {
1054
+ function Kt(e, t, n, r, o) {
999
1055
  if (!e.length) return { data: [], layout: {} };
1000
- const o = e.filter((m) => Number.isFinite(m == null ? void 0 : m.from) && Number.isFinite(m == null ? void 0 : m.to) && m.to > m.from).map((m) => ({ ...m, category: `${(m == null ? void 0 : m.val) ?? ""}`.trim() })).filter((m) => m.category !== "" && !/^(nan|null|none)$/i.test(m.category)).sort((m, h) => m.from - h.from || m.to - h.to);
1001
- if (!o.length) return { data: [], layout: {} };
1002
- const i = Bt(n), a = [
1056
+ const i = e.filter((m) => Number.isFinite(m == null ? void 0 : m.from) && Number.isFinite(m == null ? void 0 : m.to) && m.to > m.from).map((m) => ({ ...m, category: `${(m == null ? void 0 : m.val) ?? ""}`.trim() })).filter((m) => m.category !== "" && !/^(nan|null|none)$/i.test(m.category)).sort((m, g) => m.from - g.from || m.to - g.to);
1057
+ if (!i.length) return { data: [], layout: {} };
1058
+ const a = Gt(n), l = [
1003
1059
  "#1f77b4",
1004
1060
  // blue
1005
1061
  "#ff7f0e",
@@ -1028,86 +1084,86 @@ function Yt(e, t, n, r) {
1028
1084
  // violet
1029
1085
  "#636363"
1030
1086
  // dark gray
1031
- ], c = [...new Set(o.map((m) => m.category))];
1032
- function l(m, h) {
1033
- if (i && Object.keys(i).length > 0) {
1034
- const d = Pt(m, i, null);
1035
- if (d !== null) return d;
1087
+ ], c = [...new Set(i.map((m) => m.category))];
1088
+ function s(m, g) {
1089
+ if (a && Object.keys(a).length > 0) {
1090
+ const y = Ht(m, a, null);
1091
+ if (y !== null) return y;
1036
1092
  }
1037
- return a[h % a.length];
1093
+ return l[g % l.length];
1038
1094
  }
1039
- const s = new Map(
1040
- c.map((m, h) => [m, l(m, h)])
1041
- );
1042
- return { data: c.map((m) => {
1043
- const h = o.filter((d) => d.category === m);
1095
+ const u = new Map(
1096
+ c.map((m, g) => [m, s(m, g)])
1097
+ ), h = He(t, o), p = c.map((m) => {
1098
+ const g = i.filter((y) => y.category === m);
1044
1099
  return {
1045
1100
  type: "bar",
1046
- x: h.map(() => 0.5),
1047
- y: h.map((d) => d.to - d.from),
1048
- base: h.map((d) => d.from),
1101
+ x: g.map(() => 0.5),
1102
+ y: g.map((y) => y.to - y.from),
1103
+ base: g.map((y) => y.from),
1049
1104
  width: 1,
1050
- marker: { color: s.get(m), line: { width: 0 } },
1105
+ marker: { color: u.get(m), line: { width: 0 } },
1051
1106
  name: m,
1052
1107
  showlegend: !1,
1053
- customdata: h.map((d) => [d.from, d.to]),
1054
- hovertemplate: `${t}: ${m}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1108
+ customdata: g.map((y) => [y.from, y.to]),
1109
+ hovertemplate: `${h.label}: ${m}<br>${h.sourceLine}from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1055
1110
  };
1056
- }), layout: Be({
1111
+ }), b = {
1057
1112
  barmode: "overlay",
1058
1113
  bargap: 0,
1059
1114
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1060
1115
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
1061
1116
  showlegend: !1,
1062
- title: t || void 0,
1063
- template: r !== void 0 ? r : ye
1064
- }) };
1117
+ title: Ve(t, o) || void 0,
1118
+ template: r !== void 0 ? r : _e
1119
+ };
1120
+ return { data: p, layout: Ge(b) };
1065
1121
  }
1066
- function $t(e, t, n, r, o) {
1122
+ function Jt(e, t, n, r, o, i) {
1067
1123
  if (!e.length) return { data: [], layout: {} };
1068
- const i = n === "bar", a = n === "markers", c = n === "line", l = r || Rt, s = r || Vt, u = {
1069
- x: e.map((d) => d.val),
1070
- y: e.map((d) => d.z),
1071
- hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
1072
- customdata: e.map((d) => [Math.min(d.from, d.to), Math.max(d.from, d.to)])
1073
- }, p = {
1124
+ const a = n === "bar", l = n === "markers", c = n === "line", s = r || $t, u = r || Yt, h = He(t, i), p = {
1125
+ x: e.map((y) => y.val),
1126
+ y: e.map((y) => y.z),
1127
+ hovertemplate: `${h.label}: %{x}${h.unitSuffix}<br>${h.sourceLine}from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
1128
+ customdata: e.map((y) => [Math.min(y.from, y.to), Math.max(y.from, y.to)])
1129
+ }, b = {
1074
1130
  type: "data",
1075
1131
  symmetric: !1,
1076
- array: e.map((d) => d.errorPlus),
1077
- arrayminus: e.map((d) => d.errorMinus),
1132
+ array: e.map((y) => y.errorPlus),
1133
+ arrayminus: e.map((y) => y.errorMinus),
1078
1134
  thickness: 1.5,
1079
1135
  width: 2,
1080
- color: Gt
1081
- };
1082
- return { data: [i ? {
1083
- ...u,
1136
+ color: qt
1137
+ }, m = a ? {
1138
+ ...p,
1084
1139
  type: "bar",
1085
1140
  orientation: "h",
1086
- marker: { color: l },
1087
- error_y: p
1141
+ marker: { color: s },
1142
+ error_y: b
1088
1143
  } : {
1089
- ...u,
1144
+ ...p,
1090
1145
  type: "scatter",
1091
- mode: a ? "markers" : c ? "lines" : "lines+markers",
1092
- line: { color: l, width: 2 },
1093
- marker: { size: 7, color: s },
1094
- error_y: c ? void 0 : p
1095
- }], layout: Be({
1096
- xaxis: { title: t, zeroline: !1 },
1146
+ mode: l ? "markers" : c ? "lines" : "lines+markers",
1147
+ line: { color: s, width: 2 },
1148
+ marker: { size: 7, color: u },
1149
+ error_y: c ? void 0 : b
1150
+ }, g = {
1151
+ xaxis: { title: Ve(t, i), zeroline: !1 },
1097
1152
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
1098
1153
  barmode: "overlay",
1099
1154
  showlegend: !1,
1100
- template: o !== void 0 ? o : ye
1101
- }) };
1155
+ template: o !== void 0 ? o : _e
1156
+ };
1157
+ return { data: [m], layout: Ge(g) };
1102
1158
  }
1103
- function Xt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
1159
+ function Qt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i, meta: a }) {
1104
1160
  if (!e || !e.length || !n) return { data: [], layout: {} };
1105
1161
  if (t || r === "categorical")
1106
- return Yt(e, n, o, i);
1107
- const a = Ht(n);
1108
- return $t(e, n, r, a, i);
1162
+ return Kt(e, n, o, i, a);
1163
+ const l = Xt(n);
1164
+ return Jt(e, n, r, l, i, a);
1109
1165
  }
1110
- function Rr(e = [], {
1166
+ function Yr(e = [], {
1111
1167
  fromCol: t = "from",
1112
1168
  toCol: n = "to",
1113
1169
  categoryCol: r = "geology_code",
@@ -1115,19 +1171,19 @@ function Rr(e = [], {
1115
1171
  template: i = void 0
1116
1172
  } = {}) {
1117
1173
  const a = [];
1118
- return e.forEach((c) => {
1119
- const l = Number(c == null ? void 0 : c[t]), s = Number(c == null ? void 0 : c[n]), u = c == null ? void 0 : c[r];
1120
- if (!Number.isFinite(l) || !Number.isFinite(s) || s <= l || u == null || `${u}`.trim() === "") return;
1121
- const p = (l + s) / 2;
1174
+ return e.forEach((l) => {
1175
+ const c = Number(l == null ? void 0 : l[t]), s = Number(l == null ? void 0 : l[n]), u = l == null ? void 0 : l[r];
1176
+ if (!Number.isFinite(c) || !Number.isFinite(s) || s <= c || u == null || `${u}`.trim() === "") return;
1177
+ const h = (c + s) / 2;
1122
1178
  a.push({
1123
- z: p,
1179
+ z: h,
1124
1180
  val: `${u}`,
1125
- from: l,
1181
+ from: c,
1126
1182
  to: s,
1127
- errorPlus: s - p,
1128
- errorMinus: p - l
1183
+ errorPlus: s - h,
1184
+ errorMinus: h - c
1129
1185
  });
1130
- }), a.sort((c, l) => l.z - c.z), Xt({
1186
+ }), a.sort((l, c) => c.z - l.z), Qt({
1131
1187
  points: a,
1132
1188
  isCategorical: !0,
1133
1189
  property: r,
@@ -1136,7 +1192,7 @@ function Rr(e = [], {
1136
1192
  template: i
1137
1193
  });
1138
1194
  }
1139
- const qt = [
1195
+ const en = [
1140
1196
  "#313695",
1141
1197
  "#4575b4",
1142
1198
  "#74add1",
@@ -1148,7 +1204,7 @@ const qt = [
1148
1204
  "#d73027",
1149
1205
  "#a50026"
1150
1206
  ];
1151
- function Zt(e = [], t = qt) {
1207
+ function tn(e = [], t = en) {
1152
1208
  const n = e.filter((s) => Number.isFinite(s));
1153
1209
  if (!n.length)
1154
1210
  return {
@@ -1160,8 +1216,8 @@ function Zt(e = [], t = qt) {
1160
1216
  };
1161
1217
  const r = n.slice().sort((s, u) => s - u), o = r[0], i = r[r.length - 1], a = t.length;
1162
1218
  if (i === o) {
1163
- const s = t.map((u, p) => ({
1164
- index: p,
1219
+ const s = t.map((u, h) => ({
1220
+ index: h,
1165
1221
  min: o,
1166
1222
  max: i,
1167
1223
  label: `${o}`
@@ -1174,28 +1230,28 @@ function Zt(e = [], t = qt) {
1174
1230
  colors: t
1175
1231
  };
1176
1232
  }
1177
- const c = t.map((s, u) => {
1178
- const p = u / a, m = (u + 1) / a, h = Math.floor(p * r.length), d = Math.min(r.length - 1, Math.floor(m * r.length)), g = r[h], N = u === a - 1 ? i : r[d];
1233
+ const l = t.map((s, u) => {
1234
+ const h = u / a, p = (u + 1) / a, b = Math.floor(h * r.length), m = Math.min(r.length - 1, Math.floor(p * r.length)), g = r[b], y = u === a - 1 ? i : r[m];
1179
1235
  return {
1180
1236
  index: u,
1181
1237
  min: g,
1182
- max: N,
1183
- label: Wt(g, N)
1238
+ max: y,
1239
+ label: nn(g, y)
1184
1240
  };
1185
- }), l = (i - o) / a;
1241
+ }), c = (i - o) / a;
1186
1242
  return {
1187
1243
  min: o,
1188
1244
  max: i,
1189
- step: l,
1190
- bins: c,
1245
+ step: c,
1246
+ bins: l,
1191
1247
  colors: t
1192
1248
  };
1193
1249
  }
1194
- function Wt(e, t) {
1250
+ function nn(e, t) {
1195
1251
  const n = (r) => Number.isFinite(r) ? Math.abs(r) >= 1e3 ? r.toFixed(0) : Math.abs(r) >= 10 ? r.toFixed(1) : Math.abs(r) >= 0.1 ? r.toFixed(2) : r.toFixed(3) : "n/a";
1196
1252
  return `${n(e)} – ${n(t)}`;
1197
1253
  }
1198
- function Re(e, t) {
1254
+ function je(e, t) {
1199
1255
  if (!Number.isFinite(e) || !t || !Array.isArray(t.bins) || !t.bins.length)
1200
1256
  return -1;
1201
1257
  if (t.max === t.min)
@@ -1207,8 +1263,8 @@ function Re(e, t) {
1207
1263
  }
1208
1264
  return -1;
1209
1265
  }
1210
- function Kt(e, t, n = "#8b1e3f") {
1211
- const r = Re(e, t);
1266
+ function rn(e, t, n = "#8b1e3f") {
1267
+ const r = je(e, t);
1212
1268
  return r < 0 ? n : t.colors[r] || n;
1213
1269
  }
1214
1270
  function j(e) {
@@ -1218,7 +1274,7 @@ function j(e) {
1218
1274
  ...e.structuralMeshes
1219
1275
  ];
1220
1276
  }
1221
- const Jt = {
1277
+ const on = {
1222
1278
  bedding: "#2563eb",
1223
1279
  foliation: "#16a34a",
1224
1280
  joint: "#9333ea",
@@ -1227,13 +1283,13 @@ const Jt = {
1227
1283
  "shear zone": "#0ea5e9",
1228
1284
  "fault zone": "#ef4444"
1229
1285
  };
1230
- function Qt(e, t) {
1231
- const n = t || Jt, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
1232
- return new f.Color(o).getHex();
1286
+ function sn(e, t) {
1287
+ const n = t || on, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
1288
+ return new d.Color(o).getHex();
1233
1289
  }
1234
- function en(e, t) {
1290
+ function an(e, t) {
1235
1291
  const n = e * Math.PI / 180, r = t * Math.PI / 180;
1236
- return new f.Vector3(
1292
+ return new d.Vector3(
1237
1293
  Math.sin(r) * Math.sin(n),
1238
1294
  // East component
1239
1295
  Math.cos(r) * Math.sin(n),
@@ -1242,72 +1298,72 @@ function en(e, t) {
1242
1298
  // Up component
1243
1299
  ).normalize();
1244
1300
  }
1245
- function tn(e, t = {}) {
1301
+ function ln(e, t = {}) {
1246
1302
  const {
1247
1303
  radius: n = 5,
1248
1304
  discThickness: r = 0.2,
1249
1305
  opacity: o = 0.7,
1250
1306
  segments: i = 32,
1251
1307
  colorMap: a = null
1252
- } = t, c = new f.Group(), l = new f.Vector3(0, 1, 0);
1308
+ } = t, l = new d.Group(), c = new d.Vector3(0, 1, 0);
1253
1309
  for (const s of e) {
1254
- const u = s.x != null ? s.x : s.easting != null ? s.easting : null, p = s.y != null ? s.y : s.northing != null ? s.northing : null, m = s.z != null ? s.z : s.elevation != null ? s.elevation : null;
1255
- if (u == null || p == null || m == null || !Number.isFinite(u) || !Number.isFinite(p) || !Number.isFinite(m)) continue;
1256
- const h = s[K] != null ? Number(s[K]) : null, d = s[W] != null ? Number(s[W]) : null;
1310
+ const u = s.x != null ? s.x : s.easting != null ? s.easting : null, h = s.y != null ? s.y : s.northing != null ? s.northing : null, p = s.z != null ? s.z : s.elevation != null ? s.elevation : null;
1311
+ if (u == null || h == null || p == null || !Number.isFinite(u) || !Number.isFinite(h) || !Number.isFinite(p)) continue;
1312
+ const b = s[J] != null ? Number(s[J]) : null, m = s[K] != null ? Number(s[K]) : null;
1257
1313
  let g;
1258
1314
  if (s.nx != null && Number.isFinite(s.nx) && s.ny != null && Number.isFinite(s.ny) && s.nz != null && Number.isFinite(s.nz))
1259
- g = new f.Vector3(s.nx, s.ny, s.nz).normalize();
1315
+ g = new d.Vector3(s.nx, s.ny, s.nz).normalize();
1260
1316
  else {
1261
- if (h == null || d == null || !Number.isFinite(h) || !Number.isFinite(d)) continue;
1262
- g = en(h, d);
1317
+ if (b == null || m == null || !Number.isFinite(b) || !Number.isFinite(m)) continue;
1318
+ g = an(b, m);
1263
1319
  }
1264
- const N = new f.CylinderGeometry(n, n, r, i, 1, !1), O = new f.MeshStandardMaterial({
1265
- color: Qt(s.structure_type, a),
1320
+ const y = new d.CylinderGeometry(n, n, r, i, 1, !1), O = new d.MeshStandardMaterial({
1321
+ color: sn(s.structure_type, a),
1266
1322
  transparent: !0,
1267
1323
  opacity: o,
1268
- side: f.DoubleSide
1269
- }), b = new f.Mesh(N, O);
1270
- b.position.set(u, p, m), b.quaternion.setFromUnitVectors(l, g), b.userData = {
1324
+ side: d.DoubleSide
1325
+ }), f = new d.Mesh(y, O);
1326
+ f.position.set(u, h, p), f.quaternion.setFromUnitVectors(c, g), f.userData = {
1271
1327
  type: "structure",
1272
1328
  hole_id: s.hole_id,
1273
1329
  depth: s.depth ?? s.mid,
1274
1330
  structure_type: s.structure_type,
1275
- dip: h,
1276
- azimuth: d,
1331
+ dip: b,
1332
+ azimuth: m,
1277
1333
  comments: s.comments
1278
- }, c.add(b);
1334
+ }, l.add(f);
1279
1335
  }
1280
- return c;
1336
+ return l;
1281
1337
  }
1282
- function nn(e, t, n, r = {}) {
1283
- if (!e.scene || (Ve(e), !(t != null && t.length) || !(n != null && n.length))) return;
1338
+ function cn(e, t, n, r = {}) {
1339
+ if (!e.scene || (Ue(e), !(t != null && t.length) || !(n != null && n.length))) return;
1284
1340
  const { maxDiscs: o = 3e3 } = r;
1285
1341
  let i = t;
1286
1342
  if (i.length > o) {
1287
- const l = i.length / o, s = [];
1343
+ const c = i.length / o, s = [];
1288
1344
  for (let u = 0; u < o; u++)
1289
- s.push(i[Math.floor(u * l)]);
1345
+ s.push(i[Math.floor(u * c)]);
1290
1346
  i = s;
1291
1347
  }
1292
- const a = n.flatMap((l) => (l.points || []).map((s) => ({ ...s, hole_id: l.id }))), c = Ft(i, a, r);
1293
- c.length && (e.structuralGroup = tn(c, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((l) => {
1294
- l.isMesh && e.structuralMeshes.push(l);
1348
+ const a = n.flatMap((c) => (c.points || []).map((s) => ({ ...s, hole_id: c.id }))), l = Tt(i, a, r);
1349
+ l.length && (e.structuralGroup = ln(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
1350
+ c.isMesh && e.structuralMeshes.push(c);
1295
1351
  }), j(e));
1296
1352
  }
1297
- function Ve(e) {
1353
+ function Ue(e) {
1298
1354
  e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
1299
1355
  t.isMesh && (t.geometry.dispose(), t.material.dispose());
1300
1356
  }), e.structuralGroup = null), e.structuralMeshes = [], j(e);
1301
1357
  }
1302
- function rn(e, t) {
1358
+ function un(e, t) {
1303
1359
  e.structuralGroup && (e.structuralGroup.visible = !!t);
1304
1360
  }
1305
- let on = 0;
1306
- function sn(e) {
1361
+ let mn = 0;
1362
+ function dn(e) {
1307
1363
  let t, n, r, o;
1308
1364
  if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
1309
- const i = Number(e.x ?? 0), a = Number(e.y ?? 0), c = Number(e.width ?? 0), l = Number(e.height ?? 0);
1310
- t = i, n = a, r = i + c, o = a + l;
1365
+ const i = Number(e.x ?? 0), a = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
1366
+ t = i, n = a, r = i + l, o = a + c;
1311
1367
  } else
1312
1368
  t = Number(e.minX), n = Number(e.minY), r = Number(e.maxX), o = Number(e.maxY);
1313
1369
  if (r - t <= 0)
@@ -1320,7 +1376,7 @@ function sn(e) {
1320
1376
  );
1321
1377
  return { minX: t, minY: n, maxX: r, maxY: o };
1322
1378
  }
1323
- function an(e) {
1379
+ function fn(e) {
1324
1380
  if (e.type === "texture")
1325
1381
  return Promise.resolve(e.texture);
1326
1382
  let t, n = !1;
@@ -1333,7 +1389,7 @@ function an(e) {
1333
1389
  new Error(`Unsupported raster source type: "${e.type}"`)
1334
1390
  );
1335
1391
  return new Promise((r, o) => {
1336
- new f.TextureLoader().load(
1392
+ new d.TextureLoader().load(
1337
1393
  t,
1338
1394
  (a) => {
1339
1395
  n && URL.revokeObjectURL(t), r(a);
@@ -1349,71 +1405,71 @@ function an(e) {
1349
1405
  );
1350
1406
  });
1351
1407
  }
1352
- async function Vr(e) {
1353
- const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, a = e.id ?? `raster-overlay-${++on}`, c = e.name ?? a;
1354
- let l = e.opacity ?? 1;
1355
- if ((l < 0 || l > 1) && (console.warn(
1356
- `[baselode] raster overlay "${a}": opacity ${l} is outside [0, 1] — clamped`
1357
- ), l = Math.max(0, Math.min(1, l))), !t) throw new Error("raster overlay: options.source is required");
1408
+ async function Xr(e) {
1409
+ const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, a = e.id ?? `raster-overlay-${++mn}`, l = e.name ?? a;
1410
+ let c = e.opacity ?? 1;
1411
+ if ((c < 0 || c > 1) && (console.warn(
1412
+ `[baselode] raster overlay "${a}": opacity ${c} is outside [0, 1] — clamped`
1413
+ ), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
1358
1414
  if (!n) throw new Error("raster overlay: options.bounds is required");
1359
- const s = sn(n), { minX: u, minY: p, maxX: m, maxY: h } = s, d = m - u, g = h - p, N = (u + m) / 2, O = (p + h) / 2, b = await an(t), L = new f.PlaneGeometry(d, g), y = new f.MeshBasicMaterial({
1360
- map: b,
1415
+ const s = dn(n), { minX: u, minY: h, maxX: p, maxY: b } = s, m = p - u, g = b - h, y = (u + p) / 2, O = (h + b) / 2, f = await fn(t), A = new d.PlaneGeometry(m, g), _ = new d.MeshBasicMaterial({
1416
+ map: f,
1361
1417
  transparent: !0,
1362
- opacity: l,
1363
- side: f.DoubleSide,
1418
+ opacity: c,
1419
+ side: d.DoubleSide,
1364
1420
  depthWrite: !1
1365
- }), E = new f.Mesh(L, y);
1366
- return E.position.set(N, O, r), E.renderOrder = i, E.visible = o, { id: a, name: c, mesh: E, texture: b, bounds: s, elevation: r, opacity: l, visible: o };
1421
+ }), z = new d.Mesh(A, _);
1422
+ return z.position.set(y, O, r), z.renderOrder = i, z.visible = o, { id: a, name: l, mesh: z, texture: f, bounds: s, elevation: r, opacity: c, visible: o };
1367
1423
  }
1368
- function ln(e, t) {
1369
- e.scene && (e.rasterOverlays.has(t.id) && _e(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
1424
+ function hn(e, t) {
1425
+ e.scene && (e.rasterOverlays.has(t.id) && Me(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
1370
1426
  }
1371
- function _e(e, t) {
1427
+ function Me(e, t) {
1372
1428
  var r;
1373
1429
  const n = e.rasterOverlays.get(t);
1374
1430
  n && ((r = e.scene) == null || r.remove(n.mesh), n.mesh.geometry.dispose(), n.mesh.material.dispose(), n.texture && n.texture.dispose(), e.rasterOverlays.delete(t));
1375
1431
  }
1376
- function cn(e, t, n) {
1432
+ function bn(e, t, n) {
1377
1433
  const r = e.rasterOverlays.get(t);
1378
1434
  if (!r) return;
1379
1435
  const o = Math.max(0, Math.min(1, Number(n)));
1380
1436
  r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
1381
1437
  }
1382
- function un(e, t, n) {
1438
+ function pn(e, t, n) {
1383
1439
  const r = e.rasterOverlays.get(t);
1384
1440
  r && (r.visible = !!n, r.mesh.visible = r.visible);
1385
1441
  }
1386
- function mn(e, t, n) {
1442
+ function gn(e, t, n) {
1387
1443
  const r = e.rasterOverlays.get(t);
1388
1444
  r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
1389
1445
  }
1390
- function dn(e, t) {
1446
+ function yn(e, t) {
1391
1447
  return e.rasterOverlays.get(t);
1392
1448
  }
1393
- function fn(e) {
1449
+ function _n(e) {
1394
1450
  return Array.from(e.rasterOverlays.values());
1395
1451
  }
1396
- function hn(e) {
1452
+ function Mn(e) {
1397
1453
  for (const t of [...e.rasterOverlays.keys()])
1398
- _e(e, t);
1454
+ Me(e, t);
1399
1455
  }
1400
- function Me(e) {
1401
- var n, r, o, i, a, c, l, s, u;
1456
+ function Ee(e) {
1457
+ var n, r, o, i, a, l, c, s, u;
1402
1458
  if (!e) return "";
1403
- const t = (p) => Number.isFinite(p) ? p.toFixed(3) : "nan";
1459
+ const t = (h) => Number.isFinite(h) ? h.toFixed(3) : "nan";
1404
1460
  return [
1405
1461
  t((n = e.camera) == null ? void 0 : n.x),
1406
1462
  t((r = e.camera) == null ? void 0 : r.y),
1407
1463
  t((o = e.camera) == null ? void 0 : o.z),
1408
1464
  t((i = e.target) == null ? void 0 : i.x),
1409
1465
  t((a = e.target) == null ? void 0 : a.y),
1410
- t((c = e.target) == null ? void 0 : c.z),
1411
- t((l = e.up) == null ? void 0 : l.x),
1466
+ t((l = e.target) == null ? void 0 : l.z),
1467
+ t((c = e.up) == null ? void 0 : c.x),
1412
1468
  t((s = e.up) == null ? void 0 : s.y),
1413
1469
  t((u = e.up) == null ? void 0 : u.z)
1414
1470
  ].join("|");
1415
1471
  }
1416
- function He(e) {
1472
+ function $e(e) {
1417
1473
  return !e.camera || !e.controls ? null : {
1418
1474
  camera: {
1419
1475
  x: e.camera.position.x,
@@ -1432,37 +1488,37 @@ function He(e) {
1432
1488
  }
1433
1489
  };
1434
1490
  }
1435
- function bn(e, t) {
1491
+ function En(e, t) {
1436
1492
  if (!e.camera || !e.controls || !t) return !1;
1437
1493
  const n = t.camera || {}, r = t.target || {}, o = t.up || {};
1438
- return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = Me(t), !0) : !1;
1494
+ return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = Ee(t), !0) : !1;
1439
1495
  }
1440
- function pn(e) {
1496
+ function zn(e) {
1441
1497
  if (!e.viewChangeHandler) return;
1442
1498
  const t = Date.now();
1443
1499
  if (t - e._lastViewEmitMs < 250) return;
1444
- const n = He(e);
1500
+ const n = $e(e);
1445
1501
  if (!n) return;
1446
- const r = Me(n);
1502
+ const r = Ee(n);
1447
1503
  r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
1448
1504
  }
1449
- function Ee(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a }) {
1450
- const c = (t + n) / 2, l = (r + o) / 2, s = (i + a) / 2, u = n - t, p = o - r, m = a - i, d = Math.max(u, p, m, 1) * 2;
1451
- e.controls.target.set(c, l, s), e.camera.position.set(c + d, l + d, s + d), e.camera.lookAt(c, l, s), e.controls.update();
1505
+ function ze(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a }) {
1506
+ const l = (t + n) / 2, c = (r + o) / 2, s = (i + a) / 2, u = n - t, h = o - r, p = a - i, m = Math.max(u, h, p, 1) * 2;
1507
+ e.controls.target.set(l, c, s), e.camera.position.set(l + m, c + m, s + m), e.camera.lookAt(l, c, s), e.controls.update();
1452
1508
  }
1453
- function gn(e, t = 1e3) {
1509
+ function Nn(e, t = 1e3) {
1454
1510
  !e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(t, t, t), e.camera.lookAt(0, 0, 0), e.controls.update());
1455
1511
  }
1456
- function yn(e, t = 2e3) {
1512
+ function On(e, t = 2e3) {
1457
1513
  !e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(0, 0, t), e.camera.up.set(0, 1, 0), e.camera.lookAt(0, 0, 0), e.controls.update());
1458
1514
  }
1459
- function _n(e, t = 0, n = 0) {
1515
+ function Ln(e, t = 0, n = 0) {
1460
1516
  e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
1461
1517
  }
1462
- function Mn(e, t = 1.1) {
1518
+ function An(e, t = 1.1) {
1463
1519
  !e.controls || typeof e.controls.dollyIn != "function" || typeof e.controls.dollyOut != "function" || (t > 1 ? e.controls.dollyOut(t) : e.controls.dollyIn(1 / t), e.controls.update());
1464
1520
  }
1465
- function En(e, t = 1.2) {
1521
+ function kn(e, t = 1.2) {
1466
1522
  if (!e.lastBounds) return;
1467
1523
  const {
1468
1524
  minX: n,
@@ -1470,17 +1526,17 @@ function En(e, t = 1.2) {
1470
1526
  minY: o,
1471
1527
  maxY: i,
1472
1528
  minZ: a,
1473
- maxZ: c
1474
- } = e.lastBounds, l = (r - n) * t, s = (i - o) * t, u = (c - a) * t, p = (n + r) / 2, m = (o + i) / 2, h = (a + c) / 2, g = Math.max(l, s, u, 1) * 2;
1475
- e.controls.target.set(p, m, h), e.camera.position.set(p + g, m + g, h + g), e.camera.lookAt(p, m, h), e.controls.update();
1529
+ maxZ: l
1530
+ } = e.lastBounds, c = (r - n) * t, s = (i - o) * t, u = (l - a) * t, h = (n + r) / 2, p = (o + i) / 2, b = (a + l) / 2, g = Math.max(c, s, u, 1) * 2;
1531
+ e.controls.target.set(h, p, b), e.camera.position.set(h + g, p + g, b + g), e.camera.lookAt(h, p, b), e.controls.update();
1476
1532
  }
1477
- const zn = 1, Nn = 120;
1478
- function On(e, t) {
1533
+ const Dn = 1, Sn = 120;
1534
+ function wn(e, t) {
1479
1535
  if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
1480
- const n = Math.min(Nn, Math.max(zn, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, a = 2 * o * Math.tan(i / 2), c = n * Math.PI / 180, l = a / (2 * Math.tan(c / 2)), s = e.camera.position.clone().sub(r).normalize();
1481
- return e.camera.position.copy(r).addScaledVector(s, l), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
1536
+ const n = Math.min(Sn, Math.max(Dn, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, a = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, c = a / (2 * Math.tan(l / 2)), s = e.camera.position.clone().sub(r).normalize();
1537
+ return e.camera.position.copy(r).addScaledVector(s, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
1482
1538
  }
1483
- function kn(e, t = "orbit") {
1539
+ function xn(e, t = "orbit") {
1484
1540
  if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
1485
1541
  e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
1486
1542
  else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
@@ -1490,36 +1546,36 @@ function kn(e, t = "orbit") {
1490
1546
  }
1491
1547
  }
1492
1548
  const T = "#9ca3af";
1493
- function Ae(e, t) {
1549
+ function De(e, t) {
1494
1550
  const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
1495
1551
  if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
1496
1552
  const o = Math.min(n, r), i = Math.max(n, r);
1497
1553
  return i <= o ? null : { segStart: o, segEnd: i };
1498
1554
  }
1499
- function Ln(e, t, n) {
1555
+ function vn(e, t, n) {
1500
1556
  let r = 0, o = 0;
1501
1557
  for (let a = 0; a < e.length; a += 1) {
1502
- const c = e[a], l = Number(c == null ? void 0 : c.from), s = Number(c == null ? void 0 : c.to), u = Number(c == null ? void 0 : c.value);
1503
- if (!Number.isFinite(l) || !Number.isFinite(s) || !Number.isFinite(u) || s <= l) continue;
1504
- const p = Math.max(t, l), h = Math.min(n, s) - p;
1505
- h <= 0 || (r += u * h, o += h);
1558
+ const l = e[a], c = Number(l == null ? void 0 : l.from), s = Number(l == null ? void 0 : l.to), u = Number(l == null ? void 0 : l.value);
1559
+ if (!Number.isFinite(c) || !Number.isFinite(s) || !Number.isFinite(u) || s <= c) continue;
1560
+ const h = Math.max(t, c), b = Math.min(n, s) - h;
1561
+ b <= 0 || (r += u * b, o += b);
1506
1562
  }
1507
1563
  if (o <= 0) return null;
1508
1564
  const i = r / o;
1509
1565
  return Number.isFinite(i) ? i : null;
1510
1566
  }
1511
- function An(e, t) {
1512
- if (!Number.isFinite(e)) return new f.Color(T);
1513
- if (Re(e, t) < 0) return new f.Color(T);
1514
- const r = Kt(e, t, T);
1515
- return new f.Color(r);
1567
+ function Fn(e, t) {
1568
+ if (!Number.isFinite(e)) return new d.Color(T);
1569
+ if (je(e, t) < 0) return new d.Color(T);
1570
+ const r = rn(e, t, T);
1571
+ return new d.Color(r);
1516
1572
  }
1517
- function Dn(e) {
1573
+ function Cn(e) {
1518
1574
  if (!e || !String(e).trim()) return T;
1519
- const t = Ge(String(e).toLowerCase().trim());
1520
- return "#" + new f.Color().setHSL(t, 0.7, 0.5).getHexString();
1575
+ const t = Ye(String(e).toLowerCase().trim());
1576
+ return "#" + new d.Color().setHSL(t, 0.7, 0.5).getHexString();
1521
1577
  }
1522
- function Sn(e = {}) {
1578
+ function In(e = {}) {
1523
1579
  return {
1524
1580
  preserveView: !!e.preserveView,
1525
1581
  assayIntervalsByHole: e.assayIntervalsByHole || null,
@@ -1527,7 +1583,7 @@ function Sn(e = {}) {
1527
1583
  isCategoricalVariable: !!e.isCategoricalVariable
1528
1584
  };
1529
1585
  }
1530
- function wn(e, t) {
1586
+ function Tn(e, t) {
1531
1587
  if (!e || !t) return [];
1532
1588
  const n = [];
1533
1589
  return Object.values(e).forEach((r) => {
@@ -1537,138 +1593,138 @@ function wn(e, t) {
1537
1593
  });
1538
1594
  }), n;
1539
1595
  }
1540
- function oe(e) {
1596
+ function ie(e) {
1541
1597
  return {
1542
1598
  holeId: e.id,
1543
1599
  project: e.project
1544
1600
  };
1545
1601
  }
1546
- function xn(e) {
1602
+ function Pn(e) {
1547
1603
  return `${e ?? ""}`.trim().toLowerCase();
1548
1604
  }
1549
- function Fn(e, t) {
1550
- const n = `${e ?? ""}:${t ?? 0}`, r = Ge(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, a = new f.Color();
1605
+ function Bn(e, t) {
1606
+ const n = `${e ?? ""}:${t ?? 0}`, r = Ye(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, a = new d.Color();
1551
1607
  return a.setHSL(i, 1, 0.5), a;
1552
1608
  }
1553
- function Ge(e) {
1609
+ function Ye(e) {
1554
1610
  const t = `${e ?? ""}`;
1555
1611
  let n = 2166136261;
1556
1612
  for (let r = 0; r < t.length; r += 1)
1557
1613
  n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
1558
1614
  return (n >>> 0) / 4294967295;
1559
1615
  }
1560
- function vn(e, t, n) {
1616
+ function Rn(e, t, n) {
1561
1617
  let r = null, o = 0;
1562
1618
  for (const i of e) {
1563
- const a = Number(i == null ? void 0 : i.from), c = Number(i == null ? void 0 : i.to);
1564
- if (!Number.isFinite(a) || !Number.isFinite(c)) continue;
1565
- const l = Math.min(n, c) - Math.max(t, a);
1566
- l > o && (o = l, r = i == null ? void 0 : i.value);
1619
+ const a = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
1620
+ if (!Number.isFinite(a) || !Number.isFinite(l)) continue;
1621
+ const c = Math.min(n, l) - Math.max(t, a);
1622
+ c > o && (o = c, r = i == null ? void 0 : i.value);
1567
1623
  }
1568
1624
  return r;
1569
1625
  }
1570
- function In(e, t) {
1626
+ function Vn(e, t) {
1571
1627
  if (!t || !e) return [];
1572
1628
  const n = e.id || e.holeId;
1573
1629
  if (!n) return [];
1574
1630
  const r = t[n];
1575
1631
  if (Array.isArray(r) && r.length) return r;
1576
- const o = xn(n);
1632
+ const o = Pn(n);
1577
1633
  if (o) {
1578
1634
  const i = t[o];
1579
1635
  if (Array.isArray(i) && i.length) return i;
1580
1636
  }
1581
1637
  return [];
1582
1638
  }
1583
- function Cn({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: a, isCategorical: c }) {
1639
+ function Hn({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: a, isCategorical: l }) {
1584
1640
  if (!e)
1585
- return Fn(r, o);
1641
+ return Bn(r, o);
1586
1642
  if (e === "__HAS_ASSAY__") {
1587
- if (!(t != null && t.length)) return new f.Color(T);
1588
- const u = Ae(i, a);
1589
- return u ? t.some((m) => {
1590
- const h = Number(m == null ? void 0 : m.from), d = Number(m == null ? void 0 : m.to);
1591
- if (!Number.isFinite(h) || !Number.isFinite(d)) return !1;
1592
- const g = Math.max(u.segStart, h);
1593
- return Math.min(u.segEnd, d) > g;
1594
- }) ? new f.Color("#ff8c42") : new f.Color(T) : new f.Color(T);
1595
- }
1596
- if (!(t != null && t.length)) return new f.Color(T);
1597
- const l = Ae(i, a);
1598
- if (!l) return new f.Color(T);
1599
- if (c) {
1600
- const u = vn(t, l.segStart, l.segEnd);
1601
- return new f.Color(Dn(u));
1602
- }
1603
- const s = Ln(t, l.segStart, l.segEnd);
1604
- return An(s, n);
1605
- }
1606
- function Tn(e, t, n = {}) {
1607
- if (!e.scene || (je(e), !t || t.length === 0)) return;
1608
- const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: a } = Sn(n), c = a ? [] : wn(o, i), l = Zt(c);
1609
- let s = 1 / 0, u = -1 / 0, p = 1 / 0, m = -1 / 0, h = 1 / 0, d = -1 / 0;
1610
- const g = new f.Vector3(), N = new f.Vector3(0, 1, 0);
1611
- t.forEach((O, b) => {
1612
- const y = b * 137.5 % 360 / 360, E = new f.Color().setHSL(y, 0.75, 0.55), k = (O.points || []).map((A) => {
1613
- s = Math.min(s, A.x), u = Math.max(u, A.x), p = Math.min(p, A.y), m = Math.max(m, A.y), h = Math.min(h, A.z), d = Math.max(d, A.z);
1614
- const x = new f.Vector3(A.x, A.y, A.z);
1615
- return x.md = A.md, x;
1643
+ if (!(t != null && t.length)) return new d.Color(T);
1644
+ const u = De(i, a);
1645
+ return u ? t.some((p) => {
1646
+ const b = Number(p == null ? void 0 : p.from), m = Number(p == null ? void 0 : p.to);
1647
+ if (!Number.isFinite(b) || !Number.isFinite(m)) return !1;
1648
+ const g = Math.max(u.segStart, b);
1649
+ return Math.min(u.segEnd, m) > g;
1650
+ }) ? new d.Color("#ff8c42") : new d.Color(T) : new d.Color(T);
1651
+ }
1652
+ if (!(t != null && t.length)) return new d.Color(T);
1653
+ const c = De(i, a);
1654
+ if (!c) return new d.Color(T);
1655
+ if (l) {
1656
+ const u = Rn(t, c.segStart, c.segEnd);
1657
+ return new d.Color(Cn(u));
1658
+ }
1659
+ const s = vn(t, c.segStart, c.segEnd);
1660
+ return Fn(s, n);
1661
+ }
1662
+ function Gn(e, t, n = {}) {
1663
+ if (!e.scene || (Xe(e), !t || t.length === 0)) return;
1664
+ const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: a } = In(n), l = a ? [] : Tn(o, i), c = tn(l);
1665
+ let s = 1 / 0, u = -1 / 0, h = 1 / 0, p = -1 / 0, b = 1 / 0, m = -1 / 0;
1666
+ const g = new d.Vector3(), y = new d.Vector3(0, 1, 0);
1667
+ t.forEach((O, f) => {
1668
+ const _ = f * 137.5 % 360 / 360, z = new d.Color().setHSL(_, 0.75, 0.55), L = (O.points || []).map((k) => {
1669
+ s = Math.min(s, k.x), u = Math.max(u, k.x), h = Math.min(h, k.y), p = Math.max(p, k.y), b = Math.min(b, k.z), m = Math.max(m, k.z);
1670
+ const x = new d.Vector3(k.x, k.y, k.z);
1671
+ return x.md = k.md, x;
1616
1672
  });
1617
- if (k.length < 2) {
1618
- if (k.length === 1) {
1619
- const A = new f.SphereGeometry(5, 12, 12), x = new f.MeshLambertMaterial({
1620
- color: E,
1621
- emissive: E,
1673
+ if (L.length < 2) {
1674
+ if (L.length === 1) {
1675
+ const k = new d.SphereGeometry(5, 12, 12), x = new d.MeshLambertMaterial({
1676
+ color: z,
1677
+ emissive: z,
1622
1678
  emissiveIntensity: 0.2
1623
- }), S = new f.Mesh(A, x);
1624
- S.position.copy(k[0]), S.userData = oe(O), e.scene.add(S), e.drillLines.push(S), e.drillMeshes.push(S);
1679
+ }), S = new d.Mesh(k, x);
1680
+ S.position.copy(L[0]), S.userData = ie(O), e.scene.add(S), e.drillLines.push(S), e.drillMeshes.push(S);
1625
1681
  }
1626
1682
  return;
1627
1683
  }
1628
- const D = new f.Group();
1629
- D.userData = oe(O);
1630
- const w = i ? In(O, o) : [];
1631
- for (let A = 0; A < k.length - 1; A += 1) {
1632
- const x = k[A], S = k[A + 1], v = g.subVectors(S, x), C = v.length();
1633
- if (C <= 1e-3) continue;
1634
- const I = 2.2, P = new f.CylinderGeometry(I, I, C, 6, 1, !0), B = Cn({
1684
+ const D = new d.Group();
1685
+ D.userData = ie(O);
1686
+ const w = i ? Vn(O, o) : [];
1687
+ for (let k = 0; k < L.length - 1; k += 1) {
1688
+ const x = L[k], S = L[k + 1], F = g.subVectors(S, x), I = F.length();
1689
+ if (I <= 1e-3) continue;
1690
+ const C = 2.2, P = new d.CylinderGeometry(C, C, I, 6, 1, !0), B = Hn({
1635
1691
  selectedAssayVariable: i,
1636
1692
  assayIntervals: w,
1637
- assayScale: l,
1693
+ assayScale: c,
1638
1694
  holeId: O.id,
1639
- segmentIndex: A,
1695
+ segmentIndex: k,
1640
1696
  p1: x,
1641
1697
  p2: S,
1642
1698
  isCategorical: a
1643
- }), z = new f.MeshLambertMaterial({
1699
+ }), N = new d.MeshLambertMaterial({
1644
1700
  color: B,
1645
1701
  flatShading: !0,
1646
1702
  emissive: B,
1647
1703
  emissiveIntensity: 0.15
1648
- }), F = new f.Mesh(P, z);
1649
- F.position.copy(x.clone().addScaledVector(v, 0.5)), F.quaternion.setFromUnitVectors(N, v.clone().normalize()), F.userData = oe(O), D.add(F), e.drillMeshes.push(F);
1704
+ }), v = new d.Mesh(P, N);
1705
+ v.position.copy(x.clone().addScaledVector(F, 0.5)), v.quaternion.setFromUnitVectors(y, F.clone().normalize()), v.userData = ie(O), D.add(v), e.drillMeshes.push(v);
1650
1706
  }
1651
1707
  e.scene.add(D), e.drillLines.push(D);
1652
- }), e.camera && e.controls && (e.lastBounds = { minX: s, maxX: u, minY: p, maxY: m, minZ: h, maxZ: d }, r || Ee(e, { minX: s, maxX: u, minY: p, maxY: m, minZ: h, maxZ: d })), j(e);
1708
+ }), e.camera && e.controls && (e.lastBounds = { minX: s, maxX: u, minY: h, maxY: p, minZ: b, maxZ: m }, r || ze(e, { minX: s, maxX: u, minY: h, maxY: p, minZ: b, maxZ: m })), j(e);
1653
1709
  }
1654
- function je(e) {
1710
+ function Xe(e) {
1655
1711
  e.drillLines.forEach((t) => {
1656
1712
  e.scene.remove(t), t.isGroup ? t.traverse((n) => {
1657
1713
  n.isMesh && (n.geometry.dispose(), n.material.dispose());
1658
1714
  }) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
1659
1715
  }), e.drillLines = [], e.drillMeshes = [], j(e);
1660
1716
  }
1661
- const Pn = 20, Bn = 15, Rn = "#00bcd4";
1662
- function Vn(e = {}) {
1717
+ const jn = 20, Un = 15, $n = "#00bcd4";
1718
+ function Yn(e = {}) {
1663
1719
  return {
1664
- panelWidth: e.panelWidth != null ? Number(e.panelWidth) : Pn,
1665
- lateralOffset: e.lateralOffset != null ? Number(e.lateralOffset) : Bn,
1666
- color: e.color || Rn,
1720
+ panelWidth: e.panelWidth != null ? Number(e.panelWidth) : jn,
1721
+ lateralOffset: e.lateralOffset != null ? Number(e.lateralOffset) : Un,
1722
+ color: e.color || $n,
1667
1723
  valueMin: e.valueMin != null ? Number(e.valueMin) : null,
1668
1724
  valueMax: e.valueMax != null ? Number(e.valueMax) : null
1669
1725
  };
1670
1726
  }
1671
- function Hr(e) {
1727
+ function qr(e) {
1672
1728
  if (!e || e.length < 2) return null;
1673
1729
  let t = -1 / 0, n = 1 / 0;
1674
1730
  for (const o of e)
@@ -1676,116 +1732,116 @@ function Hr(e) {
1676
1732
  const r = t - n;
1677
1733
  return r < 1e-3 ? null : { topZ: t, botZ: n, height: r };
1678
1734
  }
1679
- function Hn(e, t, n, r, o, i, a) {
1735
+ function Xn(e, t, n, r, o, i, a) {
1680
1736
  if (!Array.isArray(e) || !Array.isArray(t)) return [];
1681
- const c = Math.min(e.length, t.length), l = [];
1682
- for (let b = 0; b < c; b++)
1683
- Number.isFinite(e[b]) && Number.isFinite(t[b]) && l.push({ d: e[b], v: t[b] });
1684
- if (l.length < 2) return [];
1685
- const s = a != null && a > 0 ? a : null, u = s != null ? 0 : Math.min(...l.map((b) => b.d)), m = (s ?? Math.max(...l.map((b) => b.d))) - u || 1, h = Math.min(...l.map((b) => b.v)), d = Math.max(...l.map((b) => b.v)), g = o ?? h, O = (i ?? d) - g || 1;
1686
- return l.map(({ d: b, v: L }) => {
1687
- const y = (b - u) / m, E = Math.max(0, Math.min(1, (L - g) / O)), k = -n / 2 + E * n, D = y * r;
1688
- return new f.Vector3(k, D, 0.01);
1737
+ const l = Math.min(e.length, t.length), c = [];
1738
+ for (let f = 0; f < l; f++)
1739
+ Number.isFinite(e[f]) && Number.isFinite(t[f]) && c.push({ d: e[f], v: t[f] });
1740
+ if (c.length < 2) return [];
1741
+ const s = a != null && a > 0 ? a : null, u = s != null ? 0 : Math.min(...c.map((f) => f.d)), p = (s ?? Math.max(...c.map((f) => f.d))) - u || 1, b = Math.min(...c.map((f) => f.v)), m = Math.max(...c.map((f) => f.v)), g = o ?? b, O = (i ?? m) - g || 1;
1742
+ return c.map(({ d: f, v: A }) => {
1743
+ const _ = (f - u) / p, z = Math.max(0, Math.min(1, (A - g) / O)), L = -n / 2 + z * n, D = _ * r;
1744
+ return new d.Vector3(L, D, 0.01);
1689
1745
  });
1690
1746
  }
1691
- function Gn(e, t) {
1747
+ function qn(e, t) {
1692
1748
  const n = e.length;
1693
1749
  if (n < 2) return null;
1694
1750
  const r = [], o = [];
1695
1751
  let i = 0;
1696
- for (let c = 0; c < n - 1; c++) {
1697
- const l = e[c], s = e[c + 1], u = s.x - l.x, p = s.y - l.y, m = Math.sqrt(u * u + p * p);
1698
- if (m < 1e-6) continue;
1699
- const h = -p / m * t, d = u / m * t, g = 0.01;
1752
+ for (let l = 0; l < n - 1; l++) {
1753
+ const c = e[l], s = e[l + 1], u = s.x - c.x, h = s.y - c.y, p = Math.sqrt(u * u + h * h);
1754
+ if (p < 1e-6) continue;
1755
+ const b = -h / p * t, m = u / p * t, g = 0.01;
1700
1756
  r.push(
1701
- l.x + h,
1702
- l.y + d,
1757
+ c.x + b,
1758
+ c.y + m,
1703
1759
  g,
1704
- l.x - h,
1705
- l.y - d,
1760
+ c.x - b,
1761
+ c.y - m,
1706
1762
  g,
1707
- s.x + h,
1708
- s.y + d,
1763
+ s.x + b,
1764
+ s.y + m,
1709
1765
  g,
1710
- s.x - h,
1711
- s.y - d,
1766
+ s.x - b,
1767
+ s.y - m,
1712
1768
  g
1713
1769
  ), o.push(i, i + 1, i + 2, i + 1, i + 3, i + 2), i += 4;
1714
1770
  }
1715
1771
  if (r.length === 0) return null;
1716
- const a = new f.BufferGeometry();
1717
- return a.setAttribute("position", new f.Float32BufferAttribute(r, 3)), a.setIndex(o), a;
1772
+ const a = new d.BufferGeometry();
1773
+ return a.setAttribute("position", new d.Float32BufferAttribute(r, 3)), a.setIndex(o), a;
1718
1774
  }
1719
- function jn(e, t) {
1775
+ function Zn(e, t) {
1720
1776
  const n = e.points || [];
1721
1777
  if (n.length < 2) return null;
1722
- const r = n[0], o = n[n.length - 1], i = new f.Vector3(
1778
+ const r = n[0], o = n[n.length - 1], i = new d.Vector3(
1723
1779
  o.x - r.x,
1724
1780
  o.y - r.y,
1725
1781
  o.z - r.z
1726
1782
  ), a = i.length();
1727
1783
  if (a < 1e-3) return null;
1728
- const c = i.clone().normalize(), l = Vn(t.options), { panelWidth: s, lateralOffset: u, color: p, valueMin: m, valueMax: h } = l, d = new f.Vector3(0, 0, 1);
1729
- let g = new f.Vector3().crossVectors(c, d);
1784
+ const l = i.clone().normalize(), c = Yn(t.options), { panelWidth: s, lateralOffset: u, color: h, valueMin: p, valueMax: b } = c, m = new d.Vector3(0, 0, 1);
1785
+ let g = new d.Vector3().crossVectors(l, m);
1730
1786
  g.lengthSq() < 1e-6 ? g.set(1, 0, 0) : g.normalize();
1731
- const N = new f.Vector3().crossVectors(g, c).normalize(), O = new f.Vector3(r.x, r.y, r.z).addScaledVector(g, u), b = new f.Matrix4().makeBasis(g, c, N), L = new f.Quaternion().setFromRotationMatrix(b), y = n.map((v) => v.md).filter(Number.isFinite), E = y.length > 0 ? Math.max(...y) : a, k = Hn(
1787
+ const y = new d.Vector3().crossVectors(g, l).normalize(), O = new d.Vector3(r.x, r.y, r.z).addScaledVector(g, u), f = new d.Matrix4().makeBasis(g, l, y), A = new d.Quaternion().setFromRotationMatrix(f), _ = n.map((F) => F.md).filter(Number.isFinite), z = _.length > 0 ? Math.max(..._) : a, L = Xn(
1732
1788
  t.depths,
1733
1789
  t.values,
1734
1790
  s,
1735
1791
  a,
1736
- m,
1737
- h,
1738
- E
1792
+ p,
1793
+ b,
1794
+ z
1739
1795
  );
1740
- if (k.length < 2) return null;
1741
- const D = new f.Group();
1796
+ if (L.length < 2) return null;
1797
+ const D = new d.Group();
1742
1798
  D.userData = { holeId: e.id, isStripLog: !0 };
1743
- const w = s * 0.025, A = Gn(k, w);
1744
- if (!A) return null;
1745
- const x = new f.MeshBasicMaterial({
1746
- color: new f.Color(p),
1747
- side: f.DoubleSide
1748
- }), S = new f.Mesh(A, x);
1749
- return S.position.copy(O), S.quaternion.copy(L), D.add(S), D;
1750
- }
1751
- function Un(e, t, n) {
1752
- if (!e.scene || (ce(e), !n || n.length === 0) || !t || t.length === 0) return;
1799
+ const w = s * 0.025, k = qn(L, w);
1800
+ if (!k) return null;
1801
+ const x = new d.MeshBasicMaterial({
1802
+ color: new d.Color(h),
1803
+ side: d.DoubleSide
1804
+ }), S = new d.Mesh(k, x);
1805
+ return S.position.copy(O), S.quaternion.copy(A), D.add(S), D;
1806
+ }
1807
+ function Wn(e, t, n) {
1808
+ if (!e.scene || (ue(e), !n || n.length === 0) || !t || t.length === 0) return;
1753
1809
  const r = /* @__PURE__ */ new Map();
1754
1810
  t.forEach((o) => {
1755
1811
  o.id != null && r.set(o.id, o);
1756
1812
  }), n.forEach((o) => {
1757
1813
  const i = r.get(o.holeId);
1758
1814
  if (!i) return;
1759
- const a = jn(i, o);
1815
+ const a = Zn(i, o);
1760
1816
  a && (e.scene.add(a), e.stripLogGroups.push(a));
1761
1817
  });
1762
1818
  }
1763
- function ce(e) {
1819
+ function ue(e) {
1764
1820
  e.stripLogGroups && (e.stripLogGroups.forEach((t) => {
1765
1821
  e.scene && e.scene.remove(t), t.traverse((n) => {
1766
1822
  n.geometry && n.geometry.dispose(), n.material && n.material.dispose();
1767
1823
  });
1768
1824
  }), e.stripLogGroups = []);
1769
1825
  }
1770
- const De = "#ffffbb", Yn = 2, $n = 1.5, Xn = 1;
1771
- function qn(e) {
1826
+ const Se = "#ffffbb", Kn = 2, Jn = 1.5, Qn = 1;
1827
+ function er(e) {
1772
1828
  const { renderer: t, scene: n, camera: r, container: o } = e;
1773
1829
  if (!t || !n || !r) return;
1774
- const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, a = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, c = new lt(t), l = new ct(n, r);
1775
- c.addPass(l);
1776
- const s = new f.Vector2(i, a), u = new ut(s, n, r);
1777
- u.visibleEdgeColor.set(De), u.hiddenEdgeColor.set(De), u.edgeStrength = Yn, u.edgeThickness = $n, u.edgeGlow = Xn, u.pulsePeriod = 0, u.selectedObjects = [], c.addPass(u), c.setSize(i, a), e._composer = c, e._outlinePass = u;
1830
+ const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, a = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new dt(t), c = new ft(n, r);
1831
+ l.addPass(c);
1832
+ const s = new d.Vector2(i, a), u = new ht(s, n, r);
1833
+ u.visibleEdgeColor.set(Se), u.hiddenEdgeColor.set(Se), u.edgeStrength = Kn, u.edgeThickness = Jn, u.edgeGlow = Qn, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, a), e._composer = l, e._outlinePass = u;
1778
1834
  }
1779
- function Zn(e, t, n) {
1835
+ function tr(e, t, n) {
1780
1836
  !e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
1781
1837
  }
1782
- function Z(e, t) {
1838
+ function W(e, t) {
1783
1839
  e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
1784
1840
  }
1785
- function Se(e) {
1841
+ function we(e) {
1786
1842
  e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
1787
1843
  }
1788
- const Wn = [
1844
+ const nr = [
1789
1845
  { normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
1790
1846
  { normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
1791
1847
  { normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
@@ -1793,181 +1849,181 @@ const Wn = [
1793
1849
  { normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
1794
1850
  { normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
1795
1851
  ];
1796
- function Kn(e, t, n, r, o = {}) {
1797
- if (!e.scene || (Ue(e), !t || !n || !r)) return;
1852
+ function rr(e, t, n, r, o = {}) {
1853
+ if (!e.scene || (qe(e), !t || !n || !r)) return;
1798
1854
  const { autoCenter: i = !0, opacity: a = 1 } = o;
1799
- let c = 1 / 0, l = -1 / 0, s = 1 / 0, u = -1 / 0, p = 1 / 0, m = -1 / 0;
1800
- t.forEach((z) => {
1801
- const F = Number(z.x ?? z.center_x ?? 0), R = Number(z.y ?? z.center_y ?? 0), Y = Number(z.z ?? z.center_z ?? 0), $ = Number(z.dx ?? z.size_x ?? 1), X = Number(z.dy ?? z.size_y ?? 1), q = Number(z.dz ?? z.size_z ?? 1);
1802
- c = Math.min(c, F - $ / 2), l = Math.max(l, F + $ / 2), s = Math.min(s, R - X / 2), u = Math.max(u, R + X / 2), p = Math.min(p, Y - q / 2), m = Math.max(m, Y + q / 2);
1855
+ let l = 1 / 0, c = -1 / 0, s = 1 / 0, u = -1 / 0, h = 1 / 0, p = -1 / 0;
1856
+ t.forEach((N) => {
1857
+ const v = Number(N.x ?? N.center_x ?? 0), R = Number(N.y ?? N.center_y ?? 0), Y = Number(N.z ?? N.center_z ?? 0), X = Number(N.dx ?? N.size_x ?? 1), q = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1);
1858
+ l = Math.min(l, v - X / 2), c = Math.max(c, v + X / 2), s = Math.min(s, R - q / 2), u = Math.max(u, R + q / 2), h = Math.min(h, Y - Z / 2), p = Math.max(p, Y + Z / 2);
1803
1859
  });
1804
- let h = 0, d = 0, g = 0;
1805
- o.offset ? (h = Number(o.offset.x ?? 0), d = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (h = -((c + l) / 2), d = -((s + u) / 2), g = -((p + m) / 2));
1806
- const N = c + h, O = l + h, b = s + d, L = u + d, y = p + g, E = m + g, k = (z, F, R) => `${Math.round(z)},${Math.round(F)},${Math.round(R)}`, D = new Set(
1807
- t.map((z) => k(Number(z.x ?? 0), Number(z.y ?? 0), Number(z.z ?? 0)))
1808
- ), w = [], A = [], x = [], S = [], v = [];
1809
- let C = 0;
1810
- if (t.forEach((z) => {
1811
- const F = Number(z.x ?? z.center_x ?? 0), R = Number(z.y ?? z.center_y ?? 0), Y = Number(z.z ?? z.center_z ?? 0), $ = Number(z.dx ?? z.size_x ?? 1), X = Number(z.dy ?? z.size_y ?? 1), q = Number(z.dz ?? z.size_z ?? 1), $e = F + h, Xe = R + d, qe = Y + g, Ze = St(z[n], r, f), { r: We, g: Ke, b: Je } = Ze;
1812
- Wn.forEach((V) => {
1813
- const Qe = F + V.neibDir[0] * $, et = R + V.neibDir[1] * X, tt = Y + V.neibDir[2] * q;
1814
- if (D.has(k(Qe, et, tt))) return;
1815
- const U = C;
1816
- V.verts.forEach(([nt, rt, ot]) => {
1817
- w.push($e + nt * $ / 2, Xe + rt * X / 2, qe + ot * q / 2), A.push(V.normal[0], V.normal[1], V.normal[2]), x.push(We, Ke, Je), C++;
1818
- }), S.push(U, U + 1, U + 2, U, U + 2, U + 3), v.push(z);
1860
+ let b = 0, m = 0, g = 0;
1861
+ o.offset ? (b = Number(o.offset.x ?? 0), m = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (b = -((l + c) / 2), m = -((s + u) / 2), g = -((h + p) / 2));
1862
+ const y = l + b, O = c + b, f = s + m, A = u + m, _ = h + g, z = p + g, L = (N, v, R) => `${Math.round(N)},${Math.round(v)},${Math.round(R)}`, D = new Set(
1863
+ t.map((N) => L(Number(N.x ?? 0), Number(N.y ?? 0), Number(N.z ?? 0)))
1864
+ ), w = [], k = [], x = [], S = [], F = [];
1865
+ let I = 0;
1866
+ if (t.forEach((N) => {
1867
+ const v = Number(N.x ?? N.center_x ?? 0), R = Number(N.y ?? N.center_y ?? 0), Y = Number(N.z ?? N.center_z ?? 0), X = Number(N.dx ?? N.size_x ?? 1), q = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1), We = v + b, Ke = R + m, Je = Y + g, Qe = Ft(N[n], r, d), { r: et, g: tt, b: nt } = Qe;
1868
+ nr.forEach((V) => {
1869
+ const rt = v + V.neibDir[0] * X, ot = R + V.neibDir[1] * q, it = Y + V.neibDir[2] * Z;
1870
+ if (D.has(L(rt, ot, it))) return;
1871
+ const U = I;
1872
+ V.verts.forEach(([st, at, lt]) => {
1873
+ w.push(We + st * X / 2, Ke + at * q / 2, Je + lt * Z / 2), k.push(V.normal[0], V.normal[1], V.normal[2]), x.push(et, tt, nt), I++;
1874
+ }), S.push(U, U + 1, U + 2, U, U + 2, U + 3), F.push(N);
1819
1875
  });
1820
1876
  }), w.length === 0) return;
1821
- const I = new f.BufferGeometry();
1822
- I.setAttribute("position", new f.Float32BufferAttribute(w, 3)), I.setAttribute("normal", new f.Float32BufferAttribute(A, 3)), I.setAttribute("color", new f.Float32BufferAttribute(x, 3)), I.setIndex(S);
1823
- const P = new f.MeshLambertMaterial({
1877
+ const C = new d.BufferGeometry();
1878
+ C.setAttribute("position", new d.Float32BufferAttribute(w, 3)), C.setAttribute("normal", new d.Float32BufferAttribute(k, 3)), C.setAttribute("color", new d.Float32BufferAttribute(x, 3)), C.setIndex(S);
1879
+ const P = new d.MeshLambertMaterial({
1824
1880
  vertexColors: !0,
1825
1881
  transparent: a < 1,
1826
1882
  opacity: a,
1827
- side: f.DoubleSide
1828
- }), B = new f.Mesh(I, P);
1829
- B.userData._isMergedBlocks = !0, B.userData._quadToBlock = v, B.userData._offset = { x: h, y: d, z: g }, e.scene.add(B), e.blocks.push(B), j(e), e.camera && e.controls && (e.lastBounds = { minX: N, maxX: O, minY: b, maxY: L, minZ: y, maxZ: E }, Ee(e, { minX: N, maxX: O, minY: b, maxY: L, minZ: y, maxZ: E }));
1883
+ side: d.DoubleSide
1884
+ }), B = new d.Mesh(C, P);
1885
+ B.userData._isMergedBlocks = !0, B.userData._quadToBlock = F, B.userData._offset = { x: b, y: m, z: g }, e.scene.add(B), e.blocks.push(B), j(e), e.camera && e.controls && (e.lastBounds = { minX: y, maxX: O, minY: f, maxY: A, minZ: _, maxZ: z }, ze(e, { minX: y, maxX: O, minY: f, maxY: A, minZ: _, maxZ: z }));
1830
1886
  }
1831
- function Ue(e) {
1887
+ function qe(e) {
1832
1888
  var t;
1833
1889
  e.blocks.forEach((n) => {
1834
1890
  e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
1835
1891
  }), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), j(e);
1836
1892
  }
1837
- function Jn(e, t) {
1893
+ function or(e, t) {
1838
1894
  const n = Math.max(0, Math.min(1, Number(t)));
1839
1895
  e.blocks.forEach((r) => {
1840
1896
  r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
1841
1897
  });
1842
1898
  }
1843
- function Qn(e, t, n) {
1844
- const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, a = Number(t.x ?? t.center_x ?? 0) + r, c = Number(t.y ?? t.center_y ?? 0) + o, l = Number(t.z ?? t.center_z ?? 0) + i, s = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), p = Number(t.dz ?? t.size_z ?? 1);
1899
+ function ir(e, t, n) {
1900
+ const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, a = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o, c = Number(t.z ?? t.center_z ?? 0) + i, s = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), h = Number(t.dz ?? t.size_z ?? 1);
1845
1901
  if (!e._blockHighlightMesh) {
1846
- const m = new f.BoxGeometry(1, 1, 1), h = new f.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
1847
- e._blockHighlightMesh = new f.Mesh(m, h), e.scene.add(e._blockHighlightMesh);
1902
+ const p = new d.BoxGeometry(1, 1, 1), b = new d.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
1903
+ e._blockHighlightMesh = new d.Mesh(p, b), e.scene.add(e._blockHighlightMesh);
1848
1904
  }
1849
- return e._blockHighlightMesh.position.set(a, c, l), e._blockHighlightMesh.scale.set(s, u, p), e._blockHighlightMesh;
1905
+ return e._blockHighlightMesh.position.set(a, l, c), e._blockHighlightMesh.scale.set(s, u, h), e._blockHighlightMesh;
1850
1906
  }
1851
- function Ye(e) {
1907
+ function Ze(e) {
1852
1908
  var o, i;
1853
1909
  if (!e._outlinePass || e.selectables.length === 0) {
1854
- e._outlinePass && Z(e, null);
1910
+ e._outlinePass && W(e, null);
1855
1911
  return;
1856
1912
  }
1857
1913
  const t = e.raycaster.intersectObjects(e.selectables, !0);
1858
1914
  if (t.length === 0) {
1859
- Z(e, null);
1915
+ W(e, null);
1860
1916
  return;
1861
1917
  }
1862
1918
  const n = t[0], r = n.object;
1863
1919
  if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
1864
- const a = Math.floor(n.faceIndex / 2), c = (i = r.userData._quadToBlock) == null ? void 0 : i[a];
1865
- if (c) {
1866
- Z(e, Qn(e, c, r.userData._offset));
1920
+ const a = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[a];
1921
+ if (l) {
1922
+ W(e, ir(e, l, r.userData._offset));
1867
1923
  return;
1868
1924
  }
1869
1925
  }
1870
- Z(e, r);
1926
+ W(e, r);
1871
1927
  }
1872
- function er(e) {
1928
+ function sr(e) {
1873
1929
  const t = e.renderer;
1874
1930
  t && (e.handleCanvasClick = (n) => {
1875
- var h, d, g, N, O, b, L;
1931
+ var b, m, g, y, O, f, A;
1876
1932
  if (n.button !== 0) return;
1877
- if ((h = e.gizmo) != null && h.domElement) {
1878
- const y = e.gizmo.domElement.getBoundingClientRect();
1879
- if (n.clientX >= y.left && n.clientX <= y.right && n.clientY >= y.top && n.clientY <= y.bottom)
1933
+ if ((b = e.gizmo) != null && b.domElement) {
1934
+ const _ = e.gizmo.domElement.getBoundingClientRect();
1935
+ if (n.clientX >= _.left && n.clientX <= _.right && n.clientY >= _.top && n.clientY <= _.bottom)
1880
1936
  return;
1881
1937
  }
1882
1938
  const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
1883
- if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Ye(e), e.blocks.length > 0) {
1884
- const y = e.raycaster.intersectObjects(e.blocks, !1);
1885
- if (y.length > 0) {
1886
- const E = y[0], k = E.object;
1887
- if ((d = k == null ? void 0 : k.userData) != null && d._isMergedBlocks && e.blockClickHandler) {
1888
- const D = Math.floor(E.faceIndex / 2), w = k.userData._quadToBlock[D];
1939
+ if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Ze(e), e.blocks.length > 0) {
1940
+ const _ = e.raycaster.intersectObjects(e.blocks, !1);
1941
+ if (_.length > 0) {
1942
+ const z = _[0], L = z.object;
1943
+ if ((m = L == null ? void 0 : L.userData) != null && m._isMergedBlocks && e.blockClickHandler) {
1944
+ const D = Math.floor(z.faceIndex / 2), w = L.userData._quadToBlock[D];
1889
1945
  w && e.blockClickHandler(w);
1890
1946
  }
1891
1947
  return;
1892
1948
  }
1893
1949
  }
1894
- const a = e.raycaster.intersectObjects(e.drillMeshes, !0), c = e.raycaster.intersectObjects(e.structuralMeshes, !0), l = ((g = a[0]) == null ? void 0 : g.distance) ?? 1 / 0;
1895
- if ((((N = c[0]) == null ? void 0 : N.distance) ?? 1 / 0) < l && c.length > 0) {
1896
- const y = c[0].object;
1897
- e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...y.userData });
1950
+ const a = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((g = a[0]) == null ? void 0 : g.distance) ?? 1 / 0;
1951
+ if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) < c && l.length > 0) {
1952
+ const _ = l[0].object;
1953
+ e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ..._.userData });
1898
1954
  return;
1899
1955
  }
1900
1956
  if (a.length === 0) return;
1901
1957
  let u = a[0].object;
1902
1958
  for (; u && u.parent && !((O = u.userData) != null && O.holeId); )
1903
1959
  u = u.parent;
1904
- const p = (b = u == null ? void 0 : u.userData) == null ? void 0 : b.holeId, m = (L = u == null ? void 0 : u.userData) == null ? void 0 : L.project;
1905
- p && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: p, project: m });
1960
+ const h = (f = u == null ? void 0 : u.userData) == null ? void 0 : f.holeId, p = (A = u == null ? void 0 : u.userData) == null ? void 0 : A.project;
1961
+ h && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: h, project: p });
1906
1962
  }, t.domElement.addEventListener("click", e.handleCanvasClick));
1907
1963
  }
1908
- class Gr {
1964
+ class Zr {
1909
1965
  constructor() {
1910
- this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.stripLogGroups = [], this.frameId = null, this.clock = new f.Clock(), this.handleCanvasClick = null, this.raycaster = new f.Raycaster(), this.pointer = new f.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new f.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null, this.rasterOverlays = /* @__PURE__ */ new Map();
1966
+ this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.stripLogGroups = [], this.frameId = null, this.clock = new d.Clock(), this.handleCanvasClick = null, this.raycaster = new d.Raycaster(), this.pointer = new d.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new d.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null, this.rasterOverlays = /* @__PURE__ */ new Map();
1911
1967
  }
1912
1968
  init(t) {
1913
1969
  if (!t) return;
1914
1970
  this.container = t;
1915
1971
  const n = t.clientWidth, r = t.clientHeight;
1916
- this.scene = new f.Scene(), this.scene.background = new f.Color(16777215), this.camera = new f.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new f.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
1917
- const o = new f.AmbientLight(16777215, 1.2);
1972
+ this.scene = new d.Scene(), this.scene.background = new d.Color(16777215), this.camera = new d.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new d.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
1973
+ const o = new d.AmbientLight(16777215, 1.2);
1918
1974
  this.scene.add(o);
1919
- const i = new f.DirectionalLight(16777215, 1.5);
1975
+ const i = new d.DirectionalLight(16777215, 1.5);
1920
1976
  i.position.set(10, 10, 5), this.scene.add(i);
1921
- const a = new f.AxesHelper(20);
1922
- this.scene.add(a), this.controls = new it(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 10, this.controls.minDistance = 1e-4, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
1923
- LEFT: f.MOUSE.PAN,
1924
- MIDDLE: f.MOUSE.DOLLY,
1925
- RIGHT: f.MOUSE.ROTATE
1977
+ const a = new d.AxesHelper(20);
1978
+ this.scene.add(a), this.controls = new ct(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 10, this.controls.minDistance = 1e-4, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
1979
+ LEFT: d.MOUSE.PAN,
1980
+ MIDDLE: d.MOUSE.DOLLY,
1981
+ RIGHT: d.MOUSE.ROTATE
1926
1982
  }, this.controls.touches = {
1927
- ONE: f.TOUCH.ROTATE,
1928
- TWO: f.TOUCH.DOLLY_PAN
1929
- }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new st(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new at(this.camera, this.renderer, {
1983
+ ONE: d.TOUCH.ROTATE,
1984
+ TWO: d.TOUCH.DOLLY_PAN
1985
+ }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new ut(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new mt(this.camera, this.renderer, {
1930
1986
  container: this.container,
1931
1987
  placement: "top-right",
1932
1988
  size: 110,
1933
1989
  offset: { top: 12, right: 12 },
1934
1990
  animated: !0,
1935
1991
  speed: 1.5
1936
- }), this.gizmo.attachControls(this.controls), er(this), this._wheelRelay = (l) => {
1937
- l.target !== this.renderer.domElement && (l.preventDefault(), this.renderer.domElement.dispatchEvent(new WheelEvent("wheel", {
1938
- clientX: l.clientX,
1939
- clientY: l.clientY,
1940
- deltaX: l.deltaX,
1941
- deltaY: l.deltaY,
1942
- deltaZ: l.deltaZ,
1943
- deltaMode: l.deltaMode,
1944
- ctrlKey: l.ctrlKey,
1945
- shiftKey: l.shiftKey,
1946
- altKey: l.altKey,
1992
+ }), this.gizmo.attachControls(this.controls), sr(this), this._wheelRelay = (c) => {
1993
+ c.target !== this.renderer.domElement && (c.preventDefault(), this.renderer.domElement.dispatchEvent(new WheelEvent("wheel", {
1994
+ clientX: c.clientX,
1995
+ clientY: c.clientY,
1996
+ deltaX: c.deltaX,
1997
+ deltaY: c.deltaY,
1998
+ deltaZ: c.deltaZ,
1999
+ deltaMode: c.deltaMode,
2000
+ ctrlKey: c.ctrlKey,
2001
+ shiftKey: c.shiftKey,
2002
+ altKey: c.altKey,
1947
2003
  bubbles: !1
1948
2004
  })));
1949
- }, this.container.addEventListener("wheel", this._wheelRelay, { passive: !1 }), qn(this);
1950
- const c = () => {
2005
+ }, this.container.addEventListener("wheel", this._wheelRelay, { passive: !1 }), er(this);
2006
+ const l = () => {
1951
2007
  var s;
1952
- this.frameId = requestAnimationFrame(c);
1953
- const l = this.clock.getDelta();
1954
- this.renderer.clear(), this.controlMode === "fly" && ((s = this.flyControls) != null && s.enabled) ? this.flyControls.update(l) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(l) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
2008
+ this.frameId = requestAnimationFrame(l);
2009
+ const c = this.clock.getDelta();
2010
+ this.renderer.clear(), this.controlMode === "fly" && ((s = this.flyControls) != null && s.enabled) ? this.flyControls.update(c) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(c) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
1955
2011
  };
1956
- c();
2012
+ l();
1957
2013
  }
1958
2014
  resize() {
1959
2015
  if (!this.container || !this.camera || !this.renderer) return;
1960
2016
  const t = this.container.clientWidth, n = this.container.clientHeight;
1961
- this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), Zn(this, t, n);
2017
+ this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), tr(this, t, n);
1962
2018
  }
1963
2019
  dispose() {
1964
- this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, Ue(this), je(this), ce(this), Ve(this), hn(this), Se(this), this.container && this._wheelRelay && this.container.removeEventListener("wheel", this._wheelRelay), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
2020
+ this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, qe(this), Xe(this), ue(this), Ue(this), Mn(this), we(this), this.container && this._wheelRelay && this.container.removeEventListener("wheel", this._wheelRelay), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
1965
2021
  }
1966
2022
  // ---------------------------------------------------------------------------
1967
2023
  // Data renderers — delegate to domain modules
1968
2024
  // ---------------------------------------------------------------------------
1969
2025
  setDrillholes(t, n = {}) {
1970
- Tn(this, t, n);
2026
+ Gn(this, t, n);
1971
2027
  }
1972
2028
  /**
1973
2029
  * Add floating 2D strip log panels beside drillholes in the 3D scene.
@@ -1982,13 +2038,13 @@ class Gr {
1982
2038
  * - `options` {object} — optional: panelWidth, lateralOffset, color, valueMin, valueMax
1983
2039
  */
1984
2040
  setStripLogs(t, n) {
1985
- Un(this, t, n);
2041
+ Wn(this, t, n);
1986
2042
  }
1987
2043
  /**
1988
2044
  * Remove all strip log panels from the scene and free GPU resources.
1989
2045
  */
1990
2046
  clearStripLogs() {
1991
- ce(this);
2047
+ ue(this);
1992
2048
  }
1993
2049
  /**
1994
2050
  * Render block model data as a single merged mesh of exterior faces only.
@@ -1998,20 +2054,20 @@ class Gr {
1998
2054
  * @param {Object} [options]
1999
2055
  */
2000
2056
  setBlocks(t, n, r, o = {}) {
2001
- Kn(this, t, n, r, o);
2057
+ rr(this, t, n, r, o);
2002
2058
  }
2003
2059
  /**
2004
2060
  * Update the opacity of all currently rendered blocks.
2005
2061
  * @param {number} opacity - New opacity value between 0 and 1
2006
2062
  */
2007
2063
  setBlockOpacity(t) {
2008
- Jn(this, t);
2064
+ or(this, t);
2009
2065
  }
2010
2066
  setStructuralDiscs(t, n, r = {}) {
2011
- nn(this, t, n, r);
2067
+ cn(this, t, n, r);
2012
2068
  }
2013
2069
  setStructuralDiscsVisible(t) {
2014
- rn(this, t);
2070
+ un(this, t);
2015
2071
  }
2016
2072
  // ---------------------------------------------------------------------------
2017
2073
  // Click handlers
@@ -2033,51 +2089,51 @@ class Gr {
2033
2089
  this.viewChangeHandler = typeof t == "function" ? t : null;
2034
2090
  }
2035
2091
  getViewState() {
2036
- return He(this);
2092
+ return $e(this);
2037
2093
  }
2038
2094
  setViewState(t) {
2039
- return bn(this, t);
2095
+ return En(this, t);
2040
2096
  }
2041
2097
  _buildViewSignature(t) {
2042
- return Me(t);
2098
+ return Ee(t);
2043
2099
  }
2044
2100
  _emitViewChangeIfNeeded() {
2045
- pn(this);
2101
+ zn(this);
2046
2102
  }
2047
2103
  _fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a }) {
2048
- Ee(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a });
2104
+ ze(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a });
2049
2105
  }
2050
2106
  recenterCameraToOrigin(t = 1e3) {
2051
- gn(this, t);
2107
+ Nn(this, t);
2052
2108
  }
2053
2109
  lookDown(t = 2e3) {
2054
- yn(this, t);
2110
+ On(this, t);
2055
2111
  }
2056
2112
  pan(t = 0, n = 0) {
2057
- _n(this, t, n);
2113
+ Ln(this, t, n);
2058
2114
  }
2059
2115
  dolly(t = 1.1) {
2060
- Mn(this, t);
2116
+ An(this, t);
2061
2117
  }
2062
2118
  focusOnLastBounds(t = 1.2) {
2063
- En(this, t);
2119
+ kn(this, t);
2064
2120
  }
2065
2121
  /**
2066
2122
  * Change the camera field-of-view while keeping the visible scene the same apparent size.
2067
2123
  * @param {number} fovDeg - Desired FOV in degrees
2068
2124
  */
2069
2125
  setCameraFov(t) {
2070
- On(this, t);
2126
+ wn(this, t);
2071
2127
  }
2072
2128
  /**
2073
2129
  * Set the scene background colour.
2074
2130
  * @param {'white'|'black'} colour
2075
2131
  */
2076
2132
  setBackground(t) {
2077
- this.scene && (this.scene.background = new f.Color(t === "black" ? 0 : 16777215));
2133
+ this.scene && (this.scene.background = new d.Color(t === "black" ? 0 : 16777215));
2078
2134
  }
2079
2135
  setControlMode(t = "orbit") {
2080
- kn(this, t);
2136
+ xn(this, t);
2081
2137
  }
2082
2138
  // ---------------------------------------------------------------------------
2083
2139
  // Selection glow public API
@@ -2097,7 +2153,7 @@ class Gr {
2097
2153
  * @param {THREE.Object3D|null} object
2098
2154
  */
2099
2155
  selectObject(t) {
2100
- Z(this, t || null);
2156
+ W(this, t || null);
2101
2157
  }
2102
2158
  /**
2103
2159
  * Return the currently selected object, or null if nothing is selected.
@@ -2110,11 +2166,11 @@ class Gr {
2110
2166
  * Dispose the effect composer and all GPU resources used by the selection glow.
2111
2167
  */
2112
2168
  disposeGlow() {
2113
- Se(this);
2169
+ we(this);
2114
2170
  }
2115
2171
  /** @private */
2116
2172
  _updateSelectionFromPointer() {
2117
- Ye(this);
2173
+ Ze(this);
2118
2174
  }
2119
2175
  // ---------------------------------------------------------------------------
2120
2176
  // Raster overlay API — delegate to rasterOverlayScene
@@ -2124,14 +2180,14 @@ class Gr {
2124
2180
  * @param {object} layer - Layer descriptor returned by createRasterOverlay()
2125
2181
  */
2126
2182
  addRasterOverlay(t) {
2127
- ln(this, t);
2183
+ hn(this, t);
2128
2184
  }
2129
2185
  /**
2130
2186
  * Remove a raster overlay from the scene and dispose its GPU resources.
2131
2187
  * @param {string} id - Overlay id
2132
2188
  */
2133
2189
  removeRasterOverlay(t) {
2134
- _e(this, t);
2190
+ Me(this, t);
2135
2191
  }
2136
2192
  /**
2137
2193
  * Set the opacity of a raster overlay at runtime.
@@ -2139,7 +2195,7 @@ class Gr {
2139
2195
  * @param {number} opacity - New opacity [0, 1]
2140
2196
  */
2141
2197
  setRasterOverlayOpacity(t, n) {
2142
- cn(this, t, n);
2198
+ bn(this, t, n);
2143
2199
  }
2144
2200
  /**
2145
2201
  * Show or hide a raster overlay.
@@ -2147,7 +2203,7 @@ class Gr {
2147
2203
  * @param {boolean} visible
2148
2204
  */
2149
2205
  setRasterOverlayVisibility(t, n) {
2150
- un(this, t, n);
2206
+ pn(this, t, n);
2151
2207
  }
2152
2208
  /**
2153
2209
  * Update the elevation (Z position) of a raster overlay.
@@ -2155,7 +2211,7 @@ class Gr {
2155
2211
  * @param {number} elevation
2156
2212
  */
2157
2213
  setRasterOverlayElevation(t, n) {
2158
- mn(this, t, n);
2214
+ gn(this, t, n);
2159
2215
  }
2160
2216
  /**
2161
2217
  * Return a raster overlay by id, or undefined if not found.
@@ -2163,151 +2219,156 @@ class Gr {
2163
2219
  * @returns {object|undefined}
2164
2220
  */
2165
2221
  getRasterOverlay(t) {
2166
- return dn(this, t);
2222
+ return yn(this, t);
2167
2223
  }
2168
2224
  /**
2169
2225
  * Return all raster overlay layers in insertion order.
2170
2226
  * @returns {object[]}
2171
2227
  */
2172
2228
  listRasterOverlays() {
2173
- return fn(this);
2229
+ return _n(this);
2174
2230
  }
2175
2231
  }
2176
2232
  export {
2177
- be as $,
2178
- W as A,
2179
- Er as B,
2180
- zr as C,
2181
- ge as D,
2182
- fe as E,
2183
- ne as F,
2233
+ ne as $,
2234
+ K as A,
2235
+ kr as B,
2236
+ Sr as C,
2237
+ ye as D,
2238
+ he as E,
2239
+ re as F,
2184
2240
  Ie as G,
2185
2241
  H,
2186
- Or as I,
2187
- M as J,
2188
- Ir as K,
2189
- ue as L,
2190
- pe as M,
2191
- he as N,
2192
- vr as O,
2193
- xe as P,
2194
- vt as Q,
2195
- ve as R,
2196
- re as S,
2197
- Q as T,
2198
- Gr as U,
2199
- ze as V,
2200
- dt as W,
2201
- yt as X,
2202
- Nt as Y,
2203
- te as Z,
2204
- Mt as _,
2205
- me as a,
2206
- kr as a$,
2207
- lr as a0,
2208
- we as a1,
2209
- br as a2,
2210
- ht as a3,
2211
- fr as a4,
2212
- dr as a5,
2213
- _t as a6,
2214
- ee as a7,
2215
- Gt as a8,
2216
- G as a9,
2217
- Me as aA,
2218
- Fr as aB,
2219
- At as aC,
2220
- hn as aD,
2221
- ce as aE,
2222
- Ft as aF,
2223
- Vr as aG,
2224
- Dr as aH,
2225
- en as aI,
2226
- Mn as aJ,
2227
- pn as aK,
2228
- Dt as aL,
2229
- Ee as aM,
2230
- En as aN,
2231
- xr as aO,
2232
- Dn as aP,
2233
- St as aQ,
2234
- Pt as aR,
2235
- Re as aS,
2236
- Kt as aT,
2237
- Hr as aU,
2238
- dn as aV,
2239
- He as aW,
2240
- wt as aX,
2241
- fn as aY,
2242
- wr as aZ,
2243
- Lr as a_,
2244
- Ct as aa,
2245
- Nn as ab,
2246
- zn as ac,
2247
- gr as ad,
2248
- Ne as ae,
2249
- cr as af,
2250
- Tt as ag,
2251
- ur as ah,
2252
- Rt as ai,
2242
+ Dr as I,
2243
+ wr as J,
2244
+ E as K,
2245
+ me as L,
2246
+ ge as M,
2247
+ be as N,
2248
+ Vr as O,
2249
+ ve as P,
2250
+ Rr as Q,
2251
+ Pt as R,
2252
+ Ce as S,
2253
+ ee as T,
2254
+ oe as U,
2255
+ Zr as V,
2256
+ Ne as W,
2257
+ pt as X,
2258
+ zt as Y,
2259
+ kt as Z,
2260
+ Ot as _,
2261
+ de as a,
2262
+ Ct as a$,
2263
+ pe as a0,
2264
+ hr as a1,
2265
+ xe as a2,
2266
+ Er as a3,
2267
+ yt as a4,
2268
+ _r as a5,
2269
+ yr as a6,
2270
+ Ut as a7,
2271
+ Nt as a8,
2272
+ jt as a9,
2273
+ Zn as aA,
2274
+ Xn as aB,
2275
+ ln as aC,
2276
+ Ee as aD,
2277
+ Br as aE,
2278
+ xt as aF,
2279
+ Mn as aG,
2280
+ ue as aH,
2281
+ Tt as aI,
2282
+ Xr as aJ,
2283
+ Cr as aK,
2284
+ jr as aL,
2285
+ an as aM,
2286
+ An as aN,
2287
+ zn as aO,
2288
+ vt as aP,
2289
+ ze as aQ,
2290
+ kn as aR,
2291
+ Pr as aS,
2292
+ Cn as aT,
2293
+ Ft as aU,
2294
+ Ht as aV,
2295
+ je as aW,
2296
+ rn as aX,
2297
+ qr as aY,
2298
+ yn as aZ,
2299
+ $e as a_,
2300
+ te as aa,
2301
+ qt as ab,
2302
+ G as ac,
2303
+ Rt as ad,
2304
+ Sn as ae,
2305
+ Dn as af,
2306
+ Nr as ag,
2307
+ Oe as ah,
2308
+ br as ai,
2253
2309
  Vt as aj,
2254
- bt as ak,
2255
- pt as al,
2256
- gt as am,
2257
- Rn as an,
2258
- Bn as ao,
2259
- Pn as ap,
2260
- mr as aq,
2261
- ft as ar,
2262
- hr as as,
2263
- ln as at,
2264
- xt as au,
2265
- Rr as av,
2266
- Zt as aw,
2267
- jn as ax,
2268
- Hn as ay,
2310
+ pr as ak,
2311
+ $t as al,
2312
+ Yt as am,
2313
+ _t as an,
2314
+ Mt as ao,
2315
+ Et as ap,
2316
+ $n as aq,
2317
+ Un as ar,
2318
+ jn as as,
2319
+ gr as at,
2320
+ gt as au,
2321
+ Mr as av,
2322
+ hn as aw,
2323
+ It as ax,
2324
+ Yr as ay,
2269
2325
  tn as az,
2270
- K as b,
2271
- yn as b0,
2272
- Lt as b1,
2273
- sn as b2,
2274
- Vn as b3,
2275
- _n as b4,
2276
- Sr as b5,
2277
- gn as b6,
2278
- _e as b7,
2279
- Bt as b8,
2280
- kn as b9,
2281
- On as ba,
2282
- mn as bb,
2283
- cn as bc,
2284
- un as bd,
2285
- Un as be,
2286
- bn as bf,
2287
- Et as bg,
2288
- Ar as c,
2289
- de as d,
2290
- Ce as e,
2291
- pr as f,
2292
- ye as g,
2293
- le as h,
2294
- zt as i,
2295
- ae as j,
2296
- J as k,
2297
- Ot as l,
2298
- Xt as m,
2299
- Pr as n,
2300
- Br as o,
2301
- Fe as p,
2302
- qt as q,
2303
- It as r,
2304
- _ as s,
2305
- Tr as t,
2306
- Cr as u,
2307
- Mr as v,
2308
- se as w,
2309
- yr as x,
2310
- _r as y,
2311
- Nr as z
2326
+ J as b,
2327
+ _n as b0,
2328
+ Tr as b1,
2329
+ vr as b2,
2330
+ xr as b3,
2331
+ On as b4,
2332
+ wt as b5,
2333
+ dn as b6,
2334
+ Yn as b7,
2335
+ Ln as b8,
2336
+ Ir as b9,
2337
+ Nn as ba,
2338
+ Me as bb,
2339
+ Gt as bc,
2340
+ Re as bd,
2341
+ xn as be,
2342
+ wn as bf,
2343
+ gn as bg,
2344
+ bn as bh,
2345
+ pn as bi,
2346
+ Wn as bj,
2347
+ En as bk,
2348
+ Lt as bl,
2349
+ Fr as c,
2350
+ fe as d,
2351
+ Te as e,
2352
+ zr as f,
2353
+ _e as g,
2354
+ ce as h,
2355
+ At as i,
2356
+ le as j,
2357
+ Q as k,
2358
+ Dt as l,
2359
+ Qt as m,
2360
+ Ve as n,
2361
+ Ur as o,
2362
+ $r as p,
2363
+ Fe as q,
2364
+ en as r,
2365
+ Bt as s,
2366
+ M as t,
2367
+ Gr as u,
2368
+ Hr as v,
2369
+ ae as w,
2370
+ Ar as x,
2371
+ Or as y,
2372
+ Lr as z
2312
2373
  };
2313
- //# sourceMappingURL=baselode3dScene-CLEvddGM.js.map
2374
+ //# sourceMappingURL=baselode3dScene-4nzt80B1.js.map