@welldot/core 0.1.1 → 0.2.2

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/index.cjs CHANGED
@@ -20,26 +20,95 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AirliftEventSchema: () => AirliftEventSchema,
24
+ AquiferAnalysisSchema: () => AquiferAnalysisSchema,
25
+ AttachmentSchema: () => AttachmentSchema,
23
26
  BoreHoleSchema: () => BoreHoleSchema,
24
27
  CaveSchema: () => CaveSchema,
25
28
  CementPadSchema: () => CementPadSchema,
29
+ ConstantRateEventSchema: () => ConstantRateEventSchema,
30
+ FGDC_TEXTURES_OPTIONS: () => FGDC_TEXTURES_OPTIONS,
26
31
  FractureSchema: () => FractureSchema,
32
+ HistoryLogEntrySchema: () => HistoryLogEntrySchema,
27
33
  HoleFillSchema: () => HoleFillSchema,
34
+ HydrodynamicEventBaseSchema: () => HydrodynamicEventBaseSchema,
35
+ HydrodynamicEventSchema: () => HydrodynamicEventSchema,
36
+ LevelReadingSchema: () => LevelReadingSchema,
28
37
  LithologySchema: () => LithologySchema,
38
+ LocationPropertiesSchema: () => LocationPropertiesSchema,
39
+ LocationSchema: () => LocationSchema,
40
+ PumpingStepSchema: () => PumpingStepSchema,
41
+ RecoveryOnlyEventSchema: () => RecoveryOnlyEventSchema,
42
+ RecoveryPhaseSchema: () => RecoveryPhaseSchema,
29
43
  ReductionSchema: () => ReductionSchema,
44
+ SECTION_KEYS: () => SECTION_KEYS,
45
+ SpotMeasurementEventSchema: () => SpotMeasurementEventSchema,
46
+ StepDrawdownEventSchema: () => StepDrawdownEventSchema,
30
47
  SurfaceCaseSchema: () => SurfaceCaseSchema,
48
+ TextureSchema: () => TextureSchema,
31
49
  WellCaseSchema: () => WellCaseSchema,
50
+ WellIdSchema: () => WellIdSchema,
32
51
  WellSchema: () => WellSchema,
33
52
  WellScreenSchema: () => WellScreenSchema,
34
53
  checkIfProfileIsEmpty: () => checkIfProfileIsEmpty,
35
54
  convertProfileFromJSON: () => convertProfileFromJSON,
55
+ cubicMeterPerHourToLitersPerSecond: () => cubicMeterPerHourToLitersPerSecond,
56
+ cubicMeterPerHourToUsGallonsPerMinute: () => cubicMeterPerHourToUsGallonsPerMinute,
57
+ decimalDegreesToDms: () => decimalDegreesToDms,
58
+ deserializeWell: () => deserializeWell,
59
+ dmsToDecimalDegrees: () => dmsToDecimalDegrees,
60
+ feetToMeters: () => feetToMeters,
61
+ hoursToMinutes: () => hoursToMinutes,
62
+ inchesToMm: () => inchesToMm,
63
+ isWellEmpty: () => isWellEmpty,
64
+ kilopascalToPsi: () => kilopascalToPsi,
65
+ litersPerSecondToCubicMeterPerHour: () => litersPerSecondToCubicMeterPerHour,
66
+ metersToFeet: () => metersToFeet,
67
+ minutesToHours: () => minutesToHours,
68
+ mmToInches: () => mmToInches,
69
+ mmToSlotNumber: () => mmToSlotNumber,
36
70
  parseWell: () => parseWell,
37
- profileToWell: () => profileToWell
71
+ profileToWell: () => profileToWell,
72
+ psiToKilopascal: () => psiToKilopascal,
73
+ redactWell: () => redactWell,
74
+ serializeWell: () => serializeWell,
75
+ slotNumberToMm: () => slotNumberToMm,
76
+ squareMeterPerDayToSquareMeterPerSecond: () => squareMeterPerDayToSquareMeterPerSecond,
77
+ squareMeterPerSecondToSquareMeterPerDay: () => squareMeterPerSecondToSquareMeterPerDay,
78
+ usGallonsPerMinuteToCubicMeterPerHour: () => usGallonsPerMinuteToCubicMeterPerHour
38
79
  });
39
80
  module.exports = __toCommonJS(index_exports);
40
81
 
41
82
  // src/validators/well.validators.ts
83
+ var import_defu = require("defu");
42
84
  var import_zod = require("zod");
