baselode 0.1.19 → 0.1.20

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,33 +1,33 @@
1
- import { _ as gt, w as k, H as _, P as de, F as S, T, c as bt, L as re, a as se, D as V, A as j, b as Y, E as pe, N as ye, d as Ie, M as ve, G as le, e as ce, B as _t, f as Qe, g as Fe, h as Pe, i as Ge, j as Nt, k as et, l as vt, m as Ve, n as Et, o as It } from "./baselode3dScene-DbELmWnr.js";
2
- import { p as ur, q as dr, r as mr, s as fr, t as hr, u as pr, v as yr, x as gr, y as br, z as _r, C as Nr, I as vr, J as Er, K as Ir, O as Ar, Q as Cr, R as Lr, S as Sr, U as Mr, V as Tr, W as Or, X as Pr, Y as xr, Z as Dr, $ as zr, a0 as Rr, a1 as $r, a2 as Fr, a3 as kr, a4 as wr, a5 as Br, a6 as Hr, a7 as Gr, a8 as Vr, a9 as Ur, aa as jr, ab as Yr, ac as Wr, ad as qr, ae as Kr, af as Xr, ag as Zr, ah as Jr, ai as Qr, aj as es, ak as ts, al as ns, am as rs, an as ss, ao as os, ap as is, aq as as, ar as ls, as as cs, at as us, au as ds, av as ms, aw as fs, ax as hs, ay as ps, az as ys, aA as gs, aB as bs, aC as _s, aD as Ns, aE as vs, aF as Es, aG as Is, aH as As, aI as Cs, aJ as Ls, aK as Ss, aL as Ms, aM as Ts, aN as Os, aO as Ps, aP as xs, aQ as Ds, aR as zs, aS as Rs, aT as $s, aU as Fs, aV as ks, aW as ws, aX as Bs, aY as Hs } from "./baselode3dScene-DbELmWnr.js";
1
+ import { _ as gt, w as k, H as _, P as de, F as C, T as M, c as bt, L as se, a as re, D as G, A as j, b as Y, E as pe, N as ye, d as ve, M as Ee, G as le, e as ce, B as _t, f as Qe, g as $e, h as Pe, i as Be, j as Nt, k as et, l as Et, m as Ge, n as At, o as vt } from "./baselode3dScene-qMfVRKxK.js";
2
+ import { p as us, q as ds, r as ms, s as fs, t as hs, u as ps, v as ys, x as gs, y as bs, z as _s, C as Ns, I as Es, J as As, K as vs, O as Is, Q as Ss, R as Ls, S as Cs, U as Ts, V as Ms, W as Os, X as Ps, Y as Ds, Z as xs, $ as Rs, a0 as zs, a1 as Fs, a2 as $s, a3 as ks, a4 as ws, a5 as Hs, a6 as Us, a7 as Bs, a8 as Gs, a9 as Vs, aa as js, ab as Ys, ac as Ws, ad as qs, ae as Ks, af as Xs, ag as Zs, ah as Js, ai as Qs, aj as er, ak as tr, al as nr, am as sr, an as rr, ao as or, ap as ir, aq as ar, ar as lr, as as cr, at as ur, au as dr, av as mr, aw as fr, ax as hr, ay as pr, az as yr, aA as gr, aB as br, aC as _r, aD as Nr, aE as Er, aF as Ar, aG as vr, aH as Ir, aI as Sr, aJ as Lr, aK as Cr, aL as Tr, aM as Mr, aN as Or, aO as Pr, aP as Dr, aQ as xr, aR as Rr, aS as zr, aT as Fr, aU as $r, aV as kr, aW as wr, aX as Hr, aY as Ur, aZ as Br, a_ as Gr, a$ as Vr, b0 as jr, b1 as Yr, b2 as Wr, b3 as qr, b4 as Kr, b5 as Xr, b6 as Zr, b7 as Jr, b8 as Qr, b9 as eo, ba as to, bb as no, bc as so, bd as ro, be as oo, bf as io, bg as ao } from "./baselode3dScene-qMfVRKxK.js";
3
3
  import J from "papaparse";
4
- import { jsx as C, jsxs as W } from "react/jsx-runtime";
5
- import { useRef as _e, useState as X, useEffect as ne, useMemo as ee, useCallback as xe } from "react";
6
- import Ee from "plotly.js-dist-min";
4
+ import { jsx as S, jsxs as W } from "react/jsx-runtime";
5
+ import { useRef as _e, useState as X, useEffect as ne, useMemo as ee, useCallback as De } from "react";
6
+ import Ae from "plotly.js-dist-min";
7
7
  import * as Q from "three";
