baselode 0.1.14 → 0.1.16

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 P, jsxs as J } from "react/jsx-runtime";
3
+ import { useRef as De, useState as Q, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
4
4
  import Fe from "plotly.js-dist-min";
5
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 = {
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 k = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "azimuth", q = "dip", F = "from", $ = "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
+ [k]: "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
+ [k]: "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
+ [$]: "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
+ [k]: "string",
45
45
  // The depth along the hole where the assay interval starts
46
- [L]: "number",
46
+ [F]: "number",
47
47
  // The depth along the hole where the assay interval ends
48
- [w]: "number",
48
+ [$]: "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
+ [k]: "string",
55
+ [F]: "number",
56
+ [$]: "number",
57
57
  [Ie]: "number",
58
58
  [ae]: "string",
59
59
  [ce]: "string"
60
- }, vo = {
61
- [A]: "string",
60
+ }, $o = {
61
+ [k]: "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
+ [k]: ["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
+ [F]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
79
+ [$]: ["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
117
  function ge(e, t = null, n = null) {
118
- const r = { ...xt };
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) {
133
+ function Ro(e, t = null, n = null) {
134
134
  return e.map((r) => ge(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 Bo(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) => ge(e, null, t);
189
+ function bn(e) {
190
+ return { holeId: e[k] };
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[k], 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[F]), s = Number(e[$]);
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
+ [k]: 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)[k];
228
228
  l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
229
229
  },
230
230
  complete: () => n(Array.from(o)),
@@ -232,10 +232,10 @@ 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 gn(e) {
236
+ return Object.entries(e || {}).some(([t, n]) => !(hn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
237
237
  }
238
- function gn(e, t = null) {
238
+ function yn(e, t = null) {
239
239
  return new Promise((n, r) => {
240
240
  const o = /* @__PURE__ */ new Map();
241
241
  te.parse(e, {
@@ -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 (!gn(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 = [],
@@ -337,18 +337,18 @@ function we({
337
337
  } = {}) {
338
338
  return e ? r.includes(e) ? "comment" : n.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !t || t === "categorical" || t === "comment" || t === "tadpole" ? o : t : t || o;
339
339
  }
340
- function Dt({
340
+ function St({
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
- 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] || "";
492
+ function Re(e = []) {
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,
@@ -500,14 +500,14 @@ function Be(e = []) {
500
500
  };
501
501
  }
502
502
  async function En(e, t = null) {
503
- return await gn(e);
503
+ return await yn(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 } = Re(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = St({
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[k] && 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 = ge(e, null, t), r = n[k], 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
+ [k]: 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[k] || f.holeId || f.id || "").toString().trim();
576
576
  if (!h) return;
577
- const b = h.toLowerCase();
578
- n.has(b) || n.set(b, f);
577
+ const g = h.toLowerCase();
578
+ n.has(g) || n.set(g, 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[k] || "").toString().trim();
583
583
  if (!h) return;
584
- const b = h.toLowerCase();
585
- l.has(b) || l.set(b, []), l.get(b).push(f);
584
+ const g = h.toLowerCase();
585
+ l.has(g) || l.set(g, []), l.get(g).push(f);
586
586
  });
587
- const u = [];
587
+ const c = [];
588
588
  return l.forEach((f, h) => {
589
- const b = n.get(h);
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));
589
+ const g = n.get(h);
590
+ if (!g) return;
591
+ const y = f.filter((O) => Number.isFinite(O[W] ?? O.surveydepth)).sort((O, V) => (O[W] ?? O.surveydepth) - (V[W] ?? V.surveydepth));
592
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,
593
+ const p = g.lat ?? g[oe], b = g.lng ?? g[ie], N = 111132, M = 111320 * Math.cos(p * Math.PI / 180), I = (b - o) * s, x = (p - r) * i, S = [];
594
+ let w = 0, D = 0, v = 0;
595
+ for (let O = 0; O < y.length; O += 1) {
596
+ const V = y[O], H = y[O - 1], A = V[W] ?? V.surveydepth, E = V[X] ?? V.azimuth, z = V[q] ?? V.dip;
597
+ if (!H) {
598
+ S.push({
599
+ x: I + w,
600
+ y: x + D,
601
601
  z: 0,
602
- md: v,
603
- azimuth: k,
604
- dip: N
602
+ md: A,
603
+ azimuth: E,
604
+ dip: z
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 R = H[W] ?? H.surveydepth, C = H[X] ?? H.azimuth, G = H[q] ?? H.dip, U = A - R;
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(z), K = Qe(C), le = Qe(E), ye = 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 = ye > 1e-6 ? 2 / ye * Math.tan(ye / 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
+ w += Ce, D += he, v += Ge, S.push({
614
+ x: I + w,
615
+ y: x + D,
616
+ z: -v,
617
617
  // render with z up; depth down
618
- md: v,
619
- azimuth: k,
620
- dip: N
618
+ md: A,
619
+ azimuth: E,
620
+ dip: z
621
621
  });
622
622
  }
623
- const F = O.map((C) => ({
624
- ...C,
625
- lat: p + C.y / M,
626
- lng: g + C.x / z
623
+ const L = S.map((O) => ({
624
+ ...O,
625
+ lat: p + O.y / N,
626
+ lng: b + O.x / M
627
627
  }));
628
- u.push({
629
- id: b[A] || b.holeId || h,
630
- project: b[me] || b.project_id || b.project || "",
631
- points: F,
632
- collar: b
628
+ c.push({
629
+ id: g[k] || g.holeId || h,
630
+ project: g[me] || g.project_id || g.project || "",
631
+ points: L,
632
+ collar: g
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,71 +697,71 @@ 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);
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 = {
714
+ const g = [...d].map((S) => ({
715
+ ...S,
716
+ from: re(S.from),
717
+ azimuth: re(S.azimuth),
718
+ dip: re(S.dip)
719
+ })).filter((S) => Number.isFinite(S.from) && Number.isFinite(S.azimuth) && Number.isFinite(S.dip)).sort((S, w) => S.from - w.from);
720
+ if (!g.length) return;
721
+ let y = re(h.x, 0), p = re(h.y, 0), b = re(h.z, 0), N = g[0].from;
722
+ const M = g[0].azimuth, I = g[0].dip, x = {
723
723
  hole_id: f,
724
- md: M,
724
+ md: N,
725
725
  x: y,
726
726
  y: p,
727
- z: g,
728
- azimuth: z,
729
- dip: D
727
+ z: b,
728
+ azimuth: M,
729
+ dip: I
730
730
  };
731
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;
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;
732
+ for (let S = 0; S < g.length - 1; S += 1) {
733
+ const w = g[S], D = g[S + 1], v = w.from, O = D.from - v;
734
+ if (O <= 0) continue;
735
+ const V = Math.max(1, Math.ceil(O / s)), H = O / V;
736
+ for (let A = 0; A < V; A += 1) {
737
+ N += H;
738
+ const E = (N - v) / O, z = w.azimuth + E * (D.azimuth - w.azimuth), R = w.dip + E * (D.dip - w.dip), C = In(H, w.azimuth, w.dip, D.azimuth, D.dip, i);
739
+ y += C.dx, p += C.dy, b += C.dz;
740
740
  const G = {
741
741
  hole_id: f,
742
- md: M,
742
+ md: N,
743
743
  x: y,
744
744
  y: p,
745
- z: g,
746
- azimuth: i === "minimum_curvature" ? N : I.azimuth,
747
- dip: i === "minimum_curvature" ? B : I.dip
745
+ z: b,
746
+ azimuth: i === "minimum_curvature" ? z : C.azimuth,
747
+ dip: i === "minimum_curvature" ? R : C.dip
748
748
  };
749
749
  l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (G[l.aliasCol] = h[l.aliasCol]), m.push(G);
750
750
  }
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,20 +801,20 @@ 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 = ge(l, null, t), u = a[k], m = u !== void 0 ? `${u}`.trim() : "", d = a[pe] ?? a.x, f = a[be] ?? a.y, h = a[xe] ?? a.z, g = 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,
809
- order: b,
809
+ order: g,
810
810
  x: Number(d) ?? 0,
811
811
  y: Number(f) ?? 0,
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,29 +838,29 @@ 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
- function Dn(e = [], t = "Intervals") {
848
+ function Sn(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, [k, F, $]), 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[k]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[F]), l = Number(o == null ? void 0 : o[$]);
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
  });
862
862
  }
863
- function Sn(e, t = {}) {
863
+ function Dn(e, t = {}) {
864
864
  return new Promise((n, r) => {
865
865
  te.parse(e, {
866
866
  header: !0,
@@ -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
- s = await Sn(e, i);
889
+ s = await Dn(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) => k in d))
901
+ throw Y("loadCollars", new Error(`Collar table missing column: ${k}`));
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 (k in f) {
908
+ const h = f[k];
909
+ f[k] = 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) && k in f && (f.datasource_hole_id = f[k]), 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[k] || 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 = [k, 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 (k in u) {
929
+ const m = u[k];
930
+ u[k] = 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])), $ in u && (u[$] = ee(u[$])), 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[k] || !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, [k, 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 = [k, F, $];
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 (k in u) {
950
+ const m = u[k];
951
+ u[k] = 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 F in u && (u[F] = ee(u[F])), $ in u && (u[$] = ee(u[$])), F in u && $ in u && Number.isFinite(u[F]) && Number.isFinite(u[$]) && (u[Ie] = 0.5 * (u[F] + u[$])), 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[k] || !Number.isFinite(a[F]) || !Number.isFinite(a[$]) || !(a[$] > a[F]))))
956
956
  throw Y("loadAssays", new Error("Assay table has missing required values"));
957
- return Pe(l, [A, L, w]);
957
+ return Pe(l, [k, F, $]);
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 = [k, F, $];
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 (k in m) {
971
+ const h = m[k];
972
+ m[k] = 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
+ F in m && (m[F] = ee(m[F])), $ in m && (m[$] = ee(m[$])), F in m && $ in m && Number.isFinite(m[F]) && Number.isFinite(m[$]) && (m[$] === m[F] && (m[F] = Math.round(m[F] * 1e3) / 1e3, m[$] = m[F] + 1e-3), m[Ie] = 0.5 * (m[F] + m[$]));
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[k] || !Number.isFinite(u[F]) || !Number.isFinite(u[$]) || !(u[$] > u[F]))))
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
- if (Dn(l, "Geology"), !r) {
986
- const c = new Set(Object.keys(dn));
985
+ if (Sn(l, "Geology"), !r) {
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
+ [k, F, $]
990
990
  );
991
991
  }
992
- return Pe(l, [A, L, w]);
992
+ return Pe(l, [k, F, $]);
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 : [k];
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 Dt = ["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,29 +1044,29 @@ 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
- (l) => !St.includes(l)
1069
+ (l) => !Dt.includes(l)
1070
1070
  );
1071
1071
  t({ data: i, properties: s });
1072
1072
  },
@@ -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
- (r) => !St.includes(r)
1100
+ (r) => !Dt.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;
@@ -1127,55 +1127,55 @@ function wn(e, t, n) {
1127
1127
  return new n.Color().setHSL(o / 360, 0.7, 0.5);
1128
1128
  }
1129
1129
  const nt = (e, t = null) => ge(e, null, t);
1130
- function $n(e) {
1130
+ function Rn(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 = F in 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[k] !== void 0 ? `${e[k]}`.trim() : "";
1141
1141
  if (!t) return null;
1142
1142
  const n = de(e[W]);
1143
1143
  return n === null ? null : {
1144
- [A]: t,
1144
+ [k]: 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[k] !== void 0 ? `${e[k]}`.trim() : "";
1154
1154
  if (!t) return null;
1155
- const n = de(e[L]), r = de(e[w]);
1155
+ const n = de(e[F]), r = de(e[$]);
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
+ [k]: t,
1160
+ [F]: n,
1161
+ [$]: 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 Bn(e, t = k) {
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 = Rn(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 = ge(i), l = s[k] != null ? `${s[k]}`.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[F]), a = Number(s[$]);
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
+ [k]: l,
1266
+ [F]: c,
1267
+ [$]: 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[F] - c[F])
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 = ge(o), s = (i[k] ?? "").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[F]), c = Number(i[$]);
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
+ [k]: s,
1300
+ [F]: l,
1301
+ [$]: c,
1302
1302
  [Ie]: a,
1303
1303
  [W]: a,
1304
1304
  _source: "geology"
@@ -1308,96 +1308,141 @@ 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[F] - l[F])
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 }) => Bn(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 bi(e, t, n, r, o = {}) {
1338
+ const i = o.fromCol || "from", s = o.toCol || "to", l = o.holeCol || "hole_id";
1339
+ if (!e || !e.length) return [];
1340
+ const c = {};
1341
+ for (const u of e) {
1342
+ const m = u[l];
1343
+ m != null && (c[m] || (c[m] = []), c[m].push(u));
1344
+ }
1345
+ const a = [];
1346
+ for (const [u, m] of Object.entries(c)) {
1347
+ const f = [...m].sort((p, b) => Number(p[i]) - Number(b[i])).filter((p) => {
1348
+ const b = Number(p[t]);
1349
+ return Number.isFinite(b) && b >= n;
1350
+ });
1351
+ if (!f.length) continue;
1352
+ const h = [];
1353
+ let g = [], y = null;
1354
+ for (const p of f) {
1355
+ const b = Number(p[i]), N = Number(p[s]);
1356
+ y === null || Math.abs(b - y) > 1e-6 ? (g.length && h.push(g), g = [p]) : g.push(p), y = N;
1357
+ }
1358
+ g.length && h.push(g);
1359
+ for (const p of h) {
1360
+ const b = Number(p[0][i]), N = Number(p[p.length - 1][s]), M = N - b;
1361
+ if (M < r) continue;
1362
+ let I = 0, x = 0;
1363
+ for (const v of p) {
1364
+ const L = Number(v[t]), O = Number(v[s]) - Number(v[i]);
1365
+ I += L * O, x += O;
1366
+ }
1367
+ const S = I / x, w = p.length, D = `${M.toFixed(1)} m @ ${S.toFixed(2)} ${t}`;
1368
+ a.push({
1369
+ [l]: u,
1370
+ assay_field: t,
1371
+ [i]: b,
1372
+ [s]: N,
1373
+ length: M,
1374
+ avg_grade: S,
1375
+ n_samples: w,
1376
+ label: D
1377
+ });
1378
+ }
1379
+ }
1380
+ return a;
1381
+ }
1382
+ function Gn(e, t) {
1338
1383
  if (!e || e.length === 0 || !Number.isFinite(t)) return null;
1339
1384
  const n = e.length;
1340
1385
  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 };
1386
+ const b = e[0];
1387
+ return { x: Number(b.x), y: Number(b.y), z: Number(b.z), dx: 0, dy: 0, dz: -1 };
1343
1388
  }
1344
1389
  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);
1347
- if (t >= M && t <= z) {
1348
- r = g;
1390
+ for (let b = 0; b < n - 1; b++) {
1391
+ const N = Number(e[b].md), M = Number(e[b + 1].md);
1392
+ if (t >= N && t <= M) {
1393
+ r = b;
1349
1394
  break;
1350
1395
  }
1351
1396
  }
1352
1397
  let o, i, s;
1353
1398
  if (r === -1) {
1354
1399
  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;
1400
+ const b = Number(o.md), M = Number(i.md) - b;
1401
+ s = M > 0 ? (t - b) / M : t < b ? 0 : 1;
1357
1402
  } else {
1358
1403
  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;
1404
+ const b = Number(o.md), M = Number(i.md) - b;
1405
+ s = M > 0 ? (t - b) / M : 0;
1361
1406
  }
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);
1407
+ 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));
1408
+ let u, m, d;
1409
+ const f = Number(o.azimuth), h = Number(o.dip), g = Number(i.azimuth), y = Number(i.dip);
1365
1410
  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);
1411
+ const b = Number.isFinite(g) && Number.isFinite(y) ? f + s * (g - f) : f, N = Number.isFinite(g) && Number.isFinite(y) ? h + s * (y - h) : h, M = b * Math.PI / 180, I = N * Math.PI / 180;
1412
+ u = Math.cos(I) * Math.sin(M), m = Math.cos(I) * Math.cos(M), d = -Math.sin(I);
1368
1413
  } 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]);
1414
+ const b = Number(i.x) - Number(o.x), N = Number(i.y) - Number(o.y), M = Number(i.z) - Number(o.z), I = Math.sqrt(b * b + N * N + M * M);
1415
+ if (I < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
1416
+ u = b / I, m = N / I, d = M / I;
1417
+ }
1418
+ const p = Math.sqrt(u * u + m * m + d * d);
1419
+ 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 };
1420
+ }
1421
+ function Un(e, t, n, r = {}) {
1422
+ const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
1423
+ let u = [0, 0, 1];
1424
+ const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
1425
+ Math.abs(m) > 0.99 && (u = [0, 1, 0]);
1381
1426
  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]
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 = [
1427
+ u[1] * a[2] - u[2] * a[1],
1428
+ u[2] * a[0] - u[0] * a[2],
1429
+ u[0] * a[1] - u[1] * a[0]
1430
+ ], 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], g = [
1386
1431
  a[1] * h[2] - a[2] * h[1],
1387
1432
  a[2] * h[0] - a[0] * h[2],
1388
1433
  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]
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 };
1399
- }
1400
- function Un(e, t, n = {}) {
1434
+ ], y = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), p = y > 1e-10 ? [g[0] / y, g[1] / y, g[2] / y] : [0, 1, 0], b = o === "R" ? h : p, N = t * Math.PI / 180 * i, M = Math.cos(N), I = Math.sin(N), x = b[0] * a[0] + b[1] * a[1] + b[2] * a[2], S = [
1435
+ a[1] * b[2] - a[2] * b[1],
1436
+ a[2] * b[0] - a[0] * b[2],
1437
+ a[0] * b[1] - a[1] * b[0]
1438
+ ], w = [
1439
+ b[0] * M + S[0] * I + a[0] * x * (1 - M),
1440
+ b[1] * M + S[1] * I + a[1] * x * (1 - M),
1441
+ b[2] * M + S[2] * I + a[2] * x * (1 - M)
1442
+ ], D = (90 - e) * Math.PI / 180, v = Math.cos(D), L = Math.sin(D), O = v * w[0] + L * a[0], V = v * w[1] + L * a[1], H = v * w[2] + L * a[2], A = Math.sqrt(O * O + V * V + H * H);
1443
+ return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: O / A, ny: V / A, nz: H / A };
1444
+ }
1445
+ function Yn(e, t, n = {}) {
1401
1446
  if (!(e != null && e.length) || !(t != null && t.length)) return [];
1402
1447
  const r = /* @__PURE__ */ new Map();
1403
1448
  for (const i of t) {
@@ -1412,27 +1457,27 @@ function Un(e, t, n = {}) {
1412
1457
  if (!s) continue;
1413
1458
  const l = r.get(s);
1414
1459
  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);
1460
+ const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
1461
+ if (!Number.isFinite(c)) continue;
1462
+ const a = Gn(l, c);
1418
1463
  if (!a) continue;
1419
- const { x: c, y: m, z: d, dx: f, dy: h, dz: b } = a;
1420
- let y, p, g;
1421
- const M = i.alpha != null ? Number(i.alpha) : null, z = i.beta != null ? Number(i.beta) : null;
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;
1464
+ const { x: u, y: m, z: d, dx: f, dy: h, dz: g } = a;
1465
+ let y, p, b;
1466
+ const N = i.alpha != null ? Number(i.alpha) : null, M = i.beta != null ? Number(i.beta) : null;
1467
+ if (Number.isFinite(N)) {
1468
+ const I = Number.isFinite(M) ? M : 0, x = Un(N, I, { dx: f, dy: h, dz: g }, n);
1469
+ y = x.nx, p = x.ny, b = x.nz;
1425
1470
  } 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);
1471
+ const I = i.dip != null ? Number(i.dip) : null, x = i.azimuth != null ? Number(i.azimuth) : null;
1472
+ if (!Number.isFinite(I) || !Number.isFinite(x)) continue;
1473
+ const S = I * Math.PI / 180, w = x * Math.PI / 180;
1474
+ y = Math.sin(w) * Math.sin(S), p = Math.cos(w) * Math.sin(S), b = Math.cos(S);
1430
1475
  }
1431
- o.push({ ...i, x: c, y: m, z: d, nx: y, ny: p, nz: g });
1476
+ o.push({ ...i, x: u, y: m, z: d, nx: y, ny: p, nz: b });
1432
1477
  }
1433
1478
  return o;
1434
1479
  }
1435
- const Yn = "baselode", ii = Yn, qn = [
1480
+ const Xn = "baselode", gi = Xn, qn = [
1436
1481
  "#8b1e3f",
1437
1482
  "#2563eb",
1438
1483
  "#16a34a",
@@ -1443,7 +1488,7 @@ const Yn = "baselode", ii = Yn, qn = [
1443
1488
  "#10b981",
1444
1489
  "#f97316",
1445
1490
  "#8b5cf6"
1446
- ], V = {
1491
+ ], B = {
1447
1492
  bg: "#ffffff",
1448
1493
  panel: "#f8fafc",
1449
1494
  ink: "#1e293b",
@@ -1457,31 +1502,31 @@ const Yn = "baselode", ii = Yn, qn = [
1457
1502
  muted_3: "#e2e8f0",
1458
1503
  primary: "#8b1e3f",
1459
1504
  primary_2: "#a8324f"
1460
- }, Ce = {
1505
+ }, Oe = {
1461
1506
  layout: {
1462
- paper_bgcolor: V.bg,
1463
- plot_bgcolor: V.bg,
1507
+ paper_bgcolor: B.bg,
1508
+ plot_bgcolor: B.bg,
1464
1509
  colorway: qn,
1465
1510
  font: {
1466
1511
  family: "Inter, system-ui, sans-serif",
1467
1512
  size: 12,
1468
- color: V.ink
1513
+ color: B.ink
1469
1514
  },
1470
1515
  title: {
1471
- font: { size: 14, color: V.ink },
1516
+ font: { size: 14, color: B.ink },
1472
1517
  x: 0.05
1473
1518
  },
1474
1519
  hovermode: "x unified",
1475
1520
  hoverlabel: {
1476
- bgcolor: V.bg,
1477
- bordercolor: V.line,
1478
- font: { size: 12, color: V.ink }
1521
+ bgcolor: B.bg,
1522
+ bordercolor: B.line,
1523
+ font: { size: 12, color: B.ink }
1479
1524
  },
1480
1525
  legend: {
1481
1526
  bgcolor: "rgba(255,255,255,0.9)",
1482
- bordercolor: V.muted_3,
1527
+ bordercolor: B.muted_3,
1483
1528
  borderwidth: 1,
1484
- font: { size: 11, color: V.ink },
1529
+ font: { size: 11, color: B.ink },
1485
1530
  orientation: "h",
1486
1531
  yanchor: "bottom",
1487
1532
  y: 1.02,
@@ -1491,34 +1536,34 @@ const Yn = "baselode", ii = Yn, qn = [
1491
1536
  xaxis: {
1492
1537
  showline: !0,
1493
1538
  linewidth: 1,
1494
- linecolor: V.line,
1539
+ linecolor: B.line,
1495
1540
  mirror: !1,
1496
1541
  ticks: "outside",
1497
1542
  tickwidth: 1,
1498
- tickcolor: V.line,
1543
+ tickcolor: B.line,
1499
1544
  ticklen: 4,
1500
1545
  showgrid: !0,
1501
- gridcolor: V.grid,
1546
+ gridcolor: B.grid,
1502
1547
  gridwidth: 1,
1503
1548
  zeroline: !1,
1504
- title_font: { color: V.ink, size: 12 },
1505
- tickfont: { color: V.ink_soft, size: 10 }
1549
+ title_font: { color: B.ink, size: 12 },
1550
+ tickfont: { color: B.ink_soft, size: 10 }
1506
1551
  },
1507
1552
  yaxis: {
1508
1553
  showline: !0,
1509
1554
  linewidth: 1,
1510
- linecolor: V.line,
1555
+ linecolor: B.line,
1511
1556
  mirror: !1,
1512
1557
  ticks: "outside",
1513
1558
  tickwidth: 1,
1514
- tickcolor: V.line,
1559
+ tickcolor: B.line,
1515
1560
  ticklen: 4,
1516
1561
  showgrid: !0,
1517
- gridcolor: V.grid,
1562
+ gridcolor: B.grid,
1518
1563
  gridwidth: 1,
1519
1564
  zeroline: !1,
1520
- title_font: { color: V.ink, size: 12 },
1521
- tickfont: { color: V.ink_soft, size: 10 }
1565
+ title_font: { color: B.ink, size: 12 },
1566
+ tickfont: { color: B.ink_soft, size: 10 }
1522
1567
  },
1523
1568
  modebar: {
1524
1569
  remove: ["select2d", "lasso2d", "autoScale2d"]
@@ -1529,34 +1574,34 @@ const Yn = "baselode", ii = Yn, qn = [
1529
1574
  data: {
1530
1575
  scatter: [{
1531
1576
  mode: "lines+markers",
1532
- line: { width: 2, color: V.primary },
1577
+ line: { width: 2, color: B.primary },
1533
1578
  marker: {
1534
1579
  size: 7,
1535
- color: V.primary_2,
1536
- line: { width: 1.5, color: V.bg }
1580
+ color: B.primary_2,
1581
+ line: { width: 1.5, color: B.bg }
1537
1582
  }
1538
1583
  }],
1539
1584
  bar: [{
1540
1585
  marker: {
1541
- color: V.primary,
1542
- line: { color: V.bg, width: 0 }
1586
+ color: B.primary,
1587
+ line: { color: B.bg, width: 0 }
1543
1588
  }
1544
1589
  }],
1545
1590
  histogram: [{
1546
1591
  marker: {
1547
- color: V.primary,
1548
- line: { color: V.bg, width: 0 }
1592
+ color: B.primary,
1593
+ line: { color: B.bg, width: 0 }
1549
1594
  }
1550
1595
  }],
1551
1596
  box: [{
1552
- fillcolor: V.accent,
1553
- line: { color: V.ink, width: 1.5 },
1554
- marker: { color: V.ink }
1597
+ fillcolor: B.accent,
1598
+ line: { color: B.ink, width: 1.5 },
1599
+ marker: { color: B.ink }
1555
1600
  }],
1556
1601
  violin: [{
1557
- fillcolor: V.accent,
1558
- line: { color: V.ink, width: 1.5 },
1559
- marker: { color: V.ink }
1602
+ fillcolor: B.accent,
1603
+ line: { color: B.ink, width: 1.5 },
1604
+ marker: { color: B.ink }
1560
1605
  }],
1561
1606
  heatmap: [{
1562
1607
  colorscale: [
@@ -1568,9 +1613,9 @@ const Yn = "baselode", ii = Yn, qn = [
1568
1613
  [1, "#1e293b"]
1569
1614
  ],
1570
1615
  colorbar: {
1571
- outlinecolor: V.line,
1572
- tickcolor: V.line,
1573
- tickfont: { color: V.ink_soft }
1616
+ outlinecolor: B.line,
1617
+ tickcolor: B.line,
1618
+ tickfont: { color: B.ink_soft }
1574
1619
  }
1575
1620
  }],
1576
1621
  contour: [{
@@ -1582,13 +1627,13 @@ const Yn = "baselode", ii = Yn, qn = [
1582
1627
  [1, "#1e293b"]
1583
1628
  ],
1584
1629
  colorbar: {
1585
- outlinecolor: V.line,
1586
- tickcolor: V.line,
1587
- tickfont: { color: V.ink_soft }
1630
+ outlinecolor: B.line,
1631
+ tickcolor: B.line,
1632
+ tickfont: { color: B.ink_soft }
1588
1633
  }
1589
1634
  }]
1590
1635
  }
1591
- }, si = Ce, T = {
1636
+ }, yi = Oe, T = {
1592
1637
  bg: "#1b1b1f",
1593
1638
  panel: "#25252a",
1594
1639
  ink: "#f0f0e4",
@@ -1600,7 +1645,7 @@ const Yn = "baselode", ii = Yn, qn = [
1600
1645
  muted_1: "#8a8a80",
1601
1646
  muted_2: "#5e5e56",
1602
1647
  muted_3: "#3a3a34"
1603
- }, li = "baselode-dark", ai = {
1648
+ }, _i = "baselode-dark", Ni = {
1604
1649
  layout: {
1605
1650
  font: {
1606
1651
  family: "Inter, Arial, sans-serif",
@@ -1743,7 +1788,7 @@ const Yn = "baselode", ii = Yn, qn = [
1743
1788
  }
1744
1789
  }]
1745
1790
  }
1746
- }, Xn = "#7f7f7f", Ve = {
1791
+ }, Zn = "#7f7f7f", Be = {
1747
1792
  Au: "#FFD700",
1748
1793
  // gold
1749
1794
  Ag: "#C0C0C0",
@@ -1780,7 +1825,7 @@ const Yn = "baselode", ii = Yn, qn = [
1780
1825
  // aluminium / yellow
1781
1826
  U: "#8BC34A"
1782
1827
  // uranium / lime green
1783
- }, Zn = {
1828
+ }, Wn = {
1784
1829
  // Sedimentary
1785
1830
  shale: "#607D8B",
1786
1831
  mudstone: "#78909C",
@@ -1819,11 +1864,11 @@ const Yn = "baselode", ii = Yn, qn = [
1819
1864
  calcite: "#F9FBE7",
1820
1865
  vein: "#FFFFFF",
1821
1866
  unknown: "#9E9E9E"
1822
- }, qe = {
1823
- commodity: Ve,
1824
- lithology: Zn
1867
+ }, Xe = {
1868
+ commodity: Be,
1869
+ lithology: Wn
1825
1870
  };
1826
- function Wn(e, t, n = Xn) {
1871
+ function Kn(e, t, n = Zn) {
1827
1872
  if (!t || e == null) return n;
1828
1873
  const r = String(e).trim();
1829
1874
  if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
@@ -1832,13 +1877,13 @@ function Wn(e, t, n = Xn) {
1832
1877
  if (String(i).trim().toLowerCase() === o) return s;
1833
1878
  return n;
1834
1879
  }
1835
- function Kn(e) {
1880
+ function Jn(e) {
1836
1881
  if (e == null) return {};
1837
1882
  if (typeof e == "string") {
1838
1883
  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(", ");
1884
+ if (Object.prototype.hasOwnProperty.call(Xe, t))
1885
+ return Xe[t];
1886
+ const n = Object.keys(Xe).sort().join(", ");
1842
1887
  throw new RangeError(
1843
1888
  `Unknown built-in colour map '${e}'. Available maps: ${n}`
1844
1889
  );
@@ -1848,39 +1893,39 @@ function Kn(e) {
1848
1893
  `colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
1849
1894
  );
1850
1895
  }
1851
- const Jn = "#8b1e3f", Qn = "#a8324f";
1852
- function er(e) {
1896
+ const Qn = "#8b1e3f", er = "#a8324f";
1897
+ function tr(e) {
1853
1898
  if (!e) return null;
1854
1899
  const t = e.split(/[_\-/\s]+/);
1855
1900
  for (const n of t) {
1856
- if (Object.prototype.hasOwnProperty.call(Ve, n))
1857
- return Ve[n];
1901
+ if (Object.prototype.hasOwnProperty.call(Be, n))
1902
+ return Be[n];
1858
1903
  const r = n.toLowerCase();
1859
- for (const [o, i] of Object.entries(Ve))
1904
+ for (const [o, i] of Object.entries(Be))
1860
1905
  if (o.toLowerCase() === r) return i;
1861
1906
  }
1862
1907
  return null;
1863
1908
  }
1864
- const tr = "#6b7280", nr = { l: 42, r: 4, t: 4, b: 30 }, mt = 10, ft = 12;
1865
- function ht(e) {
1909
+ const nr = "#6b7280", rr = { l: 42, r: 4, t: 4, b: 30 }, ft = 10, ht = 12;
1910
+ function pt(e) {
1866
1911
  return e ? typeof e == "string" ? { text: e } : e : {};
1867
1912
  }
1868
- function Ft(e = {}) {
1869
- const t = ht(e.xaxis && e.xaxis.title), n = ht(e.yaxis && e.yaxis.title);
1913
+ function wt(e = {}) {
1914
+ const t = pt(e.xaxis && e.xaxis.title), n = pt(e.yaxis && e.yaxis.title);
1870
1915
  return {
1871
1916
  ...e,
1872
- margin: nr,
1917
+ margin: rr,
1873
1918
  autosize: !0,
1874
1919
  width: void 0,
1875
1920
  xaxis: {
1876
1921
  ...e.xaxis || {},
1877
1922
  tickfont: {
1878
1923
  ...e.xaxis && e.xaxis.tickfont || {},
1879
- size: mt
1924
+ size: ft
1880
1925
  },
1881
1926
  title: {
1882
1927
  ...t,
1883
- font: { ...t.font || {}, size: ft }
1928
+ font: { ...t.font || {}, size: ht }
1884
1929
  }
1885
1930
  },
1886
1931
  yaxis: {
@@ -1888,16 +1933,16 @@ function Ft(e = {}) {
1888
1933
  automargin: !0,
1889
1934
  tickfont: {
1890
1935
  ...e.yaxis && e.yaxis.tickfont || {},
1891
- size: mt
1936
+ size: ft
1892
1937
  },
1893
1938
  title: {
1894
1939
  ...n,
1895
- font: { ...n.font || {}, size: ft }
1940
+ font: { ...n.font || {}, size: ht }
1896
1941
  }
1897
1942
  }
1898
1943
  };
1899
1944
  }
1900
- function rr(e, t) {
1945
+ function or(e, t) {
1901
1946
  var r;
1902
1947
  if (!e || !t) return !1;
1903
1948
  const n = e.points || [];
@@ -1908,40 +1953,40 @@ function rr(e, t) {
1908
1953
  }
1909
1954
  return !1;
1910
1955
  }
1911
- function or(e, t, n) {
1956
+ function ir(e, t, n) {
1912
1957
  if (!e || !t) return [];
1913
1958
  const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
1914
1959
  return r.forEach((s) => {
1915
1960
  let l = Number(
1916
1961
  s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
1917
- ), u = Number(
1962
+ ), c = Number(
1918
1963
  s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
1919
1964
  );
1920
- if (!Number.isFinite(l) || !Number.isFinite(u)) {
1965
+ if (!Number.isFinite(l) || !Number.isFinite(c)) {
1921
1966
  const f = Number(s.depth ?? s.md);
1922
- Number.isFinite(f) && (l = f, u = f);
1967
+ Number.isFinite(f) && (l = f, c = f);
1923
1968
  }
1924
1969
  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);
1970
+ if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
1971
+ const u = `${t}:${l}-${c}:${String(a)}`;
1972
+ if (i.has(u)) return;
1973
+ i.add(u);
1974
+ const m = (l + c) / 2, d = n ? a : Number(a);
1930
1975
  !n && !Number.isFinite(d) || o.push({
1931
1976
  z: m,
1932
1977
  val: d,
1933
1978
  from: l,
1934
- to: u,
1935
- errorPlus: u - m,
1979
+ to: c,
1980
+ errorPlus: c - m,
1936
1981
  errorMinus: m - l
1937
1982
  });
1938
1983
  }), o.sort((s, l) => l.z - s.z);
1939
1984
  }
1940
- function ir(e, t, n, r) {
1985
+ function sr(e, t, n, r) {
1941
1986
  if (!e.length) return { data: [], layout: {} };
1942
1987
  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
1988
  if (!o.length) return { data: [], layout: {} };
1944
- const i = Kn(n), s = [
1989
+ const i = Jn(n), s = [
1945
1990
  "#1f77b4",
1946
1991
  // blue
1947
1992
  "#ff7f0e",
@@ -1971,15 +2016,15 @@ function ir(e, t, n, r) {
1971
2016
  "#636363"
1972
2017
  // dark gray
1973
2018
  ], l = [...new Set(o.map((d) => d.category))];
1974
- function u(d, f) {
2019
+ function c(d, f) {
1975
2020
  if (i && Object.keys(i).length > 0) {
1976
- const h = Wn(d, i, null);
2021
+ const h = Kn(d, i, null);
1977
2022
  if (h !== null) return h;
1978
2023
  }
1979
2024
  return s[f % s.length];
1980
2025
  }
1981
2026
  const a = new Map(
1982
- l.map((d, f) => [d, u(d, f)])
2027
+ l.map((d, f) => [d, c(d, f)])
1983
2028
  );
1984
2029
  return { data: l.map((d) => {
1985
2030
  const f = o.filter((h) => h.category === d);
@@ -1995,19 +2040,19 @@ function ir(e, t, n, r) {
1995
2040
  customdata: f.map((h) => [h.from, h.to]),
1996
2041
  hovertemplate: `${t}: ${d}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1997
2042
  };
1998
- }), layout: Ft({
2043
+ }), layout: wt({
1999
2044
  barmode: "overlay",
2000
2045
  bargap: 0,
2001
2046
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
2002
2047
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
2003
2048
  showlegend: !1,
2004
2049
  title: t || void 0,
2005
- template: r !== void 0 ? r : Ce
2050
+ template: r !== void 0 ? r : Oe
2006
2051
  }) };
2007
2052
  }
2008
- function sr(e, t, n, r, o) {
2053
+ function lr(e, t, n, r, o) {
2009
2054
  if (!e.length) return { data: [], layout: {} };
2010
- const i = n === "bar", s = n === "markers", l = n === "line", u = r || Jn, a = r || Qn, c = {
2055
+ const i = n === "bar", s = n === "markers", l = n === "line", c = r || Qn, a = r || er, u = {
2011
2056
  x: e.map((h) => h.val),
2012
2057
  y: e.map((h) => h.z),
2013
2058
  hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
@@ -2019,37 +2064,37 @@ function sr(e, t, n, r, o) {
2019
2064
  arrayminus: e.map((h) => h.errorMinus),
2020
2065
  thickness: 1.5,
2021
2066
  width: 2,
2022
- color: tr
2067
+ color: nr
2023
2068
  };
2024
2069
  return { data: [i ? {
2025
- ...c,
2070
+ ...u,
2026
2071
  type: "bar",
2027
2072
  orientation: "h",
2028
- marker: { color: u },
2073
+ marker: { color: c },
2029
2074
  error_y: m
2030
2075
  } : {
2031
- ...c,
2076
+ ...u,
2032
2077
  type: "scatter",
2033
2078
  mode: s ? "markers" : l ? "lines" : "lines+markers",
2034
- line: { color: u, width: 2 },
2079
+ line: { color: c, width: 2 },
2035
2080
  marker: { size: 7, color: a },
2036
2081
  error_y: l ? void 0 : m
2037
- }], layout: Ft({
2082
+ }], layout: wt({
2038
2083
  xaxis: { title: t, zeroline: !1 },
2039
2084
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
2040
2085
  barmode: "overlay",
2041
2086
  showlegend: !1,
2042
- template: o !== void 0 ? o : Ce
2087
+ template: o !== void 0 ? o : Oe
2043
2088
  }) };
2044
2089
  }
2045
2090
  function Tt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
2046
2091
  if (!e || !e.length || !n) return { data: [], layout: {} };
2047
2092
  if (t || r === "categorical")
2048
- return ir(e, n, o, i);
2049
- const s = er(n);
2050
- return sr(e, n, r, s, i);
2093
+ return sr(e, n, o, i);
2094
+ const s = tr(n);
2095
+ return lr(e, n, r, s, i);
2051
2096
  }
2052
- function ci(e = [], {
2097
+ function Mi(e = [], {
2053
2098
  fromCol: t = "from",
2054
2099
  toCol: n = "to",
2055
2100
  categoryCol: r = "geology_code",
@@ -2058,18 +2103,18 @@ function ci(e = [], {
2058
2103
  } = {}) {
2059
2104
  const s = [];
2060
2105
  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;
2106
+ const c = Number(l == null ? void 0 : l[t]), a = Number(l == null ? void 0 : l[n]), u = l == null ? void 0 : l[r];
2107
+ if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c || u == null || `${u}`.trim() === "") return;
2108
+ const m = (c + a) / 2;
2064
2109
  s.push({
2065
2110
  z: m,
2066
- val: `${c}`,
2067
- from: u,
2111
+ val: `${u}`,
2112
+ from: c,
2068
2113
  to: a,
2069
2114
  errorPlus: a - m,
2070
- errorMinus: m - u
2115
+ errorMinus: m - c
2071
2116
  });
2072
- }), s.sort((l, u) => u.z - l.z), Tt({
2117
+ }), s.sort((l, c) => c.z - l.z), Tt({
2073
2118
  points: s,
2074
2119
  isCategorical: !0,
2075
2120
  property: r,
@@ -2078,7 +2123,7 @@ function ci(e = [], {
2078
2123
  template: i
2079
2124
  });
2080
2125
  }
2081
- const wt = [
2126
+ const $t = [
2082
2127
  "#0f172a",
2083
2128
  "#1e3a5f",
2084
2129
  "#7c3aed",
@@ -2089,24 +2134,24 @@ const wt = [
2089
2134
  "#db2777",
2090
2135
  "#65a30d",
2091
2136
  "#9333ea"
2092
- ], lr = { l: 42, r: 4, t: 4, b: 30 }, pt = 10, bt = 12;
2093
- function $t(e = {}) {
2137
+ ], ar = { l: 42, r: 4, t: 4, b: 30 }, bt = 10, gt = 12;
2138
+ function Rt(e = {}) {
2094
2139
  return {
2095
2140
  ...e,
2096
- margin: lr,
2141
+ margin: ar,
2097
2142
  autosize: !0,
2098
2143
  width: void 0,
2099
2144
  xaxis: {
2100
2145
  ...e.xaxis || {},
2101
2146
  tickfont: {
2102
2147
  ...e.xaxis && e.xaxis.tickfont || {},
2103
- size: pt
2148
+ size: bt
2104
2149
  },
2105
2150
  title: {
2106
2151
  ...e.xaxis && e.xaxis.title || {},
2107
2152
  font: {
2108
2153
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
2109
- size: bt
2154
+ size: gt
2110
2155
  }
2111
2156
  }
2112
2157
  },
@@ -2115,63 +2160,63 @@ function $t(e = {}) {
2115
2160
  automargin: !0,
2116
2161
  tickfont: {
2117
2162
  ...e.yaxis && e.yaxis.tickfont || {},
2118
- size: pt
2163
+ size: bt
2119
2164
  },
2120
2165
  title: {
2121
2166
  ...e.yaxis && e.yaxis.title || {},
2122
2167
  font: {
2123
2168
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
2124
- size: bt
2169
+ size: gt
2125
2170
  }
2126
2171
  }
2127
2172
  }
2128
2173
  };
2129
2174
  }
2130
- function ar(e, {
2175
+ function cr(e, {
2131
2176
  tailScale: t = 5,
2132
2177
  colorBy: n = null,
2133
- palette: r = wt,
2178
+ palette: r = $t,
2134
2179
  depthCol: o = W,
2135
- dipCol: i = X,
2136
- azCol: s = q,
2180
+ dipCol: i = q,
2181
+ azCol: s = X,
2137
2182
  template: l = void 0
2138
2183
  } = {}) {
2139
- const u = e.filter(
2140
- (b) => b[o] != null && b[i] != null && b[s] != null
2184
+ const c = e.filter(
2185
+ (g) => g[o] != null && g[i] != null && g[s] != null
2141
2186
  );
2142
- if (!u.length)
2187
+ if (!c.length)
2143
2188
  return { data: [], layout: {} };
2144
2189
  const a = {};
2145
- n && [...new Set(u.map((y) => y[n]).filter((y) => y != null))].sort().forEach((y, p) => {
2190
+ n && [...new Set(c.map((y) => y[n]).filter((y) => y != null))].sort().forEach((y, p) => {
2146
2191
  a[y] = r[p % r.length];
2147
2192
  });
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;
2193
+ const u = /* @__PURE__ */ new Map(), m = [];
2194
+ for (const g of c) {
2195
+ const y = Number(g[o]), p = Number(g[i]), b = Number(g[s]), N = n ? g[n] ?? "_default" : "_default", M = n ? a[N] ?? "#0f172a" : "#0f172a";
2196
+ u.has(N) || u.set(N, { xs: [], ys: [], dips: [], azs: [], color: M });
2197
+ const I = u.get(N);
2198
+ I.xs.push(p), I.ys.push(y), I.dips.push(p), I.azs.push(b);
2199
+ const x = b * Math.PI / 180, S = t * (Math.abs(p) / 90), w = Math.sin(x) * S, D = Math.cos(x) * S;
2155
2200
  m.push({
2156
2201
  type: "line",
2157
2202
  x0: p,
2158
2203
  y0: y,
2159
- x1: p + $,
2160
- y1: y + P,
2161
- line: { color: z, width: 2 }
2204
+ x1: p + w,
2205
+ y1: y + D,
2206
+ line: { color: M, width: 2 }
2162
2207
  });
2163
2208
  }
2164
- const d = [], f = n && c.size > 1;
2165
- for (const [b, y] of c.entries())
2209
+ const d = [], f = n && u.size > 1;
2210
+ for (const [g, y] of u.entries())
2166
2211
  d.push({
2167
2212
  type: "scatter",
2168
2213
  x: y.xs,
2169
2214
  y: y.ys,
2170
2215
  mode: "markers",
2171
- name: b !== "_default" ? String(b) : void 0,
2216
+ name: g !== "_default" ? String(g) : void 0,
2172
2217
  marker: { size: 8, color: y.color },
2173
- showlegend: f && b !== "_default",
2174
- customdata: y.dips.map((p, g) => [p, y.azs[g]]),
2218
+ showlegend: f && g !== "_default",
2219
+ customdata: y.dips.map((p, b) => [p, y.azs[b]]),
2175
2220
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
2176
2221
  });
2177
2222
  return { data: d, layout: {
@@ -2187,14 +2232,14 @@ function ar(e, {
2187
2232
  },
2188
2233
  yaxis: { title: "Depth (m)", autorange: "reversed" },
2189
2234
  showlegend: !!f,
2190
- template: l !== void 0 ? l : Ce
2235
+ template: l !== void 0 ? l : Oe
2191
2236
  } };
2192
2237
  }
2193
- function ui(e, {
2238
+ function zi(e, {
2194
2239
  labelCol: t = "structure_type",
2195
- palette: n = wt,
2196
- fromCol: r = L,
2197
- toCol: o = w,
2240
+ palette: n = $t,
2241
+ fromCol: r = F,
2242
+ toCol: o = $,
2198
2243
  template: i = void 0
2199
2244
  } = {}) {
2200
2245
  const s = e.filter((d) => d[r] != null && d[o] != null && Number(d[o]) > Number(d[r])).filter((d) => {
@@ -2205,7 +2250,7 @@ function ui(e, {
2205
2250
  }).map((d) => ({ from: Number(d[r]), to: Number(d[o]), label: String(d[t]).trim() })).sort((d, f) => d.from - f.from);
2206
2251
  if (!s.length)
2207
2252
  return { data: [], layout: {} };
2208
- const l = [], u = [], a = [];
2253
+ const l = [], c = [], a = [];
2209
2254
  return s.forEach((d, f) => {
2210
2255
  l.push({
2211
2256
  type: "rect",
@@ -2218,26 +2263,26 @@ function ui(e, {
2218
2263
  fillcolor: n[f % n.length],
2219
2264
  line: { width: 0 },
2220
2265
  layer: "below"
2221
- }), u.push(0.5 * (d.from + d.to)), a.push(d.label);
2266
+ }), c.push(0.5 * (d.from + d.to)), a.push(d.label);
2222
2267
  }), { data: [{
2223
2268
  type: "scatter",
2224
2269
  x: Array(a.length).fill(0.5),
2225
- y: u,
2270
+ y: c,
2226
2271
  mode: "text",
2227
2272
  text: a,
2228
2273
  textposition: "middle center",
2229
2274
  showlegend: !1,
2230
2275
  hoverinfo: "text"
2231
- }], layout: $t({
2276
+ }], layout: Rt({
2232
2277
  shapes: l,
2233
2278
  height: 400,
2234
2279
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
2235
2280
  yaxis: { title: "Depth (m)", autorange: "reversed" },
2236
2281
  showlegend: !1,
2237
- template: i !== void 0 ? i : Ce
2282
+ template: i !== void 0 ? i : Oe
2238
2283
  }) };
2239
2284
  }
2240
- function gt(e, t) {
2285
+ function yt(e, t) {
2241
2286
  if (!e) return "";
2242
2287
  const n = String(e).trim().split(/\s+/), r = [];
2243
2288
  let o = "";
@@ -2245,26 +2290,26 @@ function gt(e, t) {
2245
2290
  o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
2246
2291
  return o && r.push(o), r.join("<br>");
2247
2292
  }
2248
- function cr(e, {
2293
+ function ur(e, {
2249
2294
  commentCol: t = "comments",
2250
- fromCol: n = L,
2251
- toCol: r = w,
2295
+ fromCol: n = F,
2296
+ toCol: r = $,
2252
2297
  bgColor: o = "#f1f5f9",
2253
2298
  borderColor: i = "#cbd5e1",
2254
2299
  textColor: s = "#1e293b",
2255
2300
  charsPerLine: l = 18,
2256
- template: u = void 0
2301
+ template: c = void 0
2257
2302
  } = {}) {
2258
2303
  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() : "";
2260
- return { from: Number(p[n]), to: Number(p[r]), comment: M };
2261
- }).sort((p, g) => p.from - g.from);
2304
+ const b = p[t], N = b != null && String(b).trim() !== "" && String(b) !== "null" ? String(b).trim() : "";
2305
+ return { from: Number(p[n]), to: Number(p[r]), comment: N };
2306
+ }).sort((p, b) => p.from - b.from);
2262
2307
  if (!a.length)
2263
2308
  return { data: [], layout: {} };
2264
- const c = [], m = [], d = [], f = [], h = [];
2309
+ const u = [], m = [], d = [], f = [], h = [];
2265
2310
  for (const p of a) {
2266
- const g = 0.5 * (p.from + p.to), M = !!p.comment;
2267
- c.push({
2311
+ const b = 0.5 * (p.from + p.to), N = !!p.comment;
2312
+ u.push({
2268
2313
  type: "rect",
2269
2314
  xref: "x",
2270
2315
  yref: "y",
@@ -2272,10 +2317,10 @@ function cr(e, {
2272
2317
  x1: 1,
2273
2318
  y0: p.from,
2274
2319
  y1: p.to,
2275
- fillcolor: M ? o : "rgba(0,0,0,0)",
2320
+ fillcolor: N ? o : "rgba(0,0,0,0)",
2276
2321
  line: { color: i, width: 1 },
2277
2322
  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)}`));
2323
+ }), N && (m.push(0.5), d.push(b), f.push(yt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${yt(p.comment, 40)}`));
2279
2324
  }
2280
2325
  return { data: m.length ? [{
2281
2326
  type: "scatter",
@@ -2288,25 +2333,25 @@ function cr(e, {
2288
2333
  hovertext: h,
2289
2334
  hoverinfo: "text",
2290
2335
  showlegend: !1
2291
- }] : [], layout: $t({
2292
- shapes: c,
2336
+ }] : [], layout: Rt({
2337
+ shapes: u,
2293
2338
  height: 400,
2294
2339
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
2295
2340
  yaxis: { title: "Depth (m)", autorange: "reversed" },
2296
2341
  showlegend: !1,
2297
- template: u !== void 0 ? u : Ce
2342
+ template: c !== void 0 ? c : Oe
2298
2343
  }) };
2299
2344
  }
2300
- function di(e, {
2345
+ function vi(e, {
2301
2346
  symbolSize: t = 10,
2302
2347
  xCol: n = "easting",
2303
2348
  yCol: r = "northing"
2304
2349
  } = {}) {
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;
2350
+ 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
2351
  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);
2352
+ 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), g = f * Math.cos(u);
2308
2353
  return {
2309
- strike: u,
2354
+ strike: c,
2310
2355
  dipValue: s,
2311
2356
  x: o,
2312
2357
  y: i,
@@ -2315,27 +2360,27 @@ function di(e, {
2315
2360
  strikeX1: o + m,
2316
2361
  strikeY1: i + d,
2317
2362
  tickX1: o + h,
2318
- tickY1: i + b
2363
+ tickY1: i + g
2319
2364
  };
2320
2365
  }
2321
2366
  const Bt = "markers+line";
2322
- function ur(e, t) {
2367
+ function dr(e, t) {
2323
2368
  var r;
2324
2369
  const n = et(e);
2325
2370
  return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Bt;
2326
2371
  }
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("");
2372
+ function Ei({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
2373
+ const s = De(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) || Bt, 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), [g, y] = Q("");
2329
2374
  return se(() => {
2330
- const p = d === xe, g = d === Je;
2331
- if (!l || !a || !p && !g && u.length === 0) return;
2332
- const M = s.current;
2333
- if (!M) return;
2334
- let z;
2375
+ const p = d === ke, b = d === Je;
2376
+ if (!l || !a || !p && !b && c.length === 0) return;
2377
+ const N = s.current;
2378
+ if (!N) return;
2379
+ let M;
2335
2380
  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,
2381
+ p ? M = ur(c, { commentCol: a, fromCol: "from", toCol: "to" }) : b ? M = cr(c) : M = Tt({
2382
+ points: c,
2383
+ isCategorical: d === Le,
2339
2384
  property: a,
2340
2385
  chartType: h,
2341
2386
  template: i
@@ -2344,80 +2389,80 @@ function mi({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [],
2344
2389
  console.error("Plot build error", x), y((x == null ? void 0 : x.message) || "Plot build error");
2345
2390
  return;
2346
2391
  }
2347
- if ((!(z != null && z.data) || z.data.length === 0) && !p)
2392
+ if ((!(M != null && M.data) || M.data.length === 0) && !p)
2348
2393
  return;
2349
- const D = {
2394
+ const I = {
2350
2395
  displayModeBar: !0,
2351
2396
  responsive: !0,
2352
2397
  useResizeHandler: !0,
2353
2398
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
2354
2399
  };
2355
2400
  try {
2356
- y(""), Fe.react(M, z.data, z.layout, D), requestAnimationFrame(() => {
2357
- M && M.parentElement && Fe.Plots.resize(M);
2401
+ y(""), Fe.react(N, M.data, M.layout, I), requestAnimationFrame(() => {
2402
+ N && N.parentElement && Fe.Plots.resize(N);
2358
2403
  });
2359
2404
  } catch (x) {
2360
2405
  console.error("Plot render error", x), y((x == null ? void 0 : x.message) || "Plot render error");
2361
2406
  }
2362
2407
  return () => {
2363
- if (M)
2408
+ if (N)
2364
2409
  try {
2365
- Fe.purge(M);
2410
+ Fe.purge(N);
2366
2411
  } catch (x) {
2367
2412
  console.warn("Plot purge error", x);
2368
2413
  }
2369
2414
  };
2370
- }, [l, a, h, d, u, i]), se(() => {
2415
+ }, [l, a, h, d, c, i]), se(() => {
2371
2416
  const p = s.current;
2372
2417
  if (!p || typeof ResizeObserver > "u") return;
2373
- const g = new ResizeObserver(() => {
2418
+ const b = new ResizeObserver(() => {
2374
2419
  try {
2375
2420
  p && p.data && Fe.Plots.resize(p);
2376
- } catch (M) {
2377
- console.warn("Plot resize error", M);
2421
+ } catch (N) {
2422
+ console.warn("Plot resize error", N);
2378
2423
  }
2379
2424
  });
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: [
2425
+ return b.observe(p), () => b.disconnect();
2426
+ }, []), !l || !a ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("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__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("div", { className: "placeholder", children: "No data" }) }) : g ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ J("div", { className: "placeholder", children: [
2382
2427
  "Plot error: ",
2383
- b
2428
+ g
2384
2429
  ] }) }) : /* @__PURE__ */ J("div", { className: "plot-card", children: [
2385
- /* @__PURE__ */ S("div", { className: "plot-title", children: /* @__PURE__ */ S(
2430
+ /* @__PURE__ */ P("div", { className: "plot-title", children: /* @__PURE__ */ P(
2386
2431
  "select",
2387
2432
  {
2388
2433
  className: "plot-select",
2389
2434
  value: m,
2390
2435
  onChange: (p) => o && o({ holeId: p.target.value }),
2391
2436
  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);
2437
+ const b = typeof p == "string" ? p : p.holeId, N = typeof p == "string" ? p : p.label || p.holeId;
2438
+ return /* @__PURE__ */ P("option", { value: b, children: N }, b);
2394
2439
  })
2395
2440
  }
2396
2441
  ) }),
2397
2442
  /* @__PURE__ */ J("div", { className: "plot-controls column", children: [
2398
- r.length > 0 && /* @__PURE__ */ S(
2443
+ r.length > 0 && /* @__PURE__ */ P(
2399
2444
  "select",
2400
2445
  {
2401
2446
  className: "plot-select",
2402
2447
  value: a,
2403
2448
  onChange: (p) => o && o({ property: p.target.value }),
2404
- children: r.map((p) => /* @__PURE__ */ S("option", { value: p, children: p }, p))
2449
+ children: r.map((p) => /* @__PURE__ */ P("option", { value: p, children: p }, p))
2405
2450
  }
2406
2451
  ),
2407
- f.length > 1 && /* @__PURE__ */ S(
2452
+ f.length > 1 && /* @__PURE__ */ P(
2408
2453
  "select",
2409
2454
  {
2410
2455
  className: "plot-select",
2411
2456
  value: h,
2412
2457
  onChange: (p) => o && o({ chartType: p.target.value }),
2413
- children: f.map((p) => /* @__PURE__ */ S("option", { value: p.value, children: p.label }, p.value))
2458
+ children: f.map((p) => /* @__PURE__ */ P("option", { value: p.value, children: p.label }, p.value))
2414
2459
  }
2415
2460
  )
2416
2461
  ] }),
2417
- /* @__PURE__ */ S("div", { className: "plotly-chart", ref: s })
2462
+ /* @__PURE__ */ P("div", { className: "plotly-chart", ref: s })
2418
2463
  ] });
2419
2464
  }
2420
- function yt(e, t) {
2465
+ function _t(e, t) {
2421
2466
  if (!(t != null && t.length)) return e;
2422
2467
  const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
2423
2468
  for (const r of t) {
@@ -2431,7 +2476,7 @@ function yt(e, t) {
2431
2476
  }
2432
2477
  return Array.from(n.values());
2433
2478
  }
2434
- function dr(e, t) {
2479
+ function mr(e, t) {
2435
2480
  if (!e || !t) return [];
2436
2481
  const n = /* @__PURE__ */ new Set(), r = [];
2437
2482
  for (const o of e.points || []) {
@@ -2442,69 +2487,69 @@ function dr(e, t) {
2442
2487
  }
2443
2488
  return r;
2444
2489
  }
2445
- function fi({
2490
+ function xi({
2446
2491
  initialFocusedHoleId: e = "",
2447
2492
  sourceFile: t = null,
2448
2493
  extraHoles: n = [],
2449
2494
  plotCount: r = 4
2450
2495
  } = {}) {
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);
2496
+ const [o, i] = Q([]), [s, l] = Q([]), [c, a] = Q([]), [u, m] = Q([]), [d, f] = Q([]), [h, g] = Q({}), [y, p] = Q(""), [b, N] = Q([]), [M, I] = Q(""), [x, S] = Q(e || ""), [w, D] = Q([]), v = De(null);
2452
2497
  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),
2498
+ !t || v.current === t || (v.current = t, En(t).then((A) => {
2499
+ if (!A) return;
2500
+ const E = Array.from(new Map(A.map((z) => [z.holeId, z])).values());
2501
+ l(E), N(St({
2502
+ holeIds: E.map((z) => z.holeId),
2458
2503
  focusedHoleId: x,
2459
2504
  plotCount: r,
2460
2505
  defaultProp: "",
2461
- categoricalProps: c,
2506
+ categoricalProps: u,
2462
2507
  commentProps: d,
2463
2508
  numericDefaultChartType: "markers+line"
2464
2509
  }));
2465
- }).catch((v) => {
2466
- console.info("Assay metadata load skipped:", v.message);
2510
+ }).catch((A) => {
2511
+ console.info("Assay metadata load skipped:", A.message);
2467
2512
  }));
2468
- }, [t, x, r, c, d]), se(() => {
2513
+ }, [t, x, r, u, d]), se(() => {
2469
2514
  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;
2515
+ const A = n.map((E) => ({ holeId: E.id || E.holeId })).filter((E) => E.holeId);
2516
+ l((E) => {
2517
+ const z = new Set(E.map((C) => C.holeId)), R = A.filter((C) => !z.has(C.holeId));
2518
+ return R.length ? [...E, ...R] : E;
2474
2519
  });
2475
2520
  }, [n]), se(() => {
2476
- D((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
2477
- }, [g]), se(() => {
2521
+ I((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
2522
+ }, [b]), se(() => {
2478
2523
  if (!s.length) {
2479
- M([]);
2524
+ N([]);
2480
2525
  return;
2481
2526
  }
2482
- const v = Ct(s.map((k) => k.holeId), x);
2483
- M((k) => Array.from({ length: r }).map((B, I) => {
2527
+ const A = Ct(s.map((E) => E.holeId), x);
2528
+ N((E) => Array.from({ length: r }).map((R, C) => {
2484
2529
  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({
2530
+ const G = E[C] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : A[C] || ((K = s[C]) == null ? void 0 : K.holeId) || "", j = G.property || y, Z = Te({
2486
2531
  property: j,
2487
2532
  chartType: G.chartType,
2488
- categoricalProps: c,
2533
+ categoricalProps: u,
2489
2534
  commentProps: d,
2490
2535
  numericDefaultChartType: "markers+line"
2491
2536
  });
2492
2537
  return { holeId: U, property: j, chartType: Z };
2493
2538
  }));
2494
- }, [s, x, y, c, d, r]), se(() => {
2539
+ }, [s, x, y, u, d, r]), se(() => {
2495
2540
  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],
2541
+ b.map((E) => E.holeId).filter(Boolean).forEach((E) => {
2542
+ const z = o.some((C) => (C.id || C.holeId) === E), R = w.includes(E);
2543
+ z || R || (D((C) => [...C, E]), xn(t, E).then((C) => {
2544
+ D((G) => G.filter((U) => U !== E)), C && i((G) => {
2545
+ const U = _t(
2546
+ [...G.filter((Z) => (Z.id || Z.holeId) !== E), C],
2502
2547
  n
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) => ({
2548
+ ), j = Re(U);
2549
+ return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), g(j.columnMeta), !y && j.defaultProp && (p(j.defaultProp), N((Z) => Z.map((K) => ({
2505
2550
  ...K,
2506
2551
  property: K.property || j.defaultProp,
2507
- chartType: we({
2552
+ chartType: Te({
2508
2553
  property: K.property || j.defaultProp,
2509
2554
  chartType: K.chartType,
2510
2555
  categoricalProps: j.categoricalProps,
@@ -2513,75 +2558,75 @@ function fi({
2513
2558
  })
2514
2559
  })))), U;
2515
2560
  });
2516
- }).catch((I) => {
2517
- console.error(I), P((G) => G.filter((U) => U !== k)), D(I.message || `Error loading hole ${k}`);
2561
+ }).catch((C) => {
2562
+ console.error(C), D((G) => G.filter((U) => U !== E)), I(C.message || `Error loading hole ${E}`);
2518
2563
  }));
2519
2564
  });
2520
- }, [g, t, o, $, y, n]), se(() => {
2521
- n != null && n.length && i((v) => {
2522
- if (!v.length) {
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;
2565
+ }, [b, t, o, w, y, n]), se(() => {
2566
+ n != null && n.length && i((A) => {
2567
+ if (!A.length) {
2568
+ const R = Re(n);
2569
+ return a(R.numericProps), m(R.categoricalProps), f(R.commentProps), g(R.columnMeta), !y && R.defaultProp && p(R.defaultProp), n;
2525
2570
  }
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;
2571
+ const E = _t(A, n), z = Re(E);
2572
+ return a(z.numericProps), m(z.categoricalProps), f(z.commentProps), g(z.columnMeta), !y && z.defaultProp && p(z.defaultProp), E;
2528
2573
  });
2529
2574
  }, [n]);
2530
- const F = ne(
2531
- () => [...u, ...c, ...d],
2532
- [u, c, d]
2533
- ), C = ne(
2534
- () => s.map((v) => ({ holeId: v.holeId, label: v.holeId })).sort((v, k) => v.label.localeCompare(k.label)),
2575
+ const L = ne(
2576
+ () => [...c, ...u, ...d],
2577
+ [c, u, d]
2578
+ ), O = ne(
2579
+ () => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, E) => A.label.localeCompare(E.label)),
2535
2580
  [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;
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);
2581
+ ), V = ne(() => {
2582
+ const A = [...c, ...u, ...d];
2583
+ return Array.from({ length: r }).map((E, z) => {
2584
+ const R = b[z] || {}, C = o.find((he) => (he.id || he.holeId) === R.holeId) || null, G = C ? A.filter((he) => or(C, he)) : A;
2585
+ let U = R.property || y;
2586
+ C && !G.includes(U) && (U = G[0] || U);
2587
+ const j = d.includes(U), Z = !j && u.includes(U), K = !j && !Z && U === "dip", le = j ? "comment" : K ? "tadpole" : Z ? "categorical" : "numeric", ye = K ? "tadpole" : R.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), fe = R.holeId || (C == null ? void 0 : C.id) || (C == null ? void 0 : C.holeId) || "", Ce = K ? (C == null ? void 0 : C.points) || [] : j ? mr(C, U) : ir(C, U, Z);
2543
2588
  return {
2544
2589
  config: { holeId: fe, property: U, chartType: ye },
2545
- hole: I,
2546
- loading: $.includes(B.holeId),
2590
+ hole: C,
2591
+ loading: w.includes(R.holeId),
2547
2592
  isCategorical: Z,
2548
2593
  isComment: j,
2549
2594
  isTadpole: K,
2550
2595
  displayType: le,
2551
- points: De,
2596
+ points: Ce,
2552
2597
  propertyOptions: G,
2553
2598
  label: fe
2554
2599
  };
2555
2600
  });
2556
- }, [g, o, y, c, d, $, r, u]), R = (v, k) => {
2557
- M((N) => {
2558
- const B = [...N], G = { ...B[v] || {}, ...k };
2559
- return k.property && (G.chartType = we({
2560
- property: k.property,
2601
+ }, [b, o, y, u, d, w, r, c]), H = (A, E) => {
2602
+ N((z) => {
2603
+ const R = [...z], G = { ...R[A] || {}, ...E };
2604
+ return E.property && (G.chartType = Te({
2605
+ property: E.property,
2561
2606
  chartType: G.chartType,
2562
- categoricalProps: c,
2607
+ categoricalProps: u,
2563
2608
  commentProps: d,
2564
2609
  numericDefaultChartType: "markers+line"
2565
- })), B[v] = G, B;
2610
+ })), R[A] = G, R;
2566
2611
  });
2567
2612
  };
2568
2613
  return {
2569
- error: z,
2614
+ error: M,
2570
2615
  focusedHoleId: x,
2571
- setFocusedHoleId: O,
2572
- setError: D,
2616
+ setFocusedHoleId: S,
2617
+ setError: I,
2573
2618
  holeCount: s.length,
2574
- numericProps: u,
2575
- categoricalProps: c,
2619
+ numericProps: c,
2620
+ categoricalProps: u,
2576
2621
  commentProps: d,
2577
2622
  columnMeta: h,
2578
- propertyOptions: F,
2579
- labeledHoleOptions: C,
2580
- traceGraphs: H,
2581
- handleConfigChange: R
2623
+ propertyOptions: L,
2624
+ labeledHoleOptions: O,
2625
+ traceGraphs: V,
2626
+ handleConfigChange: H
2582
2627
  };
2583
2628
  }
2584
- const mr = [
2629
+ const fr = [
2585
2630
  "#313695",
2586
2631
  "#4575b4",
2587
2632
  "#74add1",
@@ -2593,7 +2638,7 @@ const mr = [
2593
2638
  "#d73027",
2594
2639
  "#a50026"
2595
2640
  ];
2596
- function fr(e = [], t = mr) {
2641
+ function hr(e = [], t = fr) {
2597
2642
  const n = e.filter((a) => Number.isFinite(a));
2598
2643
  if (!n.length)
2599
2644
  return {
@@ -2603,9 +2648,9 @@ function fr(e = [], t = mr) {
2603
2648
  bins: [],
2604
2649
  colors: t
2605
2650
  };
2606
- const r = n.slice().sort((a, c) => a - c), o = r[0], i = r[r.length - 1], s = t.length;
2651
+ const r = n.slice().sort((a, u) => a - u), o = r[0], i = r[r.length - 1], s = t.length;
2607
2652
  if (i === o) {
2608
- const a = t.map((c, m) => ({
2653
+ const a = t.map((u, m) => ({
2609
2654
  index: m,
2610
2655
  min: o,
2611
2656
  max: i,
@@ -2619,24 +2664,24 @@ function fr(e = [], t = mr) {
2619
2664
  colors: t
2620
2665
  };
2621
2666
  }
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];
2667
+ const l = t.map((a, u) => {
2668
+ 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)), g = r[f], y = u === s - 1 ? i : r[h];
2624
2669
  return {
2625
- index: c,
2626
- min: b,
2670
+ index: u,
2671
+ min: g,
2627
2672
  max: y,
2628
- label: hr(b, y)
2673
+ label: pr(g, y)
2629
2674
  };
2630
- }), u = (i - o) / s;
2675
+ }), c = (i - o) / s;
2631
2676
  return {
2632
2677
  min: o,
2633
2678
  max: i,
2634
- step: u,
2679
+ step: c,
2635
2680
  bins: l,
2636
2681
  colors: t
2637
2682
  };
2638
2683
  }
2639
- function hr(e, t) {
2684
+ function pr(e, t) {
2640
2685
  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
2686
  return `${n(e)} – ${n(t)}`;
2642
2687
  }
@@ -2652,43 +2697,43 @@ function Vt(e, t) {
2652
2697
  }
2653
2698
  return -1;
2654
2699
  }
2655
- function pr(e, t, n = "#8b1e3f") {
2700
+ function br(e, t, n = "#8b1e3f") {
2656
2701
  const r = Vt(e, t);
2657
2702
  return r < 0 ? n : t.colors[r] || n;
2658
2703
  }
2659
2704
  function Ht(e) {
2660
2705
  return Array.isArray(e) ? e : [];
2661
2706
  }
2662
- function Xe(e) {
2707
+ function qe(e) {
2663
2708
  const t = Number(e);
2664
2709
  return Number.isFinite(t) ? t : void 0;
2665
2710
  }
2666
- function Rt(e = {}) {
2711
+ function jt(e = {}) {
2667
2712
  return {
2668
2713
  ...e,
2669
- x: Xe(e.x),
2670
- y: Xe(e.y),
2671
- z: Xe(e.z)
2714
+ x: qe(e.x),
2715
+ y: qe(e.y),
2716
+ z: qe(e.z)
2672
2717
  };
2673
2718
  }
2674
- function br(e = [], t = [0, 0], n = 0) {
2719
+ function gr(e = [], t = [0, 0], n = 0) {
2675
2720
  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;
2721
+ return Ht(e).map(jt).map((c) => {
2722
+ if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
2723
+ const a = c.x - r, u = c.y - o;
2679
2724
  return {
2680
- ...u,
2681
- along: a * l + c * s,
2682
- across: a * s - c * l
2725
+ ...c,
2726
+ along: a * l + u * s,
2727
+ across: a * s - u * l
2683
2728
  };
2684
2729
  });
2685
2730
  }
2686
- function gr(e = [], t = [0, 0], n = 0, r = 50) {
2687
- const o = br(e, t, n), i = 0.5 * Number(r || 0);
2731
+ function yr(e = [], t = [0, 0], n = 0, r = 50) {
2732
+ const o = gr(e, t, n), i = 0.5 * Number(r || 0);
2688
2733
  return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
2689
2734
  }
2690
- function hi(e = [], t = null, n = null) {
2691
- let r = Ht(e).map(Rt);
2735
+ function ki(e = [], t = null, n = null) {
2736
+ let r = Ht(e).map(jt);
2692
2737
  if (Array.isArray(t) && t.length === 2) {
2693
2738
  const [o, i] = t;
2694
2739
  r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
@@ -2698,8 +2743,8 @@ function hi(e = [], t = null, n = null) {
2698
2743
  color_value: o == null ? void 0 : o[n]
2699
2744
  }))), r;
2700
2745
  }
2701
- function pi(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2702
- let i = gr(e, t, n, r);
2746
+ function Ai(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2747
+ let i = yr(e, t, n, r);
2703
2748
  return o && (i = i.map((s) => ({
2704
2749
  ...s,
2705
2750
  color_value: s == null ? void 0 : s[o]
@@ -2715,7 +2760,7 @@ function Ne(e, t = void 0) {
2715
2760
  const n = Number(e);
2716
2761
  return Number.isFinite(n) ? n : t;
2717
2762
  }
2718
- function bi(e = [], t = null) {
2763
+ function Ii(e = [], t = null) {
2719
2764
  const n = /* @__PURE__ */ new Map();
2720
2765
  rt(e).forEach((o) => {
2721
2766
  const i = ot(o);
@@ -2725,17 +2770,17 @@ function bi(e = [], t = null) {
2725
2770
  });
2726
2771
  const r = [];
2727
2772
  return n.forEach((o, i) => {
2728
- const s = [...o].sort((u, a) => Ne(u.md, 0) - Ne(a.md, 0)), l = {
2773
+ const s = [...o].sort((c, a) => Ne(c.md, 0) - Ne(a.md, 0)), l = {
2729
2774
  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)),
2775
+ x: s.map((c) => Ne(c.x, 0)),
2776
+ y: s.map((c) => Ne(c.y, 0)),
2777
+ z: s.map((c) => Ne(c.z, 0)),
2733
2778
  color: null
2734
2779
  };
2735
- t && (l.color = s.map((u) => u == null ? void 0 : u[t])), r.push(l);
2780
+ t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
2736
2781
  }), r;
2737
2782
  }
2738
- function gi(e = [], t = 1, n = null) {
2783
+ function Oi(e = [], t = 1, n = null) {
2739
2784
  return rt(e).map((r) => ({
2740
2785
  hole_id: ot(r),
2741
2786
  from: r == null ? void 0 : r.from,
@@ -2745,7 +2790,7 @@ function gi(e = [], t = 1, n = null) {
2745
2790
  value: n ? r == null ? void 0 : r[n] : null
2746
2791
  }));
2747
2792
  }
2748
- function yi(e = [], t = null) {
2793
+ function Ci(e = [], t = null) {
2749
2794
  return t ? rt(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
2750
2795
  hole_id: ot(n),
2751
2796
  label: n == null ? void 0 : n[t],
@@ -2759,7 +2804,7 @@ function Me(e) {
2759
2804
  ...e.structuralMeshes
2760
2805
  ];
2761
2806
  }
2762
- const yr = {
2807
+ const _r = {
2763
2808
  bedding: "#2563eb",
2764
2809
  foliation: "#16a34a",
2765
2810
  joint: "#9333ea",
@@ -2768,11 +2813,11 @@ const yr = {
2768
2813
  "shear zone": "#0ea5e9",
2769
2814
  "fault zone": "#ef4444"
2770
2815
  };
2771
- function _r(e, t) {
2772
- const n = t || yr, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2816
+ function Nr(e, t) {
2817
+ const n = t || _r, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2773
2818
  return new _.Color(o).getHex();
2774
2819
  }
2775
- function Nr(e, t) {
2820
+ function Mr(e, t) {
2776
2821
  const n = e * Math.PI / 180, r = t * Math.PI / 180;
2777
2822
  return new _.Vector3(
2778
2823
  Math.sin(r) * Math.sin(n),
@@ -2783,32 +2828,32 @@ function Nr(e, t) {
2783
2828
  // Up component
2784
2829
  ).normalize();
2785
2830
  }
2786
- function Mr(e, t = {}) {
2831
+ function zr(e, t = {}) {
2787
2832
  const {
2788
2833
  radius: n = 5,
2789
2834
  discThickness: r = 0.2,
2790
2835
  opacity: o = 0.7,
2791
2836
  segments: i = 32,
2792
2837
  colorMap: s = null
2793
- } = t, l = new _.Group(), u = new _.Vector3(0, 1, 0);
2838
+ } = t, l = new _.Group(), c = new _.Vector3(0, 1, 0);
2794
2839
  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;
2798
- let b;
2840
+ 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;
2841
+ if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
2842
+ const f = a[q] != null ? Number(a[q]) : null, h = a[X] != null ? Number(a[X]) : null;
2843
+ let g;
2799
2844
  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();
2845
+ g = new _.Vector3(a.nx, a.ny, a.nz).normalize();
2801
2846
  else {
2802
2847
  if (f == null || h == null || !Number.isFinite(f) || !Number.isFinite(h)) continue;
2803
- b = Nr(f, h);
2848
+ g = Mr(f, h);
2804
2849
  }
2805
2850
  const y = new _.CylinderGeometry(n, n, r, i, 1, !1), p = new _.MeshStandardMaterial({
2806
- color: _r(a.structure_type, s),
2851
+ color: Nr(a.structure_type, s),
2807
2852
  transparent: !0,
2808
2853
  opacity: o,
2809
2854
  side: _.DoubleSide
2810
- }), g = new _.Mesh(y, p);
2811
- g.position.set(c, m, d), g.quaternion.setFromUnitVectors(u, b), g.userData = {
2855
+ }), b = new _.Mesh(y, p);
2856
+ b.position.set(u, m, d), b.quaternion.setFromUnitVectors(c, g), b.userData = {
2812
2857
  type: "structure",
2813
2858
  hole_id: a.hole_id,
2814
2859
  depth: a.depth ?? a.mid,
@@ -2816,26 +2861,26 @@ function Mr(e, t = {}) {
2816
2861
  dip: f,
2817
2862
  azimuth: h,
2818
2863
  comments: a.comments
2819
- }, l.add(g);
2864
+ }, l.add(b);
2820
2865
  }
2821
2866
  return l;
2822
2867
  }
2823
- function zr(e, t, n, r = {}) {
2824
- if (!e.scene || (jt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2868
+ function vr(e, t, n, r = {}) {
2869
+ if (!e.scene || (Gt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2825
2870
  const { maxDiscs: o = 3e3 } = r;
2826
2871
  let i = t;
2827
2872
  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)]);
2873
+ const c = i.length / o, a = [];
2874
+ for (let u = 0; u < o; u++)
2875
+ a.push(i[Math.floor(u * c)]);
2831
2876
  i = a;
2832
2877
  }
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);
2878
+ const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Yn(i, s, r);
2879
+ l.length && (e.structuralGroup = zr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
2880
+ c.isMesh && e.structuralMeshes.push(c);
2836
2881
  }), Me(e));
2837
2882
  }
2838
- function jt(e) {
2883
+ function Gt(e) {
2839
2884
  e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
2840
2885
  t.isMesh && (t.geometry.dispose(), t.material.dispose());
2841
2886
  }), e.structuralGroup = null), e.structuralMeshes = [], Me(e);
@@ -2843,8 +2888,103 @@ function jt(e) {
2843
2888
  function Er(e, t) {
2844
2889
  e.structuralGroup && (e.structuralGroup.visible = !!t);
2845
2890
  }
2846
- function it(e) {
2847
- var n, r, o, i, s, l, u, a, c;
2891
+ let xr = 0;
2892
+ function kr(e) {
2893
+ let t, n, r, o;
2894
+ if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
2895
+ const i = Number(e.x ?? 0), s = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
2896
+ t = i, n = s, r = i + l, o = s + c;
2897
+ } else
2898
+ t = Number(e.minX), n = Number(e.minY), r = Number(e.maxX), o = Number(e.maxY);
2899
+ if (r - t <= 0)
2900
+ throw new Error(
2901
+ `Invalid raster bounds: width must be positive (got minX=${t}, maxX=${r})`
2902
+ );
2903
+ if (o - n <= 0)
2904
+ throw new Error(
2905
+ `Invalid raster bounds: height must be positive (got minY=${n}, maxY=${o})`
2906
+ );
2907
+ return { minX: t, minY: n, maxX: r, maxY: o };
2908
+ }
2909
+ function Ar(e) {
2910
+ if (e.type === "texture")
2911
+ return Promise.resolve(e.texture);
2912
+ let t, n = !1;
2913
+ if (e.type === "url")
2914
+ t = e.url;
2915
+ else if (e.type === "file")
2916
+ t = URL.createObjectURL(e.file), n = !0;
2917
+ else
2918
+ return Promise.reject(
2919
+ new Error(`Unsupported raster source type: "${e.type}"`)
2920
+ );
2921
+ return new Promise((r, o) => {
2922
+ new _.TextureLoader().load(
2923
+ t,
2924
+ (s) => {
2925
+ n && URL.revokeObjectURL(t), r(s);
2926
+ },
2927
+ void 0,
2928
+ (s) => {
2929
+ n && URL.revokeObjectURL(t), o(
2930
+ new Error(
2931
+ `Failed to load raster texture from "${t}": ${(s == null ? void 0 : s.message) ?? s}`
2932
+ )
2933
+ );
2934
+ }
2935
+ );
2936
+ });
2937
+ }
2938
+ async function Si(e) {
2939
+ 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;
2940
+ let c = e.opacity ?? 1;
2941
+ if ((c < 0 || c > 1) && (console.warn(
2942
+ `[baselode] raster overlay "${s}": opacity ${c} is outside [0, 1] — clamped`
2943
+ ), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
2944
+ if (!n) throw new Error("raster overlay: options.bounds is required");
2945
+ const a = kr(n), { minX: u, minY: m, maxX: d, maxY: f } = a, h = d - u, g = f - m, y = (u + d) / 2, p = (m + f) / 2, b = await Ar(t), N = new _.PlaneGeometry(h, g), M = new _.MeshBasicMaterial({
2946
+ map: b,
2947
+ transparent: !0,
2948
+ opacity: c,
2949
+ side: _.DoubleSide,
2950
+ depthWrite: !1
2951
+ }), I = new _.Mesh(N, M);
2952
+ return I.position.set(y, p, r), I.renderOrder = i, I.visible = o, { id: s, name: l, mesh: I, texture: b, bounds: a, elevation: r, opacity: c, visible: o };
2953
+ }
2954
+ function Ir(e, t) {
2955
+ e.scene && (e.rasterOverlays.has(t.id) && it(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
2956
+ }
2957
+ function it(e, t) {
2958
+ var r;
2959
+ const n = e.rasterOverlays.get(t);
2960
+ 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));
2961
+ }
2962
+ function Or(e, t, n) {
2963
+ const r = e.rasterOverlays.get(t);
2964
+ if (!r) return;
2965
+ const o = Math.max(0, Math.min(1, Number(n)));
2966
+ r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
2967
+ }
2968
+ function Cr(e, t, n) {
2969
+ const r = e.rasterOverlays.get(t);
2970
+ r && (r.visible = !!n, r.mesh.visible = r.visible);
2971
+ }
2972
+ function Sr(e, t, n) {
2973
+ const r = e.rasterOverlays.get(t);
2974
+ r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
2975
+ }
2976
+ function Dr(e, t) {
2977
+ return e.rasterOverlays.get(t);
2978
+ }
2979
+ function Lr(e) {
2980
+ return Array.from(e.rasterOverlays.values());
2981
+ }
2982
+ function Pr(e) {
2983
+ for (const t of [...e.rasterOverlays.keys()])
2984
+ it(e, t);
2985
+ }
2986
+ function st(e) {
2987
+ var n, r, o, i, s, l, c, a, u;
2848
2988
  if (!e) return "";
2849
2989
  const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
2850
2990
  return [
@@ -2854,12 +2994,12 @@ function it(e) {
2854
2994
  t((i = e.target) == null ? void 0 : i.x),
2855
2995
  t((s = e.target) == null ? void 0 : s.y),
2856
2996
  t((l = e.target) == null ? void 0 : l.z),
2857
- t((u = e.up) == null ? void 0 : u.x),
2997
+ t((c = e.up) == null ? void 0 : c.x),
2858
2998
  t((a = e.up) == null ? void 0 : a.y),
2859
- t((c = e.up) == null ? void 0 : c.z)
2999
+ t((u = e.up) == null ? void 0 : u.z)
2860
3000
  ].join("|");
2861
3001
  }
2862
- function Gt(e) {
3002
+ function Ut(e) {
2863
3003
  return !e.camera || !e.controls ? null : {
2864
3004
  camera: {
2865
3005
  x: e.camera.position.x,
@@ -2878,37 +3018,37 @@ function Gt(e) {
2878
3018
  }
2879
3019
  };
2880
3020
  }
2881
- function kr(e, t) {
3021
+ function Fr(e, t) {
2882
3022
  if (!e.camera || !e.controls || !t) return !1;
2883
3023
  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;
3024
+ 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
3025
  }
2886
- function Ar(e) {
3026
+ function wr(e) {
2887
3027
  if (!e.viewChangeHandler) return;
2888
3028
  const t = Date.now();
2889
3029
  if (t - e._lastViewEmitMs < 250) return;
2890
- const n = Gt(e);
3030
+ const n = Ut(e);
2891
3031
  if (!n) return;
2892
- const r = it(n);
3032
+ const r = st(n);
2893
3033
  r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
2894
3034
  }
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();
3035
+ function lt(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
3036
+ 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;
3037
+ 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
3038
  }
2899
- function xr(e, t = 1e3) {
3039
+ function Tr(e, t = 1e3) {
2900
3040
  !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
3041
  }
2902
- function vr(e, t = 2e3) {
3042
+ function $r(e, t = 2e3) {
2903
3043
  !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
3044
  }
2905
- function Ir(e, t = 0, n = 0) {
3045
+ function Rr(e, t = 0, n = 0) {
2906
3046
  e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
2907
3047
  }
2908
- function Cr(e, t = 1.1) {
3048
+ function Br(e, t = 1.1) {
2909
3049
  !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
3050
  }
2911
- function Dr(e, t = 1.2) {
3051
+ function Vr(e, t = 1.2) {
2912
3052
  if (!e.lastBounds) return;
2913
3053
  const {
2914
3054
  minX: n,
@@ -2917,16 +3057,16 @@ function Dr(e, t = 1.2) {
2917
3057
  maxY: i,
2918
3058
  minZ: s,
2919
3059
  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;
2921
- 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();
3060
+ } = 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, g = Math.max(c, a, u, 1) * 2;
3061
+ e.controls.target.set(m, d, f), e.camera.position.set(m + g, d + g, f + g), e.camera.lookAt(m, d, f), e.controls.update();
2922
3062
  }
2923
- const Sr = 1, Lr = 120;
2924
- function Or(e, t) {
3063
+ const Hr = 1, jr = 120;
3064
+ function Gr(e, t) {
2925
3065
  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;
3066
+ 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();
3067
+ return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
2928
3068
  }
2929
- function Pr(e, t = "orbit") {
3069
+ function Ur(e, t = "orbit") {
2930
3070
  if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
2931
3071
  e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
2932
3072
  else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
@@ -2936,36 +3076,36 @@ function Pr(e, t = "orbit") {
2936
3076
  }
2937
3077
  }
2938
3078
  const ue = "#9ca3af";
2939
- function _t(e, t) {
3079
+ function Nt(e, t) {
2940
3080
  const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
2941
3081
  if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
2942
3082
  const o = Math.min(n, r), i = Math.max(n, r);
2943
3083
  return i <= o ? null : { segStart: o, segEnd: i };
2944
3084
  }
2945
- function Fr(e, t, n) {
3085
+ function Yr(e, t, n) {
2946
3086
  let r = 0, o = 0;
2947
3087
  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);
3088
+ 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);
3089
+ if (!Number.isFinite(c) || !Number.isFinite(a) || !Number.isFinite(u) || a <= c) continue;
3090
+ const m = Math.max(t, c), f = Math.min(n, a) - m;
3091
+ f <= 0 || (r += u * f, o += f);
2952
3092
  }
2953
3093
  if (o <= 0) return null;
2954
3094
  const i = r / o;
2955
3095
  return Number.isFinite(i) ? i : null;
2956
3096
  }
2957
- function Tr(e, t) {
3097
+ function Xr(e, t) {
2958
3098
  if (!Number.isFinite(e)) return new _.Color(ue);
2959
3099
  if (Vt(e, t) < 0) return new _.Color(ue);
2960
- const r = pr(e, t, ue);
3100
+ const r = br(e, t, ue);
2961
3101
  return new _.Color(r);
2962
3102
  }
2963
- function wr(e) {
3103
+ function qr(e) {
2964
3104
  if (!e || !String(e).trim()) return ue;
2965
- const t = Ut(String(e).toLowerCase().trim());
3105
+ const t = Yt(String(e).toLowerCase().trim());
2966
3106
  return "#" + new _.Color().setHSL(t, 0.7, 0.5).getHexString();
2967
3107
  }
2968
- function $r(e = {}) {
3108
+ function Zr(e = {}) {
2969
3109
  return {
2970
3110
  preserveView: !!e.preserveView,
2971
3111
  assayIntervalsByHole: e.assayIntervalsByHole || null,
@@ -2973,7 +3113,7 @@ function $r(e = {}) {
2973
3113
  isCategoricalVariable: !!e.isCategoricalVariable
2974
3114
  };
2975
3115
  }
2976
- function Br(e, t) {
3116
+ function Wr(e, t) {
2977
3117
  if (!e || !t) return [];
2978
3118
  const n = [];
2979
3119
  return Object.values(e).forEach((r) => {
@@ -2989,140 +3129,140 @@ function Ze(e) {
2989
3129
  project: e.project
2990
3130
  };
2991
3131
  }
2992
- function Vr(e) {
3132
+ function Kr(e) {
2993
3133
  return `${e ?? ""}`.trim().toLowerCase();
2994
3134
  }
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();
3135
+ function Jr(e, t) {
3136
+ const n = `${e ?? ""}:${t ?? 0}`, r = Yt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new _.Color();
2997
3137
  return s.setHSL(i, 1, 0.5), s;
2998
3138
  }
2999
- function Ut(e) {
3139
+ function Yt(e) {
3000
3140
  const t = `${e ?? ""}`;
3001
3141
  let n = 2166136261;
3002
3142
  for (let r = 0; r < t.length; r += 1)
3003
3143
  n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
3004
3144
  return (n >>> 0) / 4294967295;
3005
3145
  }
3006
- function Rr(e, t, n) {
3146
+ function Qr(e, t, n) {
3007
3147
  let r = null, o = 0;
3008
3148
  for (const i of e) {
3009
3149
  const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
3010
3150
  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);
3151
+ const c = Math.min(n, l) - Math.max(t, s);
3152
+ c > o && (o = c, r = i == null ? void 0 : i.value);
3013
3153
  }
3014
3154
  return r;
3015
3155
  }
3016
- function jr(e, t) {
3156
+ function eo(e, t) {
3017
3157
  if (!t || !e) return [];
3018
3158
  const n = e.id || e.holeId;
3019
3159
  if (!n) return [];
3020
3160
  const r = t[n];
3021
3161
  if (Array.isArray(r) && r.length) return r;
3022
- const o = Vr(n);
3162
+ const o = Kr(n);
3023
3163
  if (o) {
3024
3164
  const i = t[o];
3025
3165
  if (Array.isArray(i) && i.length) return i;
3026
3166
  }
3027
3167
  return [];
3028
3168
  }
3029
- function Gr({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
3169
+ function to({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
3030
3170
  if (!e)
3031
- return Hr(r, o);
3171
+ return Jr(r, o);
3032
3172
  if (e === "__HAS_ASSAY__") {
3033
3173
  if (!(t != null && t.length)) return new _.Color(ue);
3034
- const c = _t(i, s);
3035
- return c ? t.some((d) => {
3174
+ const u = Nt(i, s);
3175
+ return u ? t.some((d) => {
3036
3176
  const f = Number(d == null ? void 0 : d.from), h = Number(d == null ? void 0 : d.to);
3037
3177
  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;
3178
+ const g = Math.max(u.segStart, f);
3179
+ return Math.min(u.segEnd, h) > g;
3040
3180
  }) ? new _.Color("#ff8c42") : new _.Color(ue) : new _.Color(ue);
3041
3181
  }
3042
3182
  if (!(t != null && t.length)) return new _.Color(ue);
3043
- const u = _t(i, s);
3044
- if (!u) return new _.Color(ue);
3183
+ const c = Nt(i, s);
3184
+ if (!c) return new _.Color(ue);
3045
3185
  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;
3186
+ const u = Qr(t, c.segStart, c.segEnd);
3187
+ return new _.Color(qr(u));
3188
+ }
3189
+ const a = Yr(t, c.segStart, c.segEnd);
3190
+ return Xr(a, n);
3191
+ }
3192
+ function no(e, t, n = {}) {
3193
+ if (!e.scene || (Xt(e), !t || t.length === 0)) return;
3194
+ const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = Zr(n), l = s ? [] : Wr(o, i), c = hr(l);
3195
+ let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, h = -1 / 0;
3196
+ const g = new _.Vector3(), y = new _.Vector3(0, 1, 0);
3197
+ t.forEach((p, b) => {
3198
+ const M = b * 137.5 % 360 / 360, I = new _.Color().setHSL(M, 0.75, 0.55), x = (p.points || []).map((D) => {
3199
+ a = Math.min(a, D.x), u = Math.max(u, D.x), m = Math.min(m, D.y), d = Math.max(d, D.y), f = Math.min(f, D.z), h = Math.max(h, D.z);
3200
+ const v = new _.Vector3(D.x, D.y, D.z);
3201
+ return v.md = D.md, v;
3062
3202
  });
3063
3203
  if (x.length < 2) {
3064
3204
  if (x.length === 1) {
3065
- const P = new _.SphereGeometry(5, 12, 12), E = new _.MeshLambertMaterial({
3066
- color: D,
3067
- emissive: D,
3205
+ const D = new _.SphereGeometry(5, 12, 12), v = new _.MeshLambertMaterial({
3206
+ color: I,
3207
+ emissive: I,
3068
3208
  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);
3209
+ }), L = new _.Mesh(D, v);
3210
+ L.position.copy(x[0]), L.userData = Ze(p), e.scene.add(L), e.drillLines.push(L), e.drillMeshes.push(L);
3071
3211
  }
3072
3212
  return;
3073
3213
  }
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({
3214
+ const S = new _.Group();
3215
+ S.userData = Ze(p);
3216
+ const w = i ? eo(p, o) : [];
3217
+ for (let D = 0; D < x.length - 1; D += 1) {
3218
+ const v = x[D], L = x[D + 1], O = g.subVectors(L, v), V = O.length();
3219
+ if (V <= 1e-3) continue;
3220
+ const H = 2.2, A = new _.CylinderGeometry(H, H, V, 6, 1, !0), E = to({
3081
3221
  selectedAssayVariable: i,
3082
- assayIntervals: $,
3083
- assayScale: u,
3222
+ assayIntervals: w,
3223
+ assayScale: c,
3084
3224
  holeId: p.id,
3085
- segmentIndex: P,
3086
- p1: E,
3087
- p2: F,
3225
+ segmentIndex: D,
3226
+ p1: v,
3227
+ p2: L,
3088
3228
  isCategorical: s
3089
- }), N = new _.MeshLambertMaterial({
3090
- color: k,
3229
+ }), z = new _.MeshLambertMaterial({
3230
+ color: E,
3091
3231
  flatShading: !0,
3092
- emissive: k,
3232
+ emissive: E,
3093
3233
  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);
3234
+ }), R = new _.Mesh(A, z);
3235
+ R.position.copy(v.clone().addScaledVector(O, 0.5)), R.quaternion.setFromUnitVectors(y, O.clone().normalize()), R.userData = Ze(p), S.add(R), e.drillMeshes.push(R);
3096
3236
  }
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);
3237
+ e.scene.add(S), e.drillLines.push(S);
3238
+ }), 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
3239
  }
3100
- function Yt(e) {
3240
+ function Xt(e) {
3101
3241
  e.drillLines.forEach((t) => {
3102
3242
  e.scene.remove(t), t.isGroup ? t.traverse((n) => {
3103
3243
  n.isMesh && (n.geometry.dispose(), n.material.dispose());
3104
3244
  }) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
3105
3245
  }), e.drillLines = [], e.drillMeshes = [], Me(e);
3106
3246
  }
3107
- const Nt = "#ffffbb", Yr = 2, qr = 1.5, Xr = 1;
3108
- function Zr(e) {
3247
+ const Mt = "#ffffbb", ro = 2, oo = 1.5, io = 1;
3248
+ function so(e) {
3109
3249
  const { renderer: t, scene: n, camera: r, container: o } = e;
3110
3250
  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;
3251
+ 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);
3252
+ l.addPass(c);
3253
+ const a = new _.Vector2(i, s), u = new un(a, n, r);
3254
+ 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
3255
  }
3116
- function Wr(e, t, n) {
3256
+ function lo(e, t, n) {
3117
3257
  !e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
3118
3258
  }
3119
3259
  function Se(e, t) {
3120
3260
  e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
3121
3261
  }
3122
- function Mt(e) {
3262
+ function zt(e) {
3123
3263
  e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
3124
3264
  }
3125
- const Kr = [
3265
+ const ao = [
3126
3266
  { normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
3127
3267
  { normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
3128
3268
  { normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
@@ -3130,40 +3270,40 @@ const Kr = [
3130
3270
  { normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
3131
3271
  { normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
3132
3272
  ];
3133
- function Jr(e, t, n, r, o = {}) {
3273
+ function co(e, t, n, r, o = {}) {
3134
3274
  if (!e.scene || (qt(e), !t || !n || !r)) return;
3135
3275
  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;
3137
- t.forEach((N) => {
3138
- 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);
3276
+ let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
3277
+ t.forEach((z) => {
3278
+ const R = Number(z.x ?? z.center_x ?? 0), C = Number(z.y ?? z.center_y ?? 0), G = Number(z.z ?? z.center_z ?? 0), U = Number(z.dx ?? z.size_x ?? 1), j = Number(z.dy ?? z.size_y ?? 1), Z = Number(z.dz ?? z.size_z ?? 1);
3279
+ l = Math.min(l, R - U / 2), c = Math.max(c, R + U / 2), a = Math.min(a, C - j / 2), u = Math.max(u, C + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
3140
3280
  });
3141
- 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;
3147
- 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++;
3155
- }), F.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), C.push(N);
3281
+ let f = 0, h = 0, g = 0;
3282
+ o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), h = -((a + u) / 2), g = -((m + d) / 2));
3283
+ const y = l + f, p = c + f, b = a + h, N = u + h, M = m + g, I = d + g, x = (z, R, C) => `${Math.round(z)},${Math.round(R)},${Math.round(C)}`, S = new Set(
3284
+ t.map((z) => x(Number(z.x ?? 0), Number(z.y ?? 0), Number(z.z ?? 0)))
3285
+ ), w = [], D = [], v = [], L = [], O = [];
3286
+ let V = 0;
3287
+ if (t.forEach((z) => {
3288
+ const R = Number(z.x ?? z.center_x ?? 0), C = Number(z.y ?? z.center_y ?? 0), G = Number(z.z ?? z.center_z ?? 0), U = Number(z.dx ?? z.size_x ?? 1), j = Number(z.dy ?? z.size_y ?? 1), Z = Number(z.dz ?? z.size_z ?? 1), K = R + f, le = C + h, ye = G + g, fe = $n(z[n], r, _), { r: Ce, g: he, b: Ge } = fe;
3289
+ ao.forEach((_e) => {
3290
+ const Jt = R + _e.neibDir[0] * U, Qt = C + _e.neibDir[1] * j, en = G + _e.neibDir[2] * Z;
3291
+ if (S.has(x(Jt, Qt, en))) return;
3292
+ const ze = V;
3293
+ _e.verts.forEach(([tn, nn, rn]) => {
3294
+ w.push(K + tn * U / 2, le + nn * j / 2, ye + rn * Z / 2), D.push(_e.normal[0], _e.normal[1], _e.normal[2]), v.push(Ce, he, Ge), V++;
3295
+ }), L.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), O.push(z);
3156
3296
  });
3157
- }), $.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({
3297
+ }), w.length === 0) return;
3298
+ const H = new _.BufferGeometry();
3299
+ H.setAttribute("position", new _.Float32BufferAttribute(w, 3)), H.setAttribute("normal", new _.Float32BufferAttribute(D, 3)), H.setAttribute("color", new _.Float32BufferAttribute(v, 3)), H.setIndex(L);
3300
+ const A = new _.MeshLambertMaterial({
3161
3301
  vertexColors: !0,
3162
3302
  transparent: s < 1,
3163
3303
  opacity: s,
3164
3304
  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 }));
3305
+ }), E = new _.Mesh(H, A);
3306
+ E.userData._isMergedBlocks = !0, E.userData._quadToBlock = O, E.userData._offset = { x: f, y: h, z: g }, e.scene.add(E), e.blocks.push(E), Me(e), e.camera && e.controls && (e.lastBounds = { minX: y, maxX: p, minY: b, maxY: N, minZ: M, maxZ: I }, lt(e, { minX: y, maxX: p, minY: b, maxY: N, minZ: M, maxZ: I }));
3167
3307
  }
3168
3308
  function qt(e) {
3169
3309
  var t;
@@ -3171,21 +3311,21 @@ function qt(e) {
3171
3311
  e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
3172
3312
  }), 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
3313
  }
3174
- function Qr(e, t) {
3314
+ function uo(e, t) {
3175
3315
  const n = Math.max(0, Math.min(1, Number(t)));
3176
3316
  e.blocks.forEach((r) => {
3177
3317
  r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
3178
3318
  });
3179
3319
  }
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);
3320
+ function mo(e, t, n) {
3321
+ 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
3322
  if (!e._blockHighlightMesh) {
3183
3323
  const d = new _.BoxGeometry(1, 1, 1), f = new _.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
3184
3324
  e._blockHighlightMesh = new _.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
3185
3325
  }
3186
- return e._blockHighlightMesh.position.set(s, l, u), e._blockHighlightMesh.scale.set(a, c, m), e._blockHighlightMesh;
3326
+ return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
3187
3327
  }
3188
- function Xt(e) {
3328
+ function Zt(e) {
3189
3329
  var o, i;
3190
3330
  if (!e._outlinePass || e.selectables.length === 0) {
3191
3331
  e._outlinePass && Se(e, null);
@@ -3200,98 +3340,98 @@ function Xt(e) {
3200
3340
  if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
3201
3341
  const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
3202
3342
  if (l) {
3203
- Se(e, eo(e, l, r.userData._offset));
3343
+ Se(e, mo(e, l, r.userData._offset));
3204
3344
  return;
3205
3345
  }
3206
3346
  }
3207
3347
  Se(e, r);
3208
3348
  }
3209
- function to(e) {
3349
+ function fo(e) {
3210
3350
  const t = e.renderer;
3211
3351
  t && (e.handleCanvasClick = (n) => {
3212
- var f, h, b, y, p, g, M;
3352
+ var f, h, g, y, p, b, N;
3213
3353
  if (n.button !== 0) return;
3214
3354
  if ((f = e.gizmo) != null && f.domElement) {
3215
- const z = e.gizmo.domElement.getBoundingClientRect();
3216
- if (n.clientX >= z.left && n.clientX <= z.right && n.clientY >= z.top && n.clientY <= z.bottom)
3355
+ const M = e.gizmo.domElement.getBoundingClientRect();
3356
+ if (n.clientX >= M.left && n.clientX <= M.right && n.clientY >= M.top && n.clientY <= M.bottom)
3217
3357
  return;
3218
3358
  }
3219
3359
  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) {
3221
- const z = e.raycaster.intersectObjects(e.blocks, !1);
3222
- if (z.length > 0) {
3223
- const D = z[0], x = D.object;
3360
+ 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) {
3361
+ const M = e.raycaster.intersectObjects(e.blocks, !1);
3362
+ if (M.length > 0) {
3363
+ const I = M[0], x = I.object;
3224
3364
  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];
3226
- $ && e.blockClickHandler($);
3365
+ const S = Math.floor(I.faceIndex / 2), w = x.userData._quadToBlock[S];
3366
+ w && e.blockClickHandler(w);
3227
3367
  }
3228
3368
  return;
3229
3369
  }
3230
3370
  }
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) {
3233
- const z = l[0].object;
3234
- e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...z.userData });
3371
+ const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((g = s[0]) == null ? void 0 : g.distance) ?? 1 / 0;
3372
+ if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) < c && l.length > 0) {
3373
+ const M = l[0].object;
3374
+ e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...M.userData });
3235
3375
  return;
3236
3376
  }
3237
3377
  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;
3378
+ let u = s[0].object;
3379
+ for (; u && u.parent && !((p = u.userData) != null && p.holeId); )
3380
+ u = u.parent;
3381
+ const m = (b = u == null ? void 0 : u.userData) == null ? void 0 : b.holeId, d = (N = u == null ? void 0 : u.userData) == null ? void 0 : N.project;
3242
3382
  m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
3243
3383
  }, t.domElement.addEventListener("click", e.handleCanvasClick));
3244
3384
  }
3245
- class _i {
3385
+ class Di {
3246
3386
  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;
3387
+ 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, this.rasterOverlays = /* @__PURE__ */ new Map();
3248
3388
  }
3249
3389
  init(t) {
3250
3390
  if (!t) return;
3251
3391
  this.container = t;
3252
3392
  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);
3393
+ this.scene = new _.Scene(), this.scene.background = new _.Color(16777215), this.camera = new _.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 _.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
3254
3394
  const o = new _.AmbientLight(16777215, 1.2);
3255
3395
  this.scene.add(o);
3256
3396
  const i = new _.DirectionalLight(16777215, 1.5);
3257
3397
  i.position.set(10, 10, 5), this.scene.add(i);
3258
3398
  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 = {
3399
+ 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 = {
3260
3400
  LEFT: _.MOUSE.PAN,
3261
3401
  MIDDLE: _.MOUSE.DOLLY,
3262
3402
  RIGHT: _.MOUSE.ROTATE
3263
3403
  }, this.controls.touches = {
3264
3404
  ONE: _.TOUCH.ROTATE,
3265
3405
  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, {
3406
+ }, 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
3407
  container: this.container,
3268
3408
  placement: "top-right",
3269
3409
  size: 110,
3270
3410
  offset: { top: 12, right: 12 },
3271
3411
  animated: !0,
3272
3412
  speed: 1.5
3273
- }), this.gizmo.attachControls(this.controls), to(this), Zr(this);
3413
+ }), this.gizmo.attachControls(this.controls), fo(this), so(this);
3274
3414
  const l = () => {
3275
3415
  var a;
3276
3416
  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();
3417
+ const c = this.clock.getDelta();
3418
+ 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
3419
  };
3280
3420
  l();
3281
3421
  }
3282
3422
  resize() {
3283
3423
  if (!this.container || !this.camera || !this.renderer) return;
3284
3424
  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);
3425
+ this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), lo(this, t, n);
3286
3426
  }
3287
3427
  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));
3428
+ 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
3429
  }
3290
3430
  // ---------------------------------------------------------------------------
3291
3431
  // Data renderers — delegate to domain modules
3292
3432
  // ---------------------------------------------------------------------------
3293
3433
  setDrillholes(t, n = {}) {
3294
- Ur(this, t, n);
3434
+ no(this, t, n);
3295
3435
  }
3296
3436
  /**
3297
3437
  * Render block model data as a single merged mesh of exterior faces only.
@@ -3301,17 +3441,17 @@ class _i {
3301
3441
  * @param {Object} [options]
3302
3442
  */
3303
3443
  setBlocks(t, n, r, o = {}) {
3304
- Jr(this, t, n, r, o);
3444
+ co(this, t, n, r, o);
3305
3445
  }
3306
3446
  /**
3307
3447
  * Update the opacity of all currently rendered blocks.
3308
3448
  * @param {number} opacity - New opacity value between 0 and 1
3309
3449
  */
3310
3450
  setBlockOpacity(t) {
3311
- Qr(this, t);
3451
+ uo(this, t);
3312
3452
  }
3313
3453
  setStructuralDiscs(t, n, r = {}) {
3314
- zr(this, t, n, r);
3454
+ vr(this, t, n, r);
3315
3455
  }
3316
3456
  setStructuralDiscsVisible(t) {
3317
3457
  Er(this, t);
@@ -3336,44 +3476,44 @@ class _i {
3336
3476
  this.viewChangeHandler = typeof t == "function" ? t : null;
3337
3477
  }
3338
3478
  getViewState() {
3339
- return Gt(this);
3479
+ return Ut(this);
3340
3480
  }
3341
3481
  setViewState(t) {
3342
- return kr(this, t);
3482
+ return Fr(this, t);
3343
3483
  }
3344
3484
  _buildViewSignature(t) {
3345
- return it(t);
3485
+ return st(t);
3346
3486
  }
3347
3487
  _emitViewChangeIfNeeded() {
3348
- Ar(this);
3488
+ wr(this);
3349
3489
  }
3350
3490
  _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 });
3491
+ lt(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
3352
3492
  }
3353
3493
  recenterCameraToOrigin(t = 1e3) {
3354
- xr(this, t);
3494
+ Tr(this, t);
3355
3495
  }
3356
3496
  lookDown(t = 2e3) {
3357
- vr(this, t);
3497
+ $r(this, t);
3358
3498
  }
3359
3499
  pan(t = 0, n = 0) {
3360
- Ir(this, t, n);
3500
+ Rr(this, t, n);
3361
3501
  }
3362
3502
  dolly(t = 1.1) {
3363
- Cr(this, t);
3503
+ Br(this, t);
3364
3504
  }
3365
3505
  focusOnLastBounds(t = 1.2) {
3366
- Dr(this, t);
3506
+ Vr(this, t);
3367
3507
  }
3368
3508
  /**
3369
3509
  * Change the camera field-of-view while keeping the visible scene the same apparent size.
3370
3510
  * @param {number} fovDeg - Desired FOV in degrees
3371
3511
  */
3372
3512
  setCameraFov(t) {
3373
- Or(this, t);
3513
+ Gr(this, t);
3374
3514
  }
3375
3515
  setControlMode(t = "orbit") {
3376
- Pr(this, t);
3516
+ Ur(this, t);
3377
3517
  }
3378
3518
  // ---------------------------------------------------------------------------
3379
3519
  // Selection glow public API
@@ -3406,14 +3546,70 @@ class _i {
3406
3546
  * Dispose the effect composer and all GPU resources used by the selection glow.
3407
3547
  */
3408
3548
  disposeGlow() {
3409
- Mt(this);
3549
+ zt(this);
3410
3550
  }
3411
3551
  /** @private */
3412
3552
  _updateSelectionFromPointer() {
3413
- Xt(this);
3553
+ Zt(this);
3554
+ }
3555
+ // ---------------------------------------------------------------------------
3556
+ // Raster overlay API — delegate to rasterOverlayScene
3557
+ // ---------------------------------------------------------------------------
3558
+ /**
3559
+ * Add a raster overlay layer (created with createRasterOverlay) to the scene.
3560
+ * @param {object} layer - Layer descriptor returned by createRasterOverlay()
3561
+ */
3562
+ addRasterOverlay(t) {
3563
+ Ir(this, t);
3564
+ }
3565
+ /**
3566
+ * Remove a raster overlay from the scene and dispose its GPU resources.
3567
+ * @param {string} id - Overlay id
3568
+ */
3569
+ removeRasterOverlay(t) {
3570
+ it(this, t);
3571
+ }
3572
+ /**
3573
+ * Set the opacity of a raster overlay at runtime.
3574
+ * @param {string} id - Overlay id
3575
+ * @param {number} opacity - New opacity [0, 1]
3576
+ */
3577
+ setRasterOverlayOpacity(t, n) {
3578
+ Or(this, t, n);
3579
+ }
3580
+ /**
3581
+ * Show or hide a raster overlay.
3582
+ * @param {string} id - Overlay id
3583
+ * @param {boolean} visible
3584
+ */
3585
+ setRasterOverlayVisibility(t, n) {
3586
+ Cr(this, t, n);
3587
+ }
3588
+ /**
3589
+ * Update the elevation (Z position) of a raster overlay.
3590
+ * @param {string} id - Overlay id
3591
+ * @param {number} elevation
3592
+ */
3593
+ setRasterOverlayElevation(t, n) {
3594
+ Sr(this, t, n);
3595
+ }
3596
+ /**
3597
+ * Return a raster overlay by id, or undefined if not found.
3598
+ * @param {string} id
3599
+ * @returns {object|undefined}
3600
+ */
3601
+ getRasterOverlay(t) {
3602
+ return Dr(this, t);
3603
+ }
3604
+ /**
3605
+ * Return all raster overlay layers in insertion order.
3606
+ * @returns {object[]}
3607
+ */
3608
+ listRasterOverlays() {
3609
+ return Lr(this);
3414
3610
  }
3415
3611
  }
3416
- function Ni({
3612
+ function Li({
3417
3613
  controlMode: e = "orbit",
3418
3614
  onToggleFly: t = () => {
3419
3615
  },
@@ -3425,13 +3621,13 @@ function Ni({
3425
3621
  }
3426
3622
  }) {
3427
3623
  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" })
3624
+ /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
3625
+ /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
3626
+ /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
3627
+ /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
3432
3628
  ] });
3433
3629
  }
3434
- function Mi({
3630
+ function Pi({
3435
3631
  properties: e = [],
3436
3632
  selectedProperty: t = "",
3437
3633
  onPropertyChange: n = () => {
@@ -3444,37 +3640,37 @@ function Mi({
3444
3640
  onPopupClose: l = () => {
3445
3641
  }
3446
3642
  }) {
3447
- var u, a;
3643
+ var c, a;
3448
3644
  return /* @__PURE__ */ J("div", { className: "bm-widget", children: [
3449
- /* @__PURE__ */ S("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
3645
+ /* @__PURE__ */ P("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
3450
3646
  /* @__PURE__ */ J(
3451
3647
  "select",
3452
3648
  {
3453
3649
  id: "bm-property-select",
3454
3650
  className: "bm-widget__select",
3455
3651
  value: t,
3456
- onChange: (c) => n(c.target.value),
3652
+ onChange: (u) => n(u.target.value),
3457
3653
  children: [
3458
- e.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "— no attributes —" }),
3459
- e.map((c) => /* @__PURE__ */ S("option", { value: c, children: c }, c))
3654
+ e.length === 0 && /* @__PURE__ */ P("option", { value: "", children: "— no attributes —" }),
3655
+ e.map((u) => /* @__PURE__ */ P("option", { value: u, children: u }, u))
3460
3656
  ]
3461
3657
  }
3462
3658
  ),
3463
3659
  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)) ?? "—" })
3660
+ /* @__PURE__ */ P("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
3661
+ /* @__PURE__ */ P("div", { className: "bm-widget__scale-bar" }),
3662
+ /* @__PURE__ */ P("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
3467
3663
  ] }),
3468
- i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
3664
+ i && i.type === "categorical" && /* @__PURE__ */ P("div", { className: "bm-widget__categories", children: (i.categories || []).map((u, m) => {
3469
3665
  const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
3470
- return /* @__PURE__ */ S(
3666
+ return /* @__PURE__ */ P(
3471
3667
  "span",
3472
3668
  {
3473
3669
  className: "bm-widget__category-chip",
3474
3670
  style: { background: `hsl(${d},70%,50%)` },
3475
- children: c
3671
+ children: u
3476
3672
  },
3477
- c
3673
+ u
3478
3674
  );
3479
3675
  }) }),
3480
3676
  /* @__PURE__ */ J("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
@@ -3482,7 +3678,7 @@ function Mi({
3482
3678
  Math.round(r * 100),
3483
3679
  "%)"
3484
3680
  ] }),
3485
- /* @__PURE__ */ S(
3681
+ /* @__PURE__ */ P(
3486
3682
  "input",
3487
3683
  {
3488
3684
  id: "bm-opacity-slider",
@@ -3492,13 +3688,13 @@ function Mi({
3492
3688
  max: "1",
3493
3689
  step: "0.01",
3494
3690
  value: r,
3495
- onChange: (c) => o(parseFloat(c.target.value))
3691
+ onChange: (u) => o(parseFloat(u.target.value))
3496
3692
  }
3497
3693
  ),
3498
3694
  s && /* @__PURE__ */ J("div", { className: "bm-widget__popup", children: [
3499
3695
  /* @__PURE__ */ J("div", { className: "bm-widget__popup-header", children: [
3500
- /* @__PURE__ */ S("span", { children: "Block attributes" }),
3501
- /* @__PURE__ */ S(
3696
+ /* @__PURE__ */ P("span", { children: "Block attributes" }),
3697
+ /* @__PURE__ */ P(
3502
3698
  "button",
3503
3699
  {
3504
3700
  type: "button",
@@ -3509,19 +3705,19 @@ function Mi({
3509
3705
  }
3510
3706
  )
3511
3707
  ] }),
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)) }) })
3708
+ /* @__PURE__ */ P("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ P("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ J("tr", { children: [
3709
+ /* @__PURE__ */ P("th", { children: u }),
3710
+ /* @__PURE__ */ P("td", { children: m == null ? "—" : String(m) })
3711
+ ] }, u)) }) })
3516
3712
  ] })
3517
3713
  ] });
3518
3714
  }
3519
- const no = [
3715
+ const ho = [
3520
3716
  { minZoom: 0, lodKey: "thumb" },
3521
3717
  { minZoom: 4, lodKey: "medium" },
3522
3718
  { minZoom: 7, lodKey: "full" }
3523
- ], Zt = 50;
3524
- function ro(e, t, n = no) {
3719
+ ], Wt = 50;
3720
+ function po(e, t, n = ho) {
3525
3721
  var i;
3526
3722
  const r = e.lod_urls;
3527
3723
  if (!r || typeof r != "object" || Array.isArray(r))
@@ -3531,10 +3727,10 @@ function ro(e, t, n = no) {
3531
3727
  t >= s.minZoom && (o = s.lodKey);
3532
3728
  return r[o] || e.image_url || "";
3533
3729
  }
3534
- function oo(e) {
3730
+ function bo(e) {
3535
3731
  return [...e].sort((t, n) => (t.from_depth ?? 0) - (n.from_depth ?? 0));
3536
3732
  }
3537
- function io(e) {
3733
+ function go(e) {
3538
3734
  const t = {};
3539
3735
  for (const n of e) {
3540
3736
  const r = n.photo_set != null && n.photo_set !== "" ? String(n.photo_set) : "default";
@@ -3542,7 +3738,7 @@ function io(e) {
3542
3738
  }
3543
3739
  return t;
3544
3740
  }
3545
- function so(e, t, n = 10) {
3741
+ function yo(e, t, n = 10) {
3546
3742
  const r = [];
3547
3743
  if (e >= t || n <= 0) return r;
3548
3744
  const o = Math.ceil(e / n) * n, i = n * 1e-9;
@@ -3552,120 +3748,120 @@ function so(e, t, n = 10) {
3552
3748
  }
3553
3749
  return r;
3554
3750
  }
3555
- function lo(e) {
3751
+ function _o(e) {
3556
3752
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
3557
3753
  }
3558
- function Wt(e) {
3754
+ function Kt(e) {
3559
3755
  return `tray_${String(e).padStart(3, "0")}.jpg`;
3560
3756
  }
3561
- function ao(e, t, n, r, o = "Tray Images", i = Wt) {
3757
+ function No(e, t, n, r, o = "Tray Images", i = Kt) {
3562
3758
  const s = (n ?? "").replace(/\/$/, ""), l = (r ?? "").replace(/\/$/, "");
3563
- return t.map((u, a) => {
3564
- const c = u.filename ?? i(a), m = u.photoSet ?? o;
3759
+ return t.map((c, a) => {
3760
+ const u = c.filename ?? i(a), m = c.photoSet ?? o;
3565
3761
  return {
3566
3762
  hole_id: e,
3567
- from_depth: u.fromDepth,
3568
- to_depth: u.toDepth,
3763
+ from_depth: c.fromDepth,
3764
+ to_depth: c.toDepth,
3569
3765
  photo_set: m,
3570
- image_url: `${s}/${c}`,
3766
+ image_url: `${s}/${u}`,
3571
3767
  lod_urls: {
3572
- thumb: `${s}/${c}`,
3573
- full: `${l}/${c}`
3768
+ thumb: `${s}/${u}`,
3769
+ full: `${l}/${u}`
3574
3770
  }
3575
3771
  };
3576
3772
  });
3577
3773
  }
3578
- function zi(e, t, n = Zt) {
3774
+ function Fi(e, t, n = Wt) {
3579
3775
  const r = t / 5;
3580
3776
  return Math.max(1, Math.round(e * n * r));
3581
3777
  }
3582
- const We = 5, zt = 1.12, co = 0.05, uo = 40;
3583
- function mo({
3778
+ const We = 5, vt = 1.12, Mo = 0.05, zo = 40;
3779
+ function vo({
3584
3780
  photos: e = [],
3585
3781
  holeId: t = "",
3586
3782
  initialZoom: n = 5,
3587
3783
  transform: r,
3588
3784
  onTransformChange: o
3589
3785
  }) {
3590
- const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, u = Le(l);
3591
- u.current = l;
3786
+ const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, c = De(l);
3787
+ c.current = l;
3592
3788
  const a = Ue(
3593
- (E) => {
3594
- const F = typeof E == "function" ? E(u.current) : E;
3595
- o ? o(F) : s(F);
3789
+ (v) => {
3790
+ const L = typeof v == "function" ? v(c.current) : v;
3791
+ o ? o(L) : s(L);
3596
3792
  },
3597
3793
  [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();
3600
- for (const F of e) {
3601
- const C = F.photo_set != null && F.photo_set !== "" ? String(F.photo_set) : "default";
3602
- E.add(C);
3794
+ ), [u, m] = Q(!1), d = De(null), f = De(null), h = ne(() => bo(e), [e]), g = ne(() => go(h), [h]), y = ne(() => {
3795
+ const v = /* @__PURE__ */ new Set();
3796
+ for (const L of e) {
3797
+ const O = L.photo_set != null && L.photo_set !== "" ? String(L.photo_set) : "default";
3798
+ v.add(O);
3603
3799
  }
3604
- return [...E];
3605
- }, [e]), { minDepth: p, maxDepth: g } = ne(() => {
3800
+ return [...v];
3801
+ }, [e]), { minDepth: p, maxDepth: b } = ne(() => {
3606
3802
  if (!h.length) return { minDepth: 0, maxDepth: 0 };
3607
- const E = h.map((F) => F.to_depth ?? F.from_depth ?? 0);
3803
+ const v = h.map((L) => L.to_depth ?? L.from_depth ?? 0);
3608
3804
  return {
3609
3805
  minDepth: h[0].from_depth ?? 0,
3610
- maxDepth: Math.max(...E)
3806
+ maxDepth: Math.max(...v)
3611
3807
  };
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(
3808
+ }, [h]), N = Wt * We / 5, M = ne(
3809
+ () => Math.max(1, Math.round((b - p) * N)),
3810
+ [p, b, N]
3811
+ ), I = ne(() => {
3812
+ const v = _o(We);
3813
+ return yo(p, b, v);
3814
+ }, [p, b]), x = 540 * We / 5, S = ne(
3619
3815
  () => Math.max(1, Math.min(10, Math.round(n * l.scale))),
3620
3816
  [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;
3817
+ ), w = Ue((v) => {
3818
+ v.preventDefault();
3819
+ const L = v.deltaY < 0 ? vt : 1 / vt, O = f.current.getBoundingClientRect(), V = v.clientX - O.left, H = v.clientY - O.top;
3820
+ a((A) => {
3821
+ const E = Math.max(Mo, Math.min(zo, A.scale * L)), z = E / A.scale;
3626
3822
  return {
3627
- scale: k,
3628
- tx: H - (H - v.tx) * N,
3629
- ty: R - (R - v.ty) * N
3823
+ scale: E,
3824
+ tx: V - (V - A.tx) * z,
3825
+ ty: H - (H - A.ty) * z
3630
3826
  };
3631
3827
  });
3632
3828
  }, [a]);
3633
3829
  se(() => {
3634
- const E = f.current;
3635
- if (E)
3636
- return E.addEventListener("wheel", $, { passive: !1 }), () => E.removeEventListener("wheel", $);
3637
- }, [$]);
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
3830
+ const v = f.current;
3831
+ if (v)
3832
+ return v.addEventListener("wheel", w, { passive: !1 }), () => v.removeEventListener("wheel", w);
3833
+ }, [w]);
3834
+ const D = Ue((v) => {
3835
+ v.button === 0 && (v.preventDefault(), d.current = {
3836
+ x: v.clientX,
3837
+ y: v.clientY,
3838
+ tx: c.current.tx,
3839
+ ty: c.current.ty
3644
3840
  }, m(!0));
3645
3841
  }, []);
3646
3842
  return se(() => {
3647
- const E = (C) => {
3843
+ const v = (O) => {
3648
3844
  if (!d.current) return;
3649
- const { tx: H, ty: R, x: v, y: k } = d.current;
3650
- a((N) => ({
3651
- ...N,
3652
- tx: H + (C.clientX - v),
3653
- ty: R + (C.clientY - k)
3845
+ const { tx: V, ty: H, x: A, y: E } = d.current;
3846
+ a((z) => ({
3847
+ ...z,
3848
+ tx: V + (O.clientX - A),
3849
+ ty: H + (O.clientY - E)
3654
3850
  }));
3655
- }, F = () => {
3851
+ }, L = () => {
3656
3852
  d.current = null, m(!1);
3657
3853
  };
3658
- return window.addEventListener("mousemove", E), window.addEventListener("mouseup", F), () => {
3659
- window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", F);
3854
+ return window.addEventListener("mousemove", v), window.addEventListener("mouseup", L), () => {
3855
+ window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", L);
3660
3856
  };
3661
3857
  }, [a]), /* @__PURE__ */ J("div", { className: "core-photo-table", children: [
3662
3858
  /* @__PURE__ */ J("div", { className: "core-photo-controls", children: [
3663
- t && /* @__PURE__ */ S("span", { className: "core-photo-hole-id", children: t }),
3859
+ t && /* @__PURE__ */ P("span", { className: "core-photo-hole-id", children: t }),
3664
3860
  /* @__PURE__ */ J("span", { className: "core-photo-zoom-label", children: [
3665
3861
  Math.round(l.scale * 100),
3666
3862
  "%"
3667
3863
  ] }),
3668
- /* @__PURE__ */ S(
3864
+ /* @__PURE__ */ P(
3669
3865
  "button",
3670
3866
  {
3671
3867
  className: "core-photo-zoom-btn",
@@ -3677,91 +3873,91 @@ function mo({
3677
3873
  )
3678
3874
  ] }),
3679
3875
  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(
3876
+ /* @__PURE__ */ P("div", { className: "core-photo-ruler-spacer" }),
3877
+ y.map((v) => /* @__PURE__ */ P(
3682
3878
  "div",
3683
3879
  {
3684
3880
  className: "core-photo-set-header",
3685
3881
  style: { width: x },
3686
- children: E
3882
+ children: v
3687
3883
  },
3688
- E
3884
+ v
3689
3885
  ))
3690
3886
  ] }),
3691
- e.length === 0 ? /* @__PURE__ */ S("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ S(
3887
+ e.length === 0 ? /* @__PURE__ */ P("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ P(
3692
3888
  "div",
3693
3889
  {
3694
- className: `core-photo-scroll${c ? " is-dragging" : ""}`,
3890
+ className: `core-photo-scroll${u ? " is-dragging" : ""}`,
3695
3891
  ref: f,
3696
- onMouseDown: P,
3892
+ onMouseDown: D,
3697
3893
  children: /* @__PURE__ */ J(
3698
3894
  "div",
3699
3895
  {
3700
3896
  className: "core-photo-inner",
3701
3897
  style: {
3702
- height: z,
3898
+ height: M,
3703
3899
  transform: `translate(${l.tx}px, ${l.ty}px) scale(${l.scale})`,
3704
3900
  transformOrigin: "0 0"
3705
3901
  },
3706
3902
  children: [
3707
- /* @__PURE__ */ S(
3903
+ /* @__PURE__ */ P(
3708
3904
  "div",
3709
3905
  {
3710
3906
  className: "core-photo-depth-ruler",
3711
- style: { height: z },
3712
- children: D.map(({ depth: E, label: F }) => /* @__PURE__ */ S(
3907
+ style: { height: M },
3908
+ children: I.map(({ depth: v, label: L }) => /* @__PURE__ */ P(
3713
3909
  "div",
3714
3910
  {
3715
3911
  className: "core-photo-depth-marker",
3716
3912
  style: {
3717
- top: Math.round((E - p) * M)
3913
+ top: Math.round((v - p) * N)
3718
3914
  },
3719
- children: F
3915
+ children: L
3720
3916
  },
3721
- E
3917
+ v
3722
3918
  ))
3723
3919
  }
3724
3920
  ),
3725
- y.map((E) => /* @__PURE__ */ S(
3921
+ y.map((v) => /* @__PURE__ */ P(
3726
3922
  "div",
3727
3923
  {
3728
3924
  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(
3732
- (C - p) * M
3733
- ), v = Math.max(
3925
+ style: { height: M, width: x },
3926
+ children: g[v].map((L) => {
3927
+ const O = L.from_depth ?? 0, V = L.to_depth ?? O, H = Math.round(
3928
+ (O - p) * N
3929
+ ), A = Math.max(
3734
3930
  2,
3735
- Math.round((H - C) * M)
3736
- ), k = ro(F, O);
3931
+ Math.round((V - O) * N)
3932
+ ), E = po(L, S);
3737
3933
  return /* @__PURE__ */ J(
3738
3934
  "div",
3739
3935
  {
3740
3936
  className: "core-photo-item",
3741
- style: { top: R, height: v, width: x },
3742
- title: `${C}–${H} m`,
3937
+ style: { top: H, height: A, width: x },
3938
+ title: `${O}–${V} m`,
3743
3939
  children: [
3744
- k ? /* @__PURE__ */ S(
3940
+ E ? /* @__PURE__ */ P(
3745
3941
  "img",
3746
3942
  {
3747
- src: k,
3748
- alt: `Core ${C}–${H} m`,
3943
+ src: E,
3944
+ alt: `Core ${O}–${V} m`,
3749
3945
  loading: "lazy"
3750
3946
  }
3751
- ) : /* @__PURE__ */ S("div", { className: "core-photo-no-image" }),
3752
- v >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
3753
- C,
3947
+ ) : /* @__PURE__ */ P("div", { className: "core-photo-no-image" }),
3948
+ A >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
3949
+ O,
3754
3950
  "–",
3755
- H,
3951
+ V,
3756
3952
  " m"
3757
3953
  ] })
3758
3954
  ]
3759
3955
  },
3760
- `${F.hole_id ?? ""}-${C}-${H}-${E}`
3956
+ `${L.hole_id ?? ""}-${O}-${V}-${v}`
3761
3957
  );
3762
3958
  })
3763
3959
  },
3764
- E
3960
+ v
3765
3961
  ))
3766
3962
  ]
3767
3963
  }
@@ -3770,33 +3966,33 @@ function mo({
3770
3966
  )
3771
3967
  ] });
3772
3968
  }
3773
- function Ei({
3969
+ function wi({
3774
3970
  holeId: e = "",
3775
3971
  trays: t = [],
3776
3972
  thumbBaseUrl: n = "",
3777
3973
  fullBaseUrl: r = "",
3778
3974
  photoSet: o = "Tray Images",
3779
- getFilename: i = Wt,
3975
+ getFilename: i = Kt,
3780
3976
  initialZoom: s = 5,
3781
3977
  transform: l,
3782
- onTransformChange: u
3978
+ onTransformChange: c
3783
3979
  }) {
3784
3980
  const a = ne(
3785
- () => ao(e, t, n, r, o, i),
3981
+ () => No(e, t, n, r, o, i),
3786
3982
  [e, t, n, r, o, i]
3787
3983
  );
3788
- return /* @__PURE__ */ S(
3789
- mo,
3984
+ return /* @__PURE__ */ P(
3985
+ vo,
3790
3986
  {
3791
3987
  photos: a,
3792
3988
  holeId: e,
3793
3989
  initialZoom: s,
3794
3990
  transform: l,
3795
- onTransformChange: u
3991
+ onTransformChange: c
3796
3992
  }
3797
3993
  );
3798
3994
  }
3799
- function ki(e) {
3995
+ function Ti(e) {
3800
3996
  const t = typeof e == "string" ? JSON.parse(e) : e;
3801
3997
  if (t.schema_version !== "1.0")
3802
3998
  throw new Error(
@@ -3824,7 +4020,7 @@ function ki(e) {
3824
4020
  blocks: n
3825
4021
  };
3826
4022
  }
3827
- function fo(e) {
4023
+ function Eo(e) {
3828
4024
  const t = new _.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
3829
4025
  e.vertices.forEach(([o, i, s], l) => {
3830
4026
  n[l * 3] = o, n[l * 3 + 1] = i, n[l * 3 + 2] = s;
@@ -3834,17 +4030,17 @@ function fo(e) {
3834
4030
  r[l * 3] = o, r[l * 3 + 1] = i, r[l * 3 + 2] = s;
3835
4031
  }), t.setIndex(new _.BufferAttribute(r, 1)), t;
3836
4032
  }
3837
- function Ai(e, t, n = {}) {
4033
+ function $i(e, t, n = {}) {
3838
4034
  const { defaultOpacity: r = 1 } = n, o = new _.Group();
3839
4035
  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({
4036
+ var g, y;
4037
+ const s = Eo(i), l = ((g = i.material) == null ? void 0 : g.color) ?? "#888888", c = ((y = i.material) == null ? void 0 : y.opacity) ?? r, a = c < 1, u = new _.MeshStandardMaterial({
3842
4038
  color: new _.Color(l),
3843
- opacity: u,
4039
+ opacity: c,
3844
4040
  transparent: a,
3845
4041
  side: _.DoubleSide,
3846
4042
  flatShading: !0
3847
- }), m = new _.Mesh(s, c);
4043
+ }), m = new _.Mesh(s, u);
3848
4044
  m.userData = {
3849
4045
  id: i.id,
3850
4046
  attributes: i.attributes
@@ -3854,169 +4050,180 @@ function Ai(e, t, n = {}) {
3854
4050
  }), e.add(o), o;
3855
4051
  }
3856
4052
  export {
3857
- mr as ASSAY_COLOR_PALETTE_10,
3858
- fn as ASSAY_NON_VALUE_FIELDS,
3859
- q as AZIMUTH,
4053
+ fr as ASSAY_COLOR_PALETTE_10,
4054
+ hn as ASSAY_NON_VALUE_FIELDS,
4055
+ X as AZIMUTH,
3860
4056
  qn as BASELODE_COLORWAY,
3861
4057
  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,
4058
+ Ni as BASELODE_DARK_TEMPLATE,
4059
+ _i as BASELODE_DARK_TEMPLATE_NAME,
4060
+ To as BASELODE_DATA_MODEL_DRILL_ASSAY,
4061
+ Fo as BASELODE_DATA_MODEL_DRILL_COLLAR,
4062
+ mn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
4063
+ wo as BASELODE_DATA_MODEL_DRILL_SURVEY,
4064
+ $o as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
4065
+ B as BASELODE_LIGHT,
4066
+ yi as BASELODE_LIGHT_TEMPLATE,
4067
+ gi as BASELODE_LIGHT_TEMPLATE_NAME,
4068
+ Oe as BASELODE_TEMPLATE,
4069
+ Xn as BASELODE_TEMPLATE_NAME,
4070
+ Wt as BASE_PIXELS_PER_METRE,
4071
+ Xe as BUILTIN_COLOUR_MAPS,
4072
+ Li as Baselode3DControls,
4073
+ Di as Baselode3DScene,
4074
+ Pi as BlockModelWidget,
4075
+ at as CHART_OPTIONS,
4076
+ zn as COMMENT_COLUMN_NAMES,
4077
+ Be as COMMODITY_COLOURS,
3882
4078
  Et as CRS,
3883
- mo as CorePhotoTable,
3884
- Ei as CorePhotoViewer,
3885
- mn as DEFAULT_COLUMN_MAP,
3886
- no as DEFAULT_LOD_BREAKPOINTS,
4079
+ vo as CorePhotoTable,
4080
+ wi as CorePhotoViewer,
4081
+ fn as DEFAULT_COLUMN_MAP,
4082
+ ho as DEFAULT_LOD_BREAKPOINTS,
3887
4083
  W as DEPTH,
3888
- X as DIP,
3889
- Oe as DISPLAY_CATEGORICAL,
3890
- xe as DISPLAY_COMMENT,
4084
+ q as DIP,
4085
+ Le as DISPLAY_CATEGORICAL,
4086
+ ke as DISPLAY_COMMENT,
3891
4087
  $e as DISPLAY_HIDDEN,
3892
- ve as DISPLAY_NUMERIC,
4088
+ Ae as DISPLAY_NUMERIC,
3893
4089
  Je as DISPLAY_TADPOLE,
3894
4090
  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,
4091
+ xe as ELEVATION,
4092
+ nr as ERROR_COLOR,
4093
+ Zn as FALLBACK_COLOUR,
4094
+ jr as FOV_MAX_DEG,
4095
+ Hr as FOV_MIN_DEG,
4096
+ F as FROM,
3901
4097
  ae as GEOLOGY_CODE,
3902
4098
  ce as GEOLOGY_DESCRIPTION,
3903
- at as HIDDEN_COLUMNS,
3904
- A as HOLE_ID,
4099
+ ct as HIDDEN_COLUMNS,
4100
+ k as HOLE_ID,
3905
4101
  oe as LATITUDE,
3906
- Zn as LITHOLOGY_COLOURS,
4102
+ Wn as LITHOLOGY_COLOURS,
3907
4103
  ie as LONGITUDE,
3908
4104
  Ie as MID,
3909
4105
  be as NORTHING,
3910
- Jn as NUMERIC_LINE_COLOR,
3911
- Qn as NUMERIC_MARKER_COLOR,
4106
+ Qn as NUMERIC_LINE_COLOR,
4107
+ er as NUMERIC_MARKER_COLOR,
3912
4108
  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,
4109
+ dn as STRIKE,
4110
+ $ as TO,
4111
+ Ei as TracePlot,
4112
+ $i as addGradeBlocksToScene,
4113
+ Ir as addRasterOverlay,
4114
+ Un as alphaBetaToNormal,
4115
+ Ci as annotationsFromIntervals,
4116
+ li as assembleDataset,
4117
+ Jo as attachAssayPositions,
4118
+ Wo as balancedTangentialDesurvey,
4119
+ kn as buildAssayState,
4120
+ Mi as buildCategoricalStripLogConfig,
4121
+ ur as buildCommentsConfig,
4122
+ yo as buildDepthMarkers,
4123
+ hr as buildEqualRangeColorScale,
4124
+ ir as buildIntervalPoints,
3928
4125
  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,
3945
- Be as deriveAssayProps,
3946
- wo as desurveyTraces,
3947
- Nr as dipAzimuthToNormal,
3948
- Cr as dolly,
3949
- Ar as emitViewChangeIfNeeded,
4126
+ vi as buildStrikeDipSymbol,
4127
+ zr as buildStructuralDiscs,
4128
+ zi as buildStructuralStripConfig,
4129
+ cr as buildTadpoleConfig,
4130
+ Ko as buildTraces,
4131
+ No as buildTrayPhotos,
4132
+ st as buildViewSignature,
4133
+ di as calculateBlockVolume,
4134
+ wn as calculatePropertyStats,
4135
+ vn as classifyColumns,
4136
+ Pr as clearRasterOverlays,
4137
+ si as coerceNumeric,
4138
+ Yn as computeStructuralPositions,
4139
+ Si as createRasterOverlay,
4140
+ Uo as defaultChartType,
4141
+ Kt as defaultTrayFilename,
4142
+ Fi as depthIntervalToPixels,
4143
+ _o as depthMarkerInterval,
4144
+ Re as deriveAssayProps,
4145
+ qo as desurveyTraces,
4146
+ Mr as dipAzimuthToNormal,
4147
+ Br as dolly,
4148
+ wr as emitViewChangeIfNeeded,
3950
4149
  Tn as filterBlocks,
3951
- Xo as filterByProject,
3952
- st as fitCameraToBounds,
3953
- Dr as focusOnLastBounds,
3954
- Qo as getBlockStats,
3955
- wr as getCategoryHexColor,
4150
+ ii as filterByProject,
4151
+ lt as fitCameraToBounds,
4152
+ Vr as focusOnLastBounds,
4153
+ ui as getBlockStats,
4154
+ qr as getCategoryHexColor,
3956
4155
  et as getChartOptions,
3957
- wn as getColorForValue,
3958
- Wn as getColour,
4156
+ $n as getColorForValue,
4157
+ Kn as getColour,
3959
4158
  Vt as getEqualRangeBinIndex,
3960
- pr as getEqualRangeColor,
3961
- Gt as getViewState,
3962
- fo as gradeBlockToThreeGeometry,
3963
- io as groupPhotosBySet,
4159
+ br as getEqualRangeColor,
4160
+ Dr as getRasterOverlay,
4161
+ Ut as getViewState,
4162
+ Eo as gradeBlockToThreeGeometry,
4163
+ go as groupPhotosBySet,
3964
4164
  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,
4165
+ or as holeHasData,
4166
+ Gn as interpolateTrace,
4167
+ Oi as intervalsAsTubes,
4168
+ oi as joinAssaysToTraces,
4169
+ Lr as listRasterOverlays,
4170
+ Yo as loadAssayFile,
4171
+ xn as loadAssayHole,
3971
4172
  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,
4173
+ ni as loadAssays,
4174
+ ci as loadBlockModelMetadata,
4175
+ ei as loadCollars,
4176
+ ri as loadGeology,
4177
+ Ti as loadGradeBlocksFromJson,
4178
+ ti as loadSurveys,
3978
4179
  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,
4180
+ Vo as logDataInfo,
4181
+ Bo as logDataWarning,
4182
+ $r as lookDown,
4183
+ On as minimumCurvatureDesurvey,
4184
+ Fn as normalizeBlockRow,
4185
+ kr as normalizeBounds,
4186
+ jo as normalizeCsvRow,
4187
+ we as normalizeFieldName,
4188
+ Rr as pan,
3987
4189
  Hn as parseAssayCsvTextToHoles,
3988
- yn as parseAssayHole,
3989
- So as parseAssayHoleIds,
3990
- gn as parseAssayHoleIdsWithAssays,
3991
- _n as parseAssaysCSV,
3992
- Ko as parseBlockModelCSV,
3993
- Ro as parseDrillholesCSV,
3994
- Rn as parseGeologyCsvText,
4190
+ _n as parseAssayHole,
4191
+ Ho as parseAssayHoleIds,
4192
+ yn as parseAssayHoleIdsWithAssays,
4193
+ Nn as parseAssaysCSV,
4194
+ ai as parseBlockModelCSV,
4195
+ Qo as parseDrillholesCSV,
4196
+ jn as parseGeologyCsvText,
3995
4197
  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,
4198
+ hi as parseStructuralIntervalsCSV,
4199
+ fi as parseStructuralPointsCSV,
4200
+ Xo as parseSurveyCSV,
4201
+ pi as parseUnifiedDataset,
4202
+ Go as pickFirstPresent,
4203
+ ki as planView,
4204
+ gr as projectTraceToSection,
4205
+ Tr as recenterCameraToOrigin,
4206
+ it as removeRasterOverlay,
4004
4207
  Ct as reorderHoleIds,
4005
- Kn as resolveColourMap,
4006
- pi as sectionView,
4007
- gr as sectionWindow,
4008
- ro as selectPhotoLodUrl,
4009
- Pr as setControlMode,
4010
- Or as setFov,
4011
- kr as setViewState,
4012
- oo as sortPhotosByDepth,
4208
+ Jn as resolveColourMap,
4209
+ Ai as sectionView,
4210
+ yr as sectionWindow,
4211
+ po as selectPhotoLodUrl,
4212
+ Ur as setControlMode,
4213
+ Gr as setFov,
4214
+ Sr as setRasterOverlayElevation,
4215
+ Or as setRasterOverlayOpacity,
4216
+ Cr as setRasterOverlayVisibility,
4217
+ Fr as setViewState,
4218
+ bi as significantIntercepts,
4219
+ bo as sortPhotosByDepth,
4013
4220
  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,
4221
+ Ro as standardizeRowArray,
4222
+ Zo as tangentialDesurvey,
4223
+ pn as toError,
4224
+ Ii as tracesAsSegments,
4225
+ xi as useDrillholeTraceGrid,
4226
+ mi as validateStructuralPoints,
4020
4227
  Y as withDataErrorContext
4021
4228
  };
4022
4229
  //# sourceMappingURL=baselode.js.map