85
+ var mergeWell = (0, import_defu.createDefu)((obj, key, value) => {
86
+ if (Array.isArray(value)) {
87
+ obj[key] = value;
88
+ return true;
89
+ }
90
+ });
91
+ var RFC3339_WITH_OFFSET = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
92
+ var rfc3339 = () => import_zod.z.string().regex(RFC3339_WITH_OFFSET, "datetime must be RFC 3339 with UTC offset");
93
+ var WellIdSchema = import_zod.z.object({
94
+ authority: import_zod.z.string(),
95
+ id: import_zod.z.string(),
96
+ primary: import_zod.z.boolean().optional()
97
+ });
98
+ var LocationPropertiesSchema = import_zod.z.object({
99
+ elevation_datum: import_zod.z.string().optional(),
100
+ crs: import_zod.z.string().optional(),
101
+ lat_precision: import_zod.z.number().optional(),
102
+ lng_precision: import_zod.z.number().optional(),
103
+ elevation_precision: import_zod.z.number().optional(),
104
+ original_crs: import_zod.z.string().optional()
105
+ });
106
+ var LocationSchema = import_zod.z.object({
107
+ lat: import_zod.z.number(),
108
+ lng: import_zod.z.number(),
109
+ elevation: import_zod.z.number().optional(),
110
+ properties: LocationPropertiesSchema.optional()
111
+ });
43
112
  var BoreHoleSchema = import_zod.z.object({
44
113
  from: import_zod.z.number(),
45
114
  to: import_zod.z.number(),
@@ -64,7 +133,7 @@ var WellScreenSchema = import_zod.z.object({
64
133
  to: import_zod.z.number(),
65
134
  type: import_zod.z.string(),
66
135
  diameter: import_zod.z.number(),
67
- screen_slot_mm: import_zod.z.number()
136
+ screen_slot: import_zod.z.number()
68
137
  });
69
138
  var HoleFillSchema = import_zod.z.object({
70
139
  from: import_zod.z.number(),
@@ -84,12 +153,16 @@ var CementPadSchema = import_zod.z.object({
84
153
  thickness: import_zod.z.number(),
85
154
  length: import_zod.z.number()
86
155
  });
156
+ var TextureSchema = import_zod.z.object({
157
+ code: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]),
158
+ vocabulary: import_zod.z.string().optional()
159
+ });
87
160
  var LithologySchema = import_zod.z.object({
88
161
  from: import_zod.z.number(),
89
162
  to: import_zod.z.number(),
90
163
  description: import_zod.z.string(),
91
164
  color: import_zod.z.string(),
92
- fgdc_texture: import_zod.z.string(),
165
+ texture: TextureSchema,
93
166
  geologic_unit: import_zod.z.string(),
94
167
  aquifer_unit: import_zod.z.string()
95
168
  });
@@ -99,7 +172,8 @@ var FractureSchema = import_zod.z.object({
99
172
  description: import_zod.z.string(),
100
173
  swarm: import_zod.z.boolean(),
101
174
  azimuth: import_zod.z.number(),
102
- dip: import_zod.z.number()
175
+ dip: import_zod.z.number(),
176
+ depth_precision: import_zod.z.number().optional()
103
177
  });
104
178
  var CaveSchema = import_zod.z.object({
105
179
  from: import_zod.z.number(),
@@ -107,35 +181,242 @@ var CaveSchema = import_zod.z.object({
107
181
  water_intake: import_zod.z.boolean(),
108
182
  description: import_zod.z.string()
109
183
  });
184
+ var LevelReadingSchema = import_zod.z.object({
185
+ elapsed: import_zod.z.number(),
186
+ depth: import_zod.z.number(),
187
+ depth_precision: import_zod.z.number().optional(),
188
+ pressure: import_zod.z.number().optional()
189
+ });
190
+ var RecoveryPhaseSchema = import_zod.z.object({
191
+ readings: import_zod.z.array(LevelReadingSchema)
192
+ });
193
+ var PumpingStepSchema = import_zod.z.object({
194
+ rate: import_zod.z.number(),
195
+ rate_precision: import_zod.z.number().optional(),
196
+ duration: import_zod.z.number().optional(),
197
+ readings: import_zod.z.array(LevelReadingSchema).optional()
198
+ });
199
+ var HydrodynamicEventBaseSchema = import_zod.z.object({
200
+ id: import_zod.z.string(),
201
+ type: import_zod.z.string(),
202
+ datetime: rfc3339(),
203
+ sequence: import_zod.z.number().int().optional(),
204
+ operator: import_zod.z.string().optional(),
205
+ equipment: import_zod.z.string().optional(),
206
+ notes: import_zod.z.string().optional()
207
+ });
208
+ var SpotMeasurementEventSchema = HydrodynamicEventBaseSchema.extend({
209
+ type: import_zod.z.literal("spot_measurement"),
210
+ static_level: import_zod.z.number(),
211
+ static_level_precision: import_zod.z.number().optional(),
212
+ measurement_method: import_zod.z.string().optional(),
213
+ steps: import_zod.z.array(PumpingStepSchema).max(1).optional(),
214
+ recovery: RecoveryPhaseSchema.optional()
215
+ });
216
+ var ConstantRateEventSchema = HydrodynamicEventBaseSchema.extend({
217
+ type: import_zod.z.literal("constant_rate"),
218
+ static_level: import_zod.z.number().optional(),
219
+ static_level_precision: import_zod.z.number().optional(),
220
+ steps: import_zod.z.tuple([PumpingStepSchema]).optional(),
221
+ recovery: RecoveryPhaseSchema.optional()
222
+ });
223
+ var StepDrawdownEventSchema = HydrodynamicEventBaseSchema.extend({
224
+ type: import_zod.z.literal("step_drawdown"),
225
+ static_level: import_zod.z.number().optional(),
226
+ static_level_precision: import_zod.z.number().optional(),
227
+ steps: import_zod.z.array(PumpingStepSchema),
228
+ recovery: RecoveryPhaseSchema.optional()
229
+ });
230
+ var AirliftEventSchema = HydrodynamicEventBaseSchema.extend({
231
+ type: import_zod.z.literal("airlift"),
232
+ steps: import_zod.z.array(PumpingStepSchema),
233
+ recovery: RecoveryPhaseSchema.optional()
234
+ });
235
+ var RecoveryOnlyEventSchema = HydrodynamicEventBaseSchema.extend({
236
+ type: import_zod.z.literal("recovery_only"),
237
+ pumping_rate: import_zod.z.number().optional(),
238
+ pumping_duration: import_zod.z.number().optional(),
239
+ recovery: RecoveryPhaseSchema
240
+ });
241
+ var HydrodynamicEventSchema = import_zod.z.discriminatedUnion("type", [
242
+ SpotMeasurementEventSchema,
243
+ ConstantRateEventSchema,
244
+ StepDrawdownEventSchema,
245
+ AirliftEventSchema,
246
+ RecoveryOnlyEventSchema
247
+ ]).or(HydrodynamicEventBaseSchema.passthrough());
248
+ var AttachmentSchema = import_zod.z.object({
249
+ id: import_zod.z.string(),
250
+ uri: import_zod.z.string().url(),
251
+ media_type: import_zod.z.string(),
252
+ filename: import_zod.z.string().optional(),
253
+ description: import_zod.z.string().optional(),
254
+ sha256: import_zod.z.string().optional()
255
+ });
256
+ var HistoryLogEntrySchema = import_zod.z.object({
257
+ id: import_zod.z.string(),
258
+ datetime: rfc3339(),
259
+ updated_at: rfc3339().optional(),
260
+ category: import_zod.z.string(),
261
+ description: import_zod.z.string(),
262
+ author: import_zod.z.string().optional(),
263
+ severity: import_zod.z.string().optional(),
264
+ attachments: import_zod.z.array(AttachmentSchema).optional()
265
+ });
266
+ var AquiferAnalysisSchema = import_zod.z.object({
267
+ id: import_zod.z.string(),
268
+ datetime: rfc3339(),
269
+ analyst: import_zod.z.string().optional(),
270
+ source_event_ids: import_zod.z.array(import_zod.z.string()),
271
+ method: import_zod.z.string().optional(),
272
+ static_level: import_zod.z.number().optional(),
273
+ static_level_precision: import_zod.z.number().optional(),
274
+ static_level_source_id: import_zod.z.string().optional(),
275
+ dynamic_level: import_zod.z.number().optional(),
276
+ dynamic_level_precision: import_zod.z.number().optional(),
277
+ flow_rate: import_zod.z.number().optional(),
278
+ flow_rate_precision: import_zod.z.number().optional(),
279
+ max_flow_rate: import_zod.z.number().optional(),
280
+ max_flow_rate_precision: import_zod.z.number().optional(),
281
+ max_flow_rate_basis: import_zod.z.string().optional(),
282
+ specific_capacity: import_zod.z.number().optional(),
283
+ transmissivity: import_zod.z.number().optional(),
284
+ storativity: import_zod.z.number().nullable().optional(),
285
+ hydraulic_conductivity: import_zod.z.number().optional(),
286
+ aquifer_thickness: import_zod.z.number().optional(),
287
+ jacob_b: import_zod.z.number().optional(),
288
+ jacob_c: import_zod.z.number().optional(),
289
+ well_efficiency_pct: import_zod.z.number().optional(),
290
+ notes: import_zod.z.string().optional()
291
+ });
110
292
  var WellSchema = import_zod.z.object({
293
+ version: import_zod.z.number().int(),
294
+ "@context": import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.unknown()), import_zod.z.record(import_zod.z.unknown())]).optional(),
295
+ well_id: import_zod.z.array(WellIdSchema).optional(),
296
+ location: LocationSchema.optional(),
297
+ profiles: import_zod.z.array(
298
+ import_zod.z.string().url().refine((u) => u.startsWith("https://"), {
299
+ message: "profiles must be HTTPS URLs"
300
+ })
301
+ ).optional(),
111
302
  well_type: import_zod.z.string().optional(),
112
303
  name: import_zod.z.string().optional(),
113
304
  well_driller: import_zod.z.string().optional(),
114
- construction_date: import_zod.z.string().optional(),
305
+ construction_date: import_zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "construction_date must be YYYY-MM-DD").optional(),
306
+ obs: import_zod.z.string().optional(),
115
307
  lat: import_zod.z.number().optional(),
116
308
  lng: import_zod.z.number().optional(),
117
309
  elevation: import_zod.z.number().optional(),
118
- obs: import_zod.z.string().optional(),
310
+ well_depth: import_zod.z.number().optional(),
119
311
  bore_hole: import_zod.z.array(BoreHoleSchema),
120
312
  well_case: import_zod.z.array(WellCaseSchema),
121
313
  reduction: import_zod.z.array(ReductionSchema),
122
314
  well_screen: import_zod.z.array(WellScreenSchema),
123
315
  surface_case: import_zod.z.array(SurfaceCaseSchema),
124
316
  hole_fill: import_zod.z.array(HoleFillSchema),
125
- cement_pad: CementPadSchema,
317
+ cement_pad: CementPadSchema.optional(),
126
318
  lithology: import_zod.z.array(LithologySchema),
127
319
  fractures: import_zod.z.array(FractureSchema),
128
- caves: import_zod.z.array(CaveSchema)
129
- });
320
+ caves: import_zod.z.array(CaveSchema),
321
+ hydrodynamic_events: import_zod.z.array(HydrodynamicEventSchema).optional(),
322
+ aquifer_analysis: import_zod.z.array(AquiferAnalysisSchema).optional(),
323
+ history_logs: import_zod.z.array(HistoryLogEntrySchema).optional()
324
+ }).passthrough();
325
+ function normalizeV1Fields(raw) {
326
+ const out = { ...raw };
327
+ out.version = 2;
328
+ if ("bole_hole" in out && !("bore_hole" in out)) {
329
+ out.bore_hole = out.bole_hole;
330
+ delete out.bole_hole;
331
+ }
332
+ if (!("location" in out)) {
333
+ const lat = out.lat;
334
+ const lng = out.lng;
335
+ const elevation = out.elevation;
336
+ if (lat !== void 0 && lng !== void 0) {
337
+ out.location = {
338
+ lat,
339
+ lng,
340
+ ...elevation !== void 0 && { elevation }
341
+ };
342
+ }
343
+ }
344
+ for (const key of [
345
+ "bore_hole",
346
+ "well_case",
347
+ "well_screen",
348
+ "surface_case",
349
+ "hole_fill"
350
+ ]) {
351
+ const items = out[key];
352
+ if (Array.isArray(items)) {
353
+ const hasDiamPol = items.some(
354
+ (item) => "diam_pol" in item
355
+ );
356
+ if (hasDiamPol) {
357
+ out[key] = items.map((item) => {
358
+ const { diam_pol, ...rest } = item;
359
+ return { ...rest, diameter: (diam_pol || 0) * 25.4 };
360
+ });
361
+ }
362
+ }
363
+ }
364
+ if (Array.isArray(out.lithology)) {
365
+ out.lithology = out.lithology.map((item) => {
366
+ if ("fgdc_texture" in item && !("texture" in item)) {
367
+ const { fgdc_texture, ...rest } = item;
368
+ return { ...rest, texture: { code: fgdc_texture, vocabulary: "fgdc" } };
369
+ }
370
+ return item;
371
+ });
372
+ }
373
+ if (Array.isArray(out.well_screen)) {
374
+ out.well_screen = out.well_screen.map(
375
+ (item) => {
376
+ if ("screen_slot_mm" in item && !("screen_slot" in item)) {
377
+ const { screen_slot_mm, ...rest } = item;
378
+ return { ...rest, screen_slot: screen_slot_mm };
379
+ }
380
+ return item;
381
+ }
382
+ );
383
+ }
384
+ return out;
385
+ }
130
386
  function parseWell(json) {
131
387
  const raw = JSON.parse(json);
132
- return WellSchema.parse(raw);
388
+ const version = raw.version;
389
+ if (version !== void 0 && typeof version === "number") {
390
+ if (version !== 1 && version !== 2) {
391
+ throw new Error(`Unsupported .well format version: ${version}`);
392
+ }
393
+ if (version === 1) {
394
+ const normalized = normalizeV1Fields(raw);
395
+ return mergeWell(
396
+ WellSchema.parse(normalized),
397
+ normalized
398
+ );
399
+ }
400
+ } else if (version !== void 0) {
401
+ throw new Error(`Unsupported .well format version: ${String(version)}`);
402
+ } else {
403
+ raw.version = 2;
404
+ }
405
+ return mergeWell(WellSchema.parse(raw), raw);
133
406
  }