8
- function Ae(e) {
8
+ function Ie(e) {
9
9
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
10
10
  }
11
11
  function ie(e, n = null, t = null) {
12
- const r = { ...gt };
12
+ const s = { ...gt };
13
13
  if (t) {
14
14
  for (const [i, o] of Object.entries(t))
15
15
  if (i != null && o != null) {
16
- const a = Ae(i), l = Ae(o);
17
- r[a] = l;
16
+ const a = Ie(i), l = Ie(o);
17
+ s[a] = l;
18
18
  }
19
19
  }
20
- const s = {};
20
+ const r = {};
21
21
  for (const [i, o] of Object.entries(e)) {
22
- const a = Ae(i), l = r[a] || a;
23
- s[l] = o;
22
+ const a = Ie(i), l = s[a] || a;
23
+ r[l] = o;
24
24
  }
25
- return s;
25
+ return r;
26
26
  }
27
27
  function _n(e, n = null, t = null) {
28
- return e.map((r) => ie(r, n, t));
28
+ return e.map((s) => ie(s, n, t));
29
29
  }
30
- const At = /* @__PURE__ */ new Set([
30
+ const It = /* @__PURE__ */ new Set([
31
31
  "hole_id",
32
32
  "holeid",
33
33
  "id",
@@ -59,25 +59,25 @@ const At = /* @__PURE__ */ new Set([
59
59
  "todepth",
60
60
  "comment",
61
61
  "z"
62
- ]), Me = (e, n = null) => ie(e, null, n);
63
- function Ct(e) {
62
+ ]), Te = (e, n = null) => ie(e, null, n);
63
+ function St(e) {
64
64
  return { holeId: e[_] };
65
65
  }
66
66
  function tt(e, n = null) {
67
- const t = e[_], r = t !== void 0 ? `${t}`.trim() : "";
68
- if (!r) return null;
69
- const s = e[de] || e.project || e.project_code, i = Number(e[S]), o = Number(e[T]);
67
+ const t = e[_], s = t !== void 0 ? `${t}`.trim() : "";
68
+ if (!s) return null;
69
+ const r = e[de] || e.project || e.project_code, i = Number(e[C]), o = Number(e[M]);
70
70
  return !Number.isFinite(i) || !Number.isFinite(o) || o <= i ? null : {
71
- holeId: r,
72
- project: s,
71
+ holeId: s,
72
+ project: r,
73
73
  from: i,
74
74
  to: o,
75
75
  ...e
76
76
  };
77
77
  }
78
78
  function nt(e, n) {
79
- var s;
80
- const t = n.sort((i, o) => i.from - o.from), r = [];
79
+ var r;
80
+ const t = n.sort((i, o) => i.from - o.from), s = [];
81
81
  return t.forEach((i) => {
82
82
  const { from: o, to: a, project: l, ...u } = i, c = {
83
83
  z: o,
@@ -87,53 +87,53 @@ function nt(e, n) {
87
87
  [de]: l,
88
88
  ...u
89
89
  };
90
- r.push(c), r.push({ ...c, z: a });
91
- }), { id: e, project: (s = t[0]) == null ? void 0 : s.project, points: r };
90
+ s.push(c), s.push({ ...c, z: a });
91
+ }), { id: e, project: (r = t[0]) == null ? void 0 : r.project, points: s };
92
92
  }
93
93
  function Nn(e, n = null) {
94
- return new Promise((t, r) => {
95
- const s = /* @__PURE__ */ new Set();
94
+ return new Promise((t, s) => {
95
+ const r = /* @__PURE__ */ new Set();
96
96
  J.parse(e, {
97
97
  header: !0,
98
98
  dynamicTyping: !0,
99
99
  skipEmptyLines: !0,
100
100
  step: (i) => {
101
- const a = Me(i.data, n)[_];
102
- a !== void 0 && `${a}`.trim() !== "" && s.add(`${a}`.trim());
101
+ const a = Te(i.data, n)[_];
102
+ a !== void 0 && `${a}`.trim() !== "" && r.add(`${a}`.trim());
103
103
  },
104
- complete: () => t(Array.from(s)),
105
- error: (i) => r(k("parseAssayHoleIds", i))
104
+ complete: () => t(Array.from(r)),
105
+ error: (i) => s(k("parseAssayHoleIds", i))
106
106
  });
107
107
  });
108
108
  }
109
109
  function Lt(e) {
110
- return Object.entries(e || {}).some(([n, t]) => !(At.has(n) || t == null || typeof t == "string" && t.trim() === ""));
110
+ return Object.entries(e || {}).some(([n, t]) => !(It.has(n) || t == null || typeof t == "string" && t.trim() === ""));
111
111
  }
112
- function St(e, n = null) {
113
- return new Promise((t, r) => {
114
- const s = /* @__PURE__ */ new Map();
112
+ function Ct(e, n = null) {
113
+ return new Promise((t, s) => {
114
+ const r = /* @__PURE__ */ new Map();
115
115
  J.parse(e, {
116
116
  header: !0,
117
117
  dynamicTyping: !0,
118
118
  skipEmptyLines: !0,
119
119
  step: (i) => {
120
- const o = Me(i.data, n);
120
+ const o = Te(i.data, n);
121
121
  if (!Lt(o)) return;
122
- const l = Ct(o).holeId;
122
+ const l = St(o).holeId;
123
123
  if (l !== void 0 && `${l}`.trim() !== "") {
124
124
  const u = `${l}`.trim();
125
- s.has(u) || s.set(u, {
125
+ r.has(u) || r.set(u, {
126
126
  holeId: u
127
127
  });
128
128
  }
129
129
  },
130
- complete: () => t(Array.from(s.values())),
131
- error: (i) => r(k("parseAssayHoleIdsWithAssays", i))
130
+ complete: () => t(Array.from(r.values())),
131
+ error: (i) => s(k("parseAssayHoleIdsWithAssays", i))
132
132
  });
133
133
  });
134
134
  }
135
- function Mt(e, n, t = null, r = null) {
136
- return new Promise((s, i) => {
135
+ function Tt(e, n, t = null, s = null) {
136
+ return new Promise((r, i) => {
137
137
  const o = `${n}`.trim();
138
138
  if (!o) {
139
139
  i(k("parseAssayHole", new Error("Missing hole id")));
@@ -145,23 +145,23 @@ function Mt(e, n, t = null, r = null) {
145
145
  dynamicTyping: !0,
146
146
  skipEmptyLines: !0,
147
147
  step: (l) => {
148
- const u = Me(l.data, r), c = tt(u, r);
148
+ const u = Te(l.data, s), c = tt(u, s);
149
149
  c && `${c.holeId}`.trim() === o && a.push(c);
150
150
  },
151
151
  complete: () => {
152
152
  if (!a.length) {
153
- s(null);
153
+ r(null);
154
154
  return;
155
155
  }
156
156
  const l = nt(o, a);
157
- s(l);
157
+ r(l);
158
158
  },
159
159
  error: (l) => i(k("parseAssayHole", l))
160
160
  });
161
161
  });
162
162
  }
163
- function Tt(e, n = null, t = null) {
164
- return new Promise((r, s) => {
163
+ function Mt(e, n = null, t = null) {
164
+ return new Promise((s, r) => {
165
165
  J.parse(e, {
166
166
  header: !0,
167
167
  dynamicTyping: !0,
@@ -169,143 +169,143 @@ function Tt(e, n = null, t = null) {
169
169
  complete: (i) => {
170
170
  const o = /* @__PURE__ */ new Map();
171
171
  i.data.forEach((l) => {
172
- const u = Me(l, t), c = tt(u, t);
172
+ const u = Te(l, t), c = tt(u, t);
173
173
  c && (o.has(c.holeId) || o.set(c.holeId, []), o.get(c.holeId).push(c));
174
174
  });
175
175
  const a = Array.from(o.entries()).map(([l, u]) => nt(l, u));
176
- r({ holes: a });
176
+ s({ holes: a });
177
177
  },
178
- error: (i) => s(k("parseAssaysCSV", i))
178
+ error: (i) => r(k("parseAssaysCSV", i))
179
179
  });
180
180
  });
181
181
  }
182
- function vn(e = {}) {
182
+ function En(e = {}) {
183
183
  const n = {};
184
- return Object.entries(e || {}).forEach(([t, r]) => {
185
- t && (n[Ae(t)] = r);
184
+ return Object.entries(e || {}).forEach(([t, s]) => {
185
+ t && (n[Ie(t)] = s);
186
186
  }), n;
187
187
  }
188
- function En(e = {}, n = [], t) {
189
- for (const r of n) {
190
- const s = e[r];
191
- if (s != null && `${s}`.trim() !== "")
192
- return s;
188
+ function An(e = {}, n = [], t) {
189
+ for (const s of n) {
190
+ const r = e[s];
191
+ if (r != null && `${r}`.trim() !== "")
192
+ return r;
193
193
  }
194
194
  return t;
195
195
  }
196
196
  const Ot = 4;
197
- function rt(e = [], n = "") {
197
+ function st(e = [], n = "") {
198
198
  if (!e.length) return [];
199
199
  if (!n) return e;
200
200
  const t = e.findIndex((i) => i === n);
201
201
  if (t === -1) return e;
202
- const r = e[t], s = e.filter((i, o) => o !== t);
203
- return [r, ...s];
202
+ const s = e[t], r = e.filter((i, o) => o !== t);
203
+ return [s, ...r];
204
204
  }
205
- function Ce({
205
+ function Se({
206
206
  property: e = "",
207
207
  chartType: n = "",
208
208
  categoricalProps: t = [],
209
- commentProps: r = [],
210
- numericDefaultChartType: s = "markers+line"
209
+ commentProps: s = [],
210
+ numericDefaultChartType: r = "markers+line"
211
211
  } = {}) {
212
- return e ? r.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !n || n === "categorical" || n === "comment" || n === "tadpole" ? s : n : n || s;
212
+ return e ? s.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !n || n === "categorical" || n === "comment" || n === "tadpole" ? r : n : n || r;
213
213
  }
214
- function st({
214
+ function rt({
215
215
  holeIds: e = [],
216
216
  focusedHoleId: n = "",
217
217
  plotCount: t = Ot,
218
- defaultProp: r = "",
219
- categoricalProps: s = [],
218
+ defaultProp: s = "",
219
+ categoricalProps: r = [],
220
220
  commentProps: i = [],
221
221
  numericDefaultChartType: o = "markers+line"
222
222
  } = {}) {
223
- const a = rt(e, n);
223
+ const a = st(e, n);
224
224
  return Array.from({ length: t }).map((l, u) => {
225
- const c = a[u] || e[u] || "", m = Ce({
226
- property: r,
225
+ const c = a[u] || e[u] || "", m = Se({
226
+ property: s,
227
227
  chartType: "",
228
- categoricalProps: s,
228
+ categoricalProps: r,
229
229
  commentProps: i,
230
230
  numericDefaultChartType: o
231
231
  });
232
232
  return {
233
233
  holeId: c,
234
- property: r,
234
+ property: s,
235
235
  chartType: m
236
236
  };
237
237
  });
238
238
  }
239
239
  function Le(e = []) {
240
- const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: r, commentCols: s, byType: i } = bt(n), o = t[0] || r[0] || "";
240
+ const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: s, commentCols: r, byType: i } = bt(n), o = t[0] || s[0] || "";
241
241
  return {
242
242
  numericProps: t,
243
- categoricalProps: r,
244
- commentProps: s,
243
+ categoricalProps: s,
244
+ commentProps: r,
245
245
  columnMeta: i,
246
246
  defaultProp: o
247
247
  };
248
248
  }
249
249
  async function Pt(e, n = null) {
250
- return await St(e);
250
+ return await Ct(e);
251
251
  }
252
- async function xt(e, n, t = null) {
253
- return await Mt(e, n);
252
+ async function Dt(e, n, t = null) {
253
+ return await Tt(e, n);
254
254
  }
255
- function Dt(e = [], n = "") {
255
+ function xt(e = [], n = "") {
256
256
  if (!e.length) return null;
257
- const { numericProps: t, categoricalProps: r, commentProps: s, columnMeta: i, defaultProp: o } = Le(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = st({
257
+ const { numericProps: t, categoricalProps: s, commentProps: r, columnMeta: i, defaultProp: o } = Le(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = rt({
258
258
  holeIds: a,
259
259
  focusedHoleId: n,
260
260
  plotCount: 4,
261
261
  defaultProp: o,
262
- categoricalProps: r,
263
- commentProps: s,
262
+ categoricalProps: s,
263
+ commentProps: r,
264
264
  numericDefaultChartType: "line"
265
265
  });
266
266
  return {
267
267
  holes: e,
268
268
  numericProps: t,
269
- categoricalProps: r,
270
- commentProps: s,
269
+ categoricalProps: s,
270
+ commentProps: r,
271
271
  columnMeta: i,
272
272
  defaultProp: o,
273
273
  traceConfigs: l
274
274
  };
275
275
  }
276
- async function In(e, n = "", t = null) {
277
- const { holes: r } = await Tt(e, t), s = Dt(r, n);
278
- if (!s) throw new Error("No valid assay intervals found.");
279
- return s;
276
+ async function vn(e, n = "", t = null) {
277
+ const { holes: s } = await Mt(e, t), r = xt(s, n);
278
+ if (!r) throw new Error("No valid assay intervals found.");
279
+ return r;
280
280
  }
281
- function An(e, n = null) {
282
- return new Promise((t, r) => {
281
+ function In(e, n = null) {
282
+ return new Promise((t, s) => {
283
283
  J.parse(e, {
284
284
  header: !0,
285
285
  dynamicTyping: !0,
286
286
  skipEmptyLines: !0,
287
- complete: (s) => {
288
- const i = s.data.map((o) => zt(o, n)).filter((o) => o[_] && Number.isFinite(o[V]) && Number.isFinite(o[Y]) && Number.isFinite(o[j]));
287
+ complete: (r) => {
288
+ const i = r.data.map((o) => Rt(o, n)).filter((o) => o[_] && Number.isFinite(o[G]) && Number.isFinite(o[Y]) && Number.isFinite(o[j]));
289
289
  t(i);
290
290
  },
291
- error: (s) => r(k("parseSurveyCSV", s))
291
+ error: (r) => s(k("parseSurveyCSV", r))
292
292
  });
293
293
  });
294
294
  }
295
- function zt(e, n = null) {
296
- const t = ie(e, null, n), r = t[_], s = t[de] || t.project || t.project_code, i = he(t[re]), o = he(t[se]), a = he(t[V]), l = he(t[Y]), u = he(t[j]), c = he(t.maxdepth);
295
+ function Rt(e, n = null) {
296
+ const t = ie(e, null, n), s = t[_], r = t[de] || t.project || t.project_code, i = he(t[se]), o = he(t[re]), a = he(t[G]), l = he(t[Y]), u = he(t[j]), c = he(t.maxdepth);
297
297
  return {
298
298
  raw: t,
299
- [_]: r,
300
- [de]: s,
301
- [re]: i,
302
- [se]: o,
303
- [V]: a,
299
+ [_]: s,
300
+ [de]: r,
301
+ [se]: i,
302
+ [re]: o,
303
+ [G]: a,
304
304
  [Y]: l,
305
305
  [j]: u,
306
306
  maxdepth: c,
307
307
  // Legacy field names for backwards compatibility
308
- project_code: s,
308
+ project_code: r,
309
309
  latitude: i,
310
310
  longitude: o,
311
311
  surveydepth: a
@@ -315,7 +315,7 @@ const he = (e) => {
315
315
  const n = Number(e);
316
316
  return Number.isFinite(n) ? n : void 0;
317
317
  };
318
- function Cn(e, n) {
318
+ function Sn(e, n) {
319
319
  var u, c, m, d;
320
320
  const t = /* @__PURE__ */ new Map();
321
321
  e.forEach((f) => {
@@ -324,7 +324,7 @@ function Cn(e, n) {
324
324
  const y = g.toLowerCase();
325
325
  t.has(y) || t.set(y, f);
326
326
  });
327
- const r = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[re]) ?? 0, s = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[se]) ?? 0, i = 111132, o = 111320 * Math.cos(r * Math.PI / 180), a = /* @__PURE__ */ new Map();
327
+ const s = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[se]) ?? 0, r = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[re]) ?? 0, i = 111132, o = 111320 * Math.cos(s * Math.PI / 180), a = /* @__PURE__ */ new Map();
328
328
  n.forEach((f) => {
329
329
  const g = (f[_] || "").toString().trim();
330
330
  if (!g) return;
@@ -335,54 +335,54 @@ function Cn(e, n) {
335
335
  return a.forEach((f, g) => {
336
336
  const y = t.get(g);
337
337
  if (!y) return;
338
- const b = f.filter((A) => Number.isFinite(A[V] ?? A.surveydepth)).sort((A, R) => (A[V] ?? A.surveydepth) - (R[V] ?? R.surveydepth));
338
+ const b = f.filter((I) => Number.isFinite(I[G] ?? I.surveydepth)).sort((I, z) => (I[G] ?? I.surveydepth) - (z[G] ?? z.surveydepth));
339
339
  if (!b.length) return;
340
- const h = y.lat ?? y[re], v = y.lng ?? y[se], E = 111132, D = 111320 * Math.cos(h * Math.PI / 180), B = (v - s) * o, O = (h - r) * i, P = [];
341
- let z = 0, U = 0, p = 0;
342
- for (let A = 0; A < b.length; A += 1) {
343
- const R = b[A], w = b[A - 1], I = R[V] ?? R.surveydepth, N = R[j] ?? R.azimuth, x = R[Y] ?? R.dip;
340
+ const h = y.lat ?? y[se], E = y.lng ?? y[re], A = 111132, x = 111320 * Math.cos(h * Math.PI / 180), H = (E - r) * o, O = (h - s) * i, P = [];
341
+ let R = 0, V = 0, p = 0;
342
+ for (let I = 0; I < b.length; I += 1) {
343
+ const z = b[I], w = b[I - 1], v = z[G] ?? z.surveydepth, N = z[j] ?? z.azimuth, D = z[Y] ?? z.dip;
344
344
  if (!w) {
345
345
  P.push({
346
- x: B + z,
347
- y: O + U,
346
+ x: H + R,
347
+ y: O + V,
348
348
  z: 0,
349
- md: I,
349
+ md: v,
350
350
  azimuth: N,
351
- dip: x
351
+ dip: D
352
352
  });
353
353
  continue;
354
354
  }
355
- const $ = w[V] ?? w.surveydepth, L = w[j] ?? w.azimuth, H = w[Y] ?? w.dip, G = I - $;
356
- if (G <= 0) continue;
357
- const F = Ue(H), q = Ue(x), K = $e(L), ae = $e(N), be = Math.acos(
358
- Math.sin(F) * Math.sin(q) * Math.cos(K - ae) + Math.cos(F) * Math.cos(q)
359
- ), me = be > 1e-6 ? 2 / be * Math.tan(be / 2) : 1, Oe = 0.5 * G * (Math.sin(F) * Math.cos(K) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * G * (Math.sin(F) * Math.sin(K) + Math.sin(q) * Math.sin(ae)) * me, yt = 0.5 * G * (Math.cos(F) + Math.cos(q)) * me;
360
- z += Oe, U += fe, p += yt, P.push({
361
- x: B + z,
362
- y: O + U,
355
+ const F = w[G] ?? w.surveydepth, L = w[j] ?? w.azimuth, U = w[Y] ?? w.dip, B = v - F;
356
+ if (B <= 0) continue;
357
+ const $ = Ve(U), q = Ve(D), K = Fe(L), ae = Fe(N), be = Math.acos(
358
+ Math.sin($) * Math.sin(q) * Math.cos(K - ae) + Math.cos($) * Math.cos(q)
359
+ ), me = be > 1e-6 ? 2 / be * Math.tan(be / 2) : 1, Oe = 0.5 * B * (Math.sin($) * Math.cos(K) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * B * (Math.sin($) * Math.sin(K) + Math.sin(q) * Math.sin(ae)) * me, yt = 0.5 * B * (Math.cos($) + Math.cos(q)) * me;
360
+ R += Oe, V += fe, p += yt, P.push({
361
+ x: H + R,
362
+ y: O + V,
363
363
  z: -p,
364
364
  // render with z up; depth down
365
- md: I,
365
+ md: v,
366
366
  azimuth: N,
367
- dip: x
367
+ dip: D
368
368
  });
369
369
  }
370
- const M = P.map((A) => ({
371
- ...A,
372
- lat: h + A.y / E,
373
- lng: v + A.x / D
370
+ const T = P.map((I) => ({
371
+ ...I,
372
+ lat: h + I.y / A,
373
+ lng: E + I.x / x
374
374
  }));
375
375
  l.push({
376
376
  id: y[_] || y.holeId || g,
377
377
  project: y[de] || y.project_id || y.project || "",
378
- points: M,
378
+ points: T,
379
379
  collar: y
380
380
  });
381
381
  }), l;
382
382
  }
383
- const $e = (e) => e * Math.PI / 180, Ue = (e) => {
384
- const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), r = Math.min(180, Math.max(0, t));
385
- return $e(r);
383
+ const Fe = (e) => e * Math.PI / 180, Ve = (e) => {
384
+ const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), s = Math.min(180, Math.max(0, t));
385
+ return Fe(s);
386
386
  };
387
387
  function te(e, n = void 0) {
388
388
  const t = Number(e);
@@ -391,27 +391,27 @@ function te(e, n = void 0) {
391
391
  function je(e) {
392
392
  return e == null ? "" : `${e}`.trim();
393
393
  }
394
- function Se(e = [], n = null) {
395
- const t = n || "hole_id", s = [t, "hole_id", "holeId", "id"].find((i) => e.some((o) => je(o == null ? void 0 : o[i])));
396
- if (!s)
394
+ function Ce(e = [], n = null) {
395
+ const t = n || "hole_id", r = [t, "hole_id", "holeId", "id"].find((i) => e.some((o) => je(o == null ? void 0 : o[i])));
396
+ if (!r)
397
397
  throw k("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
398
398
  return {
399
- aliasCol: s,
399
+ aliasCol: r,
400
400
  rows: e.map((i) => ({
401
401
  ...i,
402
- hole_id: je(i == null ? void 0 : i[s])
402
+ hole_id: je(i == null ? void 0 : i[r])
403
403
  }))
404
404
  };
405
405
  }
406
406
  function Ye(e) {
407
407
  return Number(e) * Math.PI / 180;
408
408
  }
409
- function De(e, n) {
410
- const t = Ye(e), r = Ye(n), s = Math.cos(r) * Math.sin(t), i = Math.cos(r) * Math.cos(t), o = Math.sin(r) * -1;
411
- return { ca: s, cb: i, cc: o };
409
+ function xe(e, n) {
410
+ const t = Ye(e), s = Ye(n), r = Math.cos(s) * Math.sin(t), i = Math.cos(s) * Math.cos(t), o = Math.sin(s) * -1;
411
+ return { ca: r, cb: i, cc: o };
412
412
  }
413
- function Rt(e, n, t, r, s, i = "minimum_curvature") {
414
- const o = De(n, t), a = De(r, s);
413
+ function zt(e, n, t, s, r, i = "minimum_curvature") {
414
+ const o = xe(n, t), a = xe(s, r);
415
415
  if (i === "tangential")
416
416
  return {
417
417
  dx: e * o.ca,
@@ -421,7 +421,7 @@ function Rt(e, n, t, r, s, i = "minimum_curvature") {
421
421
  dip: t
422
422
  };
423
423
  if (i === "balanced_tangential") {
424
- const m = 0.5 * (n + r), d = 0.5 * (t + s), f = De(m, d);
424
+ const m = 0.5 * (n + s), d = 0.5 * (t + r), f = xe(m, d);
425
425
  return {
426
426
  dx: e * f.ca,
427
427
  dy: e * f.cb,
@@ -435,16 +435,16 @@ function Rt(e, n, t, r, s, i = "minimum_curvature") {
435
435
  dx: 0.5 * e * (o.ca + a.ca) * c,
436
436
  dy: 0.5 * e * (o.cb + a.cb) * c,
437
437
  dz: 0.5 * e * (o.cc + a.cc) * c,
438
- azimuth: r,
439
- dip: s
438
+ azimuth: s,
439
+ dip: r
440
440
  };
441
441
  }
442
442
  function ke(e = [], n = [], t = {}) {
443
443
  const {
444
- step: r = 1,
445
- holeIdCol: s = null,
444
+ step: s = 1,
445
+ holeIdCol: r = null,
446
446
  method: i = "minimum_curvature"
447
- } = t, o = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, a = Se(e, s), l = Se(n, s || a.aliasCol);
447
+ } = t, o = Number.isFinite(Number(s)) && Number(s) > 0 ? Number(s) : 1, a = Ce(e, r), l = Ce(n, r || a.aliasCol);
448
448
  if (!a.rows.length || !l.rows.length) return [];
449
449
  const u = /* @__PURE__ */ new Map();
450
450
  a.rows.forEach((d) => {
@@ -463,76 +463,76 @@ function ke(e = [], n = [], t = {}) {
463
463
  from: te(P.from),
464
464
  azimuth: te(P.azimuth),
465
465
  dip: te(P.dip)
466
- })).filter((P) => Number.isFinite(P.from) && Number.isFinite(P.azimuth) && Number.isFinite(P.dip)).sort((P, z) => P.from - z.from);
466
+ })).filter((P) => Number.isFinite(P.from) && Number.isFinite(P.azimuth) && Number.isFinite(P.dip)).sort((P, R) => P.from - R.from);
467
467
  if (!y.length) return;
468
- let b = te(g.x, 0), h = te(g.y, 0), v = te(g.z, 0), E = y[0].from;
469
- const D = y[0].azimuth, B = y[0].dip, O = {
468
+ let b = te(g.x, 0), h = te(g.y, 0), E = te(g.z, 0), A = y[0].from;
469
+ const x = y[0].azimuth, H = y[0].dip, O = {
470
470
  hole_id: f,
471
- md: E,
471
+ md: A,
472
472
  x: b,
473
473
  y: h,
474
- z: v,
475
- azimuth: D,
476
- dip: B
474
+ z: E,
475
+ azimuth: x,
476
+ dip: H
477
477
  };
478
478
  a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (O[a.aliasCol] = g[a.aliasCol]), m.push(O);
479
479
  for (let P = 0; P < y.length - 1; P += 1) {
480
- const z = y[P], U = y[P + 1], p = z.from, A = U.from - p;
481
- if (A <= 0) continue;
482
- const R = Math.max(1, Math.ceil(A / o)), w = A / R;
483
- for (let I = 0; I < R; I += 1) {
484
- E += w;
485
- const N = (E - p) / A, x = z.azimuth + N * (U.azimuth - z.azimuth), $ = z.dip + N * (U.dip - z.dip), L = Rt(w, z.azimuth, z.dip, U.azimuth, U.dip, i);
486
- b += L.dx, h += L.dy, v += L.dz;
487
- const H = {
480
+ const R = y[P], V = y[P + 1], p = R.from, I = V.from - p;
481
+ if (I <= 0) continue;
482
+ const z = Math.max(1, Math.ceil(I / o)), w = I / z;
483
+ for (let v = 0; v < z; v += 1) {
484
+ A += w;
485
+ const N = (A - p) / I, D = R.azimuth + N * (V.azimuth - R.azimuth), F = R.dip + N * (V.dip - R.dip), L = zt(w, R.azimuth, R.dip, V.azimuth, V.dip, i);
486
+ b += L.dx, h += L.dy, E += L.dz;
487
+ const U = {
488
488
  hole_id: f,
489
- md: E,
489
+ md: A,
490
490
  x: b,
491
491
  y: h,
492
- z: v,
493
- azimuth: i === "minimum_curvature" ? x : L.azimuth,
494
- dip: i === "minimum_curvature" ? $ : L.dip
492
+ z: E,
493
+ azimuth: i === "minimum_curvature" ? D : L.azimuth,
494
+ dip: i === "minimum_curvature" ? F : L.dip
495
495
  };
496
- a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (H[a.aliasCol] = g[a.aliasCol]), m.push(H);
496
+ a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (U[a.aliasCol] = g[a.aliasCol]), m.push(U);
497
497
  }
498
498
  }
499
499
  }), m;
500
500
  }
501
- function $t(e, n, t = {}) {
501
+ function Ft(e, n, t = {}) {
502
502
  return ke(e, n, { ...t, method: "minimum_curvature" });
503
503
  }
504
504
  function Ln(e, n, t = {}) {
505
505
  return ke(e, n, { ...t, method: "tangential" });
506
506
  }
507
- function Sn(e, n, t = {}) {
507
+ function Cn(e, n, t = {}) {
508
508
  return ke(e, n, { ...t, method: "balanced_tangential" });
509
509
  }
510
- function Mn(e, n, t = {}) {
511
- return $t(e, n, t);
510
+ function Tn(e, n, t = {}) {
511
+ return Ft(e, n, t);
512
512
  }
513
- function Ft(e, n) {
513
+ function $t(e, n) {
514
514
  if (!e.length || !Number.isFinite(n)) return null;
515
- let t = null, r = 1 / 0;
516
- for (let s = 0; s < e.length; s += 1) {
517
- const i = e[s], o = te(i.md);
515
+ let t = null, s = 1 / 0;
516
+ for (let r = 0; r < e.length; r += 1) {
517
+ const i = e[r], o = te(i.md);
518
518
  if (!Number.isFinite(o)) continue;
519
519
  const a = Math.abs(o - n);
520
- a < r && (r = a, t = i);
520
+ a < s && (s = a, t = i);
521
521
  }
522
522
  return t;
523
523
  }
524
- function Tn(e = [], n = [], t = {}) {
525
- const r = t.holeIdCol || "hole_id", s = Se(e, r), i = Se(n, r);
526
- if (!s.rows.length || !i.rows.length) return [...s.rows];
524
+ function Mn(e = [], n = [], t = {}) {
525
+ const s = t.holeIdCol || "hole_id", r = Ce(e, s), i = Ce(n, s);
526
+ if (!r.rows.length || !i.rows.length) return [...r.rows];
527
527
  const o = /* @__PURE__ */ new Map();
528
528
  return i.rows.forEach((a) => {
529
529
  a.hole_id && (o.has(a.hole_id) || o.set(a.hole_id, []), o.get(a.hole_id).push(a));
530
530
  }), o.forEach((a, l) => {
531
531
  o.set(l, [...a].sort((u, c) => te(u.md, 0) - te(c.md, 0)));
532
- }), s.rows.map((a) => {
532
+ }), r.rows.map((a) => {
533
533
  const l = te(a.from), u = te(a.to), c = Number.isFinite(l) && Number.isFinite(u) ? 0.5 * (l + u) : void 0;
534
534
  if (!a.hole_id || !Number.isFinite(c)) return { ...a };
535
- const m = Ft(o.get(a.hole_id) || [], c);
535
+ const m = $t(o.get(a.hole_id) || [], c);
536
536
  if (!m) return { ...a };
537
537
  const d = { ...a };
538
538
  return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
@@ -541,15 +541,15 @@ function Tn(e = [], n = [], t = {}) {
541
541
  });
542
542
  }
543
543
  function On(e, n = null) {
544
- return new Promise((t, r) => {
544
+ return new Promise((t, s) => {
545
545
  J.parse(e, {
546
546
  header: !0,
547
547
  dynamicTyping: !0,
548
548
  skipEmptyLines: !0,
549
- complete: (s) => {
549
+ complete: (r) => {
550
550
  const i = /* @__PURE__ */ new Map();
551
- s.data.forEach((a, l) => {
552
- const u = ie(a, null, n), c = u[_], m = c !== void 0 ? `${c}`.trim() : "", d = u[pe] ?? u.x, f = u[ye] ?? u.y, g = u[Ie] ?? u.z, y = u.order ?? l;
551
+ r.data.forEach((a, l) => {
552
+ const u = ie(a, null, n), c = u[_], m = c !== void 0 ? `${c}`.trim() : "", d = u[pe] ?? u.x, f = u[ye] ?? u.y, g = u[ve] ?? u.z, y = u.order ?? l;
553
553
  !m || d === null || d === void 0 || f === null || f === void 0 || g === null || g === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
554
554
  ...u,
555
555
  holeId: m,
@@ -570,7 +570,7 @@ function On(e, n = null) {
570
570
  }));
571
571
  t({ holes: o });
572
572
  },
573
- error: (s) => r(k("parseDrillholesCSV", s))
573
+ error: (r) => s(k("parseDrillholesCSV", r))
574
574
  });
575
575
  });
576
576
  }
@@ -583,9 +583,9 @@ function Z(e) {
583
583
  }
584
584
  function Ne(e = [], n = []) {
585
585
  const t = [...e];
586
- return t.sort((r, s) => {
586
+ return t.sort((s, r) => {
587
587
  for (let i = 0; i < n.length; i += 1) {
588
- const o = n[i], a = r == null ? void 0 : r[o], l = s == null ? void 0 : s[o];
588
+ const o = n[i], a = s == null ? void 0 : s[o], l = r == null ? void 0 : r[o];
589
589
  if (a !== l)
590
590
  return a == null ? 1 : l == null ? -1 : typeof a == "number" && typeof l == "number" ? a - l : `${a}`.localeCompare(`${l}`);
591
591
  }
@@ -594,39 +594,39 @@ function Ne(e = [], n = []) {
594
594
  }
595
595
  function kt(e = [], n = "Intervals") {
596
596
  if (!e.length) return;
597
- const t = Ne(e, [_, S, T]), r = /* @__PURE__ */ new Map();
598
- t.forEach((s) => {
599
- const i = `${(s == null ? void 0 : s[_]) ?? ""}`.trim(), o = Number(s == null ? void 0 : s[S]), a = Number(s == null ? void 0 : s[T]);
597
+ const t = Ne(e, [_, C, M]), s = /* @__PURE__ */ new Map();
598
+ t.forEach((r) => {
599
+ const i = `${(r == null ? void 0 : r[_]) ?? ""}`.trim(), o = Number(r == null ? void 0 : r[C]), a = Number(r == null ? void 0 : r[M]);
600
600
  if (!i || !Number.isFinite(o) || !Number.isFinite(a)) return;
601
- const l = r.get(i);
601
+ const l = s.get(i);
602
602
  if (Number.isFinite(l) && o < l)
603
603
  throw k(
604
604
  "validateNoOverlappingIntervals",
605
605
  new Error(`${n} intervals overlap for hole '${i}': from=${o} is less than previous to=${l}`)
606
606
  );
607
- r.set(i, a);
607
+ s.set(i, a);
608
608
  });
609
609
  }
610
610
  function wt(e, n = {}) {
611
- return new Promise((t, r) => {
611
+ return new Promise((t, s) => {
612
612
  J.parse(e, {
613
613
  header: !0,
614
614
  dynamicTyping: !0,
615
615
  skipEmptyLines: !0,
616
616
  ...n,
617
- complete: (s) => t(Array.isArray(s == null ? void 0 : s.data) ? s.data : []),
618
- error: (s) => r(k("loadTable(csv)", s))
617
+ complete: (r) => t(Array.isArray(r == null ? void 0 : r.data) ? r.data : []),
618
+ error: (r) => s(k("loadTable(csv)", r))
619
619
  });
620
620
  });
621
621
  }
622
- function Bt(e = [], n = null, t = null) {
623
- return e.map((r) => ie(r, n, t));
622
+ function Ht(e = [], n = null, t = null) {
623
+ return e.map((s) => ie(s, n, t));
624
624
  }
625
- async function Te(e, n = {}) {
625
+ async function Me(e, n = {}) {
626
626
  const {
627
627
  kind: t = "csv",
628
- columnMap: r = null,
629
- sourceColumnMap: s = null,
628
+ columnMap: s = null,
629
+ sourceColumnMap: r = null,
630
630
  papaParseConfig: i = {}
631
631
  } = n;
632
632
  let o;
@@ -635,18 +635,18 @@ async function Te(e, n = {}) {
635
635
  else if (t === "csv")
636
636
  o = await wt(e, i);
637
637
  else throw t === "parquet" || t === "sql" ? k("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : k("loadTable", new Error(`Unsupported kind: ${t}`));
638
- return Bt(o, r, s);
638
+ return Ht(o, s, r);
639
639
  }
640
640
  async function Pn(e, n = {}) {
641
641
  const {
642
642
  crs: t = null,
643
- sourceColumnMap: r = null,
644
- keepAll: s = !0,
643
+ sourceColumnMap: s = null,
644
+ keepAll: r = !0,
645
645
  ...i
646
- } = n, o = await Te(e, { ...i, sourceColumnMap: r });
646
+ } = n, o = await Me(e, { ...i, sourceColumnMap: s });
647
647
  if (!o.some((d) => _ in d))
648
648
  throw k("loadCollars", new Error(`Collar table missing column: ${_}`));
649
- const l = o.some((d) => pe in d && ye in d), u = o.some((d) => re in d && se in d);
649
+ const l = o.some((d) => pe in d && ye in d), u = o.some((d) => se in d && re in d);
650
650
  if (!l && !u)
651
651
  throw k("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
652
  const c = o.map((d) => {
@@ -655,18 +655,18 @@ async function Pn(e, n = {}) {
655
655
  const g = f[_];
656
656
  f[_] = g == null ? "" : `${g}`.trim();
657
657
  }
658
- return re in f && (f[re] = Z(f[re])), se in f && (f[se] = Z(f[se])), Ie in f && (f[Ie] = Z(f[Ie])), pe in f && (f[pe] = Z(f[pe])), ye in f && (f[ye] = Z(f[ye])), !("datasource_hole_id" in f) && _ in f && (f.datasource_hole_id = f[_]), f;
658
+ return se in f && (f[se] = Z(f[se])), re in f && (f[re] = Z(f[re])), ve in f && (f[ve] = Z(f[ve])), pe in f && (f[pe] = Z(f[pe])), ye in f && (f[ye] = Z(f[ye])), !("datasource_hole_id" in f) && _ in f && (f.datasource_hole_id = f[_]), f;
659
659
  });
660
- if (!c.every((d) => !(!d[_] || u && (!Number.isFinite(d[re]) || !Number.isFinite(d[se])) || l && !u && (!Number.isFinite(d[pe]) || !Number.isFinite(d[ye])))))
660
+ if (!c.every((d) => !(!d[_] || u && (!Number.isFinite(d[se]) || !Number.isFinite(d[re])) || l && !u && (!Number.isFinite(d[pe]) || !Number.isFinite(d[ye])))))
661
661
  throw k("loadCollars", new Error("Collar table has missing required values"));
662
662
  return c;
663
663
  }
664
- async function xn(e, n = {}) {
664
+ async function Dn(e, n = {}) {
665
665
  const {
666
666
  sourceColumnMap: t = null,
667
- keepAll: r = !0,
668
- ...s
669
- } = n, i = await Te(e, { ...s, sourceColumnMap: t }), o = [_, V, j, Y];
667
+ keepAll: s = !0,
668
+ ...r
669
+ } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, G, j, Y];
670
670
  for (const u of o)
671
671
  if (!i.some((m) => u in m))
672
672
  throw k("loadSurveys", new Error(`Survey table missing column: ${u}`));
@@ -676,18 +676,18 @@ async function xn(e, n = {}) {
676
676
  const m = c[_];
677
677
  c[_] = m == null ? "" : `${m}`.trim();
678
678
  }
679
- return V in c && (c[V] = Z(c[V])), T in c && (c[T] = Z(c[T])), j in c && (c[j] = Z(c[j])), Y in c && (c[Y] = Z(c[Y])), c;
679
+ return G in c && (c[G] = Z(c[G])), M in c && (c[M] = Z(c[M])), j in c && (c[j] = Z(c[j])), Y in c && (c[Y] = Z(c[Y])), c;
680
680
  });
681
- if (!a.every((u) => !(!u[_] || !Number.isFinite(u[V]) || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]))))
681
+ if (!a.every((u) => !(!u[_] || !Number.isFinite(u[G]) || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]))))
682
682
  throw k("loadSurveys", new Error("Survey table has missing required values"));
683
- return Ne(a, [_, V]);
683
+ return Ne(a, [_, G]);
684
684
  }
685
- async function Dn(e, n = {}) {
685
+ async function xn(e, n = {}) {
686
686
  const {
687
687
  sourceColumnMap: t = null,
688
- keepAll: r = !0,
689
- ...s
690
- } = n, i = await Te(e, { ...s, sourceColumnMap: t }), o = [_, S, T];
688
+ keepAll: s = !0,
689
+ ...r
690
+ } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, C, M];
691
691
  for (const u of o)
692
692
  if (!i.some((m) => u in m))
693
693
  throw k("loadAssays", new Error(`Assay table missing column: ${u}`));
@@ -697,18 +697,18 @@ async function Dn(e, n = {}) {
697
697
  const m = c[_];
698
698
  c[_] = m == null ? "" : `${m}`.trim();
699
699
  }
700
- return S in c && (c[S] = Z(c[S])), T in c && (c[T] = Z(c[T])), S in c && T in c && Number.isFinite(c[S]) && Number.isFinite(c[T]) && (c[ve] = 0.5 * (c[S] + c[T])), c;
700
+ return C in c && (c[C] = Z(c[C])), M in c && (c[M] = Z(c[M])), C in c && M in c && Number.isFinite(c[C]) && Number.isFinite(c[M]) && (c[Ee] = 0.5 * (c[C] + c[M])), c;
701
701
  });
702
- if (!a.every((u) => !(!u[_] || !Number.isFinite(u[S]) || !Number.isFinite(u[T]) || !(u[T] > u[S]))))
702
+ if (!a.every((u) => !(!u[_] || !Number.isFinite(u[C]) || !Number.isFinite(u[M]) || !(u[M] > u[C]))))
703
703
  throw k("loadAssays", new Error("Assay table has missing required values"));
704
- return Ne(a, [_, S, T]);
704
+ return Ne(a, [_, C, M]);
705
705
  }
706
- async function zn(e, n = {}) {
706
+ async function Rn(e, n = {}) {
707
707
  const {
708
708
  sourceColumnMap: t = null,
709
- keepAll: r = !0,
710
- ...s
711
- } = n, i = await Te(e, { ...s, sourceColumnMap: t }), o = [_, S, T];
709
+ keepAll: s = !0,
710
+ ...r
711
+ } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, C, M];
712
712
  for (const c of o)
713
713
  if (!i.some((d) => c in d))
714
714
  throw k("loadGeology", new Error(`Geology table missing column: ${c}`));
@@ -718,76 +718,76 @@ async function zn(e, n = {}) {
718
718
  const g = m[_];
719
719
  m[_] = g == null ? "" : `${g}`.trim();
720
720
  }
721
- S in m && (m[S] = Z(m[S])), T in m && (m[T] = Z(m[T])), S in m && T in m && Number.isFinite(m[S]) && Number.isFinite(m[T]) && (m[T] === m[S] && (m[S] = Math.round(m[S] * 1e3) / 1e3, m[T] = m[S] + 1e-3), m[ve] = 0.5 * (m[S] + m[T]));
721
+ C in m && (m[C] = Z(m[C])), M in m && (m[M] = Z(m[M])), C in m && M in m && Number.isFinite(m[C]) && Number.isFinite(m[M]) && (m[M] === m[C] && (m[C] = Math.round(m[C] * 1e3) / 1e3, m[M] = m[C] + 1e-3), m[Ee] = 0.5 * (m[C] + m[M]));
722
722
  const d = m[le] !== void 0 && m[le] !== null && `${m[le]}`.trim() !== "", f = m[ce] !== void 0 && m[ce] !== null && `${m[ce]}`.trim() !== "";
723
723
  return !d && f && (m[le] = m[ce]), d && !f && (m[ce] = m[le]), m;
724
724
  });
725
- if (!a.every((c) => !(!c[_] || !Number.isFinite(c[S]) || !Number.isFinite(c[T]) || !(c[T] > c[S]))))
725
+ if (!a.every((c) => !(!c[_] || !Number.isFinite(c[C]) || !Number.isFinite(c[M]) || !(c[M] > c[C]))))
726
726
  throw k("loadGeology", new Error("Geology table has missing or invalid interval values"));
727
727
  if (!a.some((c) => {
728
728
  const m = c[le], d = c[ce];
729
729
  return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
730
730
  }))
731
731
  throw k("loadGeology", new Error(`Geology table missing categorical columns: ${le} or ${ce}`));
732
- if (kt(a, "Geology"), !r) {
732
+ if (kt(a, "Geology"), !s) {
733
733
  const c = new Set(Object.keys(_t));
734
734
  return Ne(
735
735
  a.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => c.has(d)))),
736
- [_, S, T]
736
+ [_, C, M]
737
737
  );
738
738
  }
739
- return Ne(a, [_, S, T]);
739
+ return Ne(a, [_, C, M]);
740
740
  }
741
- function Rn(e = [], n = [], t = {}) {
742
- const r = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [_];
741
+ function zn(e = [], n = [], t = {}) {
742
+ const s = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [_];
743
743
  if (!n.length) return [...e];
744
- const s = (o) => r.map((a) => `${(o == null ? void 0 : o[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
744
+ const r = (o) => s.map((a) => `${(o == null ? void 0 : o[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
745
745
  return n.forEach((o) => {
746
- i.set(s(o), o);
746
+ i.set(r(o), o);
747
747
  }), e.map((o) => {
748
- const a = i.get(s(o));
748
+ const a = i.get(r(o));
749
749
  if (!a) return { ...o };
750
750
  const l = { ...o };
751
751
  return Object.entries(a).forEach(([u, c]) => {
752
- r.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
752
+ s.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
753
753
  }), l;
754
754
  });
755
755
  }
756
- function $n(e = [], n = null) {
757
- return n == null ? [...e] : e.length ? e.some((r) => de in r) ? e.filter((r) => (r == null ? void 0 : r[de]) === n) : [...e] : [];
756
+ function Fn(e = [], n = null) {
757
+ return n == null ? [...e] : e.length ? e.some((s) => de in s) ? e.filter((s) => (s == null ? void 0 : s[de]) === n) : [...e] : [];
758
758
  }
759
- function Fn(e = [], n = []) {
759
+ function $n(e = [], n = []) {
760
760
  return e.map((t) => {
761
- const r = { ...t };
762
- return n.forEach((s) => {
763
- if (!(s in r)) return;
764
- const i = Z(r[s]);
765
- r[s] = i;
766
- }), r;
761
+ const s = { ...t };
762
+ return n.forEach((r) => {
763
+ if (!(r in s)) return;
764
+ const i = Z(s[r]);
765
+ s[r] = i;
766
+ }), s;
767
767
  });
768
768
  }
769
769
  function kn({
770
770
  collars: e = [],
771
771
  surveys: n = [],
772
772
  assays: t = [],
773
- geology: r = [],
774
- structures: s = [],
773
+ geology: s = [],
774
+ structures: r = [],
775
775
  metadata: i = {}
776
776
  } = {}) {
777
777
  return {
778
778
  collars: ge(e),
779
779
  surveys: ge(n),
780
780
  assays: ge(t),
781
- geology: ge(r),
782
- structures: ge(s),
781
+ geology: ge(s),
782
+ structures: ge(r),
783
783
  metadata: i || {}
784
784
  };
785
785
  }
786
786
  const we = (e, n = null) => ie(e, null, n);
787
- function Ht(e) {
787
+ function Ut(e) {
788
788
  if (!e.length) return null;
789
- const n = e[0], t = S in n && T in n, r = V in n && !t;
790
- return t ? "interval" : r ? "point" : null;
789
+ const n = e[0], t = C in n && M in n, s = G in n && !t;
790
+ return t ? "interval" : s ? "point" : null;
791
791
  }
792
792
  function oe(e) {
793
793
  const n = Number(e);
@@ -796,10 +796,10 @@ function oe(e) {
796
796
  function ot(e) {
797
797
  const n = e[_] !== void 0 ? `${e[_]}`.trim() : "";
798
798
  if (!n) return null;
799
- const t = oe(e[V]);
799
+ const t = oe(e[G]);
800
800
  return t === null ? null : {
801
801
  [_]: n,
802
- [V]: t,
802
+ [G]: t,
803
803
  [Y]: oe(e[Y]),
804
804
  [j]: oe(e[j]),
805
805
  comments: e.comments != null ? `${e.comments}` : null,
@@ -809,14 +809,14 @@ function ot(e) {
809
809
  function it(e) {
810
810
  const n = e[_] !== void 0 ? `${e[_]}`.trim() : "";
811
811
  if (!n) return null;
812
- const t = oe(e[S]), r = oe(e[T]);
813
- if (t === null || r === null || r <= t) return null;
814
- const s = 0.5 * (t + r);
812
+ const t = oe(e[C]), s = oe(e[M]);
813
+ if (t === null || s === null || s <= t) return null;
814
+ const r = 0.5 * (t + s);
815
815
  return {
816
816
  [_]: n,
817
- [S]: t,
818
- [T]: r,
819
- mid: s,
817
+ [C]: t,
818
+ [M]: s,
819
+ mid: r,
820
820
  [Y]: oe(e[Y]),
821
821
  [j]: oe(e[j]),
822
822
  classification: e.classification != null ? `${e.classification}` : null,
@@ -826,15 +826,15 @@ function it(e) {
826
826
  }
827
827
  function wn(e) {
828
828
  const n = [], t = [];
829
- for (const r of e) {
830
- const s = [], i = oe(r[Y]), o = oe(r[j]);
831
- i !== null && (i < 0 || i > 90) && s.push(`dip ${i} out of range [0, 90]`), o !== null && (o < 0 || o >= 360) && s.push(`azimuth ${o} out of range [0, 360)`), s.length ? t.push({ row: r, message: s.join("; ") }) : n.push(r);
829
+ for (const s of e) {
830
+ const r = [], i = oe(s[Y]), o = oe(s[j]);
831
+ i !== null && (i < 0 || i > 90) && r.push(`dip ${i} out of range [0, 90]`), o !== null && (o < 0 || o >= 360) && r.push(`azimuth ${o} out of range [0, 360)`), r.length ? t.push({ row: s, message: r.join("; ") }) : n.push(s);
832
832
  }
833
833
  return { valid: n, errors: t };
834
834
  }
835
- function Bn(e, n = null) {
836
- return new Promise((t, r) => {
837
- const s = {
835
+ function Hn(e, n = null) {
836
+ return new Promise((t, s) => {
837
+ const r = {
838
838
  header: !0,
839
839
  dynamicTyping: !0,
840
840
  skipEmptyLines: !0,
@@ -846,48 +846,48 @@ function Bn(e, n = null) {
846
846
  }
847
847
  t(o);
848
848
  },
849
- error: (i) => r(k("parseStructuralPointsCSV", i))
849
+ error: (i) => s(k("parseStructuralPointsCSV", i))
850
850
  };
851
851
  typeof e == "string" && !e.startsWith("data:") && e.includes(`
852
- `) ? J.parse(e, s) : J.parse(e, s);
852
+ `) ? J.parse(e, r) : J.parse(e, r);
853
853
  });
854
854
  }
855
- function Hn(e, n = null) {
856
- return new Promise((t, r) => {
855
+ function Un(e, n = null) {
856
+ return new Promise((t, s) => {
857
857
  J.parse(e, {
858
858
  header: !0,
859
859
  dynamicTyping: !0,
860
860
  skipEmptyLines: !0,
861
- complete: (s) => {
861
+ complete: (r) => {
862
862
  const i = [];
863
- for (const o of s.data) {
863
+ for (const o of r.data) {
864
864
  const a = we(o, n), l = it(a);
865
865
  l && i.push(l);
866
866
  }
867
867
  t(i);
868
868
  },
869
- error: (s) => r(k("parseStructuralIntervalsCSV", s))
869
+ error: (r) => s(k("parseStructuralIntervalsCSV", r))
870
870
  });
871
871
  });
872
872
  }
873
- function Gt(e, n = _) {
873
+ function Bt(e, n = _) {
874
874
  const t = /* @__PURE__ */ new Map();
875
- for (const r of e) {
876
- const s = r[n] != null ? String(r[n]).trim() : "";
877
- s && (t.has(s) || t.set(s, { holeId: s, points: [] }), t.get(s).points.push(r));
875
+ for (const s of e) {
876
+ const r = s[n] != null ? String(s[n]).trim() : "";
877
+ r && (t.has(r) || t.set(r, { holeId: r, points: [] }), t.get(r).points.push(s));
878
878
  }
879
879
  return Array.from(t.values());
880
880
  }
881
- function Vt(e, n = null) {
882
- return new Promise((t, r) => {
881
+ function Gt(e, n = null) {
882
+ return new Promise((t, s) => {
883
883
  J.parse(e, {
884
884
  header: !0,
885
885
  dynamicTyping: !0,
886
886
  skipEmptyLines: !0,
887
- complete: (s) => {
888
- const i = s.data.map((l) => we(l, n)), o = Ht(i);
887
+ complete: (r) => {
888
+ const i = r.data.map((l) => we(l, n)), o = Ut(i);
889
889
  if (!o) {
890
- r(k(
890
+ s(k(
891
891
  "parseStructuralCSV",
892
892
  new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
893
893
  ));
@@ -900,40 +900,40 @@ function Vt(e, n = null) {
900
900
  }
901
901
  t({ schema: o, rows: a });
902
902
  },
903
- error: (s) => r(k("parseStructuralCSV", s))
903
+ error: (r) => s(k("parseStructuralCSV", r))
904
904
  });
905
905
  });
906
906
  }
907
- function Ut(e) {
907
+ function Vt(e) {
908
908
  return new Promise((n) => {
909
909
  J.parse(e, {
910
910
  header: !0,
911
911
  dynamicTyping: !0,
912
912
  skipEmptyLines: !0,
913
913
  complete: (t) => {
914
- const r = /* @__PURE__ */ new Map();
914
+ const s = /* @__PURE__ */ new Map();
915
915
  for (const i of t.data) {
916
916
  const o = ie(i), a = o[_] != null ? `${o[_]}`.trim() : "";
917
917
  if (!a) continue;
918
- const l = Number(o[S]), u = Number(o[T]);
918
+ const l = Number(o[C]), u = Number(o[M]);
919
919
  if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l) continue;
920
920
  const c = (l + u) / 2, { [Y]: m, [j]: d, ...f } = o, g = {
921
921
  ...f,
922
922
  [_]: a,
923
- [S]: l,
924
- [T]: u,
925
- [ve]: c,
926
- [V]: c,
923
+ [C]: l,
924
+ [M]: u,
925
+ [Ee]: c,
926
+ [G]: c,
927
927
  // unified depth field for y-axis rendering
928
928
  _source: "assay"
929
929
  };
930
- r.has(a) || r.set(a, []), r.get(a).push(g);
930
+ s.has(a) || s.set(a, []), s.get(a).push(g);
931
931
  }
932
- const s = Array.from(r.entries()).map(([i, o]) => ({
932
+ const r = Array.from(s.entries()).map(([i, o]) => ({
933
933
  holeId: i,
934
- points: o.sort((a, l) => a[S] - l[S])
934
+ points: o.sort((a, l) => a[C] - l[C])
935
935
  }));
936
- n(s);
936
+ n(r);
937
937
  }
938
938
  });
939
939
  });
@@ -945,42 +945,42 @@ function jt(e) {
945
945
  dynamicTyping: !0,
946
946
  skipEmptyLines: !0,
947
947
  complete: (t) => {
948
- const r = /* @__PURE__ */ new Map();
949
- for (const s of t.data) {
950
- const i = ie(s), o = (i[_] ?? "").toString().trim();
948
+ const s = /* @__PURE__ */ new Map();
949
+ for (const r of t.data) {
950
+ const i = ie(r), o = (i[_] ?? "").toString().trim();
951
951
  if (!o) continue;
952
- const a = Number(i[S]), l = Number(i[T]);
952
+ const a = Number(i[C]), l = Number(i[M]);
953
953
  if (!Number.isFinite(a) || !Number.isFinite(l) || l <= a) continue;
954
954
  const u = (a + l) / 2, { [Y]: c, [j]: m, ...d } = i, f = {
955
955
  ...d,
956
956
  [_]: o,
957
- [S]: a,
958
- [T]: l,
959
- [ve]: u,
960
- [V]: u,
957
+ [C]: a,
958
+ [M]: l,
959
+ [Ee]: u,
960
+ [G]: u,
961
961
  _source: "geology"
962
962
  };
963
- r.has(o) || r.set(o, []), r.get(o).push(f);
963
+ s.has(o) || s.set(o, []), s.get(o).push(f);
964
964
  }
965
965
  n({
966
- holes: Array.from(r.entries()).map(([s, i]) => ({
967
- holeId: s,
968
- points: i.sort((o, a) => o[S] - a[S])
966
+ holes: Array.from(s.entries()).map(([r, i]) => ({
967
+ holeId: r,
968
+ points: i.sort((o, a) => o[C] - a[C])
969
969
  }))
970
970
  });
971
971
  }
972
972
  });
973
973
  });
974
974
  }
975
- async function Gn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
- const [r, s, i] = await Promise.all([
977
- e ? Ut(e) : Promise.resolve([]),
978
- n ? Vt(n).then(
979
- ({ rows: a }) => Gt(a.map((l) => ({ ...l, _source: "structural" })))
975
+ async function Bn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
+ const [s, r, i] = await Promise.all([
977
+ e ? Vt(e) : Promise.resolve([]),
978
+ n ? Gt(n).then(
979
+ ({ rows: a }) => Bt(a.map((l) => ({ ...l, _source: "structural" })))
980
980
  ) : Promise.resolve([]),
981
981
  t ? jt(t).then(({ holes: a }) => a) : Promise.resolve([])
982
- ]), o = new Map(r.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
- for (const a of [...s, ...i]) {
982
+ ]), o = new Map(s.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
+ for (const a of [...r, ...i]) {
984
984
  const l = a.holeId;
985
985
  if (l)
986
986
  if (o.has(l)) {
@@ -991,8 +991,8 @@ async function Gn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
991
991
  }
992
992
  return { holes: Array.from(o.values()) };
993
993
  }
994
- function Vn(e, n, t, r, s = {}) {
995
- const i = s.fromCol || "from", o = s.toCol || "to", a = s.holeCol || "hole_id";
994
+ function Gn(e, n, t, s, r = {}) {
995
+ const i = r.fromCol || "from", o = r.toCol || "to", a = r.holeCol || "hole_id";
996
996
  if (!e || !e.length) return [];
997
997
  const l = {};
998
998
  for (const c of e) {
@@ -1001,36 +1001,36 @@ function Vn(e, n, t, r, s = {}) {
1001
1001
  }
1002
1002
  const u = [];
1003
1003
  for (const [c, m] of Object.entries(l)) {
1004
- const f = [...m].sort((h, v) => Number(h[i]) - Number(v[i])).filter((h) => {
1005
- const v = Number(h[n]);
1006
- return Number.isFinite(v) && v >= t;
1004
+ const f = [...m].sort((h, E) => Number(h[i]) - Number(E[i])).filter((h) => {
1005
+ const E = Number(h[n]);
1006
+ return Number.isFinite(E) && E >= t;
1007
1007
  });
1008
1008
  if (!f.length) continue;
1009
1009
  const g = [];
1010
1010
  let y = [], b = null;
1011
1011
  for (const h of f) {
1012
- const v = Number(h[i]), E = Number(h[o]);
1013
- b === null || Math.abs(v - b) > 1e-6 ? (y.length && g.push(y), y = [h]) : y.push(h), b = E;
1012
+ const E = Number(h[i]), A = Number(h[o]);
1013
+ b === null || Math.abs(E - b) > 1e-6 ? (y.length && g.push(y), y = [h]) : y.push(h), b = A;
1014
1014
  }
1015
1015
  y.length && g.push(y);
1016
1016
  for (const h of g) {
1017
- const v = Number(h[0][i]), E = Number(h[h.length - 1][o]), D = E - v;
1018
- if (D < r) continue;
1019
- let B = 0, O = 0;
1017
+ const E = Number(h[0][i]), A = Number(h[h.length - 1][o]), x = A - E;
1018
+ if (x < s) continue;
1019
+ let H = 0, O = 0;
1020
1020
  for (const p of h) {
1021
- const M = Number(p[n]), A = Number(p[o]) - Number(p[i]);
1022
- B += M * A, O += A;
1021
+ const T = Number(p[n]), I = Number(p[o]) - Number(p[i]);
1022
+ H += T * I, O += I;
1023
1023
  }
1024
- const P = B / O, z = h.length, U = `${D.toFixed(1)} m @ ${P.toFixed(2)} ${n}`;
1024
+ const P = H / O, R = h.length, V = `${x.toFixed(1)} m @ ${P.toFixed(2)} ${n}`;
1025
1025
  u.push({
1026
1026
  [a]: c,
1027
1027
  assay_field: n,
1028
- [i]: v,
1029
- [o]: E,
1030
- length: D,
1028
+ [i]: E,
1029
+ [o]: A,
1030
+ length: x,
1031
1031
  avg_grade: P,
1032
- n_samples: z,
1033
- label: U
1032
+ n_samples: R,
1033
+ label: V
1034
1034
  });
1035
1035
  }
1036
1036
  }
@@ -1038,39 +1038,39 @@ function Vn(e, n, t, r, s = {}) {
1038
1038
  }
1039
1039
  const at = ["depth", "md", "measured_depth", "dept", "z"];
1040
1040
  function Yt(e) {
1041
- if (e[V] !== void 0) {
1042
- const r = Number(e[V]);
1043
- if (Number.isFinite(r)) return r;
1041
+ if (e[G] !== void 0) {
1042
+ const s = Number(e[G]);
1043
+ if (Number.isFinite(s)) return s;
1044
1044
  }
1045
- for (const r of at)
1046
- if (e[r] !== void 0) {
1047
- const s = Number(e[r]);
1048
- if (Number.isFinite(s)) return s;
1045
+ for (const s of at)
1046
+ if (e[s] !== void 0) {
1047
+ const r = Number(e[s]);
1048
+ if (Number.isFinite(r)) return r;
1049
1049
  }
1050
- const n = Number(e[S]), t = Number(e[T]);
1050
+ const n = Number(e[C]), t = Number(e[M]);
1051
1051
  return Number.isFinite(n) && Number.isFinite(t) && t >= n ? (n + t) / 2 : null;
1052
1052
  }
1053
1053
  function Wt(e) {
1054
1054
  if (e.length === 0) return [];
1055
- const n = /* @__PURE__ */ new Set([_, V, S, T, ve, ...at]);
1056
- return Object.keys(e[0]).filter((r) => !n.has(r)).filter((r) => {
1057
- let s = 0;
1055
+ const n = /* @__PURE__ */ new Set([_, G, C, M, Ee, ...at]);
1056
+ return Object.keys(e[0]).filter((s) => !n.has(s)).filter((s) => {
1057
+ let r = 0;
1058
1058
  for (const i of e) {
1059
- const o = Number(i[r]);
1060
- Number.isFinite(o) && s++;
1059
+ const o = Number(i[s]);
1060
+ Number.isFinite(o) && r++;
1061
1061
  }
1062
- return s / e.length > 0.5;
1062
+ return r / e.length > 0.5;
1063
1063
  });
1064
1064
  }
1065
- function Un(e, n = null) {
1066
- const r = J.parse(e, {
1065
+ function Vn(e, n = null) {
1066
+ const s = J.parse(e, {
1067
1067
  header: !0,
1068
1068
  skipEmptyLines: !0,
1069
1069
  dynamicTyping: !1
1070
1070
  }).data || [];
1071
- if (r.length === 0) return [];
1072
- const s = r.map((l) => ie(l, null, n)), i = Wt(s), o = /* @__PURE__ */ new Map();
1073
- for (const l of s) {
1071
+ if (s.length === 0) return [];
1072
+ const r = s.map((l) => ie(l, null, n)), i = Wt(r), o = /* @__PURE__ */ new Map();
1073
+ for (const l of r) {
1074
1074
  const u = l[_] != null ? `${l[_]}`.trim() : "";
1075
1075
  if (!u) continue;
1076
1076
  const c = Yt(l);
@@ -1093,82 +1093,82 @@ function Un(e, n = null) {
1093
1093
  return a;
1094
1094
  }
1095
1095
  function jn(e, n = null, t = {}) {
1096
- const r = [];
1097
- for (const { holeId: s, channels: i } of e) {
1096
+ const s = [];
1097
+ for (const { holeId: r, channels: i } of e) {
1098
1098
  const o = n && i[n] ? n : Object.keys(i)[0];
1099
1099
  if (!o) continue;
1100
1100
  const { depths: a, values: l } = i[o];
1101
- r.push({ holeId: s, depths: a, values: l, options: t });
1101
+ s.push({ holeId: r, depths: a, values: l, options: t });
1102
1102
  }
1103
- return r;
1103
+ return s;
1104
1104
  }
1105
1105
  function lt(e) {
1106
1106
  const n = e.indexOf(".");
1107
1107
  if (n < 0) return null;
1108
- const t = e.slice(0, n).trim().toUpperCase(), r = e.slice(n + 1), s = r.match(/^(\S*)\s*(.*)/s), i = s ? s[1] : "", o = s ? s[2] : r, a = o.lastIndexOf(":"), l = a >= 0 ? o.slice(0, a).trim() : o.trim(), u = a >= 0 ? o.slice(a + 1).trim() : "";
1108
+ const t = e.slice(0, n).trim().toUpperCase(), s = e.slice(n + 1), r = s.match(/^(\S*)\s*(.*)/s), i = r ? r[1] : "", o = r ? r[2] : s, a = o.lastIndexOf(":"), l = a >= 0 ? o.slice(0, a).trim() : o.trim(), u = a >= 0 ? o.slice(a + 1).trim() : "";
1109
1109
  return { mnem: t, unit: i, value: l, description: u };
1110
1110
  }
1111
1111
  function qt(e) {
1112
1112
  const n = [];
1113
1113
  let t = null;
1114
- for (const r of e.split(/\r?\n/)) {
1115
- const s = r.trimEnd();
1116
- s.startsWith("~") ? (t = { type: s.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(s);
1114
+ for (const s of e.split(/\r?\n/)) {
1115
+ const r = s.trimEnd();
1116
+ r.startsWith("~") ? (t = { type: r.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(r);
1117
1117
  }
1118
1118
  return n;
1119
1119
  }
1120
1120
  function We(e = []) {
1121
1121
  const n = {};
1122
1122
  for (const t of e) {
1123
- const r = t.trimStart();
1124
- if (!r || r.startsWith("#")) continue;
1125
- const s = lt(t);
1126
- s && (n[s.mnem] = s);
1123
+ const s = t.trimStart();
1124
+ if (!s || s.startsWith("#")) continue;
1125
+ const r = lt(t);
1126
+ r && (n[r.mnem] = r);
1127
1127
  }
1128
1128
  return n;
1129
1129
  }
1130
1130
  function Yn(e, n = {}) {
1131
- var h, v, E, D, B, O, P, z, U;
1132
- const t = qt(e), r = t.find((p) => p.type === "V"), s = t.find((p) => p.type === "W"), i = t.find((p) => p.type === "C"), o = t.find((p) => p.type === "A");
1131
+ var h, E, A, x, H, O, P, R, V;
1132
+ const t = qt(e), s = t.find((p) => p.type === "V"), r = t.find((p) => p.type === "W"), i = t.find((p) => p.type === "C"), o = t.find((p) => p.type === "A");
1133
1133
  if (!o) return [];
1134
- const a = We(r == null ? void 0 : r.lines), l = We(s == null ? void 0 : s.lines), u = [];
1134
+ const a = We(s == null ? void 0 : s.lines), l = We(r == null ? void 0 : r.lines), u = [];
1135
1135
  for (const p of (i == null ? void 0 : i.lines) ?? []) {
1136
- const M = p.trimStart();
1137
- if (!M || M.startsWith("#")) continue;
1138
- const A = lt(p);
1139
- A && u.push(A);
1136
+ const T = p.trimStart();
1137
+ if (!T || T.startsWith("#")) continue;
1138
+ const I = lt(p);
1139
+ I && u.push(I);
1140
1140
  }
1141
- (((v = (h = a.WRAP) == null ? void 0 : h.value) == null ? void 0 : v.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1141
+ (((E = (h = a.WRAP) == null ? void 0 : h.value) == null ? void 0 : E.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1142
1142
  "parseLasFile: WRAP YES is not supported. Data rows may be read incorrectly."
1143
1143
  );
1144
- const m = n.holeId ?? (((D = (E = l.WELL) == null ? void 0 : E.value) == null ? void 0 : D.trim()) || null) ?? (((O = (B = l.UWI) == null ? void 0 : B.value) == null ? void 0 : O.trim()) || null) ?? (((z = (P = l.API) == null ? void 0 : P.value) == null ? void 0 : z.trim()) || null) ?? "unknown";
1144
+ const m = n.holeId ?? (((x = (A = l.WELL) == null ? void 0 : A.value) == null ? void 0 : x.trim()) || null) ?? (((O = (H = l.UWI) == null ? void 0 : H.value) == null ? void 0 : O.trim()) || null) ?? (((R = (P = l.API) == null ? void 0 : P.value) == null ? void 0 : R.trim()) || null) ?? "unknown";
1145
1145
  let d = Qe;
1146
- if ((U = l.NULL) != null && U.value) {
1146
+ if ((V = l.NULL) != null && V.value) {
1147
1147
  const p = Number(l.NULL.value);
1148
1148
  Number.isFinite(p) && (d = p);
1149
1149
  }
1150
1150
  if (n.nullSentinel !== void 0 && (d = n.nullSentinel), u.length === 0) return [];
1151
1151
  const f = u.slice(1), g = {};
1152
- for (const { mnem: p, unit: M } of f)
1153
- g[p.toLowerCase()] = M;
1152
+ for (const { mnem: p, unit: T } of f)
1153
+ g[p.toLowerCase()] = T;
1154
1154
  const y = {};
1155
1155
  for (const { mnem: p } of f)
1156
1156
  y[p.toLowerCase()] = { depths: [], values: [] };
1157
1157
  for (const p of o.lines) {
1158
- const M = p.trimStart();
1159
- if (!M || M.startsWith("#")) continue;
1160
- const A = M.split(/\s+/);
1161
- if (A.length < 2) continue;
1162
- const R = Number(A[0]);
1163
- if (!(!Number.isFinite(R) || R === d))
1158
+ const T = p.trimStart();
1159
+ if (!T || T.startsWith("#")) continue;
1160
+ const I = T.split(/\s+/);
1161
+ if (I.length < 2) continue;
1162
+ const z = Number(I[0]);
1163
+ if (!(!Number.isFinite(z) || z === d))
1164
1164
  for (let w = 0; w < f.length; w++) {
1165
- const I = f[w].mnem.toLowerCase(), N = Number(A[w + 1]);
1166
- Number.isFinite(N) && N !== d && (y[I].depths.push(R), y[I].values.push(N));
1165
+ const v = f[w].mnem.toLowerCase(), N = Number(I[w + 1]);
1166
+ Number.isFinite(N) && N !== d && (y[v].depths.push(z), y[v].values.push(N));
1167
1167
  }
1168
1168
  }
1169
1169
  const b = {};
1170
- for (const [p, M] of Object.entries(y))
1171
- M.depths.length >= 2 && (b[p] = M);
1170
+ for (const [p, T] of Object.entries(y))
1171
+ T.depths.length >= 2 && (b[p] = T);
1172
1172
  return Object.keys(b).length === 0 ? [] : [{ holeId: m, units: g, channels: b }];
1173
1173
  }
1174
1174
  const ct = [
@@ -1223,35 +1223,35 @@ function ut(e = {}) {
1223
1223
  function Xt(e, {
1224
1224
  tailScale: n = 5,
1225
1225
  colorBy: t = null,
1226
- palette: r = ct,
1227
- depthCol: s = V,
1226
+ palette: s = ct,
1227
+ depthCol: r = G,
1228
1228
  dipCol: i = Y,
1229
1229
  azCol: o = j,
1230
1230
  template: a = void 0
1231
1231
  } = {}) {
1232
1232
  const l = e.filter(
1233
- (y) => y[s] != null && y[i] != null && y[o] != null
1233
+ (y) => y[r] != null && y[i] != null && y[o] != null
1234
1234
  );
1235
1235
  if (!l.length)
1236
1236
  return { data: [], layout: {} };
1237
1237
  const u = {};
1238
1238
  t && [...new Set(l.map((b) => b[t]).filter((b) => b != null))].sort().forEach((b, h) => {
1239
- u[b] = r[h % r.length];
1239
+ u[b] = s[h % s.length];
1240
1240
  });
1241
1241
  const c = /* @__PURE__ */ new Map(), m = [];
1242
1242
  for (const y of l) {
1243
- const b = Number(y[s]), h = Number(y[i]), v = Number(y[o]), E = t ? y[t] ?? "_default" : "_default", D = t ? u[E] ?? "#0f172a" : "#0f172a";
1244
- c.has(E) || c.set(E, { xs: [], ys: [], dips: [], azs: [], color: D });
1245
- const B = c.get(E);
1246
- B.xs.push(h), B.ys.push(b), B.dips.push(h), B.azs.push(v);
1247
- const O = v * Math.PI / 180, P = n * (Math.abs(h) / 90), z = Math.sin(O) * P, U = Math.cos(O) * P;
1243
+ const b = Number(y[r]), h = Number(y[i]), E = Number(y[o]), A = t ? y[t] ?? "_default" : "_default", x = t ? u[A] ?? "#0f172a" : "#0f172a";
1244
+ c.has(A) || c.set(A, { xs: [], ys: [], dips: [], azs: [], color: x });
1245
+ const H = c.get(A);
1246
+ H.xs.push(h), H.ys.push(b), H.dips.push(h), H.azs.push(E);
1247
+ const O = E * Math.PI / 180, P = n * (Math.abs(h) / 90), R = Math.sin(O) * P, V = Math.cos(O) * P;
1248
1248
  m.push({
1249
1249
  type: "line",
1250
1250
  x0: h,
1251
1251
  y0: b,
1252
- x1: h + z,
1253
- y1: b + U,
1254
- line: { color: D, width: 2 }
1252
+ x1: h + R,
1253
+ y1: b + V,
1254
+ line: { color: x, width: 2 }
1255
1255
  });
1256
1256
  }
1257
1257
  const d = [], f = t && c.size > 1;
@@ -1264,7 +1264,7 @@ function Xt(e, {
1264
1264
  name: y !== "_default" ? String(y) : void 0,
1265
1265
  marker: { size: 8, color: b.color },
1266
1266
  showlegend: f && y !== "_default",
1267
- customdata: b.dips.map((h, v) => [h, b.azs[v]]),
1267
+ customdata: b.dips.map((h, E) => [h, b.azs[E]]),
1268
1268
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
1269
1269
  });
1270
1270
  return { data: d, layout: {
@@ -1280,22 +1280,22 @@ function Xt(e, {
1280
1280
  },
1281
1281
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1282
1282
  showlegend: !!f,
1283
- template: a !== void 0 ? a : Fe
1283
+ template: a !== void 0 ? a : $e
1284
1284
  } };
1285
1285
  }
1286
1286
  function Wn(e, {
1287
1287
  labelCol: n = "structure_type",
1288
1288
  palette: t = ct,
1289
- fromCol: r = S,
1290
- toCol: s = T,
1289
+ fromCol: s = C,
1290
+ toCol: r = M,
1291
1291
  template: i = void 0
1292
1292
  } = {}) {
1293
- const o = e.filter((d) => d[r] != null && d[s] != null && Number(d[s]) > Number(d[r])).filter((d) => {
1293
+ const o = e.filter((d) => d[s] != null && d[r] != null && Number(d[r]) > Number(d[s])).filter((d) => {
1294
1294
  const f = d[n];
1295
1295
  if (f == null) return !1;
1296
1296
  const g = String(f).trim();
1297
1297
  return g !== "" && !/^(nan|null|none)$/i.test(g);
1298
- }).map((d) => ({ from: Number(d[r]), to: Number(d[s]), label: String(d[n]).trim() })).sort((d, f) => d.from - f.from);
1298
+ }).map((d) => ({ from: Number(d[s]), to: Number(d[r]), label: String(d[n]).trim() })).sort((d, f) => d.from - f.from);
1299
1299
  if (!o.length)
1300
1300
  return { data: [], layout: {} };
1301
1301
  const a = [], l = [], u = [];
@@ -1327,36 +1327,36 @@ function Wn(e, {
1327
1327
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1328
1328
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1329
1329
  showlegend: !1,
1330
- template: i !== void 0 ? i : Fe
1330
+ template: i !== void 0 ? i : $e
1331
1331
  }) };
1332
1332
  }
1333
1333
  function Xe(e, n) {
1334
1334
  if (!e) return "";
1335
- const t = String(e).trim().split(/\s+/), r = [];
1336
- let s = "";
1335
+ const t = String(e).trim().split(/\s+/), s = [];
1336
+ let r = "";
1337
1337
  for (const i of t)
1338
- s && s.length + 1 + i.length > n ? (r.push(s), s = i) : s = s ? `${s} ${i}` : i;
1339
- return s && r.push(s), r.join("<br>");
1338
+ r && r.length + 1 + i.length > n ? (s.push(r), r = i) : r = r ? `${r} ${i}` : i;
1339
+ return r && s.push(r), s.join("<br>");
1340
1340
  }
1341
1341
  function Zt(e, {
1342
1342
  commentCol: n = "comments",
1343
- fromCol: t = S,
1344
- toCol: r = T,
1345
- bgColor: s = "#f1f5f9",
1343
+ fromCol: t = C,
1344
+ toCol: s = M,
1345
+ bgColor: r = "#f1f5f9",
1346
1346
  borderColor: i = "#cbd5e1",
1347
1347
  textColor: o = "#1e293b",
1348
1348
  charsPerLine: a = 18,
1349
1349
  template: l = void 0
1350
1350
  } = {}) {
1351
- const u = e.filter((h) => h[t] != null && h[r] != null && Number(h[r]) > Number(h[t])).map((h) => {
1352
- const v = h[n], E = v != null && String(v).trim() !== "" && String(v) !== "null" ? String(v).trim() : "";
1353
- return { from: Number(h[t]), to: Number(h[r]), comment: E };
1354
- }).sort((h, v) => h.from - v.from);
1351
+ const u = e.filter((h) => h[t] != null && h[s] != null && Number(h[s]) > Number(h[t])).map((h) => {
1352
+ const E = h[n], A = E != null && String(E).trim() !== "" && String(E) !== "null" ? String(E).trim() : "";
1353
+ return { from: Number(h[t]), to: Number(h[s]), comment: A };
1354
+ }).sort((h, E) => h.from - E.from);
1355
1355
  if (!u.length)
1356
1356
  return { data: [], layout: {} };
1357
1357
  const c = [], m = [], d = [], f = [], g = [];
1358
1358
  for (const h of u) {
1359
- const v = 0.5 * (h.from + h.to), E = !!h.comment;
1359
+ const E = 0.5 * (h.from + h.to), A = !!h.comment;
1360
1360
  c.push({
1361
1361
  type: "rect",
1362
1362
  xref: "x",
@@ -1365,10 +1365,10 @@ function Zt(e, {
1365
1365
  x1: 1,
1366
1366
  y0: h.from,
1367
1367
  y1: h.to,
1368
- fillcolor: E ? s : "rgba(0,0,0,0)",
1368
+ fillcolor: A ? r : "rgba(0,0,0,0)",
1369
1369
  line: { color: i, width: 1 },
1370
1370
  layer: "below"
1371
- }), E && (m.push(0.5), d.push(v), f.push(Xe(h.comment, a)), g.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${Xe(h.comment, 40)}`));
1371
+ }), A && (m.push(0.5), d.push(E), f.push(Xe(h.comment, a)), g.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${Xe(h.comment, 40)}`));
1372
1372
  }
1373
1373
  return { data: m.length ? [{
1374
1374
  type: "scatter",
@@ -1387,48 +1387,48 @@ function Zt(e, {
1387
1387
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1388
1388
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1389
1389
  showlegend: !1,
1390
- template: l !== void 0 ? l : Fe
1390
+ template: l !== void 0 ? l : $e
1391
1391
  }) };
1392
1392
  }
1393
1393
  function qn(e, {
1394
1394
  symbolSize: n = 10,
1395
1395
  xCol: t = "easting",
1396
- yCol: r = "northing"
1396
+ yCol: s = "northing"
1397
1397
  } = {}) {
1398
- const s = e[t] != null ? Number(e[t]) : null, i = e[r] != null ? Number(e[r]) : null, o = e[Y] != null ? Number(e[Y]) : null, a = e[j] != null ? Number(e[j]) : null;
1399
- if (s === null || i === null || o === null || a === null) return null;
1398
+ const r = e[t] != null ? Number(e[t]) : null, i = e[s] != null ? Number(e[s]) : null, o = e[Y] != null ? Number(e[Y]) : null, a = e[j] != null ? Number(e[j]) : null;
1399
+ if (r === null || i === null || o === null || a === null) return null;
1400
1400
  const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, m = n * Math.sin(u), d = n * Math.cos(u), f = n * 0.4 * (o / 90), g = f * Math.sin(c), y = f * Math.cos(c);
1401
1401
  return {
1402
1402
  strike: l,
1403
1403
  dipValue: o,
1404
- x: s,
1404
+ x: r,
1405
1405
  y: i,
1406
- strikeX0: s - m,
1406
+ strikeX0: r - m,
1407
1407
  strikeY0: i - d,
1408
- strikeX1: s + m,
1408
+ strikeX1: r + m,
1409
1409
  strikeY1: i + d,
1410
- tickX1: s + g,
1410
+ tickX1: r + g,
1411
1411
  tickY1: i + y
1412
1412
  };
1413
1413
  }
1414
1414
  const dt = "markers+line";
1415
1415
  function Jt(e, n) {
1416
- var r;
1416
+ var s;
1417
1417
  const t = et(e);
1418
- return t.some((s) => s.value === n) ? n : ((r = t[0]) == null ? void 0 : r.value) || dt;
1418
+ return t.some((r) => r.value === n) ? n : ((s = t[0]) == null ? void 0 : s.value) || dt;
1419
1419
  }
1420
- function Kn({ config: e, graph: n, holeOptions: t = [], propertyOptions: r = [], onConfigChange: s, template: i }) {
1421
- const o = _e(null), a = n == null ? void 0 : n.hole, l = (n == null ? void 0 : n.points) || [], u = (e == null ? void 0 : e.property) || "", c = (e == null ? void 0 : e.chartType) || dt, m = (e == null ? void 0 : e.holeId) || "", d = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? Pe : n != null && n.isCategorical ? Ge : Nt), f = et(d), g = Jt(d, c), [y, b] = X("");
1420
+ function Kn({ config: e, graph: n, holeOptions: t = [], propertyOptions: s = [], onConfigChange: r, template: i }) {
1421
+ const o = _e(null), a = n == null ? void 0 : n.hole, l = (n == null ? void 0 : n.points) || [], u = (e == null ? void 0 : e.property) || "", c = (e == null ? void 0 : e.chartType) || dt, m = (e == null ? void 0 : e.holeId) || "", d = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? Pe : n != null && n.isCategorical ? Be : Nt), f = et(d), g = Jt(d, c), [y, b] = X("");
1422
1422
  return ne(() => {
1423
- const h = d === Pe, v = d === Ve;
1424
- if (!a || !u || !h && !v && l.length === 0) return;
1425
- const E = o.current;
1426
- if (!E) return;
1427
- let D;
1423
+ const h = d === Pe, E = d === Ge;
1424
+ if (!a || !u || !h && !E && l.length === 0) return;
1425
+ const A = o.current;
1426
+ if (!A) return;
1427
+ let x;
1428
1428
  try {
1429
- h ? D = Zt(l, { commentCol: u, fromCol: "from", toCol: "to" }) : v ? D = Xt(l) : D = vt({
1429
+ h ? x = Zt(l, { commentCol: u, fromCol: "from", toCol: "to" }) : E ? x = Xt(l) : x = Et({
1430
1430
  points: l,
1431
- isCategorical: d === Ge,
1431
+ isCategorical: d === Be,
1432
1432
  property: u,
1433
1433
  chartType: g,
1434
1434
  template: i
@@ -1437,25 +1437,25 @@ function Kn({ config: e, graph: n, holeOptions: t = [], propertyOptions: r = [],
1437
1437
  console.error("Plot build error", O), b((O == null ? void 0 : O.message) || "Plot build error");
1438
1438
  return;
1439
1439
  }
1440
- if ((!(D != null && D.data) || D.data.length === 0) && !h)
1440
+ if ((!(x != null && x.data) || x.data.length === 0) && !h)
1441
1441
  return;
1442
- const B = {
1442
+ const H = {
1443
1443
  displayModeBar: !0,
1444
1444
  responsive: !0,
1445
1445
  useResizeHandler: !0,
1446
1446
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
1447
1447
  };
1448
1448
  try {
1449
- b(""), Ee.react(E, D.data, D.layout, B), requestAnimationFrame(() => {
1450
- E && E.parentElement && Ee.Plots.resize(E);
1449
+ b(""), Ae.react(A, x.data, x.layout, H), requestAnimationFrame(() => {
1450
+ A && A.parentElement && Ae.Plots.resize(A);
1451
1451
  });
1452
1452
  } catch (O) {
1453
1453
  console.error("Plot render error", O), b((O == null ? void 0 : O.message) || "Plot render error");
1454
1454
  }
1455
1455
  return () => {
1456
- if (E)
1456
+ if (A)
1457
1457
  try {
1458
- Ee.purge(E);
1458
+ Ae.purge(A);
1459
1459
  } catch (O) {
1460
1460
  console.warn("Plot purge error", O);
1461
1461
  }
@@ -1463,237 +1463,237 @@ function Kn({ config: e, graph: n, holeOptions: t = [], propertyOptions: r = [],
1463
1463
  }, [a, u, g, d, l, i]), ne(() => {
1464
1464
  const h = o.current;
1465
1465
  if (!h || typeof ResizeObserver > "u") return;
1466
- const v = new ResizeObserver(() => {
1466
+ const E = new ResizeObserver(() => {
1467
1467
  try {
1468
- h && h.data && Ee.Plots.resize(h);
1469
- } catch (E) {
1470
- console.warn("Plot resize error", E);
1468
+ h && h.data && Ae.Plots.resize(h);
1469
+ } catch (A) {
1470
+ console.warn("Plot resize error", A);
1471
1471
  }
1472
1472
  });
1473
- return v.observe(h), () => v.disconnect();
1474
- }, []), !a || !u ? /* @__PURE__ */ C("div", { className: "plot-card empty", children: /* @__PURE__ */ C("div", { className: "placeholder", children: e != null && e.holeId ? n != null && n.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== Pe && d !== Ve && l.length === 0 ? /* @__PURE__ */ C("div", { className: "plot-card empty", children: /* @__PURE__ */ C("div", { className: "placeholder", children: "No data" }) }) : y ? /* @__PURE__ */ C("div", { className: "plot-card empty", children: /* @__PURE__ */ W("div", { className: "placeholder", children: [
1473
+ return E.observe(h), () => E.disconnect();
1474
+ }, []), !a || !u ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: e != null && e.holeId ? n != null && n.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== Pe && d !== Ge && l.length === 0 ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: "No data" }) }) : y ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ W("div", { className: "placeholder", children: [
1475
1475
  "Plot error: ",
1476
1476
  y
1477
1477
  ] }) }) : /* @__PURE__ */ W("div", { className: "plot-card", children: [
1478
- /* @__PURE__ */ C("div", { className: "plot-title", children: /* @__PURE__ */ C(
1478
+ /* @__PURE__ */ S("div", { className: "plot-title", children: /* @__PURE__ */ S(
1479
1479
  "select",
1480
1480
  {
1481
1481
  className: "plot-select",
1482
1482
  value: m,
1483
- onChange: (h) => s && s({ holeId: h.target.value }),
1483
+ onChange: (h) => r && r({ holeId: h.target.value }),
1484
1484
  children: t.map((h) => {
1485
- const v = typeof h == "string" ? h : h.holeId, E = typeof h == "string" ? h : h.label || h.holeId;
1486
- return /* @__PURE__ */ C("option", { value: v, children: E }, v);
1485
+ const E = typeof h == "string" ? h : h.holeId, A = typeof h == "string" ? h : h.label || h.holeId;
1486
+ return /* @__PURE__ */ S("option", { value: E, children: A }, E);
1487
1487
  })
1488
1488
  }
1489
1489
  ) }),
1490
1490
  /* @__PURE__ */ W("div", { className: "plot-controls column", children: [
1491
- r.length > 0 && /* @__PURE__ */ C(
1491
+ s.length > 0 && /* @__PURE__ */ S(
1492
1492
  "select",
1493
1493
  {
1494
1494
  className: "plot-select",
1495
1495
  value: u,
1496
- onChange: (h) => s && s({ property: h.target.value }),
1497
- children: r.map((h) => /* @__PURE__ */ C("option", { value: h, children: h }, h))
1496
+ onChange: (h) => r && r({ property: h.target.value }),
1497
+ children: s.map((h) => /* @__PURE__ */ S("option", { value: h, children: h }, h))
1498
1498
  }
1499
1499
  ),
1500
- f.length > 1 && /* @__PURE__ */ C(
1500
+ f.length > 1 && /* @__PURE__ */ S(
1501
1501
  "select",
1502
1502
  {
1503
1503
  className: "plot-select",
1504
1504
  value: g,
1505
- onChange: (h) => s && s({ chartType: h.target.value }),
1506
- children: f.map((h) => /* @__PURE__ */ C("option", { value: h.value, children: h.label }, h.value))
1505
+ onChange: (h) => r && r({ chartType: h.target.value }),
1506
+ children: f.map((h) => /* @__PURE__ */ S("option", { value: h.value, children: h.label }, h.value))
1507
1507
  }
1508
1508
  )
1509
1509
  ] }),
1510
- /* @__PURE__ */ C("div", { className: "plotly-chart", ref: o })
1510
+ /* @__PURE__ */ S("div", { className: "plotly-chart", ref: o })
1511
1511
  ] });
1512
1512
  }
1513
1513
  function Ze(e, n) {
1514
1514
  if (!(n != null && n.length)) return e;
1515
- const t = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
1516
- for (const r of n) {
1517
- const s = r.id || r.holeId;
1518
- if (s)
1519
- if (t.has(s)) {
1520
- const i = t.get(s);
1521
- t.set(s, { ...i, points: [...i.points || [], ...r.points || []] });
1515
+ const t = new Map(e.map((s) => [s.id || s.holeId, { ...s }]));
1516
+ for (const s of n) {
1517
+ const r = s.id || s.holeId;
1518
+ if (r)
1519
+ if (t.has(r)) {
1520
+ const i = t.get(r);
1521
+ t.set(r, { ...i, points: [...i.points || [], ...s.points || []] });
1522
1522
  } else
1523
- t.set(s, r);
1523
+ t.set(r, s);
1524
1524
  }
1525
1525
  return Array.from(t.values());
1526
1526
  }
1527
1527
  function Qt(e, n) {
1528
1528
  if (!e || !n) return [];
1529
- const t = /* @__PURE__ */ new Set(), r = [];
1530
- for (const s of e.points || []) {
1531
- const i = Number(s.from ?? s.samp_from ?? s.depth_from ?? s.from_depth), o = Number(s.to ?? s.samp_to ?? s.depth_to ?? s.to_depth);
1529
+ const t = /* @__PURE__ */ new Set(), s = [];
1530
+ for (const r of e.points || []) {
1531
+ const i = Number(r.from ?? r.samp_from ?? r.depth_from ?? r.from_depth), o = Number(r.to ?? r.samp_to ?? r.depth_to ?? r.to_depth);
1532
1532
  if (!Number.isFinite(i) || !Number.isFinite(o) || o <= i) continue;
1533
1533
  const a = `${i}-${o}`;
1534
- t.has(a) || (t.add(a), r.push({ from: i, to: o, [n]: s[n] ?? "" }));
1534
+ t.has(a) || (t.add(a), s.push({ from: i, to: o, [n]: r[n] ?? "" }));
1535
1535
  }
1536
- return r;
1536
+ return s;
1537
1537
  }
1538
1538
  function Xn({
1539
1539
  initialFocusedHoleId: e = "",
1540
1540
  sourceFile: n = null,
1541
1541
  extraHoles: t = [],
1542
- plotCount: r = 4
1542
+ plotCount: s = 4
1543
1543
  } = {}) {
1544
- const [s, i] = X([]), [o, a] = X([]), [l, u] = X([]), [c, m] = X([]), [d, f] = X([]), [g, y] = X({}), [b, h] = X(""), [v, E] = X([]), [D, B] = X(""), [O, P] = X(e || ""), [z, U] = X([]), p = _e(null);
1544
+ const [r, i] = X([]), [o, a] = X([]), [l, u] = X([]), [c, m] = X([]), [d, f] = X([]), [g, y] = X({}), [b, h] = X(""), [E, A] = X([]), [x, H] = X(""), [O, P] = X(e || ""), [R, V] = X([]), p = _e(null);
1545
1545
  ne(() => {
1546
- !n || p.current === n || (p.current = n, Pt(n).then((I) => {
1547
- if (!I) return;
1548
- const N = Array.from(new Map(I.map((x) => [x.holeId, x])).values());
1549
- a(N), E(st({
1550
- holeIds: N.map((x) => x.holeId),
1546
+ !n || p.current === n || (p.current = n, Pt(n).then((v) => {
1547
+ if (!v) return;
1548
+ const N = Array.from(new Map(v.map((D) => [D.holeId, D])).values());
1549
+ a(N), A(rt({
1550
+ holeIds: N.map((D) => D.holeId),
1551
1551
  focusedHoleId: O,
1552
- plotCount: r,
1552
+ plotCount: s,
1553
1553
  defaultProp: "",
1554
1554
  categoricalProps: c,
1555
1555
  commentProps: d,
1556
1556
  numericDefaultChartType: "markers+line"
1557
1557
  }));
1558
- }).catch((I) => {
1559
- console.info("Assay metadata load skipped:", I.message);
1558
+ }).catch((v) => {
1559
+ console.info("Assay metadata load skipped:", v.message);
1560
1560
  }));
1561
- }, [n, O, r, c, d]), ne(() => {
1561
+ }, [n, O, s, c, d]), ne(() => {
1562
1562
  if (!(t != null && t.length)) return;
1563
- const I = t.map((N) => ({ holeId: N.id || N.holeId })).filter((N) => N.holeId);
1563
+ const v = t.map((N) => ({ holeId: N.id || N.holeId })).filter((N) => N.holeId);
1564
1564
  a((N) => {
1565
- const x = new Set(N.map((L) => L.holeId)), $ = I.filter((L) => !x.has(L.holeId));
1566
- return $.length ? [...N, ...$] : N;
1565
+ const D = new Set(N.map((L) => L.holeId)), F = v.filter((L) => !D.has(L.holeId));
1566
+ return F.length ? [...N, ...F] : N;
1567
1567
  });
1568
1568
  }, [t]), ne(() => {
1569
- B((I) => I && I.startsWith("Loading ") && I.includes(" for hole ") ? I : "");
1570
- }, [v]), ne(() => {
1569
+ H((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
1570
+ }, [E]), ne(() => {
1571
1571
  if (!o.length) {
1572
- E([]);
1572
+ A([]);
1573
1573
  return;
1574
1574
  }
1575
- const I = rt(o.map((N) => N.holeId), O);
1576
- E((N) => Array.from({ length: r }).map(($, L) => {
1575
+ const v = st(o.map((N) => N.holeId), O);
1576
+ A((N) => Array.from({ length: s }).map((F, L) => {
1577
1577
  var K;
1578
- const H = N[L] || {}, G = o.some((ae) => ae.holeId === H.holeId) ? H.holeId : I[L] || ((K = o[L]) == null ? void 0 : K.holeId) || "", F = H.property || b, q = Ce({
1579
- property: F,
1580
- chartType: H.chartType,
1578
+ const U = N[L] || {}, B = o.some((ae) => ae.holeId === U.holeId) ? U.holeId : v[L] || ((K = o[L]) == null ? void 0 : K.holeId) || "", $ = U.property || b, q = Se({
1579
+ property: $,
1580
+ chartType: U.chartType,
1581
1581
  categoricalProps: c,
1582
1582
  commentProps: d,
1583
1583
  numericDefaultChartType: "markers+line"
1584
1584
  });
1585
- return { holeId: G, property: F, chartType: q };
1585
+ return { holeId: B, property: $, chartType: q };
1586
1586
  }));
1587
- }, [o, O, b, c, d, r]), ne(() => {
1587
+ }, [o, O, b, c, d, s]), ne(() => {
1588
1588
  if (!n) return;
1589
- v.map((N) => N.holeId).filter(Boolean).forEach((N) => {
1590
- const x = s.some((L) => (L.id || L.holeId) === N), $ = z.includes(N);
1591
- x || $ || (U((L) => [...L, N]), xt(n, N).then((L) => {
1592
- U((H) => H.filter((G) => G !== N)), L && i((H) => {
1593
- const G = Ze(
1594
- [...H.filter((q) => (q.id || q.holeId) !== N), L],
1589
+ E.map((N) => N.holeId).filter(Boolean).forEach((N) => {
1590
+ const D = r.some((L) => (L.id || L.holeId) === N), F = R.includes(N);
1591
+ D || F || (V((L) => [...L, N]), Dt(n, N).then((L) => {
1592
+ V((U) => U.filter((B) => B !== N)), L && i((U) => {
1593
+ const B = Ze(
1594
+ [...U.filter((q) => (q.id || q.holeId) !== N), L],
1595
1595
  t
1596
- ), F = Le(G);
1597
- return u(F.numericProps), m(F.categoricalProps), f(F.commentProps), y(F.columnMeta), !b && F.defaultProp && (h(F.defaultProp), E((q) => q.map((K) => ({
1596
+ ), $ = Le(B);
1597
+ return u($.numericProps), m($.categoricalProps), f($.commentProps), y($.columnMeta), !b && $.defaultProp && (h($.defaultProp), A((q) => q.map((K) => ({
1598
1598
  ...K,
1599
- property: K.property || F.defaultProp,
1600
- chartType: Ce({
1601
- property: K.property || F.defaultProp,
1599
+ property: K.property || $.defaultProp,
1600
+ chartType: Se({
1601
+ property: K.property || $.defaultProp,
1602
1602
  chartType: K.chartType,
1603
- categoricalProps: F.categoricalProps,
1604
- commentProps: F.commentProps,
1603
+ categoricalProps: $.categoricalProps,
1604
+ commentProps: $.commentProps,
1605
1605
  numericDefaultChartType: "markers+line"
1606
1606
  })
1607
- })))), G;
1607
+ })))), B;
1608
1608
  });
1609
1609
  }).catch((L) => {
1610
- console.error(L), U((H) => H.filter((G) => G !== N)), B(L.message || `Error loading hole ${N}`);
1610
+ console.error(L), V((U) => U.filter((B) => B !== N)), H(L.message || `Error loading hole ${N}`);
1611
1611
  }));
1612
1612
  });
1613
- }, [v, n, s, z, b, t]), ne(() => {
1614
- t != null && t.length && i((I) => {
1615
- if (!I.length) {
1616
- const $ = Le(t);
1617
- return u($.numericProps), m($.categoricalProps), f($.commentProps), y($.columnMeta), !b && $.defaultProp && h($.defaultProp), t;
1613
+ }, [E, n, r, R, b, t]), ne(() => {
1614
+ t != null && t.length && i((v) => {
1615
+ if (!v.length) {
1616
+ const F = Le(t);
1617
+ return u(F.numericProps), m(F.categoricalProps), f(F.commentProps), y(F.columnMeta), !b && F.defaultProp && h(F.defaultProp), t;
1618
1618
  }
1619
- const N = Ze(I, t), x = Le(N);
1620
- return u(x.numericProps), m(x.categoricalProps), f(x.commentProps), y(x.columnMeta), !b && x.defaultProp && h(x.defaultProp), N;
1619
+ const N = Ze(v, t), D = Le(N);
1620
+ return u(D.numericProps), m(D.categoricalProps), f(D.commentProps), y(D.columnMeta), !b && D.defaultProp && h(D.defaultProp), N;
1621
1621
  });
1622
1622
  }, [t]);
1623
- const M = ee(
1623
+ const T = ee(
1624
1624
  () => [...l, ...c, ...d],
1625
1625
  [l, c, d]
1626
- ), A = ee(
1627
- () => o.map((I) => ({ holeId: I.holeId, label: I.holeId })).sort((I, N) => I.label.localeCompare(N.label)),
1626
+ ), I = ee(
1627
+ () => o.map((v) => ({ holeId: v.holeId, label: v.holeId })).sort((v, N) => v.label.localeCompare(N.label)),
1628
1628
  [o]
1629
- ), R = ee(() => {
1630
- const I = [...l, ...c, ...d];
1631
- return Array.from({ length: r }).map((N, x) => {
1632
- const $ = v[x] || {}, L = s.find((fe) => (fe.id || fe.holeId) === $.holeId) || null, H = L ? I.filter((fe) => Et(L, fe)) : I;
1633
- let G = $.property || b;
1634
- L && !H.includes(G) && (G = H[0] || G);
1635
- const F = d.includes(G), q = !F && c.includes(G), K = !F && !q && G === "dip", ae = F ? "comment" : K ? "tadpole" : q ? "categorical" : "numeric", be = K ? "tadpole" : $.chartType || (F ? "comment" : q ? "categorical" : "markers+line"), me = $.holeId || (L == null ? void 0 : L.id) || (L == null ? void 0 : L.holeId) || "", Oe = K ? (L == null ? void 0 : L.points) || [] : F ? Qt(L, G) : It(L, G, q);
1629
+ ), z = ee(() => {
1630
+ const v = [...l, ...c, ...d];
1631
+ return Array.from({ length: s }).map((N, D) => {
1632
+ const F = E[D] || {}, L = r.find((fe) => (fe.id || fe.holeId) === F.holeId) || null, U = L ? v.filter((fe) => At(L, fe)) : v;
1633
+ let B = F.property || b;
1634
+ L && !U.includes(B) && (B = U[0] || B);
1635
+ const $ = d.includes(B), q = !$ && c.includes(B), K = !$ && !q && B === "dip", ae = $ ? "comment" : K ? "tadpole" : q ? "categorical" : "numeric", be = K ? "tadpole" : F.chartType || ($ ? "comment" : q ? "categorical" : "markers+line"), me = F.holeId || (L == null ? void 0 : L.id) || (L == null ? void 0 : L.holeId) || "", Oe = K ? (L == null ? void 0 : L.points) || [] : $ ? Qt(L, B) : vt(L, B, q);
1636
1636
  return {
1637
- config: { holeId: me, property: G, chartType: be },
1637
+ config: { holeId: me, property: B, chartType: be },
1638
1638
  hole: L,
1639
- loading: z.includes($.holeId),
1639
+ loading: R.includes(F.holeId),
1640
1640
  isCategorical: q,
1641
- isComment: F,
1641
+ isComment: $,
1642
1642
  isTadpole: K,
1643
1643
  displayType: ae,
1644
1644
  points: Oe,
1645
- propertyOptions: H,
1645
+ propertyOptions: U,
1646
1646
  label: me
1647
1647
  };
1648
1648
  });
1649
- }, [v, s, b, c, d, z, r, l]), w = (I, N) => {
1650
- E((x) => {
1651
- const $ = [...x], H = { ...$[I] || {}, ...N };
1652
- return N.property && (H.chartType = Ce({
1649
+ }, [E, r, b, c, d, R, s, l]), w = (v, N) => {
1650
+ A((D) => {
1651
+ const F = [...D], U = { ...F[v] || {}, ...N };
1652
+ return N.property && (U.chartType = Se({
1653
1653
  property: N.property,
1654
- chartType: H.chartType,
1654
+ chartType: U.chartType,
1655
1655
  categoricalProps: c,
1656
1656
  commentProps: d,
1657
1657
  numericDefaultChartType: "markers+line"
1658
- })), $[I] = H, $;
1658
+ })), F[v] = U, F;
1659
1659
  });
1660
1660
  };
1661
1661
  return {
1662
- error: D,
1662
+ error: x,
1663
1663
  focusedHoleId: O,
1664
1664
  setFocusedHoleId: P,
1665
- setError: B,
1665
+ setError: H,
1666
1666
  holeCount: o.length,
1667
1667
  numericProps: l,
1668
1668
  categoricalProps: c,
1669
1669
  commentProps: d,
1670
1670
  columnMeta: g,
1671
- propertyOptions: M,
1672
- labeledHoleOptions: A,
1673
- traceGraphs: R,
1671
+ propertyOptions: T,
1672
+ labeledHoleOptions: I,
1673
+ traceGraphs: z,
1674
1674
  handleConfigChange: w
1675
1675
  };
1676
1676
  }
1677
1677
  function mt(e) {
1678
1678
  return Array.isArray(e) ? e : [];
1679
1679
  }
1680
- function ze(e) {
1680
+ function Re(e) {
1681
1681
  const n = Number(e);
1682
1682
  return Number.isFinite(n) ? n : void 0;
1683
1683
  }
1684
1684
  function ft(e = {}) {
1685
1685
  return {
1686
1686
  ...e,
1687
- x: ze(e.x),
1688
- y: ze(e.y),
1689
- z: ze(e.z)
1687
+ x: Re(e.x),
1688
+ y: Re(e.y),
1689
+ z: Re(e.z)
1690
1690
  };
1691
1691
  }
1692
1692
  function en(e = [], n = [0, 0], t = 0) {
1693
- const [r, s] = n, i = Number(t) * Math.PI / 180, o = Math.cos(i), a = Math.sin(i);
1693
+ const [s, r] = n, i = Number(t) * Math.PI / 180, o = Math.cos(i), a = Math.sin(i);
1694
1694
  return mt(e).map(ft).map((l) => {
1695
1695
  if (!Number.isFinite(l.x) || !Number.isFinite(l.y)) return { ...l };
1696
- const u = l.x - r, c = l.y - s;
1696
+ const u = l.x - s, c = l.y - r;
1697
1697
  return {
1698
1698
  ...l,
1699
1699
  along: u * a + c * o,
@@ -1701,32 +1701,32 @@ function en(e = [], n = [0, 0], t = 0) {
1701
1701
  };
1702
1702
  });
1703
1703
  }
1704
- function tn(e = [], n = [0, 0], t = 0, r = 50) {
1705
- const s = en(e, n, t), i = 0.5 * Number(r || 0);
1706
- return !Number.isFinite(i) || i <= 0 ? s : s.filter((o) => Number.isFinite(o.across) && Math.abs(o.across) <= i);
1704
+ function tn(e = [], n = [0, 0], t = 0, s = 50) {
1705
+ const r = en(e, n, t), i = 0.5 * Number(s || 0);
1706
+ return !Number.isFinite(i) || i <= 0 ? r : r.filter((o) => Number.isFinite(o.across) && Math.abs(o.across) <= i);
1707
1707
  }
1708
1708
  function Zn(e = [], n = null, t = null) {
1709
- let r = mt(e).map(ft);
1709
+ let s = mt(e).map(ft);
1710
1710
  if (Array.isArray(n) && n.length === 2) {
1711
- const [s, i] = n;
1712
- r = r.filter((o) => Number.isFinite(o.z) && o.z <= Number(s) && o.z >= Number(i));
1711
+ const [r, i] = n;
1712
+ s = s.filter((o) => Number.isFinite(o.z) && o.z <= Number(r) && o.z >= Number(i));
1713
1713
  }
1714
- return t && (r = r.map((s) => ({
1715
- ...s,
1716
- color_value: s == null ? void 0 : s[t]
1717
- }))), r;
1718
- }
1719
- function Jn(e = [], n = [0, 0], t = 0, r = 50, s = null) {
1720
- let i = tn(e, n, t, r);
1721
- return s && (i = i.map((o) => ({
1714
+ return t && (s = s.map((r) => ({
1715
+ ...r,
1716
+ color_value: r == null ? void 0 : r[t]
1717
+ }))), s;
1718
+ }
1719
+ function Jn(e = [], n = [0, 0], t = 0, s = 50, r = null) {
1720
+ let i = tn(e, n, t, s);
1721
+ return r && (i = i.map((o) => ({
1722
1722
  ...o,
1723
- color_value: o == null ? void 0 : o[s]
1723
+ color_value: o == null ? void 0 : o[r]
1724
1724
  }))), i;
1725
1725
  }
1726
- function Be(e) {
1726
+ function He(e) {
1727
1727
  return Array.isArray(e) ? e : [];
1728
1728
  }
1729
- function He(e = {}) {
1729
+ function Ue(e = {}) {
1730
1730
  return e.hole_id ?? e.holeId ?? e.id;
1731
1731
  }
1732
1732
  function ue(e, n = void 0) {
@@ -1735,62 +1735,62 @@ function ue(e, n = void 0) {
1735
1735
  }
1736
1736
  function Qn(e = [], n = null) {
1737
1737
  const t = /* @__PURE__ */ new Map();
1738
- Be(e).forEach((s) => {
1739
- const i = He(s);
1738
+ He(e).forEach((r) => {
1739
+ const i = Ue(r);
1740
1740
  if (i == null || `${i}`.trim() === "") return;
1741
1741
  const o = `${i}`;
1742
- t.has(o) || t.set(o, []), t.get(o).push(s);
1742
+ t.has(o) || t.set(o, []), t.get(o).push(r);
1743
1743
  });
1744
- const r = [];
1745
- return t.forEach((s, i) => {
1746
- const o = [...s].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1744
+ const s = [];
1745
+ return t.forEach((r, i) => {
1746
+ const o = [...r].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1747
1747
  hole_id: i,
1748
1748
  x: o.map((l) => ue(l.x, 0)),
1749
1749
  y: o.map((l) => ue(l.y, 0)),
1750
1750
  z: o.map((l) => ue(l.z, 0)),
1751
1751
  color: null
1752
1752
  };
1753
- n && (a.color = o.map((l) => l == null ? void 0 : l[n])), r.push(a);
1754
- }), r;
1755
- }
1756
- function er(e = [], n = 1, t = null) {
1757
- return Be(e).map((r) => ({
1758
- hole_id: He(r),
1759
- from: r == null ? void 0 : r.from,
1760
- to: r == null ? void 0 : r.to,
1753
+ n && (a.color = o.map((l) => l == null ? void 0 : l[n])), s.push(a);
1754
+ }), s;
1755
+ }
1756
+ function es(e = [], n = 1, t = null) {
1757
+ return He(e).map((s) => ({
1758
+ hole_id: Ue(s),
1759
+ from: s == null ? void 0 : s.from,
1760
+ to: s == null ? void 0 : s.to,
1761
1761
  radius: n,
1762
- color: t ? r == null ? void 0 : r[t] : null,
1763
- value: t ? r == null ? void 0 : r[t] : null
1762
+ color: t ? s == null ? void 0 : s[t] : null,
1763
+ value: t ? s == null ? void 0 : s[t] : null
1764
1764
  }));
1765
1765
  }
1766
- function tr(e = [], n = null) {
1767
- return n ? Be(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, n)).map((t) => ({
1768
- hole_id: He(t),
1766
+ function ts(e = [], n = null) {
1767
+ return n ? He(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, n)).map((t) => ({
1768
+ hole_id: Ue(t),
1769
1769
  label: t == null ? void 0 : t[n],
1770
1770
  depth: 0.5 * (ue(t == null ? void 0 : t.from, 0) + ue(t == null ? void 0 : t.to, 0))
1771
1771
  })) : [];
1772
1772
  }
1773
- function nr({
1773
+ function ns({
1774
1774
  controlMode: e = "orbit",
1775
1775
  onToggleFly: n = () => {
1776
1776
  },
1777
1777
  onRecenter: t = () => {
1778
1778
  },
1779
- onLookDown: r = () => {
1779
+ onLookDown: s = () => {
1780
1780
  },
1781
- onFit: s = () => {
1781
+ onFit: r = () => {
1782
1782
  },
1783
1783
  darkBackground: i = !1,
1784
1784
  onToggleDarkBackground: o = () => {
1785
1785
  }
1786
1786
  }) {
1787
1787
  return /* @__PURE__ */ W("div", { className: "baselode-3d-controls", children: [
1788
- /* @__PURE__ */ C("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
1789
- /* @__PURE__ */ C("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
1790
- /* @__PURE__ */ C("button", { type: "button", className: "ghost-button", onClick: s, children: "Fit to scene" }),
1791
- /* @__PURE__ */ C("button", { type: "button", className: "ghost-button", onClick: n, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
1788
+ /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
1789
+ /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: s, children: "Look down" }),
1790
+ /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: r, children: "Fit to scene" }),
1791
+ /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: n, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
1792
1792
  /* @__PURE__ */ W("label", { className: "baselode-3d-controls-checkbox", children: [
1793
- /* @__PURE__ */ C(
1793
+ /* @__PURE__ */ S(
1794
1794
  "input",
1795
1795
  {
1796
1796
  type: "checkbox",
@@ -1802,13 +1802,13 @@ function nr({
1802
1802
  ] })
1803
1803
  ] });
1804
1804
  }
1805
- function rr({
1805
+ function ss({
1806
1806
  properties: e = [],
1807
1807
  selectedProperty: n = "",
1808
1808
  onPropertyChange: t = () => {
1809
1809
  },
1810
- opacity: r = 0.85,
1811
- onOpacityChange: s = () => {
1810
+ opacity: s = 0.85,
1811
+ onOpacityChange: r = () => {
1812
1812
  },
1813
1813
  propertyStats: i = null,
1814
1814
  clickedBlock: o = null,
@@ -1817,7 +1817,7 @@ function rr({
1817
1817
  }) {
1818
1818
  var l, u;
1819
1819
  return /* @__PURE__ */ W("div", { className: "bm-widget", children: [
1820
- /* @__PURE__ */ C("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
1820
+ /* @__PURE__ */ S("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
1821
1821
  /* @__PURE__ */ W(
1822
1822
  "select",
1823
1823
  {
@@ -1826,19 +1826,19 @@ function rr({
1826
1826
  value: n,
1827
1827
  onChange: (c) => t(c.target.value),
1828
1828
  children: [
1829
- e.length === 0 && /* @__PURE__ */ C("option", { value: "", children: "— no attributes —" }),
1830
- e.map((c) => /* @__PURE__ */ C("option", { value: c, children: c }, c))
1829
+ e.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "— no attributes —" }),
1830
+ e.map((c) => /* @__PURE__ */ S("option", { value: c, children: c }, c))
1831
1831
  ]
1832
1832
  }
1833
1833
  ),
1834
1834
  i && i.type === "numeric" && /* @__PURE__ */ W("div", { className: "bm-widget__scale", children: [
1835
- /* @__PURE__ */ C("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = i.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
1836
- /* @__PURE__ */ C("div", { className: "bm-widget__scale-bar" }),
1837
- /* @__PURE__ */ C("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = i.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
1835
+ /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = i.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
1836
+ /* @__PURE__ */ S("div", { className: "bm-widget__scale-bar" }),
1837
+ /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = i.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
1838
1838
  ] }),
1839
- i && i.type === "categorical" && /* @__PURE__ */ C("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
1839
+ i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
1840
1840
  const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
1841
- return /* @__PURE__ */ C(
1841
+ return /* @__PURE__ */ S(
1842
1842
  "span",
1843
1843
  {
1844
1844
  className: "bm-widget__category-chip",
@@ -1850,10 +1850,10 @@ function rr({
1850
1850
  }) }),
1851
1851
  /* @__PURE__ */ W("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
1852
1852
  "Opacity (",
1853
- Math.round(r * 100),
1853
+ Math.round(s * 100),
1854
1854
  "%)"
1855
1855
  ] }),
1856
- /* @__PURE__ */ C(
1856
+ /* @__PURE__ */ S(
1857
1857
  "input",
1858
1858
  {
1859
1859
  id: "bm-opacity-slider",
@@ -1862,14 +1862,14 @@ function rr({
1862
1862
  min: "0",
1863
1863
  max: "1",
1864
1864
  step: "0.01",
1865
- value: r,
1866
- onChange: (c) => s(parseFloat(c.target.value))
1865
+ value: s,
1866
+ onChange: (c) => r(parseFloat(c.target.value))
1867
1867
  }
1868
1868
  ),
1869
1869
  o && /* @__PURE__ */ W("div", { className: "bm-widget__popup", children: [
1870
1870
  /* @__PURE__ */ W("div", { className: "bm-widget__popup-header", children: [
1871
- /* @__PURE__ */ C("span", { children: "Block attributes" }),
1872
- /* @__PURE__ */ C(
1871
+ /* @__PURE__ */ S("span", { children: "Block attributes" }),
1872
+ /* @__PURE__ */ S(
1873
1873
  "button",
1874
1874
  {
1875
1875
  type: "button",
@@ -1880,9 +1880,9 @@ function rr({
1880
1880
  }
1881
1881
  )
1882
1882
  ] }),
1883
- /* @__PURE__ */ C("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ C("tbody", { children: Object.entries(o).map(([c, m]) => /* @__PURE__ */ W("tr", { children: [
1884
- /* @__PURE__ */ C("th", { children: c }),
1885
- /* @__PURE__ */ C("td", { children: m == null ? "—" : String(m) })
1883
+ /* @__PURE__ */ S("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ S("tbody", { children: Object.entries(o).map(([c, m]) => /* @__PURE__ */ W("tr", { children: [
1884
+ /* @__PURE__ */ S("th", { children: c }),
1885
+ /* @__PURE__ */ S("td", { children: m == null ? "—" : String(m) })
1886
1886
  ] }, c)) }) })
1887
1887
  ] })
1888
1888
  ] });
@@ -1892,36 +1892,36 @@ const nn = [
1892
1892
  { minZoom: 4, lodKey: "medium" },
1893
1893
  { minZoom: 7, lodKey: "full" }
1894
1894
  ], ht = 50;
1895
- function rn(e, n, t = nn) {
1895
+ function sn(e, n, t = nn) {
1896
1896
  var i;
1897
- const r = e.lod_urls;
1898
- if (!r || typeof r != "object" || Array.isArray(r))
1897
+ const s = e.lod_urls;
1898
+ if (!s || typeof s != "object" || Array.isArray(s))
1899
1899
  return e.image_url || "";
1900
- let s = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
1900
+ let r = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
1901
1901
  for (const o of t)
1902
- n >= o.minZoom && (s = o.lodKey);
1903
- return r[s] || e.image_url || "";
1902
+ n >= o.minZoom && (r = o.lodKey);
1903
+ return s[r] || e.image_url || "";
1904
1904
  }
1905
- function sn(e) {
1905
+ function rn(e) {
1906
1906
  return [...e].sort((n, t) => (n.from_depth ?? 0) - (t.from_depth ?? 0));
1907
1907
  }
1908
1908
  function on(e) {
1909
1909
  const n = {};
1910
1910
  for (const t of e) {
1911
- const r = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
1912
- n[r] || (n[r] = []), n[r].push(t);
1911
+ const s = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
1912
+ n[s] || (n[s] = []), n[s].push(t);
1913
1913
  }
1914
1914
  return n;
1915
1915
  }
1916
1916
  function an(e, n, t = 10) {
1917
- const r = [];
1918
- if (e >= n || t <= 0) return r;
1919
- const s = Math.ceil(e / t) * t, i = t * 1e-9;
1920
- for (let o = s; o <= n + i; o += t) {
1917
+ const s = [];
1918
+ if (e >= n || t <= 0) return s;
1919
+ const r = Math.ceil(e / t) * t, i = t * 1e-9;
1920
+ for (let o = r; o <= n + i; o += t) {
1921
1921
  const a = Math.round(o * 1e6) / 1e6;
1922
- r.push({ depth: a, label: `${a} m` });
1922
+ s.push({ depth: a, label: `${a} m` });
1923
1923
  }
1924
- return r;
1924
+ return s;
1925
1925
  }
1926
1926
  function ln(e) {
1927
1927
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
@@ -1929,10 +1929,10 @@ function ln(e) {
1929
1929
  function pt(e) {
1930
1930
  return `tray_${String(e).padStart(3, "0")}.jpg`;
1931
1931
  }
1932
- function cn(e, n, t, r, s = "Tray Images", i = pt) {
1933
- const o = (t ?? "").replace(/\/$/, ""), a = (r ?? "").replace(/\/$/, "");
1932
+ function cn(e, n, t, s, r = "Tray Images", i = pt) {
1933
+ const o = (t ?? "").replace(/\/$/, ""), a = (s ?? "").replace(/\/$/, "");
1934
1934
  return n.map((l, u) => {
1935
- const c = l.filename ?? i(u), m = l.photoSet ?? s;
1935
+ const c = l.filename ?? i(u), m = l.photoSet ?? r;
1936
1936
  return {
1937
1937
  hole_id: e,
1938
1938
  from_depth: l.fromDepth,
@@ -1946,67 +1946,67 @@ function cn(e, n, t, r, s = "Tray Images", i = pt) {
1946
1946
  };
1947
1947
  });
1948
1948
  }
1949
- function sr(e, n, t = ht) {
1950
- const r = n / 5;
1951
- return Math.max(1, Math.round(e * t * r));
1949
+ function rs(e, n, t = ht) {
1950
+ const s = n / 5;
1951
+ return Math.max(1, Math.round(e * t * s));
1952
1952
  }
1953
- const Re = 5, Je = 1.12, un = 0.05, dn = 40;
1953
+ const ze = 5, Je = 1.12, un = 0.05, dn = 40;
1954
1954
  function mn({
1955
1955
  photos: e = [],
1956
1956
  holeId: n = "",
1957
1957
  initialZoom: t = 5,
1958
- transform: r,
1959
- onTransformChange: s
1958
+ transform: s,
1959
+ onTransformChange: r
1960
1960
  }) {
1961
- const [i, o] = X({ scale: 1, tx: 0, ty: 0 }), a = r ?? i, l = _e(a);
1961
+ const [i, o] = X({ scale: 1, tx: 0, ty: 0 }), a = s ?? i, l = _e(a);
1962
1962
  l.current = a;
1963
- const u = xe(
1963
+ const u = De(
1964
1964
  (p) => {
1965
- const M = typeof p == "function" ? p(l.current) : p;
1966
- s ? s(M) : o(M);
1965
+ const T = typeof p == "function" ? p(l.current) : p;
1966
+ r ? r(T) : o(T);
1967
1967
  },
1968
- [s]
1969
- ), [c, m] = X(!1), d = _e(null), f = _e(null), g = ee(() => sn(e), [e]), y = ee(() => on(g), [g]), b = ee(() => {
1968
+ [r]
1969
+ ), [c, m] = X(!1), d = _e(null), f = _e(null), g = ee(() => rn(e), [e]), y = ee(() => on(g), [g]), b = ee(() => {
1970
1970
  const p = /* @__PURE__ */ new Set();
1971
- for (const M of e) {
1972
- const A = M.photo_set != null && M.photo_set !== "" ? String(M.photo_set) : "default";
1973
- p.add(A);
1971
+ for (const T of e) {
1972
+ const I = T.photo_set != null && T.photo_set !== "" ? String(T.photo_set) : "default";
1973
+ p.add(I);
1974
1974
  }
1975
1975
  return [...p];
1976
- }, [e]), { minDepth: h, maxDepth: v } = ee(() => {
1976
+ }, [e]), { minDepth: h, maxDepth: E } = ee(() => {
1977
1977
  if (!g.length) return { minDepth: 0, maxDepth: 0 };
1978
- const p = g.map((M) => M.to_depth ?? M.from_depth ?? 0);
1978
+ const p = g.map((T) => T.to_depth ?? T.from_depth ?? 0);
1979
1979
  return {
1980
1980
  minDepth: g[0].from_depth ?? 0,
1981
1981
  maxDepth: Math.max(...p)
1982
1982
  };
1983
- }, [g]), E = ht * Re / 5, D = ee(
1984
- () => Math.max(1, Math.round((v - h) * E)),
1985
- [h, v, E]
1986
- ), B = ee(() => {
1987
- const p = ln(Re);
1988
- return an(h, v, p);
1989
- }, [h, v]), O = 540 * Re / 5, P = ee(
1983
+ }, [g]), A = ht * ze / 5, x = ee(
1984
+ () => Math.max(1, Math.round((E - h) * A)),
1985
+ [h, E, A]
1986
+ ), H = ee(() => {
1987
+ const p = ln(ze);
1988
+ return an(h, E, p);
1989
+ }, [h, E]), O = 540 * ze / 5, P = ee(
1990
1990
  () => Math.max(1, Math.min(10, Math.round(t * a.scale))),
1991
1991
  [t, a.scale]
1992
- ), z = xe((p) => {
1992
+ ), R = De((p) => {
1993
1993
  p.preventDefault();
1994
- const M = p.deltaY < 0 ? Je : 1 / Je, A = f.current.getBoundingClientRect(), R = p.clientX - A.left, w = p.clientY - A.top;
1995
- u((I) => {
1996
- const N = Math.max(un, Math.min(dn, I.scale * M)), x = N / I.scale;
1994
+ const T = p.deltaY < 0 ? Je : 1 / Je, I = f.current.getBoundingClientRect(), z = p.clientX - I.left, w = p.clientY - I.top;
1995
+ u((v) => {
1996
+ const N = Math.max(un, Math.min(dn, v.scale * T)), D = N / v.scale;
1997
1997
  return {
1998
1998
  scale: N,
1999
- tx: R - (R - I.tx) * x,
2000
- ty: w - (w - I.ty) * x
1999
+ tx: z - (z - v.tx) * D,
2000
+ ty: w - (w - v.ty) * D
2001
2001
  };
2002
2002
  });
2003
2003
  }, [u]);
2004
2004
  ne(() => {
2005
2005
  const p = f.current;
2006
2006
  if (p)
2007
- return p.addEventListener("wheel", z, { passive: !1 }), () => p.removeEventListener("wheel", z);
2008
- }, [z]);
2009
- const U = xe((p) => {
2007
+ return p.addEventListener("wheel", R, { passive: !1 }), () => p.removeEventListener("wheel", R);
2008
+ }, [R]);
2009
+ const V = De((p) => {
2010
2010
  p.button === 0 && (p.preventDefault(), d.current = {
2011
2011
  x: p.clientX,
2012
2012
  y: p.clientY,
@@ -2015,28 +2015,28 @@ function mn({
2015
2015
  }, m(!0));
2016
2016
  }, []);
2017
2017
  return ne(() => {
2018
- const p = (A) => {
2018
+ const p = (I) => {
2019
2019
  if (!d.current) return;
2020
- const { tx: R, ty: w, x: I, y: N } = d.current;
2021
- u((x) => ({
2022
- ...x,
2023
- tx: R + (A.clientX - I),
2024
- ty: w + (A.clientY - N)
2020
+ const { tx: z, ty: w, x: v, y: N } = d.current;
2021
+ u((D) => ({
2022
+ ...D,
2023
+ tx: z + (I.clientX - v),
2024
+ ty: w + (I.clientY - N)
2025
2025
  }));
2026
- }, M = () => {
2026
+ }, T = () => {
2027
2027
  d.current = null, m(!1);
2028
2028
  };
2029
- return window.addEventListener("mousemove", p), window.addEventListener("mouseup", M), () => {
2030
- window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", M);
2029
+ return window.addEventListener("mousemove", p), window.addEventListener("mouseup", T), () => {
2030
+ window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", T);
2031
2031
  };
2032
2032
  }, [u]), /* @__PURE__ */ W("div", { className: "core-photo-table", children: [
2033
2033
  /* @__PURE__ */ W("div", { className: "core-photo-controls", children: [
2034
- n && /* @__PURE__ */ C("span", { className: "core-photo-hole-id", children: n }),
2034
+ n && /* @__PURE__ */ S("span", { className: "core-photo-hole-id", children: n }),
2035
2035
  /* @__PURE__ */ W("span", { className: "core-photo-zoom-label", children: [
2036
2036
  Math.round(a.scale * 100),
2037
2037
  "%"
2038
2038
  ] }),
2039
- /* @__PURE__ */ C(
2039
+ /* @__PURE__ */ S(
2040
2040
  "button",
2041
2041
  {
2042
2042
  className: "core-photo-zoom-btn",
@@ -2048,8 +2048,8 @@ function mn({
2048
2048
  )
2049
2049
  ] }),
2050
2050
  e.length > 0 && /* @__PURE__ */ W("div", { className: "core-photo-col-headers", children: [
2051
- /* @__PURE__ */ C("div", { className: "core-photo-ruler-spacer" }),
2052
- b.map((p) => /* @__PURE__ */ C(
2051
+ /* @__PURE__ */ S("div", { className: "core-photo-ruler-spacer" }),
2052
+ b.map((p) => /* @__PURE__ */ S(
2053
2053
  "div",
2054
2054
  {
2055
2055
  className: "core-photo-set-header",
@@ -2059,76 +2059,76 @@ function mn({
2059
2059
  p
2060
2060
  ))
2061
2061
  ] }),
2062
- e.length === 0 ? /* @__PURE__ */ C("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ C(
2062
+ e.length === 0 ? /* @__PURE__ */ S("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ S(
2063
2063
  "div",
2064
2064
  {
2065
2065
  className: `core-photo-scroll${c ? " is-dragging" : ""}`,
2066
2066
  ref: f,
2067
- onMouseDown: U,
2067
+ onMouseDown: V,
2068
2068
  children: /* @__PURE__ */ W(
2069
2069
  "div",
2070
2070
  {
2071
2071
  className: "core-photo-inner",
2072
2072
  style: {
2073
- height: D,
2073
+ height: x,
2074
2074
  transform: `translate(${a.tx}px, ${a.ty}px) scale(${a.scale})`,
2075
2075
  transformOrigin: "0 0"
2076
2076
  },
2077
2077
  children: [
2078
- /* @__PURE__ */ C(
2078
+ /* @__PURE__ */ S(
2079
2079
  "div",
2080
2080
  {
2081
2081
  className: "core-photo-depth-ruler",
2082
- style: { height: D },
2083
- children: B.map(({ depth: p, label: M }) => /* @__PURE__ */ C(
2082
+ style: { height: x },
2083
+ children: H.map(({ depth: p, label: T }) => /* @__PURE__ */ S(
2084
2084
  "div",
2085
2085
  {
2086
2086
  className: "core-photo-depth-marker",
2087
2087
  style: {
2088
- top: Math.round((p - h) * E)
2088
+ top: Math.round((p - h) * A)
2089
2089
  },
2090
- children: M
2090
+ children: T
2091
2091
  },
2092
2092
  p
2093
2093
  ))
2094
2094
  }
2095
2095
  ),
2096
- b.map((p) => /* @__PURE__ */ C(
2096
+ b.map((p) => /* @__PURE__ */ S(
2097
2097
  "div",
2098
2098
  {
2099
2099
  className: "core-photo-col-body",
2100
- style: { height: D, width: O },
2101
- children: y[p].map((M) => {
2102
- const A = M.from_depth ?? 0, R = M.to_depth ?? A, w = Math.round(
2103
- (A - h) * E
2104
- ), I = Math.max(
2100
+ style: { height: x, width: O },
2101
+ children: y[p].map((T) => {
2102
+ const I = T.from_depth ?? 0, z = T.to_depth ?? I, w = Math.round(
2103
+ (I - h) * A
2104
+ ), v = Math.max(
2105
2105
  2,
2106
- Math.round((R - A) * E)
2107
- ), N = rn(M, P);
2106
+ Math.round((z - I) * A)
2107
+ ), N = sn(T, P);
2108
2108
  return /* @__PURE__ */ W(
2109
2109
  "div",
2110
2110
  {
2111
2111
  className: "core-photo-item",
2112
- style: { top: w, height: I, width: O },
2113
- title: `${A}–${R} m`,
2112
+ style: { top: w, height: v, width: O },
2113
+ title: `${I}–${z} m`,
2114
2114
  children: [
2115
- N ? /* @__PURE__ */ C(
2115
+ N ? /* @__PURE__ */ S(
2116
2116
  "img",
2117
2117
  {
2118
2118
  src: N,
2119
- alt: `Core ${A}–${R} m`,
2119
+ alt: `Core ${I}–${z} m`,
2120
2120
  loading: "lazy"
2121
2121
  }
2122
- ) : /* @__PURE__ */ C("div", { className: "core-photo-no-image" }),
2123
- I >= 18 && /* @__PURE__ */ W("span", { className: "core-photo-item-label", children: [
2124
- A,
2122
+ ) : /* @__PURE__ */ S("div", { className: "core-photo-no-image" }),
2123
+ v >= 18 && /* @__PURE__ */ W("span", { className: "core-photo-item-label", children: [
2124
+ I,
2125
2125
  "–",
2126
- R,
2126
+ z,
2127
2127
  " m"
2128
2128
  ] })
2129
2129
  ]
2130
2130
  },
2131
- `${M.hole_id ?? ""}-${A}-${R}-${p}`
2131
+ `${T.hole_id ?? ""}-${I}-${z}-${p}`
2132
2132
  );
2133
2133
  })
2134
2134
  },
@@ -2141,22 +2141,22 @@ function mn({
2141
2141
  )
2142
2142
  ] });
2143
2143
  }
2144
- function or({
2144
+ function os({
2145
2145
  holeId: e = "",
2146
2146
  trays: n = [],
2147
2147
  thumbBaseUrl: t = "",
2148
- fullBaseUrl: r = "",
2149
- photoSet: s = "Tray Images",
2148
+ fullBaseUrl: s = "",
2149
+ photoSet: r = "Tray Images",
2150
2150
  getFilename: i = pt,
2151
2151
  initialZoom: o = 5,
2152
2152
  transform: a,
2153
2153
  onTransformChange: l
2154
2154
  }) {
2155
2155
  const u = ee(
2156
- () => cn(e, n, t, r, s, i),
2157
- [e, n, t, r, s, i]
2156
+ () => cn(e, n, t, s, r, i),
2157
+ [e, n, t, s, r, i]
2158
2158
  );
2159
- return /* @__PURE__ */ C(
2159
+ return /* @__PURE__ */ S(
2160
2160
  mn,
2161
2161
  {
2162
2162
  photos: u,
@@ -2167,7 +2167,7 @@ function or({
2167
2167
  }
2168
2168
  );
2169
2169
  }
2170
- function ir(e) {
2170
+ function is(e) {
2171
2171
  const n = typeof e == "string" ? JSON.parse(e) : e;
2172
2172
  if (n.schema_version !== "1.0")
2173
2173
  throw new Error(
@@ -2175,18 +2175,18 @@ function ir(e) {
2175
2175
  );
2176
2176
  if (!Array.isArray(n.blocks))
2177
2177
  throw new Error('"blocks" must be a JSON array.');
2178
- const t = n.blocks.map((r, s) => {
2179
- if (r.id == null) throw new Error(`Block at index ${s} is missing required field "id".`);
2180
- if (r.name == null) throw new Error(`Block "${r.id}" is missing required field "name".`);
2181
- if (!Array.isArray(r.vertices)) throw new Error(`Block "${r.id}" is missing required field "vertices".`);
2182
- if (!Array.isArray(r.triangles)) throw new Error(`Block "${r.id}" is missing required field "triangles".`);
2178
+ const t = n.blocks.map((s, r) => {
2179
+ if (s.id == null) throw new Error(`Block at index ${r} is missing required field "id".`);
2180
+ if (s.name == null) throw new Error(`Block "${s.id}" is missing required field "name".`);
2181
+ if (!Array.isArray(s.vertices)) throw new Error(`Block "${s.id}" is missing required field "vertices".`);
2182
+ if (!Array.isArray(s.triangles)) throw new Error(`Block "${s.id}" is missing required field "triangles".`);
2183
2183
  return {
2184
- id: r.id,
2185
- name: r.name,
2186
- vertices: r.vertices,
2187
- triangles: r.triangles,
2188
- attributes: r.attributes ?? {},
2189
- material: r.material ?? {}
2184
+ id: s.id,
2185
+ name: s.name,
2186
+ vertices: s.vertices,
2187
+ triangles: s.triangles,
2188
+ attributes: s.attributes ?? {},
2189
+ material: s.material ?? {}
2190
2190
  };
2191
2191
  });
2192
2192
  return {
@@ -2197,19 +2197,19 @@ function ir(e) {
2197
2197
  }
2198
2198
  function fn(e) {
2199
2199
  const n = new Q.BufferGeometry(), t = new Float32Array(e.vertices.length * 3);
2200
- e.vertices.forEach(([s, i, o], a) => {
2201
- t[a * 3] = s, t[a * 3 + 1] = i, t[a * 3 + 2] = o;
2200
+ e.vertices.forEach(([r, i, o], a) => {
2201
+ t[a * 3] = r, t[a * 3 + 1] = i, t[a * 3 + 2] = o;
2202
2202
  }), n.setAttribute("position", new Q.BufferAttribute(t, 3));
2203
- const r = new Uint32Array(e.triangles.length * 3);
2204
- return e.triangles.forEach(([s, i, o], a) => {
2205
- r[a * 3] = s, r[a * 3 + 1] = i, r[a * 3 + 2] = o;
2206
- }), n.setIndex(new Q.BufferAttribute(r, 1)), n;
2203
+ const s = new Uint32Array(e.triangles.length * 3);
2204
+ return e.triangles.forEach(([r, i, o], a) => {
2205
+ s[a * 3] = r, s[a * 3 + 1] = i, s[a * 3 + 2] = o;
2206
+ }), n.setIndex(new Q.BufferAttribute(s, 1)), n;
2207
2207
  }
2208
- function ar(e, n, t = {}) {
2209
- const { defaultOpacity: r = 1 } = t, s = new Q.Group();
2208
+ function as(e, n, t = {}) {
2209
+ const { defaultOpacity: s = 1 } = t, r = new Q.Group();
2210
2210
  return n.blocks.forEach((i) => {
2211
2211
  var y, b;
2212
- const o = fn(i), a = ((y = i.material) == null ? void 0 : y.color) ?? "#888888", l = ((b = i.material) == null ? void 0 : b.opacity) ?? r, u = l < 1, c = new Q.MeshStandardMaterial({
2212
+ const o = fn(i), a = ((y = i.material) == null ? void 0 : y.color) ?? "#888888", l = ((b = i.material) == null ? void 0 : b.opacity) ?? s, u = l < 1, c = new Q.MeshStandardMaterial({
2213
2213
  color: new Q.Color(a),
2214
2214
  opacity: l,
2215
2215
  transparent: u,
@@ -2221,195 +2221,215 @@ function ar(e, n, t = {}) {
2221
2221
  attributes: i.attributes
2222
2222
  };
2223
2223
  const d = new Q.EdgesGeometry(o, 15), f = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), g = new Q.LineSegments(d, f);
2224
- g.visible = !1, m.add(g), s.add(m);
2225
- }), e.add(s), s;
2224
+ g.visible = !1, m.add(g), r.add(m);
2225
+ }), e.add(r), r;
2226
2226
  }
2227
2227
  export {
2228
- ur as ASSAY_COLOR_PALETTE_10,
2229
- At as ASSAY_NON_VALUE_FIELDS,
2228
+ us as ALPHA,
2229
+ ds as ASSAY_COLOR_PALETTE_10,
2230
+ It as ASSAY_NON_VALUE_FIELDS,
2230
2231
  j as AZIMUTH,
2231
- dr as BASELODE_COLORWAY,
2232
- mr as BASELODE_DARK,
2233
- fr as BASELODE_DARK_TEMPLATE,
2234
- hr as BASELODE_DARK_TEMPLATE_NAME,
2235
- pr as BASELODE_DATA_MODEL_DRILL_ASSAY,
2236
- yr as BASELODE_DATA_MODEL_DRILL_COLLAR,
2232
+ ms as BASELODE_COLORWAY,
2233
+ fs as BASELODE_DARK,
2234
+ hs as BASELODE_DARK_TEMPLATE,
2235
+ ps as BASELODE_DARK_TEMPLATE_NAME,
2236
+ ys as BASELODE_DATA_MODEL_DRILL_ASSAY,
2237
+ gs as BASELODE_DATA_MODEL_DRILL_COLLAR,
2237
2238
  _t as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2238
- gr as BASELODE_DATA_MODEL_DRILL_SURVEY,
2239
- br as BASELODE_DATA_MODEL_GEOPHYSICS,
2240
- _r as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2241
- Nr as BASELODE_LIGHT,
2242
- vr as BASELODE_LIGHT_TEMPLATE,
2243
- Er as BASELODE_LIGHT_TEMPLATE_NAME,
2244
- Fe as BASELODE_TEMPLATE,
2245
- Ir as BASELODE_TEMPLATE_NAME,
2239
+ bs as BASELODE_DATA_MODEL_DRILL_SURVEY,
2240
+ _s as BASELODE_DATA_MODEL_GEOPHYSICS,
2241
+ Ns as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2242
+ Es as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2243
+ As as BASELODE_LIGHT,
2244
+ vs as BASELODE_LIGHT_TEMPLATE,
2245
+ Is as BASELODE_LIGHT_TEMPLATE_NAME,
2246
+ $e as BASELODE_TEMPLATE,
2247
+ Ss as BASELODE_TEMPLATE_NAME,
2246
2248
  ht as BASE_PIXELS_PER_METRE,
2247
- Ar as BUILTIN_COLOUR_MAPS,
2248
- nr as Baselode3DControls,
2249
- Cr as Baselode3DScene,
2250
- rr as BlockModelWidget,
2251
- Lr as CHART_OPTIONS,
2252
- Sr as COMMENT_COLUMN_NAMES,
2253
- Mr as COMMODITY_COLOURS,
2254
- Tr as CRS,
2249
+ Ls as BETA,
2250
+ Cs as BUILTIN_COLOUR_MAPS,
2251
+ ns as Baselode3DControls,
2252
+ Ts as Baselode3DScene,
2253
+ ss as BlockModelWidget,
2254
+ Ms as CHART_OPTIONS,
2255
+ Os as COLLAR_ID,
2256
+ Ps as COMMENTS,
2257
+ Ds as COMMENT_COLUMN_NAMES,
2258
+ xs as COMMODITY_COLOURS,
2259
+ Rs as CRS,
2255
2260
  mn as CorePhotoTable,
2256
- or as CorePhotoViewer,
2257
- Or as DEFAULT_COLUMN_MAP,
2261
+ os as CorePhotoViewer,
2262
+ zs as DATASOURCE,
2263
+ Fs as DATASOURCE_HOLE_ID,
2264
+ $s as DATASOURCE_SAMPLE_ID,
2265
+ ks as DATASOURCE_SURFACE_SAMPLE_ID,
2266
+ ws as DATE_END,
2267
+ Hs as DATE_START,
2268
+ Us as DEFAULT_COLUMN_MAP,
2258
2269
  nn as DEFAULT_LOD_BREAKPOINTS,
2259
- V as DEPTH,
2270
+ G as DEPTH,
2260
2271
  Y as DIP,
2261
- Ge as DISPLAY_CATEGORICAL,
2272
+ Be as DISPLAY_CATEGORICAL,
2262
2273
  Pe as DISPLAY_COMMENT,
2263
- Pr as DISPLAY_HIDDEN,
2274
+ Bs as DISPLAY_HIDDEN,
2264
2275
  Nt as DISPLAY_NUMERIC,
2265
- Ve as DISPLAY_TADPOLE,
2276
+ Ge as DISPLAY_TADPOLE,
2266
2277
  pe as EASTING,
2267
- Ie as ELEVATION,
2268
- xr as ERROR_COLOR,
2269
- Dr as FALLBACK_COLOUR,
2270
- zr as FOV_MAX_DEG,
2271
- Rr as FOV_MIN_DEG,
2272
- S as FROM,
2278
+ ve as ELEVATION,
2279
+ Gs as ERROR_COLOR,
2280
+ Vs as EXTRA,
2281
+ js as FALLBACK_COLOUR,
2282
+ Ys as FOV_MAX_DEG,
2283
+ Ws as FOV_MIN_DEG,
2284
+ C as FROM,
2273
2285
  le as GEOLOGY_CODE,
2274
2286
  ce as GEOLOGY_DESCRIPTION,
2287
+ qs as GEOPHYSICS_NULL,
2275
2288
  Qe as GEOPHYSICS_NULL_SENTINEL,
2276
- $r as HIDDEN_COLUMNS,
2289
+ Ks as HIDDEN_COLUMNS,
2277
2290
  _ as HOLE_ID,
2278
- re as LATITUDE,
2279
- Fr as LITHOLOGY_COLOURS,
2280
- se as LONGITUDE,
2281
- ve as MID,
2291
+ Xs as HOLE_TYPE,
2292
+ se as LATITUDE,
2293
+ Zs as LITHOLOGY_COLOURS,
2294
+ re as LONGITUDE,
2295
+ Js as MAX_DEPTH,
2296
+ Ee as MID,
2282
2297
  ye as NORTHING,
2283
- kr as NUMERIC_LINE_COLOR,
2284
- wr as NUMERIC_MARKER_COLOR,
2298
+ Qs as NUMERIC_LINE_COLOR,
2299
+ er as NUMERIC_MARKER_COLOR,
2285
2300
  de as PROJECT_ID,
2286
- Br as STRIKE,
2287
- Hr as STRIP_LOG_DEFAULT_COLOR,
2288
- Gr as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2289
- Vr as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2290
- T as TO,
2301
+ tr as REPORT_NUMBER,
2302
+ nr as SAMPLE_ID,
2303
+ sr as STRIKE,
2304
+ rr as STRIP_LOG_DEFAULT_COLOR,
2305
+ or as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2306
+ ir as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2307
+ ar as SURFACE_SAMPLE_ID,
2308
+ lr as SURFACE_SAMPLE_TYPE,
2309
+ cr as SURVEY_TYPE,
2310
+ M as TO,
2291
2311
  Kn as TracePlot,
2292
- ar as addGradeBlocksToScene,
2293
- Ur as addRasterOverlay,
2294
- jr as alphaBetaToNormal,
2295
- tr as annotationsFromIntervals,
2312
+ as as addGradeBlocksToScene,
2313
+ ur as addRasterOverlay,
2314
+ dr as alphaBetaToNormal,
2315
+ ts as annotationsFromIntervals,
2296
2316
  kn as assembleDataset,
2297
- Tn as attachAssayPositions,
2298
- Sn as balancedTangentialDesurvey,
2299
- Dt as buildAssayState,
2300
- Yr as buildCategoricalStripLogConfig,
2317
+ Mn as attachAssayPositions,
2318
+ Cn as balancedTangentialDesurvey,
2319
+ xt as buildAssayState,
2320
+ mr as buildCategoricalStripLogConfig,
2301
2321
  Zt as buildCommentsConfig,
2302
2322
  an as buildDepthMarkers,
2303
- Wr as buildEqualRangeColorScale,
2304
- It as buildIntervalPoints,
2305
- vt as buildPlotConfig,
2323
+ fr as buildEqualRangeColorScale,
2324
+ vt as buildIntervalPoints,
2325
+ Et as buildPlotConfig,
2306
2326
  qn as buildStrikeDipSymbol,
2307
- qr as buildStripLogGroup,
2308
- Kr as buildStripLogLinePoints,
2309
- Xr as buildStructuralDiscs,
2327
+ hr as buildStripLogGroup,
2328
+ pr as buildStripLogLinePoints,
2329
+ yr as buildStructuralDiscs,
2310
2330
  Wn as buildStructuralStripConfig,
2311
2331
  Xt as buildTadpoleConfig,
2312
- Mn as buildTraces,
2332
+ Tn as buildTraces,
2313
2333
  cn as buildTrayPhotos,
2314
- Zr as buildViewSignature,
2315
- Jr as calculateBlockVolume,
2316
- Qr as calculatePropertyStats,
2334
+ gr as buildViewSignature,
2335
+ br as calculateBlockVolume,
2336
+ _r as calculatePropertyStats,
2317
2337
  bt as classifyColumns,
2318
- es as clearRasterOverlays,
2319
- ts as clearStripLogs,
2320
- Fn as coerceNumeric,
2321
- ns as computeStructuralPositions,
2322
- rs as createRasterOverlay,
2323
- ss as defaultChartType,
2338
+ Nr as clearRasterOverlays,
2339
+ Er as clearStripLogs,
2340
+ $n as coerceNumeric,
2341
+ Ar as computeStructuralPositions,
2342
+ vr as createRasterOverlay,
2343
+ Ir as defaultChartType,
2324
2344
  pt as defaultTrayFilename,
2325
- sr as depthIntervalToPixels,
2345
+ rs as depthIntervalToPixels,
2326
2346
  ln as depthMarkerInterval,
2327
2347
  Le as deriveAssayProps,
2328
- Cn as desurveyTraces,
2329
- os as dipAzimuthToNormal,
2330
- is as dolly,
2331
- as as emitViewChangeIfNeeded,
2332
- ls as filterBlocks,
2333
- $n as filterByProject,
2334
- cs as fitCameraToBounds,
2335
- us as focusOnLastBounds,
2348
+ Sn as desurveyTraces,
2349
+ Sr as dipAzimuthToNormal,
2350
+ Lr as dolly,
2351
+ Cr as emitViewChangeIfNeeded,
2352
+ Tr as filterBlocks,
2353
+ Fn as filterByProject,
2354
+ Mr as fitCameraToBounds,
2355
+ Or as focusOnLastBounds,
2336
2356
  jn as geophysicsToStripLogs,
2337
- ds as getBlockStats,
2338
- ms as getCategoryHexColor,
2357
+ Pr as getBlockStats,
2358
+ Dr as getCategoryHexColor,
2339
2359
  et as getChartOptions,
2340
- fs as getColorForValue,
2341
- hs as getColour,
2342
- ps as getEqualRangeBinIndex,
2343
- ys as getEqualRangeColor,
2344
- gs as getHoleVerticalExtent,
2345
- bs as getRasterOverlay,
2346
- _s as getViewState,
2360
+ xr as getColorForValue,
2361
+ Rr as getColour,
2362
+ zr as getEqualRangeBinIndex,
2363
+ Fr as getEqualRangeColor,
2364
+ $r as getHoleVerticalExtent,
2365
+ kr as getRasterOverlay,
2366
+ wr as getViewState,
2347
2367
  fn as gradeBlockToThreeGeometry,
2348
2368
  on as groupPhotosBySet,
2349
- Gt as groupRowsByHole,
2350
- Et as holeHasData,
2351
- Ns as interpolateTrace,
2352
- er as intervalsAsTubes,
2353
- Rn as joinAssaysToTraces,
2354
- vs as listRasterOverlays,
2355
- In as loadAssayFile,
2356
- xt as loadAssayHole,
2369
+ Bt as groupRowsByHole,
2370
+ At as holeHasData,
2371
+ Hr as interpolateTrace,
2372
+ es as intervalsAsTubes,
2373
+ zn as joinAssaysToTraces,
2374
+ Ur as listRasterOverlays,
2375
+ vn as loadAssayFile,
2376
+ Dt as loadAssayHole,
2357
2377
  Pt as loadAssayMetadata,
2358
- Dn as loadAssays,
2359
- Es as loadBlockModelMetadata,
2378
+ xn as loadAssays,
2379
+ Br as loadBlockModelMetadata,
2360
2380
  Pn as loadCollars,
2361
- zn as loadGeology,
2362
- ir as loadGradeBlocksFromJson,
2363
- xn as loadSurveys,
2364
- Te as loadTable,
2365
- Is as logDataInfo,
2366
- As as logDataWarning,
2367
- Cs as lookDown,
2368
- $t as minimumCurvatureDesurvey,
2369
- Ls as normalizeBlockRow,
2370
- Ss as normalizeBounds,
2371
- vn as normalizeCsvRow,
2372
- Ae as normalizeFieldName,
2373
- Ms as normalizeStripLogOptions,
2374
- Ts as pan,
2375
- Ut as parseAssayCsvTextToHoles,
2376
- Mt as parseAssayHole,
2381
+ Rn as loadGeology,
2382
+ is as loadGradeBlocksFromJson,
2383
+ Dn as loadSurveys,
2384
+ Me as loadTable,
2385
+ Gr as logDataInfo,
2386
+ Vr as logDataWarning,
2387
+ jr as lookDown,
2388
+ Ft as minimumCurvatureDesurvey,
2389
+ Yr as normalizeBlockRow,
2390
+ Wr as normalizeBounds,
2391
+ En as normalizeCsvRow,
2392
+ Ie as normalizeFieldName,
2393
+ qr as normalizeStripLogOptions,
2394
+ Kr as pan,
2395
+ Vt as parseAssayCsvTextToHoles,
2396
+ Tt as parseAssayHole,
2377
2397
  Nn as parseAssayHoleIds,
2378
- St as parseAssayHoleIdsWithAssays,
2379
- Tt as parseAssaysCSV,
2380
- Os as parseBlockModelCSV,
2398
+ Ct as parseAssayHoleIdsWithAssays,
2399
+ Mt as parseAssaysCSV,
2400
+ Xr as parseBlockModelCSV,
2381
2401
  On as parseDrillholesCSV,
2382
2402
  jt as parseGeologyCsvText,
2383
- Un as parseGeophysicsCSV,
2403
+ Vn as parseGeophysicsCSV,
2384
2404
  Yn as parseLasFile,
2385
- Vt as parseStructuralCSV,
2386
- Hn as parseStructuralIntervalsCSV,
2387
- Bn as parseStructuralPointsCSV,
2388
- An as parseSurveyCSV,
2389
- Gn as parseUnifiedDataset,
2390
- En as pickFirstPresent,
2405
+ Gt as parseStructuralCSV,
2406
+ Un as parseStructuralIntervalsCSV,
2407
+ Hn as parseStructuralPointsCSV,
2408
+ In as parseSurveyCSV,
2409
+ Bn as parseUnifiedDataset,
2410
+ An as pickFirstPresent,
2391
2411
  Zn as planView,
2392
2412
  en as projectTraceToSection,
2393
- Ps as recenterCameraToOrigin,
2394
- xs as removeRasterOverlay,
2395
- rt as reorderHoleIds,
2396
- Ds as resolveColourMap,
2413
+ Zr as recenterCameraToOrigin,
2414
+ Jr as removeRasterOverlay,
2415
+ st as reorderHoleIds,
2416
+ Qr as resolveColourMap,
2397
2417
  Jn as sectionView,
2398
2418
  tn as sectionWindow,
2399
- rn as selectPhotoLodUrl,
2400
- zs as setControlMode,
2401
- Rs as setFov,
2402
- $s as setRasterOverlayElevation,
2403
- Fs as setRasterOverlayOpacity,
2404
- ks as setRasterOverlayVisibility,
2405
- ws as setStripLogs,
2406
- Bs as setViewState,
2407
- Vn as significantIntercepts,
2408
- sn as sortPhotosByDepth,
2419
+ sn as selectPhotoLodUrl,
2420
+ eo as setControlMode,
2421
+ to as setFov,
2422
+ no as setRasterOverlayElevation,
2423
+ so as setRasterOverlayOpacity,
2424
+ ro as setRasterOverlayVisibility,
2425
+ oo as setStripLogs,
2426
+ io as setViewState,
2427
+ Gn as significantIntercepts,
2428
+ rn as sortPhotosByDepth,
2409
2429
  ie as standardizeColumns,
2410
2430
  _n as standardizeRowArray,
2411
2431
  Ln as tangentialDesurvey,
2412
- Hs as toError,
2432
+ ao as toError,
2413
2433
  Qn as tracesAsSegments,
2414
2434
  Xn as useDrillholeTraceGrid,
2415
2435
  wn as validateStructuralPoints,