baselode 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/baselode.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import te from "papaparse";
2
- import { jsx as S, jsxs as J } from "react/jsx-runtime";
3
- import { useRef as Le, useState as Q, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
2
+ import { jsx as D, jsxs as J } from "react/jsx-runtime";
3
+ import { useRef as Se, useState as Q, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
4
4
  import Fe from "plotly.js-dist-min";
5
- import * as _ from "three";
6
- import { OrbitControls as rn } from "three/examples/jsm/controls/OrbitControls";
7
- import { FlyControls as on } from "three/examples/jsm/controls/FlyControls";
8
- import { ViewportGizmo as sn } from "three-viewport-gizmo";
9
- import { EffectComposer as ln } from "three/examples/jsm/postprocessing/EffectComposer.js";
10
- import { RenderPass as an } from "three/examples/jsm/postprocessing/RenderPass.js";
11
- import { OutlinePass as cn } from "three/examples/jsm/postprocessing/OutlinePass.js";
12
- const A = "hole_id", oe = "latitude", ie = "longitude", Ae = "elevation", q = "azimuth", X = "dip", L = "from", w = "to", Ie = "mid", me = "project_id", pe = "easting", be = "northing", Et = "crs", W = "depth", kt = "alpha", At = "beta", un = "strike", ae = "geology_code", ce = "geology_description", ko = {
5
+ import * as g from "three";
6
+ import { OrbitControls as on } from "three/examples/jsm/controls/OrbitControls";
7
+ import { FlyControls as sn } from "three/examples/jsm/controls/FlyControls";
8
+ import { ViewportGizmo as ln } from "three-viewport-gizmo";
9
+ import { EffectComposer as an } from "three/examples/jsm/postprocessing/EffectComposer.js";
10
+ import { RenderPass as cn } from "three/examples/jsm/postprocessing/RenderPass.js";
11
+ import { OutlinePass as un } from "three/examples/jsm/postprocessing/OutlinePass.js";
12
+ const x = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "azimuth", q = "dip", S = "from", T = "to", Ie = "mid", me = "project_id", pe = "easting", be = "northing", Et = "crs", W = "depth", xt = "alpha", kt = "beta", dn = "strike", ae = "geology_code", ce = "geology_description", Fo = {
13
13
  // A unique hole identifier across the entire dataset and all future data sets
14
- [A]: "string",
14
+ [x]: "string",
15
15
  // The hole ID from the original collar source
16
16
  datasource_hole_id: "string",
17
17
  // The project ID or project code from the original collar source, if available
@@ -21,62 +21,62 @@ const A = "hole_id", oe = "latitude", ie = "longitude", Ae = "elevation", q = "a
21
21
  // The longitude of the collar, in decimal degrees (WGS84)
22
22
  [ie]: "number",
23
23
  // The elevation of the collar, in meters above sea level (WGS84)
24
- [Ae]: "number",
24
+ [xe]: "number",
25
25
  // The easting coordinate of the collar, in meters (projected CRS)
26
26
  [pe]: "number",
27
27
  // The northing coordinate of the collar, in meters (projected CRS)
28
28
  [be]: "number",
29
29
  // The coordinate reference system of the collar coordinates for easting/northing, as an EPSG code or proj string
30
30
  [Et]: "string"
31
- }, Ao = {
31
+ }, wo = {
32
32
  // The unique hole id that maps to the collar and any other data tables
33
- [A]: "string",
33
+ [x]: "string",
34
34
  // The depth along the hole where the survey measurement was taken / started
35
35
  [W]: "number",
36
36
  // The depth along the hole where the survey measurement ended, if applicable (some surveys are point measurements and may not have a 'to' depth)
37
- [w]: "number",
37
+ [T]: "number",
38
38
  // The azimuth of the hole at the survey depth, in degrees from north
39
- [q]: "number",
39
+ [X]: "number",
40
40
  // The dip of the hole at the survey depth, in degrees from horizontal (negative values indicate downward inclination)
41
- [X]: "number"
42
- }, xo = {
41
+ [q]: "number"
42
+ }, To = {
43
43
  // The unique hole id that maps to the collar and any other data tables
44
- [A]: "string",
44
+ [x]: "string",
45
45
  // The depth along the hole where the assay interval starts
46
- [L]: "number",
46
+ [S]: "number",
47
47
  // The depth along the hole where the assay interval ends
48
- [w]: "number",
48
+ [T]: "number",
49
49
  // The midpoint depth of the assay interval
50
50
  [Ie]: "number"
51
51
  // assay value columns are variable and not standardized here.
52
52
  // Assays may be flattened (one column per assay type) or long (one row per assay type with an additional 'assay_type' column)
53
- }, dn = {
54
- [A]: "string",
55
- [L]: "number",
56
- [w]: "number",
53
+ }, mn = {
54
+ [x]: "string",
55
+ [S]: "number",
56
+ [T]: "number",
57
57
  [Ie]: "number",
58
58
  [ae]: "string",
59
59
  [ce]: "string"
60
- }, vo = {
61
- [A]: "string",
60
+ }, $o = {
61
+ [x]: "string",
62
62
  [W]: "number",
63
- [X]: "number",
64
63
  [q]: "number",
64
+ [X]: "number",
65
+ [xt]: "number",
65
66
  [kt]: "number",
66
- [At]: "number",
67
67
  comments: "string"
68
- }, mn = {
69
- [A]: ["hole_id", "holeid", "hole id", "hole-id"],
68
+ }, fn = {
69
+ [x]: ["hole_id", "holeid", "hole id", "hole-id"],
70
70
  datasource_hole_id: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
71
71
  [me]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
72
72
  [oe]: ["latitude", "lat"],
73
73
  [ie]: ["longitude", "lon"],
74
- [Ae]: ["elevation", "rl", "elev", "z"],
74
+ [xe]: ["elevation", "rl", "elev", "z"],
75
75
  [pe]: ["easting", "x"],
76
76
  [be]: ["northing", "y"],
77
77
  [Et]: ["crs", "epsg", "projection"],
78
- [L]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
79
- [w]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
78
+ [S]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
79
+ [T]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
80
80
  [ae]: [
81
81
  "geology_code",
82
82
  "geologycode",
@@ -98,42 +98,42 @@ const A = "hole_id", oe = "latitude", ie = "longitude", Ae = "elevation", q = "a
98
98
  "description",
99
99
  "comments"
100
100
  ],
101
- [q]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
102
- [X]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
103
- [kt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
104
- [At]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
101
+ [X]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
102
+ [q]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
103
+ [xt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
104
+ [kt]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
105
105
  declination: ["declination", "dec"],
106
106
  [W]: ["depth", "survey_depth", "surveydepth"],
107
- [un]: ["strike", "str"]
108
- }, xt = {};
109
- for (const [e, t] of Object.entries(mn))
107
+ [dn]: ["strike", "str"]
108
+ }, At = {};
109
+ for (const [e, t] of Object.entries(fn))
110
110
  for (const n of t) {
111
111
  const r = n.toLowerCase().trim();
112
- xt[r] = e;
112
+ At[r] = e;
113
113
  }
114
- function Te(e) {
114
+ function we(e) {
115
115
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
116
116
  }
117
- function ge(e, t = null, n = null) {
118
- const r = { ...xt };
117
+ function ye(e, t = null, n = null) {
118
+ const r = { ...At };
119
119
  if (n) {
120
120
  for (const [i, s] of Object.entries(n))
121
121
  if (i != null && s != null) {
122
- const l = Te(i), u = Te(s);
123
- r[l] = u;
122
+ const l = we(i), c = we(s);
123
+ r[l] = c;
124
124
  }
125
125
  }
126
126
  const o = {};
127
127
  for (const [i, s] of Object.entries(e)) {
128
- const l = Te(i), u = r[l] || l;
129
- o[u] = s;
128
+ const l = we(i), c = r[l] || l;
129
+ o[c] = s;
130
130
  }
131
131
  return o;
132
132
  }
133
- function Io(e, t = null, n = null) {
134
- return e.map((r) => ge(r, t, n));
133
+ function Bo(e, t = null, n = null) {
134
+ return e.map((r) => ye(r, t, n));
135
135
  }
136
- const fn = /* @__PURE__ */ new Set([
136
+ const hn = /* @__PURE__ */ new Set([
137
137
  "hole_id",
138
138
  "holeid",
139
139
  "id",
@@ -166,33 +166,33 @@ const fn = /* @__PURE__ */ new Set([
166
166
  "comment",
167
167
  "z"
168
168
  ]), Ke = "[baselode:data]";
169
- function hn(e, t = "Unknown error") {
169
+ function pn(e, t = "Unknown error") {
170
170
  if (e instanceof Error) return e;
171
171
  const n = typeof e == "string" && e.trim() ? e : t;
172
172
  return new Error(n);
173
173
  }
174
174
  function Y(e, t, n = "Operation failed") {
175
- const r = hn(t, n), o = new Error(`${e}: ${r.message}`);
175
+ const r = pn(t, n), o = new Error(`${e}: ${r.message}`);
176
176
  return o.cause = r, o;
177
177
  }
178
- function Co(e, t) {
178
+ function Ro(e, t) {
179
179
  if (t !== void 0) {
180
180
  console.warn(`${Ke} ${e}`, t);
181
181
  return;
182
182
  }
183
183
  console.warn(`${Ke} ${e}`);
184
184
  }
185
- function Do(e) {
185
+ function Vo(e) {
186
186
  console.info(`${Ke} ${e}`);
187
187
  }
188
- const Re = (e, t = null) => ge(e, null, t);
189
- function pn(e) {
190
- return { holeId: e[A] };
188
+ const He = (e, t = null) => ye(e, null, t);
189
+ function bn(e) {
190
+ return { holeId: e[x] };
191
191
  }
192
- function vt(e, t = null) {
193
- const n = e[A], r = n !== void 0 ? `${n}`.trim() : "";
192
+ function It(e, t = null) {
193
+ const n = e[x], r = n !== void 0 ? `${n}`.trim() : "";
194
194
  if (!r) return null;
195
- const o = e[me] || e.project || e.project_code, i = Number(e[L]), s = Number(e[w]);
195
+ const o = e[me] || e.project || e.project_code, i = Number(e[S]), s = Number(e[T]);
196
196
  return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
197
197
  holeId: r,
198
198
  project: o,
@@ -201,22 +201,22 @@ function vt(e, t = null) {
201
201
  ...e
202
202
  };
203
203
  }
204
- function It(e, t) {
204
+ function Ot(e, t) {
205
205
  var o;
206
206
  const n = t.sort((i, s) => i.from - s.from), r = [];
207
207
  return n.forEach((i) => {
208
- const { from: s, to: l, project: u, ...a } = i, c = {
208
+ const { from: s, to: l, project: c, ...a } = i, u = {
209
209
  z: s,
210
210
  from: s,
211
211
  to: l,
212
- [A]: e,
213
- [me]: u,
212
+ [x]: e,
213
+ [me]: c,
214
214
  ...a
215
215
  };
216
- r.push(c), r.push({ ...c, z: l });
216
+ r.push(u), r.push({ ...u, z: l });
217
217
  }), { id: e, project: (o = n[0]) == null ? void 0 : o.project, points: r };
218
218
  }
219
- function So(e, t = null) {
219
+ function Ho(e, t = null) {
220
220
  return new Promise((n, r) => {
221
221
  const o = /* @__PURE__ */ new Set();
222
222
  te.parse(e, {
@@ -224,7 +224,7 @@ function So(e, t = null) {
224
224
  dynamicTyping: !0,
225
225
  skipEmptyLines: !0,
226
226
  step: (i) => {
227
- const l = Re(i.data, t)[A];
227
+ const l = He(i.data, t)[x];
228
228
  l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
229
229
  },
230
230
  complete: () => n(Array.from(o)),
@@ -232,8 +232,8 @@ function So(e, t = null) {
232
232
  });
233
233
  });
234
234
  }
235
- function bn(e) {
236
- return Object.entries(e || {}).some(([t, n]) => !(fn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
235
+ function yn(e) {
236
+ return Object.entries(e || {}).some(([t, n]) => !(hn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
237
237
  }
238
238
  function gn(e, t = null) {
239
239
  return new Promise((n, r) => {
@@ -243,11 +243,11 @@ function gn(e, t = null) {
243
243
  dynamicTyping: !0,
244
244
  skipEmptyLines: !0,
245
245
  step: (i) => {
246
- const s = Re(i.data, t);
247
- if (!bn(s)) return;
248
- const u = pn(s).holeId;
249
- if (u !== void 0 && `${u}`.trim() !== "") {
250
- const a = `${u}`.trim();
246
+ const s = He(i.data, t);
247
+ if (!yn(s)) return;
248
+ const c = bn(s).holeId;
249
+ if (c !== void 0 && `${c}`.trim() !== "") {
250
+ const a = `${c}`.trim();
251
251
  o.has(a) || o.set(a, {
252
252
  holeId: a
253
253
  });
@@ -258,7 +258,7 @@ function gn(e, t = null) {
258
258
  });
259
259
  });
260
260
  }
261
- function yn(e, t, n = null, r = null) {
261
+ function _n(e, t, n = null, r = null) {
262
262
  return new Promise((o, i) => {
263
263
  const s = `${t}`.trim();
264
264
  if (!s) {
@@ -270,23 +270,23 @@ function yn(e, t, n = null, r = null) {
270
270
  header: !0,
271
271
  dynamicTyping: !0,
272
272
  skipEmptyLines: !0,
273
- step: (u) => {
274
- const a = Re(u.data, r), c = vt(a, r);
275
- c && `${c.holeId}`.trim() === s && l.push(c);
273
+ step: (c) => {
274
+ const a = He(c.data, r), u = It(a, r);
275
+ u && `${u.holeId}`.trim() === s && l.push(u);
276
276
  },
277
277
  complete: () => {
278
278
  if (!l.length) {
279
279
  o(null);
280
280
  return;
281
281
  }
282
- const u = It(s, l);
283
- o(u);
282
+ const c = Ot(s, l);
283
+ o(c);
284
284
  },
285
- error: (u) => i(Y("parseAssayHole", u))
285
+ error: (c) => i(Y("parseAssayHole", c))
286
286
  });
287
287
  });
288
288
  }
289
- function _n(e, t = null, n = null) {
289
+ function Nn(e, t = null, n = null) {
290
290
  return new Promise((r, o) => {
291
291
  te.parse(e, {
292
292
  header: !0,
@@ -294,24 +294,24 @@ function _n(e, t = null, n = null) {
294
294
  skipEmptyLines: !0,
295
295
  complete: (i) => {
296
296
  const s = /* @__PURE__ */ new Map();
297
- i.data.forEach((u) => {
298
- const a = Re(u, n), c = vt(a, n);
299
- c && (s.has(c.holeId) || s.set(c.holeId, []), s.get(c.holeId).push(c));
297
+ i.data.forEach((c) => {
298
+ const a = He(c, n), u = It(a, n);
299
+ u && (s.has(u.holeId) || s.set(u.holeId, []), s.get(u.holeId).push(u));
300
300
  });
301
- const l = Array.from(s.entries()).map(([u, a]) => It(u, a));
301
+ const l = Array.from(s.entries()).map(([c, a]) => Ot(c, a));
302
302
  r({ holes: l });
303
303
  },
304
304
  error: (i) => o(Y("parseAssaysCSV", i))
305
305
  });
306
306
  });
307
307
  }
308
- function Lo(e = {}) {
308
+ function jo(e = {}) {
309
309
  const t = {};
310
310
  return Object.entries(e || {}).forEach(([n, r]) => {
311
- n && (t[Te(n)] = r);
311
+ n && (t[we(n)] = r);
312
312
  }), t;
313
313
  }
314
- function Oo(e = {}, t = [], n) {
314
+ function Go(e = {}, t = [], n) {
315
315
  for (const r of t) {
316
316
  const o = e[r];
317
317
  if (o != null && `${o}`.trim() !== "")
@@ -319,7 +319,7 @@ function Oo(e = {}, t = [], n) {
319
319
  }
320
320
  return n;
321
321
  }
322
- const Nn = 4;
322
+ const Mn = 4;
323
323
  function Ct(e = [], t = "") {
324
324
  if (!e.length) return [];
325
325
  if (!t) return e;
@@ -328,7 +328,7 @@ function Ct(e = [], t = "") {
328
328
  const r = e[n], o = e.filter((i, s) => s !== n);
329
329
  return [r, ...o];
330
330
  }
331
- function we({
331
+ function Te({
332
332
  property: e = "",
333
333
  chartType: t = "",
334
334
  categoricalProps: n = [],
@@ -340,15 +340,15 @@ function we({
340
340
  function Dt({
341
341
  holeIds: e = [],
342
342
  focusedHoleId: t = "",
343
- plotCount: n = Nn,
343
+ plotCount: n = Mn,
344
344
  defaultProp: r = "",
345
345
  categoricalProps: o = [],
346
346
  commentProps: i = [],
347
347
  numericDefaultChartType: s = "markers+line"
348
348
  } = {}) {
349
349
  const l = Ct(e, t);
350
- return Array.from({ length: n }).map((u, a) => {
351
- const c = l[a] || e[a] || "", m = we({
350
+ return Array.from({ length: n }).map((c, a) => {
351
+ const u = l[a] || e[a] || "", m = Te({
352
352
  property: r,
353
353
  chartType: "",
354
354
  categoricalProps: o,
@@ -356,30 +356,30 @@ function Dt({
356
356
  numericDefaultChartType: s
357
357
  });
358
358
  return {
359
- holeId: c,
359
+ holeId: u,
360
360
  property: r,
361
361
  chartType: m
362
362
  };
363
363
  });
364
364
  }
365
- const ve = "numeric", Oe = "categorical", xe = "comment", $e = "hidden", Je = "tadpole", lt = {
366
- [ve]: [
365
+ const Ae = "numeric", Le = "categorical", ke = "comment", $e = "hidden", Je = "tadpole", at = {
366
+ [Ae]: [
367
367
  { value: "bar", label: "Bars" },
368
368
  { value: "markers", label: "Markers" },
369
369
  { value: "markers+line", label: "Markers + Line" },
370
370
  { value: "line", label: "Line only" }
371
371
  ],
372
- [Oe]: [
372
+ [Le]: [
373
373
  { value: "categorical", label: "Categorical bands" }
374
374
  ],
375
- [xe]: [
375
+ [ke]: [
376
376
  { value: "comment", label: "Comments" }
377
377
  ],
378
378
  [Je]: [
379
379
  { value: "tadpole", label: "Tadpole" }
380
380
  ],
381
381
  [$e]: []
382
- }, at = /* @__PURE__ */ new Set([
382
+ }, ct = /* @__PURE__ */ new Set([
383
383
  // Hole identifiers
384
384
  "hole_id",
385
385
  "holeid",
@@ -434,7 +434,7 @@ const ve = "numeric", Oe = "categorical", xe = "comment", $e = "hidden", Je = "t
434
434
  "data_source",
435
435
  "_hole_key",
436
436
  "_hole_id_key"
437
- ]), Mn = /* @__PURE__ */ new Set([
437
+ ]), zn = /* @__PURE__ */ new Set([
438
438
  "comments",
439
439
  "comment",
440
440
  "notes",
@@ -447,50 +447,50 @@ const ve = "numeric", Oe = "categorical", xe = "comment", $e = "hidden", Je = "t
447
447
  "structcomment",
448
448
  "geology_description"
449
449
  ]);
450
- function zn(e) {
450
+ function vn(e) {
451
451
  if (!(e != null && e.length))
452
452
  return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
453
453
  const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
454
454
  for (const r of t) {
455
455
  const o = r.toLowerCase().trim();
456
- if (at.has(o) || at.has(r)) {
456
+ if (ct.has(o) || ct.has(r)) {
457
457
  n[r] = $e;
458
458
  continue;
459
459
  }
460
- if (Mn.has(o)) {
461
- const l = e.some((u) => {
462
- const a = u[r];
460
+ if (zn.has(o)) {
461
+ const l = e.some((c) => {
462
+ const a = c[r];
463
463
  return a != null && String(a).trim() !== "" && String(a) !== "null";
464
464
  });
465
- n[r] = l ? xe : $e;
465
+ n[r] = l ? ke : $e;
466
466
  continue;
467
467
  }
468
468
  let i = !1, s = !1;
469
469
  for (const l of e) {
470
- const u = l[r];
471
- if (!(u == null || typeof u == "string" && u.trim() === "") && (s = !0, typeof u == "number" && Number.isFinite(u))) {
470
+ const c = l[r];
471
+ if (!(c == null || typeof c == "string" && c.trim() === "") && (s = !0, typeof c == "number" && Number.isFinite(c))) {
472
472
  i = !0;
473
473
  break;
474
474
  }
475
475
  }
476
- s ? i ? n[r] = ve : n[r] = Oe : n[r] = $e;
476
+ s ? i ? n[r] = Ae : n[r] = Le : n[r] = $e;
477
477
  }
478
478
  return {
479
479
  byType: n,
480
- numericCols: Object.entries(n).filter(([, r]) => r === ve).map(([r]) => r),
481
- categoricalCols: Object.entries(n).filter(([, r]) => r === Oe).map(([r]) => r),
482
- commentCols: Object.entries(n).filter(([, r]) => r === xe).map(([r]) => r)
480
+ numericCols: Object.entries(n).filter(([, r]) => r === Ae).map(([r]) => r),
481
+ categoricalCols: Object.entries(n).filter(([, r]) => r === Le).map(([r]) => r),
482
+ commentCols: Object.entries(n).filter(([, r]) => r === ke).map(([r]) => r)
483
483
  };
484
484
  }
485
485
  function et(e) {
486
- return lt[e] ?? lt[ve];
486
+ return at[e] ?? at[Ae];
487
487
  }
488
- function Po(e) {
488
+ function Uo(e) {
489
489
  const t = et(e);
490
- return t.length ? e === ve ? "line" : t[0].value : "markers+line";
490
+ return t.length ? e === Ae ? "line" : t[0].value : "markers+line";
491
491
  }
492
492
  function Be(e = []) {
493
- const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = zn(t), s = n[0] || r[0] || "";
493
+ const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = vn(t), s = n[0] || r[0] || "";
494
494
  return {
495
495
  numericProps: n,
496
496
  categoricalProps: r,
@@ -502,12 +502,12 @@ function Be(e = []) {
502
502
  async function En(e, t = null) {
503
503
  return await gn(e);
504
504
  }
505
- async function kn(e, t, n = null) {
506
- return await yn(e, t);
505
+ async function xn(e, t, n = null) {
506
+ return await _n(e, t);
507
507
  }
508
- function An(e = [], t = "") {
508
+ function kn(e = [], t = "") {
509
509
  if (!e.length) return null;
510
- const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Be(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), u = Dt({
510
+ const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Be(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = Dt({
511
511
  holeIds: l,
512
512
  focusedHoleId: t,
513
513
  plotCount: 4,
@@ -523,40 +523,40 @@ function An(e = [], t = "") {
523
523
  commentProps: o,
524
524
  columnMeta: i,
525
525
  defaultProp: s,
526
- traceConfigs: u
526
+ traceConfigs: c
527
527
  };
528
528
  }
529
- async function Fo(e, t = "", n = null) {
530
- const { holes: r } = await _n(e, n), o = An(r, t);
529
+ async function Yo(e, t = "", n = null) {
530
+ const { holes: r } = await Nn(e, n), o = kn(r, t);
531
531
  if (!o) throw new Error("No valid assay intervals found.");
532
532
  return o;
533
533
  }
534
- function To(e, t = null) {
534
+ function Xo(e, t = null) {
535
535
  return new Promise((n, r) => {
536
536
  te.parse(e, {
537
537
  header: !0,
538
538
  dynamicTyping: !0,
539
539
  skipEmptyLines: !0,
540
540
  complete: (o) => {
541
- const i = o.data.map((s) => xn(s, t)).filter((s) => s[A] && Number.isFinite(s[W]) && Number.isFinite(s[X]) && Number.isFinite(s[q]));
541
+ const i = o.data.map((s) => An(s, t)).filter((s) => s[x] && Number.isFinite(s[W]) && Number.isFinite(s[q]) && Number.isFinite(s[X]));
542
542
  n(i);
543
543
  },
544
544
  error: (o) => r(Y("parseSurveyCSV", o))
545
545
  });
546
546
  });
547
547
  }
548
- function xn(e, t = null) {
549
- const n = ge(e, null, t), r = n[A], o = n[me] || n.project || n.project_code, i = Ee(n[oe]), s = Ee(n[ie]), l = Ee(n[W]), u = Ee(n[X]), a = Ee(n[q]), c = Ee(n.maxdepth);
548
+ function An(e, t = null) {
549
+ const n = ye(e, null, t), r = n[x], o = n[me] || n.project || n.project_code, i = ve(n[oe]), s = ve(n[ie]), l = ve(n[W]), c = ve(n[q]), a = ve(n[X]), u = ve(n.maxdepth);
550
550
  return {
551
551
  raw: n,
552
- [A]: r,
552
+ [x]: r,
553
553
  [me]: o,
554
554
  [oe]: i,
555
555
  [ie]: s,
556
556
  [W]: l,
557
- [X]: u,
558
- [q]: a,
559
- maxdepth: c,
557
+ [q]: c,
558
+ [X]: a,
559
+ maxdepth: u,
560
560
  // Legacy field names for backwards compatibility
561
561
  project_code: o,
562
562
  latitude: i,
@@ -564,76 +564,76 @@ function xn(e, t = null) {
564
564
  surveydepth: l
565
565
  };
566
566
  }
567
- const Ee = (e) => {
567
+ const ve = (e) => {
568
568
  const t = Number(e);
569
569
  return Number.isFinite(t) ? t : void 0;
570
570
  };
571
- function wo(e, t) {
572
- var a, c, m, d;
571
+ function qo(e, t) {
572
+ var a, u, m, d;
573
573
  const n = /* @__PURE__ */ new Map();
574
574
  e.forEach((f) => {
575
- const h = (f[A] || f.holeId || f.id || "").toString().trim();
575
+ const h = (f[x] || f.holeId || f.id || "").toString().trim();
576
576
  if (!h) return;
577
577
  const b = h.toLowerCase();
578
578
  n.has(b) || n.set(b, f);
579
579
  });
580
- const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((c = e[0]) == null ? void 0 : c[oe]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[ie]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
580
+ const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((u = e[0]) == null ? void 0 : u[oe]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[ie]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
581
581
  t.forEach((f) => {
582
- const h = (f[A] || "").toString().trim();
582
+ const h = (f[x] || "").toString().trim();
583
583
  if (!h) return;
584
584
  const b = h.toLowerCase();
585
585
  l.has(b) || l.set(b, []), l.get(b).push(f);
586
586
  });
587
- const u = [];
587
+ const c = [];
588
588
  return l.forEach((f, h) => {
589
589
  const b = n.get(h);
590
590
  if (!b) return;
591
- const y = f.filter((C) => Number.isFinite(C[W] ?? C.surveydepth)).sort((C, H) => (C[W] ?? C.surveydepth) - (H[W] ?? H.surveydepth));
592
- if (!y.length) return;
593
- const p = b.lat ?? b[oe], g = b.lng ?? b[ie], M = 111132, z = 111320 * Math.cos(p * Math.PI / 180), D = (g - o) * s, x = (p - r) * i, O = [];
594
- let $ = 0, P = 0, E = 0;
595
- for (let C = 0; C < y.length; C += 1) {
596
- const H = y[C], R = y[C - 1], v = H[W] ?? H.surveydepth, k = H[q] ?? H.azimuth, N = H[X] ?? H.dip;
597
- if (!R) {
598
- O.push({
599
- x: D + $,
600
- y: x + P,
591
+ const _ = f.filter((C) => Number.isFinite(C[W] ?? C.surveydepth)).sort((C, V) => (C[W] ?? C.surveydepth) - (V[W] ?? V.surveydepth));
592
+ if (!_.length) return;
593
+ const p = b.lat ?? b[oe], y = b.lng ?? b[ie], M = 111132, z = 111320 * Math.cos(p * Math.PI / 180), O = (y - o) * s, k = (p - r) * i, L = [];
594
+ let $ = 0, P = 0, v = 0;
595
+ for (let C = 0; C < _.length; C += 1) {
596
+ const V = _[C], H = _[C - 1], A = V[W] ?? V.surveydepth, E = V[X] ?? V.azimuth, N = V[q] ?? V.dip;
597
+ if (!H) {
598
+ L.push({
599
+ x: O + $,
600
+ y: k + P,
601
601
  z: 0,
602
- md: v,
603
- azimuth: k,
602
+ md: A,
603
+ azimuth: E,
604
604
  dip: N
605
605
  });
606
606
  continue;
607
607
  }
608
- const B = R[W] ?? R.surveydepth, I = R[q] ?? R.azimuth, G = R[X] ?? R.dip, U = v - B;
608
+ const B = H[W] ?? H.surveydepth, I = H[X] ?? H.azimuth, G = H[q] ?? H.dip, U = A - B;
609
609
  if (U <= 0) continue;
610
- const j = ct(G), Z = ct(N), K = Qe(I), le = Qe(k), ye = Math.acos(
610
+ const j = ut(G), Z = ut(N), K = Qe(I), le = Qe(E), ge = Math.acos(
611
611
  Math.sin(j) * Math.sin(Z) * Math.cos(K - le) + Math.cos(j) * Math.cos(Z)
612
- ), fe = ye > 1e-6 ? 2 / ye * Math.tan(ye / 2) : 1, De = 0.5 * U * (Math.sin(j) * Math.cos(K) + Math.sin(Z) * Math.cos(le)) * fe, he = 0.5 * U * (Math.sin(j) * Math.sin(K) + Math.sin(Z) * Math.sin(le)) * fe, Ge = 0.5 * U * (Math.cos(j) + Math.cos(Z)) * fe;
613
- $ += De, P += he, E += Ge, O.push({
614
- x: D + $,
615
- y: x + P,
616
- z: -E,
612
+ ), fe = ge > 1e-6 ? 2 / ge * Math.tan(ge / 2) : 1, Ce = 0.5 * U * (Math.sin(j) * Math.cos(K) + Math.sin(Z) * Math.cos(le)) * fe, he = 0.5 * U * (Math.sin(j) * Math.sin(K) + Math.sin(Z) * Math.sin(le)) * fe, Ge = 0.5 * U * (Math.cos(j) + Math.cos(Z)) * fe;
613
+ $ += Ce, P += he, v += Ge, L.push({
614
+ x: O + $,
615
+ y: k + P,
616
+ z: -v,
617
617
  // render with z up; depth down
618
- md: v,
619
- azimuth: k,
618
+ md: A,
619
+ azimuth: E,
620
620
  dip: N
621
621
  });
622
622
  }
623
- const F = O.map((C) => ({
623
+ const F = L.map((C) => ({
624
624
  ...C,
625
625
  lat: p + C.y / M,
626
- lng: g + C.x / z
626
+ lng: y + C.x / z
627
627
  }));
628
- u.push({
629
- id: b[A] || b.holeId || h,
628
+ c.push({
629
+ id: b[x] || b.holeId || h,
630
630
  project: b[me] || b.project_id || b.project || "",
631
631
  points: F,
632
632
  collar: b
633
633
  });
634
- }), u;
634
+ }), c;
635
635
  }
636
- const Qe = (e) => e * Math.PI / 180, ct = (e) => {
636
+ const Qe = (e) => e * Math.PI / 180, ut = (e) => {
637
637
  const t = Number(e), n = 90 + (Number.isFinite(t) ? t : 0), r = Math.min(180, Math.max(0, n));
638
638
  return Qe(r);
639
639
  };
@@ -641,29 +641,29 @@ function re(e, t = void 0) {
641
641
  const n = Number(e);
642
642
  return Number.isFinite(n) ? n : t;
643
643
  }
644
- function ut(e) {
644
+ function dt(e) {
645
645
  return e == null ? "" : `${e}`.trim();
646
646
  }
647
- function He(e = [], t = null) {
648
- const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => ut(s == null ? void 0 : s[i])));
647
+ function Ve(e = [], t = null) {
648
+ const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => dt(s == null ? void 0 : s[i])));
649
649
  if (!o)
650
650
  throw Y("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
651
651
  return {
652
652
  aliasCol: o,
653
653
  rows: e.map((i) => ({
654
654
  ...i,
655
- hole_id: ut(i == null ? void 0 : i[o])
655
+ hole_id: dt(i == null ? void 0 : i[o])
656
656
  }))
657
657
  };
658
658
  }
659
- function dt(e) {
659
+ function mt(e) {
660
660
  return Number(e) * Math.PI / 180;
661
661
  }
662
662
  function Ye(e, t) {
663
- const n = dt(e), r = dt(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
663
+ const n = mt(e), r = mt(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
664
664
  return { ca: o, cb: i, cc: s };
665
665
  }
666
- function vn(e, t, n, r, o, i = "minimum_curvature") {
666
+ function In(e, t, n, r, o, i = "minimum_curvature") {
667
667
  const s = Ye(t, n), l = Ye(r, o);
668
668
  if (i === "tangential")
669
669
  return {
@@ -683,11 +683,11 @@ function vn(e, t, n, r, o, i = "minimum_curvature") {
683
683
  dip: d
684
684
  };
685
685
  }
686
- const u = s.ca * l.ca + s.cb * l.cb + s.cc * l.cc, a = Math.acos(Math.max(-1, Math.min(1, u))), c = a > 1e-6 ? 2 * Math.tan(a / 2) / a : 1;
686
+ const c = s.ca * l.ca + s.cb * l.cb + s.cc * l.cc, a = Math.acos(Math.max(-1, Math.min(1, c))), u = a > 1e-6 ? 2 * Math.tan(a / 2) / a : 1;
687
687
  return {
688
- dx: 0.5 * e * (s.ca + l.ca) * c,
689
- dy: 0.5 * e * (s.cb + l.cb) * c,
690
- dz: 0.5 * e * (s.cc + l.cc) * c,
688
+ dx: 0.5 * e * (s.ca + l.ca) * u,
689
+ dy: 0.5 * e * (s.cb + l.cb) * u,
690
+ dz: 0.5 * e * (s.cc + l.cc) * u,
691
691
  azimuth: r,
692
692
  dip: o
693
693
  };
@@ -697,52 +697,52 @@ function tt(e = [], t = [], n = {}) {
697
697
  step: r = 1,
698
698
  holeIdCol: o = null,
699
699
  method: i = "minimum_curvature"
700
- } = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = He(e, o), u = He(t, o || l.aliasCol);
701
- if (!l.rows.length || !u.rows.length) return [];
700
+ } = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = Ve(e, o), c = Ve(t, o || l.aliasCol);
701
+ if (!l.rows.length || !c.rows.length) return [];
702
702
  const a = /* @__PURE__ */ new Map();
703
703
  l.rows.forEach((d) => {
704
704
  !d.hole_id || a.has(d.hole_id) || a.set(d.hole_id, d);
705
705
  });
706
- const c = /* @__PURE__ */ new Map();
707
- u.rows.forEach((d) => {
708
- d.hole_id && (c.has(d.hole_id) || c.set(d.hole_id, []), c.get(d.hole_id).push(d));
706
+ const u = /* @__PURE__ */ new Map();
707
+ c.rows.forEach((d) => {
708
+ d.hole_id && (u.has(d.hole_id) || u.set(d.hole_id, []), u.get(d.hole_id).push(d));
709
709
  });
710
710
  const m = [];
711
- return c.forEach((d, f) => {
711
+ return u.forEach((d, f) => {
712
712
  const h = a.get(f);
713
713
  if (!h) return;
714
- const b = [...d].map((O) => ({
715
- ...O,
716
- from: re(O.from),
717
- azimuth: re(O.azimuth),
718
- dip: re(O.dip)
719
- })).filter((O) => Number.isFinite(O.from) && Number.isFinite(O.azimuth) && Number.isFinite(O.dip)).sort((O, $) => O.from - $.from);
714
+ const b = [...d].map((L) => ({
715
+ ...L,
716
+ from: re(L.from),
717
+ azimuth: re(L.azimuth),
718
+ dip: re(L.dip)
719
+ })).filter((L) => Number.isFinite(L.from) && Number.isFinite(L.azimuth) && Number.isFinite(L.dip)).sort((L, $) => L.from - $.from);
720
720
  if (!b.length) return;
721
- let y = re(h.x, 0), p = re(h.y, 0), g = re(h.z, 0), M = b[0].from;
722
- const z = b[0].azimuth, D = b[0].dip, x = {
721
+ let _ = re(h.x, 0), p = re(h.y, 0), y = re(h.z, 0), M = b[0].from;
722
+ const z = b[0].azimuth, O = b[0].dip, k = {
723
723
  hole_id: f,
724
724
  md: M,
725
- x: y,
725
+ x: _,
726
726
  y: p,
727
- z: g,
727
+ z: y,
728
728
  azimuth: z,
729
- dip: D
729
+ dip: O
730
730
  };
731
- l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (x[l.aliasCol] = h[l.aliasCol]), m.push(x);
732
- for (let O = 0; O < b.length - 1; O += 1) {
733
- const $ = b[O], P = b[O + 1], E = $.from, C = P.from - E;
731
+ l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (k[l.aliasCol] = h[l.aliasCol]), m.push(k);
732
+ for (let L = 0; L < b.length - 1; L += 1) {
733
+ const $ = b[L], P = b[L + 1], v = $.from, C = P.from - v;
734
734
  if (C <= 0) continue;
735
- const H = Math.max(1, Math.ceil(C / s)), R = C / H;
736
- for (let v = 0; v < H; v += 1) {
737
- M += R;
738
- const k = (M - E) / C, N = $.azimuth + k * (P.azimuth - $.azimuth), B = $.dip + k * (P.dip - $.dip), I = vn(R, $.azimuth, $.dip, P.azimuth, P.dip, i);
739
- y += I.dx, p += I.dy, g += I.dz;
735
+ const V = Math.max(1, Math.ceil(C / s)), H = C / V;
736
+ for (let A = 0; A < V; A += 1) {
737
+ M += H;
738
+ const E = (M - v) / C, N = $.azimuth + E * (P.azimuth - $.azimuth), B = $.dip + E * (P.dip - $.dip), I = In(H, $.azimuth, $.dip, P.azimuth, P.dip, i);
739
+ _ += I.dx, p += I.dy, y += I.dz;
740
740
  const G = {
741
741
  hole_id: f,
742
742
  md: M,
743
- x: y,
743
+ x: _,
744
744
  y: p,
745
- z: g,
745
+ z: y,
746
746
  azimuth: i === "minimum_curvature" ? N : I.azimuth,
747
747
  dip: i === "minimum_curvature" ? B : I.dip
748
748
  };
@@ -751,17 +751,17 @@ function tt(e = [], t = [], n = {}) {
751
751
  }
752
752
  }), m;
753
753
  }
754
- function In(e, t, n = {}) {
754
+ function On(e, t, n = {}) {
755
755
  return tt(e, t, { ...n, method: "minimum_curvature" });
756
756
  }
757
- function $o(e, t, n = {}) {
757
+ function Zo(e, t, n = {}) {
758
758
  return tt(e, t, { ...n, method: "tangential" });
759
759
  }
760
- function Bo(e, t, n = {}) {
760
+ function Wo(e, t, n = {}) {
761
761
  return tt(e, t, { ...n, method: "balanced_tangential" });
762
762
  }
763
- function Vo(e, t, n = {}) {
764
- return In(e, t, n);
763
+ function Ko(e, t, n = {}) {
764
+ return On(e, t, n);
765
765
  }
766
766
  function Cn(e, t) {
767
767
  if (!e.length || !Number.isFinite(t)) return null;
@@ -774,18 +774,18 @@ function Cn(e, t) {
774
774
  }
775
775
  return n;
776
776
  }
777
- function Ho(e = [], t = [], n = {}) {
778
- const r = n.holeIdCol || "hole_id", o = He(e, r), i = He(t, r);
777
+ function Jo(e = [], t = [], n = {}) {
778
+ const r = n.holeIdCol || "hole_id", o = Ve(e, r), i = Ve(t, r);
779
779
  if (!o.rows.length || !i.rows.length) return [...o.rows];
780
780
  const s = /* @__PURE__ */ new Map();
781
781
  return i.rows.forEach((l) => {
782
782
  l.hole_id && (s.has(l.hole_id) || s.set(l.hole_id, []), s.get(l.hole_id).push(l));
783
- }), s.forEach((l, u) => {
784
- s.set(u, [...l].sort((a, c) => re(a.md, 0) - re(c.md, 0)));
783
+ }), s.forEach((l, c) => {
784
+ s.set(c, [...l].sort((a, u) => re(a.md, 0) - re(u.md, 0)));
785
785
  }), o.rows.map((l) => {
786
- const u = re(l.from), a = re(l.to), c = Number.isFinite(u) && Number.isFinite(a) ? 0.5 * (u + a) : void 0;
787
- if (!l.hole_id || !Number.isFinite(c)) return { ...l };
788
- const m = Cn(s.get(l.hole_id) || [], c);
786
+ const c = re(l.from), a = re(l.to), u = Number.isFinite(c) && Number.isFinite(a) ? 0.5 * (c + a) : void 0;
787
+ if (!l.hole_id || !Number.isFinite(u)) return { ...l };
788
+ const m = Cn(s.get(l.hole_id) || [], u);
789
789
  if (!m) return { ...l };
790
790
  const d = { ...l };
791
791
  return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
@@ -793,7 +793,7 @@ function Ho(e = [], t = [], n = {}) {
793
793
  }), d;
794
794
  });
795
795
  }
796
- function Ro(e, t = null) {
796
+ function Qo(e, t = null) {
797
797
  return new Promise((n, r) => {
798
798
  te.parse(e, {
799
799
  header: !0,
@@ -801,8 +801,8 @@ function Ro(e, t = null) {
801
801
  skipEmptyLines: !0,
802
802
  complete: (o) => {
803
803
  const i = /* @__PURE__ */ new Map();
804
- o.data.forEach((l, u) => {
805
- const a = ge(l, null, t), c = a[A], m = c !== void 0 ? `${c}`.trim() : "", d = a[pe] ?? a.x, f = a[be] ?? a.y, h = a[Ae] ?? a.z, b = a.order ?? u;
804
+ o.data.forEach((l, c) => {
805
+ const a = ye(l, null, t), u = a[x], m = u !== void 0 ? `${u}`.trim() : "", d = a[pe] ?? a.x, f = a[be] ?? a.y, h = a[xe] ?? a.z, b = a.order ?? c;
806
806
  !m || d === null || d === void 0 || f === null || f === void 0 || h === null || h === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
807
807
  ...a,
808
808
  holeId: m,
@@ -812,9 +812,9 @@ function Ro(e, t = null) {
812
812
  z: Number(h) ?? 0
813
813
  }));
814
814
  });
815
- const s = Array.from(i.entries()).map(([l, u]) => ({
815
+ const s = Array.from(i.entries()).map(([l, c]) => ({
816
816
  id: l,
817
- points: u.sort((a, c) => a.order - c.order).map((a) => ({
817
+ points: c.sort((a, u) => a.order - u.order).map((a) => ({
818
818
  ...a,
819
819
  x: Number(a.x) || 0,
820
820
  y: Number(a.y) || 0,
@@ -827,7 +827,7 @@ function Ro(e, t = null) {
827
827
  });
828
828
  });
829
829
  }
830
- function ke(e) {
830
+ function Ee(e) {
831
831
  return e ? Array.isArray(e) ? [...e] : [] : [];
832
832
  }
833
833
  function ee(e) {
@@ -838,24 +838,24 @@ function Pe(e = [], t = []) {
838
838
  const n = [...e];
839
839
  return n.sort((r, o) => {
840
840
  for (let i = 0; i < t.length; i += 1) {
841
- const s = t[i], l = r == null ? void 0 : r[s], u = o == null ? void 0 : o[s];
842
- if (l !== u)
843
- return l == null ? 1 : u == null ? -1 : typeof l == "number" && typeof u == "number" ? l - u : `${l}`.localeCompare(`${u}`);
841
+ const s = t[i], l = r == null ? void 0 : r[s], c = o == null ? void 0 : o[s];
842
+ if (l !== c)
843
+ return l == null ? 1 : c == null ? -1 : typeof l == "number" && typeof c == "number" ? l - c : `${l}`.localeCompare(`${c}`);
844
844
  }
845
845
  return 0;
846
846
  }), n;
847
847
  }
848
848
  function Dn(e = [], t = "Intervals") {
849
849
  if (!e.length) return;
850
- const n = Pe(e, [A, L, w]), r = /* @__PURE__ */ new Map();
850
+ const n = Pe(e, [x, S, T]), r = /* @__PURE__ */ new Map();
851
851
  n.forEach((o) => {
852
- const i = `${(o == null ? void 0 : o[A]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[L]), l = Number(o == null ? void 0 : o[w]);
852
+ const i = `${(o == null ? void 0 : o[x]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[S]), l = Number(o == null ? void 0 : o[T]);
853
853
  if (!i || !Number.isFinite(s) || !Number.isFinite(l)) return;
854
- const u = r.get(i);
855
- if (Number.isFinite(u) && s < u)
854
+ const c = r.get(i);
855
+ if (Number.isFinite(c) && s < c)
856
856
  throw Y(
857
857
  "validateNoOverlappingIntervals",
858
- new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${u}`)
858
+ new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${c}`)
859
859
  );
860
860
  r.set(i, l);
861
861
  });
@@ -873,7 +873,7 @@ function Sn(e, t = {}) {
873
873
  });
874
874
  }
875
875
  function Ln(e = [], t = null, n = null) {
876
- return e.map((r) => ge(r, t, n));
876
+ return e.map((r) => ye(r, t, n));
877
877
  }
878
878
  async function je(e, t = {}) {
879
879
  const {
@@ -884,115 +884,115 @@ async function je(e, t = {}) {
884
884
  } = t;
885
885
  let s;
886
886
  if (Array.isArray(e))
887
- s = ke(e);
887
+ s = Ee(e);
888
888
  else if (n === "csv")
889
889
  s = await Sn(e, i);
890
890
  else throw n === "parquet" || n === "sql" ? Y("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : Y("loadTable", new Error(`Unsupported kind: ${n}`));
891
891
  return Ln(s, r, o);
892
892
  }
893
- async function jo(e, t = {}) {
893
+ async function ei(e, t = {}) {
894
894
  const {
895
895
  crs: n = null,
896
896
  sourceColumnMap: r = null,
897
897
  keepAll: o = !0,
898
898
  ...i
899
899
  } = t, s = await je(e, { ...i, sourceColumnMap: r });
900
- if (!s.some((d) => A in d))
901
- throw Y("loadCollars", new Error(`Collar table missing column: ${A}`));
902
- const u = s.some((d) => pe in d && be in d), a = s.some((d) => oe in d && ie in d);
903
- if (!u && !a)
900
+ if (!s.some((d) => x in d))
901
+ throw Y("loadCollars", new Error(`Collar table missing column: ${x}`));
902
+ const c = s.some((d) => pe in d && be in d), a = s.some((d) => oe in d && ie in d);
903
+ if (!c && !a)
904
904
  throw Y("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
905
- const c = s.map((d) => {
905
+ const u = s.map((d) => {
906
906
  const f = { ...d };
907
- if (A in f) {
908
- const h = f[A];
909
- f[A] = h == null ? "" : `${h}`.trim();
907
+ if (x in f) {
908
+ const h = f[x];
909
+ f[x] = h == null ? "" : `${h}`.trim();
910
910
  }
911
- return oe in f && (f[oe] = ee(f[oe])), ie in f && (f[ie] = ee(f[ie])), Ae in f && (f[Ae] = ee(f[Ae])), pe in f && (f[pe] = ee(f[pe])), be in f && (f[be] = ee(f[be])), !("datasource_hole_id" in f) && A in f && (f.datasource_hole_id = f[A]), f;
911
+ return oe in f && (f[oe] = ee(f[oe])), ie in f && (f[ie] = ee(f[ie])), xe in f && (f[xe] = ee(f[xe])), pe in f && (f[pe] = ee(f[pe])), be in f && (f[be] = ee(f[be])), !("datasource_hole_id" in f) && x in f && (f.datasource_hole_id = f[x]), f;
912
912
  });
913
- if (!c.every((d) => !(!d[A] || a && (!Number.isFinite(d[oe]) || !Number.isFinite(d[ie])) || u && !a && (!Number.isFinite(d[pe]) || !Number.isFinite(d[be])))))
913
+ if (!u.every((d) => !(!d[x] || a && (!Number.isFinite(d[oe]) || !Number.isFinite(d[ie])) || c && !a && (!Number.isFinite(d[pe]) || !Number.isFinite(d[be])))))
914
914
  throw Y("loadCollars", new Error("Collar table has missing required values"));
915
- return c;
915
+ return u;
916
916
  }
917
- async function Go(e, t = {}) {
917
+ async function ti(e, t = {}) {
918
918
  const {
919
919
  sourceColumnMap: n = null,
920
920
  keepAll: r = !0,
921
921
  ...o
922
- } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [A, W, q, X];
922
+ } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [x, W, X, q];
923
923
  for (const a of s)
924
924
  if (!i.some((m) => a in m))
925
925
  throw Y("loadSurveys", new Error(`Survey table missing column: ${a}`));
926
926
  const l = i.map((a) => {
927
- const c = { ...a };
928
- if (A in c) {
929
- const m = c[A];
930
- c[A] = m == null ? "" : `${m}`.trim();
927
+ const u = { ...a };
928
+ if (x in u) {
929
+ const m = u[x];
930
+ u[x] = m == null ? "" : `${m}`.trim();
931
931
  }
932
- return W in c && (c[W] = ee(c[W])), w in c && (c[w] = ee(c[w])), q in c && (c[q] = ee(c[q])), X in c && (c[X] = ee(c[X])), c;
932
+ return W in u && (u[W] = ee(u[W])), T in u && (u[T] = ee(u[T])), X in u && (u[X] = ee(u[X])), q in u && (u[q] = ee(u[q])), u;
933
933
  });
934
- if (!l.every((a) => !(!a[A] || !Number.isFinite(a[W]) || !Number.isFinite(a[q]) || !Number.isFinite(a[X]))))
934
+ if (!l.every((a) => !(!a[x] || !Number.isFinite(a[W]) || !Number.isFinite(a[X]) || !Number.isFinite(a[q]))))
935
935
  throw Y("loadSurveys", new Error("Survey table has missing required values"));
936
- return Pe(l, [A, W]);
936
+ return Pe(l, [x, W]);
937
937
  }
938
- async function Uo(e, t = {}) {
938
+ async function ni(e, t = {}) {
939
939
  const {
940
940
  sourceColumnMap: n = null,
941
941
  keepAll: r = !0,
942
942
  ...o
943
- } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [A, L, w];
943
+ } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [x, S, T];
944
944
  for (const a of s)
945
945
  if (!i.some((m) => a in m))
946
946
  throw Y("loadAssays", new Error(`Assay table missing column: ${a}`));
947
947
  const l = i.map((a) => {
948
- const c = { ...a };
949
- if (A in c) {
950
- const m = c[A];
951
- c[A] = m == null ? "" : `${m}`.trim();
948
+ const u = { ...a };
949
+ if (x in u) {
950
+ const m = u[x];
951
+ u[x] = m == null ? "" : `${m}`.trim();
952
952
  }
953
- return L in c && (c[L] = ee(c[L])), w in c && (c[w] = ee(c[w])), L in c && w in c && Number.isFinite(c[L]) && Number.isFinite(c[w]) && (c[Ie] = 0.5 * (c[L] + c[w])), c;
953
+ return S in u && (u[S] = ee(u[S])), T in u && (u[T] = ee(u[T])), S in u && T in u && Number.isFinite(u[S]) && Number.isFinite(u[T]) && (u[Ie] = 0.5 * (u[S] + u[T])), u;
954
954
  });
955
- if (!l.every((a) => !(!a[A] || !Number.isFinite(a[L]) || !Number.isFinite(a[w]) || !(a[w] > a[L]))))
955
+ if (!l.every((a) => !(!a[x] || !Number.isFinite(a[S]) || !Number.isFinite(a[T]) || !(a[T] > a[S]))))
956
956
  throw Y("loadAssays", new Error("Assay table has missing required values"));
957
- return Pe(l, [A, L, w]);
957
+ return Pe(l, [x, S, T]);
958
958
  }
959
- async function Yo(e, t = {}) {
959
+ async function ri(e, t = {}) {
960
960
  const {
961
961
  sourceColumnMap: n = null,
962
962
  keepAll: r = !0,
963
963
  ...o
964
- } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [A, L, w];
965
- for (const c of s)
966
- if (!i.some((d) => c in d))
967
- throw Y("loadGeology", new Error(`Geology table missing column: ${c}`));
968
- const l = i.map((c) => {
969
- const m = { ...c };
970
- if (A in m) {
971
- const h = m[A];
972
- m[A] = h == null ? "" : `${h}`.trim();
964
+ } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [x, S, T];
965
+ for (const u of s)
966
+ if (!i.some((d) => u in d))
967
+ throw Y("loadGeology", new Error(`Geology table missing column: ${u}`));
968
+ const l = i.map((u) => {
969
+ const m = { ...u };
970
+ if (x in m) {
971
+ const h = m[x];
972
+ m[x] = h == null ? "" : `${h}`.trim();
973
973
  }
974
- L in m && (m[L] = ee(m[L])), w in m && (m[w] = ee(m[w])), L in m && w in m && Number.isFinite(m[L]) && Number.isFinite(m[w]) && (m[w] === m[L] && (m[L] = Math.round(m[L] * 1e3) / 1e3, m[w] = m[L] + 1e-3), m[Ie] = 0.5 * (m[L] + m[w]));
974
+ S in m && (m[S] = ee(m[S])), T in m && (m[T] = ee(m[T])), S in m && T in m && Number.isFinite(m[S]) && Number.isFinite(m[T]) && (m[T] === m[S] && (m[S] = Math.round(m[S] * 1e3) / 1e3, m[T] = m[S] + 1e-3), m[Ie] = 0.5 * (m[S] + m[T]));
975
975
  const d = m[ae] !== void 0 && m[ae] !== null && `${m[ae]}`.trim() !== "", f = m[ce] !== void 0 && m[ce] !== null && `${m[ce]}`.trim() !== "";
976
976
  return !d && f && (m[ae] = m[ce]), d && !f && (m[ce] = m[ae]), m;
977
977
  });
978
- if (!l.every((c) => !(!c[A] || !Number.isFinite(c[L]) || !Number.isFinite(c[w]) || !(c[w] > c[L]))))
978
+ if (!l.every((u) => !(!u[x] || !Number.isFinite(u[S]) || !Number.isFinite(u[T]) || !(u[T] > u[S]))))
979
979
  throw Y("loadGeology", new Error("Geology table has missing or invalid interval values"));
980
- if (!l.some((c) => {
981
- const m = c[ae], d = c[ce];
980
+ if (!l.some((u) => {
981
+ const m = u[ae], d = u[ce];
982
982
  return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
983
983
  }))
984
984
  throw Y("loadGeology", new Error(`Geology table missing categorical columns: ${ae} or ${ce}`));
985
985
  if (Dn(l, "Geology"), !r) {
986
- const c = new Set(Object.keys(dn));
986
+ const u = new Set(Object.keys(mn));
987
987
  return Pe(
988
- l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => c.has(d)))),
989
- [A, L, w]
988
+ l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => u.has(d)))),
989
+ [x, S, T]
990
990
  );
991
991
  }
992
- return Pe(l, [A, L, w]);
992
+ return Pe(l, [x, S, T]);
993
993
  }
994
- function qo(e = [], t = [], n = {}) {
995
- const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [A];
994
+ function oi(e = [], t = [], n = {}) {
995
+ const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [x];
996
996
  if (!t.length) return [...e];
997
997
  const o = (s) => r.map((l) => `${(s == null ? void 0 : s[l]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
998
998
  return t.forEach((s) => {
@@ -1000,16 +1000,16 @@ function qo(e = [], t = [], n = {}) {
1000
1000
  }), e.map((s) => {
1001
1001
  const l = i.get(o(s));
1002
1002
  if (!l) return { ...s };
1003
- const u = { ...s };
1004
- return Object.entries(l).forEach(([a, c]) => {
1005
- r.includes(a) || (Object.prototype.hasOwnProperty.call(u, a) ? u[`${a}_trace`] = c : u[a] = c);
1006
- }), u;
1003
+ const c = { ...s };
1004
+ return Object.entries(l).forEach(([a, u]) => {
1005
+ r.includes(a) || (Object.prototype.hasOwnProperty.call(c, a) ? c[`${a}_trace`] = u : c[a] = u);
1006
+ }), c;
1007
1007
  });
1008
1008
  }
1009
- function Xo(e = [], t = null) {
1009
+ function ii(e = [], t = null) {
1010
1010
  return t == null ? [...e] : e.length ? e.some((r) => me in r) ? e.filter((r) => (r == null ? void 0 : r[me]) === t) : [...e] : [];
1011
1011
  }
1012
- function Zo(e = [], t = []) {
1012
+ function si(e = [], t = []) {
1013
1013
  return e.map((n) => {
1014
1014
  const r = { ...n };
1015
1015
  return t.forEach((o) => {
@@ -1019,7 +1019,7 @@ function Zo(e = [], t = []) {
1019
1019
  }), r;
1020
1020
  });
1021
1021
  }
1022
- function Wo({
1022
+ function li({
1023
1023
  collars: e = [],
1024
1024
  surveys: t = [],
1025
1025
  assays: n = [],
@@ -1028,15 +1028,15 @@ function Wo({
1028
1028
  metadata: i = {}
1029
1029
  } = {}) {
1030
1030
  return {
1031
- collars: ke(e),
1032
- surveys: ke(t),
1033
- assays: ke(n),
1034
- geology: ke(r),
1035
- structures: ke(o),
1031
+ collars: Ee(e),
1032
+ surveys: Ee(t),
1033
+ assays: Ee(n),
1034
+ geology: Ee(r),
1035
+ structures: Ee(o),
1036
1036
  metadata: i || {}
1037
1037
  };
1038
1038
  }
1039
- const St = ["x", "y", "z", "dx", "dy", "dz"], On = {
1039
+ const St = ["x", "y", "z", "dx", "dy", "dz"], Pn = {
1040
1040
  x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
1041
1041
  y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
1042
1042
  z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
@@ -1044,26 +1044,26 @@ const St = ["x", "y", "z", "dx", "dy", "dz"], On = {
1044
1044
  dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
1045
1045
  dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
1046
1046
  }, Lt = {};
1047
- Object.entries(On).forEach(([e, t]) => {
1047
+ Object.entries(Pn).forEach(([e, t]) => {
1048
1048
  t.forEach((n) => {
1049
1049
  Lt[n.toLowerCase()] = e;
1050
1050
  });
1051
1051
  });
1052
- function Pn(e) {
1052
+ function Fn(e) {
1053
1053
  const t = {};
1054
1054
  return Object.entries(e).forEach(([n, r]) => {
1055
1055
  const o = Lt[n.toLowerCase().trim()] || n;
1056
1056
  t[o] = r;
1057
1057
  }), t;
1058
1058
  }
1059
- function Ko(e) {
1059
+ function ai(e) {
1060
1060
  return new Promise((t, n) => {
1061
1061
  te.parse(e, {
1062
1062
  header: !0,
1063
1063
  dynamicTyping: !0,
1064
1064
  skipEmptyLines: !0,
1065
1065
  complete: (r) => {
1066
- const i = (r.data || []).map(Pn).filter(
1066
+ const i = (r.data || []).map(Fn).filter(
1067
1067
  (l) => l.x !== null && l.y !== null && l.z !== null
1068
1068
  ), s = Object.keys(i[0] || {}).filter(
1069
1069
  (l) => !St.includes(l)
@@ -1076,7 +1076,7 @@ function Ko(e) {
1076
1076
  });
1077
1077
  });
1078
1078
  }
1079
- function Jo(e) {
1079
+ function ci(e) {
1080
1080
  if (typeof e == "string")
1081
1081
  try {
1082
1082
  return JSON.parse(e);
@@ -1086,7 +1086,7 @@ function Jo(e) {
1086
1086
  if (e && typeof e == "object") return e;
1087
1087
  throw Y("loadBlockModelMetadata", new Error("Invalid metadata source"));
1088
1088
  }
1089
- function Fn(e, t) {
1089
+ function wn(e, t) {
1090
1090
  const n = e.map((i) => i[t]).filter((i) => i != null);
1091
1091
  if (n.length > 0 && n.every((i) => typeof i == "number")) {
1092
1092
  const i = Math.min(...n), s = Math.max(...n);
@@ -1094,13 +1094,13 @@ function Fn(e, t) {
1094
1094
  }
1095
1095
  return { type: "categorical", categories: [...new Set(n)], values: n };
1096
1096
  }
1097
- function Qo(e) {
1097
+ function ui(e) {
1098
1098
  if (!e || e.length === 0) return {};
1099
1099
  const t = Object.keys(e[0]).filter(
1100
1100
  (r) => !St.includes(r)
1101
1101
  ), n = {};
1102
1102
  return t.forEach((r) => {
1103
- n[r] = Fn(e, r);
1103
+ n[r] = wn(e, r);
1104
1104
  }), n;
1105
1105
  }
1106
1106
  function Tn(e, t) {
@@ -1111,13 +1111,13 @@ function Tn(e, t) {
1111
1111
  })
1112
1112
  );
1113
1113
  }
1114
- function ei(e, t = null) {
1114
+ function di(e, t = null) {
1115
1115
  return (t ? Tn(e, t) : e).reduce((r, o) => {
1116
1116
  const i = Number(o.dx) || 0, s = Number(o.dy) || 0, l = Number(o.dz) || 0;
1117
1117
  return r + i * s * l;
1118
1118
  }, 0);
1119
1119
  }
1120
- function wn(e, t, n) {
1120
+ function $n(e, t, n) {
1121
1121
  if (!t) return new n.Color("#888888");
1122
1122
  if (t.type === "numeric") {
1123
1123
  const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
@@ -1126,56 +1126,56 @@ function wn(e, t, n) {
1126
1126
  const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
1127
1127
  return new n.Color().setHSL(o / 360, 0.7, 0.5);
1128
1128
  }
1129
- const nt = (e, t = null) => ge(e, null, t);
1130
- function $n(e) {
1129
+ const nt = (e, t = null) => ye(e, null, t);
1130
+ function Bn(e) {
1131
1131
  if (!e.length) return null;
1132
- const t = e[0], n = L in t && w in t, r = W in t && !n;
1132
+ const t = e[0], n = S in t && T in t, r = W in t && !n;
1133
1133
  return n ? "interval" : r ? "point" : null;
1134
1134
  }
1135
1135
  function de(e) {
1136
1136
  const t = Number(e);
1137
1137
  return Number.isFinite(t) ? t : null;
1138
1138
  }
1139
- function Ot(e) {
1140
- const t = e[A] !== void 0 ? `${e[A]}`.trim() : "";
1139
+ function Pt(e) {
1140
+ const t = e[x] !== void 0 ? `${e[x]}`.trim() : "";
1141
1141
  if (!t) return null;
1142
1142
  const n = de(e[W]);
1143
1143
  return n === null ? null : {
1144
- [A]: t,
1144
+ [x]: t,
1145
1145
  [W]: n,
1146
- [X]: de(e[X]),
1147
1146
  [q]: de(e[q]),
1147
+ [X]: de(e[X]),
1148
1148
  comments: e.comments != null ? `${e.comments}` : null,
1149
1149
  ...e
1150
1150
  };
1151
1151
  }
1152
- function Pt(e) {
1153
- const t = e[A] !== void 0 ? `${e[A]}`.trim() : "";
1152
+ function Ft(e) {
1153
+ const t = e[x] !== void 0 ? `${e[x]}`.trim() : "";
1154
1154
  if (!t) return null;
1155
- const n = de(e[L]), r = de(e[w]);
1155
+ const n = de(e[S]), r = de(e[T]);
1156
1156
  if (n === null || r === null || r <= n) return null;
1157
1157
  const o = 0.5 * (n + r);
1158
1158
  return {
1159
- [A]: t,
1160
- [L]: n,
1161
- [w]: r,
1159
+ [x]: t,
1160
+ [S]: n,
1161
+ [T]: r,
1162
1162
  mid: o,
1163
- [X]: de(e[X]),
1164
1163
  [q]: de(e[q]),
1164
+ [X]: de(e[X]),
1165
1165
  classification: e.classification != null ? `${e.classification}` : null,
1166
1166
  comments: e.comments != null ? `${e.comments}` : null,
1167
1167
  ...e
1168
1168
  };
1169
1169
  }
1170
- function ti(e) {
1170
+ function mi(e) {
1171
1171
  const t = [], n = [];
1172
1172
  for (const r of e) {
1173
- const o = [], i = de(r[X]), s = de(r[q]);
1173
+ const o = [], i = de(r[q]), s = de(r[X]);
1174
1174
  i !== null && (i < 0 || i > 90) && o.push(`dip ${i} out of range [0, 90]`), s !== null && (s < 0 || s >= 360) && o.push(`azimuth ${s} out of range [0, 360)`), o.length ? n.push({ row: r, message: o.join("; ") }) : t.push(r);
1175
1175
  }
1176
1176
  return { valid: t, errors: n };
1177
1177
  }
1178
- function ni(e, t = null) {
1178
+ function fi(e, t = null) {
1179
1179
  return new Promise((n, r) => {
1180
1180
  const o = {
1181
1181
  header: !0,
@@ -1184,7 +1184,7 @@ function ni(e, t = null) {
1184
1184
  complete: (i) => {
1185
1185
  const s = [];
1186
1186
  for (const l of i.data) {
1187
- const u = nt(l, t), a = Ot(u);
1187
+ const c = nt(l, t), a = Pt(c);
1188
1188
  a && s.push(a);
1189
1189
  }
1190
1190
  n(s);
@@ -1195,7 +1195,7 @@ function ni(e, t = null) {
1195
1195
  `) ? te.parse(e, o) : te.parse(e, o);
1196
1196
  });
1197
1197
  }
1198
- function ri(e, t = null) {
1198
+ function hi(e, t = null) {
1199
1199
  return new Promise((n, r) => {
1200
1200
  te.parse(e, {
1201
1201
  header: !0,
@@ -1204,8 +1204,8 @@ function ri(e, t = null) {
1204
1204
  complete: (o) => {
1205
1205
  const i = [];
1206
1206
  for (const s of o.data) {
1207
- const l = nt(s, t), u = Pt(l);
1208
- u && i.push(u);
1207
+ const l = nt(s, t), c = Ft(l);
1208
+ c && i.push(c);
1209
1209
  }
1210
1210
  n(i);
1211
1211
  },
@@ -1213,7 +1213,7 @@ function ri(e, t = null) {
1213
1213
  });
1214
1214
  });
1215
1215
  }
1216
- function Bn(e, t = A) {
1216
+ function Rn(e, t = x) {
1217
1217
  const n = /* @__PURE__ */ new Map();
1218
1218
  for (const r of e) {
1219
1219
  const o = r[t] != null ? String(r[t]).trim() : "";
@@ -1228,7 +1228,7 @@ function Vn(e, t = null) {
1228
1228
  dynamicTyping: !0,
1229
1229
  skipEmptyLines: !0,
1230
1230
  complete: (o) => {
1231
- const i = o.data.map((u) => nt(u, t)), s = $n(i);
1231
+ const i = o.data.map((c) => nt(c, t)), s = Bn(i);
1232
1232
  if (!s) {
1233
1233
  r(Y(
1234
1234
  "parseStructuralCSV",
@@ -1237,8 +1237,8 @@ function Vn(e, t = null) {
1237
1237
  return;
1238
1238
  }
1239
1239
  const l = [];
1240
- for (const u of i) {
1241
- const a = s === "interval" ? Pt(u) : Ot(u);
1240
+ for (const c of i) {
1241
+ const a = s === "interval" ? Ft(c) : Pt(c);
1242
1242
  a && l.push(a);
1243
1243
  }
1244
1244
  n({ schema: s, rows: l });
@@ -1256,17 +1256,17 @@ function Hn(e) {
1256
1256
  complete: (n) => {
1257
1257
  const r = /* @__PURE__ */ new Map();
1258
1258
  for (const i of n.data) {
1259
- const s = ge(i), l = s[A] != null ? `${s[A]}`.trim() : "";
1259
+ const s = ye(i), l = s[x] != null ? `${s[x]}`.trim() : "";
1260
1260
  if (!l) continue;
1261
- const u = Number(s[L]), a = Number(s[w]);
1262
- if (!Number.isFinite(u) || !Number.isFinite(a) || a <= u) continue;
1263
- const c = (u + a) / 2, { [X]: m, [q]: d, ...f } = s, h = {
1261
+ const c = Number(s[S]), a = Number(s[T]);
1262
+ if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c) continue;
1263
+ const u = (c + a) / 2, { [q]: m, [X]: d, ...f } = s, h = {
1264
1264
  ...f,
1265
- [A]: l,
1266
- [L]: u,
1267
- [w]: a,
1268
- [Ie]: c,
1269
- [W]: c,
1265
+ [x]: l,
1266
+ [S]: c,
1267
+ [T]: a,
1268
+ [Ie]: u,
1269
+ [W]: u,
1270
1270
  // unified depth field for y-axis rendering
1271
1271
  _source: "assay"
1272
1272
  };
@@ -1274,14 +1274,14 @@ function Hn(e) {
1274
1274
  }
1275
1275
  const o = Array.from(r.entries()).map(([i, s]) => ({
1276
1276
  holeId: i,
1277
- points: s.sort((l, u) => l[L] - u[L])
1277
+ points: s.sort((l, c) => l[S] - c[S])
1278
1278
  }));
1279
1279
  t(o);
1280
1280
  }
1281
1281
  });
1282
1282
  });
1283
1283
  }
1284
- function Rn(e) {
1284
+ function jn(e) {
1285
1285
  return new Promise((t) => {
1286
1286
  te.parse(e, {
1287
1287
  header: !0,
@@ -1290,15 +1290,15 @@ function Rn(e) {
1290
1290
  complete: (n) => {
1291
1291
  const r = /* @__PURE__ */ new Map();
1292
1292
  for (const o of n.data) {
1293
- const i = ge(o), s = (i[A] ?? "").toString().trim();
1293
+ const i = ye(o), s = (i[x] ?? "").toString().trim();
1294
1294
  if (!s) continue;
1295
- const l = Number(i[L]), u = Number(i[w]);
1296
- if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l) continue;
1297
- const a = (l + u) / 2, { [X]: c, [q]: m, ...d } = i, f = {
1295
+ const l = Number(i[S]), c = Number(i[T]);
1296
+ if (!Number.isFinite(l) || !Number.isFinite(c) || c <= l) continue;
1297
+ const a = (l + c) / 2, { [q]: u, [X]: m, ...d } = i, f = {
1298
1298
  ...d,
1299
- [A]: s,
1300
- [L]: l,
1301
- [w]: u,
1299
+ [x]: s,
1300
+ [S]: l,
1301
+ [T]: c,
1302
1302
  [Ie]: a,
1303
1303
  [W]: a,
1304
1304
  _source: "geology"
@@ -1308,96 +1308,96 @@ function Rn(e) {
1308
1308
  t({
1309
1309
  holes: Array.from(r.entries()).map(([o, i]) => ({
1310
1310
  holeId: o,
1311
- points: i.sort((s, l) => s[L] - l[L])
1311
+ points: i.sort((s, l) => s[S] - l[S])
1312
1312
  }))
1313
1313
  });
1314
1314
  }
1315
1315
  });
1316
1316
  });
1317
1317
  }
1318
- async function oi({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1318
+ async function pi({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1319
1319
  const [r, o, i] = await Promise.all([
1320
1320
  e ? Hn(e) : Promise.resolve([]),
1321
1321
  t ? Vn(t).then(
1322
- ({ rows: l }) => Bn(l.map((u) => ({ ...u, _source: "structural" })))
1322
+ ({ rows: l }) => Rn(l.map((c) => ({ ...c, _source: "structural" })))
1323
1323
  ) : Promise.resolve([]),
1324
- n ? Rn(n).then(({ holes: l }) => l) : Promise.resolve([])
1324
+ n ? jn(n).then(({ holes: l }) => l) : Promise.resolve([])
1325
1325
  ]), s = new Map(r.map((l) => [l.holeId, { ...l, points: [...l.points] }]));
1326
1326
  for (const l of [...o, ...i]) {
1327
- const u = l.holeId;
1328
- if (u)
1329
- if (s.has(u)) {
1330
- const a = s.get(u);
1331
- s.set(u, { ...a, points: [...a.points, ...l.points || []] });
1327
+ const c = l.holeId;
1328
+ if (c)
1329
+ if (s.has(c)) {
1330
+ const a = s.get(c);
1331
+ s.set(c, { ...a, points: [...a.points, ...l.points || []] });
1332
1332
  } else
1333
- s.set(u, l);
1333
+ s.set(c, l);
1334
1334
  }
1335
1335
  return { holes: Array.from(s.values()) };
1336
1336
  }
1337
- function jn(e, t) {
1337
+ function Gn(e, t) {
1338
1338
  if (!e || e.length === 0 || !Number.isFinite(t)) return null;
1339
1339
  const n = e.length;
1340
1340
  if (n === 1) {
1341
- const g = e[0];
1342
- return { x: Number(g.x), y: Number(g.y), z: Number(g.z), dx: 0, dy: 0, dz: -1 };
1341
+ const y = e[0];
1342
+ return { x: Number(y.x), y: Number(y.y), z: Number(y.z), dx: 0, dy: 0, dz: -1 };
1343
1343
  }
1344
1344
  let r = -1;
1345
- for (let g = 0; g < n - 1; g++) {
1346
- const M = Number(e[g].md), z = Number(e[g + 1].md);
1345
+ for (let y = 0; y < n - 1; y++) {
1346
+ const M = Number(e[y].md), z = Number(e[y + 1].md);
1347
1347
  if (t >= M && t <= z) {
1348
- r = g;
1348
+ r = y;
1349
1349
  break;
1350
1350
  }
1351
1351
  }
1352
1352
  let o, i, s;
1353
1353
  if (r === -1) {
1354
1354
  t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
1355
- const g = Number(o.md), z = Number(i.md) - g;
1356
- s = z > 0 ? (t - g) / z : t < g ? 0 : 1;
1355
+ const y = Number(o.md), z = Number(i.md) - y;
1356
+ s = z > 0 ? (t - y) / z : t < y ? 0 : 1;
1357
1357
  } else {
1358
1358
  o = e[r], i = e[r + 1];
1359
- const g = Number(o.md), z = Number(i.md) - g;
1360
- s = z > 0 ? (t - g) / z : 0;
1359
+ const y = Number(o.md), z = Number(i.md) - y;
1360
+ s = z > 0 ? (t - y) / z : 0;
1361
1361
  }
1362
- const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), u = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
1363
- let c, m, d;
1364
- const f = Number(o.azimuth), h = Number(o.dip), b = Number(i.azimuth), y = Number(i.dip);
1362
+ const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), c = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
1363
+ let u, m, d;
1364
+ const f = Number(o.azimuth), h = Number(o.dip), b = Number(i.azimuth), _ = Number(i.dip);
1365
1365
  if (Number.isFinite(f) && Number.isFinite(h)) {
1366
- const g = Number.isFinite(b) && Number.isFinite(y) ? f + s * (b - f) : f, M = Number.isFinite(b) && Number.isFinite(y) ? h + s * (y - h) : h, z = g * Math.PI / 180, D = M * Math.PI / 180;
1367
- c = Math.cos(D) * Math.sin(z), m = Math.cos(D) * Math.cos(z), d = -Math.sin(D);
1366
+ const y = Number.isFinite(b) && Number.isFinite(_) ? f + s * (b - f) : f, M = Number.isFinite(b) && Number.isFinite(_) ? h + s * (_ - h) : h, z = y * Math.PI / 180, O = M * Math.PI / 180;
1367
+ u = Math.cos(O) * Math.sin(z), m = Math.cos(O) * Math.cos(z), d = -Math.sin(O);
1368
1368
  } else {
1369
- const g = Number(i.x) - Number(o.x), M = Number(i.y) - Number(o.y), z = Number(i.z) - Number(o.z), D = Math.sqrt(g * g + M * M + z * z);
1370
- if (D < 1e-10) return { x: l, y: u, z: a, dx: 0, dy: 0, dz: -1 };
1371
- c = g / D, m = M / D, d = z / D;
1372
- }
1373
- const p = Math.sqrt(c * c + m * m + d * d);
1374
- return p < 1e-10 ? { x: l, y: u, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: u, z: a, dx: c / p, dy: m / p, dz: d / p };
1375
- }
1376
- function Gn(e, t, n, r = {}) {
1377
- const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: u } = n, a = [s, l, u];
1378
- let c = [0, 0, 1];
1379
- const m = a[0] * c[0] + a[1] * c[1] + a[2] * c[2];
1380
- Math.abs(m) > 0.99 && (c = [0, 1, 0]);
1369
+ const y = Number(i.x) - Number(o.x), M = Number(i.y) - Number(o.y), z = Number(i.z) - Number(o.z), O = Math.sqrt(y * y + M * M + z * z);
1370
+ if (O < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
1371
+ u = y / O, m = M / O, d = z / O;
1372
+ }
1373
+ const p = Math.sqrt(u * u + m * m + d * d);
1374
+ return p < 1e-10 ? { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: a, dx: u / p, dy: m / p, dz: d / p };
1375
+ }
1376
+ function Un(e, t, n, r = {}) {
1377
+ const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
1378
+ let u = [0, 0, 1];
1379
+ const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
1380
+ Math.abs(m) > 0.99 && (u = [0, 1, 0]);
1381
1381
  const d = [
1382
- c[1] * a[2] - c[2] * a[1],
1383
- c[2] * a[0] - c[0] * a[2],
1384
- c[0] * a[1] - c[1] * a[0]
1382
+ u[1] * a[2] - u[2] * a[1],
1383
+ u[2] * a[0] - u[0] * a[2],
1384
+ u[0] * a[1] - u[1] * a[0]
1385
1385
  ], f = Math.sqrt(d[0] ** 2 + d[1] ** 2 + d[2] ** 2), h = f > 1e-10 ? [d[0] / f, d[1] / f, d[2] / f] : [1, 0, 0], b = [
1386
1386
  a[1] * h[2] - a[2] * h[1],
1387
1387
  a[2] * h[0] - a[0] * h[2],
1388
1388
  a[0] * h[1] - a[1] * h[0]
1389
- ], y = Math.sqrt(b[0] ** 2 + b[1] ** 2 + b[2] ** 2), p = y > 1e-10 ? [b[0] / y, b[1] / y, b[2] / y] : [0, 1, 0], g = o === "R" ? h : p, M = t * Math.PI / 180 * i, z = Math.cos(M), D = Math.sin(M), x = g[0] * a[0] + g[1] * a[1] + g[2] * a[2], O = [
1390
- a[1] * g[2] - a[2] * g[1],
1391
- a[2] * g[0] - a[0] * g[2],
1392
- a[0] * g[1] - a[1] * g[0]
1389
+ ], _ = Math.sqrt(b[0] ** 2 + b[1] ** 2 + b[2] ** 2), p = _ > 1e-10 ? [b[0] / _, b[1] / _, b[2] / _] : [0, 1, 0], y = o === "R" ? h : p, M = t * Math.PI / 180 * i, z = Math.cos(M), O = Math.sin(M), k = y[0] * a[0] + y[1] * a[1] + y[2] * a[2], L = [
1390
+ a[1] * y[2] - a[2] * y[1],
1391
+ a[2] * y[0] - a[0] * y[2],
1392
+ a[0] * y[1] - a[1] * y[0]
1393
1393
  ], $ = [
1394
- g[0] * z + O[0] * D + a[0] * x * (1 - z),
1395
- g[1] * z + O[1] * D + a[1] * x * (1 - z),
1396
- g[2] * z + O[2] * D + a[2] * x * (1 - z)
1397
- ], P = (90 - e) * Math.PI / 180, E = Math.cos(P), F = Math.sin(P), C = E * $[0] + F * a[0], H = E * $[1] + F * a[1], R = E * $[2] + F * a[2], v = Math.sqrt(C * C + H * H + R * R);
1398
- return v < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: C / v, ny: H / v, nz: R / v };
1394
+ y[0] * z + L[0] * O + a[0] * k * (1 - z),
1395
+ y[1] * z + L[1] * O + a[1] * k * (1 - z),
1396
+ y[2] * z + L[2] * O + a[2] * k * (1 - z)
1397
+ ], P = (90 - e) * Math.PI / 180, v = Math.cos(P), F = Math.sin(P), C = v * $[0] + F * a[0], V = v * $[1] + F * a[1], H = v * $[2] + F * a[2], A = Math.sqrt(C * C + V * V + H * H);
1398
+ return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: C / A, ny: V / A, nz: H / A };
1399
1399
  }
1400
- function Un(e, t, n = {}) {
1400
+ function Yn(e, t, n = {}) {
1401
1401
  if (!(e != null && e.length) || !(t != null && t.length)) return [];
1402
1402
  const r = /* @__PURE__ */ new Map();
1403
1403
  for (const i of t) {
@@ -1412,27 +1412,27 @@ function Un(e, t, n = {}) {
1412
1412
  if (!s) continue;
1413
1413
  const l = r.get(s);
1414
1414
  if (!l || l.length === 0) continue;
1415
- const u = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
1416
- if (!Number.isFinite(u)) continue;
1417
- const a = jn(l, u);
1415
+ const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
1416
+ if (!Number.isFinite(c)) continue;
1417
+ const a = Gn(l, c);
1418
1418
  if (!a) continue;
1419
- const { x: c, y: m, z: d, dx: f, dy: h, dz: b } = a;
1420
- let y, p, g;
1419
+ const { x: u, y: m, z: d, dx: f, dy: h, dz: b } = a;
1420
+ let _, p, y;
1421
1421
  const M = i.alpha != null ? Number(i.alpha) : null, z = i.beta != null ? Number(i.beta) : null;
1422
1422
  if (Number.isFinite(M)) {
1423
- const D = Number.isFinite(z) ? z : 0, x = Gn(M, D, { dx: f, dy: h, dz: b }, n);
1424
- y = x.nx, p = x.ny, g = x.nz;
1423
+ const O = Number.isFinite(z) ? z : 0, k = Un(M, O, { dx: f, dy: h, dz: b }, n);
1424
+ _ = k.nx, p = k.ny, y = k.nz;
1425
1425
  } else {
1426
- const D = i.dip != null ? Number(i.dip) : null, x = i.azimuth != null ? Number(i.azimuth) : null;
1427
- if (!Number.isFinite(D) || !Number.isFinite(x)) continue;
1428
- const O = D * Math.PI / 180, $ = x * Math.PI / 180;
1429
- y = Math.sin($) * Math.sin(O), p = Math.cos($) * Math.sin(O), g = Math.cos(O);
1426
+ const O = i.dip != null ? Number(i.dip) : null, k = i.azimuth != null ? Number(i.azimuth) : null;
1427
+ if (!Number.isFinite(O) || !Number.isFinite(k)) continue;
1428
+ const L = O * Math.PI / 180, $ = k * Math.PI / 180;
1429
+ _ = Math.sin($) * Math.sin(L), p = Math.cos($) * Math.sin(L), y = Math.cos(L);
1430
1430
  }
1431
- o.push({ ...i, x: c, y: m, z: d, nx: y, ny: p, nz: g });
1431
+ o.push({ ...i, x: u, y: m, z: d, nx: _, ny: p, nz: y });
1432
1432
  }
1433
1433
  return o;
1434
1434
  }
1435
- const Yn = "baselode", ii = Yn, qn = [
1435
+ const Xn = "baselode", bi = Xn, qn = [
1436
1436
  "#8b1e3f",
1437
1437
  "#2563eb",
1438
1438
  "#16a34a",
@@ -1443,7 +1443,7 @@ const Yn = "baselode", ii = Yn, qn = [
1443
1443
  "#10b981",
1444
1444
  "#f97316",
1445
1445
  "#8b5cf6"
1446
- ], V = {
1446
+ ], R = {
1447
1447
  bg: "#ffffff",
1448
1448
  panel: "#f8fafc",
1449
1449
  ink: "#1e293b",
@@ -1457,31 +1457,31 @@ const Yn = "baselode", ii = Yn, qn = [
1457
1457
  muted_3: "#e2e8f0",
1458
1458
  primary: "#8b1e3f",
1459
1459
  primary_2: "#a8324f"
1460
- }, Ce = {
1460
+ }, Oe = {
1461
1461
  layout: {
1462
- paper_bgcolor: V.bg,
1463
- plot_bgcolor: V.bg,
1462
+ paper_bgcolor: R.bg,
1463
+ plot_bgcolor: R.bg,
1464
1464
  colorway: qn,
1465
1465
  font: {
1466
1466
  family: "Inter, system-ui, sans-serif",
1467
1467
  size: 12,
1468
- color: V.ink
1468
+ color: R.ink
1469
1469
  },
1470
1470
  title: {
1471
- font: { size: 14, color: V.ink },
1471
+ font: { size: 14, color: R.ink },
1472
1472
  x: 0.05
1473
1473
  },
1474
1474
  hovermode: "x unified",
1475
1475
  hoverlabel: {
1476
- bgcolor: V.bg,
1477
- bordercolor: V.line,
1478
- font: { size: 12, color: V.ink }
1476
+ bgcolor: R.bg,
1477
+ bordercolor: R.line,
1478
+ font: { size: 12, color: R.ink }
1479
1479
  },
1480
1480
  legend: {
1481
1481
  bgcolor: "rgba(255,255,255,0.9)",
1482
- bordercolor: V.muted_3,
1482
+ bordercolor: R.muted_3,
1483
1483
  borderwidth: 1,
1484
- font: { size: 11, color: V.ink },
1484
+ font: { size: 11, color: R.ink },
1485
1485
  orientation: "h",
1486
1486
  yanchor: "bottom",
1487
1487
  y: 1.02,
@@ -1491,34 +1491,34 @@ const Yn = "baselode", ii = Yn, qn = [
1491
1491
  xaxis: {
1492
1492
  showline: !0,
1493
1493
  linewidth: 1,
1494
- linecolor: V.line,
1494
+ linecolor: R.line,
1495
1495
  mirror: !1,
1496
1496
  ticks: "outside",
1497
1497
  tickwidth: 1,
1498
- tickcolor: V.line,
1498
+ tickcolor: R.line,
1499
1499
  ticklen: 4,
1500
1500
  showgrid: !0,
1501
- gridcolor: V.grid,
1501
+ gridcolor: R.grid,
1502
1502
  gridwidth: 1,
1503
1503
  zeroline: !1,
1504
- title_font: { color: V.ink, size: 12 },
1505
- tickfont: { color: V.ink_soft, size: 10 }
1504
+ title_font: { color: R.ink, size: 12 },
1505
+ tickfont: { color: R.ink_soft, size: 10 }
1506
1506
  },
1507
1507
  yaxis: {
1508
1508
  showline: !0,
1509
1509
  linewidth: 1,
1510
- linecolor: V.line,
1510
+ linecolor: R.line,
1511
1511
  mirror: !1,
1512
1512
  ticks: "outside",
1513
1513
  tickwidth: 1,
1514
- tickcolor: V.line,
1514
+ tickcolor: R.line,
1515
1515
  ticklen: 4,
1516
1516
  showgrid: !0,
1517
- gridcolor: V.grid,
1517
+ gridcolor: R.grid,
1518
1518
  gridwidth: 1,
1519
1519
  zeroline: !1,
1520
- title_font: { color: V.ink, size: 12 },
1521
- tickfont: { color: V.ink_soft, size: 10 }
1520
+ title_font: { color: R.ink, size: 12 },
1521
+ tickfont: { color: R.ink_soft, size: 10 }
1522
1522
  },
1523
1523
  modebar: {
1524
1524
  remove: ["select2d", "lasso2d", "autoScale2d"]
@@ -1529,34 +1529,34 @@ const Yn = "baselode", ii = Yn, qn = [
1529
1529
  data: {
1530
1530
  scatter: [{
1531
1531
  mode: "lines+markers",
1532
- line: { width: 2, color: V.primary },
1532
+ line: { width: 2, color: R.primary },
1533
1533
  marker: {
1534
1534
  size: 7,
1535
- color: V.primary_2,
1536
- line: { width: 1.5, color: V.bg }
1535
+ color: R.primary_2,
1536
+ line: { width: 1.5, color: R.bg }
1537
1537
  }
1538
1538
  }],
1539
1539
  bar: [{
1540
1540
  marker: {
1541
- color: V.primary,
1542
- line: { color: V.bg, width: 0 }
1541
+ color: R.primary,
1542
+ line: { color: R.bg, width: 0 }
1543
1543
  }
1544
1544
  }],
1545
1545
  histogram: [{
1546
1546
  marker: {
1547
- color: V.primary,
1548
- line: { color: V.bg, width: 0 }
1547
+ color: R.primary,
1548
+ line: { color: R.bg, width: 0 }
1549
1549
  }
1550
1550
  }],
1551
1551
  box: [{
1552
- fillcolor: V.accent,
1553
- line: { color: V.ink, width: 1.5 },
1554
- marker: { color: V.ink }
1552
+ fillcolor: R.accent,
1553
+ line: { color: R.ink, width: 1.5 },
1554
+ marker: { color: R.ink }
1555
1555
  }],
1556
1556
  violin: [{
1557
- fillcolor: V.accent,
1558
- line: { color: V.ink, width: 1.5 },
1559
- marker: { color: V.ink }
1557
+ fillcolor: R.accent,
1558
+ line: { color: R.ink, width: 1.5 },
1559
+ marker: { color: R.ink }
1560
1560
  }],
1561
1561
  heatmap: [{
1562
1562
  colorscale: [
@@ -1568,9 +1568,9 @@ const Yn = "baselode", ii = Yn, qn = [
1568
1568
  [1, "#1e293b"]
1569
1569
  ],
1570
1570
  colorbar: {
1571
- outlinecolor: V.line,
1572
- tickcolor: V.line,
1573
- tickfont: { color: V.ink_soft }
1571
+ outlinecolor: R.line,
1572
+ tickcolor: R.line,
1573
+ tickfont: { color: R.ink_soft }
1574
1574
  }
1575
1575
  }],
1576
1576
  contour: [{
@@ -1582,13 +1582,13 @@ const Yn = "baselode", ii = Yn, qn = [
1582
1582
  [1, "#1e293b"]
1583
1583
  ],
1584
1584
  colorbar: {
1585
- outlinecolor: V.line,
1586
- tickcolor: V.line,
1587
- tickfont: { color: V.ink_soft }
1585
+ outlinecolor: R.line,
1586
+ tickcolor: R.line,
1587
+ tickfont: { color: R.ink_soft }
1588
1588
  }
1589
1589
  }]
1590
1590
  }
1591
- }, si = Ce, T = {
1591
+ }, yi = Oe, w = {
1592
1592
  bg: "#1b1b1f",
1593
1593
  panel: "#25252a",
1594
1594
  ink: "#f0f0e4",
@@ -1600,11 +1600,11 @@ const Yn = "baselode", ii = Yn, qn = [
1600
1600
  muted_1: "#8a8a80",
1601
1601
  muted_2: "#5e5e56",
1602
1602
  muted_3: "#3a3a34"
1603
- }, li = "baselode-dark", ai = {
1603
+ }, gi = "baselode-dark", _i = {
1604
1604
  layout: {
1605
1605
  font: {
1606
1606
  family: "Inter, Arial, sans-serif",
1607
- color: T.ink,
1607
+ color: w.ink,
1608
1608
  size: 14
1609
1609
  },
1610
1610
  title: {
@@ -1613,37 +1613,37 @@ const Yn = "baselode", ii = Yn, qn = [
1613
1613
  font: {
1614
1614
  family: "Inter, Arial, sans-serif",
1615
1615
  size: 22,
1616
- color: T.ink
1616
+ color: w.ink
1617
1617
  }
1618
1618
  },
1619
- paper_bgcolor: T.bg,
1620
- plot_bgcolor: T.bg,
1619
+ paper_bgcolor: w.bg,
1620
+ plot_bgcolor: w.bg,
1621
1621
  colorway: [
1622
- T.ink,
1623
- T.accent,
1624
- T.muted_1,
1625
- T.accent_2,
1626
- T.muted_2,
1627
- T.muted_3
1622
+ w.ink,
1623
+ w.accent,
1624
+ w.muted_1,
1625
+ w.accent_2,
1626
+ w.muted_2,
1627
+ w.muted_3
1628
1628
  ],
1629
1629
  margin: { l: 70, r: 30, t: 70, b: 60 },
1630
1630
  hovermode: "x unified",
1631
1631
  hoverlabel: {
1632
- bgcolor: T.panel,
1633
- bordercolor: T.accent,
1632
+ bgcolor: w.panel,
1633
+ bordercolor: w.accent,
1634
1634
  font: {
1635
1635
  family: "Inter, Arial, sans-serif",
1636
- color: T.ink,
1636
+ color: w.ink,
1637
1637
  size: 13
1638
1638
  }
1639
1639
  },
1640
1640
  legend: {
1641
1641
  bgcolor: "rgba(37,37,42,0.88)",
1642
- bordercolor: T.line,
1642
+ bordercolor: w.line,
1643
1643
  borderwidth: 1,
1644
1644
  font: {
1645
1645
  family: "Inter, Arial, sans-serif",
1646
- color: T.ink,
1646
+ color: w.ink,
1647
1647
  size: 12
1648
1648
  },
1649
1649
  orientation: "h",
@@ -1656,27 +1656,27 @@ const Yn = "baselode", ii = Yn, qn = [
1656
1656
  showline: !1,
1657
1657
  ticks: "outside",
1658
1658
  tickwidth: 1,
1659
- tickcolor: T.muted_1,
1659
+ tickcolor: w.muted_1,
1660
1660
  ticklen: 6,
1661
1661
  showgrid: !0,
1662
- gridcolor: T.grid,
1662
+ gridcolor: w.grid,
1663
1663
  gridwidth: 1,
1664
1664
  zeroline: !1,
1665
- title_font: { color: T.ink },
1666
- tickfont: { color: T.ink_soft }
1665
+ title_font: { color: w.ink },
1666
+ tickfont: { color: w.ink_soft }
1667
1667
  },
1668
1668
  yaxis: {
1669
1669
  showline: !1,
1670
1670
  ticks: "outside",
1671
1671
  tickwidth: 1,
1672
- tickcolor: T.muted_1,
1672
+ tickcolor: w.muted_1,
1673
1673
  ticklen: 6,
1674
1674
  showgrid: !0,
1675
- gridcolor: T.grid,
1675
+ gridcolor: w.grid,
1676
1676
  gridwidth: 1,
1677
1677
  zeroline: !1,
1678
- title_font: { color: T.ink },
1679
- tickfont: { color: T.ink_soft }
1678
+ title_font: { color: w.ink },
1679
+ tickfont: { color: w.ink_soft }
1680
1680
  },
1681
1681
  bargap: 0.18,
1682
1682
  bargroupgap: 0.08
@@ -1684,34 +1684,34 @@ const Yn = "baselode", ii = Yn, qn = [
1684
1684
  data: {
1685
1685
  scatter: [{
1686
1686
  mode: "lines+markers",
1687
- line: { width: 2.5, color: T.ink },
1687
+ line: { width: 2.5, color: w.ink },
1688
1688
  marker: {
1689
1689
  size: 7,
1690
- color: T.ink,
1691
- line: { width: 1.5, color: T.bg }
1690
+ color: w.ink,
1691
+ line: { width: 1.5, color: w.bg }
1692
1692
  }
1693
1693
  }],
1694
1694
  bar: [{
1695
1695
  marker: {
1696
- color: T.ink,
1697
- line: { color: T.bg, width: 0 }
1696
+ color: w.ink,
1697
+ line: { color: w.bg, width: 0 }
1698
1698
  }
1699
1699
  }],
1700
1700
  histogram: [{
1701
1701
  marker: {
1702
- color: T.ink,
1703
- line: { color: T.bg, width: 0 }
1702
+ color: w.ink,
1703
+ line: { color: w.bg, width: 0 }
1704
1704
  }
1705
1705
  }],
1706
1706
  box: [{
1707
- fillcolor: T.accent,
1708
- line: { color: T.ink, width: 1.5 },
1709
- marker: { color: T.ink }
1707
+ fillcolor: w.accent,
1708
+ line: { color: w.ink, width: 1.5 },
1709
+ marker: { color: w.ink }
1710
1710
  }],
1711
1711
  violin: [{
1712
- fillcolor: T.accent,
1713
- line: { color: T.ink, width: 1.5 },
1714
- marker: { color: T.ink }
1712
+ fillcolor: w.accent,
1713
+ line: { color: w.ink, width: 1.5 },
1714
+ marker: { color: w.ink }
1715
1715
  }],
1716
1716
  heatmap: [{
1717
1717
  colorscale: [
@@ -1723,9 +1723,9 @@ const Yn = "baselode", ii = Yn, qn = [
1723
1723
  [1, "#ffffbb"]
1724
1724
  ],
1725
1725
  colorbar: {
1726
- outlinecolor: T.ink,
1727
- tickcolor: T.ink,
1728
- tickfont: { color: T.ink_soft }
1726
+ outlinecolor: w.ink,
1727
+ tickcolor: w.ink,
1728
+ tickfont: { color: w.ink_soft }
1729
1729
  }
1730
1730
  }],
1731
1731
  contour: [{
@@ -1737,13 +1737,13 @@ const Yn = "baselode", ii = Yn, qn = [
1737
1737
  [1, "#ffffbb"]
1738
1738
  ],
1739
1739
  colorbar: {
1740
- outlinecolor: T.ink,
1741
- tickcolor: T.ink,
1742
- tickfont: { color: T.ink_soft }
1740
+ outlinecolor: w.ink,
1741
+ tickcolor: w.ink,
1742
+ tickfont: { color: w.ink_soft }
1743
1743
  }
1744
1744
  }]
1745
1745
  }
1746
- }, Xn = "#7f7f7f", Ve = {
1746
+ }, Zn = "#7f7f7f", Re = {
1747
1747
  Au: "#FFD700",
1748
1748
  // gold
1749
1749
  Ag: "#C0C0C0",
@@ -1780,7 +1780,7 @@ const Yn = "baselode", ii = Yn, qn = [
1780
1780
  // aluminium / yellow
1781
1781
  U: "#8BC34A"
1782
1782
  // uranium / lime green
1783
- }, Zn = {
1783
+ }, Wn = {
1784
1784
  // Sedimentary
1785
1785
  shale: "#607D8B",
1786
1786
  mudstone: "#78909C",
@@ -1819,11 +1819,11 @@ const Yn = "baselode", ii = Yn, qn = [
1819
1819
  calcite: "#F9FBE7",
1820
1820
  vein: "#FFFFFF",
1821
1821
  unknown: "#9E9E9E"
1822
- }, qe = {
1823
- commodity: Ve,
1824
- lithology: Zn
1822
+ }, Xe = {
1823
+ commodity: Re,
1824
+ lithology: Wn
1825
1825
  };
1826
- function Wn(e, t, n = Xn) {
1826
+ function Kn(e, t, n = Zn) {
1827
1827
  if (!t || e == null) return n;
1828
1828
  const r = String(e).trim();
1829
1829
  if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
@@ -1832,13 +1832,13 @@ function Wn(e, t, n = Xn) {
1832
1832
  if (String(i).trim().toLowerCase() === o) return s;
1833
1833
  return n;
1834
1834
  }
1835
- function Kn(e) {
1835
+ function Jn(e) {
1836
1836
  if (e == null) return {};
1837
1837
  if (typeof e == "string") {
1838
1838
  const t = e.trim().toLowerCase();
1839
- if (Object.prototype.hasOwnProperty.call(qe, t))
1840
- return qe[t];
1841
- const n = Object.keys(qe).sort().join(", ");
1839
+ if (Object.prototype.hasOwnProperty.call(Xe, t))
1840
+ return Xe[t];
1841
+ const n = Object.keys(Xe).sort().join(", ");
1842
1842
  throw new RangeError(
1843
1843
  `Unknown built-in colour map '${e}'. Available maps: ${n}`
1844
1844
  );
@@ -1848,39 +1848,39 @@ function Kn(e) {
1848
1848
  `colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
1849
1849
  );
1850
1850
  }
1851
- const Jn = "#8b1e3f", Qn = "#a8324f";
1852
- function er(e) {
1851
+ const Qn = "#8b1e3f", er = "#a8324f";
1852
+ function tr(e) {
1853
1853
  if (!e) return null;
1854
1854
  const t = e.split(/[_\-/\s]+/);
1855
1855
  for (const n of t) {
1856
- if (Object.prototype.hasOwnProperty.call(Ve, n))
1857
- return Ve[n];
1856
+ if (Object.prototype.hasOwnProperty.call(Re, n))
1857
+ return Re[n];
1858
1858
  const r = n.toLowerCase();
1859
- for (const [o, i] of Object.entries(Ve))
1859
+ for (const [o, i] of Object.entries(Re))
1860
1860
  if (o.toLowerCase() === r) return i;
1861
1861
  }
1862
1862
  return null;
1863
1863
  }
1864
- const tr = "#6b7280", nr = { l: 42, r: 4, t: 4, b: 30 }, mt = 10, ft = 12;
1865
- function ht(e) {
1864
+ const nr = "#6b7280", rr = { l: 42, r: 4, t: 4, b: 30 }, ft = 10, ht = 12;
1865
+ function pt(e) {
1866
1866
  return e ? typeof e == "string" ? { text: e } : e : {};
1867
1867
  }
1868
- function Ft(e = {}) {
1869
- const t = ht(e.xaxis && e.xaxis.title), n = ht(e.yaxis && e.yaxis.title);
1868
+ function wt(e = {}) {
1869
+ const t = pt(e.xaxis && e.xaxis.title), n = pt(e.yaxis && e.yaxis.title);
1870
1870
  return {
1871
1871
  ...e,
1872
- margin: nr,
1872
+ margin: rr,
1873
1873
  autosize: !0,
1874
1874
  width: void 0,
1875
1875
  xaxis: {
1876
1876
  ...e.xaxis || {},
1877
1877
  tickfont: {
1878
1878
  ...e.xaxis && e.xaxis.tickfont || {},
1879
- size: mt
1879
+ size: ft
1880
1880
  },
1881
1881
  title: {
1882
1882
  ...t,
1883
- font: { ...t.font || {}, size: ft }
1883
+ font: { ...t.font || {}, size: ht }
1884
1884
  }
1885
1885
  },
1886
1886
  yaxis: {
@@ -1888,16 +1888,16 @@ function Ft(e = {}) {
1888
1888
  automargin: !0,
1889
1889
  tickfont: {
1890
1890
  ...e.yaxis && e.yaxis.tickfont || {},
1891
- size: mt
1891
+ size: ft
1892
1892
  },
1893
1893
  title: {
1894
1894
  ...n,
1895
- font: { ...n.font || {}, size: ft }
1895
+ font: { ...n.font || {}, size: ht }
1896
1896
  }
1897
1897
  }
1898
1898
  };
1899
1899
  }
1900
- function rr(e, t) {
1900
+ function or(e, t) {
1901
1901
  var r;
1902
1902
  if (!e || !t) return !1;
1903
1903
  const n = e.points || [];
@@ -1908,40 +1908,40 @@ function rr(e, t) {
1908
1908
  }
1909
1909
  return !1;
1910
1910
  }
1911
- function or(e, t, n) {
1911
+ function ir(e, t, n) {
1912
1912
  if (!e || !t) return [];
1913
1913
  const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
1914
1914
  return r.forEach((s) => {
1915
1915
  let l = Number(
1916
1916
  s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
1917
- ), u = Number(
1917
+ ), c = Number(
1918
1918
  s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
1919
1919
  );
1920
- if (!Number.isFinite(l) || !Number.isFinite(u)) {
1920
+ if (!Number.isFinite(l) || !Number.isFinite(c)) {
1921
1921
  const f = Number(s.depth ?? s.md);
1922
- Number.isFinite(f) && (l = f, u = f);
1922
+ Number.isFinite(f) && (l = f, c = f);
1923
1923
  }
1924
1924
  const a = s == null ? void 0 : s[t];
1925
- if (!Number.isFinite(l) || !Number.isFinite(u) || u < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
1926
- const c = `${t}:${l}-${u}:${String(a)}`;
1927
- if (i.has(c)) return;
1928
- i.add(c);
1929
- const m = (l + u) / 2, d = n ? a : Number(a);
1925
+ if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
1926
+ const u = `${t}:${l}-${c}:${String(a)}`;
1927
+ if (i.has(u)) return;
1928
+ i.add(u);
1929
+ const m = (l + c) / 2, d = n ? a : Number(a);
1930
1930
  !n && !Number.isFinite(d) || o.push({
1931
1931
  z: m,
1932
1932
  val: d,
1933
1933
  from: l,
1934
- to: u,
1935
- errorPlus: u - m,
1934
+ to: c,
1935
+ errorPlus: c - m,
1936
1936
  errorMinus: m - l
1937
1937
  });
1938
1938
  }), o.sort((s, l) => l.z - s.z);
1939
1939
  }
1940
- function ir(e, t, n, r) {
1940
+ function sr(e, t, n, r) {
1941
1941
  if (!e.length) return { data: [], layout: {} };
1942
1942
  const o = e.filter((d) => Number.isFinite(d == null ? void 0 : d.from) && Number.isFinite(d == null ? void 0 : d.to) && d.to > d.from).map((d) => ({ ...d, category: `${(d == null ? void 0 : d.val) ?? ""}`.trim() })).filter((d) => d.category !== "" && !/^(nan|null|none)$/i.test(d.category)).sort((d, f) => d.from - f.from || d.to - f.to);
1943
1943
  if (!o.length) return { data: [], layout: {} };
1944
- const i = Kn(n), s = [
1944
+ const i = Jn(n), s = [
1945
1945
  "#1f77b4",
1946
1946
  // blue
1947
1947
  "#ff7f0e",
@@ -1971,15 +1971,15 @@ function ir(e, t, n, r) {
1971
1971
  "#636363"
1972
1972
  // dark gray
1973
1973
  ], l = [...new Set(o.map((d) => d.category))];
1974
- function u(d, f) {
1974
+ function c(d, f) {
1975
1975
  if (i && Object.keys(i).length > 0) {
1976
- const h = Wn(d, i, null);
1976
+ const h = Kn(d, i, null);
1977
1977
  if (h !== null) return h;
1978
1978
  }
1979
1979
  return s[f % s.length];
1980
1980
  }
1981
1981
  const a = new Map(
1982
- l.map((d, f) => [d, u(d, f)])
1982
+ l.map((d, f) => [d, c(d, f)])
1983
1983
  );
1984
1984
  return { data: l.map((d) => {
1985
1985
  const f = o.filter((h) => h.category === d);
@@ -1995,19 +1995,19 @@ function ir(e, t, n, r) {
1995
1995
  customdata: f.map((h) => [h.from, h.to]),
1996
1996
  hovertemplate: `${t}: ${d}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1997
1997
  };
1998
- }), layout: Ft({
1998
+ }), layout: wt({
1999
1999
  barmode: "overlay",
2000
2000
  bargap: 0,
2001
2001
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
2002
2002
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
2003
2003
  showlegend: !1,
2004
2004
  title: t || void 0,
2005
- template: r !== void 0 ? r : Ce
2005
+ template: r !== void 0 ? r : Oe
2006
2006
  }) };
2007
2007
  }
2008
- function sr(e, t, n, r, o) {
2008
+ function lr(e, t, n, r, o) {
2009
2009
  if (!e.length) return { data: [], layout: {} };
2010
- const i = n === "bar", s = n === "markers", l = n === "line", u = r || Jn, a = r || Qn, c = {
2010
+ const i = n === "bar", s = n === "markers", l = n === "line", c = r || Qn, a = r || er, u = {
2011
2011
  x: e.map((h) => h.val),
2012
2012
  y: e.map((h) => h.z),
2013
2013
  hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
@@ -2019,37 +2019,37 @@ function sr(e, t, n, r, o) {
2019
2019
  arrayminus: e.map((h) => h.errorMinus),
2020
2020
  thickness: 1.5,
2021
2021
  width: 2,
2022
- color: tr
2022
+ color: nr
2023
2023
  };
2024
2024
  return { data: [i ? {
2025
- ...c,
2025
+ ...u,
2026
2026
  type: "bar",
2027
2027
  orientation: "h",
2028
- marker: { color: u },
2028
+ marker: { color: c },
2029
2029
  error_y: m
2030
2030
  } : {
2031
- ...c,
2031
+ ...u,
2032
2032
  type: "scatter",
2033
2033
  mode: s ? "markers" : l ? "lines" : "lines+markers",
2034
- line: { color: u, width: 2 },
2034
+ line: { color: c, width: 2 },
2035
2035
  marker: { size: 7, color: a },
2036
2036
  error_y: l ? void 0 : m
2037
- }], layout: Ft({
2037
+ }], layout: wt({
2038
2038
  xaxis: { title: t, zeroline: !1 },
2039
2039
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
2040
2040
  barmode: "overlay",
2041
2041
  showlegend: !1,
2042
- template: o !== void 0 ? o : Ce
2042
+ template: o !== void 0 ? o : Oe
2043
2043
  }) };
2044
2044
  }
2045
2045
  function Tt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
2046
2046
  if (!e || !e.length || !n) return { data: [], layout: {} };
2047
2047
  if (t || r === "categorical")
2048
- return ir(e, n, o, i);
2049
- const s = er(n);
2050
- return sr(e, n, r, s, i);
2048
+ return sr(e, n, o, i);
2049
+ const s = tr(n);
2050
+ return lr(e, n, r, s, i);
2051
2051
  }
2052
- function ci(e = [], {
2052
+ function Ni(e = [], {
2053
2053
  fromCol: t = "from",
2054
2054
  toCol: n = "to",
2055
2055
  categoryCol: r = "geology_code",
@@ -2058,18 +2058,18 @@ function ci(e = [], {
2058
2058
  } = {}) {
2059
2059
  const s = [];
2060
2060
  return e.forEach((l) => {
2061
- const u = Number(l == null ? void 0 : l[t]), a = Number(l == null ? void 0 : l[n]), c = l == null ? void 0 : l[r];
2062
- if (!Number.isFinite(u) || !Number.isFinite(a) || a <= u || c == null || `${c}`.trim() === "") return;
2063
- const m = (u + a) / 2;
2061
+ const c = Number(l == null ? void 0 : l[t]), a = Number(l == null ? void 0 : l[n]), u = l == null ? void 0 : l[r];
2062
+ if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c || u == null || `${u}`.trim() === "") return;
2063
+ const m = (c + a) / 2;
2064
2064
  s.push({
2065
2065
  z: m,
2066
- val: `${c}`,
2067
- from: u,
2066
+ val: `${u}`,
2067
+ from: c,
2068
2068
  to: a,
2069
2069
  errorPlus: a - m,
2070
- errorMinus: m - u
2070
+ errorMinus: m - c
2071
2071
  });
2072
- }), s.sort((l, u) => u.z - l.z), Tt({
2072
+ }), s.sort((l, c) => c.z - l.z), Tt({
2073
2073
  points: s,
2074
2074
  isCategorical: !0,
2075
2075
  property: r,
@@ -2078,7 +2078,7 @@ function ci(e = [], {
2078
2078
  template: i
2079
2079
  });
2080
2080
  }
2081
- const wt = [
2081
+ const $t = [
2082
2082
  "#0f172a",
2083
2083
  "#1e3a5f",
2084
2084
  "#7c3aed",
@@ -2089,24 +2089,24 @@ const wt = [
2089
2089
  "#db2777",
2090
2090
  "#65a30d",
2091
2091
  "#9333ea"
2092
- ], lr = { l: 42, r: 4, t: 4, b: 30 }, pt = 10, bt = 12;
2093
- function $t(e = {}) {
2092
+ ], ar = { l: 42, r: 4, t: 4, b: 30 }, bt = 10, yt = 12;
2093
+ function Bt(e = {}) {
2094
2094
  return {
2095
2095
  ...e,
2096
- margin: lr,
2096
+ margin: ar,
2097
2097
  autosize: !0,
2098
2098
  width: void 0,
2099
2099
  xaxis: {
2100
2100
  ...e.xaxis || {},
2101
2101
  tickfont: {
2102
2102
  ...e.xaxis && e.xaxis.tickfont || {},
2103
- size: pt
2103
+ size: bt
2104
2104
  },
2105
2105
  title: {
2106
2106
  ...e.xaxis && e.xaxis.title || {},
2107
2107
  font: {
2108
2108
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
2109
- size: bt
2109
+ size: yt
2110
2110
  }
2111
2111
  }
2112
2112
  },
@@ -2115,63 +2115,63 @@ function $t(e = {}) {
2115
2115
  automargin: !0,
2116
2116
  tickfont: {
2117
2117
  ...e.yaxis && e.yaxis.tickfont || {},
2118
- size: pt
2118
+ size: bt
2119
2119
  },
2120
2120
  title: {
2121
2121
  ...e.yaxis && e.yaxis.title || {},
2122
2122
  font: {
2123
2123
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
2124
- size: bt
2124
+ size: yt
2125
2125
  }
2126
2126
  }
2127
2127
  }
2128
2128
  };
2129
2129
  }
2130
- function ar(e, {
2130
+ function cr(e, {
2131
2131
  tailScale: t = 5,
2132
2132
  colorBy: n = null,
2133
- palette: r = wt,
2133
+ palette: r = $t,
2134
2134
  depthCol: o = W,
2135
- dipCol: i = X,
2136
- azCol: s = q,
2135
+ dipCol: i = q,
2136
+ azCol: s = X,
2137
2137
  template: l = void 0
2138
2138
  } = {}) {
2139
- const u = e.filter(
2139
+ const c = e.filter(
2140
2140
  (b) => b[o] != null && b[i] != null && b[s] != null
2141
2141
  );
2142
- if (!u.length)
2142
+ if (!c.length)
2143
2143
  return { data: [], layout: {} };
2144
2144
  const a = {};
2145
- n && [...new Set(u.map((y) => y[n]).filter((y) => y != null))].sort().forEach((y, p) => {
2146
- a[y] = r[p % r.length];
2145
+ n && [...new Set(c.map((_) => _[n]).filter((_) => _ != null))].sort().forEach((_, p) => {
2146
+ a[_] = r[p % r.length];
2147
2147
  });
2148
- const c = /* @__PURE__ */ new Map(), m = [];
2149
- for (const b of u) {
2150
- const y = Number(b[o]), p = Number(b[i]), g = Number(b[s]), M = n ? b[n] ?? "_default" : "_default", z = n ? a[M] ?? "#0f172a" : "#0f172a";
2151
- c.has(M) || c.set(M, { xs: [], ys: [], dips: [], azs: [], color: z });
2152
- const D = c.get(M);
2153
- D.xs.push(p), D.ys.push(y), D.dips.push(p), D.azs.push(g);
2154
- const x = g * Math.PI / 180, O = t * (Math.abs(p) / 90), $ = Math.sin(x) * O, P = Math.cos(x) * O;
2148
+ const u = /* @__PURE__ */ new Map(), m = [];
2149
+ for (const b of c) {
2150
+ const _ = Number(b[o]), p = Number(b[i]), y = Number(b[s]), M = n ? b[n] ?? "_default" : "_default", z = n ? a[M] ?? "#0f172a" : "#0f172a";
2151
+ u.has(M) || u.set(M, { xs: [], ys: [], dips: [], azs: [], color: z });
2152
+ const O = u.get(M);
2153
+ O.xs.push(p), O.ys.push(_), O.dips.push(p), O.azs.push(y);
2154
+ const k = y * Math.PI / 180, L = t * (Math.abs(p) / 90), $ = Math.sin(k) * L, P = Math.cos(k) * L;
2155
2155
  m.push({
2156
2156
  type: "line",
2157
2157
  x0: p,
2158
- y0: y,
2158
+ y0: _,
2159
2159
  x1: p + $,
2160
- y1: y + P,
2160
+ y1: _ + P,
2161
2161
  line: { color: z, width: 2 }
2162
2162
  });
2163
2163
  }
2164
- const d = [], f = n && c.size > 1;
2165
- for (const [b, y] of c.entries())
2164
+ const d = [], f = n && u.size > 1;
2165
+ for (const [b, _] of u.entries())
2166
2166
  d.push({
2167
2167
  type: "scatter",
2168
- x: y.xs,
2169
- y: y.ys,
2168
+ x: _.xs,
2169
+ y: _.ys,
2170
2170
  mode: "markers",
2171
2171
  name: b !== "_default" ? String(b) : void 0,
2172
- marker: { size: 8, color: y.color },
2172
+ marker: { size: 8, color: _.color },
2173
2173
  showlegend: f && b !== "_default",
2174
- customdata: y.dips.map((p, g) => [p, y.azs[g]]),
2174
+ customdata: _.dips.map((p, y) => [p, _.azs[y]]),
2175
2175
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
2176
2176
  });
2177
2177
  return { data: d, layout: {
@@ -2187,14 +2187,14 @@ function ar(e, {
2187
2187
  },
2188
2188
  yaxis: { title: "Depth (m)", autorange: "reversed" },
2189
2189
  showlegend: !!f,
2190
- template: l !== void 0 ? l : Ce
2190
+ template: l !== void 0 ? l : Oe
2191
2191
  } };
2192
2192
  }
2193
- function ui(e, {
2193
+ function Mi(e, {
2194
2194
  labelCol: t = "structure_type",
2195
- palette: n = wt,
2196
- fromCol: r = L,
2197
- toCol: o = w,
2195
+ palette: n = $t,
2196
+ fromCol: r = S,
2197
+ toCol: o = T,
2198
2198
  template: i = void 0
2199
2199
  } = {}) {
2200
2200
  const s = e.filter((d) => d[r] != null && d[o] != null && Number(d[o]) > Number(d[r])).filter((d) => {
@@ -2205,7 +2205,7 @@ function ui(e, {
2205
2205
  }).map((d) => ({ from: Number(d[r]), to: Number(d[o]), label: String(d[t]).trim() })).sort((d, f) => d.from - f.from);
2206
2206
  if (!s.length)
2207
2207
  return { data: [], layout: {} };
2208
- const l = [], u = [], a = [];
2208
+ const l = [], c = [], a = [];
2209
2209
  return s.forEach((d, f) => {
2210
2210
  l.push({
2211
2211
  type: "rect",
@@ -2218,23 +2218,23 @@ function ui(e, {
2218
2218
  fillcolor: n[f % n.length],
2219
2219
  line: { width: 0 },
2220
2220
  layer: "below"
2221
- }), u.push(0.5 * (d.from + d.to)), a.push(d.label);
2221
+ }), c.push(0.5 * (d.from + d.to)), a.push(d.label);
2222
2222
  }), { data: [{
2223
2223
  type: "scatter",
2224
2224
  x: Array(a.length).fill(0.5),
2225
- y: u,
2225
+ y: c,
2226
2226
  mode: "text",
2227
2227
  text: a,
2228
2228
  textposition: "middle center",
2229
2229
  showlegend: !1,
2230
2230
  hoverinfo: "text"
2231
- }], layout: $t({
2231
+ }], layout: Bt({
2232
2232
  shapes: l,
2233
2233
  height: 400,
2234
2234
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
2235
2235
  yaxis: { title: "Depth (m)", autorange: "reversed" },
2236
2236
  showlegend: !1,
2237
- template: i !== void 0 ? i : Ce
2237
+ template: i !== void 0 ? i : Oe
2238
2238
  }) };
2239
2239
  }
2240
2240
  function gt(e, t) {
@@ -2245,26 +2245,26 @@ function gt(e, t) {
2245
2245
  o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
2246
2246
  return o && r.push(o), r.join("<br>");
2247
2247
  }
2248
- function cr(e, {
2248
+ function ur(e, {
2249
2249
  commentCol: t = "comments",
2250
- fromCol: n = L,
2251
- toCol: r = w,
2250
+ fromCol: n = S,
2251
+ toCol: r = T,
2252
2252
  bgColor: o = "#f1f5f9",
2253
2253
  borderColor: i = "#cbd5e1",
2254
2254
  textColor: s = "#1e293b",
2255
2255
  charsPerLine: l = 18,
2256
- template: u = void 0
2256
+ template: c = void 0
2257
2257
  } = {}) {
2258
2258
  const a = e.filter((p) => p[n] != null && p[r] != null && Number(p[r]) > Number(p[n])).map((p) => {
2259
- const g = p[t], M = g != null && String(g).trim() !== "" && String(g) !== "null" ? String(g).trim() : "";
2259
+ const y = p[t], M = y != null && String(y).trim() !== "" && String(y) !== "null" ? String(y).trim() : "";
2260
2260
  return { from: Number(p[n]), to: Number(p[r]), comment: M };
2261
- }).sort((p, g) => p.from - g.from);
2261
+ }).sort((p, y) => p.from - y.from);
2262
2262
  if (!a.length)
2263
2263
  return { data: [], layout: {} };
2264
- const c = [], m = [], d = [], f = [], h = [];
2264
+ const u = [], m = [], d = [], f = [], h = [];
2265
2265
  for (const p of a) {
2266
- const g = 0.5 * (p.from + p.to), M = !!p.comment;
2267
- c.push({
2266
+ const y = 0.5 * (p.from + p.to), M = !!p.comment;
2267
+ u.push({
2268
2268
  type: "rect",
2269
2269
  xref: "x",
2270
2270
  yref: "y",
@@ -2275,7 +2275,7 @@ function cr(e, {
2275
2275
  fillcolor: M ? o : "rgba(0,0,0,0)",
2276
2276
  line: { color: i, width: 1 },
2277
2277
  layer: "below"
2278
- }), M && (m.push(0.5), d.push(g), f.push(gt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${gt(p.comment, 40)}`));
2278
+ }), M && (m.push(0.5), d.push(y), f.push(gt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${gt(p.comment, 40)}`));
2279
2279
  }
2280
2280
  return { data: m.length ? [{
2281
2281
  type: "scatter",
@@ -2288,25 +2288,25 @@ function cr(e, {
2288
2288
  hovertext: h,
2289
2289
  hoverinfo: "text",
2290
2290
  showlegend: !1
2291
- }] : [], layout: $t({
2292
- shapes: c,
2291
+ }] : [], layout: Bt({
2292
+ shapes: u,
2293
2293
  height: 400,
2294
2294
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
2295
2295
  yaxis: { title: "Depth (m)", autorange: "reversed" },
2296
2296
  showlegend: !1,
2297
- template: u !== void 0 ? u : Ce
2297
+ template: c !== void 0 ? c : Oe
2298
2298
  }) };
2299
2299
  }
2300
- function di(e, {
2300
+ function zi(e, {
2301
2301
  symbolSize: t = 10,
2302
2302
  xCol: n = "easting",
2303
2303
  yCol: r = "northing"
2304
2304
  } = {}) {
2305
- const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[X] != null ? Number(e[X]) : null, l = e[q] != null ? Number(e[q]) : null;
2305
+ const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[q] != null ? Number(e[q]) : null, l = e[X] != null ? Number(e[X]) : null;
2306
2306
  if (o === null || i === null || s === null || l === null) return null;
2307
- const u = (l - 90 + 360) % 360, a = u * Math.PI / 180, c = l * Math.PI / 180, m = t * Math.sin(a), d = t * Math.cos(a), f = t * 0.4 * (s / 90), h = f * Math.sin(c), b = f * Math.cos(c);
2307
+ const c = (l - 90 + 360) % 360, a = c * Math.PI / 180, u = l * Math.PI / 180, m = t * Math.sin(a), d = t * Math.cos(a), f = t * 0.4 * (s / 90), h = f * Math.sin(u), b = f * Math.cos(u);
2308
2308
  return {
2309
- strike: u,
2309
+ strike: c,
2310
2310
  dipValue: s,
2311
2311
  x: o,
2312
2312
  y: i,
@@ -2318,106 +2318,106 @@ function di(e, {
2318
2318
  tickY1: i + b
2319
2319
  };
2320
2320
  }
2321
- const Bt = "markers+line";
2322
- function ur(e, t) {
2321
+ const Rt = "markers+line";
2322
+ function dr(e, t) {
2323
2323
  var r;
2324
2324
  const n = et(e);
2325
- return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Bt;
2325
+ return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Rt;
2326
2326
  }
2327
- function mi({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
2328
- const s = Le(null), l = t == null ? void 0 : t.hole, u = (t == null ? void 0 : t.points) || [], a = (e == null ? void 0 : e.property) || "", c = (e == null ? void 0 : e.chartType) || Bt, m = (e == null ? void 0 : e.holeId) || "", d = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? xe : t != null && t.isCategorical ? Oe : ve), f = et(d), h = ur(d, c), [b, y] = Q("");
2327
+ function vi({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
2328
+ const s = Se(null), l = t == null ? void 0 : t.hole, c = (t == null ? void 0 : t.points) || [], a = (e == null ? void 0 : e.property) || "", u = (e == null ? void 0 : e.chartType) || Rt, m = (e == null ? void 0 : e.holeId) || "", d = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? ke : t != null && t.isCategorical ? Le : Ae), f = et(d), h = dr(d, u), [b, _] = Q("");
2329
2329
  return se(() => {
2330
- const p = d === xe, g = d === Je;
2331
- if (!l || !a || !p && !g && u.length === 0) return;
2330
+ const p = d === ke, y = d === Je;
2331
+ if (!l || !a || !p && !y && c.length === 0) return;
2332
2332
  const M = s.current;
2333
2333
  if (!M) return;
2334
2334
  let z;
2335
2335
  try {
2336
- p ? z = cr(u, { commentCol: a, fromCol: "from", toCol: "to" }) : g ? z = ar(u) : z = Tt({
2337
- points: u,
2338
- isCategorical: d === Oe,
2336
+ p ? z = ur(c, { commentCol: a, fromCol: "from", toCol: "to" }) : y ? z = cr(c) : z = Tt({
2337
+ points: c,
2338
+ isCategorical: d === Le,
2339
2339
  property: a,
2340
2340
  chartType: h,
2341
2341
  template: i
2342
2342
  });
2343
- } catch (x) {
2344
- console.error("Plot build error", x), y((x == null ? void 0 : x.message) || "Plot build error");
2343
+ } catch (k) {
2344
+ console.error("Plot build error", k), _((k == null ? void 0 : k.message) || "Plot build error");
2345
2345
  return;
2346
2346
  }
2347
2347
  if ((!(z != null && z.data) || z.data.length === 0) && !p)
2348
2348
  return;
2349
- const D = {
2349
+ const O = {
2350
2350
  displayModeBar: !0,
2351
2351
  responsive: !0,
2352
2352
  useResizeHandler: !0,
2353
2353
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
2354
2354
  };
2355
2355
  try {
2356
- y(""), Fe.react(M, z.data, z.layout, D), requestAnimationFrame(() => {
2356
+ _(""), Fe.react(M, z.data, z.layout, O), requestAnimationFrame(() => {
2357
2357
  M && M.parentElement && Fe.Plots.resize(M);
2358
2358
  });
2359
- } catch (x) {
2360
- console.error("Plot render error", x), y((x == null ? void 0 : x.message) || "Plot render error");
2359
+ } catch (k) {
2360
+ console.error("Plot render error", k), _((k == null ? void 0 : k.message) || "Plot render error");
2361
2361
  }
2362
2362
  return () => {
2363
2363
  if (M)
2364
2364
  try {
2365
2365
  Fe.purge(M);
2366
- } catch (x) {
2367
- console.warn("Plot purge error", x);
2366
+ } catch (k) {
2367
+ console.warn("Plot purge error", k);
2368
2368
  }
2369
2369
  };
2370
- }, [l, a, h, d, u, i]), se(() => {
2370
+ }, [l, a, h, d, c, i]), se(() => {
2371
2371
  const p = s.current;
2372
2372
  if (!p || typeof ResizeObserver > "u") return;
2373
- const g = new ResizeObserver(() => {
2373
+ const y = new ResizeObserver(() => {
2374
2374
  try {
2375
2375
  p && p.data && Fe.Plots.resize(p);
2376
2376
  } catch (M) {
2377
2377
  console.warn("Plot resize error", M);
2378
2378
  }
2379
2379
  });
2380
- return g.observe(p), () => g.disconnect();
2381
- }, []), !l || !a ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== xe && d !== Je && u.length === 0 ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: "No data" }) }) : b ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ J("div", { className: "placeholder", children: [
2380
+ return y.observe(p), () => y.disconnect();
2381
+ }, []), !l || !a ? /* @__PURE__ */ D("div", { className: "plot-card empty", children: /* @__PURE__ */ D("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== ke && d !== Je && c.length === 0 ? /* @__PURE__ */ D("div", { className: "plot-card empty", children: /* @__PURE__ */ D("div", { className: "placeholder", children: "No data" }) }) : b ? /* @__PURE__ */ D("div", { className: "plot-card empty", children: /* @__PURE__ */ J("div", { className: "placeholder", children: [
2382
2382
  "Plot error: ",
2383
2383
  b
2384
2384
  ] }) }) : /* @__PURE__ */ J("div", { className: "plot-card", children: [
2385
- /* @__PURE__ */ S("div", { className: "plot-title", children: /* @__PURE__ */ S(
2385
+ /* @__PURE__ */ D("div", { className: "plot-title", children: /* @__PURE__ */ D(
2386
2386
  "select",
2387
2387
  {
2388
2388
  className: "plot-select",
2389
2389
  value: m,
2390
2390
  onChange: (p) => o && o({ holeId: p.target.value }),
2391
2391
  children: n.map((p) => {
2392
- const g = typeof p == "string" ? p : p.holeId, M = typeof p == "string" ? p : p.label || p.holeId;
2393
- return /* @__PURE__ */ S("option", { value: g, children: M }, g);
2392
+ const y = typeof p == "string" ? p : p.holeId, M = typeof p == "string" ? p : p.label || p.holeId;
2393
+ return /* @__PURE__ */ D("option", { value: y, children: M }, y);
2394
2394
  })
2395
2395
  }
2396
2396
  ) }),
2397
2397
  /* @__PURE__ */ J("div", { className: "plot-controls column", children: [
2398
- r.length > 0 && /* @__PURE__ */ S(
2398
+ r.length > 0 && /* @__PURE__ */ D(
2399
2399
  "select",
2400
2400
  {
2401
2401
  className: "plot-select",
2402
2402
  value: a,
2403
2403
  onChange: (p) => o && o({ property: p.target.value }),
2404
- children: r.map((p) => /* @__PURE__ */ S("option", { value: p, children: p }, p))
2404
+ children: r.map((p) => /* @__PURE__ */ D("option", { value: p, children: p }, p))
2405
2405
  }
2406
2406
  ),
2407
- f.length > 1 && /* @__PURE__ */ S(
2407
+ f.length > 1 && /* @__PURE__ */ D(
2408
2408
  "select",
2409
2409
  {
2410
2410
  className: "plot-select",
2411
2411
  value: h,
2412
2412
  onChange: (p) => o && o({ chartType: p.target.value }),
2413
- children: f.map((p) => /* @__PURE__ */ S("option", { value: p.value, children: p.label }, p.value))
2413
+ children: f.map((p) => /* @__PURE__ */ D("option", { value: p.value, children: p.label }, p.value))
2414
2414
  }
2415
2415
  )
2416
2416
  ] }),
2417
- /* @__PURE__ */ S("div", { className: "plotly-chart", ref: s })
2417
+ /* @__PURE__ */ D("div", { className: "plotly-chart", ref: s })
2418
2418
  ] });
2419
2419
  }
2420
- function yt(e, t) {
2420
+ function _t(e, t) {
2421
2421
  if (!(t != null && t.length)) return e;
2422
2422
  const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
2423
2423
  for (const r of t) {
@@ -2431,7 +2431,7 @@ function yt(e, t) {
2431
2431
  }
2432
2432
  return Array.from(n.values());
2433
2433
  }
2434
- function dr(e, t) {
2434
+ function mr(e, t) {
2435
2435
  if (!e || !t) return [];
2436
2436
  const n = /* @__PURE__ */ new Set(), r = [];
2437
2437
  for (const o of e.points || []) {
@@ -2442,69 +2442,69 @@ function dr(e, t) {
2442
2442
  }
2443
2443
  return r;
2444
2444
  }
2445
- function fi({
2445
+ function Ei({
2446
2446
  initialFocusedHoleId: e = "",
2447
2447
  sourceFile: t = null,
2448
2448
  extraHoles: n = [],
2449
2449
  plotCount: r = 4
2450
2450
  } = {}) {
2451
- const [o, i] = Q([]), [s, l] = Q([]), [u, a] = Q([]), [c, m] = Q([]), [d, f] = Q([]), [h, b] = Q({}), [y, p] = Q(""), [g, M] = Q([]), [z, D] = Q(""), [x, O] = Q(e || ""), [$, P] = Q([]), E = Le(null);
2451
+ const [o, i] = Q([]), [s, l] = Q([]), [c, a] = Q([]), [u, m] = Q([]), [d, f] = Q([]), [h, b] = Q({}), [_, p] = Q(""), [y, M] = Q([]), [z, O] = Q(""), [k, L] = Q(e || ""), [$, P] = Q([]), v = Se(null);
2452
2452
  se(() => {
2453
- !t || E.current === t || (E.current = t, En(t).then((v) => {
2454
- if (!v) return;
2455
- const k = Array.from(new Map(v.map((N) => [N.holeId, N])).values());
2456
- l(k), M(Dt({
2457
- holeIds: k.map((N) => N.holeId),
2458
- focusedHoleId: x,
2453
+ !t || v.current === t || (v.current = t, En(t).then((A) => {
2454
+ if (!A) return;
2455
+ const E = Array.from(new Map(A.map((N) => [N.holeId, N])).values());
2456
+ l(E), M(Dt({
2457
+ holeIds: E.map((N) => N.holeId),
2458
+ focusedHoleId: k,
2459
2459
  plotCount: r,
2460
2460
  defaultProp: "",
2461
- categoricalProps: c,
2461
+ categoricalProps: u,
2462
2462
  commentProps: d,
2463
2463
  numericDefaultChartType: "markers+line"
2464
2464
  }));
2465
- }).catch((v) => {
2466
- console.info("Assay metadata load skipped:", v.message);
2465
+ }).catch((A) => {
2466
+ console.info("Assay metadata load skipped:", A.message);
2467
2467
  }));
2468
- }, [t, x, r, c, d]), se(() => {
2468
+ }, [t, k, r, u, d]), se(() => {
2469
2469
  if (!(n != null && n.length)) return;
2470
- const v = n.map((k) => ({ holeId: k.id || k.holeId })).filter((k) => k.holeId);
2471
- l((k) => {
2472
- const N = new Set(k.map((I) => I.holeId)), B = v.filter((I) => !N.has(I.holeId));
2473
- return B.length ? [...k, ...B] : k;
2470
+ const A = n.map((E) => ({ holeId: E.id || E.holeId })).filter((E) => E.holeId);
2471
+ l((E) => {
2472
+ const N = new Set(E.map((I) => I.holeId)), B = A.filter((I) => !N.has(I.holeId));
2473
+ return B.length ? [...E, ...B] : E;
2474
2474
  });
2475
2475
  }, [n]), se(() => {
2476
- D((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
2477
- }, [g]), se(() => {
2476
+ O((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
2477
+ }, [y]), se(() => {
2478
2478
  if (!s.length) {
2479
2479
  M([]);
2480
2480
  return;
2481
2481
  }
2482
- const v = Ct(s.map((k) => k.holeId), x);
2483
- M((k) => Array.from({ length: r }).map((B, I) => {
2482
+ const A = Ct(s.map((E) => E.holeId), k);
2483
+ M((E) => Array.from({ length: r }).map((B, I) => {
2484
2484
  var K;
2485
- const G = k[I] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : v[I] || ((K = s[I]) == null ? void 0 : K.holeId) || "", j = G.property || y, Z = we({
2485
+ const G = E[I] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : A[I] || ((K = s[I]) == null ? void 0 : K.holeId) || "", j = G.property || _, Z = Te({
2486
2486
  property: j,
2487
2487
  chartType: G.chartType,
2488
- categoricalProps: c,
2488
+ categoricalProps: u,
2489
2489
  commentProps: d,
2490
2490
  numericDefaultChartType: "markers+line"
2491
2491
  });
2492
2492
  return { holeId: U, property: j, chartType: Z };
2493
2493
  }));
2494
- }, [s, x, y, c, d, r]), se(() => {
2494
+ }, [s, k, _, u, d, r]), se(() => {
2495
2495
  if (!t) return;
2496
- g.map((k) => k.holeId).filter(Boolean).forEach((k) => {
2497
- const N = o.some((I) => (I.id || I.holeId) === k), B = $.includes(k);
2498
- N || B || (P((I) => [...I, k]), kn(t, k).then((I) => {
2499
- P((G) => G.filter((U) => U !== k)), I && i((G) => {
2500
- const U = yt(
2501
- [...G.filter((Z) => (Z.id || Z.holeId) !== k), I],
2496
+ y.map((E) => E.holeId).filter(Boolean).forEach((E) => {
2497
+ const N = o.some((I) => (I.id || I.holeId) === E), B = $.includes(E);
2498
+ N || B || (P((I) => [...I, E]), xn(t, E).then((I) => {
2499
+ P((G) => G.filter((U) => U !== E)), I && i((G) => {
2500
+ const U = _t(
2501
+ [...G.filter((Z) => (Z.id || Z.holeId) !== E), I],
2502
2502
  n
2503
2503
  ), j = Be(U);
2504
- return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), b(j.columnMeta), !y && j.defaultProp && (p(j.defaultProp), M((Z) => Z.map((K) => ({
2504
+ return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), b(j.columnMeta), !_ && j.defaultProp && (p(j.defaultProp), M((Z) => Z.map((K) => ({
2505
2505
  ...K,
2506
2506
  property: K.property || j.defaultProp,
2507
- chartType: we({
2507
+ chartType: Te({
2508
2508
  property: K.property || j.defaultProp,
2509
2509
  chartType: K.chartType,
2510
2510
  categoricalProps: j.categoricalProps,
@@ -2514,74 +2514,74 @@ function fi({
2514
2514
  })))), U;
2515
2515
  });
2516
2516
  }).catch((I) => {
2517
- console.error(I), P((G) => G.filter((U) => U !== k)), D(I.message || `Error loading hole ${k}`);
2517
+ console.error(I), P((G) => G.filter((U) => U !== E)), O(I.message || `Error loading hole ${E}`);
2518
2518
  }));
2519
2519
  });
2520
- }, [g, t, o, $, y, n]), se(() => {
2521
- n != null && n.length && i((v) => {
2522
- if (!v.length) {
2520
+ }, [y, t, o, $, _, n]), se(() => {
2521
+ n != null && n.length && i((A) => {
2522
+ if (!A.length) {
2523
2523
  const B = Be(n);
2524
- return a(B.numericProps), m(B.categoricalProps), f(B.commentProps), b(B.columnMeta), !y && B.defaultProp && p(B.defaultProp), n;
2524
+ return a(B.numericProps), m(B.categoricalProps), f(B.commentProps), b(B.columnMeta), !_ && B.defaultProp && p(B.defaultProp), n;
2525
2525
  }
2526
- const k = yt(v, n), N = Be(k);
2527
- return a(N.numericProps), m(N.categoricalProps), f(N.commentProps), b(N.columnMeta), !y && N.defaultProp && p(N.defaultProp), k;
2526
+ const E = _t(A, n), N = Be(E);
2527
+ return a(N.numericProps), m(N.categoricalProps), f(N.commentProps), b(N.columnMeta), !_ && N.defaultProp && p(N.defaultProp), E;
2528
2528
  });
2529
2529
  }, [n]);
2530
2530
  const F = ne(
2531
- () => [...u, ...c, ...d],
2532
- [u, c, d]
2531
+ () => [...c, ...u, ...d],
2532
+ [c, u, d]
2533
2533
  ), C = ne(
2534
- () => s.map((v) => ({ holeId: v.holeId, label: v.holeId })).sort((v, k) => v.label.localeCompare(k.label)),
2534
+ () => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, E) => A.label.localeCompare(E.label)),
2535
2535
  [s]
2536
- ), H = ne(() => {
2537
- const v = [...u, ...c, ...d];
2538
- return Array.from({ length: r }).map((k, N) => {
2539
- const B = g[N] || {}, I = o.find((he) => (he.id || he.holeId) === B.holeId) || null, G = I ? v.filter((he) => rr(I, he)) : v;
2540
- let U = B.property || y;
2536
+ ), V = ne(() => {
2537
+ const A = [...c, ...u, ...d];
2538
+ return Array.from({ length: r }).map((E, N) => {
2539
+ const B = y[N] || {}, I = o.find((he) => (he.id || he.holeId) === B.holeId) || null, G = I ? A.filter((he) => or(I, he)) : A;
2540
+ let U = B.property || _;
2541
2541
  I && !G.includes(U) && (U = G[0] || U);
2542
- const j = d.includes(U), Z = !j && c.includes(U), K = !j && !Z && U === "dip", le = j ? "comment" : K ? "tadpole" : Z ? "categorical" : "numeric", ye = K ? "tadpole" : B.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), fe = B.holeId || (I == null ? void 0 : I.id) || (I == null ? void 0 : I.holeId) || "", De = K ? (I == null ? void 0 : I.points) || [] : j ? dr(I, U) : or(I, U, Z);
2542
+ const j = d.includes(U), Z = !j && u.includes(U), K = !j && !Z && U === "dip", le = j ? "comment" : K ? "tadpole" : Z ? "categorical" : "numeric", ge = K ? "tadpole" : B.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), fe = B.holeId || (I == null ? void 0 : I.id) || (I == null ? void 0 : I.holeId) || "", Ce = K ? (I == null ? void 0 : I.points) || [] : j ? mr(I, U) : ir(I, U, Z);
2543
2543
  return {
2544
- config: { holeId: fe, property: U, chartType: ye },
2544
+ config: { holeId: fe, property: U, chartType: ge },
2545
2545
  hole: I,
2546
2546
  loading: $.includes(B.holeId),
2547
2547
  isCategorical: Z,
2548
2548
  isComment: j,
2549
2549
  isTadpole: K,
2550
2550
  displayType: le,
2551
- points: De,
2551
+ points: Ce,
2552
2552
  propertyOptions: G,
2553
2553
  label: fe
2554
2554
  };
2555
2555
  });
2556
- }, [g, o, y, c, d, $, r, u]), R = (v, k) => {
2556
+ }, [y, o, _, u, d, $, r, c]), H = (A, E) => {
2557
2557
  M((N) => {
2558
- const B = [...N], G = { ...B[v] || {}, ...k };
2559
- return k.property && (G.chartType = we({
2560
- property: k.property,
2558
+ const B = [...N], G = { ...B[A] || {}, ...E };
2559
+ return E.property && (G.chartType = Te({
2560
+ property: E.property,
2561
2561
  chartType: G.chartType,
2562
- categoricalProps: c,
2562
+ categoricalProps: u,
2563
2563
  commentProps: d,
2564
2564
  numericDefaultChartType: "markers+line"
2565
- })), B[v] = G, B;
2565
+ })), B[A] = G, B;
2566
2566
  });
2567
2567
  };
2568
2568
  return {
2569
2569
  error: z,
2570
- focusedHoleId: x,
2571
- setFocusedHoleId: O,
2572
- setError: D,
2570
+ focusedHoleId: k,
2571
+ setFocusedHoleId: L,
2572
+ setError: O,
2573
2573
  holeCount: s.length,
2574
- numericProps: u,
2575
- categoricalProps: c,
2574
+ numericProps: c,
2575
+ categoricalProps: u,
2576
2576
  commentProps: d,
2577
2577
  columnMeta: h,
2578
2578
  propertyOptions: F,
2579
2579
  labeledHoleOptions: C,
2580
- traceGraphs: H,
2581
- handleConfigChange: R
2580
+ traceGraphs: V,
2581
+ handleConfigChange: H
2582
2582
  };
2583
2583
  }
2584
- const mr = [
2584
+ const fr = [
2585
2585
  "#313695",
2586
2586
  "#4575b4",
2587
2587
  "#74add1",
@@ -2593,7 +2593,7 @@ const mr = [
2593
2593
  "#d73027",
2594
2594
  "#a50026"
2595
2595
  ];
2596
- function fr(e = [], t = mr) {
2596
+ function hr(e = [], t = fr) {
2597
2597
  const n = e.filter((a) => Number.isFinite(a));
2598
2598
  if (!n.length)
2599
2599
  return {
@@ -2603,9 +2603,9 @@ function fr(e = [], t = mr) {
2603
2603
  bins: [],
2604
2604
  colors: t
2605
2605
  };
2606
- const r = n.slice().sort((a, c) => a - c), o = r[0], i = r[r.length - 1], s = t.length;
2606
+ const r = n.slice().sort((a, u) => a - u), o = r[0], i = r[r.length - 1], s = t.length;
2607
2607
  if (i === o) {
2608
- const a = t.map((c, m) => ({
2608
+ const a = t.map((u, m) => ({
2609
2609
  index: m,
2610
2610
  min: o,
2611
2611
  max: i,
@@ -2619,24 +2619,24 @@ function fr(e = [], t = mr) {
2619
2619
  colors: t
2620
2620
  };
2621
2621
  }
2622
- const l = t.map((a, c) => {
2623
- const m = c / s, d = (c + 1) / s, f = Math.floor(m * r.length), h = Math.min(r.length - 1, Math.floor(d * r.length)), b = r[f], y = c === s - 1 ? i : r[h];
2622
+ const l = t.map((a, u) => {
2623
+ const m = u / s, d = (u + 1) / s, f = Math.floor(m * r.length), h = Math.min(r.length - 1, Math.floor(d * r.length)), b = r[f], _ = u === s - 1 ? i : r[h];
2624
2624
  return {
2625
- index: c,
2625
+ index: u,
2626
2626
  min: b,
2627
- max: y,
2628
- label: hr(b, y)
2627
+ max: _,
2628
+ label: pr(b, _)
2629
2629
  };
2630
- }), u = (i - o) / s;
2630
+ }), c = (i - o) / s;
2631
2631
  return {
2632
2632
  min: o,
2633
2633
  max: i,
2634
- step: u,
2634
+ step: c,
2635
2635
  bins: l,
2636
2636
  colors: t
2637
2637
  };
2638
2638
  }
2639
- function hr(e, t) {
2639
+ function pr(e, t) {
2640
2640
  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";
2641
2641
  return `${n(e)} – ${n(t)}`;
2642
2642
  }
@@ -2652,43 +2652,43 @@ function Vt(e, t) {
2652
2652
  }
2653
2653
  return -1;
2654
2654
  }
2655
- function pr(e, t, n = "#8b1e3f") {
2655
+ function br(e, t, n = "#8b1e3f") {
2656
2656
  const r = Vt(e, t);
2657
2657
  return r < 0 ? n : t.colors[r] || n;
2658
2658
  }
2659
2659
  function Ht(e) {
2660
2660
  return Array.isArray(e) ? e : [];
2661
2661
  }
2662
- function Xe(e) {
2662
+ function qe(e) {
2663
2663
  const t = Number(e);
2664
2664
  return Number.isFinite(t) ? t : void 0;
2665
2665
  }
2666
- function Rt(e = {}) {
2666
+ function jt(e = {}) {
2667
2667
  return {
2668
2668
  ...e,
2669
- x: Xe(e.x),
2670
- y: Xe(e.y),
2671
- z: Xe(e.z)
2669
+ x: qe(e.x),
2670
+ y: qe(e.y),
2671
+ z: qe(e.z)
2672
2672
  };
2673
2673
  }
2674
- function br(e = [], t = [0, 0], n = 0) {
2674
+ function yr(e = [], t = [0, 0], n = 0) {
2675
2675
  const [r, o] = t, i = Number(n) * Math.PI / 180, s = Math.cos(i), l = Math.sin(i);
2676
- return Ht(e).map(Rt).map((u) => {
2677
- if (!Number.isFinite(u.x) || !Number.isFinite(u.y)) return { ...u };
2678
- const a = u.x - r, c = u.y - o;
2676
+ return Ht(e).map(jt).map((c) => {
2677
+ if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
2678
+ const a = c.x - r, u = c.y - o;
2679
2679
  return {
2680
- ...u,
2681
- along: a * l + c * s,
2682
- across: a * s - c * l
2680
+ ...c,
2681
+ along: a * l + u * s,
2682
+ across: a * s - u * l
2683
2683
  };
2684
2684
  });
2685
2685
  }
2686
2686
  function gr(e = [], t = [0, 0], n = 0, r = 50) {
2687
- const o = br(e, t, n), i = 0.5 * Number(r || 0);
2687
+ const o = yr(e, t, n), i = 0.5 * Number(r || 0);
2688
2688
  return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
2689
2689
  }
2690
- function hi(e = [], t = null, n = null) {
2691
- let r = Ht(e).map(Rt);
2690
+ function xi(e = [], t = null, n = null) {
2691
+ let r = Ht(e).map(jt);
2692
2692
  if (Array.isArray(t) && t.length === 2) {
2693
2693
  const [o, i] = t;
2694
2694
  r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
@@ -2698,7 +2698,7 @@ function hi(e = [], t = null, n = null) {
2698
2698
  color_value: o == null ? void 0 : o[n]
2699
2699
  }))), r;
2700
2700
  }
2701
- function pi(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2701
+ function ki(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2702
2702
  let i = gr(e, t, n, r);
2703
2703
  return o && (i = i.map((s) => ({
2704
2704
  ...s,
@@ -2715,7 +2715,7 @@ function Ne(e, t = void 0) {
2715
2715
  const n = Number(e);
2716
2716
  return Number.isFinite(n) ? n : t;
2717
2717
  }
2718
- function bi(e = [], t = null) {
2718
+ function Ai(e = [], t = null) {
2719
2719
  const n = /* @__PURE__ */ new Map();
2720
2720
  rt(e).forEach((o) => {
2721
2721
  const i = ot(o);
@@ -2725,17 +2725,17 @@ function bi(e = [], t = null) {
2725
2725
  });
2726
2726
  const r = [];
2727
2727
  return n.forEach((o, i) => {
2728
- const s = [...o].sort((u, a) => Ne(u.md, 0) - Ne(a.md, 0)), l = {
2728
+ const s = [...o].sort((c, a) => Ne(c.md, 0) - Ne(a.md, 0)), l = {
2729
2729
  hole_id: i,
2730
- x: s.map((u) => Ne(u.x, 0)),
2731
- y: s.map((u) => Ne(u.y, 0)),
2732
- z: s.map((u) => Ne(u.z, 0)),
2730
+ x: s.map((c) => Ne(c.x, 0)),
2731
+ y: s.map((c) => Ne(c.y, 0)),
2732
+ z: s.map((c) => Ne(c.z, 0)),
2733
2733
  color: null
2734
2734
  };
2735
- t && (l.color = s.map((u) => u == null ? void 0 : u[t])), r.push(l);
2735
+ t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
2736
2736
  }), r;
2737
2737
  }
2738
- function gi(e = [], t = 1, n = null) {
2738
+ function Ii(e = [], t = 1, n = null) {
2739
2739
  return rt(e).map((r) => ({
2740
2740
  hole_id: ot(r),
2741
2741
  from: r == null ? void 0 : r.from,
@@ -2745,7 +2745,7 @@ function gi(e = [], t = 1, n = null) {
2745
2745
  value: n ? r == null ? void 0 : r[n] : null
2746
2746
  }));
2747
2747
  }
2748
- function yi(e = [], t = null) {
2748
+ function Oi(e = [], t = null) {
2749
2749
  return t ? rt(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
2750
2750
  hole_id: ot(n),
2751
2751
  label: n == null ? void 0 : n[t],
@@ -2759,7 +2759,7 @@ function Me(e) {
2759
2759
  ...e.structuralMeshes
2760
2760
  ];
2761
2761
  }
2762
- const yr = {
2762
+ const _r = {
2763
2763
  bedding: "#2563eb",
2764
2764
  foliation: "#16a34a",
2765
2765
  joint: "#9333ea",
@@ -2768,13 +2768,13 @@ const yr = {
2768
2768
  "shear zone": "#0ea5e9",
2769
2769
  "fault zone": "#ef4444"
2770
2770
  };
2771
- function _r(e, t) {
2772
- const n = t || yr, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2773
- return new _.Color(o).getHex();
2774
- }
2775
2771
  function Nr(e, t) {
2772
+ const n = t || _r, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2773
+ return new g.Color(o).getHex();
2774
+ }
2775
+ function Mr(e, t) {
2776
2776
  const n = e * Math.PI / 180, r = t * Math.PI / 180;
2777
- return new _.Vector3(
2777
+ return new g.Vector3(
2778
2778
  Math.sin(r) * Math.sin(n),
2779
2779
  // East component
2780
2780
  Math.cos(r) * Math.sin(n),
@@ -2783,32 +2783,32 @@ function Nr(e, t) {
2783
2783
  // Up component
2784
2784
  ).normalize();
2785
2785
  }
2786
- function Mr(e, t = {}) {
2786
+ function zr(e, t = {}) {
2787
2787
  const {
2788
2788
  radius: n = 5,
2789
2789
  discThickness: r = 0.2,
2790
2790
  opacity: o = 0.7,
2791
2791
  segments: i = 32,
2792
2792
  colorMap: s = null
2793
- } = t, l = new _.Group(), u = new _.Vector3(0, 1, 0);
2793
+ } = t, l = new g.Group(), c = new g.Vector3(0, 1, 0);
2794
2794
  for (const a of e) {
2795
- const c = a.x != null ? a.x : a.easting != null ? a.easting : null, m = a.y != null ? a.y : a.northing != null ? a.northing : null, d = a.z != null ? a.z : a.elevation != null ? a.elevation : null;
2796
- if (c == null || m == null || d == null || !Number.isFinite(c) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
2797
- const f = a[X] != null ? Number(a[X]) : null, h = a[q] != null ? Number(a[q]) : null;
2795
+ const u = a.x != null ? a.x : a.easting != null ? a.easting : null, m = a.y != null ? a.y : a.northing != null ? a.northing : null, d = a.z != null ? a.z : a.elevation != null ? a.elevation : null;
2796
+ if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
2797
+ const f = a[q] != null ? Number(a[q]) : null, h = a[X] != null ? Number(a[X]) : null;
2798
2798
  let b;
2799
2799
  if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
2800
- b = new _.Vector3(a.nx, a.ny, a.nz).normalize();
2800
+ b = new g.Vector3(a.nx, a.ny, a.nz).normalize();
2801
2801
  else {
2802
2802
  if (f == null || h == null || !Number.isFinite(f) || !Number.isFinite(h)) continue;
2803
- b = Nr(f, h);
2803
+ b = Mr(f, h);
2804
2804
  }
2805
- const y = new _.CylinderGeometry(n, n, r, i, 1, !1), p = new _.MeshStandardMaterial({
2806
- color: _r(a.structure_type, s),
2805
+ const _ = new g.CylinderGeometry(n, n, r, i, 1, !1), p = new g.MeshStandardMaterial({
2806
+ color: Nr(a.structure_type, s),
2807
2807
  transparent: !0,
2808
2808
  opacity: o,
2809
- side: _.DoubleSide
2810
- }), g = new _.Mesh(y, p);
2811
- g.position.set(c, m, d), g.quaternion.setFromUnitVectors(u, b), g.userData = {
2809
+ side: g.DoubleSide
2810
+ }), y = new g.Mesh(_, p);
2811
+ y.position.set(u, m, d), y.quaternion.setFromUnitVectors(c, b), y.userData = {
2812
2812
  type: "structure",
2813
2813
  hole_id: a.hole_id,
2814
2814
  depth: a.depth ?? a.mid,
@@ -2816,26 +2816,26 @@ function Mr(e, t = {}) {
2816
2816
  dip: f,
2817
2817
  azimuth: h,
2818
2818
  comments: a.comments
2819
- }, l.add(g);
2819
+ }, l.add(y);
2820
2820
  }
2821
2821
  return l;
2822
2822
  }
2823
- function zr(e, t, n, r = {}) {
2824
- if (!e.scene || (jt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2823
+ function vr(e, t, n, r = {}) {
2824
+ if (!e.scene || (Gt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2825
2825
  const { maxDiscs: o = 3e3 } = r;
2826
2826
  let i = t;
2827
2827
  if (i.length > o) {
2828
- const u = i.length / o, a = [];
2829
- for (let c = 0; c < o; c++)
2830
- a.push(i[Math.floor(c * u)]);
2828
+ const c = i.length / o, a = [];
2829
+ for (let u = 0; u < o; u++)
2830
+ a.push(i[Math.floor(u * c)]);
2831
2831
  i = a;
2832
2832
  }
2833
- const s = n.flatMap((u) => (u.points || []).map((a) => ({ ...a, hole_id: u.id }))), l = Un(i, s, r);
2834
- l.length && (e.structuralGroup = Mr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((u) => {
2835
- u.isMesh && e.structuralMeshes.push(u);
2833
+ const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Yn(i, s, r);
2834
+ l.length && (e.structuralGroup = zr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
2835
+ c.isMesh && e.structuralMeshes.push(c);
2836
2836
  }), Me(e));
2837
2837
  }
2838
- function jt(e) {
2838
+ function Gt(e) {
2839
2839
  e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
2840
2840
  t.isMesh && (t.geometry.dispose(), t.material.dispose());
2841
2841
  }), e.structuralGroup = null), e.structuralMeshes = [], Me(e);
@@ -2843,8 +2843,103 @@ function jt(e) {
2843
2843
  function Er(e, t) {
2844
2844
  e.structuralGroup && (e.structuralGroup.visible = !!t);
2845
2845
  }
2846
- function it(e) {
2847
- var n, r, o, i, s, l, u, a, c;
2846
+ let xr = 0;
2847
+ function kr(e) {
2848
+ let t, n, r, o;
2849
+ if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
2850
+ const i = Number(e.x ?? 0), s = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
2851
+ t = i, n = s, r = i + l, o = s + c;
2852
+ } else
2853
+ t = Number(e.minX), n = Number(e.minY), r = Number(e.maxX), o = Number(e.maxY);
2854
+ if (r - t <= 0)
2855
+ throw new Error(
2856
+ `Invalid raster bounds: width must be positive (got minX=${t}, maxX=${r})`
2857
+ );
2858
+ if (o - n <= 0)
2859
+ throw new Error(
2860
+ `Invalid raster bounds: height must be positive (got minY=${n}, maxY=${o})`
2861
+ );
2862
+ return { minX: t, minY: n, maxX: r, maxY: o };
2863
+ }
2864
+ function Ar(e) {
2865
+ if (e.type === "texture")
2866
+ return Promise.resolve(e.texture);
2867
+ let t, n = !1;
2868
+ if (e.type === "url")
2869
+ t = e.url;
2870
+ else if (e.type === "file")
2871
+ t = URL.createObjectURL(e.file), n = !0;
2872
+ else
2873
+ return Promise.reject(
2874
+ new Error(`Unsupported raster source type: "${e.type}"`)
2875
+ );
2876
+ return new Promise((r, o) => {
2877
+ new g.TextureLoader().load(
2878
+ t,
2879
+ (s) => {
2880
+ n && URL.revokeObjectURL(t), r(s);
2881
+ },
2882
+ void 0,
2883
+ (s) => {
2884
+ n && URL.revokeObjectURL(t), o(
2885
+ new Error(
2886
+ `Failed to load raster texture from "${t}": ${(s == null ? void 0 : s.message) ?? s}`
2887
+ )
2888
+ );
2889
+ }
2890
+ );
2891
+ });
2892
+ }
2893
+ async function Ci(e) {
2894
+ const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, s = e.id ?? `raster-overlay-${++xr}`, l = e.name ?? s;
2895
+ let c = e.opacity ?? 1;
2896
+ if ((c < 0 || c > 1) && (console.warn(
2897
+ `[baselode] raster overlay "${s}": opacity ${c} is outside [0, 1] — clamped`
2898
+ ), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
2899
+ if (!n) throw new Error("raster overlay: options.bounds is required");
2900
+ const a = kr(n), { minX: u, minY: m, maxX: d, maxY: f } = a, h = d - u, b = f - m, _ = (u + d) / 2, p = (m + f) / 2, y = await Ar(t), M = new g.PlaneGeometry(h, b), z = new g.MeshBasicMaterial({
2901
+ map: y,
2902
+ transparent: !0,
2903
+ opacity: c,
2904
+ side: g.DoubleSide,
2905
+ depthWrite: !1
2906
+ }), O = new g.Mesh(M, z);
2907
+ return O.position.set(_, p, r), O.renderOrder = i, O.visible = o, { id: s, name: l, mesh: O, texture: y, bounds: a, elevation: r, opacity: c, visible: o };
2908
+ }
2909
+ function Ir(e, t) {
2910
+ e.scene && (e.rasterOverlays.has(t.id) && it(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
2911
+ }
2912
+ function it(e, t) {
2913
+ var r;
2914
+ const n = e.rasterOverlays.get(t);
2915
+ 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));
2916
+ }
2917
+ function Or(e, t, n) {
2918
+ const r = e.rasterOverlays.get(t);
2919
+ if (!r) return;
2920
+ const o = Math.max(0, Math.min(1, Number(n)));
2921
+ r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
2922
+ }
2923
+ function Cr(e, t, n) {
2924
+ const r = e.rasterOverlays.get(t);
2925
+ r && (r.visible = !!n, r.mesh.visible = r.visible);
2926
+ }
2927
+ function Dr(e, t, n) {
2928
+ const r = e.rasterOverlays.get(t);
2929
+ r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
2930
+ }
2931
+ function Sr(e, t) {
2932
+ return e.rasterOverlays.get(t);
2933
+ }
2934
+ function Lr(e) {
2935
+ return Array.from(e.rasterOverlays.values());
2936
+ }
2937
+ function Pr(e) {
2938
+ for (const t of [...e.rasterOverlays.keys()])
2939
+ it(e, t);
2940
+ }
2941
+ function st(e) {
2942
+ var n, r, o, i, s, l, c, a, u;
2848
2943
  if (!e) return "";
2849
2944
  const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
2850
2945
  return [
@@ -2854,12 +2949,12 @@ function it(e) {
2854
2949
  t((i = e.target) == null ? void 0 : i.x),
2855
2950
  t((s = e.target) == null ? void 0 : s.y),
2856
2951
  t((l = e.target) == null ? void 0 : l.z),
2857
- t((u = e.up) == null ? void 0 : u.x),
2952
+ t((c = e.up) == null ? void 0 : c.x),
2858
2953
  t((a = e.up) == null ? void 0 : a.y),
2859
- t((c = e.up) == null ? void 0 : c.z)
2954
+ t((u = e.up) == null ? void 0 : u.z)
2860
2955
  ].join("|");
2861
2956
  }
2862
- function Gt(e) {
2957
+ function Ut(e) {
2863
2958
  return !e.camera || !e.controls ? null : {
2864
2959
  camera: {
2865
2960
  x: e.camera.position.x,
@@ -2878,37 +2973,37 @@ function Gt(e) {
2878
2973
  }
2879
2974
  };
2880
2975
  }
2881
- function kr(e, t) {
2976
+ function Fr(e, t) {
2882
2977
  if (!e.camera || !e.controls || !t) return !1;
2883
2978
  const n = t.camera || {}, r = t.target || {}, o = t.up || {};
2884
- 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 = it(t), !0) : !1;
2979
+ 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 = st(t), !0) : !1;
2885
2980
  }
2886
- function Ar(e) {
2981
+ function wr(e) {
2887
2982
  if (!e.viewChangeHandler) return;
2888
2983
  const t = Date.now();
2889
2984
  if (t - e._lastViewEmitMs < 250) return;
2890
- const n = Gt(e);
2985
+ const n = Ut(e);
2891
2986
  if (!n) return;
2892
- const r = it(n);
2987
+ const r = st(n);
2893
2988
  r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
2894
2989
  }
2895
- function st(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
2896
- const l = (t + n) / 2, u = (r + o) / 2, a = (i + s) / 2, c = n - t, m = o - r, d = s - i, h = Math.max(c, m, d, 1) * 2;
2897
- e.controls.target.set(l, u, a), e.camera.position.set(l + h, u + h, a + h), e.camera.lookAt(l, u, a), e.controls.update();
2990
+ function lt(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
2991
+ const l = (t + n) / 2, c = (r + o) / 2, a = (i + s) / 2, u = n - t, m = o - r, d = s - i, h = Math.max(u, m, d, 1) * 2;
2992
+ e.controls.target.set(l, c, a), e.camera.position.set(l + h, c + h, a + h), e.camera.lookAt(l, c, a), e.controls.update();
2898
2993
  }
2899
- function xr(e, t = 1e3) {
2994
+ function Tr(e, t = 1e3) {
2900
2995
  !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());
2901
2996
  }
2902
- function vr(e, t = 2e3) {
2997
+ function $r(e, t = 2e3) {
2903
2998
  !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());
2904
2999
  }
2905
- function Ir(e, t = 0, n = 0) {
3000
+ function Br(e, t = 0, n = 0) {
2906
3001
  e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
2907
3002
  }
2908
- function Cr(e, t = 1.1) {
3003
+ function Rr(e, t = 1.1) {
2909
3004
  !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());
2910
3005
  }
2911
- function Dr(e, t = 1.2) {
3006
+ function Vr(e, t = 1.2) {
2912
3007
  if (!e.lastBounds) return;
2913
3008
  const {
2914
3009
  minX: n,
@@ -2917,16 +3012,16 @@ function Dr(e, t = 1.2) {
2917
3012
  maxY: i,
2918
3013
  minZ: s,
2919
3014
  maxZ: l
2920
- } = e.lastBounds, u = (r - n) * t, a = (i - o) * t, c = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, b = Math.max(u, a, c, 1) * 2;
3015
+ } = e.lastBounds, c = (r - n) * t, a = (i - o) * t, u = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, b = Math.max(c, a, u, 1) * 2;
2921
3016
  e.controls.target.set(m, d, f), e.camera.position.set(m + b, d + b, f + b), e.camera.lookAt(m, d, f), e.controls.update();
2922
3017
  }
2923
- const Sr = 1, Lr = 120;
2924
- function Or(e, t) {
3018
+ const Hr = 1, jr = 120;
3019
+ function Gr(e, t) {
2925
3020
  if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
2926
- const n = Math.min(Lr, Math.max(Sr, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, s = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, u = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
2927
- return e.camera.position.copy(r).addScaledVector(a, u), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
3021
+ const n = Math.min(jr, Math.max(Hr, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, s = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, c = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
3022
+ return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
2928
3023
  }
2929
- function Pr(e, t = "orbit") {
3024
+ function Ur(e, t = "orbit") {
2930
3025
  if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
2931
3026
  e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
2932
3027
  else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
@@ -2936,36 +3031,36 @@ function Pr(e, t = "orbit") {
2936
3031
  }
2937
3032
  }
2938
3033
  const ue = "#9ca3af";
2939
- function _t(e, t) {
3034
+ function Nt(e, t) {
2940
3035
  const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
2941
3036
  if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
2942
3037
  const o = Math.min(n, r), i = Math.max(n, r);
2943
3038
  return i <= o ? null : { segStart: o, segEnd: i };
2944
3039
  }
2945
- function Fr(e, t, n) {
3040
+ function Yr(e, t, n) {
2946
3041
  let r = 0, o = 0;
2947
3042
  for (let s = 0; s < e.length; s += 1) {
2948
- const l = e[s], u = Number(l == null ? void 0 : l.from), a = Number(l == null ? void 0 : l.to), c = Number(l == null ? void 0 : l.value);
2949
- if (!Number.isFinite(u) || !Number.isFinite(a) || !Number.isFinite(c) || a <= u) continue;
2950
- const m = Math.max(t, u), f = Math.min(n, a) - m;
2951
- f <= 0 || (r += c * f, o += f);
3043
+ const l = e[s], c = Number(l == null ? void 0 : l.from), a = Number(l == null ? void 0 : l.to), u = Number(l == null ? void 0 : l.value);
3044
+ if (!Number.isFinite(c) || !Number.isFinite(a) || !Number.isFinite(u) || a <= c) continue;
3045
+ const m = Math.max(t, c), f = Math.min(n, a) - m;
3046
+ f <= 0 || (r += u * f, o += f);
2952
3047
  }
2953
3048
  if (o <= 0) return null;
2954
3049
  const i = r / o;
2955
3050
  return Number.isFinite(i) ? i : null;
2956
3051
  }
2957
- function Tr(e, t) {
2958
- if (!Number.isFinite(e)) return new _.Color(ue);
2959
- if (Vt(e, t) < 0) return new _.Color(ue);
2960
- const r = pr(e, t, ue);
2961
- return new _.Color(r);
3052
+ function Xr(e, t) {
3053
+ if (!Number.isFinite(e)) return new g.Color(ue);
3054
+ if (Vt(e, t) < 0) return new g.Color(ue);
3055
+ const r = br(e, t, ue);
3056
+ return new g.Color(r);
2962
3057
  }
2963
- function wr(e) {
3058
+ function qr(e) {
2964
3059
  if (!e || !String(e).trim()) return ue;
2965
- const t = Ut(String(e).toLowerCase().trim());
2966
- return "#" + new _.Color().setHSL(t, 0.7, 0.5).getHexString();
3060
+ const t = Yt(String(e).toLowerCase().trim());
3061
+ return "#" + new g.Color().setHSL(t, 0.7, 0.5).getHexString();
2967
3062
  }
2968
- function $r(e = {}) {
3063
+ function Zr(e = {}) {
2969
3064
  return {
2970
3065
  preserveView: !!e.preserveView,
2971
3066
  assayIntervalsByHole: e.assayIntervalsByHole || null,
@@ -2973,7 +3068,7 @@ function $r(e = {}) {
2973
3068
  isCategoricalVariable: !!e.isCategoricalVariable
2974
3069
  };
2975
3070
  }
2976
- function Br(e, t) {
3071
+ function Wr(e, t) {
2977
3072
  if (!e || !t) return [];
2978
3073
  const n = [];
2979
3074
  return Object.values(e).forEach((r) => {
@@ -2989,140 +3084,140 @@ function Ze(e) {
2989
3084
  project: e.project
2990
3085
  };
2991
3086
  }
2992
- function Vr(e) {
3087
+ function Kr(e) {
2993
3088
  return `${e ?? ""}`.trim().toLowerCase();
2994
3089
  }
2995
- function Hr(e, t) {
2996
- const n = `${e ?? ""}:${t ?? 0}`, r = Ut(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new _.Color();
3090
+ function Jr(e, t) {
3091
+ const n = `${e ?? ""}:${t ?? 0}`, r = Yt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new g.Color();
2997
3092
  return s.setHSL(i, 1, 0.5), s;
2998
3093
  }
2999
- function Ut(e) {
3094
+ function Yt(e) {
3000
3095
  const t = `${e ?? ""}`;
3001
3096
  let n = 2166136261;
3002
3097
  for (let r = 0; r < t.length; r += 1)
3003
3098
  n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
3004
3099
  return (n >>> 0) / 4294967295;
3005
3100
  }
3006
- function Rr(e, t, n) {
3101
+ function Qr(e, t, n) {
3007
3102
  let r = null, o = 0;
3008
3103
  for (const i of e) {
3009
3104
  const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
3010
3105
  if (!Number.isFinite(s) || !Number.isFinite(l)) continue;
3011
- const u = Math.min(n, l) - Math.max(t, s);
3012
- u > o && (o = u, r = i == null ? void 0 : i.value);
3106
+ const c = Math.min(n, l) - Math.max(t, s);
3107
+ c > o && (o = c, r = i == null ? void 0 : i.value);
3013
3108
  }
3014
3109
  return r;
3015
3110
  }
3016
- function jr(e, t) {
3111
+ function eo(e, t) {
3017
3112
  if (!t || !e) return [];
3018
3113
  const n = e.id || e.holeId;
3019
3114
  if (!n) return [];
3020
3115
  const r = t[n];
3021
3116
  if (Array.isArray(r) && r.length) return r;
3022
- const o = Vr(n);
3117
+ const o = Kr(n);
3023
3118
  if (o) {
3024
3119
  const i = t[o];
3025
3120
  if (Array.isArray(i) && i.length) return i;
3026
3121
  }
3027
3122
  return [];
3028
3123
  }
3029
- function Gr({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
3124
+ function to({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
3030
3125
  if (!e)
3031
- return Hr(r, o);
3126
+ return Jr(r, o);
3032
3127
  if (e === "__HAS_ASSAY__") {
3033
- if (!(t != null && t.length)) return new _.Color(ue);
3034
- const c = _t(i, s);
3035
- return c ? t.some((d) => {
3128
+ if (!(t != null && t.length)) return new g.Color(ue);
3129
+ const u = Nt(i, s);
3130
+ return u ? t.some((d) => {
3036
3131
  const f = Number(d == null ? void 0 : d.from), h = Number(d == null ? void 0 : d.to);
3037
3132
  if (!Number.isFinite(f) || !Number.isFinite(h)) return !1;
3038
- const b = Math.max(c.segStart, f);
3039
- return Math.min(c.segEnd, h) > b;
3040
- }) ? new _.Color("#ff8c42") : new _.Color(ue) : new _.Color(ue);
3133
+ const b = Math.max(u.segStart, f);
3134
+ return Math.min(u.segEnd, h) > b;
3135
+ }) ? new g.Color("#ff8c42") : new g.Color(ue) : new g.Color(ue);
3041
3136
  }
3042
- if (!(t != null && t.length)) return new _.Color(ue);
3043
- const u = _t(i, s);
3044
- if (!u) return new _.Color(ue);
3137
+ if (!(t != null && t.length)) return new g.Color(ue);
3138
+ const c = Nt(i, s);
3139
+ if (!c) return new g.Color(ue);
3045
3140
  if (l) {
3046
- const c = Rr(t, u.segStart, u.segEnd);
3047
- return new _.Color(wr(c));
3048
- }
3049
- const a = Fr(t, u.segStart, u.segEnd);
3050
- return Tr(a, n);
3051
- }
3052
- function Ur(e, t, n = {}) {
3053
- if (!e.scene || (Yt(e), !t || t.length === 0)) return;
3054
- const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = $r(n), l = s ? [] : Br(o, i), u = fr(l);
3055
- let a = 1 / 0, c = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, h = -1 / 0;
3056
- const b = new _.Vector3(), y = new _.Vector3(0, 1, 0);
3057
- t.forEach((p, g) => {
3058
- const z = g * 137.5 % 360 / 360, D = new _.Color().setHSL(z, 0.75, 0.55), x = (p.points || []).map((P) => {
3059
- a = Math.min(a, P.x), c = Math.max(c, P.x), m = Math.min(m, P.y), d = Math.max(d, P.y), f = Math.min(f, P.z), h = Math.max(h, P.z);
3060
- const E = new _.Vector3(P.x, P.y, P.z);
3061
- return E.md = P.md, E;
3141
+ const u = Qr(t, c.segStart, c.segEnd);
3142
+ return new g.Color(qr(u));
3143
+ }
3144
+ const a = Yr(t, c.segStart, c.segEnd);
3145
+ return Xr(a, n);
3146
+ }
3147
+ function no(e, t, n = {}) {
3148
+ if (!e.scene || (Xt(e), !t || t.length === 0)) return;
3149
+ const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = Zr(n), l = s ? [] : Wr(o, i), c = hr(l);
3150
+ let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, h = -1 / 0;
3151
+ const b = new g.Vector3(), _ = new g.Vector3(0, 1, 0);
3152
+ t.forEach((p, y) => {
3153
+ const z = y * 137.5 % 360 / 360, O = new g.Color().setHSL(z, 0.75, 0.55), k = (p.points || []).map((P) => {
3154
+ a = Math.min(a, P.x), u = Math.max(u, P.x), m = Math.min(m, P.y), d = Math.max(d, P.y), f = Math.min(f, P.z), h = Math.max(h, P.z);
3155
+ const v = new g.Vector3(P.x, P.y, P.z);
3156
+ return v.md = P.md, v;
3062
3157
  });
3063
- if (x.length < 2) {
3064
- if (x.length === 1) {
3065
- const P = new _.SphereGeometry(5, 12, 12), E = new _.MeshLambertMaterial({
3066
- color: D,
3067
- emissive: D,
3158
+ if (k.length < 2) {
3159
+ if (k.length === 1) {
3160
+ const P = new g.SphereGeometry(5, 12, 12), v = new g.MeshLambertMaterial({
3161
+ color: O,
3162
+ emissive: O,
3068
3163
  emissiveIntensity: 0.2
3069
- }), F = new _.Mesh(P, E);
3070
- F.position.copy(x[0]), F.userData = Ze(p), e.scene.add(F), e.drillLines.push(F), e.drillMeshes.push(F);
3164
+ }), F = new g.Mesh(P, v);
3165
+ F.position.copy(k[0]), F.userData = Ze(p), e.scene.add(F), e.drillLines.push(F), e.drillMeshes.push(F);
3071
3166
  }
3072
3167
  return;
3073
3168
  }
3074
- const O = new _.Group();
3075
- O.userData = Ze(p);
3076
- const $ = i ? jr(p, o) : [];
3077
- for (let P = 0; P < x.length - 1; P += 1) {
3078
- const E = x[P], F = x[P + 1], C = b.subVectors(F, E), H = C.length();
3079
- if (H <= 1e-3) continue;
3080
- const R = 2.2, v = new _.CylinderGeometry(R, R, H, 6, 1, !0), k = Gr({
3169
+ const L = new g.Group();
3170
+ L.userData = Ze(p);
3171
+ const $ = i ? eo(p, o) : [];
3172
+ for (let P = 0; P < k.length - 1; P += 1) {
3173
+ const v = k[P], F = k[P + 1], C = b.subVectors(F, v), V = C.length();
3174
+ if (V <= 1e-3) continue;
3175
+ const H = 2.2, A = new g.CylinderGeometry(H, H, V, 6, 1, !0), E = to({
3081
3176
  selectedAssayVariable: i,
3082
3177
  assayIntervals: $,
3083
- assayScale: u,
3178
+ assayScale: c,
3084
3179
  holeId: p.id,
3085
3180
  segmentIndex: P,
3086
- p1: E,
3181
+ p1: v,
3087
3182
  p2: F,
3088
3183
  isCategorical: s
3089
- }), N = new _.MeshLambertMaterial({
3090
- color: k,
3184
+ }), N = new g.MeshLambertMaterial({
3185
+ color: E,
3091
3186
  flatShading: !0,
3092
- emissive: k,
3187
+ emissive: E,
3093
3188
  emissiveIntensity: 0.15
3094
- }), B = new _.Mesh(v, N);
3095
- B.position.copy(E.clone().addScaledVector(C, 0.5)), B.quaternion.setFromUnitVectors(y, C.clone().normalize()), B.userData = Ze(p), O.add(B), e.drillMeshes.push(B);
3189
+ }), B = new g.Mesh(A, N);
3190
+ B.position.copy(v.clone().addScaledVector(C, 0.5)), B.quaternion.setFromUnitVectors(_, C.clone().normalize()), B.userData = Ze(p), L.add(B), e.drillMeshes.push(B);
3096
3191
  }
3097
- e.scene.add(O), e.drillLines.push(O);
3098
- }), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: c, minY: m, maxY: d, minZ: f, maxZ: h }, r || st(e, { minX: a, maxX: c, minY: m, maxY: d, minZ: f, maxZ: h })), Me(e);
3192
+ e.scene.add(L), e.drillLines.push(L);
3193
+ }), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h }, r || lt(e, { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h })), Me(e);
3099
3194
  }
3100
- function Yt(e) {
3195
+ function Xt(e) {
3101
3196
  e.drillLines.forEach((t) => {
3102
3197
  e.scene.remove(t), t.isGroup ? t.traverse((n) => {
3103
3198
  n.isMesh && (n.geometry.dispose(), n.material.dispose());
3104
3199
  }) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
3105
3200
  }), e.drillLines = [], e.drillMeshes = [], Me(e);
3106
3201
  }
3107
- const Nt = "#ffffbb", Yr = 2, qr = 1.5, Xr = 1;
3108
- function Zr(e) {
3202
+ const Mt = "#ffffbb", ro = 2, oo = 1.5, io = 1;
3203
+ function so(e) {
3109
3204
  const { renderer: t, scene: n, camera: r, container: o } = e;
3110
3205
  if (!t || !n || !r) return;
3111
- const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, s = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new ln(t), u = new an(n, r);
3112
- l.addPass(u);
3113
- const a = new _.Vector2(i, s), c = new cn(a, n, r);
3114
- c.visibleEdgeColor.set(Nt), c.hiddenEdgeColor.set(Nt), c.edgeStrength = Yr, c.edgeThickness = qr, c.edgeGlow = Xr, c.pulsePeriod = 0, c.selectedObjects = [], l.addPass(c), l.setSize(i, s), e._composer = l, e._outlinePass = c;
3206
+ const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, s = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new an(t), c = new cn(n, r);
3207
+ l.addPass(c);
3208
+ const a = new g.Vector2(i, s), u = new un(a, n, r);
3209
+ u.visibleEdgeColor.set(Mt), u.hiddenEdgeColor.set(Mt), u.edgeStrength = ro, u.edgeThickness = oo, u.edgeGlow = io, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, s), e._composer = l, e._outlinePass = u;
3115
3210
  }
3116
- function Wr(e, t, n) {
3211
+ function lo(e, t, n) {
3117
3212
  !e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
3118
3213
  }
3119
- function Se(e, t) {
3214
+ function De(e, t) {
3120
3215
  e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
3121
3216
  }
3122
- function Mt(e) {
3217
+ function zt(e) {
3123
3218
  e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
3124
3219
  }
3125
- const Kr = [
3220
+ const ao = [
3126
3221
  { normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
3127
3222
  { normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
3128
3223
  { normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
@@ -3130,40 +3225,40 @@ const Kr = [
3130
3225
  { normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
3131
3226
  { normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
3132
3227
  ];
3133
- function Jr(e, t, n, r, o = {}) {
3228
+ function co(e, t, n, r, o = {}) {
3134
3229
  if (!e.scene || (qt(e), !t || !n || !r)) return;
3135
3230
  const { autoCenter: i = !0, opacity: s = 1 } = o;
3136
- let l = 1 / 0, u = -1 / 0, a = 1 / 0, c = -1 / 0, m = 1 / 0, d = -1 / 0;
3231
+ let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
3137
3232
  t.forEach((N) => {
3138
3233
  const B = Number(N.x ?? N.center_x ?? 0), I = Number(N.y ?? N.center_y ?? 0), G = Number(N.z ?? N.center_z ?? 0), U = Number(N.dx ?? N.size_x ?? 1), j = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1);
3139
- l = Math.min(l, B - U / 2), u = Math.max(u, B + U / 2), a = Math.min(a, I - j / 2), c = Math.max(c, I + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
3234
+ l = Math.min(l, B - U / 2), c = Math.max(c, B + U / 2), a = Math.min(a, I - j / 2), u = Math.max(u, I + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
3140
3235
  });
3141
3236
  let f = 0, h = 0, b = 0;
3142
- o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l + u) / 2), h = -((a + c) / 2), b = -((m + d) / 2));
3143
- const y = l + f, p = u + f, g = a + h, M = c + h, z = m + b, D = d + b, x = (N, B, I) => `${Math.round(N)},${Math.round(B)},${Math.round(I)}`, O = new Set(
3144
- t.map((N) => x(Number(N.x ?? 0), Number(N.y ?? 0), Number(N.z ?? 0)))
3145
- ), $ = [], P = [], E = [], F = [], C = [];
3146
- let H = 0;
3237
+ o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), h = -((a + u) / 2), b = -((m + d) / 2));
3238
+ const _ = l + f, p = c + f, y = a + h, M = u + h, z = m + b, O = d + b, k = (N, B, I) => `${Math.round(N)},${Math.round(B)},${Math.round(I)}`, L = new Set(
3239
+ t.map((N) => k(Number(N.x ?? 0), Number(N.y ?? 0), Number(N.z ?? 0)))
3240
+ ), $ = [], P = [], v = [], F = [], C = [];
3241
+ let V = 0;
3147
3242
  if (t.forEach((N) => {
3148
- const B = Number(N.x ?? N.center_x ?? 0), I = Number(N.y ?? N.center_y ?? 0), G = Number(N.z ?? N.center_z ?? 0), U = Number(N.dx ?? N.size_x ?? 1), j = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1), K = B + f, le = I + h, ye = G + b, fe = wn(N[n], r, _), { r: De, g: he, b: Ge } = fe;
3149
- Kr.forEach((_e) => {
3150
- const Kt = B + _e.neibDir[0] * U, Jt = I + _e.neibDir[1] * j, Qt = G + _e.neibDir[2] * Z;
3151
- if (O.has(x(Kt, Jt, Qt))) return;
3152
- const ze = H;
3153
- _e.verts.forEach(([en, tn, nn]) => {
3154
- $.push(K + en * U / 2, le + tn * j / 2, ye + nn * Z / 2), P.push(_e.normal[0], _e.normal[1], _e.normal[2]), E.push(De, he, Ge), H++;
3243
+ const B = Number(N.x ?? N.center_x ?? 0), I = Number(N.y ?? N.center_y ?? 0), G = Number(N.z ?? N.center_z ?? 0), U = Number(N.dx ?? N.size_x ?? 1), j = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1), K = B + f, le = I + h, ge = G + b, fe = $n(N[n], r, g), { r: Ce, g: he, b: Ge } = fe;
3244
+ ao.forEach((_e) => {
3245
+ const Jt = B + _e.neibDir[0] * U, Qt = I + _e.neibDir[1] * j, en = G + _e.neibDir[2] * Z;
3246
+ if (L.has(k(Jt, Qt, en))) return;
3247
+ const ze = V;
3248
+ _e.verts.forEach(([tn, nn, rn]) => {
3249
+ $.push(K + tn * U / 2, le + nn * j / 2, ge + rn * Z / 2), P.push(_e.normal[0], _e.normal[1], _e.normal[2]), v.push(Ce, he, Ge), V++;
3155
3250
  }), F.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), C.push(N);
3156
3251
  });
3157
3252
  }), $.length === 0) return;
3158
- const R = new _.BufferGeometry();
3159
- R.setAttribute("position", new _.Float32BufferAttribute($, 3)), R.setAttribute("normal", new _.Float32BufferAttribute(P, 3)), R.setAttribute("color", new _.Float32BufferAttribute(E, 3)), R.setIndex(F);
3160
- const v = new _.MeshLambertMaterial({
3253
+ const H = new g.BufferGeometry();
3254
+ H.setAttribute("position", new g.Float32BufferAttribute($, 3)), H.setAttribute("normal", new g.Float32BufferAttribute(P, 3)), H.setAttribute("color", new g.Float32BufferAttribute(v, 3)), H.setIndex(F);
3255
+ const A = new g.MeshLambertMaterial({
3161
3256
  vertexColors: !0,
3162
3257
  transparent: s < 1,
3163
3258
  opacity: s,
3164
- side: _.DoubleSide
3165
- }), k = new _.Mesh(R, v);
3166
- k.userData._isMergedBlocks = !0, k.userData._quadToBlock = C, k.userData._offset = { x: f, y: h, z: b }, e.scene.add(k), e.blocks.push(k), Me(e), e.camera && e.controls && (e.lastBounds = { minX: y, maxX: p, minY: g, maxY: M, minZ: z, maxZ: D }, st(e, { minX: y, maxX: p, minY: g, maxY: M, minZ: z, maxZ: D }));
3259
+ side: g.DoubleSide
3260
+ }), E = new g.Mesh(H, A);
3261
+ E.userData._isMergedBlocks = !0, E.userData._quadToBlock = C, E.userData._offset = { x: f, y: h, z: b }, e.scene.add(E), e.blocks.push(E), Me(e), e.camera && e.controls && (e.lastBounds = { minX: _, maxX: p, minY: y, maxY: M, minZ: z, maxZ: O }, lt(e, { minX: _, maxX: p, minY: y, maxY: M, minZ: z, maxZ: O }));
3167
3262
  }
3168
3263
  function qt(e) {
3169
3264
  var t;
@@ -3171,45 +3266,45 @@ function qt(e) {
3171
3266
  e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
3172
3267
  }), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), Me(e);
3173
3268
  }
3174
- function Qr(e, t) {
3269
+ function uo(e, t) {
3175
3270
  const n = Math.max(0, Math.min(1, Number(t)));
3176
3271
  e.blocks.forEach((r) => {
3177
3272
  r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
3178
3273
  });
3179
3274
  }
3180
- function eo(e, t, n) {
3181
- 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, s = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o, u = Number(t.z ?? t.center_z ?? 0) + i, a = Number(t.dx ?? t.size_x ?? 1), c = Number(t.dy ?? t.size_y ?? 1), m = Number(t.dz ?? t.size_z ?? 1);
3275
+ function mo(e, t, n) {
3276
+ 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, s = 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, a = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), m = Number(t.dz ?? t.size_z ?? 1);
3182
3277
  if (!e._blockHighlightMesh) {
3183
- const d = new _.BoxGeometry(1, 1, 1), f = new _.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
3184
- e._blockHighlightMesh = new _.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
3278
+ const d = new g.BoxGeometry(1, 1, 1), f = new g.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
3279
+ e._blockHighlightMesh = new g.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
3185
3280
  }
3186
- return e._blockHighlightMesh.position.set(s, l, u), e._blockHighlightMesh.scale.set(a, c, m), e._blockHighlightMesh;
3281
+ return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
3187
3282
  }
3188
- function Xt(e) {
3283
+ function Zt(e) {
3189
3284
  var o, i;
3190
3285
  if (!e._outlinePass || e.selectables.length === 0) {
3191
- e._outlinePass && Se(e, null);
3286
+ e._outlinePass && De(e, null);
3192
3287
  return;
3193
3288
  }
3194
3289
  const t = e.raycaster.intersectObjects(e.selectables, !0);
3195
3290
  if (t.length === 0) {
3196
- Se(e, null);
3291
+ De(e, null);
3197
3292
  return;
3198
3293
  }
3199
3294
  const n = t[0], r = n.object;
3200
3295
  if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
3201
3296
  const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
3202
3297
  if (l) {
3203
- Se(e, eo(e, l, r.userData._offset));
3298
+ De(e, mo(e, l, r.userData._offset));
3204
3299
  return;
3205
3300
  }
3206
3301
  }
3207
- Se(e, r);
3302
+ De(e, r);
3208
3303
  }
3209
- function to(e) {
3304
+ function fo(e) {
3210
3305
  const t = e.renderer;
3211
3306
  t && (e.handleCanvasClick = (n) => {
3212
- var f, h, b, y, p, g, M;
3307
+ var f, h, b, _, p, y, M;
3213
3308
  if (n.button !== 0) return;
3214
3309
  if ((f = e.gizmo) != null && f.domElement) {
3215
3310
  const z = e.gizmo.domElement.getBoundingClientRect();
@@ -3217,81 +3312,81 @@ function to(e) {
3217
3312
  return;
3218
3313
  }
3219
3314
  const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
3220
- if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Xt(e), e.blocks.length > 0) {
3315
+ if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Zt(e), e.blocks.length > 0) {
3221
3316
  const z = e.raycaster.intersectObjects(e.blocks, !1);
3222
3317
  if (z.length > 0) {
3223
- const D = z[0], x = D.object;
3224
- if ((h = x == null ? void 0 : x.userData) != null && h._isMergedBlocks && e.blockClickHandler) {
3225
- const O = Math.floor(D.faceIndex / 2), $ = x.userData._quadToBlock[O];
3318
+ const O = z[0], k = O.object;
3319
+ if ((h = k == null ? void 0 : k.userData) != null && h._isMergedBlocks && e.blockClickHandler) {
3320
+ const L = Math.floor(O.faceIndex / 2), $ = k.userData._quadToBlock[L];
3226
3321
  $ && e.blockClickHandler($);
3227
3322
  }
3228
3323
  return;
3229
3324
  }
3230
3325
  }
3231
- const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), u = ((b = s[0]) == null ? void 0 : b.distance) ?? 1 / 0;
3232
- if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) < u && l.length > 0) {
3326
+ const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((b = s[0]) == null ? void 0 : b.distance) ?? 1 / 0;
3327
+ if ((((_ = l[0]) == null ? void 0 : _.distance) ?? 1 / 0) < c && l.length > 0) {
3233
3328
  const z = l[0].object;
3234
3329
  e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...z.userData });
3235
3330
  return;
3236
3331
  }
3237
3332
  if (s.length === 0) return;
3238
- let c = s[0].object;
3239
- for (; c && c.parent && !((p = c.userData) != null && p.holeId); )
3240
- c = c.parent;
3241
- const m = (g = c == null ? void 0 : c.userData) == null ? void 0 : g.holeId, d = (M = c == null ? void 0 : c.userData) == null ? void 0 : M.project;
3333
+ let u = s[0].object;
3334
+ for (; u && u.parent && !((p = u.userData) != null && p.holeId); )
3335
+ u = u.parent;
3336
+ const m = (y = u == null ? void 0 : u.userData) == null ? void 0 : y.holeId, d = (M = u == null ? void 0 : u.userData) == null ? void 0 : M.project;
3242
3337
  m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
3243
3338
  }, t.domElement.addEventListener("click", e.handleCanvasClick));
3244
3339
  }
3245
- class _i {
3340
+ class Di {
3246
3341
  constructor() {
3247
- 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.frameId = null, this.clock = new _.Clock(), this.handleCanvasClick = null, this.raycaster = new _.Raycaster(), this.pointer = new _.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new _.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null;
3342
+ 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.frameId = null, this.clock = new g.Clock(), this.handleCanvasClick = null, this.raycaster = new g.Raycaster(), this.pointer = new g.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new g.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();
3248
3343
  }
3249
3344
  init(t) {
3250
3345
  if (!t) return;
3251
3346
  this.container = t;
3252
3347
  const n = t.clientWidth, r = t.clientHeight;
3253
- this.scene = new _.Scene(), this.scene.background = new _.Color(16777215), this.camera = new _.PerspectiveCamera(28, n / r, 1e-3, 1e5), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new _.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
3254
- const o = new _.AmbientLight(16777215, 1.2);
3348
+ this.scene = new g.Scene(), this.scene.background = new g.Color(16777215), this.camera = new g.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 g.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
3349
+ const o = new g.AmbientLight(16777215, 1.2);
3255
3350
  this.scene.add(o);
3256
- const i = new _.DirectionalLight(16777215, 1.5);
3351
+ const i = new g.DirectionalLight(16777215, 1.5);
3257
3352
  i.position.set(10, 10, 5), this.scene.add(i);
3258
- const s = new _.AxesHelper(20);
3259
- this.scene.add(s), this.controls = new rn(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 1.2, this.controls.minDistance = 3e-3, this.controls.maxDistance = 4e4, this.controls.mouseButtons = {
3260
- LEFT: _.MOUSE.PAN,
3261
- MIDDLE: _.MOUSE.DOLLY,
3262
- RIGHT: _.MOUSE.ROTATE
3353
+ const s = new g.AxesHelper(20);
3354
+ this.scene.add(s), this.controls = new on(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 1.2, this.controls.minDistance = 3e-3, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
3355
+ LEFT: g.MOUSE.PAN,
3356
+ MIDDLE: g.MOUSE.DOLLY,
3357
+ RIGHT: g.MOUSE.ROTATE
3263
3358
  }, this.controls.touches = {
3264
- ONE: _.TOUCH.ROTATE,
3265
- TWO: _.TOUCH.PAN
3266
- }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new on(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 sn(this.camera, this.renderer, {
3359
+ ONE: g.TOUCH.ROTATE,
3360
+ TWO: g.TOUCH.PAN
3361
+ }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new sn(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 ln(this.camera, this.renderer, {
3267
3362
  container: this.container,
3268
3363
  placement: "top-right",
3269
3364
  size: 110,
3270
3365
  offset: { top: 12, right: 12 },
3271
3366
  animated: !0,
3272
3367
  speed: 1.5
3273
- }), this.gizmo.attachControls(this.controls), to(this), Zr(this);
3368
+ }), this.gizmo.attachControls(this.controls), fo(this), so(this);
3274
3369
  const l = () => {
3275
3370
  var a;
3276
3371
  this.frameId = requestAnimationFrame(l);
3277
- const u = this.clock.getDelta();
3278
- this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(u) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(u) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
3372
+ const c = this.clock.getDelta();
3373
+ this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.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();
3279
3374
  };
3280
3375
  l();
3281
3376
  }
3282
3377
  resize() {
3283
3378
  if (!this.container || !this.camera || !this.renderer) return;
3284
3379
  const t = this.container.clientWidth, n = this.container.clientHeight;
3285
- this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), Wr(this, t, n);
3380
+ this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), lo(this, t, n);
3286
3381
  }
3287
3382
  dispose() {
3288
- 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, qt(this), Yt(this), jt(this), Mt(this), 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));
3383
+ 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, qt(this), Xt(this), Gt(this), Pr(this), zt(this), 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));
3289
3384
  }
3290
3385
  // ---------------------------------------------------------------------------
3291
3386
  // Data renderers — delegate to domain modules
3292
3387
  // ---------------------------------------------------------------------------
3293
3388
  setDrillholes(t, n = {}) {
3294
- Ur(this, t, n);
3389
+ no(this, t, n);
3295
3390
  }
3296
3391
  /**
3297
3392
  * Render block model data as a single merged mesh of exterior faces only.
@@ -3301,17 +3396,17 @@ class _i {
3301
3396
  * @param {Object} [options]
3302
3397
  */
3303
3398
  setBlocks(t, n, r, o = {}) {
3304
- Jr(this, t, n, r, o);
3399
+ co(this, t, n, r, o);
3305
3400
  }
3306
3401
  /**
3307
3402
  * Update the opacity of all currently rendered blocks.
3308
3403
  * @param {number} opacity - New opacity value between 0 and 1
3309
3404
  */
3310
3405
  setBlockOpacity(t) {
3311
- Qr(this, t);
3406
+ uo(this, t);
3312
3407
  }
3313
3408
  setStructuralDiscs(t, n, r = {}) {
3314
- zr(this, t, n, r);
3409
+ vr(this, t, n, r);
3315
3410
  }
3316
3411
  setStructuralDiscsVisible(t) {
3317
3412
  Er(this, t);
@@ -3336,44 +3431,44 @@ class _i {
3336
3431
  this.viewChangeHandler = typeof t == "function" ? t : null;
3337
3432
  }
3338
3433
  getViewState() {
3339
- return Gt(this);
3434
+ return Ut(this);
3340
3435
  }
3341
3436
  setViewState(t) {
3342
- return kr(this, t);
3437
+ return Fr(this, t);
3343
3438
  }
3344
3439
  _buildViewSignature(t) {
3345
- return it(t);
3440
+ return st(t);
3346
3441
  }
3347
3442
  _emitViewChangeIfNeeded() {
3348
- Ar(this);
3443
+ wr(this);
3349
3444
  }
3350
3445
  _fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
3351
- st(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
3446
+ lt(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
3352
3447
  }
3353
3448
  recenterCameraToOrigin(t = 1e3) {
3354
- xr(this, t);
3449
+ Tr(this, t);
3355
3450
  }
3356
3451
  lookDown(t = 2e3) {
3357
- vr(this, t);
3452
+ $r(this, t);
3358
3453
  }
3359
3454
  pan(t = 0, n = 0) {
3360
- Ir(this, t, n);
3455
+ Br(this, t, n);
3361
3456
  }
3362
3457
  dolly(t = 1.1) {
3363
- Cr(this, t);
3458
+ Rr(this, t);
3364
3459
  }
3365
3460
  focusOnLastBounds(t = 1.2) {
3366
- Dr(this, t);
3461
+ Vr(this, t);
3367
3462
  }
3368
3463
  /**
3369
3464
  * Change the camera field-of-view while keeping the visible scene the same apparent size.
3370
3465
  * @param {number} fovDeg - Desired FOV in degrees
3371
3466
  */
3372
3467
  setCameraFov(t) {
3373
- Or(this, t);
3468
+ Gr(this, t);
3374
3469
  }
3375
3470
  setControlMode(t = "orbit") {
3376
- Pr(this, t);
3471
+ Ur(this, t);
3377
3472
  }
3378
3473
  // ---------------------------------------------------------------------------
3379
3474
  // Selection glow public API
@@ -3393,7 +3488,7 @@ class _i {
3393
3488
  * @param {THREE.Object3D|null} object
3394
3489
  */
3395
3490
  selectObject(t) {
3396
- Se(this, t || null);
3491
+ De(this, t || null);
3397
3492
  }
3398
3493
  /**
3399
3494
  * Return the currently selected object, or null if nothing is selected.
@@ -3406,14 +3501,70 @@ class _i {
3406
3501
  * Dispose the effect composer and all GPU resources used by the selection glow.
3407
3502
  */
3408
3503
  disposeGlow() {
3409
- Mt(this);
3504
+ zt(this);
3410
3505
  }
3411
3506
  /** @private */
3412
3507
  _updateSelectionFromPointer() {
3413
- Xt(this);
3508
+ Zt(this);
3509
+ }
3510
+ // ---------------------------------------------------------------------------
3511
+ // Raster overlay API — delegate to rasterOverlayScene
3512
+ // ---------------------------------------------------------------------------
3513
+ /**
3514
+ * Add a raster overlay layer (created with createRasterOverlay) to the scene.
3515
+ * @param {object} layer - Layer descriptor returned by createRasterOverlay()
3516
+ */
3517
+ addRasterOverlay(t) {
3518
+ Ir(this, t);
3519
+ }
3520
+ /**
3521
+ * Remove a raster overlay from the scene and dispose its GPU resources.
3522
+ * @param {string} id - Overlay id
3523
+ */
3524
+ removeRasterOverlay(t) {
3525
+ it(this, t);
3526
+ }
3527
+ /**
3528
+ * Set the opacity of a raster overlay at runtime.
3529
+ * @param {string} id - Overlay id
3530
+ * @param {number} opacity - New opacity [0, 1]
3531
+ */
3532
+ setRasterOverlayOpacity(t, n) {
3533
+ Or(this, t, n);
3534
+ }
3535
+ /**
3536
+ * Show or hide a raster overlay.
3537
+ * @param {string} id - Overlay id
3538
+ * @param {boolean} visible
3539
+ */
3540
+ setRasterOverlayVisibility(t, n) {
3541
+ Cr(this, t, n);
3542
+ }
3543
+ /**
3544
+ * Update the elevation (Z position) of a raster overlay.
3545
+ * @param {string} id - Overlay id
3546
+ * @param {number} elevation
3547
+ */
3548
+ setRasterOverlayElevation(t, n) {
3549
+ Dr(this, t, n);
3550
+ }
3551
+ /**
3552
+ * Return a raster overlay by id, or undefined if not found.
3553
+ * @param {string} id
3554
+ * @returns {object|undefined}
3555
+ */
3556
+ getRasterOverlay(t) {
3557
+ return Sr(this, t);
3558
+ }
3559
+ /**
3560
+ * Return all raster overlay layers in insertion order.
3561
+ * @returns {object[]}
3562
+ */
3563
+ listRasterOverlays() {
3564
+ return Lr(this);
3414
3565
  }
3415
3566
  }
3416
- function Ni({
3567
+ function Si({
3417
3568
  controlMode: e = "orbit",
3418
3569
  onToggleFly: t = () => {
3419
3570
  },
@@ -3425,13 +3576,13 @@ function Ni({
3425
3576
  }
3426
3577
  }) {
3427
3578
  return /* @__PURE__ */ J("div", { className: "baselode-3d-controls", children: [
3428
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
3429
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
3430
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
3431
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
3579
+ /* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
3580
+ /* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
3581
+ /* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
3582
+ /* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
3432
3583
  ] });
3433
3584
  }
3434
- function Mi({
3585
+ function Li({
3435
3586
  properties: e = [],
3436
3587
  selectedProperty: t = "",
3437
3588
  onPropertyChange: n = () => {
@@ -3444,37 +3595,37 @@ function Mi({
3444
3595
  onPopupClose: l = () => {
3445
3596
  }
3446
3597
  }) {
3447
- var u, a;
3598
+ var c, a;
3448
3599
  return /* @__PURE__ */ J("div", { className: "bm-widget", children: [
3449
- /* @__PURE__ */ S("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
3600
+ /* @__PURE__ */ D("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
3450
3601
  /* @__PURE__ */ J(
3451
3602
  "select",
3452
3603
  {
3453
3604
  id: "bm-property-select",
3454
3605
  className: "bm-widget__select",
3455
3606
  value: t,
3456
- onChange: (c) => n(c.target.value),
3607
+ onChange: (u) => n(u.target.value),
3457
3608
  children: [
3458
- e.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "— no attributes —" }),
3459
- e.map((c) => /* @__PURE__ */ S("option", { value: c, children: c }, c))
3609
+ e.length === 0 && /* @__PURE__ */ D("option", { value: "", children: "— no attributes —" }),
3610
+ e.map((u) => /* @__PURE__ */ D("option", { value: u, children: u }, u))
3460
3611
  ]
3461
3612
  }
3462
3613
  ),
3463
3614
  i && i.type === "numeric" && /* @__PURE__ */ J("div", { className: "bm-widget__scale", children: [
3464
- /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((u = i.min) == null ? void 0 : u.toFixed(2)) ?? "—" }),
3465
- /* @__PURE__ */ S("div", { className: "bm-widget__scale-bar" }),
3466
- /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
3615
+ /* @__PURE__ */ D("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
3616
+ /* @__PURE__ */ D("div", { className: "bm-widget__scale-bar" }),
3617
+ /* @__PURE__ */ D("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
3467
3618
  ] }),
3468
- i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
3619
+ i && i.type === "categorical" && /* @__PURE__ */ D("div", { className: "bm-widget__categories", children: (i.categories || []).map((u, m) => {
3469
3620
  const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
3470
- return /* @__PURE__ */ S(
3621
+ return /* @__PURE__ */ D(
3471
3622
  "span",
3472
3623
  {
3473
3624
  className: "bm-widget__category-chip",
3474
3625
  style: { background: `hsl(${d},70%,50%)` },
3475
- children: c
3626
+ children: u
3476
3627
  },
3477
- c
3628
+ u
3478
3629
  );
3479
3630
  }) }),
3480
3631
  /* @__PURE__ */ J("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
@@ -3482,7 +3633,7 @@ function Mi({
3482
3633
  Math.round(r * 100),
3483
3634
  "%)"
3484
3635
  ] }),
3485
- /* @__PURE__ */ S(
3636
+ /* @__PURE__ */ D(
3486
3637
  "input",
3487
3638
  {
3488
3639
  id: "bm-opacity-slider",
@@ -3492,13 +3643,13 @@ function Mi({
3492
3643
  max: "1",
3493
3644
  step: "0.01",
3494
3645
  value: r,
3495
- onChange: (c) => o(parseFloat(c.target.value))
3646
+ onChange: (u) => o(parseFloat(u.target.value))
3496
3647
  }
3497
3648
  ),
3498
3649
  s && /* @__PURE__ */ J("div", { className: "bm-widget__popup", children: [
3499
3650
  /* @__PURE__ */ J("div", { className: "bm-widget__popup-header", children: [
3500
- /* @__PURE__ */ S("span", { children: "Block attributes" }),
3501
- /* @__PURE__ */ S(
3651
+ /* @__PURE__ */ D("span", { children: "Block attributes" }),
3652
+ /* @__PURE__ */ D(
3502
3653
  "button",
3503
3654
  {
3504
3655
  type: "button",
@@ -3509,19 +3660,19 @@ function Mi({
3509
3660
  }
3510
3661
  )
3511
3662
  ] }),
3512
- /* @__PURE__ */ S("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ S("tbody", { children: Object.entries(s).map(([c, m]) => /* @__PURE__ */ J("tr", { children: [
3513
- /* @__PURE__ */ S("th", { children: c }),
3514
- /* @__PURE__ */ S("td", { children: m == null ? "—" : String(m) })
3515
- ] }, c)) }) })
3663
+ /* @__PURE__ */ D("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ D("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ J("tr", { children: [
3664
+ /* @__PURE__ */ D("th", { children: u }),
3665
+ /* @__PURE__ */ D("td", { children: m == null ? "—" : String(m) })
3666
+ ] }, u)) }) })
3516
3667
  ] })
3517
3668
  ] });
3518
3669
  }
3519
- const no = [
3670
+ const ho = [
3520
3671
  { minZoom: 0, lodKey: "thumb" },
3521
3672
  { minZoom: 4, lodKey: "medium" },
3522
3673
  { minZoom: 7, lodKey: "full" }
3523
- ], Zt = 50;
3524
- function ro(e, t, n = no) {
3674
+ ], Wt = 50;
3675
+ function po(e, t, n = ho) {
3525
3676
  var i;
3526
3677
  const r = e.lod_urls;
3527
3678
  if (!r || typeof r != "object" || Array.isArray(r))
@@ -3531,10 +3682,10 @@ function ro(e, t, n = no) {
3531
3682
  t >= s.minZoom && (o = s.lodKey);
3532
3683
  return r[o] || e.image_url || "";
3533
3684
  }
3534
- function oo(e) {
3685
+ function bo(e) {
3535
3686
  return [...e].sort((t, n) => (t.from_depth ?? 0) - (n.from_depth ?? 0));
3536
3687
  }
3537
- function io(e) {
3688
+ function yo(e) {
3538
3689
  const t = {};
3539
3690
  for (const n of e) {
3540
3691
  const r = n.photo_set != null && n.photo_set !== "" ? String(n.photo_set) : "default";
@@ -3542,7 +3693,7 @@ function io(e) {
3542
3693
  }
3543
3694
  return t;
3544
3695
  }
3545
- function so(e, t, n = 10) {
3696
+ function go(e, t, n = 10) {
3546
3697
  const r = [];
3547
3698
  if (e >= t || n <= 0) return r;
3548
3699
  const o = Math.ceil(e / n) * n, i = n * 1e-9;
@@ -3552,120 +3703,120 @@ function so(e, t, n = 10) {
3552
3703
  }
3553
3704
  return r;
3554
3705
  }
3555
- function lo(e) {
3706
+ function _o(e) {
3556
3707
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
3557
3708
  }
3558
- function Wt(e) {
3709
+ function Kt(e) {
3559
3710
  return `tray_${String(e).padStart(3, "0")}.jpg`;
3560
3711
  }
3561
- function ao(e, t, n, r, o = "Tray Images", i = Wt) {
3712
+ function No(e, t, n, r, o = "Tray Images", i = Kt) {
3562
3713
  const s = (n ?? "").replace(/\/$/, ""), l = (r ?? "").replace(/\/$/, "");
3563
- return t.map((u, a) => {
3564
- const c = u.filename ?? i(a), m = u.photoSet ?? o;
3714
+ return t.map((c, a) => {
3715
+ const u = c.filename ?? i(a), m = c.photoSet ?? o;
3565
3716
  return {
3566
3717
  hole_id: e,
3567
- from_depth: u.fromDepth,
3568
- to_depth: u.toDepth,
3718
+ from_depth: c.fromDepth,
3719
+ to_depth: c.toDepth,
3569
3720
  photo_set: m,
3570
- image_url: `${s}/${c}`,
3721
+ image_url: `${s}/${u}`,
3571
3722
  lod_urls: {
3572
- thumb: `${s}/${c}`,
3573
- full: `${l}/${c}`
3723
+ thumb: `${s}/${u}`,
3724
+ full: `${l}/${u}`
3574
3725
  }
3575
3726
  };
3576
3727
  });
3577
3728
  }
3578
- function zi(e, t, n = Zt) {
3729
+ function Pi(e, t, n = Wt) {
3579
3730
  const r = t / 5;
3580
3731
  return Math.max(1, Math.round(e * n * r));
3581
3732
  }
3582
- const We = 5, zt = 1.12, co = 0.05, uo = 40;
3583
- function mo({
3733
+ const We = 5, vt = 1.12, Mo = 0.05, zo = 40;
3734
+ function vo({
3584
3735
  photos: e = [],
3585
3736
  holeId: t = "",
3586
3737
  initialZoom: n = 5,
3587
3738
  transform: r,
3588
3739
  onTransformChange: o
3589
3740
  }) {
3590
- const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, u = Le(l);
3591
- u.current = l;
3741
+ const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, c = Se(l);
3742
+ c.current = l;
3592
3743
  const a = Ue(
3593
- (E) => {
3594
- const F = typeof E == "function" ? E(u.current) : E;
3744
+ (v) => {
3745
+ const F = typeof v == "function" ? v(c.current) : v;
3595
3746
  o ? o(F) : s(F);
3596
3747
  },
3597
3748
  [o]
3598
- ), [c, m] = Q(!1), d = Le(null), f = Le(null), h = ne(() => oo(e), [e]), b = ne(() => io(h), [h]), y = ne(() => {
3599
- const E = /* @__PURE__ */ new Set();
3749
+ ), [u, m] = Q(!1), d = Se(null), f = Se(null), h = ne(() => bo(e), [e]), b = ne(() => yo(h), [h]), _ = ne(() => {
3750
+ const v = /* @__PURE__ */ new Set();
3600
3751
  for (const F of e) {
3601
3752
  const C = F.photo_set != null && F.photo_set !== "" ? String(F.photo_set) : "default";
3602
- E.add(C);
3753
+ v.add(C);
3603
3754
  }
3604
- return [...E];
3605
- }, [e]), { minDepth: p, maxDepth: g } = ne(() => {
3755
+ return [...v];
3756
+ }, [e]), { minDepth: p, maxDepth: y } = ne(() => {
3606
3757
  if (!h.length) return { minDepth: 0, maxDepth: 0 };
3607
- const E = h.map((F) => F.to_depth ?? F.from_depth ?? 0);
3758
+ const v = h.map((F) => F.to_depth ?? F.from_depth ?? 0);
3608
3759
  return {
3609
3760
  minDepth: h[0].from_depth ?? 0,
3610
- maxDepth: Math.max(...E)
3761
+ maxDepth: Math.max(...v)
3611
3762
  };
3612
- }, [h]), M = Zt * We / 5, z = ne(
3613
- () => Math.max(1, Math.round((g - p) * M)),
3614
- [p, g, M]
3615
- ), D = ne(() => {
3616
- const E = lo(We);
3617
- return so(p, g, E);
3618
- }, [p, g]), x = 540 * We / 5, O = ne(
3763
+ }, [h]), M = Wt * We / 5, z = ne(
3764
+ () => Math.max(1, Math.round((y - p) * M)),
3765
+ [p, y, M]
3766
+ ), O = ne(() => {
3767
+ const v = _o(We);
3768
+ return go(p, y, v);
3769
+ }, [p, y]), k = 540 * We / 5, L = ne(
3619
3770
  () => Math.max(1, Math.min(10, Math.round(n * l.scale))),
3620
3771
  [n, l.scale]
3621
- ), $ = Ue((E) => {
3622
- E.preventDefault();
3623
- const F = E.deltaY < 0 ? zt : 1 / zt, C = f.current.getBoundingClientRect(), H = E.clientX - C.left, R = E.clientY - C.top;
3624
- a((v) => {
3625
- const k = Math.max(co, Math.min(uo, v.scale * F)), N = k / v.scale;
3772
+ ), $ = Ue((v) => {
3773
+ v.preventDefault();
3774
+ const F = v.deltaY < 0 ? vt : 1 / vt, C = f.current.getBoundingClientRect(), V = v.clientX - C.left, H = v.clientY - C.top;
3775
+ a((A) => {
3776
+ const E = Math.max(Mo, Math.min(zo, A.scale * F)), N = E / A.scale;
3626
3777
  return {
3627
- scale: k,
3628
- tx: H - (H - v.tx) * N,
3629
- ty: R - (R - v.ty) * N
3778
+ scale: E,
3779
+ tx: V - (V - A.tx) * N,
3780
+ ty: H - (H - A.ty) * N
3630
3781
  };
3631
3782
  });
3632
3783
  }, [a]);
3633
3784
  se(() => {
3634
- const E = f.current;
3635
- if (E)
3636
- return E.addEventListener("wheel", $, { passive: !1 }), () => E.removeEventListener("wheel", $);
3785
+ const v = f.current;
3786
+ if (v)
3787
+ return v.addEventListener("wheel", $, { passive: !1 }), () => v.removeEventListener("wheel", $);
3637
3788
  }, [$]);
3638
- const P = Ue((E) => {
3639
- E.button === 0 && (E.preventDefault(), d.current = {
3640
- x: E.clientX,
3641
- y: E.clientY,
3642
- tx: u.current.tx,
3643
- ty: u.current.ty
3789
+ const P = Ue((v) => {
3790
+ v.button === 0 && (v.preventDefault(), d.current = {
3791
+ x: v.clientX,
3792
+ y: v.clientY,
3793
+ tx: c.current.tx,
3794
+ ty: c.current.ty
3644
3795
  }, m(!0));
3645
3796
  }, []);
3646
3797
  return se(() => {
3647
- const E = (C) => {
3798
+ const v = (C) => {
3648
3799
  if (!d.current) return;
3649
- const { tx: H, ty: R, x: v, y: k } = d.current;
3800
+ const { tx: V, ty: H, x: A, y: E } = d.current;
3650
3801
  a((N) => ({
3651
3802
  ...N,
3652
- tx: H + (C.clientX - v),
3653
- ty: R + (C.clientY - k)
3803
+ tx: V + (C.clientX - A),
3804
+ ty: H + (C.clientY - E)
3654
3805
  }));
3655
3806
  }, F = () => {
3656
3807
  d.current = null, m(!1);
3657
3808
  };
3658
- return window.addEventListener("mousemove", E), window.addEventListener("mouseup", F), () => {
3659
- window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", F);
3809
+ return window.addEventListener("mousemove", v), window.addEventListener("mouseup", F), () => {
3810
+ window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", F);
3660
3811
  };
3661
3812
  }, [a]), /* @__PURE__ */ J("div", { className: "core-photo-table", children: [
3662
3813
  /* @__PURE__ */ J("div", { className: "core-photo-controls", children: [
3663
- t && /* @__PURE__ */ S("span", { className: "core-photo-hole-id", children: t }),
3814
+ t && /* @__PURE__ */ D("span", { className: "core-photo-hole-id", children: t }),
3664
3815
  /* @__PURE__ */ J("span", { className: "core-photo-zoom-label", children: [
3665
3816
  Math.round(l.scale * 100),
3666
3817
  "%"
3667
3818
  ] }),
3668
- /* @__PURE__ */ S(
3819
+ /* @__PURE__ */ D(
3669
3820
  "button",
3670
3821
  {
3671
3822
  className: "core-photo-zoom-btn",
@@ -3677,21 +3828,21 @@ function mo({
3677
3828
  )
3678
3829
  ] }),
3679
3830
  e.length > 0 && /* @__PURE__ */ J("div", { className: "core-photo-col-headers", children: [
3680
- /* @__PURE__ */ S("div", { className: "core-photo-ruler-spacer" }),
3681
- y.map((E) => /* @__PURE__ */ S(
3831
+ /* @__PURE__ */ D("div", { className: "core-photo-ruler-spacer" }),
3832
+ _.map((v) => /* @__PURE__ */ D(
3682
3833
  "div",
3683
3834
  {
3684
3835
  className: "core-photo-set-header",
3685
- style: { width: x },
3686
- children: E
3836
+ style: { width: k },
3837
+ children: v
3687
3838
  },
3688
- E
3839
+ v
3689
3840
  ))
3690
3841
  ] }),
3691
- e.length === 0 ? /* @__PURE__ */ S("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ S(
3842
+ e.length === 0 ? /* @__PURE__ */ D("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ D(
3692
3843
  "div",
3693
3844
  {
3694
- className: `core-photo-scroll${c ? " is-dragging" : ""}`,
3845
+ className: `core-photo-scroll${u ? " is-dragging" : ""}`,
3695
3846
  ref: f,
3696
3847
  onMouseDown: P,
3697
3848
  children: /* @__PURE__ */ J(
@@ -3704,64 +3855,64 @@ function mo({
3704
3855
  transformOrigin: "0 0"
3705
3856
  },
3706
3857
  children: [
3707
- /* @__PURE__ */ S(
3858
+ /* @__PURE__ */ D(
3708
3859
  "div",
3709
3860
  {
3710
3861
  className: "core-photo-depth-ruler",
3711
3862
  style: { height: z },
3712
- children: D.map(({ depth: E, label: F }) => /* @__PURE__ */ S(
3863
+ children: O.map(({ depth: v, label: F }) => /* @__PURE__ */ D(
3713
3864
  "div",
3714
3865
  {
3715
3866
  className: "core-photo-depth-marker",
3716
3867
  style: {
3717
- top: Math.round((E - p) * M)
3868
+ top: Math.round((v - p) * M)
3718
3869
  },
3719
3870
  children: F
3720
3871
  },
3721
- E
3872
+ v
3722
3873
  ))
3723
3874
  }
3724
3875
  ),
3725
- y.map((E) => /* @__PURE__ */ S(
3876
+ _.map((v) => /* @__PURE__ */ D(
3726
3877
  "div",
3727
3878
  {
3728
3879
  className: "core-photo-col-body",
3729
- style: { height: z, width: x },
3730
- children: b[E].map((F) => {
3731
- const C = F.from_depth ?? 0, H = F.to_depth ?? C, R = Math.round(
3880
+ style: { height: z, width: k },
3881
+ children: b[v].map((F) => {
3882
+ const C = F.from_depth ?? 0, V = F.to_depth ?? C, H = Math.round(
3732
3883
  (C - p) * M
3733
- ), v = Math.max(
3884
+ ), A = Math.max(
3734
3885
  2,
3735
- Math.round((H - C) * M)
3736
- ), k = ro(F, O);
3886
+ Math.round((V - C) * M)
3887
+ ), E = po(F, L);
3737
3888
  return /* @__PURE__ */ J(
3738
3889
  "div",
3739
3890
  {
3740
3891
  className: "core-photo-item",
3741
- style: { top: R, height: v, width: x },
3742
- title: `${C}–${H} m`,
3892
+ style: { top: H, height: A, width: k },
3893
+ title: `${C}–${V} m`,
3743
3894
  children: [
3744
- k ? /* @__PURE__ */ S(
3895
+ E ? /* @__PURE__ */ D(
3745
3896
  "img",
3746
3897
  {
3747
- src: k,
3748
- alt: `Core ${C}–${H} m`,
3898
+ src: E,
3899
+ alt: `Core ${C}–${V} m`,
3749
3900
  loading: "lazy"
3750
3901
  }
3751
- ) : /* @__PURE__ */ S("div", { className: "core-photo-no-image" }),
3752
- v >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
3902
+ ) : /* @__PURE__ */ D("div", { className: "core-photo-no-image" }),
3903
+ A >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
3753
3904
  C,
3754
3905
  "–",
3755
- H,
3906
+ V,
3756
3907
  " m"
3757
3908
  ] })
3758
3909
  ]
3759
3910
  },
3760
- `${F.hole_id ?? ""}-${C}-${H}-${E}`
3911
+ `${F.hole_id ?? ""}-${C}-${V}-${v}`
3761
3912
  );
3762
3913
  })
3763
3914
  },
3764
- E
3915
+ v
3765
3916
  ))
3766
3917
  ]
3767
3918
  }
@@ -3770,33 +3921,33 @@ function mo({
3770
3921
  )
3771
3922
  ] });
3772
3923
  }
3773
- function Ei({
3924
+ function Fi({
3774
3925
  holeId: e = "",
3775
3926
  trays: t = [],
3776
3927
  thumbBaseUrl: n = "",
3777
3928
  fullBaseUrl: r = "",
3778
3929
  photoSet: o = "Tray Images",
3779
- getFilename: i = Wt,
3930
+ getFilename: i = Kt,
3780
3931
  initialZoom: s = 5,
3781
3932
  transform: l,
3782
- onTransformChange: u
3933
+ onTransformChange: c
3783
3934
  }) {
3784
3935
  const a = ne(
3785
- () => ao(e, t, n, r, o, i),
3936
+ () => No(e, t, n, r, o, i),
3786
3937
  [e, t, n, r, o, i]
3787
3938
  );
3788
- return /* @__PURE__ */ S(
3789
- mo,
3939
+ return /* @__PURE__ */ D(
3940
+ vo,
3790
3941
  {
3791
3942
  photos: a,
3792
3943
  holeId: e,
3793
3944
  initialZoom: s,
3794
3945
  transform: l,
3795
- onTransformChange: u
3946
+ onTransformChange: c
3796
3947
  }
3797
3948
  );
3798
3949
  }
3799
- function ki(e) {
3950
+ function wi(e) {
3800
3951
  const t = typeof e == "string" ? JSON.parse(e) : e;
3801
3952
  if (t.schema_version !== "1.0")
3802
3953
  throw new Error(
@@ -3824,199 +3975,209 @@ function ki(e) {
3824
3975
  blocks: n
3825
3976
  };
3826
3977
  }
3827
- function fo(e) {
3828
- const t = new _.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
3978
+ function Eo(e) {
3979
+ const t = new g.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
3829
3980
  e.vertices.forEach(([o, i, s], l) => {
3830
3981
  n[l * 3] = o, n[l * 3 + 1] = i, n[l * 3 + 2] = s;
3831
- }), t.setAttribute("position", new _.BufferAttribute(n, 3));
3982
+ }), t.setAttribute("position", new g.BufferAttribute(n, 3));
3832
3983
  const r = new Uint32Array(e.triangles.length * 3);
3833
3984
  return e.triangles.forEach(([o, i, s], l) => {
3834
3985
  r[l * 3] = o, r[l * 3 + 1] = i, r[l * 3 + 2] = s;
3835
- }), t.setIndex(new _.BufferAttribute(r, 1)), t;
3986
+ }), t.setIndex(new g.BufferAttribute(r, 1)), t;
3836
3987
  }
3837
- function Ai(e, t, n = {}) {
3838
- const { defaultOpacity: r = 1 } = n, o = new _.Group();
3988
+ function Ti(e, t, n = {}) {
3989
+ const { defaultOpacity: r = 1 } = n, o = new g.Group();
3839
3990
  return t.blocks.forEach((i) => {
3840
- var b, y;
3841
- const s = fo(i), l = ((b = i.material) == null ? void 0 : b.color) ?? "#888888", u = ((y = i.material) == null ? void 0 : y.opacity) ?? r, a = u < 1, c = new _.MeshStandardMaterial({
3842
- color: new _.Color(l),
3843
- opacity: u,
3991
+ var b, _;
3992
+ const s = Eo(i), l = ((b = i.material) == null ? void 0 : b.color) ?? "#888888", c = ((_ = i.material) == null ? void 0 : _.opacity) ?? r, a = c < 1, u = new g.MeshStandardMaterial({
3993
+ color: new g.Color(l),
3994
+ opacity: c,
3844
3995
  transparent: a,
3845
- side: _.DoubleSide,
3996
+ side: g.DoubleSide,
3846
3997
  flatShading: !0
3847
- }), m = new _.Mesh(s, c);
3998
+ }), m = new g.Mesh(s, u);
3848
3999
  m.userData = {
3849
4000
  id: i.id,
3850
4001
  attributes: i.attributes
3851
4002
  };
3852
- const d = new _.EdgesGeometry(s, 15), f = new _.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), h = new _.LineSegments(d, f);
4003
+ const d = new g.EdgesGeometry(s, 15), f = new g.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), h = new g.LineSegments(d, f);
3853
4004
  h.visible = !1, m.add(h), o.add(m);
3854
4005
  }), e.add(o), o;
3855
4006
  }
3856
4007
  export {
3857
- mr as ASSAY_COLOR_PALETTE_10,
3858
- fn as ASSAY_NON_VALUE_FIELDS,
3859
- q as AZIMUTH,
4008
+ fr as ASSAY_COLOR_PALETTE_10,
4009
+ hn as ASSAY_NON_VALUE_FIELDS,
4010
+ X as AZIMUTH,
3860
4011
  qn as BASELODE_COLORWAY,
3861
- T as BASELODE_DARK,
3862
- ai as BASELODE_DARK_TEMPLATE,
3863
- li as BASELODE_DARK_TEMPLATE_NAME,
3864
- xo as BASELODE_DATA_MODEL_DRILL_ASSAY,
3865
- ko as BASELODE_DATA_MODEL_DRILL_COLLAR,
3866
- dn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
3867
- Ao as BASELODE_DATA_MODEL_DRILL_SURVEY,
3868
- vo as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
3869
- V as BASELODE_LIGHT,
3870
- si as BASELODE_LIGHT_TEMPLATE,
3871
- ii as BASELODE_LIGHT_TEMPLATE_NAME,
3872
- Ce as BASELODE_TEMPLATE,
3873
- Yn as BASELODE_TEMPLATE_NAME,
3874
- Zt as BASE_PIXELS_PER_METRE,
3875
- qe as BUILTIN_COLOUR_MAPS,
3876
- Ni as Baselode3DControls,
3877
- _i as Baselode3DScene,
3878
- Mi as BlockModelWidget,
3879
- lt as CHART_OPTIONS,
3880
- Mn as COMMENT_COLUMN_NAMES,
3881
- Ve as COMMODITY_COLOURS,
4012
+ w as BASELODE_DARK,
4013
+ _i as BASELODE_DARK_TEMPLATE,
4014
+ gi as BASELODE_DARK_TEMPLATE_NAME,
4015
+ To as BASELODE_DATA_MODEL_DRILL_ASSAY,
4016
+ Fo as BASELODE_DATA_MODEL_DRILL_COLLAR,
4017
+ mn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
4018
+ wo as BASELODE_DATA_MODEL_DRILL_SURVEY,
4019
+ $o as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
4020
+ R as BASELODE_LIGHT,
4021
+ yi as BASELODE_LIGHT_TEMPLATE,
4022
+ bi as BASELODE_LIGHT_TEMPLATE_NAME,
4023
+ Oe as BASELODE_TEMPLATE,
4024
+ Xn as BASELODE_TEMPLATE_NAME,
4025
+ Wt as BASE_PIXELS_PER_METRE,
4026
+ Xe as BUILTIN_COLOUR_MAPS,
4027
+ Si as Baselode3DControls,
4028
+ Di as Baselode3DScene,
4029
+ Li as BlockModelWidget,
4030
+ at as CHART_OPTIONS,
4031
+ zn as COMMENT_COLUMN_NAMES,
4032
+ Re as COMMODITY_COLOURS,
3882
4033
  Et as CRS,
3883
- mo as CorePhotoTable,
3884
- Ei as CorePhotoViewer,
3885
- mn as DEFAULT_COLUMN_MAP,
3886
- no as DEFAULT_LOD_BREAKPOINTS,
4034
+ vo as CorePhotoTable,
4035
+ Fi as CorePhotoViewer,
4036
+ fn as DEFAULT_COLUMN_MAP,
4037
+ ho as DEFAULT_LOD_BREAKPOINTS,
3887
4038
  W as DEPTH,
3888
- X as DIP,
3889
- Oe as DISPLAY_CATEGORICAL,
3890
- xe as DISPLAY_COMMENT,
4039
+ q as DIP,
4040
+ Le as DISPLAY_CATEGORICAL,
4041
+ ke as DISPLAY_COMMENT,
3891
4042
  $e as DISPLAY_HIDDEN,
3892
- ve as DISPLAY_NUMERIC,
4043
+ Ae as DISPLAY_NUMERIC,
3893
4044
  Je as DISPLAY_TADPOLE,
3894
4045
  pe as EASTING,
3895
- Ae as ELEVATION,
3896
- tr as ERROR_COLOR,
3897
- Xn as FALLBACK_COLOUR,
3898
- Lr as FOV_MAX_DEG,
3899
- Sr as FOV_MIN_DEG,
3900
- L as FROM,
4046
+ xe as ELEVATION,
4047
+ nr as ERROR_COLOR,
4048
+ Zn as FALLBACK_COLOUR,
4049
+ jr as FOV_MAX_DEG,
4050
+ Hr as FOV_MIN_DEG,
4051
+ S as FROM,
3901
4052
  ae as GEOLOGY_CODE,
3902
4053
  ce as GEOLOGY_DESCRIPTION,
3903
- at as HIDDEN_COLUMNS,
3904
- A as HOLE_ID,
4054
+ ct as HIDDEN_COLUMNS,
4055
+ x as HOLE_ID,
3905
4056
  oe as LATITUDE,
3906
- Zn as LITHOLOGY_COLOURS,
4057
+ Wn as LITHOLOGY_COLOURS,
3907
4058
  ie as LONGITUDE,
3908
4059
  Ie as MID,
3909
4060
  be as NORTHING,
3910
- Jn as NUMERIC_LINE_COLOR,
3911
- Qn as NUMERIC_MARKER_COLOR,
4061
+ Qn as NUMERIC_LINE_COLOR,
4062
+ er as NUMERIC_MARKER_COLOR,
3912
4063
  me as PROJECT_ID,
3913
- un as STRIKE,
3914
- w as TO,
3915
- mi as TracePlot,
3916
- Ai as addGradeBlocksToScene,
3917
- Gn as alphaBetaToNormal,
3918
- yi as annotationsFromIntervals,
3919
- Wo as assembleDataset,
3920
- Ho as attachAssayPositions,
3921
- Bo as balancedTangentialDesurvey,
3922
- An as buildAssayState,
3923
- ci as buildCategoricalStripLogConfig,
3924
- cr as buildCommentsConfig,
3925
- so as buildDepthMarkers,
3926
- fr as buildEqualRangeColorScale,
3927
- or as buildIntervalPoints,
4064
+ dn as STRIKE,
4065
+ T as TO,
4066
+ vi as TracePlot,
4067
+ Ti as addGradeBlocksToScene,
4068
+ Ir as addRasterOverlay,
4069
+ Un as alphaBetaToNormal,
4070
+ Oi as annotationsFromIntervals,
4071
+ li as assembleDataset,
4072
+ Jo as attachAssayPositions,
4073
+ Wo as balancedTangentialDesurvey,
4074
+ kn as buildAssayState,
4075
+ Ni as buildCategoricalStripLogConfig,
4076
+ ur as buildCommentsConfig,
4077
+ go as buildDepthMarkers,
4078
+ hr as buildEqualRangeColorScale,
4079
+ ir as buildIntervalPoints,
3928
4080
  Tt as buildPlotConfig,
3929
- di as buildStrikeDipSymbol,
3930
- Mr as buildStructuralDiscs,
3931
- ui as buildStructuralStripConfig,
3932
- ar as buildTadpoleConfig,
3933
- Vo as buildTraces,
3934
- ao as buildTrayPhotos,
3935
- it as buildViewSignature,
3936
- ei as calculateBlockVolume,
3937
- Fn as calculatePropertyStats,
3938
- zn as classifyColumns,
3939
- Zo as coerceNumeric,
3940
- Un as computeStructuralPositions,
3941
- Po as defaultChartType,
3942
- Wt as defaultTrayFilename,
3943
- zi as depthIntervalToPixels,
3944
- lo as depthMarkerInterval,
4081
+ zi as buildStrikeDipSymbol,
4082
+ zr as buildStructuralDiscs,
4083
+ Mi as buildStructuralStripConfig,
4084
+ cr as buildTadpoleConfig,
4085
+ Ko as buildTraces,
4086
+ No as buildTrayPhotos,
4087
+ st as buildViewSignature,
4088
+ di as calculateBlockVolume,
4089
+ wn as calculatePropertyStats,
4090
+ vn as classifyColumns,
4091
+ Pr as clearRasterOverlays,
4092
+ si as coerceNumeric,
4093
+ Yn as computeStructuralPositions,
4094
+ Ci as createRasterOverlay,
4095
+ Uo as defaultChartType,
4096
+ Kt as defaultTrayFilename,
4097
+ Pi as depthIntervalToPixels,
4098
+ _o as depthMarkerInterval,
3945
4099
  Be as deriveAssayProps,
3946
- wo as desurveyTraces,
3947
- Nr as dipAzimuthToNormal,
3948
- Cr as dolly,
3949
- Ar as emitViewChangeIfNeeded,
4100
+ qo as desurveyTraces,
4101
+ Mr as dipAzimuthToNormal,
4102
+ Rr as dolly,
4103
+ wr as emitViewChangeIfNeeded,
3950
4104
  Tn as filterBlocks,
3951
- Xo as filterByProject,
3952
- st as fitCameraToBounds,
3953
- Dr as focusOnLastBounds,
3954
- Qo as getBlockStats,
3955
- wr as getCategoryHexColor,
4105
+ ii as filterByProject,
4106
+ lt as fitCameraToBounds,
4107
+ Vr as focusOnLastBounds,
4108
+ ui as getBlockStats,
4109
+ qr as getCategoryHexColor,
3956
4110
  et as getChartOptions,
3957
- wn as getColorForValue,
3958
- Wn as getColour,
4111
+ $n as getColorForValue,
4112
+ Kn as getColour,
3959
4113
  Vt as getEqualRangeBinIndex,
3960
- pr as getEqualRangeColor,
3961
- Gt as getViewState,
3962
- fo as gradeBlockToThreeGeometry,
3963
- io as groupPhotosBySet,
3964
- Bn as groupRowsByHole,
3965
- rr as holeHasData,
3966
- jn as interpolateTrace,
3967
- gi as intervalsAsTubes,
3968
- qo as joinAssaysToTraces,
3969
- Fo as loadAssayFile,
3970
- kn as loadAssayHole,
4114
+ br as getEqualRangeColor,
4115
+ Sr as getRasterOverlay,
4116
+ Ut as getViewState,
4117
+ Eo as gradeBlockToThreeGeometry,
4118
+ yo as groupPhotosBySet,
4119
+ Rn as groupRowsByHole,
4120
+ or as holeHasData,
4121
+ Gn as interpolateTrace,
4122
+ Ii as intervalsAsTubes,
4123
+ oi as joinAssaysToTraces,
4124
+ Lr as listRasterOverlays,
4125
+ Yo as loadAssayFile,
4126
+ xn as loadAssayHole,
3971
4127
  En as loadAssayMetadata,
3972
- Uo as loadAssays,
3973
- Jo as loadBlockModelMetadata,
3974
- jo as loadCollars,
3975
- Yo as loadGeology,
3976
- ki as loadGradeBlocksFromJson,
3977
- Go as loadSurveys,
4128
+ ni as loadAssays,
4129
+ ci as loadBlockModelMetadata,
4130
+ ei as loadCollars,
4131
+ ri as loadGeology,
4132
+ wi as loadGradeBlocksFromJson,
4133
+ ti as loadSurveys,
3978
4134
  je as loadTable,
3979
- Do as logDataInfo,
3980
- Co as logDataWarning,
3981
- vr as lookDown,
3982
- In as minimumCurvatureDesurvey,
3983
- Pn as normalizeBlockRow,
3984
- Lo as normalizeCsvRow,
3985
- Te as normalizeFieldName,
3986
- Ir as pan,
4135
+ Vo as logDataInfo,
4136
+ Ro as logDataWarning,
4137
+ $r as lookDown,
4138
+ On as minimumCurvatureDesurvey,
4139
+ Fn as normalizeBlockRow,
4140
+ kr as normalizeBounds,
4141
+ jo as normalizeCsvRow,
4142
+ we as normalizeFieldName,
4143
+ Br as pan,
3987
4144
  Hn as parseAssayCsvTextToHoles,
3988
- yn as parseAssayHole,
3989
- So as parseAssayHoleIds,
4145
+ _n as parseAssayHole,
4146
+ Ho as parseAssayHoleIds,
3990
4147
  gn as parseAssayHoleIdsWithAssays,
3991
- _n as parseAssaysCSV,
3992
- Ko as parseBlockModelCSV,
3993
- Ro as parseDrillholesCSV,
3994
- Rn as parseGeologyCsvText,
4148
+ Nn as parseAssaysCSV,
4149
+ ai as parseBlockModelCSV,
4150
+ Qo as parseDrillholesCSV,
4151
+ jn as parseGeologyCsvText,
3995
4152
  Vn as parseStructuralCSV,
3996
- ri as parseStructuralIntervalsCSV,
3997
- ni as parseStructuralPointsCSV,
3998
- To as parseSurveyCSV,
3999
- oi as parseUnifiedDataset,
4000
- Oo as pickFirstPresent,
4001
- hi as planView,
4002
- br as projectTraceToSection,
4003
- xr as recenterCameraToOrigin,
4153
+ hi as parseStructuralIntervalsCSV,
4154
+ fi as parseStructuralPointsCSV,
4155
+ Xo as parseSurveyCSV,
4156
+ pi as parseUnifiedDataset,
4157
+ Go as pickFirstPresent,
4158
+ xi as planView,
4159
+ yr as projectTraceToSection,
4160
+ Tr as recenterCameraToOrigin,
4161
+ it as removeRasterOverlay,
4004
4162
  Ct as reorderHoleIds,
4005
- Kn as resolveColourMap,
4006
- pi as sectionView,
4163
+ Jn as resolveColourMap,
4164
+ ki as sectionView,
4007
4165
  gr as sectionWindow,
4008
- ro as selectPhotoLodUrl,
4009
- Pr as setControlMode,
4010
- Or as setFov,
4011
- kr as setViewState,
4012
- oo as sortPhotosByDepth,
4013
- ge as standardizeColumns,
4014
- Io as standardizeRowArray,
4015
- $o as tangentialDesurvey,
4016
- hn as toError,
4017
- bi as tracesAsSegments,
4018
- fi as useDrillholeTraceGrid,
4019
- ti as validateStructuralPoints,
4166
+ po as selectPhotoLodUrl,
4167
+ Ur as setControlMode,
4168
+ Gr as setFov,
4169
+ Dr as setRasterOverlayElevation,
4170
+ Or as setRasterOverlayOpacity,
4171
+ Cr as setRasterOverlayVisibility,
4172
+ Fr as setViewState,
4173
+ bo as sortPhotosByDepth,
4174
+ ye as standardizeColumns,
4175
+ Bo as standardizeRowArray,
4176
+ Zo as tangentialDesurvey,
4177
+ pn as toError,
4178
+ Ai as tracesAsSegments,
4179
+ Ei as useDrillholeTraceGrid,
4180
+ mi as validateStructuralPoints,
4020
4181
  Y as withDataErrorContext
4021
4182
  };
4022
4183
  //# sourceMappingURL=baselode.js.map