baselode 0.1.22 → 0.1.24

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 Nt, w as U, H as N, P as de, F as M, T as O, c as vt, L as re, a as oe, D as V, A as Y, b as W, E as pe, N as ge, d as Ee, M as ve, G as le, e as ce, B as Et, f as et, g as $e, h as ze, i as tt, j as Ge, k as At, l as nt, m as St, n as Tt, o as Lt, p as It } from "./baselode3dScene-4nzt80B1.js";
2
- import { q as vr, r as Er, s as Ar, t as Sr, u as Tr, v as Lr, x as Ir, y as Cr, z as Mr, C as Pr, I as Or, J as xr, K as Dr, O as Rr, Q as zr, R as Fr, S as $r, U as kr, V as wr, W as Ur, X as Hr, Y as Gr, Z as Br, $ as Vr, a0 as jr, a1 as Yr, a2 as Wr, a3 as qr, a4 as Xr, a5 as Kr, a6 as Zr, a7 as Jr, a8 as Qr, a9 as eo, aa as to, ab as no, ac as ro, ad as oo, ae as so, af as io, ag as ao, ah as lo, ai as co, aj as uo, ak as mo, al as fo, am as ho, an as po, ao as go, ap as bo, aq as yo, ar as _o, as as No, at as vo, au as Eo, av as Ao, aw as So, ax as To, ay as Lo, az as Io, aA as Co, aB as Mo, aC as Po, aD as Oo, aE as xo, aF as Do, aG as Ro, aH as zo, aI as Fo, aJ as $o, aK as ko, aL as wo, aM as Uo, aN as Ho, aO as Go, aP as Bo, aQ as Vo, aR as jo, aS as Yo, aT as Wo, aU as qo, aV as Xo, aW as Ko, aX as Zo, aY as Jo, aZ as Qo, a_ as es, a$ as ts, b0 as ns, b1 as rs, b2 as os, b3 as ss, b4 as is, b5 as as, b6 as ls, b7 as cs, b8 as us, b9 as ds, ba as ms, bb as fs, bc as hs, bd as ps, be as gs, bf as bs, bg as ys, bh as _s, bi as Ns, bj as vs, bk as Es, bl as As } from "./baselode3dScene-4nzt80B1.js";
1
+ import { _ as Ot, w as G, H as N, P as fe, F as S, T as M, c as Dt, L as se, a as oe, D as j, A as Y, b as W, E as be, N as ye, d as Se, M as Ae, G as ce, e as ue, B as Pt, f as it, g as at, h as Ue, i as we, j as lt, k as We, l as Rt, m as ct, n as $t, o as kt, p as Ct, q as zt } from "./baselode3dScene-vx7nOB46.js";
2
+ import { r as ts, s as ns, t as rs, u as ss, v as os, x as is, y as as, z as ls, C as cs, I as us, J as ds, K as fs, O as ms, Q as hs, R as ps, S as gs, U as bs, V as ys, W as _s, X as Ns, Y as vs, Z as Es, $ as Is, a0 as As, a1 as Ss, a2 as Ts, a3 as xs, a4 as Ls, a5 as Ms, a6 as Os, a7 as Ds, a8 as Ps, a9 as Rs, aa as $s, ab as ks, ac as Cs, ad as zs, ae as Fs, af as ws, ag as Hs, ah as Bs, ai as Us, aj as Gs, ak as js, al as Vs, am as Ys, an as Ws, ao as qs, ap as Xs, aq as Ks, ar as Zs, as as Js, at as Qs, au as eo, av as to, aw as no, ax as ro, ay as so, az as oo, aA as io, aB as ao, aC as lo, aD as co, aE as uo, aF as fo, aG as mo, aH as ho, aI as po, aJ as go, aK as bo, aL as yo, aM as _o, aN as No, aO as vo, aP as Eo, aQ as Io, aR as Ao, aS as So, aT as To, aU as xo, aV as Lo, aW as Mo, aX as Oo, aY as Do, aZ as Po, a_ as Ro, a$ as $o, b0 as ko, b1 as Co, b2 as zo, b3 as Fo, b4 as wo, b5 as Ho, b6 as Bo, b7 as Uo, b8 as Go, b9 as jo, ba as Vo, bb as Yo, bc as Wo, bd as qo, be as Xo, bf as Ko, bg as Zo, bh as Jo, bi as Qo, bj as ei, bk as ti, bl as ni } from "./baselode3dScene-vx7nOB46.js";
3
3
  import J from "papaparse";
4
- import { jsxs as w, jsx as S, Fragment as Ct } from "react/jsx-runtime";
5
- import { useRef as ye, useState as K, useEffect as te, useMemo as ee, useCallback as Pe } from "react";
6
- import Oe from "plotly.js-dist-min";
4
+ import { jsxs as U, jsx as T, Fragment as Ft } from "react/jsx-runtime";
5
+ import { useRef as Ne, useState as K, useEffect as te, useMemo as ee, useCallback as $e } from "react";
6
+ import ke from "plotly.js-dist-min";
7
7
  import * as Q from "three";
