brepjs-bim 0.26.0 → 0.27.1

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.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region \0rolldown/runtime.js
2
+ // \0rolldown/runtime.js
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -20,11 +20,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
20
  value: mod,
21
21
  enumerable: true
22
22
  }) : target, mod));
23
- //#endregion
24
23
  let brepjs = require("brepjs");
25
24
  let web_ifc = require("web-ifc");
26
25
  web_ifc = __toESM(web_ifc, 1);
27
- //#region src/identity/ifcGuid.ts
26
+ // src/identity/ifcGuid.ts
28
27
  var IFC_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$";
29
28
  function newIfcGuid() {
30
29
  const bytes = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
@@ -53,8 +52,7 @@ function encodeIfcGuid(bytes) {
53
52
  if (bits > 0) result += IFC_CHARS[acc << 6 - bits & 63] ?? "";
54
53
  return result;
55
54
  }
56
- //#endregion
57
- //#region src/identity/guidDerivation.ts
55
+ // src/identity/guidDerivation.ts
58
56
  var NAMESPACE = "brepjs-bim:v1";
59
57
  var FNV_OFFSET = 2166136261;
60
58
  var FNV_PRIME = 16777619;
@@ -115,8 +113,7 @@ function makeRelKey(modelScope, kind, localId) {
115
113
  function makeLineKey(modelScope, expressId) {
116
114
  return `line:${modelScope}:${expressId}`;
117
115
  }
118
- //#endregion
119
- //#region src/identity/localId.ts
116
+ // src/identity/localId.ts
120
117
  function makeLocalIdCounter(start = 1) {
121
118
  let n = start;
122
119
  return {
@@ -124,8 +121,7 @@ function makeLocalIdCounter(start = 1) {
124
121
  current: () => n - 1
125
122
  };
126
123
  }
127
- //#endregion
128
- //#region src/errors/bimError.ts
124
+ // src/errors/bimError.ts
129
125
  function specError(code, message, cause) {
130
126
  return {
131
127
  kind: "BIM_SPEC",
@@ -206,8 +202,7 @@ function fromBrepError(inner, code, message) {
206
202
  cause: inner
207
203
  };
208
204
  }
209
- //#endregion
210
- //#region ../../node_modules/zod/v4/core/util.js
205
+ // ../../node_modules/zod/v4/core/util.js
211
206
  function getEnumValues(entries) {
212
207
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
213
208
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -514,6 +509,17 @@ function prefixIssues(path, issues) {
514
509
  function unwrapMessage(message) {
515
510
  return typeof message === "string" ? message : message?.message;
516
511
  }
512
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
513
+ function sizeCaps(defChecks) {
514
+ const caps = [];
515
+ for (const ch of defChecks ?? []) {
516
+ const d = ch._zod.def;
517
+ if (!/_(length|size)$|_equals$/.test(d.check)) break;
518
+ const max = d.maximum ?? d.length ?? d.size;
519
+ if (max >= 0) caps.push([max, ch]);
520
+ }
521
+ return caps;
522
+ }
517
523
  function attachSchema(issues, start, inst) {
518
524
  var _a;
519
525
  for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
@@ -606,6 +612,7 @@ function hide(inst, key, value) {
606
612
  return own(inst, key, value, false);
607
613
  }
608
614
  /** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
615
+ /* @__NO_SIDE_EFFECTS__ */
609
616
  function derived(computes, table) {
610
617
  for (const key in computes) {
611
618
  const compute = computes[key];
@@ -729,8 +736,7 @@ function constantCatch(value) {
729
736
  fn[CONSTANT_CATCH] = true;
730
737
  return fn;
731
738
  }
732
- //#endregion
733
- //#region ../../node_modules/zod/v4/core/core.js
739
+ // ../../node_modules/zod/v4/core/core.js
734
740
  var _a$1;
735
741
  var _zodDesc = {
736
742
  value: void 0,
@@ -757,6 +763,7 @@ function newError(Definition) {
757
763
  }
758
764
  return new Definition();
759
765
  }
766
+ /* @__NO_SIDE_EFFECTS__ */
760
767
  function $constructor(name, initializer, proto, params) {
761
768
  const zodProto = {};
762
769
  function Internals(def) {
@@ -835,8 +842,7 @@ function config(newConfig) {
835
842
  if (newConfig) Object.assign(globalConfig, newConfig);
836
843
  return globalConfig;
837
844
  }
838
- //#endregion
839
- //#region ../../node_modules/zod/v4/core/errors.js
845
+ // ../../node_modules/zod/v4/core/errors.js
840
846
  function _getMessage() {
841
847
  const internals = this._zod;
842
848
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -887,8 +893,7 @@ var initializer$1 = (inst, def) => {
887
893
  });
888
894
  }
889
895
  };
890
- var $ZodError = $constructor("$ZodError", initializer$1);
891
- $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
896
+ var $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
892
897
  /** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
893
898
  * ("toString", "constructor") would otherwise read through to the prototype, and assigning
894
899
  * "__proto__" would hit the setter instead of creating a key. */
@@ -951,8 +956,7 @@ function formatError(error, mapper = (issue) => issue.message) {
951
956
  processError(error);
952
957
  return fieldErrors;
953
958
  }
954
- //#endregion
955
- //#region ../../node_modules/zod/v4/core/parse.js
959
+ // ../../node_modules/zod/v4/core/parse.js
956
960
  function finalizeParams(callee, params) {
957
961
  return {
958
962
  callee: params?.callee ?? callee,
@@ -1154,8 +1158,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
1154
1158
  var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1155
1159
  return _safeParseAsync(_Err)(schema, value, _ctx);
1156
1160
  };
1157
- //#endregion
1158
- //#region ../../node_modules/zod/v4/core/regexes.js
1161
+ // ../../node_modules/zod/v4/core/regexes.js
1159
1162
  /**
1160
1163
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
1161
1164
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -1226,8 +1229,7 @@ var number$1 = /^-?\d+(?:\.\d+)?$/;
1226
1229
  var boolean$1 = /^(?:true|false)$/i;
1227
1230
  var lowercase = /^[^A-Z]*$/;
1228
1231
  var uppercase = /^[^a-z]*$/;
1229
- //#endregion
1230
- //#region ../../node_modules/zod/v4/core/checks.js
1232
+ // ../../node_modules/zod/v4/core/checks.js
1231
1233
  var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1232
1234
  var _a;
1233
1235
  inst._zod ?? (inst._zod = {});
@@ -1522,8 +1524,7 @@ var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst,
1522
1524
  payload.value = def.tx(payload.value);
1523
1525
  };
1524
1526
  });
1525
- //#endregion
1526
- //#region ../../node_modules/zod/v4/core/doc.js
1527
+ // ../../node_modules/zod/v4/core/doc.js
1527
1528
  var Doc = class {
1528
1529
  constructor(args = [], closed = {}) {
1529
1530
  this.content = [];
@@ -1556,15 +1557,13 @@ var Doc = class {
1556
1557
  return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
1557
1558
  }
1558
1559
  };
1559
- //#endregion
1560
- //#region ../../node_modules/zod/v4/core/versions.js
1560
+ // ../../node_modules/zod/v4/core/versions.js
1561
1561
  var version = {
1562
1562
  major: 4,
1563
1563
  minor: 6,
1564
- patch: 5
1564
+ patch: 7
1565
1565
  };
1566
- //#endregion
1567
- //#region ../../node_modules/zod/v4/core/schemas.js
1566
+ // ../../node_modules/zod/v4/core/schemas.js
1568
1567
  var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1569
1568
  var _a;
1570
1569
  inst ?? (inst = {});
@@ -2061,6 +2060,26 @@ var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
2061
2060
  return payload;
2062
2061
  };
2063
2062
  });
2063
+ function capSize(inst, size) {
2064
+ const caps = sizeCaps(inst._zod.def.checks);
2065
+ if (!caps.length) return;
2066
+ const cap = Math.min(...caps.map((c) => c[0]));
2067
+ const parse = inst._zod.parse;
2068
+ inst._zod.parse = (payload, ctx) => {
2069
+ const n = size(payload.value);
2070
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
2071
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
2072
+ const start = payload.issues.length;
2073
+ ch._zod.check(payload);
2074
+ payload.issues[start].continue = false;
2075
+ attachSchema(payload.issues, start, inst);
2076
+ return payload;
2077
+ }
2078
+ }
2079
+ return parse(payload, ctx);
2080
+ };
2081
+ }
2082
+ var arraySize = (input) => Array.isArray(input) ? input.length : -1;
2064
2083
  function handleArrayResult(result, final, index) {
2065
2084
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
2066
2085
  final.value[index] = result.value;
@@ -2098,6 +2117,7 @@ var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
2098
2117
  if (proms.length) return Promise.all(proms).then(() => payload);
2099
2118
  return payload;
2100
2119
  };
2120
+ capSize(inst, arraySize);
2101
2121
  });
2102
2122
  function handlePropertyResult(result, final, key, input, optin, optout) {
2103
2123
  const isPresent = key in input;
@@ -2206,7 +2226,7 @@ var $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2206
2226
  }
2207
2227
  return propValues;
2208
2228
  });
2209
- const isObject$2 = isObject;
2229
+ const isObject$1 = isObject;
2210
2230
  const catchall = def.catchall;
2211
2231
  let value;
2212
2232
  const memo = globalConfig.memoizer;
@@ -2214,7 +2234,7 @@ var $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2214
2234
  inst._zod.parse = (payload, ctx) => {
2215
2235
  value ?? (value = _normalized.value);
2216
2236
  const input = payload.value;
2217
- if (!isObject$2(input)) {
2237
+ if (!isObject$1(input)) {
2218
2238
  payload.issues.push({
2219
2239
  expected: "object",
2220
2240
  code: "invalid_type",
@@ -2344,7 +2364,7 @@ var $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
2344
2364
  return doc.compile();
2345
2365
  };
2346
2366
  let fastpass;
2347
- const isObject$1 = isObject;
2367
+ const isObject$2 = isObject;
2348
2368
  const jit = !globalConfig.jitless;
2349
2369
  const fastEnabled = jit && allowsEval.value;
2350
2370
  const catchall = def.catchall;
@@ -2352,7 +2372,7 @@ var $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
2352
2372
  inst._zod.parse = (payload, ctx) => {
2353
2373
  value ?? (value = _normalized.value);
2354
2374
  const input = payload.value;
2355
- if (!isObject$1(input)) {
2375
+ if (!isObject$2(input)) {
2356
2376
  payload.issues.push({
2357
2377
  expected: "object",
2358
2378
  code: "invalid_type",
@@ -3105,8 +3125,7 @@ function handleRefineResult(result, payload, input, inst) {
3105
3125
  payload.issues.push(issue$1(_iss));
3106
3126
  }
3107
3127
  }
3108
- //#endregion
3109
- //#region ../../node_modules/zod/v4/core/memoizer.js
3128
+ // ../../node_modules/zod/v4/core/memoizer.js
3110
3129
  var $ZodCyclicError = class extends Error {
3111
3130
  constructor() {
3112
3131
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -3358,8 +3377,7 @@ function isBackEdge(ctx, value) {
3358
3377
  const backEdges = ctx[STATE]?.backEdges;
3359
3378
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
3360
3379
  }
3361
- //#endregion
3362
- //#region ../../node_modules/zod/v4/locales/en.js
3380
+ // ../../node_modules/zod/v4/locales/en.js
3363
3381
  var error = () => {
3364
3382
  const Sizable = {
3365
3383
  string: {
@@ -3466,8 +3484,7 @@ var error = () => {
3466
3484
  function en_default() {
3467
3485
  return { localeError: error() };
3468
3486
  }
3469
- //#endregion
3470
- //#region ../../node_modules/zod/v4/core/registries.js
3487
+ // ../../node_modules/zod/v4/core/registries.js
3471
3488
  var _a;
3472
3489
  var $ZodRegistry = class {
3473
3490
  constructor() {
@@ -3513,8 +3530,7 @@ function registry() {
3513
3530
  }
3514
3531
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
3515
3532
  var globalRegistry = globalThis.__zod_globalRegistry;
3516
- //#endregion
3517
- //#region ../../node_modules/zod/v4/core/api.js
3533
+ // ../../node_modules/zod/v4/core/api.js
3518
3534
  function snapshotChecks(def) {
3519
3535
  if (def.checks) def.checks = [...def.checks];
3520
3536
  return def;
@@ -4033,8 +4049,7 @@ function _check(fn, params) {
4033
4049
  ch._zod.check = fn;
4034
4050
  return ch;
4035
4051
  }
4036
- //#endregion
4037
- //#region ../../node_modules/zod/v4/core/to-json-schema.js
4052
+ // ../../node_modules/zod/v4/core/to-json-schema.js
4038
4053
  function assignProps(target, ...sources) {
4039
4054
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
4040
4055
  return target;
@@ -4477,8 +4492,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
4477
4492
  extractDefs(ctx, schema);
4478
4493
  return finalize$1(ctx, schema);
4479
4494
  };
4480
- //#endregion
4481
- //#region ../../node_modules/zod/v4/core/json-schema-processors.js
4495
+ // ../../node_modules/zod/v4/core/json-schema-processors.js
4482
4496
  var narrowMin = (agg, key, value) => {
4483
4497
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
4484
4498
  };
@@ -4977,8 +4991,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
4977
4991
  const seen = ctx.seen.get(schema);
4978
4992
  seen.ref = def.innerType;
4979
4993
  };
4980
- //#endregion
4981
- //#region ../../node_modules/zod/v4/classic/errors.js
4994
+ // ../../node_modules/zod/v4/classic/errors.js
4982
4995
  var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4983
4996
  function _lazyMethod(proto, key, make) {
4984
4997
  Object.defineProperty(proto, key, {
@@ -5027,8 +5040,7 @@ var initializer = (inst, issues) => {
5027
5040
  });
5028
5041
  };
5029
5042
  var ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
5030
- //#endregion
5031
- //#region ../../node_modules/zod/v4/classic/parse.js
5043
+ // ../../node_modules/zod/v4/classic/parse.js
5032
5044
  var parse = /* @__PURE__ */ _parse(ZodRealError);
5033
5045
  var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
5034
5046
  var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -5041,8 +5053,7 @@ var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
5041
5053
  var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
5042
5054
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
5043
5055
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
5044
- //#endregion
5045
- //#region ../../node_modules/zod/v4/classic/schemas.js
5056
+ // ../../node_modules/zod/v4/classic/schemas.js
5046
5057
  function _ensureDefaultLocale() {
5047
5058
  if (!globalConfig.localeError) config(en_default());
5048
5059
  }
@@ -5957,8 +5968,7 @@ function refine(fn, _params = {}) {
5957
5968
  function superRefine(fn, params) {
5958
5969
  return /* @__PURE__ */ _superRefine(fn, params);
5959
5970
  }
5960
- //#endregion
5961
- //#region src/geometryCleanupDiagnostics.ts
5971
+ // src/geometryCleanupDiagnostics.ts
5962
5972
  var diagnosticSchema = object({
5963
5973
  operation: string(),
5964
5974
  itemIndex: number().int().nonnegative(),
@@ -6059,8 +6069,7 @@ function reportedGeometryCleanup(error, operation, context = {}) {
6059
6069
  visit(error);
6060
6070
  return diagnostics;
6061
6071
  }
6062
- //#endregion
6063
- //#region src/placementFrame.ts
6072
+ // src/placementFrame.ts
6064
6073
  /** Numeric, column-major rigid frames. Translation is in millimetres. */
6065
6074
  /** Construction is private; every exposed matrix is an immutable snapshot. */
6066
6075
  var RigidFrame = class RigidFrame {
@@ -6369,8 +6378,7 @@ function isFiniteNumbers(value) {
6369
6378
  function within(value, target, tolerance) {
6370
6379
  return value >= target - tolerance && value <= target + tolerance;
6371
6380
  }
6372
- //#endregion
6373
- //#region src/rigidPlacement.ts
6381
+ // src/rigidPlacement.ts
6374
6382
  var RAD_TO_DEG = 180 / Math.PI;
6375
6383
  var ROTATION_EPSILON = 1e-12;
6376
6384
  /** Applies a rigid placement as a location so the source BRep is not rebuilt. */
@@ -6441,8 +6449,7 @@ function rotationOp(matrix) {
6441
6449
  axis
6442
6450
  };
6443
6451
  }
6444
- //#endregion
6445
- //#region src/productBodyCleanup.ts
6452
+ // src/productBodyCleanup.ts
6446
6453
  var COMPLETE_CLEANUP = Object.freeze({ kind: "COMPLETE" });
6447
6454
  function cleanupReport(diagnostics) {
6448
6455
  const [first, ...rest] = diagnostics;
@@ -6500,14 +6507,12 @@ function cleanupOwnedResources(items, context) {
6500
6507
  }
6501
6508
  return cleanupReport(diagnostics);
6502
6509
  }
6503
- //#endregion
6504
- //#region src/productBodyTestHooks.ts
6510
+ // src/productBodyTestHooks.ts
6505
6511
  var hooks = null;
6506
6512
  function productBodyTestHooks() {
6507
6513
  return hooks;
6508
6514
  }
6509
- //#endregion
6510
- //#region src/types/productBody.ts
6515
+ // src/types/productBody.ts
6511
6516
  var descriptorSchema = object({
6512
6517
  kind: _enum(["PARAMETRIC", "AUTHORITATIVE"]),
6513
6518
  solids: custom((value) => Array.isArray(value)).refine((value) => value.length > 0)
@@ -6798,8 +6803,7 @@ function validateBoundsItems(input) {
6798
6803
  operation: "productBodyBounds"
6799
6804
  });
6800
6805
  }
6801
- //#endregion
6802
- //#region src/geometryGeneration.ts
6806
+ // src/geometryGeneration.ts
6803
6807
  var uncertainGeneration = /* @__PURE__ */ new WeakMap();
6804
6808
  /** Already-attempted resources, with identities captured before any release. Never retry them. */
6805
6809
  function uncertainGeneratedResources(error) {
@@ -6867,8 +6871,7 @@ function generateGeometry(context, build) {
6867
6871
  metadata: { cleanup: cleanupReport(diagnostics) }
6868
6872
  }, uncertain);
6869
6873
  }
6870
- //#endregion
6871
- //#region src/elementFns/validateGeneratedSolid.ts
6874
+ // src/elementFns/validateGeneratedSolid.ts
6872
6875
  /** Validate a candidate already owned by the surrounding generation scope. */
6873
6876
  function validateGeneratedSolid(solid, context) {
6874
6877
  let cause;
@@ -6879,8 +6882,7 @@ function validateGeneratedSolid(solid, context) {
6879
6882
  }
6880
6883
  return (0, brepjs.err)(geometryError(context.code, context.message, cause));
6881
6884
  }
6882
- //#endregion
6883
- //#region src/elementFns/wallFns.ts
6885
+ // src/elementFns/wallFns.ts
6884
6886
  function wallToSolid(spec) {
6885
6887
  return generateGeometry({
6886
6888
  operation: "wallToSolid",
@@ -6926,8 +6928,7 @@ function wallToSolid(spec) {
6926
6928
  });
6927
6929
  });
6928
6930
  }
6929
- //#endregion
6930
- //#region src/elementFns/slabFns.ts
6931
+ // src/elementFns/slabFns.ts
6931
6932
  function slabToSolid(spec) {
6932
6933
  return generateGeometry({
6933
6934
  operation: "slabToSolid",
@@ -6973,8 +6974,7 @@ function slabToSolid(spec) {
6973
6974
  });
6974
6975
  });
6975
6976
  }
6976
- //#endregion
6977
- //#region src/specs/profilesExtended.ts
6977
+ // src/specs/profilesExtended.ts
6978
6978
  var ELLIPSE_SEGMENTS = 48;
6979
6979
  function extendedProfileArea(profile) {
6980
6980
  switch (profile.kind) {
@@ -7253,8 +7253,7 @@ function extendedProfileToFace(profile) {
7253
7253
  return (0, brepjs.ok)(faceWithHoles);
7254
7254
  });
7255
7255
  }
7256
- //#endregion
7257
- //#region src/specs/profile.ts
7256
+ // src/specs/profile.ts
7258
7257
  var EXTENDED_PROFILE_KIND_SET = /* @__PURE__ */ new Set([
7259
7258
  "L_SHAPE",
7260
7259
  "T_SHAPE",
@@ -7429,8 +7428,7 @@ function parseProfile(input) {
7429
7428
  }
7430
7429
  return (0, brepjs.ok)(profile);
7431
7430
  }
7432
- //#endregion
7433
- //#region src/elementFns/profileFns.ts
7431
+ // src/elementFns/profileFns.ts
7434
7432
  function profileCrossSectionArea(profile) {
7435
7433
  if (isExtendedProfile(profile)) return extendedProfileArea(profile);
7436
7434
  switch (profile.kind) {
@@ -7568,8 +7566,7 @@ function profileToPolygon(profile, circleSegments = 32) {
7568
7566
  }
7569
7567
  }
7570
7568
  }
7571
- //#endregion
7572
- //#region src/elementFns/beamFns.ts
7569
+ // src/elementFns/beamFns.ts
7573
7570
  function beamToSolid(spec) {
7574
7571
  return generateGeometry({
7575
7572
  operation: "beamToSolid",
@@ -7618,8 +7615,7 @@ function beamToSolid(spec) {
7618
7615
  });
7619
7616
  });
7620
7617
  }
7621
- //#endregion
7622
- //#region src/elementFns/columnFns.ts
7618
+ // src/elementFns/columnFns.ts
7623
7619
  function columnToSolid(spec) {
7624
7620
  return generateGeometry({
7625
7621
  operation: "columnToSolid",
@@ -7659,8 +7655,7 @@ function columnToSolid(spec) {
7659
7655
  });
7660
7656
  });
7661
7657
  }
7662
- //#endregion
7663
- //#region src/elementFns/openingFns.ts
7658
+ // src/elementFns/openingFns.ts
7664
7659
  var EPSILON_MM = 1;
7665
7660
  function openingToSolid(spec, wallThickness) {
7666
7661
  return generateGeometry({
@@ -7711,8 +7706,7 @@ function openingToSolid(spec, wallThickness) {
7711
7706
  });
7712
7707
  });
7713
7708
  }
7714
- //#endregion
7715
- //#region src/elementFns/slabOpeningFns.ts
7709
+ // src/elementFns/slabOpeningFns.ts
7716
7710
  function slabOpeningToSolid(spec, slabThickness) {
7717
7711
  return generateGeometry({
7718
7712
  operation: "slabOpeningToSolid",
@@ -7762,8 +7756,7 @@ function slabOpeningToSolid(spec, slabThickness) {
7762
7756
  });
7763
7757
  });
7764
7758
  }
7765
- //#endregion
7766
- //#region src/ownedSolidChildren.ts
7759
+ // src/ownedSolidChildren.ts
7767
7760
  /** Register every eager iterator allocation before wrapping any child. */
7768
7761
  function ownSolidChildren(parent, own) {
7769
7762
  const kernel = (0, brepjs.getKernel)();
@@ -7789,8 +7782,7 @@ function ownSolidChildren(parent, own) {
7789
7782
  children.forEach(({ resource }, itemIndex) => own(resource, itemIndex));
7790
7783
  return children.map(({ wrap }) => wrap());
7791
7784
  }
7792
- //#endregion
7793
- //#region src/elementFns/cutOpeningSolid.ts
7785
+ // src/elementFns/cutOpeningSolid.ts
7794
7786
  /** Borrow the host; retain one independent solid only after all temporary cleanup succeeds. */
7795
7787
  function cutOpeningSolid(input) {
7796
7788
  const prefix = `${input.hostKind}_OPENING`;
@@ -7814,8 +7806,7 @@ function cutOpeningSolid(input) {
7814
7806
  });
7815
7807
  });
7816
7808
  }
7817
- //#endregion
7818
- //#region src/elementFns/spaceFns.ts
7809
+ // src/elementFns/spaceFns.ts
7819
7810
  function spaceToSolid(spec) {
7820
7811
  return generateGeometry({
7821
7812
  operation: "spaceToSolid",
@@ -7861,8 +7852,7 @@ function spaceToSolid(spec) {
7861
7852
  });
7862
7853
  });
7863
7854
  }
7864
- //#endregion
7865
- //#region src/elementFns/roofFns.ts
7855
+ // src/elementFns/roofFns.ts
7866
7856
  var DEG2RAD = Math.PI / 180;
7867
7857
  function gate(solid, code, own) {
7868
7858
  return validateGeneratedSolid(own(solid), {
@@ -8084,8 +8074,7 @@ function roofToSolid(spec) {
8084
8074
  }
8085
8075
  });
8086
8076
  }
8087
- //#endregion
8088
- //#region src/elementFns/curtainWallFns.ts
8077
+ // src/elementFns/curtainWallFns.ts
8089
8078
  function registerResource(owned, resource, itemIndex) {
8090
8079
  const item = {
8091
8080
  resource,
@@ -8251,8 +8240,7 @@ function curtainWallToGrid(spec) {
8251
8240
  }
8252
8241
  }, uncertain);
8253
8242
  }
8254
- //#endregion
8255
- //#region src/elementFns/foundationFns.ts
8243
+ // src/elementFns/foundationFns.ts
8256
8244
  function footingToSolid(spec) {
8257
8245
  return generateGeometry({
8258
8246
  operation: "footingToSolid",
@@ -8337,8 +8325,7 @@ function pileToSolid(spec) {
8337
8325
  });
8338
8326
  });
8339
8327
  }
8340
- //#endregion
8341
- //#region src/elementFns/railingFns.ts
8328
+ // src/elementFns/railingFns.ts
8342
8329
  function panelRailing(spec) {
8343
8330
  return generateGeometry({
8344
8331
  operation: "railingToSolid",
@@ -8438,8 +8425,7 @@ function railingToSolid(spec) {
8438
8425
  if (spec.thickness <= 0) return (0, brepjs.err)(specError("RAILING_ZERO_THICKNESS", "Railing thickness must be positive"));
8439
8426
  return spec.infill === "POSTED" ? postedRailing(spec) : panelRailing(spec);
8440
8427
  }
8441
- //#endregion
8442
- //#region src/elementFns/coveringFns.ts
8428
+ // src/elementFns/coveringFns.ts
8443
8429
  function coveringToSolid(spec) {
8444
8430
  return generateGeometry({
8445
8431
  operation: "coveringToSolid",
@@ -8485,8 +8471,7 @@ function coveringToSolid(spec) {
8485
8471
  });
8486
8472
  });
8487
8473
  }
8488
- //#endregion
8489
- //#region src/model/modelGeometry.ts
8474
+ // src/model/modelGeometry.ts
8490
8475
  /** Transitional enumeration of current record storage. Step 2 converges these forms. */
8491
8476
  function retainedSolids(element) {
8492
8477
  switch (element.category) {
@@ -8545,8 +8530,7 @@ function protectElement(element) {
8545
8530
  }));
8546
8531
  return (0, brepjs.ok)(Object.freeze(element));
8547
8532
  }
8548
- //#endregion
8549
- //#region src/model/bimModel.ts
8533
+ // src/model/bimModel.ts
8550
8534
  var RejectedModelCommand = class extends Error {
8551
8535
  error;
8552
8536
  constructor(error) {
@@ -9822,8 +9806,7 @@ var BimModel = class {
9822
9806
  return localId;
9823
9807
  }
9824
9808
  };
9825
- //#endregion
9826
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/usingCtx.js
9809
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/usingCtx.js
9827
9810
  function _usingCtx() {
9828
9811
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
9829
9812
  var n = Error();
@@ -9878,8 +9861,7 @@ function _usingCtx() {
9878
9861
  }
9879
9862
  };
9880
9863
  }
9881
- //#endregion
9882
- //#region src/elementFns/stairFns.ts
9864
+ // src/elementFns/stairFns.ts
9883
9865
  function buildSilhouette$1(numberOfRisers, riserHeight, treadLength) {
9884
9866
  const pts = [];
9885
9867
  pts.push([
@@ -9942,8 +9924,7 @@ function stairFlightToSolid(spec) {
9942
9924
  _usingCtx$7.d();
9943
9925
  }
9944
9926
  }
9945
- //#endregion
9946
- //#region src/elementFns/rampFns.ts
9927
+ // src/elementFns/rampFns.ts
9947
9928
  function buildSilhouette(length, rise, thickness) {
9948
9929
  return [
9949
9930
  [
@@ -10001,8 +9982,7 @@ function rampFlightToSolid(spec) {
10001
9982
  _usingCtx$6.d();
10002
9983
  }
10003
9984
  }
10004
- //#endregion
10005
- //#region src/elementFns/placedGeometry.ts
9985
+ // src/elementFns/placedGeometry.ts
10006
9986
  function place(solid, frame) {
10007
9987
  try {
10008
9988
  return (0, brepjs.ok)(locateShapeInFrame(solid, frame));
@@ -10200,8 +10180,7 @@ function validatePlacements(el, parent) {
10200
10180
  }
10201
10181
  return (0, brepjs.ok)(void 0);
10202
10182
  }
10203
- //#endregion
10204
- //#region src/ifc-writer/schemaVersion.ts
10183
+ // src/ifc-writer/schemaVersion.ts
10205
10184
  /**
10206
10185
  * IFC schema-version abstraction for the writer.
10207
10186
  *
@@ -10263,8 +10242,7 @@ function schemaSupports(schema, entityName) {
10263
10242
  if (IFC4X3_ONLY_ENTITIES.has(entityName)) return schema === "IFC4X3";
10264
10243
  return true;
10265
10244
  }
10266
- //#endregion
10267
- //#region src/ifcRuntime.ts
10245
+ // src/ifcRuntime.ts
10268
10246
  var wasmLocateFile;
10269
10247
  /**
10270
10248
  * Override how web-ifc finds its `.wasm` file. Applied by every web-ifc entry
@@ -10289,8 +10267,7 @@ function setIfcWasmLocateFile(locate) {
10289
10267
  async function initIfcApi(api) {
10290
10268
  await api.Init(wasmLocateFile, true);
10291
10269
  }
10292
- //#endregion
10293
- //#region src/ifc-writer/ifcWriter.ts
10270
+ // src/ifc-writer/ifcWriter.ts
10294
10271
  var testHooks$3 = null;
10295
10272
  /** Default MVD ViewDefinition declared in the STEP FILE_DESCRIPTION header. */
10296
10273
  var DEFAULT_MVD_VIEW_DEFINITION = "ReferenceView_v1.2";
@@ -10406,8 +10383,7 @@ var IfcWriter = class IfcWriter {
10406
10383
  return out;
10407
10384
  }
10408
10385
  };
10409
- //#endregion
10410
- //#region src/ifc-writer/ownerHistoryWriter.ts
10386
+ // src/ifc-writer/ownerHistoryWriter.ts
10411
10387
  /**
10412
10388
  * Writes the IfcPerson → IfcOrganization → IfcPersonAndOrganization →
10413
10389
  * IfcApplication → IfcOwnerHistory chain from the supplied metadata and returns
@@ -10511,8 +10487,7 @@ function optionalLabel(w, value) {
10511
10487
  if (value === void 0 || value.length === 0) return null;
10512
10488
  return w.mkType(web_ifc.IFCLABEL, value);
10513
10489
  }
10514
- //#endregion
10515
- //#region src/ifc-writer/headerWriter.ts
10490
+ // src/ifc-writer/headerWriter.ts
10516
10491
  function writeHeader(w, meta) {
10517
10492
  const ownerHistoryId = writeOwnerHistory(w, {
10518
10493
  author: meta.author ?? {},
@@ -10693,8 +10668,7 @@ function writeDirection(w, dir) {
10693
10668
  });
10694
10669
  return id;
10695
10670
  }
10696
- //#endregion
10697
- //#region src/units/units.ts
10671
+ // src/units/units.ts
10698
10672
  var DEFAULT_UNITS = { length: "mm" };
10699
10673
  function toLengthMm(value, unit) {
10700
10674
  switch (unit) {
@@ -10707,8 +10681,7 @@ function toLengthMm(value, unit) {
10707
10681
  function toIfcLengthM(mm) {
10708
10682
  return mm / 1e3;
10709
10683
  }
10710
- //#endregion
10711
- //#region src/ifc-writer/entityWriter.ts
10684
+ // src/ifc-writer/entityWriter.ts
10712
10685
  function writeProject$1(w, guid, name, ownerHistoryId, unitAssignmentId, geomContextId) {
10713
10686
  const id = w.nextId();
10714
10687
  w.writeLine({
@@ -10926,8 +10899,7 @@ function writeColumnEntity(w, guid, name, _predefinedType, ownerHistoryId, local
10926
10899
  });
10927
10900
  return id;
10928
10901
  }
10929
- //#endregion
10930
- //#region src/ifc-writer/tessellationWriter.ts
10902
+ // src/ifc-writer/tessellationWriter.ts
10931
10903
  var IFC_MESH_TOLERANCE_MM = 5;
10932
10904
  var IFC_MESH_ANGULAR_TOLERANCE_RAD = .3;
10933
10905
  function prepareTessellation(solid, toleranceMm = IFC_MESH_TOLERANCE_MM) {
@@ -11149,8 +11121,7 @@ function writeFacetedBrepFallback(w, geomSubContextId, reason) {
11149
11121
  fallbackReason: reason
11150
11122
  };
11151
11123
  }
11152
- //#endregion
11153
- //#region src/ifc-writer/profileDefWriter.ts
11124
+ // src/ifc-writer/profileDefWriter.ts
11154
11125
  var AREA_PROFILE = {
11155
11126
  type: 3,
11156
11127
  value: "AREA"
@@ -11397,8 +11368,7 @@ function writePolyline(w, points) {
11397
11368
  });
11398
11369
  return id;
11399
11370
  }
11400
- //#endregion
11401
- //#region src/ifc-writer/geometryWriter.ts
11371
+ // src/ifc-writer/geometryWriter.ts
11402
11372
  function writeSlabGeometry(w, spec, geomSubContextId, parentPlacementId) {
11403
11373
  const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
11404
11374
  const localPlacementId = w.nextId();
@@ -11700,8 +11670,7 @@ function writeBeamGeometry(w, spec, geomSubContextId, parentPlacementId) {
11700
11670
  function writeColumnGeometry(w, spec, geomSubContextId, parentPlacementId) {
11701
11671
  return writeLinearExtrusion(w, spec.profile, spec.origin, spec.axisZ, spec.axisX, toIfcLengthM(spec.height), geomSubContextId, parentPlacementId);
11702
11672
  }
11703
- //#endregion
11704
- //#region src/ifc-writer/spaceWriter.ts
11673
+ // src/ifc-writer/spaceWriter.ts
11705
11674
  function writeSpaceGeometry(w, spec, geomSubContextId, parentPlacementId) {
11706
11675
  const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
11707
11676
  const localPlacementId = w.nextId();
@@ -11824,8 +11793,7 @@ function writeRelSpaceBoundary(w, guid, ownerHistoryId, spaceExpressId, elementE
11824
11793
  }
11825
11794
  });
11826
11795
  }
11827
- //#endregion
11828
- //#region src/ifc-writer/roofWriter.ts
11796
+ // src/ifc-writer/roofWriter.ts
11829
11797
  /**
11830
11798
  * Writes an IfcRoof occurrence. `localPlacementId` and `productDefinitionShapeId`
11831
11799
  * are the IfcLocalPlacement and IfcProductDefinitionShape express IDs produced by
@@ -11886,8 +11854,7 @@ function writeRoofType(w, ownerHistoryId, typeGuid, relGuid, predefinedType, occ
11886
11854
  })
11887
11855
  };
11888
11856
  }
11889
- //#endregion
11890
- //#region src/ifc-writer/curtainWallWriter.ts
11857
+ // src/ifc-writer/curtainWallWriter.ts
11891
11858
  function writeComponentGeometry(w, component, geomSubContextId, parentPlacementId) {
11892
11859
  const placement3DId = writeAxis2Placement3D(w, component.origin.map(toIfcLengthM));
11893
11860
  const localPlacementId = w.nextId();
@@ -12074,8 +12041,7 @@ function writeCurtainWall(w, spec, grid, stableKey, name, ownerHistoryId, geomSu
12074
12041
  aggregatesId
12075
12042
  };
12076
12043
  }
12077
- //#endregion
12078
- //#region src/ifc-writer/foundationWriter.ts
12044
+ // src/ifc-writer/foundationWriter.ts
12079
12045
  function writeFootingGeometry(w, spec, geomSubContextId, parentPlacementId) {
12080
12046
  const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
12081
12047
  const localPlacementId = w.nextId();
@@ -12227,8 +12193,7 @@ function writePileEntity(w, guid, name, _predefinedType, constructionType, owner
12227
12193
  });
12228
12194
  return id;
12229
12195
  }
12230
- //#endregion
12231
- //#region src/ifc-writer/relWriter.ts
12196
+ // src/ifc-writer/relWriter.ts
12232
12197
  function writeRelAggregates(w, guid, ownerHistoryId, relatingObjectId, relatedObjectIds) {
12233
12198
  w.writeLine({
12234
12199
  expressID: w.nextId(),
@@ -12253,8 +12218,7 @@ function writeRelContainedInSpatialStructure(w, guid, ownerHistoryId, relatingSt
12253
12218
  RelatingStructure: w.ref(relatingStructureId)
12254
12219
  });
12255
12220
  }
12256
- //#endregion
12257
- //#region src/ifc-writer/stairWriter.ts
12221
+ // src/ifc-writer/stairWriter.ts
12258
12222
  function writeLocalPlacement(w, origin, axisZ, axisX, parentPlacementId) {
12259
12223
  const placement3DId = writeAxis2Placement3D(w, origin.map(toIfcLengthM), axisZ, axisX);
12260
12224
  const localPlacementId = w.nextId();
@@ -12539,8 +12503,7 @@ function writeRampAssembly(w, spec, rampKey, assemblyGuid, ownerHistoryId, geomS
12539
12503
  }
12540
12504
  };
12541
12505
  }
12542
- //#endregion
12543
- //#region src/ifc-writer/railingWriter.ts
12506
+ // src/ifc-writer/railingWriter.ts
12544
12507
  function writeRailingEntity(w, guid, name, _predefinedType, ownerHistoryId, localPlacementId, productDefinitionShapeId) {
12545
12508
  const id = w.nextId();
12546
12509
  w.writeLine({
@@ -12558,8 +12521,7 @@ function writeRailingEntity(w, guid, name, _predefinedType, ownerHistoryId, loca
12558
12521
  });
12559
12522
  return id;
12560
12523
  }
12561
- //#endregion
12562
- //#region src/ifc-writer/coveringWriter.ts
12524
+ // src/ifc-writer/coveringWriter.ts
12563
12525
  function writeCoveringGeometry(w, spec, geomSubContextId, parentPlacementId) {
12564
12526
  const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
12565
12527
  const localPlacementId = w.nextId();
@@ -12671,8 +12633,7 @@ function writeRelCoversBldgElements(w, guid, ownerHistoryId, relatingBuildingEle
12671
12633
  });
12672
12634
  return id;
12673
12635
  }
12674
- //#endregion
12675
- //#region src/ifc-writer/assemblyWriter.ts
12636
+ // src/ifc-writer/assemblyWriter.ts
12676
12637
  /**
12677
12638
  * Emits an IfcElementAssembly grouping container. The assembly itself carries no
12678
12639
  * own geometry by default — parts contribute geometry and are linked via
@@ -12740,8 +12701,7 @@ function writeRelNests(w, guid, ownerHistoryId, relatingObjectId, relatedObjectI
12740
12701
  RelatedObjects: relatedObjectIds.map((id) => w.ref(id))
12741
12702
  });
12742
12703
  }
12743
- //#endregion
12744
- //#region src/ifc-writer/infrastructureWriter.ts
12704
+ // src/ifc-writer/infrastructureWriter.ts
12745
12705
  function writeBridge(w, guid, spec, ownerHistoryId, parentPlacementId) {
12746
12706
  const placementId = writeSpatialLocalPlacement(w, spec, parentPlacementId);
12747
12707
  const entityId = w.nextId();
@@ -12822,8 +12782,7 @@ function writeEarthworksFillEntity(w, guid, spec, ownerHistoryId, localPlacement
12822
12782
  });
12823
12783
  return entityId;
12824
12784
  }
12825
- //#endregion
12826
- //#region src/ifc-writer/tessellatedProductWriter.ts
12785
+ // src/ifc-writer/tessellatedProductWriter.ts
12827
12786
  /** Write a tessellated body in the coordinate frame supplied by the caller. */
12828
12787
  function writeTessellatedProductGeometry(w, solid, geomSubContextId, parentPlacementId) {
12829
12788
  const placement3DId = writeAxis2Placement3D(w, [
@@ -12845,8 +12804,7 @@ function writeTessellatedProductGeometry(w, solid, geomSubContextId, parentPlace
12845
12804
  tessellation
12846
12805
  };
12847
12806
  }
12848
- //#endregion
12849
- //#region src/ifc-writer/groupWriter.ts
12807
+ // src/ifc-writer/groupWriter.ts
12850
12808
  /**
12851
12809
  * Emits an IfcZone grouping object. `longName` (a descriptive label such as
12852
12810
  * "Top Floor Thermal Zone") maps to the entity Description since IfcZone has no
@@ -12900,8 +12858,7 @@ function writeRelAssignsToGroup(w, guid, ownerHistoryId, groupExpressId, memberE
12900
12858
  RelatingGroup: w.ref(groupExpressId)
12901
12859
  });
12902
12860
  }
12903
- //#endregion
12904
- //#region src/ifc-writer/styleWriter.ts
12861
+ // src/ifc-writer/styleWriter.ts
12905
12862
  function clamp01(n) {
12906
12863
  if (n < 0) return 0;
12907
12864
  if (n > 1) return 1;
@@ -12980,8 +12937,7 @@ function writePresentationLayer(w, layerName, itemIds) {
12980
12937
  Identifier: null
12981
12938
  });
12982
12939
  }
12983
- //#endregion
12984
- //#region src/ifc-writer/connectivityWriter.ts
12940
+ // src/ifc-writer/connectivityWriter.ts
12985
12941
  /**
12986
12942
  * Emits an IfcRelConnectsElements recording a physical connection between two
12987
12943
  * elements. `description` optionally annotates the connection; geometry of the
@@ -13028,8 +12984,7 @@ function writeRelConnectsPathElements(w, guid, ownerHistoryId, relatingElementId
13028
12984
  }
13029
12985
  });
13030
12986
  }
13031
- //#endregion
13032
- //#region src/ifc-writer/materialWriter.ts
12987
+ // src/ifc-writer/materialWriter.ts
13033
12988
  var LOGICAL_TRUE = "T";
13034
12989
  var LOGICAL_FALSE = "F";
13035
12990
  var LOGICAL_UNKNOWN = "U";
@@ -13140,8 +13095,7 @@ function writeMaterialProfileSet(w, guid, ownerHistoryId, spec, relatedObjectIds
13140
13095
  function writeMaterialSimple(w, guid, ownerHistoryId, materialName, relatedObjectIds) {
13141
13096
  writeRelAssociatesMaterial(w, guid, ownerHistoryId, writeMaterial(w, materialName), relatedObjectIds);
13142
13097
  }
13143
- //#endregion
13144
- //#region src/ifc-writer/classificationWriter.ts
13098
+ // src/ifc-writer/classificationWriter.ts
13145
13099
  /** Stable derivation key for an IfcRelAssociatesClassification, keyed on the ref. */
13146
13100
  function makeClassificationRelKey(ref) {
13147
13101
  return `rel-class:${ref.system}:${ref.code}`;
@@ -13203,8 +13157,7 @@ function writeClassificationRefs(w, ownerHistoryId, refs) {
13203
13157
  });
13204
13158
  }
13205
13159
  }
13206
- //#endregion
13207
- //#region src/psets/psetTemplates.ts
13160
+ // src/psets/psetTemplates.ts
13208
13161
  var STATUS_PROPERTY = {
13209
13162
  name: "Status",
13210
13163
  measureType: "IFCLABEL",
@@ -13466,8 +13419,7 @@ function webIfcConstantFor(measureType) {
13466
13419
  function templateFor(category) {
13467
13420
  return PSET_TEMPLATES[category];
13468
13421
  }
13469
- //#endregion
13470
- //#region src/psets/qtoWeights.ts
13422
+ // src/psets/qtoWeights.ts
13471
13423
  /**
13472
13424
  * Indicative material bulk densities in kg/m³, keyed by lowercase material name.
13473
13425
  * These are nominal values for deriving an analytic IfcQuantityWeight from a
@@ -13525,8 +13477,7 @@ function writeWeightQuantity(w, name, volumeM3, densityKgM3) {
13525
13477
  });
13526
13478
  return id;
13527
13479
  }
13528
- //#endregion
13529
- //#region src/ifc-writer/psetWriter.ts
13480
+ // src/ifc-writer/psetWriter.ts
13530
13481
  /**
13531
13482
  * Resolves the IFC measure value for a Pset property by name. Properties listed
13532
13483
  * in the Pset measure-type table emit their canonical IFC measure type (e.g.
@@ -13961,8 +13912,7 @@ function writeCoveringCommonPset(w, ownerHistoryId, coveringExpressId, spec) {
13961
13912
  if (spec.status !== void 0) values["Status"] = spec.status;
13962
13913
  writeCommonPset(w, ownerHistoryId, coveringExpressId, "COVERING", values);
13963
13914
  }
13964
- //#endregion
13965
- //#region src/ifc-writer/openingWriter.ts
13915
+ // src/ifc-writer/openingWriter.ts
13966
13916
  function writeAxis2Placement2D(w) {
13967
13917
  const originId = w.nextId();
13968
13918
  w.writeLine({
@@ -14326,8 +14276,7 @@ function writeDoorCommonPset(w, ownerHistoryId, doorEntityId, spec) {
14326
14276
  function writeWindowCommonPset(w, ownerHistoryId, windowEntityId, spec) {
14327
14277
  writeCommonPset(w, ownerHistoryId, windowEntityId, "WINDOW", buildOpeningPsetValues(spec));
14328
14278
  }
14329
- //#endregion
14330
- //#region src/ifc-writer/proxyWriter.ts
14279
+ // src/ifc-writer/proxyWriter.ts
14331
14280
  /**
14332
14281
  * Writes the IfcLocalPlacement (at origin, relative to parentPlacementId) and a
14333
14282
  * tessellated body (IfcTriangulatedFaceSet) for a proxy's solid. Solid
@@ -14357,8 +14306,7 @@ function writeProxyEntity(w, guid, name, predefinedType, ownerHistoryId, localPl
14357
14306
  });
14358
14307
  return id;
14359
14308
  }
14360
- //#endregion
14361
- //#region src/ifc-writer/typeWriter.ts
14309
+ // src/ifc-writer/typeWriter.ts
14362
14310
  var TYPE_CONSTANT = {
14363
14311
  IFCWALLTYPE: web_ifc.IFCWALLTYPE,
14364
14312
  IFCSLABTYPE: web_ifc.IFCSLABTYPE,
@@ -14472,8 +14420,7 @@ function writeIfcType(w, ownerHistoryId, typeName, typeGuid, relGuid, predefined
14472
14420
  })
14473
14421
  };
14474
14422
  }
14475
- //#endregion
14476
- //#region src/validation/severity.ts
14423
+ // src/validation/severity.ts
14477
14424
  function issue(severity, code, message, entity, context) {
14478
14425
  return {
14479
14426
  severity,
@@ -14505,8 +14452,7 @@ function countBySeverity(report) {
14505
14452
  for (const i of report.issues) counts[i.severity] += 1;
14506
14453
  return counts;
14507
14454
  }
14508
- //#endregion
14509
- //#region src/validation/geometryValidity.ts
14455
+ // src/validation/geometryValidity.ts
14510
14456
  /**
14511
14457
  * Minimum solid volume (mm³) treated as physically meaningful. Real building
14512
14458
  * elements are many orders of magnitude larger; degenerate solids produced by
@@ -14564,16 +14510,14 @@ function checkOne(solid, entity) {
14564
14510
  if (volume.value <= MIN_VOLUME_MM3) issues.push(issue("error", "ZERO_VOLUME", `Solid has zero or negligible volume (${volume.value} mm³); it carries no usable geometry`, entity, { volumeMm3: volume.value }));
14565
14511
  return issues;
14566
14512
  }
14567
- //#endregion
14568
- //#region src/types/bimTypes.ts
14513
+ // src/types/bimTypes.ts
14569
14514
  function isWallOpening(spec) {
14570
14515
  return spec.kind === "WALL_OPENING";
14571
14516
  }
14572
14517
  function isSlabOpening(spec) {
14573
14518
  return spec.kind === "SLAB_OPENING";
14574
14519
  }
14575
- //#endregion
14576
- //#region src/validation/referentialIntegrity.ts
14520
+ // src/validation/referentialIntegrity.ts
14577
14521
  /**
14578
14522
  * Physical building elements that must live inside exactly one spatial
14579
14523
  * structure (via IfcRelContainedInSpatialStructure / CONTAINED_IN). Spatial
@@ -14660,8 +14604,7 @@ function checkOpeningExists(issues, elementsById, openingId, code) {
14660
14604
  }
14661
14605
  if (opening.category !== "OPENING") issues.push(issue("error", code === "VOID_OPENING_MISSING" ? "VOID_OPENING_WRONG_CATEGORY" : "FILL_OPENING_WRONG_CATEGORY", `References opening localId ${openingId}, expected OPENING but found ${opening.category}`, openingId, { actual: opening.category }));
14662
14606
  }
14663
- //#endregion
14664
- //#region src/validation/schemaCheck.ts
14607
+ // src/validation/schemaCheck.ts
14665
14608
  /**
14666
14609
  * EXPRESS/STEP self-validation gate.
14667
14610
  *
@@ -14739,8 +14682,7 @@ function describeError(e) {
14739
14682
  if (e instanceof Error) return e.message;
14740
14683
  return String(e);
14741
14684
  }
14742
- //#endregion
14743
- //#region src/validation/roundTrip.ts
14685
+ // src/validation/roundTrip.ts
14744
14686
  /**
14745
14687
  * Human-readable names of the key entities whose per-type counts are compared
14746
14688
  * across a write→read→re-write round-trip. The keys double as `typeCounts` map
@@ -14848,8 +14790,7 @@ async function checkRoundTrip(bytes) {
14848
14790
  secondPass
14849
14791
  };
14850
14792
  }
14851
- //#endregion
14852
- //#region src/import/spfReader.ts
14793
+ // src/import/spfReader.ts
14853
14794
  var SUPPORTED_SCHEMAS = [
14854
14795
  "IFC2X3",
14855
14796
  "IFC4",
@@ -15029,8 +14970,7 @@ var SpfReader = class SpfReader {
15029
14970
  return typeof decoded === "string" ? decoded : s;
15030
14971
  }
15031
14972
  };
15032
- //#endregion
15033
- //#region src/validation/qtoDefinitions.generated.ts
14973
+ // src/validation/qtoDefinitions.generated.ts
15034
14974
  var QTO_DEFINITIONS = {
15035
14975
  "Qto_ActuatorBaseQuantities": {
15036
14976
  "entities": ["IFCACTUATOR"],
@@ -15651,8 +15591,7 @@ var QTO_DEFINITIONS = {
15651
15591
  }
15652
15592
  }
15653
15593
  };
15654
- //#endregion
15655
- //#region src/validation/gherkinChecks.ts
15594
+ // src/validation/gherkinChecks.ts
15656
15595
  /**
15657
15596
  * Local implementations of the buildingSMART Validation Service's gherkin
15658
15597
  * normative rules that apply to the entity vocabulary this writer emits:
@@ -15798,8 +15737,7 @@ function checkGeoreferencing(reader) {
15798
15737
  if (reader.getLinesOfType(web_ifc.IFCPROJECTEDCRS).length > 0 || reader.getLinesOfType(web_ifc.IFCGEOGRAPHICCRS).length > 0) return [];
15799
15738
  return [issue("warning", "NO_GEOREFERENCING", "Model contains a facility but no IfcProjectedCRS/IfcGeographicCRS (GRF003) — set ProjectSpec.crs")];
15800
15739
  }
15801
- //#endregion
15802
- //#region src/serialize/productBodyPreflight.ts
15740
+ // src/serialize/productBodyPreflight.ts
15803
15741
  var testItemPreparer = null;
15804
15742
  /** Prepares every retained Body item without writing IFC lines. Source solids remain borrowed. */
15805
15743
  function preflightProductBody(input) {
@@ -15827,8 +15765,7 @@ function preflightProductBody(input) {
15827
15765
  }
15828
15766
  return (0, brepjs.ok)([first.value, ...remainingPrepared]);
15829
15767
  }
15830
- //#endregion
15831
- //#region src/serialize/wallQuantities.ts
15768
+ // src/serialize/wallQuantities.ts
15832
15769
  function deriveWallQuantities(input) {
15833
15770
  try {
15834
15771
  const measured = measureProductBodyMaterial(input.solids);
@@ -15846,8 +15783,7 @@ function deriveWallQuantities(input) {
15846
15783
  function wallVolumeError(cause) {
15847
15784
  return (0, brepjs.err)(ifcError("IFC_WALL_QUANTITY_DERIVATION_FAILED", "Failed to derive a positive finite NetVolume for the retained Wall Body", cause));
15848
15785
  }
15849
- //#endregion
15850
- //#region src/serialize/toIfc.ts
15786
+ // src/serialize/toIfc.ts
15851
15787
  function preflightProductBodies(elements) {
15852
15788
  const preflighted = [];
15853
15789
  for (const element of elements) {
@@ -16565,8 +16501,7 @@ function findContainerOf(elementId, relationships) {
16565
16501
  for (const rel of relationships) if (rel.kind === "CONTAINED_IN" && rel.relatedElements.includes(elementId)) return rel.relatingStructure;
16566
16502
  return null;
16567
16503
  }
16568
- //#endregion
16569
- //#region src/import/placement.ts
16504
+ // src/import/placement.ts
16570
16505
  /**
16571
16506
  * Metres-per-file-unit length scale read from the IfcUnitAssignment's
16572
16507
  * LENGTHUNIT. Multiply a file-unit length by this to get metres, then by 1000
@@ -16821,8 +16756,7 @@ function enumValue(v) {
16821
16756
  const value = v.value;
16822
16757
  return typeof value === "string" ? value : null;
16823
16758
  }
16824
- //#endregion
16825
- //#region src/import/spatialTree.ts
16759
+ // src/import/spatialTree.ts
16826
16760
  var CATEGORY_BY_TYPE = /* @__PURE__ */ new Map([
16827
16761
  [web_ifc.IFCPROJECT, "PROJECT"],
16828
16762
  [web_ifc.IFCSITE, "SITE"],
@@ -16939,8 +16873,7 @@ function buildElementContainmentMap(reader) {
16939
16873
  for (const [structure, elements] of buildContainmentIndex(reader)) for (const elementId of elements) map.set(elementId, structure);
16940
16874
  return map;
16941
16875
  }
16942
- //#endregion
16943
- //#region src/import/geometryRead.ts
16876
+ // src/import/geometryRead.ts
16944
16877
  var NONE = { kind: "NONE" };
16945
16878
  var testHooks$2 = null;
16946
16879
  /**
@@ -17791,8 +17724,7 @@ function isStreamedTessellatedType(type) {
17791
17724
  function errMsg$1(e) {
17792
17725
  return e instanceof Error ? e.message : String(e);
17793
17726
  }
17794
- //#endregion
17795
- //#region src/import/cutImportedSolids.ts
17727
+ // src/import/cutImportedSolids.ts
17796
17728
  /** Borrow World-placed inputs; own every disconnected result independently of the cut's cache. */
17797
17729
  function cutImportedSolids(host, opening) {
17798
17730
  const context = { operation: "cutImportedSolids" };
@@ -17851,8 +17783,7 @@ function cutImportedSolids(host, opening) {
17851
17783
  }
17852
17784
  });
17853
17785
  }
17854
- //#endregion
17855
- //#region src/import/dataRead.ts
17786
+ // src/import/dataRead.ts
17856
17787
  /** Narrows an unknown line attribute to the `{ type, value }` wrapper shape. */
17857
17788
  function asTyped(v) {
17858
17789
  return typeof v === "object" && v !== null ? v : null;
@@ -18163,8 +18094,7 @@ function readOwnerHistory(reader, ownerHistoryExpressId) {
18163
18094
  creationDate
18164
18095
  } : { applicationName };
18165
18096
  }
18166
- //#endregion
18167
- //#region src/import/fromIfc.ts
18097
+ // src/import/fromIfc.ts
18168
18098
  var testHooks$1 = null;
18169
18099
  /**
18170
18100
  * Each enumerated physical-element IFC type and the {@link ImportedElementCategory}
@@ -18558,8 +18488,7 @@ function refValue(v) {
18558
18488
  function errMsg(e) {
18559
18489
  return e instanceof Error ? e.message : String(e);
18560
18490
  }
18561
- //#endregion
18562
- //#region src/import/importedModel.ts
18491
+ // src/import/importedModel.ts
18563
18492
  /**
18564
18493
  * Frees every reconstructed solid handle held by an imported model. The
18565
18494
  * geometry are live WASM handles, so callers MUST call this once they are done
@@ -18568,8 +18497,7 @@ function errMsg(e) {
18568
18497
  function disposeImportedModel(model) {
18569
18498
  for (const el of model.elements) for (const solid of el.geometry.solids) solid[Symbol.dispose]();
18570
18499
  }
18571
- //#endregion
18572
- //#region src/specs/materialSpec.ts
18500
+ // src/specs/materialSpec.ts
18573
18501
  /**
18574
18502
  * Shared Zod schemas for the optional material-layer and classification fields
18575
18503
  * that element specs (wall/slab/beam/column) accept. Centralised here so every
@@ -18588,8 +18516,7 @@ var ClassificationRefSchema = object({
18588
18516
  code: string().min(1),
18589
18517
  description: string().optional()
18590
18518
  });
18591
- //#endregion
18592
- //#region src/specs/wallSpec.ts
18519
+ // src/specs/wallSpec.ts
18593
18520
  var unitVec$11 = tuple([
18594
18521
  number(),
18595
18522
  number(),
@@ -18637,8 +18564,7 @@ function parseWallSpec(input) {
18637
18564
  if (!result.success) return (0, brepjs.err)(specError("INVALID_WALL_SPEC", result.error.message, result.error));
18638
18565
  return (0, brepjs.ok)(result.data);
18639
18566
  }
18640
- //#endregion
18641
- //#region src/specs/slabSpec.ts
18567
+ // src/specs/slabSpec.ts
18642
18568
  var unitVec$10 = tuple([
18643
18569
  number(),
18644
18570
  number(),
@@ -18694,8 +18620,7 @@ function parseSlabSpec(input) {
18694
18620
  if (!result.success) return (0, brepjs.err)(specError("INVALID_SLAB_SPEC", result.error.message, result.error));
18695
18621
  return (0, brepjs.ok)(result.data);
18696
18622
  }
18697
- //#endregion
18698
- //#region src/specs/beamSpec.ts
18623
+ // src/specs/beamSpec.ts
18699
18624
  var unitVec$9 = tuple([
18700
18625
  number(),
18701
18626
  number(),
@@ -18755,8 +18680,7 @@ function parseBeamSpec(input) {
18755
18680
  if (!profileCheck.ok) return (0, brepjs.err)(profileCheck.error);
18756
18681
  return (0, brepjs.ok)(result.data);
18757
18682
  }
18758
- //#endregion
18759
- //#region src/specs/columnSpec.ts
18683
+ // src/specs/columnSpec.ts
18760
18684
  var unitVec$8 = tuple([
18761
18685
  number(),
18762
18686
  number(),
@@ -18810,8 +18734,7 @@ function parseColumnSpec(input) {
18810
18734
  if (!profileCheck.ok) return (0, brepjs.err)(profileCheck.error);
18811
18735
  return (0, brepjs.ok)(result.data);
18812
18736
  }
18813
- //#endregion
18814
- //#region src/specs/spaceSpec.ts
18737
+ // src/specs/spaceSpec.ts
18815
18738
  var unitVec$7 = tuple([
18816
18739
  number(),
18817
18740
  number(),
@@ -18862,8 +18785,7 @@ function parseSpaceSpec(input) {
18862
18785
  if (!result.success) return (0, brepjs.err)(specError("INVALID_SPACE_SPEC", result.error.message, result.error));
18863
18786
  return (0, brepjs.ok)(result.data);
18864
18787
  }
18865
- //#endregion
18866
- //#region src/specs/roofSpec.ts
18788
+ // src/specs/roofSpec.ts
18867
18789
  var ROOF_PREDEFINED_TYPES = [
18868
18790
  "FLAT_ROOF",
18869
18791
  "SHED_ROOF",
@@ -18927,8 +18849,7 @@ function parseRoofSpec(input) {
18927
18849
  if (!result.success) return (0, brepjs.err)(specError("INVALID_ROOF_SPEC", result.error.message, result.error));
18928
18850
  return (0, brepjs.ok)(result.data);
18929
18851
  }
18930
- //#endregion
18931
- //#region src/specs/curtainWallSpec.ts
18852
+ // src/specs/curtainWallSpec.ts
18932
18853
  var unitVec$5 = tuple([
18933
18854
  number(),
18934
18855
  number(),
@@ -18988,8 +18909,7 @@ function parseCurtainWallSpec(input) {
18988
18909
  if (!result.success) return (0, brepjs.err)(specError("INVALID_CURTAIN_WALL_SPEC", result.error.message, result.error));
18989
18910
  return (0, brepjs.ok)(result.data);
18990
18911
  }
18991
- //#endregion
18992
- //#region src/specs/foundationSpec.ts
18912
+ // src/specs/foundationSpec.ts
18993
18913
  var unitVec$4 = tuple([
18994
18914
  number(),
18995
18915
  number(),
@@ -19079,8 +18999,7 @@ function parsePileSpec(input) {
19079
18999
  if (!profileCheck.ok) return (0, brepjs.err)(profileCheck.error);
19080
19000
  return (0, brepjs.ok)(result.data);
19081
19001
  }
19082
- //#endregion
19083
- //#region src/specs/stairSpec.ts
19002
+ // src/specs/stairSpec.ts
19084
19003
  var unitVec$3 = tuple([
19085
19004
  number(),
19086
19005
  number(),
@@ -19144,8 +19063,7 @@ function parseStairSpec(input) {
19144
19063
  if (!result.success) return (0, brepjs.err)(specError("INVALID_STAIR_SPEC", result.error.message, result.error));
19145
19064
  return (0, brepjs.ok)(result.data);
19146
19065
  }
19147
- //#endregion
19148
- //#region src/specs/rampSpec.ts
19066
+ // src/specs/rampSpec.ts
19149
19067
  var unitVec$2 = tuple([
19150
19068
  number(),
19151
19069
  number(),
@@ -19206,8 +19124,7 @@ function parseRampSpec(input) {
19206
19124
  if (!result.success) return (0, brepjs.err)(specError("INVALID_RAMP_SPEC", result.error.message, result.error));
19207
19125
  return (0, brepjs.ok)(result.data);
19208
19126
  }
19209
- //#endregion
19210
- //#region src/specs/railingSpec.ts
19127
+ // src/specs/railingSpec.ts
19211
19128
  var unitVec$1 = tuple([
19212
19129
  number(),
19213
19130
  number(),
@@ -19259,8 +19176,7 @@ function parseRailingSpec(input) {
19259
19176
  if (!result.success) return (0, brepjs.err)(specError("INVALID_RAILING_SPEC", result.error.message, result.error));
19260
19177
  return (0, brepjs.ok)(result.data);
19261
19178
  }
19262
- //#endregion
19263
- //#region src/specs/coveringSpec.ts
19179
+ // src/specs/coveringSpec.ts
19264
19180
  var unitVec = tuple([
19265
19181
  number(),
19266
19182
  number(),
@@ -19319,8 +19235,7 @@ function parseCoveringSpec(input) {
19319
19235
  if (!result.success) return (0, brepjs.err)(specError("INVALID_COVERING_SPEC", result.error.message, result.error));
19320
19236
  return (0, brepjs.ok)(result.data);
19321
19237
  }
19322
- //#endregion
19323
- //#region src/specs/assemblySpec.ts
19238
+ // src/specs/assemblySpec.ts
19324
19239
  var ElementAssemblySpecSchema = object({
19325
19240
  name: string().optional(),
19326
19241
  predefinedType: _enum([
@@ -19347,8 +19262,7 @@ function parseElementAssemblySpec(input) {
19347
19262
  if (!result.success) return (0, brepjs.err)(specError("INVALID_ASSEMBLY_SPEC", result.error.message, result.error));
19348
19263
  return (0, brepjs.ok)(result.data);
19349
19264
  }
19350
- //#endregion
19351
- //#region src/specs/groupSpec.ts
19265
+ // src/specs/groupSpec.ts
19352
19266
  var ZoneSpecSchema = object({
19353
19267
  name: string().min(1),
19354
19268
  longName: string().optional(),
@@ -19371,8 +19285,7 @@ function parseSystemSpec(input) {
19371
19285
  if (!result.success) return (0, brepjs.err)(specError("INVALID_SYSTEM_SPEC", result.error.message, result.error));
19372
19286
  return (0, brepjs.ok)(result.data);
19373
19287
  }
19374
- //#endregion
19375
- //#region src/specs/styleSpec.ts
19288
+ // src/specs/styleSpec.ts
19376
19289
  var SurfaceStyleSpecSchema = object({
19377
19290
  name: string().min(1),
19378
19291
  r: number().min(0).max(1),
@@ -19385,8 +19298,7 @@ function parseSurfaceStyleSpec(input) {
19385
19298
  if (!result.success) return (0, brepjs.err)(specError("INVALID_STYLE_SPEC", result.error.message, result.error));
19386
19299
  return (0, brepjs.ok)(result.data);
19387
19300
  }
19388
- //#endregion
19389
- //#region src/specs/openingSpec.ts
19301
+ // src/specs/openingSpec.ts
19390
19302
  var baseOpeningSchema = object({
19391
19303
  width: number().positive(),
19392
19304
  height: number().positive(),
@@ -19422,8 +19334,7 @@ function parseSlabOpeningInput(input) {
19422
19334
  if (!result.success) return (0, brepjs.err)(specError("INVALID_SLAB_OPENING_INPUT", result.error.message, result.error));
19423
19335
  return (0, brepjs.ok)(result.data);
19424
19336
  }
19425
- //#endregion
19426
- //#region src/specs/spatialSpec.ts
19337
+ // src/specs/spatialSpec.ts
19427
19338
  var unitVector = tuple([
19428
19339
  number(),
19429
19340
  number(),
@@ -19470,8 +19381,7 @@ function parseSiteSpec(input) {
19470
19381
  const result = SiteSpecSchema.safeParse(input);
19471
19382
  return result.success ? (0, brepjs.ok)(result.data) : (0, brepjs.err)(specError("INVALID_SITE_SPEC", result.error.message, result.error));
19472
19383
  }
19473
- //#endregion
19474
- //#region src/specs/infrastructureSpec.ts
19384
+ // src/specs/infrastructureSpec.ts
19475
19385
  var composition = _enum([
19476
19386
  "COMPLEX",
19477
19387
  "ELEMENT",
@@ -19531,8 +19441,7 @@ function parseBridgePartSpec(input) {
19531
19441
  const result = BridgePartSpecSchema.safeParse(input);
19532
19442
  return result.success ? (0, brepjs.ok)(result.data) : (0, brepjs.err)(specError("INVALID_BRIDGE_PART_SPEC", result.error.message, result.error));
19533
19443
  }
19534
- //#endregion
19535
- //#region src/cobie/cobieExport.ts
19444
+ // src/cobie/cobieExport.ts
19536
19445
  /**
19537
19446
  * Physical-element categories that become COBie Component rows. Spatial
19538
19447
  * containers (PROJECT/SITE/BUILDING/STOREY), abstract groupings, and the SPACE
@@ -19962,8 +19871,7 @@ function serializeCobieToJson(model) {
19962
19871
  Attribute: model.attribute
19963
19872
  };
19964
19873
  }
19965
- //#endregion
19966
- //#region src/ids/idsXml.ts
19874
+ // src/ids/idsXml.ts
19967
19875
  var XmlParseError = class extends Error {};
19968
19876
  function parseXml$1(input) {
19969
19877
  return new Parser(input).parseDocument();
@@ -20134,8 +20042,7 @@ function childrenNamed(el, tag) {
20134
20042
  function firstChild(el, tag) {
20135
20043
  return el.children.find((c) => c.tag === tag);
20136
20044
  }
20137
- //#endregion
20138
- //#region src/ids/idsSchema.generated.ts
20045
+ // src/ids/idsSchema.generated.ts
20139
20046
  var IFC_ENTITY_ATTRIBUTES = {
20140
20047
  "IFC2DCOMPOSITECURVE": {
20141
20048
  "Segments": "L1",
@@ -29667,8 +29574,7 @@ var IFC_ENTITY_ATTRIBUTES = {
29667
29574
  "WebThickness": "d"
29668
29575
  }
29669
29576
  };
29670
- //#endregion
29671
- //#region src/ids/idsParser.ts
29577
+ // src/ids/idsParser.ts
29672
29578
  /**
29673
29579
  * Parses an IDS 1.0 XML document string into a typed {@link IdsDocument}.
29674
29580
  *
@@ -30013,8 +29919,7 @@ function parseValue(container) {
30013
29919
  maxLength: num("maxLength")
30014
29920
  };
30015
29921
  }
30016
- //#endregion
30017
- //#region src/ids/idsEngine.ts
29922
+ // src/ids/idsEngine.ts
30018
29923
  /** Relative + fixed equality tolerance for floating point values (IDS spec). */
30019
29924
  var EPS = 1e-6;
30020
29925
  /** All relationship-derived context, built once per check. */
@@ -30786,8 +30691,7 @@ async function checkIdsData(bytes, ids) {
30786
30691
  reader.close();
30787
30692
  }
30788
30693
  }
30789
- //#endregion
30790
- //#region src/bcf/bcfXml.ts
30694
+ // src/bcf/bcfXml.ts
30791
30695
  /**
30792
30696
  * Minimal, zero-dependency XML helpers scoped to the BCF 3.0 subset.
30793
30697
  *
@@ -30937,8 +30841,7 @@ function findChildren(node, tag) {
30937
30841
  function childText(node, tag) {
30938
30842
  return findChild(node, tag)?.text;
30939
30843
  }
30940
- //#endregion
30941
- //#region src/bcf/bcfWrite.ts
30844
+ // src/bcf/bcfWrite.ts
30942
30845
  /**
30943
30846
  * Serialize a BCF 3.0 container into its unzipped file structure
30944
30847
  * (`Map<path, xml-string>`):
@@ -30946,6 +30849,7 @@ function childText(node, tag) {
30946
30849
  * - `bcf.version` — container version marker
30947
30850
  * - `project.bcfp` — project metadata
30948
30851
  * - `{topicGuid}/markup.bcf` — one markup file per topic (topic, comments, viewpoints)
30852
+ * - `{topicGuid}/{viewpoint}.bcfv`: one visualization file per viewpoint (components, camera)
30949
30853
  *
30950
30854
  * `FLAG: BCF_ZIP_PACKAGING_ABSENT` — to produce an actual `.bcfzip`, ZIP these
30951
30855
  * entries with an external library; no ZIP dependency is declared in the
@@ -30957,13 +30861,15 @@ function serializeBcfFiles(data) {
30957
30861
  files.set("project.bcfp", writeProject(data));
30958
30862
  for (const topic of data.topics) {
30959
30863
  files.set(`${topic.guid}/markup.bcf`, writeMarkup(topic));
30960
- for (const viewpoint of topic.viewpoints) if (viewpoint.components !== void 0 || viewpoint.viewpointFile !== void 0) files.set(`${topic.guid}/${bcfvName(viewpoint)}`, writeVisualizationInfo(viewpoint));
30864
+ for (const viewpoint of topic.viewpoints) if (hasVisualization(viewpoint)) files.set(`${topic.guid}/${bcfvName(viewpoint)}`, writeVisualizationInfo(viewpoint));
30961
30865
  }
30962
30866
  return files;
30963
30867
  }
30964
30868
  function writeVersion(data) {
30965
- const lines = [`<Version VersionId="${escapeXmlAttr(data.version.versionId)}">`];
30966
- if (data.version.detailedVersion !== void 0) lines.push(` <DetailedVersion>${escapeXmlText(data.version.detailedVersion)}</DetailedVersion>`);
30869
+ const open = `<Version VersionId="${escapeXmlAttr(data.version.versionId)}"`;
30870
+ if (data.version.detailedVersion === void 0) return xmlDocument(`${open} />`);
30871
+ const lines = [`${open}>`];
30872
+ lines.push(` <DetailedVersion>${escapeXmlText(data.version.detailedVersion)}</DetailedVersion>`);
30967
30873
  lines.push("</Version>");
30968
30874
  return xmlDocument(lines.join("\n"));
30969
30875
  }
@@ -30979,8 +30885,6 @@ function writeProject(data) {
30979
30885
  function writeMarkup(topic) {
30980
30886
  const lines = ["<Markup>"];
30981
30887
  lines.push(...writeTopic(topic).map(indent(1)));
30982
- for (const comment of topic.comments) lines.push(...writeComment(comment).map(indent(1)));
30983
- for (const viewpoint of topic.viewpoints) lines.push(...writeViewpoint(viewpoint).map(indent(1)));
30984
30888
  lines.push("</Markup>");
30985
30889
  return xmlDocument(lines.join("\n"));
30986
30890
  }
@@ -30993,7 +30897,7 @@ function writeTopic(topic) {
30993
30897
  inner.push(`<Title>${escapeXmlText(topic.title)}</Title>`);
30994
30898
  pushOptional(inner, "Priority", topic.priority);
30995
30899
  pushOptionalNum(inner, "Index", topic.index);
30996
- for (const label of topic.labels ?? []) inner.push(`<Labels>${escapeXmlText(label)}</Labels>`);
30900
+ pushList(inner, "Labels", (topic.labels ?? []).map((label) => [`<Label>${escapeXmlText(label)}</Label>`]));
30997
30901
  pushOptional(inner, "CreationDate", topic.creationDate);
30998
30902
  pushOptional(inner, "CreationAuthor", topic.creationAuthor);
30999
30903
  pushOptional(inner, "ModifiedDate", topic.modifiedDate);
@@ -31001,7 +30905,9 @@ function writeTopic(topic) {
31001
30905
  pushOptional(inner, "DueDate", topic.dueDate);
31002
30906
  pushOptional(inner, "AssignedTo", topic.assignedTo);
31003
30907
  pushOptional(inner, "Description", topic.description);
31004
- for (const related of topic.relatedTopics ?? []) inner.push(`<RelatedTopic Guid="${escapeXmlAttr(related)}" />`);
30908
+ pushList(inner, "RelatedTopics", (topic.relatedTopics ?? []).map((related) => [`<RelatedTopic Guid="${escapeXmlAttr(related)}" />`]));
30909
+ pushList(inner, "Comments", topic.comments.map(writeComment));
30910
+ pushList(inner, "Viewpoints", topic.viewpoints.map(writeViewpoint));
31005
30911
  lines.push(...inner.map(indent(1)));
31006
30912
  lines.push("</Topic>");
31007
30913
  return lines;
@@ -31012,34 +30918,63 @@ function writeComment(comment) {
31012
30918
  inner.push(`<Date>${escapeXmlText(comment.date)}</Date>`);
31013
30919
  inner.push(`<Author>${escapeXmlText(comment.author)}</Author>`);
31014
30920
  inner.push(`<Comment>${escapeXmlText(comment.comment)}</Comment>`);
30921
+ if (comment.viewpointRef !== void 0) inner.push(`<Viewpoint Guid="${escapeXmlAttr(comment.viewpointRef)}" />`);
31015
30922
  pushOptional(inner, "ModifiedDate", comment.modifiedDate);
31016
30923
  pushOptional(inner, "ModifiedAuthor", comment.modifiedAuthor);
31017
- if (comment.viewpointRef !== void 0) inner.push(`<Viewpoint Guid="${escapeXmlAttr(comment.viewpointRef)}" />`);
31018
30924
  lines.push(...inner.map(indent(1)));
31019
30925
  lines.push("</Comment>");
31020
30926
  return lines;
31021
30927
  }
31022
30928
  function writeViewpoint(viewpoint) {
31023
- const lines = [`<Viewpoints Guid="${escapeXmlAttr(viewpoint.guid)}">`];
30929
+ const lines = [`<ViewPoint Guid="${escapeXmlAttr(viewpoint.guid)}">`];
31024
30930
  const inner = [];
31025
- if (viewpoint.components !== void 0 || viewpoint.viewpointFile !== void 0) inner.push(`<Viewpoint>${escapeXmlText(bcfvName(viewpoint))}</Viewpoint>`);
30931
+ if (hasVisualization(viewpoint)) inner.push(`<Viewpoint>${escapeXmlText(bcfvName(viewpoint))}</Viewpoint>`);
31026
30932
  pushOptional(inner, "Snapshot", viewpoint.snapshotFile);
31027
30933
  pushOptionalNum(inner, "Index", viewpoint.index);
31028
30934
  lines.push(...inner.map(indent(1)));
31029
- lines.push("</Viewpoints>");
30935
+ lines.push("</ViewPoint>");
31030
30936
  return lines;
31031
30937
  }
30938
+ function hasVisualization(viewpoint) {
30939
+ return viewpoint.components !== void 0 || viewpoint.camera !== void 0 || viewpoint.viewpointFile !== void 0;
30940
+ }
31032
30941
  /** The .bcfv filename a viewpoint's Components are written to / referenced by. */
31033
30942
  function bcfvName(viewpoint) {
31034
30943
  return viewpoint.viewpointFile ?? `${viewpoint.guid}.bcfv`;
31035
30944
  }
31036
- /** Serializes a viewpoint's Components into a standalone BCF 3.0 .bcfv document. */
30945
+ /** Serializes a viewpoint's Components and camera into a standalone BCF 3.0 .bcfv document. */
31037
30946
  function writeVisualizationInfo(viewpoint) {
31038
30947
  const lines = [`<VisualizationInfo Guid="${escapeXmlAttr(viewpoint.guid)}">`];
31039
30948
  if (viewpoint.components !== void 0) lines.push(...writeComponents(viewpoint.components).map(indent(1)));
30949
+ if (viewpoint.camera !== void 0) lines.push(...writeCamera(viewpoint.camera).map(indent(1)));
31040
30950
  lines.push("</VisualizationInfo>");
31041
30951
  return xmlDocument(lines.join("\n"));
31042
30952
  }
30953
+ function writeCamera(camera) {
30954
+ const tag = camera.kind === "ORTHOGONAL" ? "OrthogonalCamera" : "PerspectiveCamera";
30955
+ const inner = [
30956
+ ...writeVector("CameraViewPoint", camera.viewPoint),
30957
+ ...writeVector("CameraDirection", camera.direction),
30958
+ ...writeVector("CameraUpVector", camera.upVector)
30959
+ ];
30960
+ if (camera.kind === "ORTHOGONAL") inner.push(`<ViewToWorldScale>${camera.viewToWorldScale}</ViewToWorldScale>`);
30961
+ else inner.push(`<FieldOfView>${camera.fieldOfView}</FieldOfView>`);
30962
+ inner.push(`<AspectRatio>${camera.aspectRatio}</AspectRatio>`);
30963
+ return [
30964
+ `<${tag}>`,
30965
+ ...inner.map(indent(1)),
30966
+ `</${tag}>`
30967
+ ];
30968
+ }
30969
+ function writeVector(tag, [x, y, z]) {
30970
+ return [
30971
+ `<${tag}>`,
30972
+ ` <X>${x}</X>`,
30973
+ ` <Y>${y}</Y>`,
30974
+ ` <Z>${z}</Z>`,
30975
+ `</${tag}>`
30976
+ ];
30977
+ }
31043
30978
  function writeComponents(components) {
31044
30979
  const lines = ["<Components>"];
31045
30980
  const inner = [];
@@ -31071,7 +31006,10 @@ function writeVisibility(visibility) {
31071
31006
  }
31072
31007
  function writeColoring(coloring) {
31073
31008
  const lines = [`<Color Color="${escapeXmlAttr(coloring.color)}">`];
31074
- for (const c of coloring.components) lines.push(...writeComponent(c).map(indent(1)));
31009
+ const inner = ["<Components>"];
31010
+ for (const c of coloring.components) inner.push(...writeComponent(c).map(indent(1)));
31011
+ inner.push("</Components>");
31012
+ lines.push(...inner.map(indent(1)));
31075
31013
  lines.push("</Color>");
31076
31014
  return lines;
31077
31015
  }
@@ -31093,12 +31031,18 @@ function pushOptional(target, tag, value) {
31093
31031
  function pushOptionalNum(target, tag, value) {
31094
31032
  if (value !== void 0) target.push(`<${tag}>${value}</${tag}>`);
31095
31033
  }
31034
+ /** A wrapper element around `items`, each already written as lines; nothing when empty. */
31035
+ function pushList(target, tag, items) {
31036
+ if (items.length === 0) return;
31037
+ target.push(`<${tag}>`);
31038
+ for (const item of items) target.push(...item.map(indent(1)));
31039
+ target.push(`</${tag}>`);
31040
+ }
31096
31041
  function indent(levels) {
31097
31042
  const pad = " ".repeat(levels);
31098
31043
  return (line) => `${pad}${line}`;
31099
31044
  }
31100
- //#endregion
31101
- //#region src/bcf/bcfRead.ts
31045
+ // src/bcf/bcfRead.ts
31102
31046
  /**
31103
31047
  * Parse an unzipped BCF 3.0 container (`Map<path, xml-string>`) back into the
31104
31048
  * typed data model. The inverse of `serializeBcfFiles`.
@@ -31155,8 +31099,10 @@ function parseMarkup(xml, files, dir) {
31155
31099
  const markup = parseXml(xml);
31156
31100
  const topicEl = findChild(markup, "Topic");
31157
31101
  if (topicEl === void 0) throw new Error("markup.bcf is missing a <Topic> element");
31158
- const comments = findChildren(markup, "Comment").map(parseComment);
31159
- const viewpoints = findChildren(markup, "Viewpoints").map((el) => parseViewpoint(el, files, dir));
31102
+ const commentsEl = findChild(topicEl, "Comments");
31103
+ const viewpointsEl = findChild(topicEl, "Viewpoints");
31104
+ const comments = (commentsEl !== void 0 ? findChildren(commentsEl, "Comment") : findChildren(markup, "Comment")).map(parseComment);
31105
+ const viewpoints = (viewpointsEl !== void 0 ? findChildren(viewpointsEl, "ViewPoint") : findChildren(markup, "Viewpoints")).map((el) => parseViewpoint(el, files, dir));
31160
31106
  const topic = {
31161
31107
  guid: topicEl.attrs["Guid"] ?? "",
31162
31108
  title: childText(topicEl, "Title") ?? "",
@@ -31174,9 +31120,13 @@ function parseMarkup(xml, files, dir) {
31174
31120
  assign(topic, "dueDate", childText(topicEl, "DueDate"));
31175
31121
  assign(topic, "assignedTo", childText(topicEl, "AssignedTo"));
31176
31122
  assign(topic, "description", childText(topicEl, "Description"));
31177
- const labels = findChildren(topicEl, "Labels").map((l) => l.text);
31123
+ const labels = findChildren(topicEl, "Labels").flatMap((l) => {
31124
+ const nested = findChildren(l, "Label");
31125
+ if (nested.length > 0) return nested.map((n) => n.text);
31126
+ return l.text !== "" ? [l.text] : [];
31127
+ });
31178
31128
  if (labels.length > 0) topic.labels = labels;
31179
- const related = findChildren(topicEl, "RelatedTopic").map((r) => r.attrs["Guid"]).filter((g) => g !== void 0);
31129
+ const related = findChildren(findChild(topicEl, "RelatedTopics") ?? topicEl, "RelatedTopic").map((r) => r.attrs["Guid"]).filter((g) => g !== void 0);
31180
31130
  if (related.length > 0) topic.relatedTopics = related;
31181
31131
  return topic;
31182
31132
  }
@@ -31203,12 +31153,51 @@ function parseViewpoint(el, files, dir) {
31203
31153
  else if (viewpoint.viewpointFile !== void 0) {
31204
31154
  const bcfvXml = files.get(`${dir}${viewpoint.viewpointFile}`);
31205
31155
  if (bcfvXml !== void 0) {
31206
- const visEl = findChild(parseXml(bcfvXml), "Components");
31156
+ const visInfo = parseXml(bcfvXml);
31157
+ const visEl = findChild(visInfo, "Components");
31207
31158
  if (visEl !== void 0) viewpoint.components = parseComponents(visEl);
31159
+ const camera = parseCamera(visInfo);
31160
+ if (camera !== void 0) viewpoint.camera = camera;
31208
31161
  }
31209
31162
  }
31210
31163
  return viewpoint;
31211
31164
  }
31165
+ function parseCamera(visInfo) {
31166
+ const ortho = findChild(visInfo, "OrthogonalCamera");
31167
+ const persp = findChild(visInfo, "PerspectiveCamera");
31168
+ const el = ortho ?? persp;
31169
+ if (el === void 0) return void 0;
31170
+ const frame = {
31171
+ viewPoint: parseVector(el, "CameraViewPoint"),
31172
+ direction: parseVector(el, "CameraDirection"),
31173
+ upVector: parseVector(el, "CameraUpVector"),
31174
+ aspectRatio: requiredNumber(el, "AspectRatio")
31175
+ };
31176
+ return ortho !== void 0 ? {
31177
+ kind: "ORTHOGONAL",
31178
+ ...frame,
31179
+ viewToWorldScale: requiredNumber(el, "ViewToWorldScale")
31180
+ } : {
31181
+ kind: "PERSPECTIVE",
31182
+ ...frame,
31183
+ fieldOfView: requiredNumber(el, "FieldOfView")
31184
+ };
31185
+ }
31186
+ function parseVector(camera, tag) {
31187
+ const el = findChild(camera, tag);
31188
+ if (el === void 0) throw new Error(`<${camera.tag}> is missing <${tag}>`);
31189
+ return [
31190
+ requiredNumber(el, "X"),
31191
+ requiredNumber(el, "Y"),
31192
+ requiredNumber(el, "Z")
31193
+ ];
31194
+ }
31195
+ function requiredNumber(el, tag) {
31196
+ const text = childText(el, tag);
31197
+ const value = Number(text);
31198
+ if (text === void 0 || text === "" || !Number.isFinite(value)) throw new Error(`<${el.tag}> has no numeric <${tag}>`);
31199
+ return value;
31200
+ }
31212
31201
  function parseComponents(el) {
31213
31202
  const components = {};
31214
31203
  const selectionEl = findChild(el, "Selection");
@@ -31220,9 +31209,10 @@ function parseComponents(el) {
31220
31209
  return components;
31221
31210
  }
31222
31211
  function parseColoring(el) {
31212
+ const componentsEl = findChild(el, "Components") ?? el;
31223
31213
  return {
31224
31214
  color: el.attrs["Color"] ?? "",
31225
- components: findChildren(el, "Component").map(parseComponent)
31215
+ components: findChildren(componentsEl, "Component").map(parseComponent)
31226
31216
  };
31227
31217
  }
31228
31218
  function parseVisibility(el) {
@@ -31245,8 +31235,7 @@ function assign(target, key, value) {
31245
31235
  function assignNum(target, key, value) {
31246
31236
  if (value !== void 0) target[key] = Number(value);
31247
31237
  }
31248
- //#endregion
31249
- //#region src/familiesFrame.ts
31238
+ // src/familiesFrame.ts
31250
31239
  /** Families translates authored operations at its boundary, in authored order. */
31251
31240
  function frameFromOps(ops) {
31252
31241
  let frame = IDENTITY_FRAME;
@@ -31271,8 +31260,7 @@ function requireFrame(result) {
31271
31260
  if (!result.ok) throw new FrameProjectionError(result.error);
31272
31261
  return result.value;
31273
31262
  }
31274
- //#endregion
31275
- //#region src/familiesProductBody.ts
31263
+ // src/familiesProductBody.ts
31276
31264
  /**
31277
31265
  * Borrow evaluator parents, then copy and inverse-localize in item order.
31278
31266
  * Every successful result is AUTHORITATIVE and caller-owned until COMMITTED.
@@ -31345,8 +31333,7 @@ function productBodyError(input, code, detail, cause, itemIndex, reports = []) {
31345
31333
  }
31346
31334
  };
31347
31335
  }
31348
- //#endregion
31349
- //#region src/familiesAdapter.ts
31336
+ // src/familiesAdapter.ts
31350
31337
  /**
31351
31338
  * brepjs-families -> BimModel adapter. Consumes a resolved element tree and
31352
31339
  * feeds each element's PRE-DESUGARED props into parametric specs. Civil wall
@@ -32531,7 +32518,6 @@ function projectFamiliesToBim(root, options, model) {
32531
32518
  proxied
32532
32519
  });
32533
32520
  }
32534
- //#endregion
32535
32521
  exports.BimModel = BimModel;
32536
32522
  exports.DEFAULT_IFC_SCHEMA = DEFAULT_IFC_SCHEMA;
32537
32523
  exports.DEFAULT_UNITS = DEFAULT_UNITS;