134
407
 
135
408
  // src/utils/well.utils.ts
136
- var WELL_FORMAT_VERSION = 1;
409
+ var WELL_FORMAT_VERSION = 2;
137
410
  var INCHES_TO_MM = 25.4;
411
+ var SECTION_KEYS = [
412
+ "general",
413
+ "constructive",
414
+ "geology",
415
+ "hydrodynamic",
416
+ "history"
417
+ ];
138
418
  var EMPTY_WELL = {
419
+ version: 2,
139
420
  bore_hole: [],
140
421
  well_case: [],
141
422
  reduction: [],
@@ -150,11 +431,56 @@ var EMPTY_WELL = {
150
431
  function createEmptyWell() {
151
432
  return JSON.parse(JSON.stringify(EMPTY_WELL));
152
433
  }
434
+ function calculatedWellDepth(well) {
435
+ const lastTo = (items) => items.length ? items[items.length - 1].to : 0;
436
+ return Math.max(
437
+ 0,
438
+ lastTo(well.bore_hole),
439
+ lastTo(well.hole_fill),
440
+ lastTo(well.reduction),
441
+ lastTo(well.surface_case),
442
+ lastTo(well.well_case),
443
+ lastTo(well.well_screen)
444
+ );
445
+ }
446
+ function withCalculatedWellDepth(well) {
447
+ if (well.well_depth != null) return well;
448
+ const calculated = calculatedWellDepth(well);
449
+ return calculated > 0 ? { ...well, well_depth: calculated } : well;
450
+ }
153
451
  function normalizeLithology(items) {
154
- return items.map((item) => ({ aquifer_unit: "", ...item }));
452
+ return items.map((item) => {
453
+ const base = { aquifer_unit: "", ...item };
454
+ if ("fgdc_texture" in base && !("texture" in base)) {
455
+ const { fgdc_texture, ...rest } = base;
456
+ return {
457
+ ...rest,
458
+ texture: { code: fgdc_texture, vocabulary: "fgdc" }
459
+ };
460
+ }
461
+ return base;
462
+ });
463
+ }
464
+ function normalizeWellScreens(items) {
465
+ return items.map((item) => {
466
+ if ("screen_slot_mm" in item && !("screen_slot" in item)) {
467
+ const { screen_slot_mm, ...rest } = item;
468
+ return {
469
+ ...rest,
470
+ screen_slot: screen_slot_mm
471
+ };
472
+ }
473
+ return item;
474
+ });
155
475
  }
156
476
  function decodeV1Well(raw) {
157
- return {
477
+ const lat = raw.lat;
478
+ const lng = raw.lng;
479
+ const elevation = raw.elevation;
480
+ const hasCoords = lat !== void 0 || lng !== void 0 || elevation !== void 0;
481
+ const location = hasCoords && lat !== void 0 && lng !== void 0 ? { lat, lng, ...elevation !== void 0 && { elevation } } : void 0;
482
+ const rawScreens = raw.well_screen ?? [];
483
+ const decoded = {
158
484
  ...createEmptyWell(),
159
485
  ...raw.well_type !== void 0 && { well_type: raw.well_type },
160
486
  ...raw.name !== void 0 && { name: raw.name },
@@ -164,14 +490,15 @@ function decodeV1Well(raw) {
164
490
  ...raw.construction_date !== void 0 && {
165
491
  construction_date: raw.construction_date
166
492
  },
167
- ...raw.lat !== void 0 && { lat: raw.lat },
168
- ...raw.lng !== void 0 && { lng: raw.lng },
169
- ...raw.elevation !== void 0 && { elevation: raw.elevation },
493
+ ...lat !== void 0 && { lat },
494
+ ...lng !== void 0 && { lng },
495
+ ...elevation !== void 0 && { elevation },
496
+ ...location !== void 0 && { location },
170
497
  ...raw.obs !== void 0 && { obs: raw.obs },
171
498
  bore_hole: raw.bore_hole ?? [],
172
499
  well_case: raw.well_case ?? [],
173
500
  reduction: raw.reduction ?? [],
174
- well_screen: raw.well_screen ?? [],
501
+ well_screen: normalizeWellScreens(rawScreens),
175
502
  surface_case: raw.surface_case ?? [],
176
503
  hole_fill: raw.hole_fill ?? [],
177
504
  ...raw.cement_pad ? { cement_pad: raw.cement_pad } : {},
@@ -179,6 +506,58 @@ function decodeV1Well(raw) {
179
506
  fractures: raw.fractures ?? [],
180
507
  caves: raw.caves ?? []
181
508
  };
509
+ return mergeWell(decoded, raw);
510
+ }
511
+ function decodeV2Well(raw) {
512
+ const rawScreens = raw.well_screen ?? [];
513
+ const decoded = {
514
+ ...createEmptyWell(),
515
+ ...raw.version !== void 0 && { version: raw.version },
516
+ ...raw["@context"] !== void 0 && {
517
+ "@context": raw["@context"]
518
+ },
519
+ ...raw.well_id !== void 0 && {
520
+ well_id: raw.well_id
521
+ },
522
+ ...raw.location !== void 0 && {
523
+ location: raw.location
524
+ },
525
+ ...raw.profiles !== void 0 && {
526
+ profiles: raw.profiles
527
+ },
528
+ ...raw.well_type !== void 0 && { well_type: raw.well_type },
529
+ ...raw.name !== void 0 && { name: raw.name },
530
+ ...raw.well_driller !== void 0 && {
531
+ well_driller: raw.well_driller
532
+ },
533
+ ...raw.construction_date !== void 0 && {
534
+ construction_date: raw.construction_date
535
+ },
536
+ ...raw.obs !== void 0 && { obs: raw.obs },
537
+ ...raw.well_depth !== void 0 && {
538
+ well_depth: raw.well_depth
539
+ },
540
+ bore_hole: raw.bore_hole ?? [],
541
+ well_case: raw.well_case ?? [],
542
+ reduction: raw.reduction ?? [],
543
+ well_screen: normalizeWellScreens(rawScreens),
544
+ surface_case: raw.surface_case ?? [],
545
+ hole_fill: raw.hole_fill ?? [],
546
+ ...raw.cement_pad ? { cement_pad: raw.cement_pad } : {},
547
+ lithology: normalizeLithology(raw.lithology ?? []),
548
+ fractures: raw.fractures ?? [],
549
+ caves: raw.caves ?? [],
550
+ ...raw.hydrodynamic_events !== void 0 && {
551
+ hydrodynamic_events: raw.hydrodynamic_events
552
+ },
553
+ ...raw.aquifer_analysis !== void 0 && {
554
+ aquifer_analysis: raw.aquifer_analysis
555
+ },
556
+ ...raw.history_logs !== void 0 && {
557
+ history_logs: raw.history_logs
558
+ }
559
+ };
560
+ return mergeWell(decoded, raw);
182
561
  }
183
562
  function convertLegacyDiameters(items) {
184
563
  if (!items?.length) return items ?? [];
@@ -190,6 +569,9 @@ function convertLegacyDiameters(items) {
190
569
  }
191
570
  function normalizeConstructive(src) {
192
571
  const boreHoleData = src.bole_hole ?? src.bore_hole ?? [];
572
+ const rawScreens = convertLegacyDiameters(
573
+ src.well_screen ?? []
574
+ );
193
575
  return {
194
576
  bore_hole: convertLegacyDiameters(boreHoleData),
195
577
  hole_fill: convertLegacyDiameters(
@@ -201,9 +583,7 @@ function normalizeConstructive(src) {
201
583
  well_case: convertLegacyDiameters(
202
584
  src.well_case ?? []
203
585
  ),
204
- well_screen: convertLegacyDiameters(
205
- src.well_screen ?? []
206
- ),
586
+ well_screen: normalizeWellScreens(rawScreens),
207
587
  reduction: src.reduction ?? [],
208
588
  ...src.cement_pad ? { cement_pad: src.cement_pad } : {}
209
589
  };
@@ -219,16 +599,18 @@ function normalizeGeologic(raw) {
219
599
  function serializeWell(well) {
220
600
  const payload = {
221
601
  version: WELL_FORMAT_VERSION,
602
+ ...well["@context"] !== void 0 && { "@context": well["@context"] },
603
+ ...well.well_id !== void 0 && { well_id: well.well_id },
604
+ ...well.location !== void 0 && { location: well.location },
605
+ ...well.profiles !== void 0 && { profiles: well.profiles },
222
606
  ...well.well_type !== void 0 && { well_type: well.well_type },
223
607
  ...well.name !== void 0 && { name: well.name },
224
608
  ...well.well_driller !== void 0 && { well_driller: well.well_driller },
225
609
  ...well.construction_date !== void 0 && {
226
610
  construction_date: well.construction_date
227
611
  },
228
- ...well.lat !== void 0 && { lat: well.lat },
229
- ...well.lng !== void 0 && { lng: well.lng },
230
- ...well.elevation !== void 0 && { elevation: well.elevation },
231
612
  ...well.obs !== void 0 && { obs: well.obs },
613
+ ...well.well_depth !== void 0 && { well_depth: well.well_depth },
232
614
  bore_hole: well.bore_hole,
233
615
  well_case: well.well_case,
234
616
  reduction: well.reduction,
@@ -238,7 +620,14 @@ function serializeWell(well) {
238
620
  ...well.cement_pad && { cement_pad: well.cement_pad },
239
621
  lithology: well.lithology,
240
622
  fractures: well.fractures,
241
- caves: well.caves
623
+ caves: well.caves,
624
+ ...well.hydrodynamic_events !== void 0 && {
625
+ hydrodynamic_events: well.hydrodynamic_events
626
+ },
627
+ ...well.aquifer_analysis !== void 0 && {
628
+ aquifer_analysis: well.aquifer_analysis
629
+ },
630
+ ...well.history_logs !== void 0 && { history_logs: well.history_logs }
242
631
  };
243
632
  return JSON.stringify(payload);
244
633
  }
@@ -248,6 +637,44 @@ function isWellEmpty(well) {
248
637
  if (raw.constructive || raw.geologic) return false;
249
638
  return well.lithology?.length === 0 && well.fractures?.length === 0 && well.caves?.length === 0 && well.bore_hole?.length === 0 && well.hole_fill?.length === 0 && well.well_case?.length === 0 && well.well_screen?.length === 0;
250
639
  }
640
+ function redactWell(well, visibility) {
641
+ const redacted = { ...well };
642
+ if (!visibility.general) {
643
+ delete redacted.well_id;
644
+ delete redacted.location;
645
+ delete redacted.well_type;
646
+ delete redacted.name;
647
+ delete redacted.well_driller;
648
+ delete redacted.construction_date;
649
+ delete redacted.obs;
650
+ delete redacted.lat;
651
+ delete redacted.lng;
652
+ delete redacted.elevation;
653
+ }
654
+ if (!visibility.constructive) {
655
+ redacted.bore_hole = [];
656
+ redacted.well_case = [];
657
+ redacted.reduction = [];
658
+ redacted.well_screen = [];
659
+ redacted.surface_case = [];
660
+ redacted.hole_fill = [];
661
+ delete redacted.cement_pad;
662
+ delete redacted.well_depth;
663
+ }
664
+ if (!visibility.geology) {
665
+ redacted.lithology = [];
666
+ redacted.fractures = [];
667
+ redacted.caves = [];
668
+ }
669
+ if (!visibility.hydrodynamic) {
670
+ redacted.hydrodynamic_events = [];
671
+ redacted.aquifer_analysis = [];
672
+ }
673
+ if (!visibility.history) {
674
+ redacted.history_logs = [];
675
+ }
676
+ return redacted;
677
+ }
251
678
  function deserializeWell(jsonString) {
252
679
  let raw;
253
680
  try {
@@ -259,9 +686,9 @@ function deserializeWell(jsonString) {
259
686
  throw new Error("Invalid profile format");
260
687
  }
261
688
  if (typeof raw.version === "number") {
262
- if (raw.version !== 1)
263
- throw new Error(`Unsupported .well format version: ${raw.version}`);
264
- return decodeV1Well(raw);
689
+ if (raw.version === 2) return withCalculatedWellDepth(decodeV2Well(raw));
690
+ if (raw.version === 1) return withCalculatedWellDepth(decodeV1Well(raw));
691
+ throw new Error(`Unsupported .well format version: ${raw.version}`);
265
692
  }
266
693
  if (isWellEmpty(raw)) return null;
267
694
  const constructiveSource = raw.constructive ?? raw;
@@ -279,32 +706,453 @@ function deserializeWell(jsonString) {
279
706
  ...raw.elevation !== void 0 && { elevation: raw.elevation },
280
707
  ...raw.obs !== void 0 && { obs: raw.obs }
281
708
  };
282
- return {
709
+ return withCalculatedWellDepth({
283
710
  ...createEmptyWell(),
284
711
  ...metadata,
285
712
  ...normalizeConstructive(constructiveSource),
286
713
  ...normalizeGeologic(raw)
287
- };
714
+ });
288
715
  }
289
716
  var profileToWell = serializeWell;
290
717
  var checkIfProfileIsEmpty = isWellEmpty;
291
718
  var convertProfileFromJSON = deserializeWell;
719
+
720
+ // src/utils/fgdc.textures.ts
721
+ var FGDC_TEXTURES_OPTIONS = [
722
+ // --- Surficial Patterns (Series 100) ---
723
+ { code: 101, label: "Unconsolidated material", pending: true },
724
+ { code: 102, label: "Alluvium", pending: true },
725
+ { code: 103, label: "Terrace deposit", pending: true },
726
+ { code: 104, label: "Floodplain deposit", pending: true },
727
+ { code: 105, label: "Fan or pediment deposit", pending: true },
728
+ { code: 106, label: "Eolian sand", pending: true },
729
+ { code: 107, label: "Silt or loess", pending: true },
730
+ { code: 108, label: "Clay deposit", pending: true },
731
+ { code: 109, label: "Colluvium", pending: true },
732
+ { code: 110, label: "Gravel deposit", pending: true },
733
+ { code: 111, label: "Residual deposit", pending: true },
734
+ { code: 112, label: "Playa deposit", pending: true },
735
+ { code: 113, label: "Lacustrine deposit", pending: true },
736
+ { code: 114, label: "Marine deposit", pending: true },
737
+ { code: 115, label: "Beach or bar deposit", pending: true },
738
+ { code: 116, label: "Organic deposit or peat", pending: true },
739
+ { code: 117, label: "Swamp or marsh deposit", pending: true },
740
+ { code: 118, label: "Soil", pending: true },
741
+ { code: 119, label: "Fill or artificial deposit", pending: true },
742
+ { code: 120, label: "Surficial pattern 120" },
743
+ { code: 121, label: "Surficial pattern 121", pending: true },
744
+ { code: 122, label: "Surficial pattern 122", pending: true },
745
+ { code: 123, label: "Surficial pattern 123" },
746
+ { code: 124, label: "Surficial pattern 124", pending: true },
747
+ { code: 125, label: "Surficial pattern 125", pending: true },
748
+ { code: 126, label: "Surficial pattern 126", pending: true },
749
+ { code: 127, label: "Surficial pattern 127", pending: true },
750
+ { code: 128, label: "Surficial pattern 128", pending: true },
751
+ { code: 129, label: "Surficial pattern 129", pending: true },
752
+ { code: 130, label: "Surficial pattern 130", pending: true },
753
+ { code: 131, label: "Surficial pattern 131", pending: true },
754
+ { code: 132, label: "Surficial pattern 132" },
755
+ { code: 133, label: "Surficial pattern 133", pending: true },
756
+ { code: 134, label: "Surficial pattern 134", pending: true },
757
+ { code: 135, label: "Surficial pattern 135", pending: true },
758
+ { code: 136, label: "Surficial pattern 136", pending: true },
759
+ { code: 137, label: "Surficial pattern 137", pending: true },
760
+ // --- Sedimentary Patterns (Series 200) ---
761
+ { code: 201, label: "Sedimentary pattern 201", pending: true },
762
+ { code: 202, label: "Sedimentary pattern 202", pending: true },
763
+ { code: 203, label: "Sedimentary pattern 203", pending: true },
764
+ { code: 204, label: "Sedimentary pattern 204", pending: true },
765
+ { code: 205, label: "Sedimentary pattern 205", pending: true },
766
+ { code: 206, label: "Sedimentary pattern 206", pending: true },
767
+ { code: 207, label: "Sedimentary pattern 207", pending: true },
768
+ { code: 208, label: "Sedimentary pattern 208", pending: true },
769
+ { code: 209, label: "Sedimentary pattern 209", pending: true },
770
+ { code: 210, label: "Sedimentary pattern 210", pending: true },
771
+ { code: 211, label: "Sedimentary pattern 211", pending: true },
772
+ { code: 212, label: "Sedimentary pattern 212", pending: true },
773
+ { code: 213, label: "Sedimentary pattern 213", pending: true },
774
+ { code: 214, label: "Sedimentary pattern 214", pending: true },
775
+ { code: 215, label: "Sedimentary pattern 215", pending: true },
776
+ { code: 216, label: "Sedimentary pattern 216", pending: true },
777
+ { code: 217, label: "Sedimentary pattern 217", pending: true },
778
+ { code: 218, label: "Sedimentary pattern 218", pending: true },
779
+ { code: 219, label: "Sedimentary pattern 219", pending: true },
780
+ { code: 220, label: "Sedimentary pattern 220", pending: true },
781
+ { code: 221, label: "Sedimentary pattern 221", pending: true },
782
+ { code: 222, label: "Sedimentary pattern 222", pending: true },
783
+ { code: 223, label: "Sedimentary pattern 223", pending: true },
784
+ { code: 224, label: "Sedimentary pattern 224", pending: true },
785
+ { code: 225, label: "Sedimentary pattern 225", pending: true },
786
+ { code: 226, label: "Sedimentary pattern 226", pending: true },
787
+ { code: 227, label: "Sedimentary pattern 227", pending: true },
788
+ { code: 228, label: "Sedimentary pattern 228", pending: true },
789
+ { code: 229, label: "Sedimentary pattern 229", pending: true },
790
+ { code: 230, label: "Sedimentary pattern 230", pending: true },
791
+ { code: 231, label: "Sedimentary pattern 231", pending: true },
792
+ { code: 232, label: "Sedimentary pattern 232", pending: true },
793
+ { code: 233, label: "Sedimentary pattern 233", pending: true },
794
+ // --- Igneous Patterns (Series 300) ---
795
+ { code: 301, label: "Igneous pattern 301", pending: true },
796
+ { code: 302, label: "Igneous pattern 302", pending: true },
797
+ { code: 303, label: "Igneous pattern 303", pending: true },
798
+ { code: 304, label: "Igneous pattern 304", pending: true },
799
+ { code: 305, label: "Igneous pattern 305", pending: true },
800
+ { code: 306, label: "Igneous pattern 306", pending: true },
801
+ { code: 307, label: "Igneous pattern 307", pending: true },
802
+ { code: 308, label: "Igneous pattern 308", pending: true },
803
+ { code: 309, label: "Igneous pattern 309", pending: true },
804
+ { code: 310, label: "Igneous pattern 310", pending: true },
805
+ { code: 311, label: "Igneous pattern 311", pending: true },
806
+ { code: 312, label: "Igneous pattern 312", pending: true },
807
+ { code: 313, label: "Igneous pattern 313", pending: true },
808
+ { code: 314, label: "Igneous pattern 314", pending: true },
809
+ { code: 315, label: "Igneous pattern 315", pending: true },
810
+ { code: 316, label: "Igneous pattern 316", pending: true },
811
+ { code: 317, label: "Igneous pattern 317", pending: true },
812
+ { code: 318, label: "Igneous pattern 318", pending: true },
813
+ { code: 319, label: "Igneous pattern 319", pending: true },
814
+ { code: 320, label: "Igneous pattern 320", pending: true },
815
+ { code: 321, label: "Igneous pattern 321", pending: true },
816
+ { code: 322, label: "Igneous pattern 322", pending: true },
817
+ { code: 323, label: "Igneous pattern 323", pending: true },
818
+ { code: 324, label: "Igneous pattern 324", pending: true },
819
+ { code: 325, label: "Igneous pattern 325", pending: true },
820
+ { code: 326, label: "Igneous pattern 326", pending: true },
821
+ { code: 327, label: "Igneous pattern 327", pending: true },
822
+ { code: 328, label: "Igneous pattern 328", pending: true },
823
+ { code: 329, label: "Igneous pattern 329", pending: true },
824
+ { code: 330, label: "Igneous pattern 330", pending: true },
825
+ { code: 331, label: "Igneous pattern 331", pending: true },
826
+ // --- Miscellaneous and Metamorphic Patterns (Series 400) ---
827
+ { code: 401, label: "Miscellaneous pattern 401", pending: true },
828
+ { code: 402, label: "Miscellaneous pattern 402", pending: true },
829
+ { code: 403, label: "Miscellaneous pattern 403", pending: true },
830
+ { code: 404, label: "Miscellaneous pattern 404", pending: true },
831
+ { code: 405, label: "Miscellaneous pattern 405", pending: true },
832
+ { code: 406, label: "Miscellaneous pattern 406", pending: true },
833
+ { code: 407, label: "Miscellaneous pattern 407", pending: true },
834
+ { code: 408, label: "Miscellaneous pattern 408", pending: true },
835
+ { code: 409, label: "Miscellaneous pattern 409", pending: true },
836
+ { code: 410, label: "Miscellaneous pattern 410", pending: true },
837
+ { code: 411, label: "Miscellaneous pattern 411", pending: true },
838
+ { code: 412, label: "Miscellaneous pattern 412", pending: true },
839
+ { code: 413, label: "Miscellaneous pattern 413", pending: true },
840
+ { code: 414, label: "Miscellaneous pattern 414", pending: true },
841
+ { code: 415, label: "Miscellaneous pattern 415", pending: true },
842
+ { code: 416, label: "Miscellaneous pattern 416", pending: true },
843
+ { code: 417, label: "Miscellaneous pattern 417", pending: true },
844
+ { code: 418, label: "Miscellaneous pattern 418", pending: true },
845
+ { code: 419, label: "Miscellaneous pattern 419", pending: true },
846
+ { code: 420, label: "Miscellaneous pattern 420", pending: true },
847
+ { code: 421, label: "Miscellaneous pattern 421", pending: true },
848
+ { code: 422, label: "Miscellaneous pattern 422", pending: true },
849
+ { code: 423, label: "Miscellaneous pattern 423", pending: true },
850
+ { code: 424, label: "Miscellaneous pattern 424", pending: true },
851
+ { code: 425, label: "Miscellaneous pattern 425", pending: true },
852
+ { code: 426, label: "Miscellaneous pattern 426", pending: true },
853
+ { code: 427, label: "Miscellaneous pattern 427", pending: true },
854
+ { code: 428, label: "Miscellaneous pattern 428", pending: true },
855
+ { code: 429, label: "Miscellaneous pattern 429", pending: true },
856
+ { code: 430, label: "Miscellaneous pattern 430", pending: true },
857
+ { code: 431, label: "Miscellaneous pattern 431", pending: true },
858
+ { code: 432, label: "Miscellaneous pattern 432", pending: true },
859
+ { code: 433, label: "Miscellaneous pattern 433", pending: true },
860
+ { code: 434, label: "Miscellaneous pattern 434", pending: true },
861
+ { code: 435, label: "Miscellaneous pattern 435", pending: true },
862
+ { code: 436, label: "Miscellaneous pattern 436", pending: true },
863
+ // --- Glacial Patterns (Series 500) ---
864
+ { code: 521, label: "Glacial pattern 521", pending: true },
865
+ { code: 522, label: "Glacial pattern 522", pending: true },
866
+ { code: 523, label: "Glacial pattern 523", pending: true },
867
+ { code: 524, label: "Glacial pattern 524", pending: true },
868
+ { code: 530, label: "Glacial pattern 530", pending: true },
869
+ { code: 531, label: "Glacial pattern 531", pending: true },
870
+ { code: 532, label: "Glacial pattern 532", pending: true },
871
+ { code: 533, label: "Glacial pattern 533", pending: true },
872
+ { code: 534, label: "Glacial pattern 534", pending: true },
873
+ { code: 535, label: "Glacial pattern 535", pending: true },
874
+ { code: 536, label: "Glacial pattern 536", pending: true },
875
+ { code: 537, label: "Glacial pattern 537", pending: true },
876
+ { code: 538, label: "Glacial pattern 538", pending: true },
877
+ { code: 580, label: "Glacial pattern 580", pending: true },
878
+ { code: 581, label: "Glacial pattern 581", pending: true },
879
+ { code: 582, label: "Glacial pattern 582", pending: true },
880
+ { code: 583, label: "Glacial pattern 583", pending: true },
881
+ { code: 584, label: "Glacial pattern 584", pending: true },
882
+ { code: 585, label: "Glacial pattern 585", pending: true },
883
+ { code: 586, label: "Glacial pattern 586", pending: true },
884
+ { code: 587, label: "Glacial pattern 587", pending: true },
885
+ { code: 588, label: "Glacial pattern 588", pending: true },
886
+ { code: 589, label: "Glacial pattern 589", pending: true },
887
+ { code: 591, label: "Periglacial pattern 591", pending: true },
888
+ { code: 592, label: "Periglacial pattern 592", pending: true },
889
+ { code: 593, label: "Periglacial pattern 593", pending: true },
890
+ { code: 594, label: "Periglacial pattern 594", pending: true },
891
+ { code: 595, label: "Periglacial pattern 595", pending: true },
892
+ // --- Sedimentary Lithology Patterns (Series 600) ---
893
+ { code: 601, label: "Gravel or conglomerate (1st option)" },
894
+ { code: 602, label: "Gravel or conglomerate (2nd option)" },
895
+ { code: 603, label: "Crossbedded gravel or conglomerate" },
896
+ { code: 605, label: "Breccia (1st option)" },
897
+ { code: 606, label: "Breccia (2nd option)" },
898
+ { code: 607, label: "Massive sand or sandstone" },
899
+ { code: 608, label: "Bedded sand or sandstone" },
900
+ { code: 609, label: "Crossbedded sand or sandstone (1st option)" },
901
+ { code: 610, label: "Crossbedded sand or sandstone (2nd option)" },
902
+ { code: 611, label: "Ripple-bedded sand or sandstone" },
903
+ { code: 612, label: "Argillaceous or shaly sandstone" },
904
+ { code: 613, label: "Calcareous sandstone" },
905
+ { code: 614, label: "Dolomitic sandstone" },
906
+ { code: 616, label: "Silt, siltstone, or shaly silt" },
907
+ { code: 617, label: "Calcareous siltstone" },
908
+ { code: 618, label: "Dolomitic siltstone" },
909
+ { code: 619, label: "Sandy or silty shale" },
910
+ { code: 620, label: "Clay or clay shale" },
911
+ { code: 621, label: "Cherty shale" },
912
+ { code: 622, label: "Dolomitic shale" },
913
+ { code: 623, label: "Calcareous shale or marl" },
914
+ { code: 624, label: "Carbonaceous shale" },
915
+ { code: 625, label: "Oil shale" },
916
+ { code: 626, label: "Chalk" },
917
+ { code: 627, label: "Limestone" },
918
+ { code: 628, label: "Clastic limestone" },
919
+ { code: 629, label: "Fossiliferous clastic limestone" },
920
+ { code: 630, label: "Nodular or irregularly bedded limestone" },
921
+ {
922
+ code: 631,
923
+ label: "Limestone, irregular (burrow?) fillings of saccharoidal dolomite"
924
+ },
925
+ { code: 632, label: "Crossbedded limestone" },
926
+ { code: 633, label: "Cherty crossbedded limestone" },
927
+ { code: 634, label: "Cherty and sandy crossbedded clastic limestone" },
928
+ { code: 635, label: "Oolitic limestone" },
929
+ { code: 636, label: "Sandy limestone" },
930
+ { code: 637, label: "Silty limestone" },
931
+ { code: 638, label: "Argillaceous or shaly limestone" },
932
+ { code: 639, label: "Cherty limestone (1st option)" },
933
+ { code: 640, label: "Cherty limestone (2nd option)" },
934
+ { code: 641, label: "Dolomitic limestone, limy dolostone, or limy dolomite" },
935
+ { code: 642, label: "Dolostone or dolomite" },
936
+ { code: 643, label: "Crossbedded dolostone or dolomite" },
937
+ { code: 644, label: "Oolitic dolostone or dolomite" },
938
+ { code: 645, label: "Sandy dolostone or dolomite" },
939
+ { code: 646, label: "Silty dolostone or dolomite" },
940
+ { code: 647, label: "Argillaceous or shaly dolostone or dolomite" },
941
+ { code: 648, label: "Cherty dolostone or dolomite" },
942
+ { code: 649, label: "Bedded chert (1st option)" },
943
+ { code: 650, label: "Bedded chert (2nd option)" },
944
+ { code: 651, label: "Fossiliferous bedded chert" },
945
+ { code: 652, label: "Fossiliferous rock" },
946
+ { code: 653, label: "Diatomaceous rock" },
947
+ { code: 654, label: "Subgraywacke" },
948
+ { code: 655, label: "Crossbedded subgraywacke" },
949
+ { code: 656, label: "Ripple-bedded subgraywacke" },
950
+ { code: 657, label: "Peat" },
951
+ { code: 658, label: "Coal" },
952
+ { code: 659, label: "Bony coal or impure coal" },
953
+ { code: 660, label: "Underclay" },
954
+ { code: 661, label: "Flint clay" },
955
+ { code: 662, label: "Bentonite" },
956
+ { code: 663, label: "Glauconite" },
957
+ { code: 664, label: "Limonite" },
958
+ { code: 665, label: "Siderite" },
959
+ { code: 666, label: "Phosphatic-nodular rock" },
960
+ { code: 667, label: "Gypsum" },
961
+ { code: 668, label: "Salt" },
962
+ { code: 669, label: "Interbedded sandstone and siltstone" },
963
+ { code: 670, label: "Interbedded sandstone and shale" },
964
+ { code: 671, label: "Interbedded ripple-bedded sandstone and shale" },
965
+ {
966
+ code: 672,
967
+ label: "Interbedded shale and silty limestone (shale dominant)"
968
+ },
969
+ {
970
+ code: 673,
971
+ label: "Interbedded shale and limestone, shale dominant (1st option)"
972
+ },
973
+ {
974
+ code: 674,
975
+ label: "Interbedded shale and limestone, shale dominant (2nd option)"
976
+ },
977
+ {
978
+ code: 675,
979
+ label: "Interbedded calcareous shale and limestone (shale dominant)"
980
+ },
981
+ { code: 676, label: "Interbedded silty limestone and shale" },
982
+ { code: 677, label: "Interbedded limestone and shale (1st option)" },
983
+ { code: 678, label: "Interbedded limestone and shale (2nd option)" },
984
+ { code: 679, label: "Interbedded limestone and shale (limestone dominant)" },
985
+ { code: 680, label: "Interbedded limestone and calcareous shale" },
986
+ { code: 681, label: "Till or diamicton (1st option)" },
987
+ { code: 682, label: "Till or diamicton (2nd option)" },
988
+ { code: 683, label: "Till or diamicton (3rd option)" },
989
+ { code: 684, label: "Loess (1st option)" },
990
+ { code: 685, label: "Loess (2nd option)" },
991
+ { code: 686, label: "Loess (3rd option)" },
992
+ // --- Metamorphic Lithology Patterns (Series 700) ---
993
+ { code: 701, label: "Metamorphism" },
994
+ { code: 702, label: "Quartzite" },
995
+ { code: 703, label: "Slate" },
996
+ { code: 704, label: "Schistose or gneissoid granite" },
997
+ { code: 705, label: "Schist" },
998
+ { code: 706, label: "Contorted schist" },
999
+ { code: 707, label: "Schist and gneiss" },
1000
+ { code: 708, label: "Gneiss" },
1001
+ { code: 709, label: "Contorted gneiss" },
1002
+ { code: 710, label: "Soapstone, talc, or serpentinite" },
1003
+ // --- Igneous and Vein-Matter Lithology Patterns (Series 700 continued) ---
1004
+ { code: 711, label: "Tuffaceous rock" },
1005
+ { code: 712, label: "Crystal tuff" },
1006
+ { code: 713, label: "Devitrified tuff" },
1007
+ { code: 714, label: "Volcanic breccia and tuff" },
1008
+ { code: 715, label: "Volcanic breccia or agglomerate" },
1009
+ { code: 716, label: "Zeolitic rock" },
1010
+ { code: 717, label: "Basaltic flows" },
1011
+ { code: 718, label: "Granite (1st option)" },
1012
+ { code: 719, label: "Granite (2nd option)" },
1013
+ { code: 720, label: "Banded igneous rock" },
1014
+ { code: 721, label: "Igneous rock (1st option)" },
1015
+ { code: 722, label: "Igneous rock (2nd option)" },
1016
+ { code: 723, label: "Igneous rock (3rd option)" },
1017
+ { code: 724, label: "Igneous rock (4th option)" },
1018
+ { code: 725, label: "Igneous rock (5th option)" },
1019
+ { code: 726, label: "Igneous rock (6th option)" },
1020
+ { code: 727, label: "Igneous rock (7th option)" },
1021
+ { code: 728, label: "Igneous rock (8th option)" },
1022
+ { code: 729, label: "Porphyritic rock (1st option)" },
1023
+ { code: 730, label: "Porphyritic rock (2nd option)" },
1024
+ { code: 731, label: "Vitrophyre" },
1025
+ { code: 732, label: "Quartz" },
1026
+ { code: 733, label: "Ore" }
1027
+ ];
1028
+
1029
+ // src/utils/units.ts
1030
+ var FEET_PER_METER = 3.280839895;
1031
+ var METERS_PER_FOOT = 0.3048;
1032
+ var MM_PER_INCH = 25.4;
1033
+ var M3H_TO_LS = 1 / 3.6;
1034
+ var M3H_TO_USGPM = 4.402867361;
1035
+ var M2S_TO_M2D = 86400;
1036
+ var PSI_PER_KPA = 0.145037738;
1037
+ var SLOT_MM = 0.0254;
1038
+ function metersToFeet(m) {
1039
+ return m * FEET_PER_METER;
1040
+ }
1041
+ function feetToMeters(ft) {
1042
+ return ft * METERS_PER_FOOT;
1043
+ }
1044
+ function mmToInches(mm) {
1045
+ return mm / MM_PER_INCH;
1046
+ }
1047
+ function inchesToMm(inches) {
1048
+ return inches * MM_PER_INCH;
1049
+ }
1050
+ function cubicMeterPerHourToLitersPerSecond(q) {
1051
+ return q * M3H_TO_LS;
1052
+ }
1053
+ function litersPerSecondToCubicMeterPerHour(q) {
1054
+ return q / M3H_TO_LS;
1055
+ }
1056
+ function cubicMeterPerHourToUsGallonsPerMinute(q) {
1057
+ return q * M3H_TO_USGPM;
1058
+ }
1059
+ function usGallonsPerMinuteToCubicMeterPerHour(q) {
1060
+ return q / M3H_TO_USGPM;
1061
+ }
1062
+ function squareMeterPerSecondToSquareMeterPerDay(t) {
1063
+ return t * M2S_TO_M2D;
1064
+ }
1065
+ function squareMeterPerDayToSquareMeterPerSecond(t) {
1066
+ return t / M2S_TO_M2D;
1067
+ }
1068
+ function decimalDegreesToDms(degrees, axis = "lat") {
1069
+ const abs = Math.abs(degrees);
1070
+ const d = Math.floor(abs);
1071
+ const minFloat = (abs - d) * 60;
1072
+ const m = Math.floor(minFloat);
1073
+ const s = (minFloat - m) * 60;
1074
+ const direction = axis === "lat" ? degrees >= 0 ? "N" : "S" : degrees >= 0 ? "E" : "W";
1075
+ return { degrees: d, minutes: m, seconds: s, direction };
1076
+ }
1077
+ function dmsToDecimalDegrees(dms) {
1078
+ const abs = dms.degrees + dms.minutes / 60 + dms.seconds / 3600;
1079
+ return dms.direction === "S" || dms.direction === "W" ? -abs : abs;
1080
+ }
1081
+ function slotNumberToMm(slotNumber) {
1082
+ return slotNumber * SLOT_MM;
1083
+ }
1084
+ function mmToSlotNumber(mm) {
1085
+ return Math.round(mm / SLOT_MM);
1086
+ }
1087
+ function kilopascalToPsi(kPa) {
1088
+ return kPa * PSI_PER_KPA;
1089
+ }
1090
+ function psiToKilopascal(psi) {
1091
+ return psi / PSI_PER_KPA;
1092
+ }
1093
+ function minutesToHours(min) {
1094
+ return min / 60;
1095
+ }
1096
+ function hoursToMinutes(h) {
1097
+ return h * 60;
1098
+ }
292
1099
  // Annotate the CommonJS export names for ESM import in node:
293
1100
  0 && (module.exports = {
1101
+ AirliftEventSchema,
1102
+ AquiferAnalysisSchema,
1103
+ AttachmentSchema,
294
1104
  BoreHoleSchema,
295
1105
  CaveSchema,
296
1106
  CementPadSchema,
1107
+ ConstantRateEventSchema,
1108
+ FGDC_TEXTURES_OPTIONS,
297
1109
  FractureSchema,
1110
+ HistoryLogEntrySchema,
298
1111
  HoleFillSchema,
1112
+ HydrodynamicEventBaseSchema,
1113
+ HydrodynamicEventSchema,
1114
+ LevelReadingSchema,
299
1115
  LithologySchema,
1116
+ LocationPropertiesSchema,
1117
+ LocationSchema,
1118
+ PumpingStepSchema,
1119
+ RecoveryOnlyEventSchema,
1120
+ RecoveryPhaseSchema,
300
1121
  ReductionSchema,
1122
+ SECTION_KEYS,
1123
+ SpotMeasurementEventSchema,
1124
+ StepDrawdownEventSchema,
301
1125
  SurfaceCaseSchema,
1126
+ TextureSchema,
302
1127
  WellCaseSchema,
1128
+ WellIdSchema,
303
1129
  WellSchema,
304
1130
  WellScreenSchema,
305
1131
  checkIfProfileIsEmpty,
306
1132
  convertProfileFromJSON,
1133
+ cubicMeterPerHourToLitersPerSecond,
1134
+ cubicMeterPerHourToUsGallonsPerMinute,
1135
+ decimalDegreesToDms,
1136
+ deserializeWell,
1137
+ dmsToDecimalDegrees,
1138
+ feetToMeters,
1139
+ hoursToMinutes,
1140
+ inchesToMm,
1141
+ isWellEmpty,
1142
+ kilopascalToPsi,
1143
+ litersPerSecondToCubicMeterPerHour,
1144
+ metersToFeet,
1145
+ minutesToHours,
1146
+ mmToInches,
1147
+ mmToSlotNumber,
307
1148
  parseWell,
308
- profileToWell
1149
+ profileToWell,
1150
+ psiToKilopascal,
1151
+ redactWell,
1152
+ serializeWell,
1153
+ slotNumberToMm,
1154
+ squareMeterPerDayToSquareMeterPerSecond,
1155
+ squareMeterPerSecondToSquareMeterPerDay,
1156
+ usGallonsPerMinuteToCubicMeterPerHour
309
1157
  });
310
1158
  //# sourceMappingURL=index.cjs.map