8
- function Ae(e) {
8
+ function Te(e) {
9
9
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
10
10
  }
11
- function ie(e, n = null, t = null) {
12
- const r = { ...Nt };
11
+ function ae(e, r = null, t = null) {
12
+ const n = { ...Ot };
13
13
  if (t) {
14
- for (const [i, s] of Object.entries(t))
15
- if (i != null && s != null) {
16
- const a = Ae(i), l = Ae(s);
17
- r[a] = l;
14
+ for (const [o, i] of Object.entries(t))
15
+ if (o != null && i != null) {
16
+ const a = Te(o), l = Te(i);
17
+ n[a] = l;
18
18
  }
19
19
  }
20
- const o = {};
21
- for (const [i, s] of Object.entries(e)) {
22
- const a = Ae(i), l = r[a] || a;
23
- o[l] = s;
20
+ const s = {};
21
+ for (const [o, i] of Object.entries(e)) {
22
+ const a = Te(o), l = n[a] || a;
23
+ s[l] = i;
24
24
  }
25
- return o;
25
+ return s;
26
26
  }
27
- function Pn(e, n = null, t = null) {
28
- return e.map((r) => ie(r, n, t));
27
+ function Qn(e, r = null, t = null) {
28
+ return e.map((n) => ae(n, r, t));
29
29
  }
30
- const Mt = /* @__PURE__ */ new Set([
30
+ const wt = /* @__PURE__ */ new Set([
31
31
  "hole_id",
32
32
  "holeid",
33
33
  "id",
@@ -59,84 +59,84 @@ const Mt = /* @__PURE__ */ new Set([
59
59
  "todepth",
60
60
  "comment",
61
61
  "z"
62
- ]), Ie = (e, n = null) => ie(e, null, n);
63
- function Pt(e) {
62
+ ]), De = (e, r = null) => ae(e, null, r);
63
+ function Ht(e) {
64
64
  return { holeId: e[N] };
65
65
  }
66
- function rt(e, n = null) {
67
- const t = e[N], r = t !== void 0 ? `${t}`.trim() : "";
68
- if (!r) return null;
69
- const o = e[de] || e.project || e.project_code, i = Number(e[M]), s = Number(e[O]);
70
- return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
71
- holeId: r,
72
- project: o,
73
- from: i,
74
- to: s,
66
+ function ut(e, r = null) {
67
+ const t = e[N], n = t !== void 0 ? `${t}`.trim() : "";
68
+ if (!n) return null;
69
+ const s = e[fe] || e.project || e.project_code, o = Number(e[S]), i = Number(e[M]);
70
+ return !Number.isFinite(o) || !Number.isFinite(i) || i <= o ? null : {
71
+ holeId: n,
72
+ project: s,
73
+ from: o,
74
+ to: i,
75
75
  ...e
76
76
  };
77
77
  }
78
- function ot(e, n) {
79
- var o;
80
- const t = n.sort((i, s) => i.from - s.from), r = [];
81
- return t.forEach((i) => {
82
- const { from: s, to: a, project: l, ...u } = i, c = {
83
- z: s,
84
- from: s,
78
+ function dt(e, r) {
79
+ var s;
80
+ const t = r.sort((o, i) => o.from - i.from), n = [];
81
+ return t.forEach((o) => {
82
+ const { from: i, to: a, project: l, ...u } = o, c = {
83
+ z: i,
84
+ from: i,
85
85
  to: a,
86
86
  [N]: e,
87
- [de]: l,
87
+ [fe]: l,
88
88
  ...u
89
89
  };
90
- r.push(c), r.push({ ...c, z: a });
91
- }), { id: e, project: (o = t[0]) == null ? void 0 : o.project, points: r };
90
+ n.push(c), n.push({ ...c, z: a });
91
+ }), { id: e, project: (s = t[0]) == null ? void 0 : s.project, points: n };
92
92
  }
93
- function On(e, n = null) {
94
- return new Promise((t, r) => {
95
- const o = /* @__PURE__ */ new Set();
93
+ function er(e, r = null) {
94
+ return new Promise((t, n) => {
95
+ const s = /* @__PURE__ */ new Set();
96
96
  J.parse(e, {
97
97
  header: !0,
98
98
  dynamicTyping: !0,
99
99
  skipEmptyLines: !0,
100
- step: (i) => {
101
- const a = Ie(i.data, n)[N];
102
- a !== void 0 && `${a}`.trim() !== "" && o.add(`${a}`.trim());
100
+ step: (o) => {
101
+ const a = De(o.data, r)[N];
102
+ a !== void 0 && `${a}`.trim() !== "" && s.add(`${a}`.trim());
103
103
  },
104
- complete: () => t(Array.from(o)),
105
- error: (i) => r(U("parseAssayHoleIds", i))
104
+ complete: () => t(Array.from(s)),
105
+ error: (o) => n(G("parseAssayHoleIds", o))
106
106
  });
107
107
  });
108
108
  }
109
- function Ot(e) {
110
- return Object.entries(e || {}).some(([n, t]) => !(Mt.has(n) || t == null || typeof t == "string" && t.trim() === ""));
109
+ function Bt(e) {
110
+ return Object.entries(e || {}).some(([r, t]) => !(wt.has(r) || t == null || typeof t == "string" && t.trim() === ""));
111
111
  }
112
- function xt(e, n = null) {
113
- return new Promise((t, r) => {
114
- const o = /* @__PURE__ */ new Map();
112
+ function Ut(e, r = null) {
113
+ return new Promise((t, n) => {
114
+ const s = /* @__PURE__ */ new Map();
115
115
  J.parse(e, {
116
116
  header: !0,
117
117
  dynamicTyping: !0,
118
118
  skipEmptyLines: !0,
119
- step: (i) => {
120
- const s = Ie(i.data, n);
121
- if (!Ot(s)) return;
122
- const l = Pt(s).holeId;
119
+ step: (o) => {
120
+ const i = De(o.data, r);
121
+ if (!Bt(i)) return;
122
+ const l = Ht(i).holeId;
123
123
  if (l !== void 0 && `${l}`.trim() !== "") {
124
124
  const u = `${l}`.trim();
125
- o.has(u) || o.set(u, {
125
+ s.has(u) || s.set(u, {
126
126
  holeId: u
127
127
  });
128
128
  }
129
129
  },
130
- complete: () => t(Array.from(o.values())),
131
- error: (i) => r(U("parseAssayHoleIdsWithAssays", i))
130
+ complete: () => t(Array.from(s.values())),
131
+ error: (o) => n(G("parseAssayHoleIdsWithAssays", o))
132
132
  });
133
133
  });
134
134
  }
135
- function Dt(e, n, t = null, r = null) {
136
- return new Promise((o, i) => {
137
- const s = `${n}`.trim();
138
- if (!s) {
139
- i(U("parseAssayHole", new Error("Missing hole id")));
135
+ function Gt(e, r, t = null, n = null) {
136
+ return new Promise((s, o) => {
137
+ const i = `${r}`.trim();
138
+ if (!i) {
139
+ o(G("parseAssayHole", new Error("Missing hole id")));
140
140
  return;
141
141
  }
142
142
  const a = [];
@@ -145,421 +145,421 @@ function Dt(e, n, t = null, r = null) {
145
145
  dynamicTyping: !0,
146
146
  skipEmptyLines: !0,
147
147
  step: (l) => {
148
- const u = Ie(l.data, r), c = rt(u, r);
149
- c && `${c.holeId}`.trim() === s && a.push(c);
148
+ const u = De(l.data, n), c = ut(u, n);
149
+ c && `${c.holeId}`.trim() === i && a.push(c);
150
150
  },
151
151
  complete: () => {
152
152
  if (!a.length) {
153
- o(null);
153
+ s(null);
154
154
  return;
155
155
  }
156
- const l = ot(s, a);
157
- o(l);
156
+ const l = dt(i, a);
157
+ s(l);
158
158
  },
159
- error: (l) => i(U("parseAssayHole", l))
159
+ error: (l) => o(G("parseAssayHole", l))
160
160
  });
161
161
  });
162
162
  }
163
- function Rt(e, n = null, t = null) {
164
- return new Promise((r, o) => {
163
+ function jt(e, r = null, t = null) {
164
+ return new Promise((n, s) => {
165
165
  J.parse(e, {
166
166
  header: !0,
167
167
  dynamicTyping: !0,
168
168
  skipEmptyLines: !0,
169
- complete: (i) => {
170
- const s = /* @__PURE__ */ new Map();
171
- i.data.forEach((l) => {
172
- const u = Ie(l, t), c = rt(u, t);
173
- c && (s.has(c.holeId) || s.set(c.holeId, []), s.get(c.holeId).push(c));
169
+ complete: (o) => {
170
+ const i = /* @__PURE__ */ new Map();
171
+ o.data.forEach((l) => {
172
+ const u = De(l, t), c = ut(u, t);
173
+ c && (i.has(c.holeId) || i.set(c.holeId, []), i.get(c.holeId).push(c));
174
174
  });
175
- const a = Array.from(s.entries()).map(([l, u]) => ot(l, u));
176
- r({ holes: a });
175
+ const a = Array.from(i.entries()).map(([l, u]) => dt(l, u));
176
+ n({ holes: a });
177
177
  },
178
- error: (i) => o(U("parseAssaysCSV", i))
178
+ error: (o) => s(G("parseAssaysCSV", o))
179
179
  });
180
180
  });
181
181
  }
182
- function xn(e = {}) {
183
- const n = {};
184
- return Object.entries(e || {}).forEach(([t, r]) => {
185
- t && (n[Ae(t)] = r);
186
- }), n;
182
+ function tr(e = {}) {
183
+ const r = {};
184
+ return Object.entries(e || {}).forEach(([t, n]) => {
185
+ t && (r[Te(t)] = n);
186
+ }), r;
187
187
  }
188
- function Dn(e = {}, n = [], t) {
189
- for (const r of n) {
190
- const o = e[r];
191
- if (o != null && `${o}`.trim() !== "")
192
- return o;
188
+ function nr(e = {}, r = [], t) {
189
+ for (const n of r) {
190
+ const s = e[n];
191
+ if (s != null && `${s}`.trim() !== "")
192
+ return s;
193
193
  }
194
194
  return t;
195
195
  }
196
- const zt = 4;
197
- function st(e = [], n = "") {
196
+ const Vt = 4;
197
+ function ft(e = [], r = "") {
198
198
  if (!e.length) return [];
199
- if (!n) return e;
200
- const t = e.findIndex((i) => i === n);
199
+ if (!r) return e;
200
+ const t = e.findIndex((o) => o === r);
201
201
  if (t === -1) return e;
202
- const r = e[t], o = e.filter((i, s) => s !== t);
203
- return [r, ...o];
202
+ const n = e[t], s = e.filter((o, i) => i !== t);
203
+ return [n, ...s];
204
204
  }
205
- function Se({
205
+ function xe({
206
206
  property: e = "",
207
- chartType: n = "",
207
+ chartType: r = "",
208
208
  categoricalProps: t = [],
209
- commentProps: r = [],
210
- numericDefaultChartType: o = "markers+line"
209
+ commentProps: n = [],
210
+ numericDefaultChartType: s = "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" ? o : n : n || o;
212
+ return e ? n.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !r || r === "categorical" || r === "comment" || r === "tadpole" ? s : r : r || s;
213
213
  }
214
- function it({
214
+ function mt({
215
215
  holeIds: e = [],
216
- focusedHoleId: n = "",
217
- plotCount: t = zt,
218
- defaultProp: r = "",
219
- categoricalProps: o = [],
220
- commentProps: i = [],
221
- numericDefaultChartType: s = "markers+line"
216
+ focusedHoleId: r = "",
217
+ plotCount: t = Vt,
218
+ defaultProp: n = "",
219
+ categoricalProps: s = [],
220
+ commentProps: o = [],
221
+ numericDefaultChartType: i = "markers+line"
222
222
  } = {}) {
223
- const a = st(e, n);
223
+ const a = ft(e, r);
224
224
  return Array.from({ length: t }).map((l, u) => {
225
- const c = a[u] || e[u] || "", d = Se({
226
- property: r,
225
+ const c = a[u] || e[u] || "", d = xe({
226
+ property: n,
227
227
  chartType: "",
228
- categoricalProps: o,
229
- commentProps: i,
230
- numericDefaultChartType: s
228
+ categoricalProps: s,
229
+ commentProps: o,
230
+ numericDefaultChartType: i
231
231
  });
232
232
  return {
233
233
  holeId: c,
234
- property: r,
234
+ property: n,
235
235
  chartType: d
236
236
  };
237
237
  });
238
238
  }
239
- function Te(e = []) {
240
- const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: r, commentCols: o, byType: i } = vt(n), s = t[0] || r[0] || "";
239
+ function Le(e = []) {
240
+ const r = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: n, commentCols: s, byType: o } = Dt(r), i = t[0] || n[0] || "";
241
241
  return {
242
242
  numericProps: t,
243
- categoricalProps: r,
244
- commentProps: o,
245
- columnMeta: i,
246
- defaultProp: s
243
+ categoricalProps: n,
244
+ commentProps: s,
245
+ columnMeta: o,
246
+ defaultProp: i
247
247
  };
248
248
  }
249
- async function Ft(e, n = null) {
250
- return await xt(e);
249
+ async function Yt(e, r = null) {
250
+ return await Ut(e);
251
251
  }
252
- async function $t(e, n, t = null) {
253
- return await Dt(e, n);
252
+ async function Wt(e, r, t = null) {
253
+ return await Gt(e, r);
254
254
  }
255
- function kt(e = [], n = "") {
255
+ function qt(e = [], r = "") {
256
256
  if (!e.length) return null;
257
- const { numericProps: t, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Te(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = it({
257
+ const { numericProps: t, categoricalProps: n, commentProps: s, columnMeta: o, defaultProp: i } = Le(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = mt({
258
258
  holeIds: a,
259
- focusedHoleId: n,
259
+ focusedHoleId: r,
260
260
  plotCount: 4,
261
- defaultProp: s,
262
- categoricalProps: r,
263
- commentProps: o,
261
+ defaultProp: i,
262
+ categoricalProps: n,
263
+ commentProps: s,
264
264
  numericDefaultChartType: "line"
265
265
  });
266
266
  return {
267
267
  holes: e,
268
268
  numericProps: t,
269
- categoricalProps: r,
270
- commentProps: o,
271
- columnMeta: i,
272
- defaultProp: s,
269
+ categoricalProps: n,
270
+ commentProps: s,
271
+ columnMeta: o,
272
+ defaultProp: i,
273
273
  traceConfigs: l
274
274
  };
275
275
  }
276
- async function Rn(e, n = "", t = null) {
277
- const { holes: r } = await Rt(e, t), o = kt(r, n);
278
- if (!o) throw new Error("No valid assay intervals found.");
279
- return o;
276
+ async function rr(e, r = "", t = null) {
277
+ const { holes: n } = await jt(e, t), s = qt(n, r);
278
+ if (!s) throw new Error("No valid assay intervals found.");
279
+ return s;
280
280
  }
281
- function zn(e, n = null) {
282
- return new Promise((t, r) => {
281
+ function sr(e, r = null) {
282
+ return new Promise((t, n) => {
283
283
  J.parse(e, {
284
284
  header: !0,
285
285
  dynamicTyping: !0,
286
286
  skipEmptyLines: !0,
287
- complete: (o) => {
288
- const i = o.data.map((s) => wt(s, n)).filter((s) => s[N] && Number.isFinite(s[V]) && Number.isFinite(s[W]) && Number.isFinite(s[Y]));
289
- t(i);
287
+ complete: (s) => {
288
+ const o = s.data.map((i) => Xt(i, r)).filter((i) => i[N] && Number.isFinite(i[j]) && Number.isFinite(i[W]) && Number.isFinite(i[Y]));
289
+ t(o);
290
290
  },
291
- error: (o) => r(U("parseSurveyCSV", o))
291
+ error: (s) => n(G("parseSurveyCSV", s))
292
292
  });
293
293
  });
294
294
  }
295
- function wt(e, n = null) {
296
- const t = ie(e, null, n), r = t[N], o = t[de] || t.project || t.project_code, i = he(t[re]), s = he(t[oe]), a = he(t[V]), l = he(t[W]), u = he(t[Y]), c = he(t.maxdepth);
295
+ function Xt(e, r = null) {
296
+ const t = ae(e, null, r), n = t[N], s = t[fe] || t.project || t.project_code, o = ge(t[se]), i = ge(t[oe]), a = ge(t[j]), l = ge(t[W]), u = ge(t[Y]), c = ge(t.maxdepth);
297
297
  return {
298
298
  raw: t,
299
- [N]: r,
300
- [de]: o,
301
- [re]: i,
302
- [oe]: s,
303
- [V]: a,
299
+ [N]: n,
300
+ [fe]: s,
301
+ [se]: o,
302
+ [oe]: i,
303
+ [j]: a,
304
304
  [W]: l,
305
305
  [Y]: u,
306
306
  maxdepth: c,
307
307
  // Legacy field names for backwards compatibility
308
- project_code: o,
309
- latitude: i,
310
- longitude: s,
308
+ project_code: s,
309
+ latitude: o,
310
+ longitude: i,
311
311
  surveydepth: a
312
312
  };
313
313
  }
314
- const he = (e) => {
315
- const n = Number(e);
316
- return Number.isFinite(n) ? n : void 0;
314
+ const ge = (e) => {
315
+ const r = Number(e);
316
+ return Number.isFinite(r) ? r : void 0;
317
317
  };
318
- function Fn(e, n) {
319
- var u, c, d, m;
318
+ function or(e, r) {
319
+ var u, c, d, f;
320
320
  const t = /* @__PURE__ */ new Map();
321
- e.forEach((f) => {
322
- const b = (f[N] || f.holeId || f.id || "").toString().trim();
323
- if (!b) return;
324
- const p = b.toLowerCase();
325
- t.has(p) || t.set(p, f);
321
+ e.forEach((m) => {
322
+ const g = (m[N] || m.holeId || m.id || "").toString().trim();
323
+ if (!g) return;
324
+ const h = g.toLowerCase();
325
+ t.has(h) || t.set(h, m);
326
326
  });
327
- const r = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[re]) ?? 0, o = ((d = e[0]) == null ? void 0 : d.lng) ?? ((m = e[0]) == null ? void 0 : m[oe]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), a = /* @__PURE__ */ new Map();
328
- n.forEach((f) => {
329
- const b = (f[N] || "").toString().trim();
330
- if (!b) return;
331
- const p = b.toLowerCase();
332
- a.has(p) || a.set(p, []), a.get(p).push(f);
327
+ const n = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[se]) ?? 0, s = ((d = e[0]) == null ? void 0 : d.lng) ?? ((f = e[0]) == null ? void 0 : f[oe]) ?? 0, o = 111132, i = 111320 * Math.cos(n * Math.PI / 180), a = /* @__PURE__ */ new Map();
328
+ r.forEach((m) => {
329
+ const g = (m[N] || "").toString().trim();
330
+ if (!g) return;
331
+ const h = g.toLowerCase();
332
+ a.has(h) || a.set(h, []), a.get(h).push(m);
333
333
  });
334
334
  const l = [];
335
- return a.forEach((f, b) => {
336
- const p = t.get(b);
337
- if (!p) return;
338
- const v = f.filter((A) => Number.isFinite(A[V] ?? A.surveydepth)).sort((A, z) => (A[V] ?? A.surveydepth) - (z[V] ?? z.surveydepth));
339
- if (!v.length) return;
340
- const g = p.lat ?? p[re], L = p.lng ?? p[oe], C = 111132, j = 111320 * Math.cos(g * Math.PI / 180), H = (L - o) * s, $ = (g - r) * i, D = [];
341
- let R = 0, G = 0, h = 0;
342
- for (let A = 0; A < v.length; A += 1) {
343
- const z = v[A], E = v[A - 1], _ = z[V] ?? z.surveydepth, y = z[Y] ?? z.azimuth, I = z[W] ?? z.dip;
344
- if (!E) {
345
- D.push({
346
- x: H + R,
347
- y: $ + G,
335
+ return a.forEach((m, g) => {
336
+ const h = t.get(g);
337
+ if (!h) return;
338
+ const y = m.filter((A) => Number.isFinite(A[j] ?? A.surveydepth)).sort((A, C) => (A[j] ?? A.surveydepth) - (C[j] ?? C.surveydepth));
339
+ if (!y.length) return;
340
+ const p = h.lat ?? h[se], E = h.lng ?? h[oe], x = 111132, F = 111320 * Math.cos(p * Math.PI / 180), w = (E - s) * i, k = (p - n) * o, $ = [];
341
+ let P = 0, H = 0, b = 0;
342
+ for (let A = 0; A < y.length; A += 1) {
343
+ const C = y[A], I = y[A - 1], v = C[j] ?? C.surveydepth, _ = C[Y] ?? C.azimuth, D = C[W] ?? C.dip;
344
+ if (!I) {
345
+ $.push({
346
+ x: w + P,
347
+ y: k + H,
348
348
  z: 0,
349
- md: _,
350
- azimuth: y,
351
- dip: I
349
+ md: v,
350
+ azimuth: _,
351
+ dip: D
352
352
  });
353
353
  continue;
354
354
  }
355
- const F = E[V] ?? E.surveydepth, T = E[Y] ?? E.azimuth, x = E[W] ?? E.dip, B = _ - F;
356
- if (B <= 0) continue;
357
- const k = Be(x), q = Be(I), X = Fe(T), ae = Fe(y), _e = Math.acos(
358
- Math.sin(k) * Math.sin(q) * Math.cos(X - ae) + Math.cos(k) * Math.cos(q)
359
- ), me = _e > 1e-6 ? 2 / _e * Math.tan(_e / 2) : 1, Me = 0.5 * B * (Math.sin(k) * Math.cos(X) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * B * (Math.sin(k) * Math.sin(X) + Math.sin(q) * Math.sin(ae)) * me, _t = 0.5 * B * (Math.cos(k) + Math.cos(q)) * me;
360
- R += Me, G += fe, h += _t, D.push({
361
- x: H + R,
362
- y: $ + G,
363
- z: -h,
355
+ const z = I[j] ?? I.surveydepth, O = I[Y] ?? I.azimuth, R = I[W] ?? I.dip, V = v - z;
356
+ if (V <= 0) continue;
357
+ const B = qe(R), q = qe(D), X = He(O), le = He(_), ve = Math.acos(
358
+ Math.sin(B) * Math.sin(q) * Math.cos(X - le) + Math.cos(B) * Math.cos(q)
359
+ ), he = ve > 1e-6 ? 2 / ve * Math.tan(ve / 2) : 1, Re = 0.5 * V * (Math.sin(B) * Math.cos(X) + Math.sin(q) * Math.cos(le)) * he, pe = 0.5 * V * (Math.sin(B) * Math.sin(X) + Math.sin(q) * Math.sin(le)) * he, Mt = 0.5 * V * (Math.cos(B) + Math.cos(q)) * he;
360
+ P += Re, H += pe, b += Mt, $.push({
361
+ x: w + P,
362
+ y: k + H,
363
+ z: -b,
364
364
  // render with z up; depth down
365
- md: _,
366
- azimuth: y,
367
- dip: I
365
+ md: v,
366
+ azimuth: _,
367
+ dip: D
368
368
  });
369
369
  }
370
- const P = D.map((A) => ({
370
+ const L = $.map((A) => ({
371
371
  ...A,
372
- lat: g + A.y / C,
373
- lng: L + A.x / j
372
+ lat: p + A.y / x,
373
+ lng: E + A.x / F
374
374
  }));
375
375
  l.push({
376
- id: p[N] || p.holeId || b,
377
- project: p[de] || p.project_id || p.project || "",
378
- points: P,
379
- collar: p
376
+ id: h[N] || h.holeId || g,
377
+ project: h[fe] || h.project_id || h.project || "",
378
+ points: L,
379
+ collar: h
380
380
  });
381
381
  }), l;
382
382
  }
383
- const Fe = (e) => e * Math.PI / 180, Be = (e) => {
384
- const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), r = Math.min(180, Math.max(0, t));
385
- return Fe(r);
383
+ const He = (e) => e * Math.PI / 180, qe = (e) => {
384
+ const r = Number(e), t = 90 + (Number.isFinite(r) ? r : 0), n = Math.min(180, Math.max(0, t));
385
+ return He(n);
386
386
  };
387
- function ne(e, n = void 0) {
387
+ function ne(e, r = void 0) {
388
388
  const t = Number(e);
389
- return Number.isFinite(t) ? t : n;
389
+ return Number.isFinite(t) ? t : r;
390
390
  }
391
- function Ve(e) {
391
+ function Xe(e) {
392
392
  return e == null ? "" : `${e}`.trim();
393
393
  }
394
- function Le(e = [], n = null) {
395
- const t = n || "hole_id", o = [t, "hole_id", "holeId", "id"].find((i) => e.some((s) => Ve(s == null ? void 0 : s[i])));
396
- if (!o)
397
- throw U("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
394
+ function Me(e = [], r = null) {
395
+ const t = r || "hole_id", s = [t, "hole_id", "holeId", "id"].find((o) => e.some((i) => Xe(i == null ? void 0 : i[o])));
396
+ if (!s)
397
+ throw G("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
398
398
  return {
399
- aliasCol: o,
400
- rows: e.map((i) => ({
401
- ...i,
402
- hole_id: Ve(i == null ? void 0 : i[o])
399
+ aliasCol: s,
400
+ rows: e.map((o) => ({
401
+ ...o,
402
+ hole_id: Xe(o == null ? void 0 : o[s])
403
403
  }))
404
404
  };
405
405
  }
406
- function je(e) {
406
+ function Ke(e) {
407
407
  return Number(e) * Math.PI / 180;
408
408
  }
409
- function xe(e, n) {
410
- const t = je(e), r = je(n), o = Math.cos(r) * Math.sin(t), i = Math.cos(r) * Math.cos(t), s = Math.sin(r) * -1;
411
- return { ca: o, cb: i, cc: s };
409
+ function Ce(e, r) {
410
+ const t = Ke(e), n = Ke(r), s = Math.cos(n) * Math.sin(t), o = Math.cos(n) * Math.cos(t), i = Math.sin(n) * -1;
411
+ return { ca: s, cb: o, cc: i };
412
412
  }
413
- function Ut(e, n, t, r, o, i = "minimum_curvature") {
414
- const s = xe(n, t), a = xe(r, o);
415
- if (i === "tangential")
413
+ function Kt(e, r, t, n, s, o = "minimum_curvature") {
414
+ const i = Ce(r, t), a = Ce(n, s);
415
+ if (o === "tangential")
416
416
  return {
417
- dx: e * s.ca,
418
- dy: e * s.cb,
419
- dz: e * s.cc,
420
- azimuth: n,
417
+ dx: e * i.ca,
418
+ dy: e * i.cb,
419
+ dz: e * i.cc,
420
+ azimuth: r,
421
421
  dip: t
422
422
  };
423
- if (i === "balanced_tangential") {
424
- const d = 0.5 * (n + r), m = 0.5 * (t + o), f = xe(d, m);
423
+ if (o === "balanced_tangential") {
424
+ const d = 0.5 * (r + n), f = 0.5 * (t + s), m = Ce(d, f);
425
425
  return {
426
- dx: e * f.ca,
427
- dy: e * f.cb,
428
- dz: e * f.cc,
426
+ dx: e * m.ca,
427
+ dy: e * m.cb,
428
+ dz: e * m.cc,
429
429
  azimuth: d,
430
- dip: m
430
+ dip: f
431
431
  };
432
432
  }
433
- const l = s.ca * a.ca + s.cb * a.cb + s.cc * a.cc, u = Math.acos(Math.max(-1, Math.min(1, l))), c = u > 1e-6 ? 2 * Math.tan(u / 2) / u : 1;
433
+ const l = i.ca * a.ca + i.cb * a.cb + i.cc * a.cc, u = Math.acos(Math.max(-1, Math.min(1, l))), c = u > 1e-6 ? 2 * Math.tan(u / 2) / u : 1;
434
434
  return {
435
- dx: 0.5 * e * (s.ca + a.ca) * c,
436
- dy: 0.5 * e * (s.cb + a.cb) * c,
437
- dz: 0.5 * e * (s.cc + a.cc) * c,
438
- azimuth: r,
439
- dip: o
435
+ dx: 0.5 * e * (i.ca + a.ca) * c,
436
+ dy: 0.5 * e * (i.cb + a.cb) * c,
437
+ dz: 0.5 * e * (i.cc + a.cc) * c,
438
+ azimuth: n,
439
+ dip: s
440
440
  };
441
441
  }
442
- function ke(e = [], n = [], t = {}) {
442
+ function Ge(e = [], r = [], t = {}) {
443
443
  const {
444
- step: r = 1,
445
- holeIdCol: o = null,
446
- method: i = "minimum_curvature"
447
- } = t, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, a = Le(e, o), l = Le(n, o || a.aliasCol);
444
+ step: n = 1,
445
+ holeIdCol: s = null,
446
+ method: o = "minimum_curvature"
447
+ } = t, i = Number.isFinite(Number(n)) && Number(n) > 0 ? Number(n) : 1, a = Me(e, s), l = Me(r, s || a.aliasCol);
448
448
  if (!a.rows.length || !l.rows.length) return [];
449
449
  const u = /* @__PURE__ */ new Map();
450
- a.rows.forEach((m) => {
451
- !m.hole_id || u.has(m.hole_id) || u.set(m.hole_id, m);
450
+ a.rows.forEach((f) => {
451
+ !f.hole_id || u.has(f.hole_id) || u.set(f.hole_id, f);
452
452
  });
453
453
  const c = /* @__PURE__ */ new Map();
454
- l.rows.forEach((m) => {
455
- m.hole_id && (c.has(m.hole_id) || c.set(m.hole_id, []), c.get(m.hole_id).push(m));
454
+ l.rows.forEach((f) => {
455
+ f.hole_id && (c.has(f.hole_id) || c.set(f.hole_id, []), c.get(f.hole_id).push(f));
456
456
  });
457
457
  const d = [];
458
- return c.forEach((m, f) => {
459
- const b = u.get(f);
460
- if (!b) return;
461
- const p = [...m].map((D) => ({
462
- ...D,
463
- from: ne(D.from),
464
- azimuth: ne(D.azimuth),
465
- dip: ne(D.dip)
466
- })).filter((D) => Number.isFinite(D.from) && Number.isFinite(D.azimuth) && Number.isFinite(D.dip)).sort((D, R) => D.from - R.from);
467
- if (!p.length) return;
468
- let v = ne(b.x, 0), g = ne(b.y, 0), L = ne(b.z, 0), C = p[0].from;
469
- const j = p[0].azimuth, H = p[0].dip, $ = {
470
- hole_id: f,
471
- md: C,
472
- x: v,
473
- y: g,
474
- z: L,
475
- azimuth: j,
476
- dip: H
458
+ return c.forEach((f, m) => {
459
+ const g = u.get(m);
460
+ if (!g) return;
461
+ const h = [...f].map(($) => ({
462
+ ...$,
463
+ from: ne($.from),
464
+ azimuth: ne($.azimuth),
465
+ dip: ne($.dip)
466
+ })).filter(($) => Number.isFinite($.from) && Number.isFinite($.azimuth) && Number.isFinite($.dip)).sort(($, P) => $.from - P.from);
467
+ if (!h.length) return;
468
+ let y = ne(g.x, 0), p = ne(g.y, 0), E = ne(g.z, 0), x = h[0].from;
469
+ const F = h[0].azimuth, w = h[0].dip, k = {
470
+ hole_id: m,
471
+ md: x,
472
+ x: y,
473
+ y: p,
474
+ z: E,
475
+ azimuth: F,
476
+ dip: w
477
477
  };
478
- a.aliasCol !== "hole_id" && b[a.aliasCol] !== void 0 && ($[a.aliasCol] = b[a.aliasCol]), d.push($);
479
- for (let D = 0; D < p.length - 1; D += 1) {
480
- const R = p[D], G = p[D + 1], h = R.from, A = G.from - h;
478
+ a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (k[a.aliasCol] = g[a.aliasCol]), d.push(k);
479
+ for (let $ = 0; $ < h.length - 1; $ += 1) {
480
+ const P = h[$], H = h[$ + 1], b = P.from, A = H.from - b;
481
481
  if (A <= 0) continue;
482
- const z = Math.max(1, Math.ceil(A / s)), E = A / z;
483
- for (let _ = 0; _ < z; _ += 1) {
484
- C += E;
485
- const y = (C - h) / A, I = R.azimuth + y * (G.azimuth - R.azimuth), F = R.dip + y * (G.dip - R.dip), T = Ut(E, R.azimuth, R.dip, G.azimuth, G.dip, i);
486
- v += T.dx, g += T.dy, L += T.dz;
487
- const x = {
488
- hole_id: f,
489
- md: C,
490
- x: v,
491
- y: g,
492
- z: L,
493
- azimuth: i === "minimum_curvature" ? I : T.azimuth,
494
- dip: i === "minimum_curvature" ? F : T.dip
482
+ const C = Math.max(1, Math.ceil(A / i)), I = A / C;
483
+ for (let v = 0; v < C; v += 1) {
484
+ x += I;
485
+ const _ = (x - b) / A, D = P.azimuth + _ * (H.azimuth - P.azimuth), z = P.dip + _ * (H.dip - P.dip), O = Kt(I, P.azimuth, P.dip, H.azimuth, H.dip, o);
486
+ y += O.dx, p += O.dy, E += O.dz;
487
+ const R = {
488
+ hole_id: m,
489
+ md: x,
490
+ x: y,
491
+ y: p,
492
+ z: E,
493
+ azimuth: o === "minimum_curvature" ? D : O.azimuth,
494
+ dip: o === "minimum_curvature" ? z : O.dip
495
495
  };
496
- a.aliasCol !== "hole_id" && b[a.aliasCol] !== void 0 && (x[a.aliasCol] = b[a.aliasCol]), d.push(x);
496
+ a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (R[a.aliasCol] = g[a.aliasCol]), d.push(R);
497
497
  }
498
498
  }
499
499
  }), d;
500
500
  }
501
- function Ht(e, n, t = {}) {
502
- return ke(e, n, { ...t, method: "minimum_curvature" });
501
+ function Zt(e, r, t = {}) {
502
+ return Ge(e, r, { ...t, method: "minimum_curvature" });
503
503
  }
504
- function $n(e, n, t = {}) {
505
- return ke(e, n, { ...t, method: "tangential" });
504
+ function ir(e, r, t = {}) {
505
+ return Ge(e, r, { ...t, method: "tangential" });
506
506
  }
507
- function kn(e, n, t = {}) {
508
- return ke(e, n, { ...t, method: "balanced_tangential" });
507
+ function ar(e, r, t = {}) {
508
+ return Ge(e, r, { ...t, method: "balanced_tangential" });
509
509
  }
510
- function wn(e, n, t = {}) {
511
- return Ht(e, n, t);
510
+ function lr(e, r, t = {}) {
511
+ return Zt(e, r, t);
512
512
  }
513
- function Gt(e, n) {
514
- if (!e.length || !Number.isFinite(n)) return null;
515
- let t = null, r = 1 / 0;
516
- for (let o = 0; o < e.length; o += 1) {
517
- const i = e[o], s = ne(i.md);
518
- if (!Number.isFinite(s)) continue;
519
- const a = Math.abs(s - n);
520
- a < r && (r = a, t = i);
513
+ function Jt(e, r) {
514
+ if (!e.length || !Number.isFinite(r)) return null;
515
+ let t = null, n = 1 / 0;
516
+ for (let s = 0; s < e.length; s += 1) {
517
+ const o = e[s], i = ne(o.md);
518
+ if (!Number.isFinite(i)) continue;
519
+ const a = Math.abs(i - r);
520
+ a < n && (n = a, t = o);
521
521
  }
522
522
  return t;
523
523
  }
524
- function Un(e = [], n = [], t = {}) {
525
- const r = t.holeIdCol || "hole_id", o = Le(e, r), i = Le(n, r);
526
- if (!o.rows.length || !i.rows.length) return [...o.rows];
527
- const s = /* @__PURE__ */ new Map();
528
- return i.rows.forEach((a) => {
529
- a.hole_id && (s.has(a.hole_id) || s.set(a.hole_id, []), s.get(a.hole_id).push(a));
530
- }), s.forEach((a, l) => {
531
- s.set(l, [...a].sort((u, c) => ne(u.md, 0) - ne(c.md, 0)));
532
- }), o.rows.map((a) => {
524
+ function cr(e = [], r = [], t = {}) {
525
+ const n = t.holeIdCol || "hole_id", s = Me(e, n), o = Me(r, n);
526
+ if (!s.rows.length || !o.rows.length) return [...s.rows];
527
+ const i = /* @__PURE__ */ new Map();
528
+ return o.rows.forEach((a) => {
529
+ a.hole_id && (i.has(a.hole_id) || i.set(a.hole_id, []), i.get(a.hole_id).push(a));
530
+ }), i.forEach((a, l) => {
531
+ i.set(l, [...a].sort((u, c) => ne(u.md, 0) - ne(c.md, 0)));
532
+ }), s.rows.map((a) => {
533
533
  const l = ne(a.from), u = ne(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 d = Gt(s.get(a.hole_id) || [], c);
535
+ const d = Jt(i.get(a.hole_id) || [], c);
536
536
  if (!d) return { ...a };
537
- const m = { ...a };
538
- return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
539
- d[f] !== void 0 && (Object.prototype.hasOwnProperty.call(m, f) ? m[`${f}_trace`] = d[f] : m[f] = d[f]);
540
- }), m;
537
+ const f = { ...a };
538
+ return ["md", "x", "y", "z", "azimuth", "dip"].forEach((m) => {
539
+ d[m] !== void 0 && (Object.prototype.hasOwnProperty.call(f, m) ? f[`${m}_trace`] = d[m] : f[m] = d[m]);
540
+ }), f;
541
541
  });
542
542
  }
543
- function Hn(e, n = null) {
544
- return new Promise((t, r) => {
543
+ function ur(e, r = null) {
544
+ return new Promise((t, n) => {
545
545
  J.parse(e, {
546
546
  header: !0,
547
547
  dynamicTyping: !0,
548
548
  skipEmptyLines: !0,
549
- complete: (o) => {
550
- const i = /* @__PURE__ */ new Map();
551
- o.data.forEach((a, l) => {
552
- const u = ie(a, null, n), c = u[N], d = c !== void 0 ? `${c}`.trim() : "", m = u[pe] ?? u.x, f = u[ge] ?? u.y, b = u[Ee] ?? u.z, p = u.order ?? l;
553
- !d || m === null || m === void 0 || f === null || f === void 0 || b === null || b === void 0 || (i.has(d) || i.set(d, []), i.get(d).push({
549
+ complete: (s) => {
550
+ const o = /* @__PURE__ */ new Map();
551
+ s.data.forEach((a, l) => {
552
+ const u = ae(a, null, r), c = u[N], d = c !== void 0 ? `${c}`.trim() : "", f = u[be] ?? u.x, m = u[ye] ?? u.y, g = u[Se] ?? u.z, h = u.order ?? l;
553
+ !d || f === null || f === void 0 || m === null || m === void 0 || g === null || g === void 0 || (o.has(d) || o.set(d, []), o.get(d).push({
554
554
  ...u,
555
555
  holeId: d,
556
- order: p,
557
- x: Number(m) ?? 0,
558
- y: Number(f) ?? 0,
559
- z: Number(b) ?? 0
556
+ order: h,
557
+ x: Number(f) ?? 0,
558
+ y: Number(m) ?? 0,
559
+ z: Number(g) ?? 0
560
560
  }));
561
561
  });
562
- const s = Array.from(i.entries()).map(([a, l]) => ({
562
+ const i = Array.from(o.entries()).map(([a, l]) => ({
563
563
  id: a,
564
564
  points: l.sort((u, c) => u.order - c.order).map((u) => ({
565
565
  ...u,
@@ -568,431 +568,431 @@ function Hn(e, n = null) {
568
568
  z: Number(u.z) || 0
569
569
  }))
570
570
  }));
571
- t({ holes: s });
571
+ t({ holes: i });
572
572
  },
573
- error: (o) => r(U("parseDrillholesCSV", o))
573
+ error: (s) => n(G("parseDrillholesCSV", s))
574
574
  });
575
575
  });
576
576
  }
577
- function be(e) {
577
+ function _e(e) {
578
578
  return e ? Array.isArray(e) ? [...e] : [] : [];
579
579
  }
580
580
  function Z(e) {
581
- const n = Number(e);
582
- return Number.isFinite(n) ? n : void 0;
581
+ const r = Number(e);
582
+ return Number.isFinite(r) ? r : void 0;
583
583
  }
584
- function Ne(e = [], n = []) {
584
+ function Ee(e = [], r = []) {
585
585
  const t = [...e];
586
- return t.sort((r, o) => {
587
- for (let i = 0; i < n.length; i += 1) {
588
- const s = n[i], a = r == null ? void 0 : r[s], l = o == null ? void 0 : o[s];
586
+ return t.sort((n, s) => {
587
+ for (let o = 0; o < r.length; o += 1) {
588
+ const i = r[o], a = n == null ? void 0 : n[i], l = s == null ? void 0 : s[i];
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
  }
592
592
  return 0;
593
593
  }), t;
594
594
  }
595
- function Bt(e = [], n = "Intervals") {
595
+ function Qt(e = [], r = "Intervals") {
596
596
  if (!e.length) return;
597
- const t = Ne(e, [N, M, O]), r = /* @__PURE__ */ new Map();
598
- t.forEach((o) => {
599
- const i = `${(o == null ? void 0 : o[N]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[M]), a = Number(o == null ? void 0 : o[O]);
600
- if (!i || !Number.isFinite(s) || !Number.isFinite(a)) return;
601
- const l = r.get(i);
602
- if (Number.isFinite(l) && s < l)
603
- throw U(
597
+ const t = Ee(e, [N, S, M]), n = /* @__PURE__ */ new Map();
598
+ t.forEach((s) => {
599
+ const o = `${(s == null ? void 0 : s[N]) ?? ""}`.trim(), i = Number(s == null ? void 0 : s[S]), a = Number(s == null ? void 0 : s[M]);
600
+ if (!o || !Number.isFinite(i) || !Number.isFinite(a)) return;
601
+ const l = n.get(o);
602
+ if (Number.isFinite(l) && i < l)
603
+ throw G(
604
604
  "validateNoOverlappingIntervals",
605
- new Error(`${n} intervals overlap for hole '${i}': from=${s} is less than previous to=${l}`)
605
+ new Error(`${r} intervals overlap for hole '${o}': from=${i} is less than previous to=${l}`)
606
606
  );
607
- r.set(i, a);
607
+ n.set(o, a);
608
608
  });
609
609
  }
610
- function Vt(e, n = {}) {
611
- return new Promise((t, r) => {
610
+ function en(e, r = {}) {
611
+ return new Promise((t, n) => {
612
612
  J.parse(e, {
613
613
  header: !0,
614
614
  dynamicTyping: !0,
615
615
  skipEmptyLines: !0,
616
- ...n,
617
- complete: (o) => t(Array.isArray(o == null ? void 0 : o.data) ? o.data : []),
618
- error: (o) => r(U("loadTable(csv)", o))
616
+ ...r,
617
+ complete: (s) => t(Array.isArray(s == null ? void 0 : s.data) ? s.data : []),
618
+ error: (s) => n(G("loadTable(csv)", s))
619
619
  });
620
620
  });
621
621
  }
622
- function jt(e = [], n = null, t = null) {
623
- return e.map((r) => ie(r, n, t));
622
+ function tn(e = [], r = null, t = null) {
623
+ return e.map((n) => ae(n, r, t));
624
624
  }
625
- async function Ce(e, n = {}) {
625
+ async function Pe(e, r = {}) {
626
626
  const {
627
627
  kind: t = "csv",
628
- columnMap: r = null,
629
- sourceColumnMap: o = null,
630
- papaParseConfig: i = {}
631
- } = n;
632
- let s;
628
+ columnMap: n = null,
629
+ sourceColumnMap: s = null,
630
+ papaParseConfig: o = {}
631
+ } = r;
632
+ let i;
633
633
  if (Array.isArray(e))
634
- s = be(e);
634
+ i = _e(e);
635
635
  else if (t === "csv")
636
- s = await Vt(e, i);
637
- else throw t === "parquet" || t === "sql" ? U("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : U("loadTable", new Error(`Unsupported kind: ${t}`));
638
- return jt(s, r, o);
636
+ i = await en(e, o);
637
+ else throw t === "parquet" || t === "sql" ? G("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : G("loadTable", new Error(`Unsupported kind: ${t}`));
638
+ return tn(i, n, s);
639
639
  }
640
- async function Gn(e, n = {}) {
640
+ async function dr(e, r = {}) {
641
641
  const {
642
642
  crs: t = null,
643
- sourceColumnMap: r = null,
644
- keepAll: o = !0,
645
- ...i
646
- } = n, s = await Ce(e, { ...i, sourceColumnMap: r });
647
- if (!s.some((m) => N in m))
648
- throw U("loadCollars", new Error(`Collar table missing column: ${N}`));
649
- const l = s.some((m) => pe in m && ge in m), u = s.some((m) => re in m && oe in m);
643
+ sourceColumnMap: n = null,
644
+ keepAll: s = !0,
645
+ ...o
646
+ } = r, i = await Pe(e, { ...o, sourceColumnMap: n });
647
+ if (!i.some((f) => N in f))
648
+ throw G("loadCollars", new Error(`Collar table missing column: ${N}`));
649
+ const l = i.some((f) => be in f && ye in f), u = i.some((f) => se in f && oe in f);
650
650
  if (!l && !u)
651
- throw U("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
- const c = s.map((m) => {
653
- const f = { ...m };
654
- if (N in f) {
655
- const b = f[N];
656
- f[N] = b == null ? "" : `${b}`.trim();
651
+ throw G("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
+ const c = i.map((f) => {
653
+ const m = { ...f };
654
+ if (N in m) {
655
+ const g = m[N];
656
+ m[N] = g == null ? "" : `${g}`.trim();
657
657
  }
658
- return re in f && (f[re] = Z(f[re])), oe in f && (f[oe] = Z(f[oe])), Ee in f && (f[Ee] = Z(f[Ee])), pe in f && (f[pe] = Z(f[pe])), ge in f && (f[ge] = Z(f[ge])), !("datasource_hole_id" in f) && N in f && (f.datasource_hole_id = f[N]), f;
658
+ return se in m && (m[se] = Z(m[se])), oe in m && (m[oe] = Z(m[oe])), Se in m && (m[Se] = Z(m[Se])), be in m && (m[be] = Z(m[be])), ye in m && (m[ye] = Z(m[ye])), !("datasource_hole_id" in m) && N in m && (m.datasource_hole_id = m[N]), m;
659
659
  });
660
- if (!c.every((m) => !(!m[N] || u && (!Number.isFinite(m[re]) || !Number.isFinite(m[oe])) || l && !u && (!Number.isFinite(m[pe]) || !Number.isFinite(m[ge])))))
661
- throw U("loadCollars", new Error("Collar table has missing required values"));
660
+ if (!c.every((f) => !(!f[N] || u && (!Number.isFinite(f[se]) || !Number.isFinite(f[oe])) || l && !u && (!Number.isFinite(f[be]) || !Number.isFinite(f[ye])))))
661
+ throw G("loadCollars", new Error("Collar table has missing required values"));
662
662
  return c;
663
663
  }
664
- async function Bn(e, n = {}) {
664
+ async function fr(e, r = {}) {
665
665
  const {
666
666
  sourceColumnMap: t = null,
667
- keepAll: r = !0,
668
- ...o
669
- } = n, i = await Ce(e, { ...o, sourceColumnMap: t }), s = [N, V, Y, W];
670
- for (const u of s)
671
- if (!i.some((d) => u in d))
672
- throw U("loadSurveys", new Error(`Survey table missing column: ${u}`));
673
- const a = i.map((u) => {
667
+ keepAll: n = !0,
668
+ ...s
669
+ } = r, o = await Pe(e, { ...s, sourceColumnMap: t }), i = [N, j, Y, W];
670
+ for (const u of i)
671
+ if (!o.some((d) => u in d))
672
+ throw G("loadSurveys", new Error(`Survey table missing column: ${u}`));
673
+ const a = o.map((u) => {
674
674
  const c = { ...u };
675
675
  if (N in c) {
676
676
  const d = c[N];
677
677
  c[N] = d == null ? "" : `${d}`.trim();
678
678
  }
679
- return V in c && (c[V] = Z(c[V])), O in c && (c[O] = Z(c[O])), Y in c && (c[Y] = Z(c[Y])), W in c && (c[W] = Z(c[W])), c;
679
+ return j in c && (c[j] = Z(c[j])), M in c && (c[M] = Z(c[M])), Y in c && (c[Y] = Z(c[Y])), W in c && (c[W] = Z(c[W])), c;
680
680
  });
681
- if (!a.every((u) => !(!u[N] || !Number.isFinite(u[V]) || !Number.isFinite(u[Y]) || !Number.isFinite(u[W]))))
682
- throw U("loadSurveys", new Error("Survey table has missing required values"));
683
- return Ne(a, [N, V]);
681
+ if (!a.every((u) => !(!u[N] || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]) || !Number.isFinite(u[W]))))
682
+ throw G("loadSurveys", new Error("Survey table has missing required values"));
683
+ return Ee(a, [N, j]);
684
684
  }
685
- async function Vn(e, n = {}) {
685
+ async function mr(e, r = {}) {
686
686
  const {
687
687
  sourceColumnMap: t = null,
688
- keepAll: r = !0,
689
- ...o
690
- } = n, i = await Ce(e, { ...o, sourceColumnMap: t }), s = [N, M, O];
691
- for (const u of s)
692
- if (!i.some((d) => u in d))
693
- throw U("loadAssays", new Error(`Assay table missing column: ${u}`));
694
- const a = i.map((u) => {
688
+ keepAll: n = !0,
689
+ ...s
690
+ } = r, o = await Pe(e, { ...s, sourceColumnMap: t }), i = [N, S, M];
691
+ for (const u of i)
692
+ if (!o.some((d) => u in d))
693
+ throw G("loadAssays", new Error(`Assay table missing column: ${u}`));
694
+ const a = o.map((u) => {
695
695
  const c = { ...u };
696
696
  if (N in c) {
697
697
  const d = c[N];
698
698
  c[N] = d == null ? "" : `${d}`.trim();
699
699
  }
700
- return M in c && (c[M] = Z(c[M])), O in c && (c[O] = Z(c[O])), M in c && O in c && Number.isFinite(c[M]) && Number.isFinite(c[O]) && (c[ve] = 0.5 * (c[M] + c[O])), c;
700
+ return S in c && (c[S] = Z(c[S])), M in c && (c[M] = Z(c[M])), S in c && M in c && Number.isFinite(c[S]) && Number.isFinite(c[M]) && (c[Ae] = 0.5 * (c[S] + c[M])), c;
701
701
  });
702
- if (!a.every((u) => !(!u[N] || !Number.isFinite(u[M]) || !Number.isFinite(u[O]) || !(u[O] > u[M]))))
703
- throw U("loadAssays", new Error("Assay table has missing required values"));
704
- return Ne(a, [N, M, O]);
702
+ if (!a.every((u) => !(!u[N] || !Number.isFinite(u[S]) || !Number.isFinite(u[M]) || !(u[M] > u[S]))))
703
+ throw G("loadAssays", new Error("Assay table has missing required values"));
704
+ return Ee(a, [N, S, M]);
705
705
  }
706
- async function jn(e, n = {}) {
706
+ async function hr(e, r = {}) {
707
707
  const {
708
708
  sourceColumnMap: t = null,
709
- keepAll: r = !0,
710
- ...o
711
- } = n, i = await Ce(e, { ...o, sourceColumnMap: t }), s = [N, M, O];
712
- for (const c of s)
713
- if (!i.some((m) => c in m))
714
- throw U("loadGeology", new Error(`Geology table missing column: ${c}`));
715
- const a = i.map((c) => {
709
+ keepAll: n = !0,
710
+ ...s
711
+ } = r, o = await Pe(e, { ...s, sourceColumnMap: t }), i = [N, S, M];
712
+ for (const c of i)
713
+ if (!o.some((f) => c in f))
714
+ throw G("loadGeology", new Error(`Geology table missing column: ${c}`));
715
+ const a = o.map((c) => {
716
716
  const d = { ...c };
717
717
  if (N in d) {
718
- const b = d[N];
719
- d[N] = b == null ? "" : `${b}`.trim();
718
+ const g = d[N];
719
+ d[N] = g == null ? "" : `${g}`.trim();
720
720
  }
721
- M in d && (d[M] = Z(d[M])), O in d && (d[O] = Z(d[O])), M in d && O in d && Number.isFinite(d[M]) && Number.isFinite(d[O]) && (d[O] === d[M] && (d[M] = Math.round(d[M] * 1e3) / 1e3, d[O] = d[M] + 1e-3), d[ve] = 0.5 * (d[M] + d[O]));
722
- const m = d[le] !== void 0 && d[le] !== null && `${d[le]}`.trim() !== "", f = d[ce] !== void 0 && d[ce] !== null && `${d[ce]}`.trim() !== "";
723
- return !m && f && (d[le] = d[ce]), m && !f && (d[ce] = d[le]), d;
721
+ S in d && (d[S] = Z(d[S])), M in d && (d[M] = Z(d[M])), S in d && M in d && Number.isFinite(d[S]) && Number.isFinite(d[M]) && (d[M] === d[S] && (d[S] = Math.round(d[S] * 1e3) / 1e3, d[M] = d[S] + 1e-3), d[Ae] = 0.5 * (d[S] + d[M]));
722
+ const f = d[ce] !== void 0 && d[ce] !== null && `${d[ce]}`.trim() !== "", m = d[ue] !== void 0 && d[ue] !== null && `${d[ue]}`.trim() !== "";
723
+ return !f && m && (d[ce] = d[ue]), f && !m && (d[ue] = d[ce]), d;
724
724
  });
725
- if (!a.every((c) => !(!c[N] || !Number.isFinite(c[M]) || !Number.isFinite(c[O]) || !(c[O] > c[M]))))
726
- throw U("loadGeology", new Error("Geology table has missing or invalid interval values"));
725
+ if (!a.every((c) => !(!c[N] || !Number.isFinite(c[S]) || !Number.isFinite(c[M]) || !(c[M] > c[S]))))
726
+ throw G("loadGeology", new Error("Geology table has missing or invalid interval values"));
727
727
  if (!a.some((c) => {
728
- const d = c[le], m = c[ce];
729
- return d != null && `${d}`.trim() !== "" || m != null && `${m}`.trim() !== "";
728
+ const d = c[ce], f = c[ue];
729
+ return d != null && `${d}`.trim() !== "" || f != null && `${f}`.trim() !== "";
730
730
  }))
731
- throw U("loadGeology", new Error(`Geology table missing categorical columns: ${le} or ${ce}`));
732
- if (Bt(a, "Geology"), !r) {
733
- const c = new Set(Object.keys(Et));
734
- return Ne(
735
- a.map((d) => Object.fromEntries(Object.entries(d).filter(([m]) => c.has(m)))),
736
- [N, M, O]
731
+ throw G("loadGeology", new Error(`Geology table missing categorical columns: ${ce} or ${ue}`));
732
+ if (Qt(a, "Geology"), !n) {
733
+ const c = new Set(Object.keys(Pt));
734
+ return Ee(
735
+ a.map((d) => Object.fromEntries(Object.entries(d).filter(([f]) => c.has(f)))),
736
+ [N, S, M]
737
737
  );
738
738
  }
739
- return Ne(a, [N, M, O]);
740
- }
741
- function Yn(e = [], n = [], t = {}) {
742
- const r = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [N];
743
- if (!n.length) return [...e];
744
- const o = (s) => r.map((a) => `${(s == null ? void 0 : s[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
745
- return n.forEach((s) => {
746
- i.set(o(s), s);
747
- }), e.map((s) => {
748
- const a = i.get(o(s));
749
- if (!a) return { ...s };
750
- const l = { ...s };
739
+ return Ee(a, [N, S, M]);
740
+ }
741
+ function pr(e = [], r = [], t = {}) {
742
+ const n = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [N];
743
+ if (!r.length) return [...e];
744
+ const s = (i) => n.map((a) => `${(i == null ? void 0 : i[a]) ?? ""}`).join("|"), o = /* @__PURE__ */ new Map();
745
+ return r.forEach((i) => {
746
+ o.set(s(i), i);
747
+ }), e.map((i) => {
748
+ const a = o.get(s(i));
749
+ if (!a) return { ...i };
750
+ const l = { ...i };
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
+ n.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
753
753
  }), l;
754
754
  });
755
755
  }
756
- function Wn(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 gr(e = [], r = null) {
757
+ return r == null ? [...e] : e.length ? e.some((n) => fe in n) ? e.filter((n) => (n == null ? void 0 : n[fe]) === r) : [...e] : [];
758
758
  }
759
- function qn(e = [], n = []) {
759
+ function br(e = [], r = []) {
760
760
  return e.map((t) => {
761
- const r = { ...t };
762
- return n.forEach((o) => {
763
- if (!(o in r)) return;
764
- const i = Z(r[o]);
765
- r[o] = i;
766
- }), r;
761
+ const n = { ...t };
762
+ return r.forEach((s) => {
763
+ if (!(s in n)) return;
764
+ const o = Z(n[s]);
765
+ n[s] = o;
766
+ }), n;
767
767
  });
768
768
  }
769
- function Xn({
769
+ function yr({
770
770
  collars: e = [],
771
- surveys: n = [],
771
+ surveys: r = [],
772
772
  assays: t = [],
773
- geology: r = [],
774
- structures: o = [],
775
- metadata: i = {}
773
+ geology: n = [],
774
+ structures: s = [],
775
+ metadata: o = {}
776
776
  } = {}) {
777
777
  return {
778
- collars: be(e),
779
- surveys: be(n),
780
- assays: be(t),
781
- geology: be(r),
782
- structures: be(o),
783
- metadata: i || {}
778
+ collars: _e(e),
779
+ surveys: _e(r),
780
+ assays: _e(t),
781
+ geology: _e(n),
782
+ structures: _e(s),
783
+ metadata: o || {}
784
784
  };
785
785
  }
786
- const we = (e, n = null) => ie(e, null, n);
787
- function Yt(e) {
786
+ const je = (e, r = null) => ae(e, null, r);
787
+ function nn(e) {
788
788
  if (!e.length) return null;
789
- const n = e[0], t = M in n && O in n, r = V in n && !t;
790
- return t ? "interval" : r ? "point" : null;
789
+ const r = e[0], t = S in r && M in r, n = j in r && !t;
790
+ return t ? "interval" : n ? "point" : null;
791
791
  }
792
- function se(e) {
793
- const n = Number(e);
794
- return Number.isFinite(n) ? n : null;
792
+ function ie(e) {
793
+ const r = Number(e);
794
+ return Number.isFinite(r) ? r : null;
795
795
  }
796
- function at(e) {
797
- const n = e[N] !== void 0 ? `${e[N]}`.trim() : "";
798
- if (!n) return null;
799
- const t = se(e[V]);
796
+ function ht(e) {
797
+ const r = e[N] !== void 0 ? `${e[N]}`.trim() : "";
798
+ if (!r) return null;
799
+ const t = ie(e[j]);
800
800
  return t === null ? null : {
801
- [N]: n,
802
- [V]: t,
803
- [W]: se(e[W]),
804
- [Y]: se(e[Y]),
801
+ [N]: r,
802
+ [j]: t,
803
+ [W]: ie(e[W]),
804
+ [Y]: ie(e[Y]),
805
805
  comments: e.comments != null ? `${e.comments}` : null,
806
806
  ...e
807
807
  };
808
808
  }
809
- function lt(e) {
810
- const n = e[N] !== void 0 ? `${e[N]}`.trim() : "";
811
- if (!n) return null;
812
- const t = se(e[M]), r = se(e[O]);
813
- if (t === null || r === null || r <= t) return null;
814
- const o = 0.5 * (t + r);
809
+ function pt(e) {
810
+ const r = e[N] !== void 0 ? `${e[N]}`.trim() : "";
811
+ if (!r) return null;
812
+ const t = ie(e[S]), n = ie(e[M]);
813
+ if (t === null || n === null || n <= t) return null;
814
+ const s = 0.5 * (t + n);
815
815
  return {
816
- [N]: n,
817
- [M]: t,
818
- [O]: r,
819
- mid: o,
820
- [W]: se(e[W]),
821
- [Y]: se(e[Y]),
816
+ [N]: r,
817
+ [S]: t,
818
+ [M]: n,
819
+ mid: s,
820
+ [W]: ie(e[W]),
821
+ [Y]: ie(e[Y]),
822
822
  classification: e.classification != null ? `${e.classification}` : null,
823
823
  comments: e.comments != null ? `${e.comments}` : null,
824
824
  ...e
825
825
  };
826
826
  }
827
- function Kn(e) {
828
- const n = [], t = [];
829
- for (const r of e) {
830
- const o = [], i = se(r[W]), s = se(r[Y]);
831
- i !== null && (i < 0 || i > 90) && o.push(`dip ${i} out of range [0, 90]`), s !== null && (s < 0 || s >= 360) && o.push(`azimuth ${s} out of range [0, 360)`), o.length ? t.push({ row: r, message: o.join("; ") }) : n.push(r);
827
+ function _r(e) {
828
+ const r = [], t = [];
829
+ for (const n of e) {
830
+ const s = [], o = ie(n[W]), i = ie(n[Y]);
831
+ o !== null && (o < 0 || o > 90) && s.push(`dip ${o} out of range [0, 90]`), i !== null && (i < 0 || i >= 360) && s.push(`azimuth ${i} out of range [0, 360)`), s.length ? t.push({ row: n, message: s.join("; ") }) : r.push(n);
832
832
  }
833
- return { valid: n, errors: t };
833
+ return { valid: r, errors: t };
834
834
  }
835
- function Zn(e, n = null) {
836
- return new Promise((t, r) => {
837
- const o = {
835
+ function Nr(e, r = null) {
836
+ return new Promise((t, n) => {
837
+ const s = {
838
838
  header: !0,
839
839
  dynamicTyping: !0,
840
840
  skipEmptyLines: !0,
841
- complete: (i) => {
842
- const s = [];
843
- for (const a of i.data) {
844
- const l = we(a, n), u = at(l);
845
- u && s.push(u);
841
+ complete: (o) => {
842
+ const i = [];
843
+ for (const a of o.data) {
844
+ const l = je(a, r), u = ht(l);
845
+ u && i.push(u);
846
846
  }
847
- t(s);
847
+ t(i);
848
848
  },
849
- error: (i) => r(U("parseStructuralPointsCSV", i))
849
+ error: (o) => n(G("parseStructuralPointsCSV", o))
850
850
  };
851
851
  typeof e == "string" && !e.startsWith("data:") && e.includes(`
852
- `) ? J.parse(e, o) : J.parse(e, o);
852
+ `) ? J.parse(e, s) : J.parse(e, s);
853
853
  });
854
854
  }
855
- function Jn(e, n = null) {
856
- return new Promise((t, r) => {
855
+ function vr(e, r = null) {
856
+ return new Promise((t, n) => {
857
857
  J.parse(e, {
858
858
  header: !0,
859
859
  dynamicTyping: !0,
860
860
  skipEmptyLines: !0,
861
- complete: (o) => {
862
- const i = [];
863
- for (const s of o.data) {
864
- const a = we(s, n), l = lt(a);
865
- l && i.push(l);
861
+ complete: (s) => {
862
+ const o = [];
863
+ for (const i of s.data) {
864
+ const a = je(i, r), l = pt(a);
865
+ l && o.push(l);
866
866
  }
867
- t(i);
867
+ t(o);
868
868
  },
869
- error: (o) => r(U("parseStructuralIntervalsCSV", o))
869
+ error: (s) => n(G("parseStructuralIntervalsCSV", s))
870
870
  });
871
871
  });
872
872
  }
873
- function Wt(e, n = N) {
873
+ function rn(e, r = N) {
874
874
  const t = /* @__PURE__ */ new Map();
875
- for (const r of e) {
876
- const o = r[n] != null ? String(r[n]).trim() : "";
877
- o && (t.has(o) || t.set(o, { holeId: o, points: [] }), t.get(o).points.push(r));
875
+ for (const n of e) {
876
+ const s = n[r] != null ? String(n[r]).trim() : "";
877
+ s && (t.has(s) || t.set(s, { holeId: s, points: [] }), t.get(s).points.push(n));
878
878
  }
879
879
  return Array.from(t.values());
880
880
  }
881
- function qt(e, n = null) {
882
- return new Promise((t, r) => {
881
+ function sn(e, r = null) {
882
+ return new Promise((t, n) => {
883
883
  J.parse(e, {
884
884
  header: !0,
885
885
  dynamicTyping: !0,
886
886
  skipEmptyLines: !0,
887
- complete: (o) => {
888
- const i = o.data.map((l) => we(l, n)), s = Yt(i);
889
- if (!s) {
890
- r(U(
887
+ complete: (s) => {
888
+ const o = s.data.map((l) => je(l, r)), i = nn(o);
889
+ if (!i) {
890
+ n(G(
891
891
  "parseStructuralCSV",
892
892
  new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
893
893
  ));
894
894
  return;
895
895
  }
896
896
  const a = [];
897
- for (const l of i) {
898
- const u = s === "interval" ? lt(l) : at(l);
897
+ for (const l of o) {
898
+ const u = i === "interval" ? pt(l) : ht(l);
899
899
  u && a.push(u);
900
900
  }
901
- t({ schema: s, rows: a });
901
+ t({ schema: i, rows: a });
902
902
  },
903
- error: (o) => r(U("parseStructuralCSV", o))
903
+ error: (s) => n(G("parseStructuralCSV", s))
904
904
  });
905
905
  });
906
906
  }
907
- function Xt(e) {
908
- return new Promise((n) => {
907
+ function on(e) {
908
+ return new Promise((r) => {
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();
915
- for (const i of t.data) {
916
- const s = ie(i), a = s[N] != null ? `${s[N]}`.trim() : "";
914
+ const n = /* @__PURE__ */ new Map();
915
+ for (const o of t.data) {
916
+ const i = ae(o), a = i[N] != null ? `${i[N]}`.trim() : "";
917
917
  if (!a) continue;
918
- const l = Number(s[M]), u = Number(s[O]);
918
+ const l = Number(i[S]), u = Number(i[M]);
919
919
  if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l) continue;
920
- const c = (l + u) / 2, { [W]: d, [Y]: m, ...f } = s, b = {
921
- ...f,
920
+ const c = (l + u) / 2, { [W]: d, [Y]: f, ...m } = i, g = {
921
+ ...m,
922
922
  [N]: a,
923
- [M]: l,
924
- [O]: u,
925
- [ve]: c,
926
- [V]: c,
923
+ [S]: l,
924
+ [M]: u,
925
+ [Ae]: c,
926
+ [j]: 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(b);
930
+ n.has(a) || n.set(a, []), n.get(a).push(g);
931
931
  }
932
- const o = Array.from(r.entries()).map(([i, s]) => ({
933
- holeId: i,
934
- points: s.sort((a, l) => a[M] - l[M])
932
+ const s = Array.from(n.entries()).map(([o, i]) => ({
933
+ holeId: o,
934
+ points: i.sort((a, l) => a[S] - l[S])
935
935
  }));
936
- n(o);
936
+ r(s);
937
937
  }
938
938
  });
939
939
  });
940
940
  }
941
- function Kt(e) {
942
- return new Promise((n) => {
941
+ function an(e) {
942
+ return new Promise((r) => {
943
943
  J.parse(e, {
944
944
  header: !0,
945
945
  dynamicTyping: !0,
946
946
  skipEmptyLines: !0,
947
947
  complete: (t) => {
948
- const r = /* @__PURE__ */ new Map();
949
- for (const o of t.data) {
950
- const i = ie(o), s = (i[N] ?? "").toString().trim();
951
- if (!s) continue;
952
- const a = Number(i[M]), l = Number(i[O]);
948
+ const n = /* @__PURE__ */ new Map();
949
+ for (const s of t.data) {
950
+ const o = ae(s), i = (o[N] ?? "").toString().trim();
951
+ if (!i) continue;
952
+ const a = Number(o[S]), l = Number(o[M]);
953
953
  if (!Number.isFinite(a) || !Number.isFinite(l) || l <= a) continue;
954
- const u = (a + l) / 2, { [W]: c, [Y]: d, ...m } = i, f = {
955
- ...m,
956
- [N]: s,
957
- [M]: a,
958
- [O]: l,
959
- [ve]: u,
960
- [V]: u,
954
+ const u = (a + l) / 2, { [W]: c, [Y]: d, ...f } = o, m = {
955
+ ...f,
956
+ [N]: i,
957
+ [S]: a,
958
+ [M]: l,
959
+ [Ae]: u,
960
+ [j]: u,
961
961
  _source: "geology"
962
962
  };
963
- r.has(s) || r.set(s, []), r.get(s).push(f);
963
+ n.has(i) || n.set(i, []), n.get(i).push(m);
964
964
  }
965
- n({
966
- holes: Array.from(r.entries()).map(([o, i]) => ({
967
- holeId: o,
968
- points: i.sort((s, a) => s[M] - a[M])
965
+ r({
966
+ holes: Array.from(n.entries()).map(([s, o]) => ({
967
+ holeId: s,
968
+ points: o.sort((i, a) => i[S] - a[S])
969
969
  }))
970
970
  });
971
971
  }
972
972
  });
973
973
  });
974
974
  }
975
- async function Qn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
- const [r, o, i] = await Promise.all([
977
- e ? Xt(e) : Promise.resolve([]),
978
- n ? qt(n).then(
979
- ({ rows: a }) => Wt(a.map((l) => ({ ...l, _source: "structural" })))
975
+ async function Er({ assayCsv: e, structuralCsv: r, geologyCsv: t } = {}) {
976
+ const [n, s, o] = await Promise.all([
977
+ e ? on(e) : Promise.resolve([]),
978
+ r ? sn(r).then(
979
+ ({ rows: a }) => rn(a.map((l) => ({ ...l, _source: "structural" })))
980
980
  ) : Promise.resolve([]),
981
- t ? Kt(t).then(({ holes: a }) => a) : Promise.resolve([])
982
- ]), s = new Map(r.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
- for (const a of [...o, ...i]) {
981
+ t ? an(t).then(({ holes: a }) => a) : Promise.resolve([])
982
+ ]), i = new Map(n.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
+ for (const a of [...s, ...o]) {
984
984
  const l = a.holeId;
985
985
  if (l)
986
- if (s.has(l)) {
987
- const u = s.get(l);
988
- s.set(l, { ...u, points: [...u.points, ...a.points || []] });
986
+ if (i.has(l)) {
987
+ const u = i.get(l);
988
+ i.set(l, { ...u, points: [...u.points, ...a.points || []] });
989
989
  } else
990
- s.set(l, a);
990
+ i.set(l, a);
991
991
  }
992
- return { holes: Array.from(s.values()) };
992
+ return { holes: Array.from(i.values()) };
993
993
  }
994
- function er(e, n, t, r, o = {}) {
995
- const i = o.fromCol || "from", s = o.toCol || "to", a = o.holeCol || "hole_id";
994
+ function Ir(e, r, t, n, s = {}) {
995
+ const o = s.fromCol || "from", i = s.toCol || "to", a = s.holeCol || "hole_id";
996
996
  if (!e || !e.length) return [];
997
997
  const l = {};
998
998
  for (const c of e) {
@@ -1001,177 +1001,619 @@ function er(e, n, t, r, o = {}) {
1001
1001
  }
1002
1002
  const u = [];
1003
1003
  for (const [c, d] of Object.entries(l)) {
1004
- const f = [...d].sort((g, L) => Number(g[i]) - Number(L[i])).filter((g) => {
1005
- const L = Number(g[n]);
1006
- return Number.isFinite(L) && L >= t;
1004
+ const m = [...d].sort((p, E) => Number(p[o]) - Number(E[o])).filter((p) => {
1005
+ const E = Number(p[r]);
1006
+ return Number.isFinite(E) && E >= t;
1007
1007
  });
1008
- if (!f.length) continue;
1009
- const b = [];
1010
- let p = [], v = null;
1011
- for (const g of f) {
1012
- const L = Number(g[i]), C = Number(g[s]);
1013
- v === null || Math.abs(L - v) > 1e-6 ? (p.length && b.push(p), p = [g]) : p.push(g), v = C;
1008
+ if (!m.length) continue;
1009
+ const g = [];
1010
+ let h = [], y = null;
1011
+ for (const p of m) {
1012
+ const E = Number(p[o]), x = Number(p[i]);
1013
+ y === null || Math.abs(E - y) > 1e-6 ? (h.length && g.push(h), h = [p]) : h.push(p), y = x;
1014
1014
  }
1015
- p.length && b.push(p);
1016
- for (const g of b) {
1017
- const L = Number(g[0][i]), C = Number(g[g.length - 1][s]), j = C - L;
1018
- if (j < r) continue;
1019
- let H = 0, $ = 0;
1020
- for (const h of g) {
1021
- const P = Number(h[n]), A = Number(h[s]) - Number(h[i]);
1022
- H += P * A, $ += A;
1015
+ h.length && g.push(h);
1016
+ for (const p of g) {
1017
+ const E = Number(p[0][o]), x = Number(p[p.length - 1][i]), F = x - E;
1018
+ if (F < n) continue;
1019
+ let w = 0, k = 0;
1020
+ for (const b of p) {
1021
+ const L = Number(b[r]), A = Number(b[i]) - Number(b[o]);
1022
+ w += L * A, k += A;
1023
1023
  }
1024
- const D = H / $, R = g.length, G = `${j.toFixed(1)} m @ ${D.toFixed(2)} ${n}`;
1024
+ const $ = w / k, P = p.length, H = `${F.toFixed(1)} m @ ${$.toFixed(2)} ${r}`;
1025
1025
  u.push({
1026
1026
  [a]: c,
1027
- assay_field: n,
1028
- [i]: L,
1029
- [s]: C,
1030
- length: j,
1031
- avg_grade: D,
1032
- n_samples: R,
1033
- label: G
1027
+ assay_field: r,
1028
+ [o]: E,
1029
+ [i]: x,
1030
+ length: F,
1031
+ avg_grade: $,
1032
+ n_samples: P,
1033
+ label: H
1034
1034
  });
1035
1035
  }
1036
1036
  }
1037
1037
  return u;
1038
1038
  }
1039
- const ct = ["depth", "md", "measured_depth", "dept", "z"];
1040
- function Zt(e) {
1041
- if (e[V] !== void 0) {
1042
- const r = Number(e[V]);
1043
- if (Number.isFinite(r)) return r;
1039
+ function Be(e, r) {
1040
+ const t = /* @__PURE__ */ new Map();
1041
+ for (const n of e) {
1042
+ const s = n[r];
1043
+ s != null && (t.has(s) || t.set(s, []), t.get(s).push(n));
1044
+ }
1045
+ return t;
1046
+ }
1047
+ function Ar(e, { fromCol: r = S, toCol: t = M } = {}) {
1048
+ return e.map((n) => Number(n[t]) - Number(n[r]));
1049
+ }
1050
+ function Sr(e, { fromCol: r = S, toCol: t = M } = {}) {
1051
+ return e.map((n) => (Number(n[r]) + Number(n[t])) / 2);
1052
+ }
1053
+ function ln(e, { fromCol: r = S, toCol: t = M, holeCol: n = N, minGap: s = 0 } = {}) {
1054
+ if (!e || !e.length) return [];
1055
+ const o = [];
1056
+ for (const [i, a] of Be(e, n)) {
1057
+ const l = [...a].sort(
1058
+ (c, d) => Number(c[r]) - Number(d[r])
1059
+ );
1060
+ let u = null;
1061
+ for (const c of l) {
1062
+ const d = Number(c[r]), f = Number(c[t]);
1063
+ u !== null && d - u > s && o.push({
1064
+ [n]: i,
1065
+ [r]: u,
1066
+ [t]: d,
1067
+ length: d - u
1068
+ }), (u === null || f > u) && (u = f);
1069
+ }
1070
+ }
1071
+ return o;
1072
+ }
1073
+ function cn(e, { fromCol: r = S, toCol: t = M, holeCol: n = N } = {}) {
1074
+ if (!e || !e.length) return [];
1075
+ const s = e.map((a, l) => ({ row: a, originalIndex: l })), o = /* @__PURE__ */ new Map();
1076
+ for (const a of s) {
1077
+ const l = a.row[n];
1078
+ l != null && (o.has(l) || o.set(l, []), o.get(l).push(a));
1079
+ }
1080
+ const i = [];
1081
+ for (const [a, l] of o) {
1082
+ const u = [...l].sort(
1083
+ (c, d) => Number(c.row[r]) - Number(d.row[r])
1084
+ );
1085
+ for (let c = 0; c < u.length; c += 1) {
1086
+ const d = Number(u[c].row[r]), f = Number(u[c].row[t]);
1087
+ for (let m = c + 1; m < u.length; m += 1) {
1088
+ const g = Number(u[m].row[r]);
1089
+ if (g >= f) break;
1090
+ const h = Number(u[m].row[t]), y = Math.max(d, g), p = Math.min(f, h);
1091
+ p > y && i.push({
1092
+ [n]: a,
1093
+ [r]: y,
1094
+ [t]: p,
1095
+ length: p - y,
1096
+ first_index: u[c].originalIndex,
1097
+ second_index: u[m].originalIndex
1098
+ });
1099
+ }
1100
+ }
1101
+ }
1102
+ return i;
1103
+ }
1104
+ function un(e, r) {
1105
+ if (e == null) return { byHole: /* @__PURE__ */ new Map(), all: [] };
1106
+ if (Array.isArray(e)) {
1107
+ const t = e[0];
1108
+ if (e.length && t && typeof t == "object" && t[r] != null && t.depth != null) {
1109
+ const s = /* @__PURE__ */ new Map();
1110
+ for (const o of e) {
1111
+ const i = o && o[r], a = o && o.depth;
1112
+ i == null || a == null || (s.has(i) || s.set(i, []), s.get(i).push(Number(a)));
1113
+ }
1114
+ return { byHole: s, all: [] };
1115
+ }
1116
+ return { byHole: /* @__PURE__ */ new Map(), all: e.map(Number) };
1117
+ }
1118
+ if (typeof e == "number")
1119
+ return { byHole: /* @__PURE__ */ new Map(), all: [Number(e)] };
1120
+ if (e && typeof e == "object") {
1121
+ if (e[r] != null && e.depth != null) {
1122
+ const n = /* @__PURE__ */ new Map();
1123
+ return n.set(e[r], [Number(e.depth)]), { byHole: n, all: [] };
1124
+ }
1125
+ const t = /* @__PURE__ */ new Map();
1126
+ for (const [n, s] of Object.entries(e)) {
1127
+ const o = Array.isArray(s) ? s : [s];
1128
+ t.set(n, o.map(Number));
1129
+ }
1130
+ return { byHole: t, all: [] };
1131
+ }
1132
+ return { byHole: /* @__PURE__ */ new Map(), all: [] };
1133
+ }
1134
+ function Tr(e, r, { fromCol: t = S, toCol: n = M, holeCol: s = N } = {}) {
1135
+ if (!e || !e.length) return [];
1136
+ const { byHole: o, all: i } = un(r, s), a = [];
1137
+ for (const l of e) {
1138
+ const u = l[s], c = Number(l[t]), d = Number(l[n]), f = o.has(u) ? o.get(u) : i, m = [...new Set(
1139
+ f.map(Number).filter((h) => h > c && h < d)
1140
+ )].sort((h, y) => h - y);
1141
+ if (!m.length) {
1142
+ a.push({ ...l });
1143
+ continue;
1144
+ }
1145
+ const g = [c, ...m, d];
1146
+ for (let h = 0; h < g.length - 1; h += 1)
1147
+ a.push({
1148
+ ...l,
1149
+ [t]: g[h],
1150
+ [n]: g[h + 1]
1151
+ });
1152
+ }
1153
+ return a;
1154
+ }
1155
+ function xr(e, r, t, { fromCol: n = S, toCol: s = M } = {}) {
1156
+ if (!e || !e.length) return [];
1157
+ const o = [];
1158
+ for (const i of e) {
1159
+ let a = Number(i[n]), l = Number(i[s]);
1160
+ if (r != null) {
1161
+ if (l <= r) continue;
1162
+ a < r && (a = r);
1163
+ }
1164
+ if (t != null) {
1165
+ if (a >= t) continue;
1166
+ l > t && (l = t);
1167
+ }
1168
+ o.push({ ...i, [n]: a, [s]: l });
1169
+ }
1170
+ return o;
1171
+ }
1172
+ function Ze(e, r, t, n) {
1173
+ for (const s of e)
1174
+ if (Number(s[t]) <= r && Number(s[n]) > r) return s;
1175
+ return null;
1176
+ }
1177
+ function Lr(e, { fromCol: r = S, toCol: t = M, holeCol: n = N } = {}) {
1178
+ if (!e) return [];
1179
+ const s = Object.keys(e);
1180
+ if (!s.length) return [];
1181
+ const o = s[0], i = e[o] || [];
1182
+ if (!i.length) return [];
1183
+ const a = Be(i, n), l = {};
1184
+ for (const c of s.slice(1))
1185
+ l[c] = Be(e[c] || [], n);
1186
+ const u = [];
1187
+ for (const [c, d] of a) {
1188
+ const f = /* @__PURE__ */ new Set();
1189
+ let m = 1 / 0, g = -1 / 0;
1190
+ for (const y of d) {
1191
+ const p = Number(y[r]), E = Number(y[t]);
1192
+ f.add(p), f.add(E), p < m && (m = p), E > g && (g = E);
1193
+ }
1194
+ for (const y of s.slice(1)) {
1195
+ const p = l[y].get(c) || [];
1196
+ for (const E of p) {
1197
+ const x = Number(E[r]), F = Number(E[t]);
1198
+ F < m || x > g || (x > m && f.add(x), F < g && f.add(F));
1199
+ }
1200
+ }
1201
+ const h = [...f].sort((y, p) => y - p);
1202
+ for (let y = 0; y < h.length - 1; y += 1) {
1203
+ const p = h[y], E = h[y + 1], x = (p + E) / 2, F = Ze(d, x, r, t);
1204
+ if (!F) continue;
1205
+ const w = { [n]: c, [r]: p, [t]: E };
1206
+ for (const k of Object.keys(F))
1207
+ k === n || k === r || k === t || (w[`${o}_${k}`] = F[k]);
1208
+ for (const k of s.slice(1)) {
1209
+ const $ = l[k].get(c) || [], P = Ze($, x, r, t), H = e[k] && e[k][0] || {}, b = Object.keys(H).filter(
1210
+ (L) => L !== n && L !== r && L !== t
1211
+ );
1212
+ for (const L of b)
1213
+ w[`${k}_${L}`] = P ? P[L] : null;
1214
+ }
1215
+ u.push(w);
1216
+ }
1217
+ }
1218
+ return u;
1219
+ }
1220
+ const me = "error", Ie = "warning", Oe = "info", gt = /^\s*<\s*(-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?)\s*$/;
1221
+ function re({ check: e, severity: r, message: t, holeId: n = null, table: s = null, rowIndex: o = null, fix: i = null }) {
1222
+ return { check: e, severity: r, hole_id: n, table: s, row_index: o, message: t, fix: i };
1223
+ }
1224
+ function bt(e, r, t) {
1225
+ const n = /* @__PURE__ */ new Map();
1226
+ for (const s of e || []) {
1227
+ const o = s && s[r], i = s && s[t];
1228
+ o == null || i == null || Number.isNaN(Number(i)) || n.set(o, Number(i));
1044
1229
  }
1045
- for (const r of ct)
1046
- if (e[r] !== void 0) {
1047
- const o = Number(e[r]);
1048
- if (Number.isFinite(o)) return o;
1230
+ return n;
1231
+ }
1232
+ function yt(e, r) {
1233
+ const t = /* @__PURE__ */ new Map();
1234
+ for (const n of e || []) {
1235
+ const s = n && n[r];
1236
+ s != null && (t.has(s) || t.set(s, []), t.get(s).push(n));
1237
+ }
1238
+ return t;
1239
+ }
1240
+ function dn(e, r) {
1241
+ if (!e || !e.length) return [];
1242
+ const t = /* @__PURE__ */ new Map();
1243
+ for (const s of e) {
1244
+ const o = s && s[r];
1245
+ o != null && t.set(o, (t.get(o) || 0) + 1);
1246
+ }
1247
+ const n = [];
1248
+ for (const [s, o] of t)
1249
+ o > 1 && n.push(re({
1250
+ check: "duplicate_hole_ids",
1251
+ severity: me,
1252
+ holeId: String(s),
1253
+ table: "collar",
1254
+ message: `Hole '${s}' appears ${o} times in the collar table`,
1255
+ fix: "Remove or merge duplicate collar rows so each hole_id is unique"
1256
+ }));
1257
+ return n;
1258
+ }
1259
+ function fn(e, r) {
1260
+ if (!e || !e.length) return [];
1261
+ const t = yt(e, r), n = [];
1262
+ for (const [s, o] of t)
1263
+ if (o.length === 1) {
1264
+ const i = e.indexOf(o[0]);
1265
+ n.push(re({
1266
+ check: "single_station_surveys",
1267
+ severity: Ie,
1268
+ holeId: String(s),
1269
+ table: "survey",
1270
+ rowIndex: i,
1271
+ message: `Hole '${s}' has only one survey station; desurvey will fail`,
1272
+ fix: "Call fixSingleStationSurveys(survey, collar) to add a synthetic station"
1273
+ }));
1049
1274
  }
1050
- const n = Number(e[M]), t = Number(e[O]);
1051
- return Number.isFinite(n) && Number.isFinite(t) && t >= n ? (n + t) / 2 : null;
1275
+ return n;
1276
+ }
1277
+ function mn(e, r, t, n = !1) {
1278
+ if (!e || !e.length) return [];
1279
+ const s = n ? "[0, 360]" : "[0, 360)", o = [];
1280
+ return e.forEach((i, a) => {
1281
+ const l = i && i[t];
1282
+ if (l == null || Number.isNaN(Number(l))) return;
1283
+ const u = Number(l);
1284
+ (u < 0 || (n ? u > 360 : u >= 360)) && o.push(re({
1285
+ check: "azimuth_range",
1286
+ severity: me,
1287
+ holeId: i[r] != null ? String(i[r]) : null,
1288
+ table: "survey",
1289
+ rowIndex: a,
1290
+ message: `Azimuth ${u} outside ${s}`,
1291
+ fix: "Call normalizeAzimuth(survey) to wrap into [0, 360) or correct the source value"
1292
+ }));
1293
+ }), o;
1294
+ }
1295
+ function hn(e, r, t) {
1296
+ if (!e || !e.length) return [];
1297
+ const n = [];
1298
+ return e.forEach((s, o) => {
1299
+ const i = s && s[t];
1300
+ if (i == null || Number.isNaN(Number(i))) return;
1301
+ const a = Number(i);
1302
+ (a < -90 || a > 90) && n.push(re({
1303
+ check: "dip_range",
1304
+ severity: me,
1305
+ holeId: s[r] != null ? String(s[r]) : null,
1306
+ table: "survey",
1307
+ rowIndex: o,
1308
+ message: `Dip ${a} outside [-90, 90]`,
1309
+ fix: "Correct the source dip value"
1310
+ }));
1311
+ }), n;
1052
1312
  }
1053
- function Jt(e) {
1313
+ function pn(e, r, t, n) {
1314
+ if (!e || !e.length) return [];
1315
+ const s = [];
1316
+ return e.forEach((o, i) => {
1317
+ const a = o && o[n];
1318
+ a != null && (t.has(a) || s.push(re({
1319
+ check: "orphan_intervals",
1320
+ severity: me,
1321
+ holeId: String(a),
1322
+ table: r,
1323
+ rowIndex: i,
1324
+ message: `Hole '${a}' in '${r}' is not present in the collar table`,
1325
+ fix: "Call dropOrphanIntervals(table, collar) to remove these rows, or add the hole to the collar table"
1326
+ })));
1327
+ }), s;
1328
+ }
1329
+ function gn(e, r, t, n, s) {
1330
+ if (!e || !e.length) return [];
1331
+ const o = [];
1332
+ return e.forEach((i, a) => {
1333
+ const l = i && i[n], u = i && i[s];
1334
+ l == null || u == null || Number(u) <= Number(l) && o.push(re({
1335
+ check: "negative_lengths",
1336
+ severity: me,
1337
+ holeId: i[t] != null ? String(i[t]) : null,
1338
+ table: r,
1339
+ rowIndex: a,
1340
+ message: `Interval from=${l} to=${u} has zero or negative length`,
1341
+ fix: "Call swapInvertedIntervals(table) to fix data-entry typos where to<from; zero-length rows (to===from) require manual review"
1342
+ }));
1343
+ }), o;
1344
+ }
1345
+ function bn(e, r, t, n, s) {
1346
+ if (!t.size || !e || !e.length) return [];
1347
+ const o = [];
1348
+ return e.forEach((i, a) => {
1349
+ const l = i && i[n];
1350
+ if (l == null) return;
1351
+ const u = t.get(l);
1352
+ if (u == null) return;
1353
+ const c = i && i[s];
1354
+ c != null && Number(c) > u && o.push(re({
1355
+ check: "intervals_beyond_max_depth",
1356
+ severity: Ie,
1357
+ holeId: String(l),
1358
+ table: r,
1359
+ rowIndex: a,
1360
+ message: `Interval to=${c} exceeds collar max_depth=${u} for '${l}'`,
1361
+ fix: "Extend collar max_depth or clip the interval"
1362
+ }));
1363
+ }), o;
1364
+ }
1365
+ function yn(e, r, t, n, s) {
1366
+ return !e || !e.length ? [] : ln(e, { holeCol: t, fromCol: n, toCol: s }).map((o) => re({
1367
+ check: "interval_gaps",
1368
+ severity: Oe,
1369
+ holeId: String(o[t]),
1370
+ table: r,
1371
+ message: `Gap from ${o[n]} to ${o[s]} (${o.length.toFixed(3)} m) in '${r}'`,
1372
+ fix: "Re-sample the interval or document the gap"
1373
+ }));
1374
+ }
1375
+ function _n(e, r, t, n, s) {
1376
+ return !e || !e.length ? [] : cn(e, { holeCol: t, fromCol: n, toCol: s }).map((o) => re({
1377
+ check: "interval_overlaps",
1378
+ severity: Ie,
1379
+ holeId: String(o[t]),
1380
+ table: r,
1381
+ rowIndex: o.first_index,
1382
+ message: `Overlap from ${o[n]} to ${o[s]} (${o.length.toFixed(3)} m) between rows ${o.first_index} and ${o.second_index}`,
1383
+ fix: "Merge overlapping intervals or correct the from/to depths"
1384
+ }));
1385
+ }
1386
+ function Nn(e, r, t, n, s) {
1387
+ if (!e || !e.length) return [];
1388
+ const o = /* @__PURE__ */ new Set([t, n, s]), i = [];
1389
+ return e.forEach((a, l) => {
1390
+ if (a)
1391
+ for (const [u, c] of Object.entries(a))
1392
+ o.has(u) || typeof c == "string" && gt.test(c) && i.push(re({
1393
+ check: "below_detection_limit",
1394
+ severity: Oe,
1395
+ holeId: a[t] != null ? String(a[t]) : null,
1396
+ table: r,
1397
+ rowIndex: l,
1398
+ message: `Column '${u}' contains below-detection sentinel '${c}'`,
1399
+ fix: "Call replaceBelowDetectionLimit(rows, {columns: [...]}) to substitute MDL/2"
1400
+ }));
1401
+ }), i;
1402
+ }
1403
+ function Mr({ collar: e = [], survey: r = [], intervalTables: t = null } = {}, {
1404
+ holeCol: n = N,
1405
+ depthCol: s = j,
1406
+ azimuthCol: o = Y,
1407
+ dipCol: i = W,
1408
+ fromCol: a = S,
1409
+ toCol: l = M,
1410
+ maxDepthCol: u = it,
1411
+ allowFullCircle: c = !1
1412
+ } = {}) {
1413
+ const d = [];
1414
+ if (d.push(...dn(e, n)), d.push(...fn(r, n)), d.push(...mn(r, n, o, c)), d.push(...hn(r, n, i)), t) {
1415
+ const m = new Set(
1416
+ (e || []).map((h) => h && h[n]).filter((h) => h != null)
1417
+ ), g = bt(e, n, u);
1418
+ for (const [h, y] of Object.entries(t))
1419
+ d.push(...pn(y, h, m, n)), d.push(...gn(y, h, n, a, l)), d.push(...bn(y, h, g, n, l)), d.push(...yn(y, h, n, a, l)), d.push(..._n(y, h, n, a, l)), d.push(...Nn(y, h, n, a, l));
1420
+ }
1421
+ return { summary: {
1422
+ [me]: d.filter((m) => m.severity === me).length,
1423
+ [Ie]: d.filter((m) => m.severity === Ie).length,
1424
+ [Oe]: d.filter((m) => m.severity === Oe).length
1425
+ }, issues: d };
1426
+ }
1427
+ function Or(e, r, { holeCol: t = N, depthCol: n = j, maxDepthCol: s = it } = {}) {
1428
+ if (!e || !e.length) return [];
1429
+ const o = r ? bt(r, t, s) : /* @__PURE__ */ new Map(), i = yt(e, t), a = [];
1430
+ for (const [u, c] of i) {
1431
+ if (c.length !== 1) continue;
1432
+ const d = c[0], f = Number(d[n]);
1433
+ let m = o.get(u);
1434
+ (m == null || m <= f) && (m = f + 1), a.push({ ...d, [n]: m });
1435
+ }
1436
+ return [...e, ...a].sort((u, c) => {
1437
+ const d = String(u[t] ?? ""), f = String(c[t] ?? "");
1438
+ return d !== f ? d < f ? -1 : 1 : Number(u[n]) - Number(c[n]);
1439
+ });
1440
+ }
1441
+ function Dr(e, r, { holeCol: t = N } = {}) {
1442
+ if (!e || !e.length) return [];
1443
+ if (!r || !r.length) return [];
1444
+ const n = new Set(
1445
+ r.map((s) => s && s[t]).filter((s) => s != null)
1446
+ );
1447
+ return e.filter((s) => s && n.has(s[t]));
1448
+ }
1449
+ function Pr(e, { fromCol: r = S, toCol: t = M } = {}) {
1450
+ return !e || !e.length ? [] : e.map((n) => {
1451
+ if (!n) return n;
1452
+ const s = Number(n[r]), o = Number(n[t]);
1453
+ return Number.isFinite(s) && Number.isFinite(o) && o < s ? { ...n, [r]: o, [t]: s } : { ...n };
1454
+ });
1455
+ }
1456
+ function Rr(e, { azimuthCol: r = Y } = {}) {
1457
+ return !e || !e.length ? [] : e.map((t) => {
1458
+ if (!t) return t;
1459
+ const n = t[r];
1460
+ if (n == null) return { ...t };
1461
+ const s = Number(n);
1462
+ if (Number.isNaN(s)) return { ...t };
1463
+ const o = (s % 360 + 360) % 360;
1464
+ return { ...t, [r]: o };
1465
+ });
1466
+ }
1467
+ function $r(e, { columns: r = null, sentinelFactor: t = 0.5 } = {}) {
1468
+ if (!e || !e.length) return [];
1469
+ const n = r ? new Set(r) : null;
1470
+ return e.map((s) => {
1471
+ if (!s) return s;
1472
+ const o = { ...s };
1473
+ for (const [i, a] of Object.entries(s)) {
1474
+ if (n && !n.has(i) || typeof a != "string") continue;
1475
+ const l = gt.exec(a);
1476
+ l !== null && (o[i] = Number(l[1]) * t);
1477
+ }
1478
+ return o;
1479
+ });
1480
+ }
1481
+ const _t = ["depth", "md", "measured_depth", "dept", "z"];
1482
+ function vn(e) {
1483
+ if (e[j] !== void 0) {
1484
+ const n = Number(e[j]);
1485
+ if (Number.isFinite(n)) return n;
1486
+ }
1487
+ for (const n of _t)
1488
+ if (e[n] !== void 0) {
1489
+ const s = Number(e[n]);
1490
+ if (Number.isFinite(s)) return s;
1491
+ }
1492
+ const r = Number(e[S]), t = Number(e[M]);
1493
+ return Number.isFinite(r) && Number.isFinite(t) && t >= r ? (r + t) / 2 : null;
1494
+ }
1495
+ function En(e) {
1054
1496
  if (e.length === 0) return [];
1055
- const n = /* @__PURE__ */ new Set([N, V, M, O, ve, ...ct]);
1056
- return Object.keys(e[0]).filter((r) => !n.has(r)).filter((r) => {
1057
- let o = 0;
1058
- for (const i of e) {
1059
- const s = Number(i[r]);
1060
- Number.isFinite(s) && o++;
1497
+ const r = /* @__PURE__ */ new Set([N, j, S, M, Ae, ..._t]);
1498
+ return Object.keys(e[0]).filter((n) => !r.has(n)).filter((n) => {
1499
+ let s = 0;
1500
+ for (const o of e) {
1501
+ const i = Number(o[n]);
1502
+ Number.isFinite(i) && s++;
1061
1503
  }
1062
- return o / e.length > 0.5;
1504
+ return s / e.length > 0.5;
1063
1505
  });
1064
1506
  }
1065
- function tr(e, n = null) {
1066
- const r = J.parse(e, {
1507
+ function kr(e, r = null) {
1508
+ const n = J.parse(e, {
1067
1509
  header: !0,
1068
1510
  skipEmptyLines: !0,
1069
1511
  dynamicTyping: !1
1070
1512
  }).data || [];
1071
- if (r.length === 0) return [];
1072
- const o = r.map((l) => ie(l, null, n)), i = Jt(o), s = /* @__PURE__ */ new Map();
1073
- for (const l of o) {
1513
+ if (n.length === 0) return [];
1514
+ const s = n.map((l) => ae(l, null, r)), o = En(s), i = /* @__PURE__ */ new Map();
1515
+ for (const l of s) {
1074
1516
  const u = l[N] != null ? `${l[N]}`.trim() : "";
1075
1517
  if (!u) continue;
1076
- const c = Zt(l);
1077
- c === null || c < 0 || (s.has(u) || s.set(u, []), s.get(u).push({ depth: c, row: l }));
1518
+ const c = vn(l);
1519
+ c === null || c < 0 || (i.has(u) || i.set(u, []), i.get(u).push({ depth: c, row: l }));
1078
1520
  }
1079
1521
  const a = [];
1080
- for (const [l, u] of s) {
1081
- u.sort((d, m) => d.depth - m.depth);
1522
+ for (const [l, u] of i) {
1523
+ u.sort((d, f) => d.depth - f.depth);
1082
1524
  const c = {};
1083
- for (const d of i) {
1084
- const m = [], f = [];
1085
- for (const { depth: b, row: p } of u) {
1086
- const v = Number(p[d]);
1087
- Number.isFinite(v) && v !== et && (m.push(b), f.push(v));
1525
+ for (const d of o) {
1526
+ const f = [], m = [];
1527
+ for (const { depth: g, row: h } of u) {
1528
+ const y = Number(h[d]);
1529
+ Number.isFinite(y) && y !== at && (f.push(g), m.push(y));
1088
1530
  }
1089
- m.length >= 2 && (c[d] = { depths: m, values: f });
1531
+ f.length >= 2 && (c[d] = { depths: f, values: m });
1090
1532
  }
1091
1533
  Object.keys(c).length > 0 && a.push({ holeId: l, channels: c });
1092
1534
  }
1093
1535
  return a;
1094
1536
  }
1095
- function nr(e, n = null, t = {}) {
1096
- const r = [];
1097
- for (const { holeId: o, channels: i } of e) {
1098
- const s = n && i[n] ? n : Object.keys(i)[0];
1099
- if (!s) continue;
1100
- const { depths: a, values: l } = i[s];
1101
- r.push({ holeId: o, depths: a, values: l, options: t });
1537
+ function Cr(e, r = null, t = {}) {
1538
+ const n = [];
1539
+ for (const { holeId: s, channels: o } of e) {
1540
+ const i = r && o[r] ? r : Object.keys(o)[0];
1541
+ if (!i) continue;
1542
+ const { depths: a, values: l } = o[i];
1543
+ n.push({ holeId: s, depths: a, values: l, options: t });
1102
1544
  }
1103
- return r;
1545
+ return n;
1104
1546
  }
1105
- function ut(e) {
1106
- const n = e.indexOf(".");
1107
- if (n < 0) return null;
1108
- const t = e.slice(0, n).trim().toUpperCase(), r = e.slice(n + 1), o = r.match(/^(\S*)\s*(.*)/s), i = o ? o[1] : "", s = o ? o[2] : r, a = s.lastIndexOf(":"), l = a >= 0 ? s.slice(0, a).trim() : s.trim(), u = a >= 0 ? s.slice(a + 1).trim() : "";
1109
- return { mnem: t, unit: i, value: l, description: u };
1547
+ function Nt(e) {
1548
+ const r = e.indexOf(".");
1549
+ if (r < 0) return null;
1550
+ const t = e.slice(0, r).trim().toUpperCase(), n = e.slice(r + 1), s = n.match(/^(\S*)\s*(.*)/s), o = s ? s[1] : "", i = s ? s[2] : n, a = i.lastIndexOf(":"), l = a >= 0 ? i.slice(0, a).trim() : i.trim(), u = a >= 0 ? i.slice(a + 1).trim() : "";
1551
+ return { mnem: t, unit: o, value: l, description: u };
1110
1552
  }
1111
- function Qt(e) {
1112
- const n = [];
1553
+ function In(e) {
1554
+ const r = [];
1113
1555
  let t = null;
1114
- for (const r of e.split(/\r?\n/)) {
1115
- const o = r.trimEnd();
1116
- o.startsWith("~") ? (t = { type: o.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(o);
1556
+ for (const n of e.split(/\r?\n/)) {
1557
+ const s = n.trimEnd();
1558
+ s.startsWith("~") ? (t = { type: s.slice(1, 2).toUpperCase(), lines: [] }, r.push(t)) : t && t.lines.push(s);
1117
1559
  }
1118
- return n;
1560
+ return r;
1119
1561
  }
1120
- function Ye(e = []) {
1121
- const n = {};
1562
+ function Je(e = []) {
1563
+ const r = {};
1122
1564
  for (const t of e) {
1123
- const r = t.trimStart();
1124
- if (!r || r.startsWith("#")) continue;
1125
- const o = ut(t);
1126
- o && (n[o.mnem] = o);
1565
+ const n = t.trimStart();
1566
+ if (!n || n.startsWith("#")) continue;
1567
+ const s = Nt(t);
1568
+ s && (r[s.mnem] = s);
1127
1569
  }
1128
- return n;
1570
+ return r;
1129
1571
  }
1130
- function rr(e, n = {}) {
1131
- var g, L, C, j, H, $, D, R, G;
1132
- const t = Qt(e), r = t.find((h) => h.type === "V"), o = t.find((h) => h.type === "W"), i = t.find((h) => h.type === "C"), s = t.find((h) => h.type === "A");
1133
- if (!s) return [];
1134
- const a = Ye(r == null ? void 0 : r.lines), l = Ye(o == null ? void 0 : o.lines), u = [];
1135
- for (const h of (i == null ? void 0 : i.lines) ?? []) {
1136
- const P = h.trimStart();
1137
- if (!P || P.startsWith("#")) continue;
1138
- const A = ut(h);
1572
+ function zr(e, r = {}) {
1573
+ var p, E, x, F, w, k, $, P, H;
1574
+ const t = In(e), n = t.find((b) => b.type === "V"), s = t.find((b) => b.type === "W"), o = t.find((b) => b.type === "C"), i = t.find((b) => b.type === "A");
1575
+ if (!i) return [];
1576
+ const a = Je(n == null ? void 0 : n.lines), l = Je(s == null ? void 0 : s.lines), u = [];
1577
+ for (const b of (o == null ? void 0 : o.lines) ?? []) {
1578
+ const L = b.trimStart();
1579
+ if (!L || L.startsWith("#")) continue;
1580
+ const A = Nt(b);
1139
1581
  A && u.push(A);
1140
1582
  }
1141
- (((L = (g = a.WRAP) == null ? void 0 : g.value) == null ? void 0 : L.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1583
+ (((E = (p = a.WRAP) == null ? void 0 : p.value) == null ? void 0 : E.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1142
1584
  "parseLasFile: WRAP YES is not supported. Data rows may be read incorrectly."
1143
1585
  );
1144
- const d = n.holeId ?? (((j = (C = l.WELL) == null ? void 0 : C.value) == null ? void 0 : j.trim()) || null) ?? ((($ = (H = l.UWI) == null ? void 0 : H.value) == null ? void 0 : $.trim()) || null) ?? (((R = (D = l.API) == null ? void 0 : D.value) == null ? void 0 : R.trim()) || null) ?? "unknown";
1145
- let m = et;
1146
- if ((G = l.NULL) != null && G.value) {
1147
- const h = Number(l.NULL.value);
1148
- Number.isFinite(h) && (m = h);
1586
+ const d = r.holeId ?? (((F = (x = l.WELL) == null ? void 0 : x.value) == null ? void 0 : F.trim()) || null) ?? (((k = (w = l.UWI) == null ? void 0 : w.value) == null ? void 0 : k.trim()) || null) ?? (((P = ($ = l.API) == null ? void 0 : $.value) == null ? void 0 : P.trim()) || null) ?? "unknown";
1587
+ let f = at;
1588
+ if ((H = l.NULL) != null && H.value) {
1589
+ const b = Number(l.NULL.value);
1590
+ Number.isFinite(b) && (f = b);
1149
1591
  }
1150
- if (n.nullSentinel !== void 0 && (m = n.nullSentinel), u.length === 0) return [];
1151
- const f = u.slice(1), b = {};
1152
- for (const { mnem: h, unit: P } of f)
1153
- b[h.toLowerCase()] = P;
1154
- const p = {};
1155
- for (const { mnem: h } of f)
1156
- p[h.toLowerCase()] = { depths: [], values: [] };
1157
- for (const h of s.lines) {
1158
- const P = h.trimStart();
1159
- if (!P || P.startsWith("#")) continue;
1160
- const A = P.split(/\s+/);
1592
+ if (r.nullSentinel !== void 0 && (f = r.nullSentinel), u.length === 0) return [];
1593
+ const m = u.slice(1), g = {};
1594
+ for (const { mnem: b, unit: L } of m)
1595
+ g[b.toLowerCase()] = L;
1596
+ const h = {};
1597
+ for (const { mnem: b } of m)
1598
+ h[b.toLowerCase()] = { depths: [], values: [] };
1599
+ for (const b of i.lines) {
1600
+ const L = b.trimStart();
1601
+ if (!L || L.startsWith("#")) continue;
1602
+ const A = L.split(/\s+/);
1161
1603
  if (A.length < 2) continue;
1162
- const z = Number(A[0]);
1163
- if (!(!Number.isFinite(z) || z === m))
1164
- for (let E = 0; E < f.length; E++) {
1165
- const _ = f[E].mnem.toLowerCase(), y = Number(A[E + 1]);
1166
- Number.isFinite(y) && y !== m && (p[_].depths.push(z), p[_].values.push(y));
1604
+ const C = Number(A[0]);
1605
+ if (!(!Number.isFinite(C) || C === f))
1606
+ for (let I = 0; I < m.length; I++) {
1607
+ const v = m[I].mnem.toLowerCase(), _ = Number(A[I + 1]);
1608
+ Number.isFinite(_) && _ !== f && (h[v].depths.push(C), h[v].values.push(_));
1167
1609
  }
1168
1610
  }
1169
- const v = {};
1170
- for (const [h, P] of Object.entries(p))
1171
- P.depths.length >= 2 && (v[h] = P);
1172
- return Object.keys(v).length === 0 ? [] : [{ holeId: d, units: b, channels: v }];
1611
+ const y = {};
1612
+ for (const [b, L] of Object.entries(h))
1613
+ L.depths.length >= 2 && (y[b] = L);
1614
+ return Object.keys(y).length === 0 ? [] : [{ holeId: d, units: g, channels: y }];
1173
1615
  }
1174
- const dt = [
1616
+ const vt = [
1175
1617
  "#0f172a",
1176
1618
  "#1e3a5f",
1177
1619
  "#7c3aed",
@@ -1182,26 +1624,26 @@ const dt = [
1182
1624
  "#db2777",
1183
1625
  "#65a30d",
1184
1626
  "#9333ea"
1185
- ], en = { l: 42, r: 4, t: 4, b: 36 }, We = 10, qe = 11, tn = 6;
1186
- function mt(e = {}) {
1627
+ ], An = { l: 42, r: 4, t: 4, b: 36 }, Qe = 10, et = 11, Sn = 6;
1628
+ function Et(e = {}) {
1187
1629
  return {
1188
1630
  ...e,
1189
- margin: en,
1631
+ margin: An,
1190
1632
  autosize: !0,
1191
1633
  width: void 0,
1192
1634
  xaxis: {
1193
1635
  ...e.xaxis || {},
1194
1636
  tickfont: {
1195
1637
  ...e.xaxis && e.xaxis.tickfont || {},
1196
- size: We
1638
+ size: Qe
1197
1639
  },
1198
1640
  title: {
1199
1641
  ...e.xaxis && e.xaxis.title || {},
1200
1642
  font: {
1201
1643
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
1202
- size: qe
1644
+ size: et
1203
1645
  },
1204
- standoff: (e.xaxis && e.xaxis.title && e.xaxis.title.standoff) ?? tn
1646
+ standoff: (e.xaxis && e.xaxis.title && e.xaxis.title.standoff) ?? Sn
1205
1647
  }
1206
1648
  },
1207
1649
  yaxis: {
@@ -1209,66 +1651,66 @@ function mt(e = {}) {
1209
1651
  automargin: !0,
1210
1652
  tickfont: {
1211
1653
  ...e.yaxis && e.yaxis.tickfont || {},
1212
- size: We
1654
+ size: Qe
1213
1655
  },
1214
1656
  title: {
1215
1657
  ...e.yaxis && e.yaxis.title || {},
1216
1658
  font: {
1217
1659
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
1218
- size: qe
1660
+ size: et
1219
1661
  }
1220
1662
  }
1221
1663
  }
1222
1664
  };
1223
1665
  }
1224
- function nn(e, {
1225
- tailScale: n = 5,
1666
+ function Tn(e, {
1667
+ tailScale: r = 5,
1226
1668
  colorBy: t = null,
1227
- palette: r = dt,
1228
- depthCol: o = V,
1229
- dipCol: i = W,
1230
- azCol: s = Y,
1669
+ palette: n = vt,
1670
+ depthCol: s = j,
1671
+ dipCol: o = W,
1672
+ azCol: i = Y,
1231
1673
  template: a = void 0
1232
1674
  } = {}) {
1233
1675
  const l = e.filter(
1234
- (p) => p[o] != null && p[i] != null && p[s] != null
1676
+ (h) => h[s] != null && h[o] != null && h[i] != null
1235
1677
  );
1236
1678
  if (!l.length)
1237
1679
  return { data: [], layout: {} };
1238
1680
  const u = {};
1239
- t && [...new Set(l.map((v) => v[t]).filter((v) => v != null))].sort().forEach((v, g) => {
1240
- u[v] = r[g % r.length];
1681
+ t && [...new Set(l.map((y) => y[t]).filter((y) => y != null))].sort().forEach((y, p) => {
1682
+ u[y] = n[p % n.length];
1241
1683
  });
1242
1684
  const c = /* @__PURE__ */ new Map(), d = [];
1243
- for (const p of l) {
1244
- const v = Number(p[o]), g = Number(p[i]), L = Number(p[s]), C = t ? p[t] ?? "_default" : "_default", j = t ? u[C] ?? "#0f172a" : "#0f172a";
1245
- c.has(C) || c.set(C, { xs: [], ys: [], dips: [], azs: [], color: j });
1246
- const H = c.get(C);
1247
- H.xs.push(g), H.ys.push(v), H.dips.push(g), H.azs.push(L);
1248
- const $ = L * Math.PI / 180, D = n * (Math.abs(g) / 90), R = Math.sin($) * D, G = Math.cos($) * D;
1685
+ for (const h of l) {
1686
+ const y = Number(h[s]), p = Number(h[o]), E = Number(h[i]), x = t ? h[t] ?? "_default" : "_default", F = t ? u[x] ?? "#0f172a" : "#0f172a";
1687
+ c.has(x) || c.set(x, { xs: [], ys: [], dips: [], azs: [], color: F });
1688
+ const w = c.get(x);
1689
+ w.xs.push(p), w.ys.push(y), w.dips.push(p), w.azs.push(E);
1690
+ const k = E * Math.PI / 180, $ = r * (Math.abs(p) / 90), P = Math.sin(k) * $, H = Math.cos(k) * $;
1249
1691
  d.push({
1250
1692
  type: "line",
1251
- x0: g,
1252
- y0: v,
1253
- x1: g + R,
1254
- y1: v + G,
1255
- line: { color: j, width: 2 }
1693
+ x0: p,
1694
+ y0: y,
1695
+ x1: p + P,
1696
+ y1: y + H,
1697
+ line: { color: F, width: 2 }
1256
1698
  });
1257
1699
  }
1258
- const m = [], f = t && c.size > 1;
1259
- for (const [p, v] of c.entries())
1260
- m.push({
1700
+ const f = [], m = t && c.size > 1;
1701
+ for (const [h, y] of c.entries())
1702
+ f.push({
1261
1703
  type: "scatter",
1262
- x: v.xs,
1263
- y: v.ys,
1704
+ x: y.xs,
1705
+ y: y.ys,
1264
1706
  mode: "markers",
1265
- name: p !== "_default" ? String(p) : void 0,
1266
- marker: { size: 8, color: v.color },
1267
- showlegend: f && p !== "_default",
1268
- customdata: v.dips.map((g, L) => [g, v.azs[L]]),
1707
+ name: h !== "_default" ? String(h) : void 0,
1708
+ marker: { size: 8, color: y.color },
1709
+ showlegend: m && h !== "_default",
1710
+ customdata: y.dips.map((p, E) => [p, y.azs[E]]),
1269
1711
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
1270
1712
  });
1271
- return { data: m, layout: {
1713
+ return { data: f, layout: {
1272
1714
  shapes: d,
1273
1715
  height: 400,
1274
1716
  margin: { l: 40, r: 10, t: 10, b: 40 },
@@ -1280,39 +1722,39 @@ function nn(e, {
1280
1722
  tickvals: [-90, -60, -30, 0, 30, 60, 90]
1281
1723
  },
1282
1724
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1283
- showlegend: !!f,
1284
- template: a !== void 0 ? a : $e
1725
+ showlegend: !!m,
1726
+ template: a !== void 0 ? a : Ue
1285
1727
  } };
1286
1728
  }
1287
- function or(e, {
1288
- labelCol: n = "structure_type",
1289
- palette: t = dt,
1290
- fromCol: r = M,
1291
- toCol: o = O,
1292
- template: i = void 0
1729
+ function Fr(e, {
1730
+ labelCol: r = "structure_type",
1731
+ palette: t = vt,
1732
+ fromCol: n = S,
1733
+ toCol: s = M,
1734
+ template: o = void 0
1293
1735
  } = {}) {
1294
- const s = e.filter((m) => m[r] != null && m[o] != null && Number(m[o]) > Number(m[r])).filter((m) => {
1295
- const f = m[n];
1296
- if (f == null) return !1;
1297
- const b = String(f).trim();
1298
- return b !== "" && !/^(nan|null|none)$/i.test(b);
1299
- }).map((m) => ({ from: Number(m[r]), to: Number(m[o]), label: String(m[n]).trim() })).sort((m, f) => m.from - f.from);
1300
- if (!s.length)
1736
+ const i = e.filter((f) => f[n] != null && f[s] != null && Number(f[s]) > Number(f[n])).filter((f) => {
1737
+ const m = f[r];
1738
+ if (m == null) return !1;
1739
+ const g = String(m).trim();
1740
+ return g !== "" && !/^(nan|null|none)$/i.test(g);
1741
+ }).map((f) => ({ from: Number(f[n]), to: Number(f[s]), label: String(f[r]).trim() })).sort((f, m) => f.from - m.from);
1742
+ if (!i.length)
1301
1743
  return { data: [], layout: {} };
1302
1744
  const a = [], l = [], u = [];
1303
- return s.forEach((m, f) => {
1745
+ return i.forEach((f, m) => {
1304
1746
  a.push({
1305
1747
  type: "rect",
1306
1748
  xref: "x",
1307
1749
  yref: "y",
1308
1750
  x0: 0,
1309
1751
  x1: 1,
1310
- y0: m.from,
1311
- y1: m.to,
1312
- fillcolor: t[f % t.length],
1752
+ y0: f.from,
1753
+ y1: f.to,
1754
+ fillcolor: t[m % t.length],
1313
1755
  line: { width: 0 },
1314
1756
  layer: "below"
1315
- }), l.push(0.5 * (m.from + m.to)), u.push(m.label);
1757
+ }), l.push(0.5 * (f.from + f.to)), u.push(f.label);
1316
1758
  }), { data: [{
1317
1759
  type: "scatter",
1318
1760
  x: Array(u.length).fill(0.5),
@@ -1322,104 +1764,104 @@ function or(e, {
1322
1764
  textposition: "middle center",
1323
1765
  showlegend: !1,
1324
1766
  hoverinfo: "text"
1325
- }], layout: mt({
1767
+ }], layout: Et({
1326
1768
  shapes: a,
1327
1769
  height: 400,
1328
1770
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1329
1771
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1330
1772
  showlegend: !1,
1331
- template: i !== void 0 ? i : $e
1773
+ template: o !== void 0 ? o : Ue
1332
1774
  }) };
1333
1775
  }
1334
- function Xe(e, n) {
1776
+ function tt(e, r) {
1335
1777
  if (!e) return "";
1336
- const t = String(e).trim().split(/\s+/), r = [];
1337
- let o = "";
1338
- for (const i of t)
1339
- o && o.length + 1 + i.length > n ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
1340
- return o && r.push(o), r.join("<br>");
1341
- }
1342
- function rn(e, {
1343
- commentCol: n = "comments",
1344
- fromCol: t = M,
1345
- toCol: r = O,
1346
- bgColor: o = "#f1f5f9",
1347
- borderColor: i = "#cbd5e1",
1348
- textColor: s = "#1e293b",
1778
+ const t = String(e).trim().split(/\s+/), n = [];
1779
+ let s = "";
1780
+ for (const o of t)
1781
+ s && s.length + 1 + o.length > r ? (n.push(s), s = o) : s = s ? `${s} ${o}` : o;
1782
+ return s && n.push(s), n.join("<br>");
1783
+ }
1784
+ function xn(e, {
1785
+ commentCol: r = "comments",
1786
+ fromCol: t = S,
1787
+ toCol: n = M,
1788
+ bgColor: s = "#f1f5f9",
1789
+ borderColor: o = "#cbd5e1",
1790
+ textColor: i = "#1e293b",
1349
1791
  charsPerLine: a = 18,
1350
1792
  template: l = void 0
1351
1793
  } = {}) {
1352
- const u = e.filter((g) => g[t] != null && g[r] != null && Number(g[r]) > Number(g[t])).map((g) => {
1353
- const L = g[n], C = L != null && String(L).trim() !== "" && String(L) !== "null" ? String(L).trim() : "";
1354
- return { from: Number(g[t]), to: Number(g[r]), comment: C };
1355
- }).sort((g, L) => g.from - L.from);
1794
+ const u = e.filter((p) => p[t] != null && p[n] != null && Number(p[n]) > Number(p[t])).map((p) => {
1795
+ const E = p[r], x = E != null && String(E).trim() !== "" && String(E) !== "null" ? String(E).trim() : "";
1796
+ return { from: Number(p[t]), to: Number(p[n]), comment: x };
1797
+ }).sort((p, E) => p.from - E.from);
1356
1798
  if (!u.length)
1357
1799
  return { data: [], layout: {} };
1358
- const c = [], d = [], m = [], f = [], b = [];
1359
- for (const g of u) {
1360
- const L = 0.5 * (g.from + g.to), C = !!g.comment;
1800
+ const c = [], d = [], f = [], m = [], g = [];
1801
+ for (const p of u) {
1802
+ const E = 0.5 * (p.from + p.to), x = !!p.comment;
1361
1803
  c.push({
1362
1804
  type: "rect",
1363
1805
  xref: "x",
1364
1806
  yref: "y",
1365
1807
  x0: 0,
1366
1808
  x1: 1,
1367
- y0: g.from,
1368
- y1: g.to,
1369
- fillcolor: C ? o : "rgba(0,0,0,0)",
1370
- line: { color: i, width: 1 },
1809
+ y0: p.from,
1810
+ y1: p.to,
1811
+ fillcolor: x ? s : "rgba(0,0,0,0)",
1812
+ line: { color: o, width: 1 },
1371
1813
  layer: "below"
1372
- }), C && (d.push(0.5), m.push(L), f.push(Xe(g.comment, a)), b.push(`${g.from.toFixed(3)}–${g.to.toFixed(3)} m<br>${Xe(g.comment, 40)}`));
1814
+ }), x && (d.push(0.5), f.push(E), m.push(tt(p.comment, a)), g.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${tt(p.comment, 40)}`));
1373
1815
  }
1374
1816
  return { data: d.length ? [{
1375
1817
  type: "scatter",
1376
1818
  x: d,
1377
- y: m,
1819
+ y: f,
1378
1820
  mode: "text",
1379
- text: f,
1821
+ text: m,
1380
1822
  textposition: "middle center",
1381
- textfont: { color: s, size: 10 },
1382
- hovertext: b,
1823
+ textfont: { color: i, size: 10 },
1824
+ hovertext: g,
1383
1825
  hoverinfo: "text",
1384
1826
  showlegend: !1
1385
- }] : [], layout: mt({
1827
+ }] : [], layout: Et({
1386
1828
  shapes: c,
1387
1829
  height: 400,
1388
1830
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1389
1831
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1390
1832
  showlegend: !1,
1391
- template: l !== void 0 ? l : $e
1833
+ template: l !== void 0 ? l : Ue
1392
1834
  }) };
1393
1835
  }
1394
- function sr(e, {
1395
- symbolSize: n = 10,
1836
+ function wr(e, {
1837
+ symbolSize: r = 10,
1396
1838
  xCol: t = "easting",
1397
- yCol: r = "northing"
1839
+ yCol: n = "northing"
1398
1840
  } = {}) {
1399
- const o = e[t] != null ? Number(e[t]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[W] != null ? Number(e[W]) : null, a = e[Y] != null ? Number(e[Y]) : null;
1400
- if (o === null || i === null || s === null || a === null) return null;
1401
- const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, d = n * Math.sin(u), m = n * Math.cos(u), f = n * 0.4 * (s / 90), b = f * Math.sin(c), p = f * Math.cos(c);
1841
+ const s = e[t] != null ? Number(e[t]) : null, o = e[n] != null ? Number(e[n]) : null, i = e[W] != null ? Number(e[W]) : null, a = e[Y] != null ? Number(e[Y]) : null;
1842
+ if (s === null || o === null || i === null || a === null) return null;
1843
+ const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, d = r * Math.sin(u), f = r * Math.cos(u), m = r * 0.4 * (i / 90), g = m * Math.sin(c), h = m * Math.cos(c);
1402
1844
  return {
1403
1845
  strike: l,
1404
- dipValue: s,
1405
- x: o,
1406
- y: i,
1407
- strikeX0: o - d,
1408
- strikeY0: i - m,
1409
- strikeX1: o + d,
1410
- strikeY1: i + m,
1411
- tickX1: o + b,
1412
- tickY1: i + p
1846
+ dipValue: i,
1847
+ x: s,
1848
+ y: o,
1849
+ strikeX0: s - d,
1850
+ strikeY0: o - f,
1851
+ strikeX1: s + d,
1852
+ strikeY1: o + f,
1853
+ tickX1: s + g,
1854
+ tickY1: o + h
1413
1855
  };
1414
1856
  }
1415
- function on({
1857
+ function Ln({
1416
1858
  holeId: e,
1417
- hole: n,
1859
+ hole: r,
1418
1860
  holeOptions: t,
1419
- property: r,
1420
- propertyOptions: o,
1421
- displayType: i,
1422
- points: s,
1861
+ property: n,
1862
+ propertyOptions: s,
1863
+ displayType: o,
1864
+ points: i,
1423
1865
  renderError: a
1424
1866
  }) {
1425
1867
  if (a)
@@ -1427,80 +1869,80 @@ function on({
1427
1869
  const l = t || [];
1428
1870
  if (!e)
1429
1871
  return l.length === 0 ? { kind: "placeholder", text: "No holes loaded" } : { kind: "placeholder", text: "Select a hole" };
1430
- if (!n)
1872
+ if (!r)
1431
1873
  return { kind: "placeholder", text: `Loading ${e}…` };
1432
- const u = o || [];
1433
- return r ? !(i === ze) && !(i === tt) && (s || []).length === 0 ? { kind: "placeholder", text: `No values for ${r} in hole ${e}` } : { kind: "chart" } : u.length === 0 ? { kind: "placeholder", text: `No properties available for hole ${e}` } : { kind: "placeholder", text: "Select a property" };
1434
- }
1435
- function ft(e, n) {
1436
- if (typeof n == "function") return n(e);
1437
- if (!(typeof n != "string" || !n) && !(e == null || typeof e != "object"))
1438
- return e[n];
1439
- }
1440
- function sn(e, n) {
1441
- const t = [], r = /* @__PURE__ */ new Set();
1442
- for (const o of e || []) {
1443
- const i = ft(o, n);
1444
- i == null || i === "" || r.has(i) || (r.add(i), t.push(i));
1874
+ const u = s || [];
1875
+ return n ? !(o === we) && !(o === lt) && (i || []).length === 0 ? { kind: "placeholder", text: `No values for ${n} in hole ${e}` } : { kind: "chart" } : u.length === 0 ? { kind: "placeholder", text: `No properties available for hole ${e}` } : { kind: "placeholder", text: "Select a property" };
1876
+ }
1877
+ function It(e, r) {
1878
+ if (typeof r == "function") return r(e);
1879
+ if (!(typeof r != "string" || !r) && !(e == null || typeof e != "object"))
1880
+ return e[r];
1881
+ }
1882
+ function Mn(e, r) {
1883
+ const t = [], n = /* @__PURE__ */ new Set();
1884
+ for (const s of e || []) {
1885
+ const o = It(s, r);
1886
+ o == null || o === "" || n.has(o) || (n.add(o), t.push(o));
1445
1887
  }
1446
1888
  return t;
1447
1889
  }
1448
- function an(e, n, t) {
1449
- return t == null || t === "" ? e || [] : (e || []).filter((r) => ft(r, n) === t);
1890
+ function On(e, r, t) {
1891
+ return t == null || t === "" ? e || [] : (e || []).filter((n) => It(n, r) === t);
1450
1892
  }
1451
- function ln({
1893
+ function Dn({
1452
1894
  chartOptions: e,
1453
- showHoleSelect: n,
1895
+ showHoleSelect: r,
1454
1896
  showPropertySelect: t,
1455
- showChartTypeSelect: r
1897
+ showChartTypeSelect: n
1456
1898
  }) {
1457
1899
  return {
1458
- hole: n !== !1,
1900
+ hole: r !== !1,
1459
1901
  property: t !== !1,
1460
- chartType: r !== !1 && (e || []).length > 1
1902
+ chartType: n !== !1 && (e || []).length > 1
1461
1903
  };
1462
1904
  }
1463
- const ht = "markers+line";
1464
- function cn(e, n) {
1465
- var r;
1466
- const t = nt(e);
1467
- return t.some((o) => o.value === n) ? n : ((r = t[0]) == null ? void 0 : r.value) || ht;
1468
- }
1469
- function Ke(e) {
1470
- const n = typeof e == "string" ? e : e.holeId, t = typeof e == "string" ? e : e.label || e.holeId;
1471
- return [n, t];
1472
- }
1473
- function Ze(e) {
1474
- const n = typeof e == "string" ? e : e.value, t = typeof e == "string" ? e : e.label ?? e.value;
1475
- return [n, t];
1476
- }
1477
- function un({ selector: e, holeOptions: n, selectedHoleId: t, onConfigChange: r }) {
1478
- const o = (e == null ? void 0 : e.kind) || "hole";
1479
- if (o === "field") {
1480
- const s = e.value ?? "", a = e.options || [], l = e.label || "Selection";
1481
- return /* @__PURE__ */ w(
1905
+ const At = "markers+line";
1906
+ function Pn(e, r) {
1907
+ var n;
1908
+ const t = ct(e);
1909
+ return t.some((s) => s.value === r) ? r : ((n = t[0]) == null ? void 0 : n.value) || At;
1910
+ }
1911
+ function nt(e) {
1912
+ const r = typeof e == "string" ? e : e.holeId, t = typeof e == "string" ? e : e.label || e.holeId;
1913
+ return [r, t];
1914
+ }
1915
+ function rt(e) {
1916
+ const r = typeof e == "string" ? e : e.value, t = typeof e == "string" ? e : e.label ?? e.value;
1917
+ return [r, t];
1918
+ }
1919
+ function Rn({ selector: e, holeOptions: r, selectedHoleId: t, onConfigChange: n }) {
1920
+ const s = (e == null ? void 0 : e.kind) || "hole";
1921
+ if (s === "field") {
1922
+ const i = e.value ?? "", a = e.options || [], l = e.label || "Selection";
1923
+ return /* @__PURE__ */ U(
1482
1924
  "select",
1483
1925
  {
1484
1926
  className: "plot-select plot-select--field",
1485
- value: s,
1927
+ value: i,
1486
1928
  onChange: (u) => e.onChange && e.onChange(u.target.value),
1487
1929
  disabled: a.length === 0,
1488
1930
  "aria-label": l,
1489
1931
  children: [
1490
- a.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "—" }),
1491
- !s && a.length > 0 && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1932
+ a.length === 0 && /* @__PURE__ */ T("option", { value: "", children: "—" }),
1933
+ !i && a.length > 0 && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1492
1934
  a.map((u) => {
1493
- const [c, d] = Ze(u);
1494
- return /* @__PURE__ */ S("option", { value: c, children: d }, c);
1935
+ const [c, d] = rt(u);
1936
+ return /* @__PURE__ */ T("option", { value: c, children: d }, c);
1495
1937
  })
1496
1938
  ]
1497
1939
  }
1498
1940
  );
1499
1941
  }
1500
- if (o === "group+hole") {
1501
- const s = e.groupBy, a = e.groupValue ?? "", l = e.groupLabel || "Group", u = e.groupOptions || sn(n, s), c = an(n, s, a);
1502
- return /* @__PURE__ */ w(Ct, { children: [
1503
- /* @__PURE__ */ w(
1942
+ if (s === "group+hole") {
1943
+ const i = e.groupBy, a = e.groupValue ?? "", l = e.groupLabel || "Group", u = e.groupOptions || Mn(r, i), c = On(r, i, a);
1944
+ return /* @__PURE__ */ U(Ft, { children: [
1945
+ /* @__PURE__ */ U(
1504
1946
  "select",
1505
1947
  {
1506
1948
  className: "plot-select plot-select--group",
@@ -1509,554 +1951,554 @@ function un({ selector: e, holeOptions: n, selectedHoleId: t, onConfigChange: r
1509
1951
  disabled: u.length === 0,
1510
1952
  "aria-label": l,
1511
1953
  children: [
1512
- u.length === 0 && /* @__PURE__ */ w("option", { value: "", children: [
1954
+ u.length === 0 && /* @__PURE__ */ U("option", { value: "", children: [
1513
1955
  "No ",
1514
1956
  l.toLowerCase(),
1515
1957
  "s"
1516
1958
  ] }),
1517
- !a && u.length > 0 && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1959
+ !a && u.length > 0 && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1518
1960
  u.map((d) => {
1519
- const [m, f] = Ze(d);
1520
- return /* @__PURE__ */ S("option", { value: m, children: f }, m);
1961
+ const [f, m] = rt(d);
1962
+ return /* @__PURE__ */ T("option", { value: f, children: m }, f);
1521
1963
  })
1522
1964
  ]
1523
1965
  }
1524
1966
  ),
1525
- /* @__PURE__ */ w(
1967
+ /* @__PURE__ */ U(
1526
1968
  "select",
1527
1969
  {
1528
1970
  className: "plot-select plot-select--hole",
1529
1971
  value: t,
1530
- onChange: (d) => r && r({ holeId: d.target.value }),
1972
+ onChange: (d) => n && n({ holeId: d.target.value }),
1531
1973
  disabled: c.length === 0,
1532
1974
  "aria-label": "Hole",
1533
1975
  children: [
1534
- c.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "No holes" }),
1535
- !t && c.length > 0 && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1976
+ c.length === 0 && /* @__PURE__ */ T("option", { value: "", children: "No holes" }),
1977
+ !t && c.length > 0 && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1536
1978
  c.map((d) => {
1537
- const [m, f] = Ke(d);
1538
- return /* @__PURE__ */ S("option", { value: m, children: f }, m);
1979
+ const [f, m] = nt(d);
1980
+ return /* @__PURE__ */ T("option", { value: f, children: m }, f);
1539
1981
  })
1540
1982
  ]
1541
1983
  }
1542
1984
  )
1543
1985
  ] });
1544
1986
  }
1545
- const i = n.length > 0;
1546
- return /* @__PURE__ */ w(
1987
+ const o = r.length > 0;
1988
+ return /* @__PURE__ */ U(
1547
1989
  "select",
1548
1990
  {
1549
1991
  className: "plot-select plot-select--hole",
1550
1992
  value: t,
1551
- onChange: (s) => r && r({ holeId: s.target.value }),
1552
- disabled: !i,
1993
+ onChange: (i) => n && n({ holeId: i.target.value }),
1994
+ disabled: !o,
1553
1995
  "aria-label": "Hole",
1554
1996
  children: [
1555
- !i && /* @__PURE__ */ S("option", { value: "", children: "No holes loaded" }),
1556
- !t && i && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1557
- n.map((s) => {
1558
- const [a, l] = Ke(s);
1559
- return /* @__PURE__ */ S("option", { value: a, children: l }, a);
1997
+ !o && /* @__PURE__ */ T("option", { value: "", children: "No holes loaded" }),
1998
+ !t && o && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1999
+ r.map((i) => {
2000
+ const [a, l] = nt(i);
2001
+ return /* @__PURE__ */ T("option", { value: a, children: l }, a);
1560
2002
  })
1561
2003
  ]
1562
2004
  }
1563
2005
  );
1564
2006
  }
1565
- function ir({
2007
+ function Hr({
1566
2008
  config: e,
1567
- graph: n,
2009
+ graph: r,
1568
2010
  holeOptions: t = [],
1569
- propertyOptions: r = [],
1570
- propertyMeta: o,
1571
- onConfigChange: i,
1572
- template: s,
2011
+ propertyOptions: n = [],
2012
+ propertyMeta: s,
2013
+ onConfigChange: o,
2014
+ template: i,
1573
2015
  showHoleSelect: a = !0,
1574
2016
  showPropertySelect: l = !0,
1575
2017
  showChartTypeSelect: u = !0,
1576
2018
  holeSelector: c
1577
2019
  }) {
1578
- const d = ye(null), m = ye(null), f = n == null ? void 0 : n.hole, b = (n == null ? void 0 : n.points) || [], p = (e == null ? void 0 : e.property) || "", v = o == null ? void 0 : o[p], g = (e == null ? void 0 : e.chartType) || ht, L = (e == null ? void 0 : e.holeId) || "", C = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? ze : n != null && n.isCategorical ? Ge : At), j = nt(C), H = cn(C, g), [$, D] = K(""), [R, G] = K({ width: 0, height: 0 }), h = on({
1579
- holeId: L,
1580
- hole: f,
2020
+ const d = Ne(null), f = Ne(null), m = r == null ? void 0 : r.hole, g = (r == null ? void 0 : r.points) || [], h = (e == null ? void 0 : e.property) || "", y = s == null ? void 0 : s[h], p = (e == null ? void 0 : e.chartType) || At, E = (e == null ? void 0 : e.holeId) || "", x = (r == null ? void 0 : r.displayType) || (r != null && r.isComment ? we : r != null && r.isCategorical ? We : Rt), F = ct(x), w = Pn(x, p), [k, $] = K(""), [P, H] = K({ width: 0, height: 0 }), b = Ln({
2021
+ holeId: E,
2022
+ hole: m,
1581
2023
  holeOptions: t,
1582
- property: p,
1583
- propertyOptions: r,
1584
- displayType: C,
1585
- points: b,
1586
- renderError: $
1587
- }), P = h.kind !== "chart", A = ln({
1588
- chartOptions: j,
2024
+ property: h,
2025
+ propertyOptions: n,
2026
+ displayType: x,
2027
+ points: g,
2028
+ renderError: k
2029
+ }), L = b.kind !== "chart", A = Dn({
2030
+ chartOptions: F,
1589
2031
  showHoleSelect: a,
1590
2032
  showPropertySelect: l,
1591
2033
  showChartTypeSelect: u
1592
- }), z = r.length > 0;
2034
+ }), C = n.length > 0;
1593
2035
  return te(() => {
1594
- const E = d.current;
1595
- if (!E || typeof ResizeObserver > "u") return;
1596
- let _ = 0;
1597
- const y = () => {
1598
- _ && cancelAnimationFrame(_), _ = requestAnimationFrame(() => {
1599
- const F = Math.max(0, Math.floor(E.clientWidth)), T = Math.max(0, Math.floor(E.clientHeight));
1600
- G((x) => x.width === F && x.height === T ? x : { width: F, height: T });
2036
+ const I = d.current;
2037
+ if (!I || typeof ResizeObserver > "u") return;
2038
+ let v = 0;
2039
+ const _ = () => {
2040
+ v && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
2041
+ const z = Math.max(0, Math.floor(I.clientWidth)), O = Math.max(0, Math.floor(I.clientHeight));
2042
+ H((R) => R.width === z && R.height === O ? R : { width: z, height: O });
1601
2043
  });
1602
2044
  };
1603
- y();
1604
- const I = new ResizeObserver(y);
1605
- return I.observe(E), () => {
1606
- _ && cancelAnimationFrame(_), I.disconnect();
2045
+ _();
2046
+ const D = new ResizeObserver(_);
2047
+ return D.observe(I), () => {
2048
+ v && cancelAnimationFrame(v), D.disconnect();
1607
2049
  };
1608
2050
  }, []), te(() => {
1609
- if (h.kind !== "chart") return;
1610
- const E = m.current;
1611
- if (!E || R.width <= 0 || R.height <= 0) return;
1612
- const _ = C === ze, y = C === tt;
1613
- let I;
2051
+ if (b.kind !== "chart") return;
2052
+ const I = f.current;
2053
+ if (!I || P.width <= 0 || P.height <= 0) return;
2054
+ const v = x === we, _ = x === lt;
2055
+ let D;
1614
2056
  try {
1615
- _ ? I = rn(b, { commentCol: p, fromCol: "from", toCol: "to" }) : y ? I = nn(b) : I = St({
1616
- points: b,
1617
- isCategorical: C === Ge,
1618
- property: p,
1619
- chartType: H,
1620
- template: s,
1621
- meta: v
2057
+ v ? D = xn(g, { commentCol: h, fromCol: "from", toCol: "to" }) : _ ? D = Tn(g) : D = $t({
2058
+ points: g,
2059
+ isCategorical: x === We,
2060
+ property: h,
2061
+ chartType: w,
2062
+ template: i,
2063
+ meta: y
1622
2064
  });
1623
- } catch (x) {
1624
- console.error("Plot build error", x), D((x == null ? void 0 : x.message) || "Plot build error");
2065
+ } catch (R) {
2066
+ console.error("Plot build error", R), $((R == null ? void 0 : R.message) || "Plot build error");
1625
2067
  return;
1626
2068
  }
1627
- if ((!(I != null && I.data) || I.data.length === 0) && !_)
2069
+ if ((!(D != null && D.data) || D.data.length === 0) && !v)
1628
2070
  return;
1629
- const F = {
2071
+ const z = {
1630
2072
  displayModeBar: !0,
1631
2073
  responsive: !1,
1632
2074
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
1633
- }, T = {
1634
- ...I.layout,
2075
+ }, O = {
2076
+ ...D.layout,
1635
2077
  autosize: !1,
1636
- width: R.width,
1637
- height: R.height
2078
+ width: P.width,
2079
+ height: P.height
1638
2080
  };
1639
2081
  try {
1640
- D(""), Oe.react(E, I.data, T, F);
1641
- } catch (x) {
1642
- console.error("Plot render error", x), D((x == null ? void 0 : x.message) || "Plot render error");
2082
+ $(""), ke.react(I, D.data, O, z);
2083
+ } catch (R) {
2084
+ console.error("Plot render error", R), $((R == null ? void 0 : R.message) || "Plot render error");
1643
2085
  }
1644
2086
  return () => {
1645
- if (E)
2087
+ if (I)
1646
2088
  try {
1647
- Oe.purge(E);
1648
- } catch (x) {
1649
- console.warn("Plot purge error", x);
2089
+ ke.purge(I);
2090
+ } catch (R) {
2091
+ console.warn("Plot purge error", R);
1650
2092
  }
1651
2093
  };
1652
2094
  }, [
1653
- h.kind,
1654
- f,
1655
- p,
1656
- v,
1657
- H,
1658
- C,
1659
- b,
1660
- s,
1661
- R.width,
1662
- R.height
2095
+ b.kind,
2096
+ m,
2097
+ h,
2098
+ y,
2099
+ w,
2100
+ x,
2101
+ g,
2102
+ i,
2103
+ P.width,
2104
+ P.height
1663
2105
  ]), te(() => {
1664
- const E = m.current;
1665
- if (!E || typeof ResizeObserver > "u") return;
1666
- const _ = new ResizeObserver(() => {
2106
+ const I = f.current;
2107
+ if (!I || typeof ResizeObserver > "u") return;
2108
+ const v = new ResizeObserver(() => {
1667
2109
  try {
1668
- if (E && E.data) {
1669
- const y = Math.max(0, Math.floor(E.clientWidth)), I = Math.max(0, Math.floor(E.clientHeight));
1670
- y > 0 && I > 0 && Oe.relayout(E, { width: y, height: I, autosize: !1 });
2110
+ if (I && I.data) {
2111
+ const _ = Math.max(0, Math.floor(I.clientWidth)), D = Math.max(0, Math.floor(I.clientHeight));
2112
+ _ > 0 && D > 0 && ke.relayout(I, { width: _, height: D, autosize: !1 });
1671
2113
  }
1672
- } catch (y) {
1673
- console.warn("Plot resize error", y);
2114
+ } catch (_) {
2115
+ console.warn("Plot resize error", _);
1674
2116
  }
1675
2117
  });
1676
- return _.observe(E), () => _.disconnect();
1677
- }, [h.kind]), /* @__PURE__ */ w("div", { className: `plot-card${P ? " empty" : ""}`, children: [
1678
- /* @__PURE__ */ w("header", { className: "plot-card__controls", children: [
1679
- A.hole && /* @__PURE__ */ S("div", { className: "plot-title", children: un({
2118
+ return v.observe(I), () => v.disconnect();
2119
+ }, [b.kind]), /* @__PURE__ */ U("div", { className: `plot-card${L ? " empty" : ""}`, children: [
2120
+ /* @__PURE__ */ U("header", { className: "plot-card__controls", children: [
2121
+ A.hole && /* @__PURE__ */ T("div", { className: "plot-title", children: Rn({
1680
2122
  selector: c,
1681
2123
  holeOptions: t,
1682
- selectedHoleId: L,
1683
- onConfigChange: i
2124
+ selectedHoleId: E,
2125
+ onConfigChange: o
1684
2126
  }) }),
1685
- (A.property || A.chartType) && /* @__PURE__ */ w("div", { className: "plot-controls column", children: [
1686
- A.property && /* @__PURE__ */ w(
2127
+ (A.property || A.chartType) && /* @__PURE__ */ U("div", { className: "plot-controls column", children: [
2128
+ A.property && /* @__PURE__ */ U(
1687
2129
  "select",
1688
2130
  {
1689
2131
  className: "plot-select plot-select--property",
1690
- value: p,
1691
- onChange: (E) => i && i({ property: E.target.value }),
1692
- disabled: !z,
2132
+ value: h,
2133
+ onChange: (I) => o && o({ property: I.target.value }),
2134
+ disabled: !C,
1693
2135
  "aria-label": "Property",
1694
2136
  children: [
1695
- !z && /* @__PURE__ */ S("option", { value: "", children: "—" }),
1696
- !p && z && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: "Select a property" }),
1697
- r.map((E) => /* @__PURE__ */ S("option", { value: E, children: Tt(E, o == null ? void 0 : o[E]) }, E))
2137
+ !C && /* @__PURE__ */ T("option", { value: "", children: "—" }),
2138
+ !h && C && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: "Select a property" }),
2139
+ n.map((I) => /* @__PURE__ */ T("option", { value: I, children: kt(I, s == null ? void 0 : s[I]) }, I))
1698
2140
  ]
1699
2141
  }
1700
2142
  ),
1701
- A.chartType && /* @__PURE__ */ S(
2143
+ A.chartType && /* @__PURE__ */ T(
1702
2144
  "select",
1703
2145
  {
1704
2146
  className: "plot-select plot-select--chart-type",
1705
- value: H,
1706
- onChange: (E) => i && i({ chartType: E.target.value }),
2147
+ value: w,
2148
+ onChange: (I) => o && o({ chartType: I.target.value }),
1707
2149
  "aria-label": "Chart type",
1708
- children: j.map((E) => /* @__PURE__ */ S("option", { value: E.value, children: E.label }, E.value))
2150
+ children: F.map((I) => /* @__PURE__ */ T("option", { value: I.value, children: I.label }, I.value))
1709
2151
  }
1710
2152
  )
1711
2153
  ] })
1712
2154
  ] }),
1713
- /* @__PURE__ */ S("div", { className: "plot-card__body", ref: d, children: h.kind === "chart" ? /* @__PURE__ */ S("div", { className: "plotly-chart", ref: m }) : /* @__PURE__ */ S("div", { className: "placeholder", children: h.text }) })
2155
+ /* @__PURE__ */ T("div", { className: "plot-card__body", ref: d, children: b.kind === "chart" ? /* @__PURE__ */ T("div", { className: "plotly-chart", ref: f }) : /* @__PURE__ */ T("div", { className: "placeholder", children: b.text }) })
1714
2156
  ] });
1715
2157
  }
1716
- function Je(e, n) {
1717
- if (!(n != null && n.length)) return e;
1718
- const t = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
1719
- for (const r of n) {
1720
- const o = r.id || r.holeId;
1721
- if (o)
1722
- if (t.has(o)) {
1723
- const i = t.get(o);
1724
- t.set(o, { ...i, points: [...i.points || [], ...r.points || []] });
2158
+ function st(e, r) {
2159
+ if (!(r != null && r.length)) return e;
2160
+ const t = new Map(e.map((n) => [n.id || n.holeId, { ...n }]));
2161
+ for (const n of r) {
2162
+ const s = n.id || n.holeId;
2163
+ if (s)
2164
+ if (t.has(s)) {
2165
+ const o = t.get(s);
2166
+ t.set(s, { ...o, points: [...o.points || [], ...n.points || []] });
1725
2167
  } else
1726
- t.set(o, r);
2168
+ t.set(s, n);
1727
2169
  }
1728
2170
  return Array.from(t.values());
1729
2171
  }
1730
- function dn(e, n) {
1731
- if (!e || !n) return [];
1732
- const t = /* @__PURE__ */ new Set(), r = [];
1733
- for (const o of e.points || []) {
1734
- const i = Number(o.from ?? o.samp_from ?? o.depth_from ?? o.from_depth), s = Number(o.to ?? o.samp_to ?? o.depth_to ?? o.to_depth);
1735
- if (!Number.isFinite(i) || !Number.isFinite(s) || s <= i) continue;
1736
- const a = `${i}-${s}`;
1737
- t.has(a) || (t.add(a), r.push({ from: i, to: s, [n]: o[n] ?? "" }));
2172
+ function $n(e, r) {
2173
+ if (!e || !r) return [];
2174
+ const t = /* @__PURE__ */ new Set(), n = [];
2175
+ for (const s of e.points || []) {
2176
+ const o = Number(s.from ?? s.samp_from ?? s.depth_from ?? s.from_depth), i = Number(s.to ?? s.samp_to ?? s.depth_to ?? s.to_depth);
2177
+ if (!Number.isFinite(o) || !Number.isFinite(i) || i <= o) continue;
2178
+ const a = `${o}-${i}`;
2179
+ t.has(a) || (t.add(a), n.push({ from: o, to: i, [r]: s[r] ?? "" }));
1738
2180
  }
1739
- return r;
2181
+ return n;
1740
2182
  }
1741
- function ar({
2183
+ function Br({
1742
2184
  initialFocusedHoleId: e = "",
1743
- sourceFile: n = null,
2185
+ sourceFile: r = null,
1744
2186
  extraHoles: t = [],
1745
- plotCount: r = 4
2187
+ plotCount: n = 4
1746
2188
  } = {}) {
1747
- const [o, i] = K([]), [s, a] = K([]), [l, u] = K([]), [c, d] = K([]), [m, f] = K([]), [b, p] = K({}), [v, g] = K(""), [L, C] = K([]), [j, H] = K(""), [$, D] = K(e || ""), [R, G] = K([]), h = ye(null);
2189
+ const [s, o] = K([]), [i, a] = K([]), [l, u] = K([]), [c, d] = K([]), [f, m] = K([]), [g, h] = K({}), [y, p] = K(""), [E, x] = K([]), [F, w] = K(""), [k, $] = K(e || ""), [P, H] = K([]), b = Ne(null);
1748
2190
  te(() => {
1749
- !n || h.current === n || (h.current = n, Ft(n).then((_) => {
1750
- if (!_) return;
1751
- const y = Array.from(new Map(_.map((I) => [I.holeId, I])).values());
1752
- a(y), C(it({
1753
- holeIds: y.map((I) => I.holeId),
1754
- focusedHoleId: $,
1755
- plotCount: r,
2191
+ !r || b.current === r || (b.current = r, Yt(r).then((v) => {
2192
+ if (!v) return;
2193
+ const _ = Array.from(new Map(v.map((D) => [D.holeId, D])).values());
2194
+ a(_), x(mt({
2195
+ holeIds: _.map((D) => D.holeId),
2196
+ focusedHoleId: k,
2197
+ plotCount: n,
1756
2198
  defaultProp: "",
1757
2199
  categoricalProps: c,
1758
- commentProps: m,
2200
+ commentProps: f,
1759
2201
  numericDefaultChartType: "markers+line"
1760
2202
  }));
1761
- }).catch((_) => {
1762
- console.info("Assay metadata load skipped:", _.message);
2203
+ }).catch((v) => {
2204
+ console.info("Assay metadata load skipped:", v.message);
1763
2205
  }));
1764
- }, [n, $, r, c, m]), te(() => {
2206
+ }, [r, k, n, c, f]), te(() => {
1765
2207
  if (!(t != null && t.length)) return;
1766
- const _ = t.map((y) => ({ holeId: y.id || y.holeId })).filter((y) => y.holeId);
1767
- a((y) => {
1768
- const I = new Set(y.map((T) => T.holeId)), F = _.filter((T) => !I.has(T.holeId));
1769
- return F.length ? [...y, ...F] : y;
2208
+ const v = t.map((_) => ({ holeId: _.id || _.holeId })).filter((_) => _.holeId);
2209
+ a((_) => {
2210
+ const D = new Set(_.map((O) => O.holeId)), z = v.filter((O) => !D.has(O.holeId));
2211
+ return z.length ? [..._, ...z] : _;
1770
2212
  });
1771
2213
  }, [t]), te(() => {
1772
- H((_) => _ && _.startsWith("Loading ") && _.includes(" for hole ") ? _ : "");
1773
- }, [L]), te(() => {
1774
- if (!s.length) {
1775
- C([]);
2214
+ w((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
2215
+ }, [E]), te(() => {
2216
+ if (!i.length) {
2217
+ x([]);
1776
2218
  return;
1777
2219
  }
1778
- const _ = st(s.map((y) => y.holeId), $);
1779
- C((y) => Array.from({ length: r }).map((F, T) => {
2220
+ const v = ft(i.map((_) => _.holeId), k);
2221
+ x((_) => Array.from({ length: n }).map((z, O) => {
1780
2222
  var X;
1781
- const x = y[T] || {}, B = s.some((ae) => ae.holeId === x.holeId) ? x.holeId : _[T] || ((X = s[T]) == null ? void 0 : X.holeId) || "", k = x.property || v, q = Se({
1782
- property: k,
1783
- chartType: x.chartType,
2223
+ const R = _[O] || {}, V = i.some((le) => le.holeId === R.holeId) ? R.holeId : v[O] || ((X = i[O]) == null ? void 0 : X.holeId) || "", B = R.property || y, q = xe({
2224
+ property: B,
2225
+ chartType: R.chartType,
1784
2226
  categoricalProps: c,
1785
- commentProps: m,
2227
+ commentProps: f,
1786
2228
  numericDefaultChartType: "markers+line"
1787
2229
  });
1788
- return { holeId: B, property: k, chartType: q };
2230
+ return { holeId: V, property: B, chartType: q };
1789
2231
  }));
1790
- }, [s, $, v, c, m, r]), te(() => {
1791
- if (!n) return;
1792
- L.map((y) => y.holeId).filter(Boolean).forEach((y) => {
1793
- const I = o.some((T) => (T.id || T.holeId) === y), F = R.includes(y);
1794
- I || F || (G((T) => [...T, y]), $t(n, y).then((T) => {
1795
- G((x) => x.filter((B) => B !== y)), T && i((x) => {
1796
- const B = Je(
1797
- [...x.filter((q) => (q.id || q.holeId) !== y), T],
2232
+ }, [i, k, y, c, f, n]), te(() => {
2233
+ if (!r) return;
2234
+ E.map((_) => _.holeId).filter(Boolean).forEach((_) => {
2235
+ const D = s.some((O) => (O.id || O.holeId) === _), z = P.includes(_);
2236
+ D || z || (H((O) => [...O, _]), Wt(r, _).then((O) => {
2237
+ H((R) => R.filter((V) => V !== _)), O && o((R) => {
2238
+ const V = st(
2239
+ [...R.filter((q) => (q.id || q.holeId) !== _), O],
1798
2240
  t
1799
- ), k = Te(B);
1800
- return u(k.numericProps), d(k.categoricalProps), f(k.commentProps), p(k.columnMeta), !v && k.defaultProp && (g(k.defaultProp), C((q) => q.map((X) => ({
2241
+ ), B = Le(V);
2242
+ return u(B.numericProps), d(B.categoricalProps), m(B.commentProps), h(B.columnMeta), !y && B.defaultProp && (p(B.defaultProp), x((q) => q.map((X) => ({
1801
2243
  ...X,
1802
- property: X.property || k.defaultProp,
1803
- chartType: Se({
1804
- property: X.property || k.defaultProp,
2244
+ property: X.property || B.defaultProp,
2245
+ chartType: xe({
2246
+ property: X.property || B.defaultProp,
1805
2247
  chartType: X.chartType,
1806
- categoricalProps: k.categoricalProps,
1807
- commentProps: k.commentProps,
2248
+ categoricalProps: B.categoricalProps,
2249
+ commentProps: B.commentProps,
1808
2250
  numericDefaultChartType: "markers+line"
1809
2251
  })
1810
- })))), B;
2252
+ })))), V;
1811
2253
  });
1812
- }).catch((T) => {
1813
- console.error(T), G((x) => x.filter((B) => B !== y)), H(T.message || `Error loading hole ${y}`);
2254
+ }).catch((O) => {
2255
+ console.error(O), H((R) => R.filter((V) => V !== _)), w(O.message || `Error loading hole ${_}`);
1814
2256
  }));
1815
2257
  });
1816
- }, [L, n, o, R, v, t]), te(() => {
1817
- t != null && t.length && i((_) => {
1818
- if (!_.length) {
1819
- const F = Te(t);
1820
- return u(F.numericProps), d(F.categoricalProps), f(F.commentProps), p(F.columnMeta), !v && F.defaultProp && g(F.defaultProp), t;
2258
+ }, [E, r, s, P, y, t]), te(() => {
2259
+ t != null && t.length && o((v) => {
2260
+ if (!v.length) {
2261
+ const z = Le(t);
2262
+ return u(z.numericProps), d(z.categoricalProps), m(z.commentProps), h(z.columnMeta), !y && z.defaultProp && p(z.defaultProp), t;
1821
2263
  }
1822
- const y = Je(_, t), I = Te(y);
1823
- return u(I.numericProps), d(I.categoricalProps), f(I.commentProps), p(I.columnMeta), !v && I.defaultProp && g(I.defaultProp), y;
2264
+ const _ = st(v, t), D = Le(_);
2265
+ return u(D.numericProps), d(D.categoricalProps), m(D.commentProps), h(D.columnMeta), !y && D.defaultProp && p(D.defaultProp), _;
1824
2266
  });
1825
2267
  }, [t]);
1826
- const P = ee(
1827
- () => [...l, ...c, ...m],
1828
- [l, c, m]
2268
+ const L = ee(
2269
+ () => [...l, ...c, ...f],
2270
+ [l, c, f]
1829
2271
  ), A = ee(
1830
- () => s.map((_) => ({ holeId: _.holeId, label: _.holeId })).sort((_, y) => _.label.localeCompare(y.label)),
1831
- [s]
1832
- ), z = ee(() => {
1833
- const _ = [...l, ...c, ...m];
1834
- return Array.from({ length: r }).map((y, I) => {
1835
- const F = L[I] || {}, T = o.find((fe) => (fe.id || fe.holeId) === F.holeId) || null, x = T ? _.filter((fe) => Lt(T, fe)) : _;
1836
- let B = F.property || v;
1837
- T && !x.includes(B) && (B = x[0] || B);
1838
- const k = m.includes(B), q = !k && c.includes(B), X = !k && !q && B === "dip", ae = k ? "comment" : X ? "tadpole" : q ? "categorical" : "numeric", _e = X ? "tadpole" : F.chartType || (k ? "comment" : q ? "categorical" : "markers+line"), me = F.holeId || (T == null ? void 0 : T.id) || (T == null ? void 0 : T.holeId) || "", Me = X ? (T == null ? void 0 : T.points) || [] : k ? dn(T, B) : It(T, B, q);
2272
+ () => i.map((v) => ({ holeId: v.holeId, label: v.holeId })).sort((v, _) => v.label.localeCompare(_.label)),
2273
+ [i]
2274
+ ), C = ee(() => {
2275
+ const v = [...l, ...c, ...f];
2276
+ return Array.from({ length: n }).map((_, D) => {
2277
+ const z = E[D] || {}, O = s.find((pe) => (pe.id || pe.holeId) === z.holeId) || null, R = O ? v.filter((pe) => Ct(O, pe)) : v;
2278
+ let V = z.property || y;
2279
+ O && !R.includes(V) && (V = R[0] || V);
2280
+ const B = f.includes(V), q = !B && c.includes(V), X = !B && !q && V === "dip", le = B ? "comment" : X ? "tadpole" : q ? "categorical" : "numeric", ve = X ? "tadpole" : z.chartType || (B ? "comment" : q ? "categorical" : "markers+line"), he = z.holeId || (O == null ? void 0 : O.id) || (O == null ? void 0 : O.holeId) || "", Re = X ? (O == null ? void 0 : O.points) || [] : B ? $n(O, V) : zt(O, V, q);
1839
2281
  return {
1840
- config: { holeId: me, property: B, chartType: _e },
1841
- hole: T,
1842
- loading: R.includes(F.holeId),
2282
+ config: { holeId: he, property: V, chartType: ve },
2283
+ hole: O,
2284
+ loading: P.includes(z.holeId),
1843
2285
  isCategorical: q,
1844
- isComment: k,
2286
+ isComment: B,
1845
2287
  isTadpole: X,
1846
- displayType: ae,
1847
- points: Me,
1848
- propertyOptions: x,
1849
- label: me
2288
+ displayType: le,
2289
+ points: Re,
2290
+ propertyOptions: R,
2291
+ label: he
1850
2292
  };
1851
2293
  });
1852
- }, [L, o, v, c, m, R, r, l]), E = (_, y) => {
1853
- C((I) => {
1854
- const F = [...I], x = { ...F[_] || {}, ...y };
1855
- return y.property && (x.chartType = Se({
1856
- property: y.property,
1857
- chartType: x.chartType,
2294
+ }, [E, s, y, c, f, P, n, l]), I = (v, _) => {
2295
+ x((D) => {
2296
+ const z = [...D], R = { ...z[v] || {}, ..._ };
2297
+ return _.property && (R.chartType = xe({
2298
+ property: _.property,
2299
+ chartType: R.chartType,
1858
2300
  categoricalProps: c,
1859
- commentProps: m,
2301
+ commentProps: f,
1860
2302
  numericDefaultChartType: "markers+line"
1861
- })), F[_] = x, F;
2303
+ })), z[v] = R, z;
1862
2304
  });
1863
2305
  };
1864
2306
  return {
1865
- error: j,
1866
- focusedHoleId: $,
1867
- setFocusedHoleId: D,
1868
- setError: H,
1869
- holeCount: s.length,
2307
+ error: F,
2308
+ focusedHoleId: k,
2309
+ setFocusedHoleId: $,
2310
+ setError: w,
2311
+ holeCount: i.length,
1870
2312
  numericProps: l,
1871
2313
  categoricalProps: c,
1872
- commentProps: m,
1873
- columnMeta: b,
1874
- propertyOptions: P,
2314
+ commentProps: f,
2315
+ columnMeta: g,
2316
+ propertyOptions: L,
1875
2317
  labeledHoleOptions: A,
1876
- traceGraphs: z,
1877
- handleConfigChange: E
2318
+ traceGraphs: C,
2319
+ handleConfigChange: I
1878
2320
  };
1879
2321
  }
1880
- function pt(e) {
2322
+ function St(e) {
1881
2323
  return Array.isArray(e) ? e : [];
1882
2324
  }
1883
- function De(e) {
1884
- const n = Number(e);
1885
- return Number.isFinite(n) ? n : void 0;
2325
+ function ze(e) {
2326
+ const r = Number(e);
2327
+ return Number.isFinite(r) ? r : void 0;
1886
2328
  }
1887
- function gt(e = {}) {
2329
+ function Tt(e = {}) {
1888
2330
  return {
1889
2331
  ...e,
1890
- x: De(e.x),
1891
- y: De(e.y),
1892
- z: De(e.z)
2332
+ x: ze(e.x),
2333
+ y: ze(e.y),
2334
+ z: ze(e.z)
1893
2335
  };
1894
2336
  }
1895
- function mn(e = [], n = [0, 0], t = 0) {
1896
- const [r, o] = n, i = Number(t) * Math.PI / 180, s = Math.cos(i), a = Math.sin(i);
1897
- return pt(e).map(gt).map((l) => {
2337
+ function kn(e = [], r = [0, 0], t = 0) {
2338
+ const [n, s] = r, o = Number(t) * Math.PI / 180, i = Math.cos(o), a = Math.sin(o);
2339
+ return St(e).map(Tt).map((l) => {
1898
2340
  if (!Number.isFinite(l.x) || !Number.isFinite(l.y)) return { ...l };
1899
- const u = l.x - r, c = l.y - o;
2341
+ const u = l.x - n, c = l.y - s;
1900
2342
  return {
1901
2343
  ...l,
1902
- along: u * a + c * s,
1903
- across: u * s - c * a
2344
+ along: u * a + c * i,
2345
+ across: u * i - c * a
1904
2346
  };
1905
2347
  });
1906
2348
  }
1907
- function fn(e = [], n = [0, 0], t = 0, r = 50) {
1908
- const o = mn(e, n, t), i = 0.5 * Number(r || 0);
1909
- return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
2349
+ function Cn(e = [], r = [0, 0], t = 0, n = 50) {
2350
+ const s = kn(e, r, t), o = 0.5 * Number(n || 0);
2351
+ return !Number.isFinite(o) || o <= 0 ? s : s.filter((i) => Number.isFinite(i.across) && Math.abs(i.across) <= o);
1910
2352
  }
1911
- function lr(e = [], n = null, t = null) {
1912
- let r = pt(e).map(gt);
1913
- if (Array.isArray(n) && n.length === 2) {
1914
- const [o, i] = n;
1915
- r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
2353
+ function Ur(e = [], r = null, t = null) {
2354
+ let n = St(e).map(Tt);
2355
+ if (Array.isArray(r) && r.length === 2) {
2356
+ const [s, o] = r;
2357
+ n = n.filter((i) => Number.isFinite(i.z) && i.z <= Number(s) && i.z >= Number(o));
1916
2358
  }
1917
- return t && (r = r.map((o) => ({
1918
- ...o,
1919
- color_value: o == null ? void 0 : o[t]
1920
- }))), r;
1921
- }
1922
- function cr(e = [], n = [0, 0], t = 0, r = 50, o = null) {
1923
- let i = fn(e, n, t, r);
1924
- return o && (i = i.map((s) => ({
2359
+ return t && (n = n.map((s) => ({
1925
2360
  ...s,
1926
- color_value: s == null ? void 0 : s[o]
1927
- }))), i;
2361
+ color_value: s == null ? void 0 : s[t]
2362
+ }))), n;
2363
+ }
2364
+ function Gr(e = [], r = [0, 0], t = 0, n = 50, s = null) {
2365
+ let o = Cn(e, r, t, n);
2366
+ return s && (o = o.map((i) => ({
2367
+ ...i,
2368
+ color_value: i == null ? void 0 : i[s]
2369
+ }))), o;
1928
2370
  }
1929
- function Ue(e) {
2371
+ function Ve(e) {
1930
2372
  return Array.isArray(e) ? e : [];
1931
2373
  }
1932
- function He(e = {}) {
2374
+ function Ye(e = {}) {
1933
2375
  return e.hole_id ?? e.holeId ?? e.id;
1934
2376
  }
1935
- function ue(e, n = void 0) {
2377
+ function de(e, r = void 0) {
1936
2378
  const t = Number(e);
1937
- return Number.isFinite(t) ? t : n;
2379
+ return Number.isFinite(t) ? t : r;
1938
2380
  }
1939
- function ur(e = [], n = null) {
2381
+ function jr(e = [], r = null) {
1940
2382
  const t = /* @__PURE__ */ new Map();
1941
- Ue(e).forEach((o) => {
1942
- const i = He(o);
1943
- if (i == null || `${i}`.trim() === "") return;
1944
- const s = `${i}`;
1945
- t.has(s) || t.set(s, []), t.get(s).push(o);
2383
+ Ve(e).forEach((s) => {
2384
+ const o = Ye(s);
2385
+ if (o == null || `${o}`.trim() === "") return;
2386
+ const i = `${o}`;
2387
+ t.has(i) || t.set(i, []), t.get(i).push(s);
1946
2388
  });
1947
- const r = [];
1948
- return t.forEach((o, i) => {
1949
- const s = [...o].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1950
- hole_id: i,
1951
- x: s.map((l) => ue(l.x, 0)),
1952
- y: s.map((l) => ue(l.y, 0)),
1953
- z: s.map((l) => ue(l.z, 0)),
2389
+ const n = [];
2390
+ return t.forEach((s, o) => {
2391
+ const i = [...s].sort((l, u) => de(l.md, 0) - de(u.md, 0)), a = {
2392
+ hole_id: o,
2393
+ x: i.map((l) => de(l.x, 0)),
2394
+ y: i.map((l) => de(l.y, 0)),
2395
+ z: i.map((l) => de(l.z, 0)),
1954
2396
  color: null
1955
2397
  };
1956
- n && (a.color = s.map((l) => l == null ? void 0 : l[n])), r.push(a);
1957
- }), r;
2398
+ r && (a.color = i.map((l) => l == null ? void 0 : l[r])), n.push(a);
2399
+ }), n;
1958
2400
  }
1959
- function dr(e = [], n = 1, t = null) {
1960
- return Ue(e).map((r) => ({
1961
- hole_id: He(r),
1962
- from: r == null ? void 0 : r.from,
1963
- to: r == null ? void 0 : r.to,
1964
- radius: n,
1965
- color: t ? r == null ? void 0 : r[t] : null,
1966
- value: t ? r == null ? void 0 : r[t] : null
2401
+ function Vr(e = [], r = 1, t = null) {
2402
+ return Ve(e).map((n) => ({
2403
+ hole_id: Ye(n),
2404
+ from: n == null ? void 0 : n.from,
2405
+ to: n == null ? void 0 : n.to,
2406
+ radius: r,
2407
+ color: t ? n == null ? void 0 : n[t] : null,
2408
+ value: t ? n == null ? void 0 : n[t] : null
1967
2409
  }));
1968
2410
  }
1969
- function mr(e = [], n = null) {
1970
- return n ? Ue(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, n)).map((t) => ({
1971
- hole_id: He(t),
1972
- label: t == null ? void 0 : t[n],
1973
- depth: 0.5 * (ue(t == null ? void 0 : t.from, 0) + ue(t == null ? void 0 : t.to, 0))
2411
+ function Yr(e = [], r = null) {
2412
+ return r ? Ve(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, r)).map((t) => ({
2413
+ hole_id: Ye(t),
2414
+ label: t == null ? void 0 : t[r],
2415
+ depth: 0.5 * (de(t == null ? void 0 : t.from, 0) + de(t == null ? void 0 : t.to, 0))
1974
2416
  })) : [];
1975
2417
  }
1976
- function fr({
2418
+ function Wr({
1977
2419
  controlMode: e = "orbit",
1978
- onToggleFly: n = () => {
2420
+ onToggleFly: r = () => {
1979
2421
  },
1980
2422
  onRecenter: t = () => {
1981
2423
  },
1982
- onLookDown: r = () => {
2424
+ onLookDown: n = () => {
1983
2425
  },
1984
- onFit: o = () => {
2426
+ onFit: s = () => {
1985
2427
  },
1986
- darkBackground: i = !1,
1987
- onToggleDarkBackground: s = () => {
2428
+ darkBackground: o = !1,
2429
+ onToggleDarkBackground: i = () => {
1988
2430
  }
1989
2431
  }) {
1990
- return /* @__PURE__ */ w("div", { className: "baselode-3d-controls", children: [
1991
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
1992
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
1993
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
1994
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: n, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
1995
- /* @__PURE__ */ w("label", { className: "baselode-3d-controls-checkbox", children: [
1996
- /* @__PURE__ */ S(
2432
+ return /* @__PURE__ */ U("div", { className: "baselode-3d-controls", children: [
2433
+ /* @__PURE__ */ T("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
2434
+ /* @__PURE__ */ T("button", { type: "button", className: "ghost-button", onClick: n, children: "Look down" }),
2435
+ /* @__PURE__ */ T("button", { type: "button", className: "ghost-button", onClick: s, children: "Fit to scene" }),
2436
+ /* @__PURE__ */ T("button", { type: "button", className: "ghost-button", onClick: r, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
2437
+ /* @__PURE__ */ U("label", { className: "baselode-3d-controls-checkbox", children: [
2438
+ /* @__PURE__ */ T(
1997
2439
  "input",
1998
2440
  {
1999
2441
  type: "checkbox",
2000
- checked: i,
2001
- onChange: s
2442
+ checked: o,
2443
+ onChange: i
2002
2444
  }
2003
2445
  ),
2004
2446
  "Dark background"
2005
2447
  ] })
2006
2448
  ] });
2007
2449
  }
2008
- function hr({
2450
+ function qr({
2009
2451
  properties: e = [],
2010
- selectedProperty: n = "",
2452
+ selectedProperty: r = "",
2011
2453
  onPropertyChange: t = () => {
2012
2454
  },
2013
- opacity: r = 0.85,
2014
- onOpacityChange: o = () => {
2455
+ opacity: n = 0.85,
2456
+ onOpacityChange: s = () => {
2015
2457
  },
2016
- propertyStats: i = null,
2017
- clickedBlock: s = null,
2458
+ propertyStats: o = null,
2459
+ clickedBlock: i = null,
2018
2460
  onPopupClose: a = () => {
2019
2461
  }
2020
2462
  }) {
2021
2463
  var l, u;
2022
- return /* @__PURE__ */ w("div", { className: "bm-widget", children: [
2023
- /* @__PURE__ */ S("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
2024
- /* @__PURE__ */ w(
2464
+ return /* @__PURE__ */ U("div", { className: "bm-widget", children: [
2465
+ /* @__PURE__ */ T("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
2466
+ /* @__PURE__ */ U(
2025
2467
  "select",
2026
2468
  {
2027
2469
  id: "bm-property-select",
2028
2470
  className: "bm-widget__select",
2029
- value: n,
2471
+ value: r,
2030
2472
  onChange: (c) => t(c.target.value),
2031
2473
  children: [
2032
- e.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "— no attributes —" }),
2033
- e.map((c) => /* @__PURE__ */ S("option", { value: c, children: c }, c))
2474
+ e.length === 0 && /* @__PURE__ */ T("option", { value: "", children: "— no attributes —" }),
2475
+ e.map((c) => /* @__PURE__ */ T("option", { value: c, children: c }, c))
2034
2476
  ]
2035
2477
  }
2036
2478
  ),
2037
- i && i.type === "numeric" && /* @__PURE__ */ w("div", { className: "bm-widget__scale", children: [
2038
- /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = i.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
2039
- /* @__PURE__ */ S("div", { className: "bm-widget__scale-bar" }),
2040
- /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = i.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
2479
+ o && o.type === "numeric" && /* @__PURE__ */ U("div", { className: "bm-widget__scale", children: [
2480
+ /* @__PURE__ */ T("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = o.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
2481
+ /* @__PURE__ */ T("div", { className: "bm-widget__scale-bar" }),
2482
+ /* @__PURE__ */ T("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = o.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
2041
2483
  ] }),
2042
- i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, d) => {
2043
- const m = Math.round(d / Math.max(i.categories.length, 1) * 360);
2044
- return /* @__PURE__ */ S(
2484
+ o && o.type === "categorical" && /* @__PURE__ */ T("div", { className: "bm-widget__categories", children: (o.categories || []).map((c, d) => {
2485
+ const f = Math.round(d / Math.max(o.categories.length, 1) * 360);
2486
+ return /* @__PURE__ */ T(
2045
2487
  "span",
2046
2488
  {
2047
2489
  className: "bm-widget__category-chip",
2048
- style: { background: `hsl(${m},70%,50%)` },
2490
+ style: { background: `hsl(${f},70%,50%)` },
2049
2491
  children: c
2050
2492
  },
2051
2493
  c
2052
2494
  );
2053
2495
  }) }),
2054
- /* @__PURE__ */ w("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
2496
+ /* @__PURE__ */ U("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
2055
2497
  "Opacity (",
2056
- Math.round(r * 100),
2498
+ Math.round(n * 100),
2057
2499
  "%)"
2058
2500
  ] }),
2059
- /* @__PURE__ */ S(
2501
+ /* @__PURE__ */ T(
2060
2502
  "input",
2061
2503
  {
2062
2504
  id: "bm-opacity-slider",
@@ -2065,14 +2507,14 @@ function hr({
2065
2507
  min: "0",
2066
2508
  max: "1",
2067
2509
  step: "0.01",
2068
- value: r,
2069
- onChange: (c) => o(parseFloat(c.target.value))
2510
+ value: n,
2511
+ onChange: (c) => s(parseFloat(c.target.value))
2070
2512
  }
2071
2513
  ),
2072
- s && /* @__PURE__ */ w("div", { className: "bm-widget__popup", children: [
2073
- /* @__PURE__ */ w("div", { className: "bm-widget__popup-header", children: [
2074
- /* @__PURE__ */ S("span", { children: "Block attributes" }),
2075
- /* @__PURE__ */ S(
2514
+ i && /* @__PURE__ */ U("div", { className: "bm-widget__popup", children: [
2515
+ /* @__PURE__ */ U("div", { className: "bm-widget__popup-header", children: [
2516
+ /* @__PURE__ */ T("span", { children: "Block attributes" }),
2517
+ /* @__PURE__ */ T(
2076
2518
  "button",
2077
2519
  {
2078
2520
  type: "button",
@@ -2083,163 +2525,163 @@ function hr({
2083
2525
  }
2084
2526
  )
2085
2527
  ] }),
2086
- /* @__PURE__ */ S("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ S("tbody", { children: Object.entries(s).map(([c, d]) => /* @__PURE__ */ w("tr", { children: [
2087
- /* @__PURE__ */ S("th", { children: c }),
2088
- /* @__PURE__ */ S("td", { children: d == null ? "—" : String(d) })
2528
+ /* @__PURE__ */ T("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ T("tbody", { children: Object.entries(i).map(([c, d]) => /* @__PURE__ */ U("tr", { children: [
2529
+ /* @__PURE__ */ T("th", { children: c }),
2530
+ /* @__PURE__ */ T("td", { children: d == null ? "—" : String(d) })
2089
2531
  ] }, c)) }) })
2090
2532
  ] })
2091
2533
  ] });
2092
2534
  }
2093
- const hn = [
2535
+ const zn = [
2094
2536
  { minZoom: 0, lodKey: "thumb" },
2095
2537
  { minZoom: 4, lodKey: "medium" },
2096
2538
  { minZoom: 7, lodKey: "full" }
2097
- ], bt = 50;
2098
- function pn(e, n, t = hn) {
2099
- var i;
2100
- const r = e.lod_urls;
2101
- if (!r || typeof r != "object" || Array.isArray(r))
2539
+ ], xt = 50;
2540
+ function Fn(e, r, t = zn) {
2541
+ var o;
2542
+ const n = e.lod_urls;
2543
+ if (!n || typeof n != "object" || Array.isArray(n))
2102
2544
  return e.image_url || "";
2103
- let o = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
2104
- for (const s of t)
2105
- n >= s.minZoom && (o = s.lodKey);
2106
- return r[o] || e.image_url || "";
2545
+ let s = ((o = t[0]) == null ? void 0 : o.lodKey) ?? "thumb";
2546
+ for (const i of t)
2547
+ r >= i.minZoom && (s = i.lodKey);
2548
+ return n[s] || e.image_url || "";
2107
2549
  }
2108
- function gn(e) {
2109
- return [...e].sort((n, t) => (n.from_depth ?? 0) - (t.from_depth ?? 0));
2550
+ function wn(e) {
2551
+ return [...e].sort((r, t) => (r.from_depth ?? 0) - (t.from_depth ?? 0));
2110
2552
  }
2111
- function bn(e) {
2112
- const n = {};
2553
+ function Hn(e) {
2554
+ const r = {};
2113
2555
  for (const t of e) {
2114
- const r = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
2115
- n[r] || (n[r] = []), n[r].push(t);
2556
+ const n = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
2557
+ r[n] || (r[n] = []), r[n].push(t);
2116
2558
  }
2117
- return n;
2559
+ return r;
2118
2560
  }
2119
- function yn(e, n, t = 10) {
2120
- const r = [];
2121
- if (e >= n || t <= 0) return r;
2122
- const o = Math.ceil(e / t) * t, i = t * 1e-9;
2123
- for (let s = o; s <= n + i; s += t) {
2124
- const a = Math.round(s * 1e6) / 1e6;
2125
- r.push({ depth: a, label: `${a} m` });
2561
+ function Bn(e, r, t = 10) {
2562
+ const n = [];
2563
+ if (e >= r || t <= 0) return n;
2564
+ const s = Math.ceil(e / t) * t, o = t * 1e-9;
2565
+ for (let i = s; i <= r + o; i += t) {
2566
+ const a = Math.round(i * 1e6) / 1e6;
2567
+ n.push({ depth: a, label: `${a} m` });
2126
2568
  }
2127
- return r;
2569
+ return n;
2128
2570
  }
2129
- function _n(e) {
2571
+ function Un(e) {
2130
2572
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
2131
2573
  }
2132
- function yt(e) {
2574
+ function Lt(e) {
2133
2575
  return `tray_${String(e).padStart(3, "0")}.jpg`;
2134
2576
  }
2135
- function Nn(e, n, t, r, o = "Tray Images", i = yt) {
2136
- const s = (t ?? "").replace(/\/$/, ""), a = (r ?? "").replace(/\/$/, "");
2137
- return n.map((l, u) => {
2138
- const c = l.filename ?? i(u), d = l.photoSet ?? o;
2577
+ function Gn(e, r, t, n, s = "Tray Images", o = Lt) {
2578
+ const i = (t ?? "").replace(/\/$/, ""), a = (n ?? "").replace(/\/$/, "");
2579
+ return r.map((l, u) => {
2580
+ const c = l.filename ?? o(u), d = l.photoSet ?? s;
2139
2581
  return {
2140
2582
  hole_id: e,
2141
2583
  from_depth: l.fromDepth,
2142
2584
  to_depth: l.toDepth,
2143
2585
  photo_set: d,
2144
- image_url: `${s}/${c}`,
2586
+ image_url: `${i}/${c}`,
2145
2587
  lod_urls: {
2146
- thumb: `${s}/${c}`,
2588
+ thumb: `${i}/${c}`,
2147
2589
  full: `${a}/${c}`
2148
2590
  }
2149
2591
  };
2150
2592
  });
2151
2593
  }
2152
- function pr(e, n, t = bt) {
2153
- const r = n / 5;
2154
- return Math.max(1, Math.round(e * t * r));
2594
+ function Xr(e, r, t = xt) {
2595
+ const n = r / 5;
2596
+ return Math.max(1, Math.round(e * t * n));
2155
2597
  }
2156
- const Re = 5, Qe = 1.12, vn = 0.05, En = 40;
2157
- function An({
2598
+ const Fe = 5, ot = 1.12, jn = 0.05, Vn = 40;
2599
+ function Yn({
2158
2600
  photos: e = [],
2159
- holeId: n = "",
2601
+ holeId: r = "",
2160
2602
  initialZoom: t = 5,
2161
- transform: r,
2162
- onTransformChange: o
2603
+ transform: n,
2604
+ onTransformChange: s
2163
2605
  }) {
2164
- const [i, s] = K({ scale: 1, tx: 0, ty: 0 }), a = r ?? i, l = ye(a);
2606
+ const [o, i] = K({ scale: 1, tx: 0, ty: 0 }), a = n ?? o, l = Ne(a);
2165
2607
  l.current = a;
2166
- const u = Pe(
2167
- (h) => {
2168
- const P = typeof h == "function" ? h(l.current) : h;
2169
- o ? o(P) : s(P);
2608
+ const u = $e(
2609
+ (b) => {
2610
+ const L = typeof b == "function" ? b(l.current) : b;
2611
+ s ? s(L) : i(L);
2170
2612
  },
2171
- [o]
2172
- ), [c, d] = K(!1), m = ye(null), f = ye(null), b = ee(() => gn(e), [e]), p = ee(() => bn(b), [b]), v = ee(() => {
2173
- const h = /* @__PURE__ */ new Set();
2174
- for (const P of e) {
2175
- const A = P.photo_set != null && P.photo_set !== "" ? String(P.photo_set) : "default";
2176
- h.add(A);
2613
+ [s]
2614
+ ), [c, d] = K(!1), f = Ne(null), m = Ne(null), g = ee(() => wn(e), [e]), h = ee(() => Hn(g), [g]), y = ee(() => {
2615
+ const b = /* @__PURE__ */ new Set();
2616
+ for (const L of e) {
2617
+ const A = L.photo_set != null && L.photo_set !== "" ? String(L.photo_set) : "default";
2618
+ b.add(A);
2177
2619
  }
2178
- return [...h];
2179
- }, [e]), { minDepth: g, maxDepth: L } = ee(() => {
2180
- if (!b.length) return { minDepth: 0, maxDepth: 0 };
2181
- const h = b.map((P) => P.to_depth ?? P.from_depth ?? 0);
2620
+ return [...b];
2621
+ }, [e]), { minDepth: p, maxDepth: E } = ee(() => {
2622
+ if (!g.length) return { minDepth: 0, maxDepth: 0 };
2623
+ const b = g.map((L) => L.to_depth ?? L.from_depth ?? 0);
2182
2624
  return {
2183
- minDepth: b[0].from_depth ?? 0,
2184
- maxDepth: Math.max(...h)
2625
+ minDepth: g[0].from_depth ?? 0,
2626
+ maxDepth: Math.max(...b)
2185
2627
  };
2186
- }, [b]), C = bt * Re / 5, j = ee(
2187
- () => Math.max(1, Math.round((L - g) * C)),
2188
- [g, L, C]
2189
- ), H = ee(() => {
2190
- const h = _n(Re);
2191
- return yn(g, L, h);
2192
- }, [g, L]), $ = 540 * Re / 5, D = ee(
2628
+ }, [g]), x = xt * Fe / 5, F = ee(
2629
+ () => Math.max(1, Math.round((E - p) * x)),
2630
+ [p, E, x]
2631
+ ), w = ee(() => {
2632
+ const b = Un(Fe);
2633
+ return Bn(p, E, b);
2634
+ }, [p, E]), k = 540 * Fe / 5, $ = ee(
2193
2635
  () => Math.max(1, Math.min(10, Math.round(t * a.scale))),
2194
2636
  [t, a.scale]
2195
- ), R = Pe((h) => {
2196
- h.preventDefault();
2197
- const P = h.deltaY < 0 ? Qe : 1 / Qe, A = f.current.getBoundingClientRect(), z = h.clientX - A.left, E = h.clientY - A.top;
2198
- u((_) => {
2199
- const y = Math.max(vn, Math.min(En, _.scale * P)), I = y / _.scale;
2637
+ ), P = $e((b) => {
2638
+ b.preventDefault();
2639
+ const L = b.deltaY < 0 ? ot : 1 / ot, A = m.current.getBoundingClientRect(), C = b.clientX - A.left, I = b.clientY - A.top;
2640
+ u((v) => {
2641
+ const _ = Math.max(jn, Math.min(Vn, v.scale * L)), D = _ / v.scale;
2200
2642
  return {
2201
- scale: y,
2202
- tx: z - (z - _.tx) * I,
2203
- ty: E - (E - _.ty) * I
2643
+ scale: _,
2644
+ tx: C - (C - v.tx) * D,
2645
+ ty: I - (I - v.ty) * D
2204
2646
  };
2205
2647
  });
2206
2648
  }, [u]);
2207
2649
  te(() => {
2208
- const h = f.current;
2209
- if (h)
2210
- return h.addEventListener("wheel", R, { passive: !1 }), () => h.removeEventListener("wheel", R);
2211
- }, [R]);
2212
- const G = Pe((h) => {
2213
- h.button === 0 && (h.preventDefault(), m.current = {
2214
- x: h.clientX,
2215
- y: h.clientY,
2650
+ const b = m.current;
2651
+ if (b)
2652
+ return b.addEventListener("wheel", P, { passive: !1 }), () => b.removeEventListener("wheel", P);
2653
+ }, [P]);
2654
+ const H = $e((b) => {
2655
+ b.button === 0 && (b.preventDefault(), f.current = {
2656
+ x: b.clientX,
2657
+ y: b.clientY,
2216
2658
  tx: l.current.tx,
2217
2659
  ty: l.current.ty
2218
2660
  }, d(!0));
2219
2661
  }, []);
2220
2662
  return te(() => {
2221
- const h = (A) => {
2222
- if (!m.current) return;
2223
- const { tx: z, ty: E, x: _, y } = m.current;
2224
- u((I) => ({
2225
- ...I,
2226
- tx: z + (A.clientX - _),
2227
- ty: E + (A.clientY - y)
2663
+ const b = (A) => {
2664
+ if (!f.current) return;
2665
+ const { tx: C, ty: I, x: v, y: _ } = f.current;
2666
+ u((D) => ({
2667
+ ...D,
2668
+ tx: C + (A.clientX - v),
2669
+ ty: I + (A.clientY - _)
2228
2670
  }));
2229
- }, P = () => {
2230
- m.current = null, d(!1);
2671
+ }, L = () => {
2672
+ f.current = null, d(!1);
2231
2673
  };
2232
- return window.addEventListener("mousemove", h), window.addEventListener("mouseup", P), () => {
2233
- window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", P);
2674
+ return window.addEventListener("mousemove", b), window.addEventListener("mouseup", L), () => {
2675
+ window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", L);
2234
2676
  };
2235
- }, [u]), /* @__PURE__ */ w("div", { className: "core-photo-table", children: [
2236
- /* @__PURE__ */ w("div", { className: "core-photo-controls", children: [
2237
- n && /* @__PURE__ */ S("span", { className: "core-photo-hole-id", children: n }),
2238
- /* @__PURE__ */ w("span", { className: "core-photo-zoom-label", children: [
2677
+ }, [u]), /* @__PURE__ */ U("div", { className: "core-photo-table", children: [
2678
+ /* @__PURE__ */ U("div", { className: "core-photo-controls", children: [
2679
+ r && /* @__PURE__ */ T("span", { className: "core-photo-hole-id", children: r }),
2680
+ /* @__PURE__ */ U("span", { className: "core-photo-zoom-label", children: [
2239
2681
  Math.round(a.scale * 100),
2240
2682
  "%"
2241
2683
  ] }),
2242
- /* @__PURE__ */ S(
2684
+ /* @__PURE__ */ T(
2243
2685
  "button",
2244
2686
  {
2245
2687
  className: "core-photo-zoom-btn",
@@ -2250,92 +2692,92 @@ function An({
2250
2692
  }
2251
2693
  )
2252
2694
  ] }),
2253
- e.length > 0 && /* @__PURE__ */ w("div", { className: "core-photo-col-headers", children: [
2254
- /* @__PURE__ */ S("div", { className: "core-photo-ruler-spacer" }),
2255
- v.map((h) => /* @__PURE__ */ S(
2695
+ e.length > 0 && /* @__PURE__ */ U("div", { className: "core-photo-col-headers", children: [
2696
+ /* @__PURE__ */ T("div", { className: "core-photo-ruler-spacer" }),
2697
+ y.map((b) => /* @__PURE__ */ T(
2256
2698
  "div",
2257
2699
  {
2258
2700
  className: "core-photo-set-header",
2259
- style: { width: $ },
2260
- children: h
2701
+ style: { width: k },
2702
+ children: b
2261
2703
  },
2262
- h
2704
+ b
2263
2705
  ))
2264
2706
  ] }),
2265
- e.length === 0 ? /* @__PURE__ */ S("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ S(
2707
+ e.length === 0 ? /* @__PURE__ */ T("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ T(
2266
2708
  "div",
2267
2709
  {
2268
2710
  className: `core-photo-scroll${c ? " is-dragging" : ""}`,
2269
- ref: f,
2270
- onMouseDown: G,
2271
- children: /* @__PURE__ */ w(
2711
+ ref: m,
2712
+ onMouseDown: H,
2713
+ children: /* @__PURE__ */ U(
2272
2714
  "div",
2273
2715
  {
2274
2716
  className: "core-photo-inner",
2275
2717
  style: {
2276
- height: j,
2718
+ height: F,
2277
2719
  transform: `translate(${a.tx}px, ${a.ty}px) scale(${a.scale})`,
2278
2720
  transformOrigin: "0 0"
2279
2721
  },
2280
2722
  children: [
2281
- /* @__PURE__ */ S(
2723
+ /* @__PURE__ */ T(
2282
2724
  "div",
2283
2725
  {
2284
2726
  className: "core-photo-depth-ruler",
2285
- style: { height: j },
2286
- children: H.map(({ depth: h, label: P }) => /* @__PURE__ */ S(
2727
+ style: { height: F },
2728
+ children: w.map(({ depth: b, label: L }) => /* @__PURE__ */ T(
2287
2729
  "div",
2288
2730
  {
2289
2731
  className: "core-photo-depth-marker",
2290
2732
  style: {
2291
- top: Math.round((h - g) * C)
2733
+ top: Math.round((b - p) * x)
2292
2734
  },
2293
- children: P
2735
+ children: L
2294
2736
  },
2295
- h
2737
+ b
2296
2738
  ))
2297
2739
  }
2298
2740
  ),
2299
- v.map((h) => /* @__PURE__ */ S(
2741
+ y.map((b) => /* @__PURE__ */ T(
2300
2742
  "div",
2301
2743
  {
2302
2744
  className: "core-photo-col-body",
2303
- style: { height: j, width: $ },
2304
- children: p[h].map((P) => {
2305
- const A = P.from_depth ?? 0, z = P.to_depth ?? A, E = Math.round(
2306
- (A - g) * C
2307
- ), _ = Math.max(
2745
+ style: { height: F, width: k },
2746
+ children: h[b].map((L) => {
2747
+ const A = L.from_depth ?? 0, C = L.to_depth ?? A, I = Math.round(
2748
+ (A - p) * x
2749
+ ), v = Math.max(
2308
2750
  2,
2309
- Math.round((z - A) * C)
2310
- ), y = pn(P, D);
2311
- return /* @__PURE__ */ w(
2751
+ Math.round((C - A) * x)
2752
+ ), _ = Fn(L, $);
2753
+ return /* @__PURE__ */ U(
2312
2754
  "div",
2313
2755
  {
2314
2756
  className: "core-photo-item",
2315
- style: { top: E, height: _, width: $ },
2316
- title: `${A}–${z} m`,
2757
+ style: { top: I, height: v, width: k },
2758
+ title: `${A}–${C} m`,
2317
2759
  children: [
2318
- y ? /* @__PURE__ */ S(
2760
+ _ ? /* @__PURE__ */ T(
2319
2761
  "img",
2320
2762
  {
2321
- src: y,
2322
- alt: `Core ${A}–${z} m`,
2763
+ src: _,
2764
+ alt: `Core ${A}–${C} m`,
2323
2765
  loading: "lazy"
2324
2766
  }
2325
- ) : /* @__PURE__ */ S("div", { className: "core-photo-no-image" }),
2326
- _ >= 18 && /* @__PURE__ */ w("span", { className: "core-photo-item-label", children: [
2767
+ ) : /* @__PURE__ */ T("div", { className: "core-photo-no-image" }),
2768
+ v >= 18 && /* @__PURE__ */ U("span", { className: "core-photo-item-label", children: [
2327
2769
  A,
2328
2770
  "–",
2329
- z,
2771
+ C,
2330
2772
  " m"
2331
2773
  ] })
2332
2774
  ]
2333
2775
  },
2334
- `${P.hole_id ?? ""}-${A}-${z}-${h}`
2776
+ `${L.hole_id ?? ""}-${A}-${C}-${b}`
2335
2777
  );
2336
2778
  })
2337
2779
  },
2338
- h
2780
+ b
2339
2781
  ))
2340
2782
  ]
2341
2783
  }
@@ -2344,303 +2786,319 @@ function An({
2344
2786
  )
2345
2787
  ] });
2346
2788
  }
2347
- function gr({
2789
+ function Kr({
2348
2790
  holeId: e = "",
2349
- trays: n = [],
2791
+ trays: r = [],
2350
2792
  thumbBaseUrl: t = "",
2351
- fullBaseUrl: r = "",
2352
- photoSet: o = "Tray Images",
2353
- getFilename: i = yt,
2354
- initialZoom: s = 5,
2793
+ fullBaseUrl: n = "",
2794
+ photoSet: s = "Tray Images",
2795
+ getFilename: o = Lt,
2796
+ initialZoom: i = 5,
2355
2797
  transform: a,
2356
2798
  onTransformChange: l
2357
2799
  }) {
2358
2800
  const u = ee(
2359
- () => Nn(e, n, t, r, o, i),
2360
- [e, n, t, r, o, i]
2801
+ () => Gn(e, r, t, n, s, o),
2802
+ [e, r, t, n, s, o]
2361
2803
  );
2362
- return /* @__PURE__ */ S(
2363
- An,
2804
+ return /* @__PURE__ */ T(
2805
+ Yn,
2364
2806
  {
2365
2807
  photos: u,
2366
2808
  holeId: e,
2367
- initialZoom: s,
2809
+ initialZoom: i,
2368
2810
  transform: a,
2369
2811
  onTransformChange: l
2370
2812
  }
2371
2813
  );
2372
2814
  }
2373
- function br(e) {
2374
- const n = typeof e == "string" ? JSON.parse(e) : e;
2375
- if (n.schema_version !== "1.0")
2815
+ function Zr(e) {
2816
+ const r = typeof e == "string" ? JSON.parse(e) : e;
2817
+ if (r.schema_version !== "1.0")
2376
2818
  throw new Error(
2377
- `Unsupported schema_version: ${JSON.stringify(n.schema_version)}. Expected "1.0".`
2819
+ `Unsupported schema_version: ${JSON.stringify(r.schema_version)}. Expected "1.0".`
2378
2820
  );
2379
- if (!Array.isArray(n.blocks))
2821
+ if (!Array.isArray(r.blocks))
2380
2822
  throw new Error('"blocks" must be a JSON array.');
2381
- const t = n.blocks.map((r, o) => {
2382
- if (r.id == null) throw new Error(`Block at index ${o} is missing required field "id".`);
2383
- if (r.name == null) throw new Error(`Block "${r.id}" is missing required field "name".`);
2384
- if (!Array.isArray(r.vertices)) throw new Error(`Block "${r.id}" is missing required field "vertices".`);
2385
- if (!Array.isArray(r.triangles)) throw new Error(`Block "${r.id}" is missing required field "triangles".`);
2823
+ const t = r.blocks.map((n, s) => {
2824
+ if (n.id == null) throw new Error(`Block at index ${s} is missing required field "id".`);
2825
+ if (n.name == null) throw new Error(`Block "${n.id}" is missing required field "name".`);
2826
+ if (!Array.isArray(n.vertices)) throw new Error(`Block "${n.id}" is missing required field "vertices".`);
2827
+ if (!Array.isArray(n.triangles)) throw new Error(`Block "${n.id}" is missing required field "triangles".`);
2386
2828
  return {
2387
- id: r.id,
2388
- name: r.name,
2389
- vertices: r.vertices,
2390
- triangles: r.triangles,
2391
- attributes: r.attributes ?? {},
2392
- material: r.material ?? {}
2829
+ id: n.id,
2830
+ name: n.name,
2831
+ vertices: n.vertices,
2832
+ triangles: n.triangles,
2833
+ attributes: n.attributes ?? {},
2834
+ material: n.material ?? {}
2393
2835
  };
2394
2836
  });
2395
2837
  return {
2396
- schema_version: n.schema_version,
2397
- units: n.units ?? "",
2838
+ schema_version: r.schema_version,
2839
+ units: r.units ?? "",
2398
2840
  blocks: t
2399
2841
  };
2400
2842
  }
2401
- function Sn(e) {
2402
- const n = new Q.BufferGeometry(), t = new Float32Array(e.vertices.length * 3);
2403
- e.vertices.forEach(([o, i, s], a) => {
2404
- t[a * 3] = o, t[a * 3 + 1] = i, t[a * 3 + 2] = s;
2405
- }), n.setAttribute("position", new Q.BufferAttribute(t, 3));
2406
- const r = new Uint32Array(e.triangles.length * 3);
2407
- return e.triangles.forEach(([o, i, s], a) => {
2408
- r[a * 3] = o, r[a * 3 + 1] = i, r[a * 3 + 2] = s;
2409
- }), n.setIndex(new Q.BufferAttribute(r, 1)), n;
2410
- }
2411
- function yr(e, n, t = {}) {
2412
- const { defaultOpacity: r = 1 } = t, o = new Q.Group();
2413
- return n.blocks.forEach((i) => {
2414
- var p, v;
2415
- const s = Sn(i), a = ((p = i.material) == null ? void 0 : p.color) ?? "#888888", l = ((v = i.material) == null ? void 0 : v.opacity) ?? r, u = l < 1, c = new Q.MeshStandardMaterial({
2843
+ function Wn(e) {
2844
+ const r = new Q.BufferGeometry(), t = new Float32Array(e.vertices.length * 3);
2845
+ e.vertices.forEach(([s, o, i], a) => {
2846
+ t[a * 3] = s, t[a * 3 + 1] = o, t[a * 3 + 2] = i;
2847
+ }), r.setAttribute("position", new Q.BufferAttribute(t, 3));
2848
+ const n = new Uint32Array(e.triangles.length * 3);
2849
+ return e.triangles.forEach(([s, o, i], a) => {
2850
+ n[a * 3] = s, n[a * 3 + 1] = o, n[a * 3 + 2] = i;
2851
+ }), r.setIndex(new Q.BufferAttribute(n, 1)), r;
2852
+ }
2853
+ function Jr(e, r, t = {}) {
2854
+ const { defaultOpacity: n = 1 } = t, s = new Q.Group();
2855
+ return r.blocks.forEach((o) => {
2856
+ var h, y;
2857
+ const i = Wn(o), a = ((h = o.material) == null ? void 0 : h.color) ?? "#888888", l = ((y = o.material) == null ? void 0 : y.opacity) ?? n, u = l < 1, c = new Q.MeshStandardMaterial({
2416
2858
  color: new Q.Color(a),
2417
2859
  opacity: l,
2418
2860
  transparent: u,
2419
2861
  side: Q.DoubleSide,
2420
2862
  flatShading: !0
2421
- }), d = new Q.Mesh(s, c);
2863
+ }), d = new Q.Mesh(i, c);
2422
2864
  d.userData = {
2423
- id: i.id,
2424
- attributes: i.attributes
2865
+ id: o.id,
2866
+ attributes: o.attributes
2425
2867
  };
2426
- const m = new Q.EdgesGeometry(s, 15), f = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), b = new Q.LineSegments(m, f);
2427
- b.visible = !1, d.add(b), o.add(d);
2428
- }), e.add(o), o;
2868
+ const f = new Q.EdgesGeometry(i, 15), m = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), g = new Q.LineSegments(f, m);
2869
+ g.visible = !1, d.add(g), s.add(d);
2870
+ }), e.add(s), s;
2429
2871
  }
2430
2872
  export {
2431
- vr as ALPHA,
2432
- Er as ASSAY_COLOR_PALETTE_10,
2433
- Mt as ASSAY_NON_VALUE_FIELDS,
2873
+ ts as ALPHA,
2874
+ ns as ASSAY_COLOR_PALETTE_10,
2875
+ wt as ASSAY_NON_VALUE_FIELDS,
2434
2876
  Y as AZIMUTH,
2435
- Ar as BASELODE_COLORWAY,
2436
- Sr as BASELODE_DARK,
2437
- Tr as BASELODE_DARK_TEMPLATE,
2438
- Lr as BASELODE_DARK_TEMPLATE_NAME,
2439
- Ir as BASELODE_DATA_MODEL_DRILL_ASSAY,
2440
- Cr as BASELODE_DATA_MODEL_DRILL_COLLAR,
2441
- Et as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2442
- Mr as BASELODE_DATA_MODEL_DRILL_SURVEY,
2443
- Pr as BASELODE_DATA_MODEL_GEOPHYSICS,
2444
- Or as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2445
- xr as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2446
- Dr as BASELODE_LIGHT,
2447
- Rr as BASELODE_LIGHT_TEMPLATE,
2448
- zr as BASELODE_LIGHT_TEMPLATE_NAME,
2449
- $e as BASELODE_TEMPLATE,
2450
- Fr as BASELODE_TEMPLATE_NAME,
2451
- bt as BASE_PIXELS_PER_METRE,
2452
- $r as BETA,
2453
- kr as BUILTIN_COLOUR_MAPS,
2454
- fr as Baselode3DControls,
2455
- wr as Baselode3DScene,
2456
- hr as BlockModelWidget,
2457
- Ur as CHART_OPTIONS,
2458
- Hr as COLLAR_ID,
2459
- Gr as COMMENTS,
2460
- Br as COMMENT_COLUMN_NAMES,
2461
- Vr as COMMODITY_COLOURS,
2462
- jr as CRS,
2463
- An as CorePhotoTable,
2464
- gr as CorePhotoViewer,
2465
- Yr as DATASOURCE,
2466
- Wr as DATASOURCE_HOLE_ID,
2467
- qr as DATASOURCE_SAMPLE_ID,
2468
- Xr as DATASOURCE_SURFACE_SAMPLE_ID,
2469
- Kr as DATE_END,
2470
- Zr as DATE_START,
2471
- Jr as DEFAULT_ATTRIBUTE_COLUMN,
2472
- Qr as DEFAULT_COLUMN_MAP,
2473
- hn as DEFAULT_LOD_BREAKPOINTS,
2474
- eo as DEFAULT_UNIT_COLUMN,
2475
- V as DEPTH,
2877
+ rs as BASELODE_COLORWAY,
2878
+ ss as BASELODE_DARK,
2879
+ os as BASELODE_DARK_TEMPLATE,
2880
+ is as BASELODE_DARK_TEMPLATE_NAME,
2881
+ as as BASELODE_DATA_MODEL_DRILL_ASSAY,
2882
+ ls as BASELODE_DATA_MODEL_DRILL_COLLAR,
2883
+ Pt as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2884
+ cs as BASELODE_DATA_MODEL_DRILL_SURVEY,
2885
+ us as BASELODE_DATA_MODEL_GEOPHYSICS,
2886
+ ds as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2887
+ fs as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2888
+ ms as BASELODE_LIGHT,
2889
+ hs as BASELODE_LIGHT_TEMPLATE,
2890
+ ps as BASELODE_LIGHT_TEMPLATE_NAME,
2891
+ Ue as BASELODE_TEMPLATE,
2892
+ gs as BASELODE_TEMPLATE_NAME,
2893
+ xt as BASE_PIXELS_PER_METRE,
2894
+ bs as BETA,
2895
+ ys as BUILTIN_COLOUR_MAPS,
2896
+ Wr as Baselode3DControls,
2897
+ _s as Baselode3DScene,
2898
+ qr as BlockModelWidget,
2899
+ Ns as CHART_OPTIONS,
2900
+ vs as COLLAR_ID,
2901
+ Es as COMMENTS,
2902
+ Is as COMMENT_COLUMN_NAMES,
2903
+ As as COMMODITY_COLOURS,
2904
+ Ss as CRS,
2905
+ Yn as CorePhotoTable,
2906
+ Kr as CorePhotoViewer,
2907
+ Ts as DATASOURCE,
2908
+ xs as DATASOURCE_HOLE_ID,
2909
+ Ls as DATASOURCE_SAMPLE_ID,
2910
+ Ms as DATASOURCE_SURFACE_SAMPLE_ID,
2911
+ Os as DATE_END,
2912
+ Ds as DATE_START,
2913
+ Ps as DEFAULT_ATTRIBUTE_COLUMN,
2914
+ Rs as DEFAULT_COLUMN_MAP,
2915
+ zn as DEFAULT_LOD_BREAKPOINTS,
2916
+ $s as DEFAULT_UNIT_COLUMN,
2917
+ j as DEPTH,
2476
2918
  W as DIP,
2477
- Ge as DISPLAY_CATEGORICAL,
2478
- ze as DISPLAY_COMMENT,
2479
- to as DISPLAY_HIDDEN,
2480
- At as DISPLAY_NUMERIC,
2481
- tt as DISPLAY_TADPOLE,
2482
- pe as EASTING,
2483
- Ee as ELEVATION,
2484
- no as ERROR_COLOR,
2485
- ro as EXTRA,
2486
- oo as FALLBACK_COLOUR,
2487
- so as FOV_MAX_DEG,
2488
- io as FOV_MIN_DEG,
2489
- M as FROM,
2490
- le as GEOLOGY_CODE,
2491
- ce as GEOLOGY_DESCRIPTION,
2492
- ao as GEOPHYSICS_NULL,
2493
- et as GEOPHYSICS_NULL_SENTINEL,
2494
- lo as HIDDEN_COLUMNS,
2919
+ We as DISPLAY_CATEGORICAL,
2920
+ we as DISPLAY_COMMENT,
2921
+ ks as DISPLAY_HIDDEN,
2922
+ Rt as DISPLAY_NUMERIC,
2923
+ lt as DISPLAY_TADPOLE,
2924
+ be as EASTING,
2925
+ Se as ELEVATION,
2926
+ Cs as ERROR_COLOR,
2927
+ zs as EXTRA,
2928
+ Fs as FALLBACK_COLOUR,
2929
+ ws as FOV_MAX_DEG,
2930
+ Hs as FOV_MIN_DEG,
2931
+ S as FROM,
2932
+ ce as GEOLOGY_CODE,
2933
+ ue as GEOLOGY_DESCRIPTION,
2934
+ Bs as GEOPHYSICS_NULL,
2935
+ at as GEOPHYSICS_NULL_SENTINEL,
2936
+ Us as HIDDEN_COLUMNS,
2495
2937
  N as HOLE_ID,
2496
- co as HOLE_TYPE,
2497
- re as LATITUDE,
2498
- uo as LITHOLOGY_COLOURS,
2938
+ Gs as HOLE_TYPE,
2939
+ se as LATITUDE,
2940
+ js as LITHOLOGY_COLOURS,
2499
2941
  oe as LONGITUDE,
2500
- mo as MAX_DEPTH,
2501
- ve as MID,
2502
- ge as NORTHING,
2503
- fo as NUMERIC_LINE_COLOR,
2504
- ho as NUMERIC_MARKER_COLOR,
2505
- de as PROJECT_ID,
2506
- po as REPORT_NUMBER,
2507
- go as SAMPLE_ID,
2508
- bo as STRIKE,
2509
- yo as STRIP_LOG_DEFAULT_COLOR,
2510
- _o as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2511
- No as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2512
- vo as SURFACE_SAMPLE_ID,
2513
- Eo as SURFACE_SAMPLE_TYPE,
2514
- Ao as SURVEY_TYPE,
2515
- O as TO,
2516
- ir as TracePlot,
2517
- yr as addGradeBlocksToScene,
2518
- So as addRasterOverlay,
2519
- To as alphaBetaToNormal,
2520
- mr as annotationsFromIntervals,
2521
- Xn as assembleDataset,
2522
- Un as attachAssayPositions,
2523
- kn as balancedTangentialDesurvey,
2524
- kt as buildAssayState,
2525
- Lo as buildCategoricalStripLogConfig,
2526
- rn as buildCommentsConfig,
2527
- yn as buildDepthMarkers,
2528
- Io as buildEqualRangeColorScale,
2529
- It as buildIntervalPoints,
2530
- St as buildPlotConfig,
2531
- sr as buildStrikeDipSymbol,
2532
- Co as buildStripLogGroup,
2533
- Mo as buildStripLogLinePoints,
2534
- Po as buildStructuralDiscs,
2535
- or as buildStructuralStripConfig,
2536
- nn as buildTadpoleConfig,
2537
- wn as buildTraces,
2538
- Nn as buildTrayPhotos,
2539
- Oo as buildViewSignature,
2540
- xo as calculateBlockVolume,
2541
- Do as calculatePropertyStats,
2542
- vt as classifyColumns,
2543
- Ro as clearRasterOverlays,
2544
- zo as clearStripLogs,
2545
- qn as coerceNumeric,
2546
- Fo as computeStructuralPositions,
2547
- $o as createRasterOverlay,
2548
- ko as defaultChartType,
2549
- yt as defaultTrayFilename,
2550
- pr as depthIntervalToPixels,
2551
- _n as depthMarkerInterval,
2552
- Te as deriveAssayProps,
2553
- wo as derivePropertyMeta,
2554
- Fn as desurveyTraces,
2555
- Uo as dipAzimuthToNormal,
2556
- Ho as dolly,
2557
- Go as emitViewChangeIfNeeded,
2558
- Bo as filterBlocks,
2559
- Wn as filterByProject,
2560
- Vo as fitCameraToBounds,
2561
- jo as focusOnLastBounds,
2562
- Tt as formatPropertyLabel,
2563
- nr as geophysicsToStripLogs,
2564
- Yo as getBlockStats,
2565
- Wo as getCategoryHexColor,
2566
- nt as getChartOptions,
2567
- qo as getColorForValue,
2568
- Xo as getColour,
2569
- Ko as getEqualRangeBinIndex,
2570
- Zo as getEqualRangeColor,
2571
- Jo as getHoleVerticalExtent,
2572
- Qo as getRasterOverlay,
2573
- es as getViewState,
2574
- Sn as gradeBlockToThreeGeometry,
2575
- bn as groupPhotosBySet,
2576
- Wt as groupRowsByHole,
2577
- Lt as holeHasData,
2578
- ts as interpolateTrace,
2579
- dr as intervalsAsTubes,
2580
- Yn as joinAssaysToTraces,
2581
- ns as listRasterOverlays,
2582
- Rn as loadAssayFile,
2583
- $t as loadAssayHole,
2584
- Ft as loadAssayMetadata,
2585
- Vn as loadAssays,
2586
- rs as loadBlockModelMetadata,
2587
- Gn as loadCollars,
2588
- jn as loadGeology,
2589
- br as loadGradeBlocksFromJson,
2590
- Bn as loadSurveys,
2591
- Ce as loadTable,
2592
- os as logDataInfo,
2593
- ss as logDataWarning,
2594
- is as lookDown,
2595
- Ht as minimumCurvatureDesurvey,
2596
- as as normalizeBlockRow,
2597
- ls as normalizeBounds,
2598
- xn as normalizeCsvRow,
2599
- Ae as normalizeFieldName,
2600
- cs as normalizeStripLogOptions,
2601
- us as pan,
2602
- Xt as parseAssayCsvTextToHoles,
2603
- Dt as parseAssayHole,
2604
- On as parseAssayHoleIds,
2605
- xt as parseAssayHoleIdsWithAssays,
2606
- Rt as parseAssaysCSV,
2607
- ds as parseBlockModelCSV,
2608
- Hn as parseDrillholesCSV,
2609
- Kt as parseGeologyCsvText,
2610
- tr as parseGeophysicsCSV,
2611
- rr as parseLasFile,
2612
- qt as parseStructuralCSV,
2613
- Jn as parseStructuralIntervalsCSV,
2614
- Zn as parseStructuralPointsCSV,
2615
- zn as parseSurveyCSV,
2616
- Qn as parseUnifiedDataset,
2617
- Dn as pickFirstPresent,
2618
- lr as planView,
2619
- mn as projectTraceToSection,
2620
- ms as recenterCameraToOrigin,
2621
- fs as removeRasterOverlay,
2622
- st as reorderHoleIds,
2623
- hs as resolveColourMap,
2624
- ps as resolvePropertyLabelParts,
2625
- cr as sectionView,
2626
- fn as sectionWindow,
2627
- pn as selectPhotoLodUrl,
2628
- gs as setControlMode,
2629
- bs as setFov,
2630
- ys as setRasterOverlayElevation,
2631
- _s as setRasterOverlayOpacity,
2632
- Ns as setRasterOverlayVisibility,
2633
- vs as setStripLogs,
2634
- Es as setViewState,
2635
- er as significantIntercepts,
2636
- gn as sortPhotosByDepth,
2637
- ie as standardizeColumns,
2638
- Pn as standardizeRowArray,
2639
- $n as tangentialDesurvey,
2640
- As as toError,
2641
- ur as tracesAsSegments,
2642
- ar as useDrillholeTraceGrid,
2643
- Kn as validateStructuralPoints,
2644
- U as withDataErrorContext
2942
+ it as MAX_DEPTH,
2943
+ Ae as MID,
2944
+ ye as NORTHING,
2945
+ Vs as NUMERIC_LINE_COLOR,
2946
+ Ys as NUMERIC_MARKER_COLOR,
2947
+ fe as PROJECT_ID,
2948
+ Ws as REPORT_NUMBER,
2949
+ qs as SAMPLE_ID,
2950
+ me as SEVERITY_ERROR,
2951
+ Oe as SEVERITY_INFO,
2952
+ Ie as SEVERITY_WARNING,
2953
+ Xs as STRIKE,
2954
+ Ks as STRIP_LOG_DEFAULT_COLOR,
2955
+ Zs as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2956
+ Js as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2957
+ Qs as SURFACE_SAMPLE_ID,
2958
+ eo as SURFACE_SAMPLE_TYPE,
2959
+ to as SURVEY_TYPE,
2960
+ M as TO,
2961
+ Hr as TracePlot,
2962
+ Jr as addGradeBlocksToScene,
2963
+ no as addRasterOverlay,
2964
+ ro as alphaBetaToNormal,
2965
+ Yr as annotationsFromIntervals,
2966
+ yr as assembleDataset,
2967
+ cr as attachAssayPositions,
2968
+ ar as balancedTangentialDesurvey,
2969
+ qt as buildAssayState,
2970
+ so as buildCategoricalStripLogConfig,
2971
+ xn as buildCommentsConfig,
2972
+ Bn as buildDepthMarkers,
2973
+ oo as buildEqualRangeColorScale,
2974
+ zt as buildIntervalPoints,
2975
+ $t as buildPlotConfig,
2976
+ wr as buildStrikeDipSymbol,
2977
+ io as buildStripLogGroup,
2978
+ ao as buildStripLogLinePoints,
2979
+ lo as buildStructuralDiscs,
2980
+ Fr as buildStructuralStripConfig,
2981
+ Tn as buildTadpoleConfig,
2982
+ lr as buildTraces,
2983
+ Gn as buildTrayPhotos,
2984
+ co as buildViewSignature,
2985
+ uo as calculateBlockVolume,
2986
+ fo as calculatePropertyStats,
2987
+ Dt as classifyColumns,
2988
+ mo as clearRasterOverlays,
2989
+ ho as clearStripLogs,
2990
+ xr as clip,
2991
+ br as coerceNumeric,
2992
+ po as computeStructuralPositions,
2993
+ go as createRasterOverlay,
2994
+ bo as defaultChartType,
2995
+ Lt as defaultTrayFilename,
2996
+ Xr as depthIntervalToPixels,
2997
+ Un as depthMarkerInterval,
2998
+ Le as deriveAssayProps,
2999
+ yo as derivePropertyMeta,
3000
+ or as desurveyTraces,
3001
+ ln as detectGaps,
3002
+ cn as detectOverlaps,
3003
+ _o as dipAzimuthToNormal,
3004
+ No as dolly,
3005
+ Dr as dropOrphanIntervals,
3006
+ vo as emitViewChangeIfNeeded,
3007
+ Eo as filterBlocks,
3008
+ gr as filterByProject,
3009
+ Io as fitCameraToBounds,
3010
+ Or as fixSingleStationSurveys,
3011
+ Ao as focusOnLastBounds,
3012
+ kt as formatPropertyLabel,
3013
+ Sr as fromToMidpoints,
3014
+ Cr as geophysicsToStripLogs,
3015
+ So as getBlockStats,
3016
+ To as getCategoryHexColor,
3017
+ ct as getChartOptions,
3018
+ xo as getColorForValue,
3019
+ Lo as getColour,
3020
+ Mo as getEqualRangeBinIndex,
3021
+ Oo as getEqualRangeColor,
3022
+ Do as getHoleVerticalExtent,
3023
+ Po as getRasterOverlay,
3024
+ Ro as getViewState,
3025
+ Wn as gradeBlockToThreeGeometry,
3026
+ Hn as groupPhotosBySet,
3027
+ rn as groupRowsByHole,
3028
+ Ct as holeHasData,
3029
+ $o as interpolateTrace,
3030
+ Ar as intervalLength,
3031
+ Vr as intervalsAsTubes,
3032
+ pr as joinAssaysToTraces,
3033
+ ko as listRasterOverlays,
3034
+ rr as loadAssayFile,
3035
+ Wt as loadAssayHole,
3036
+ Yt as loadAssayMetadata,
3037
+ mr as loadAssays,
3038
+ Co as loadBlockModelMetadata,
3039
+ dr as loadCollars,
3040
+ hr as loadGeology,
3041
+ Zr as loadGradeBlocksFromJson,
3042
+ fr as loadSurveys,
3043
+ Pe as loadTable,
3044
+ zo as logDataInfo,
3045
+ Fo as logDataWarning,
3046
+ wo as lookDown,
3047
+ Lr as mergeTables,
3048
+ Zt as minimumCurvatureDesurvey,
3049
+ Rr as normalizeAzimuth,
3050
+ Ho as normalizeBlockRow,
3051
+ Bo as normalizeBounds,
3052
+ tr as normalizeCsvRow,
3053
+ Te as normalizeFieldName,
3054
+ Uo as normalizeStripLogOptions,
3055
+ Go as pan,
3056
+ on as parseAssayCsvTextToHoles,
3057
+ Gt as parseAssayHole,
3058
+ er as parseAssayHoleIds,
3059
+ Ut as parseAssayHoleIdsWithAssays,
3060
+ jt as parseAssaysCSV,
3061
+ jo as parseBlockModelCSV,
3062
+ ur as parseDrillholesCSV,
3063
+ an as parseGeologyCsvText,
3064
+ kr as parseGeophysicsCSV,
3065
+ zr as parseLasFile,
3066
+ sn as parseStructuralCSV,
3067
+ vr as parseStructuralIntervalsCSV,
3068
+ Nr as parseStructuralPointsCSV,
3069
+ sr as parseSurveyCSV,
3070
+ Er as parseUnifiedDataset,
3071
+ nr as pickFirstPresent,
3072
+ Ur as planView,
3073
+ kn as projectTraceToSection,
3074
+ Vo as recenterCameraToOrigin,
3075
+ Yo as removeRasterOverlay,
3076
+ ft as reorderHoleIds,
3077
+ $r as replaceBelowDetectionLimit,
3078
+ Wo as resolveColourMap,
3079
+ qo as resolvePropertyLabelParts,
3080
+ Gr as sectionView,
3081
+ Cn as sectionWindow,
3082
+ Fn as selectPhotoLodUrl,
3083
+ Xo as setControlMode,
3084
+ Ko as setFov,
3085
+ Zo as setRasterOverlayElevation,
3086
+ Jo as setRasterOverlayOpacity,
3087
+ Qo as setRasterOverlayVisibility,
3088
+ ei as setStripLogs,
3089
+ ti as setViewState,
3090
+ Ir as significantIntercepts,
3091
+ wn as sortPhotosByDepth,
3092
+ Tr as splitAt,
3093
+ ae as standardizeColumns,
3094
+ Qn as standardizeRowArray,
3095
+ Pr as swapInvertedIntervals,
3096
+ ir as tangentialDesurvey,
3097
+ ni as toError,
3098
+ jr as tracesAsSegments,
3099
+ Br as useDrillholeTraceGrid,
3100
+ Mr as validateDrillholeDb,
3101
+ _r as validateStructuralPoints,
3102
+ G as withDataErrorContext
2645
3103
  };
2646
3104
  //# sourceMappingURL=baselode.js.map