@bldrs-ai/conway 1.373.1180 → 1.375.1183
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/compiled/examples/browser-bundled.cjs +358 -30
- package/compiled/examples/cli-bundled.cjs +358 -30
- package/compiled/examples/cli-step-bundled.cjs +358 -30
- package/compiled/examples/validator-bundled.cjs +358 -30
- package/compiled/src/compat/web-ifc/ap214_properties.d.ts +8 -0
- package/compiled/src/compat/web-ifc/ap214_properties.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ap214_properties.js +10 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +20 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +30 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +16 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +32 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +38 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +33 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +38 -0
- package/compiled/src/compat/web-ifc/ifc_properties.d.ts +8 -0
- package/compiled/src/compat/web-ifc/ifc_properties.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_properties.js +24 -0
- package/compiled/src/compat/web-ifc/ifc_spill_source.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_spill_source.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_spill_source.test.js +108 -0
- package/compiled/src/step/step_buffer_provider.d.ts +278 -0
- package/compiled/src/step/step_buffer_provider.d.ts.map +1 -0
- package/compiled/src/step/step_buffer_provider.js +382 -0
- package/compiled/src/step/step_buffer_provider.test.d.ts +2 -0
- package/compiled/src/step/step_buffer_provider.test.d.ts.map +1 -0
- package/compiled/src/step/step_buffer_provider.test.js +149 -0
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +41 -11
- package/compiled/src/step/step_model_base.d.ts +62 -2
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +120 -18
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -18570,6 +18570,240 @@ var EntityTypesIfc;
|
|
|
18570
18570
|
var EntityTypesIfcCount = 909;
|
|
18571
18571
|
var entity_types_ifc_gen_default = EntityTypesIfc;
|
|
18572
18572
|
|
|
18573
|
+
// compiled/src/step/step_buffer_provider.js
|
|
18574
|
+
var DEFAULT_CHUNK_BYTES = 4 * 1024 * 1024;
|
|
18575
|
+
var DEFAULT_MAX_RESIDENT_CHUNKS = 16;
|
|
18576
|
+
var STEP_BUFFER_BASE = Symbol("stepBufferBase");
|
|
18577
|
+
function stepBufferBase(buffer) {
|
|
18578
|
+
return buffer[STEP_BUFFER_BASE] ?? 0;
|
|
18579
|
+
}
|
|
18580
|
+
function tagBufferBase(buffer, base) {
|
|
18581
|
+
if (base !== 0) {
|
|
18582
|
+
Object.defineProperty(buffer, STEP_BUFFER_BASE, { value: base });
|
|
18583
|
+
}
|
|
18584
|
+
return buffer;
|
|
18585
|
+
}
|
|
18586
|
+
var StepBufferNotResidentError = class extends Error {
|
|
18587
|
+
/**
|
|
18588
|
+
* Construct this for a byte range.
|
|
18589
|
+
*
|
|
18590
|
+
* @param address Absolute start of the range.
|
|
18591
|
+
* @param length Length of the range.
|
|
18592
|
+
*/
|
|
18593
|
+
constructor(address, length) {
|
|
18594
|
+
super(`STEP source range [${address}, ${address + length}) is not resident \u2014 call ensureResident before synchronous extraction`);
|
|
18595
|
+
this.address = address;
|
|
18596
|
+
this.length = length;
|
|
18597
|
+
this.name = "StepBufferNotResidentError";
|
|
18598
|
+
}
|
|
18599
|
+
};
|
|
18600
|
+
var ResidentStepBufferProvider = class {
|
|
18601
|
+
/**
|
|
18602
|
+
* Construct this over the resident source buffer.
|
|
18603
|
+
*
|
|
18604
|
+
* @param buffer_ The full source bytes.
|
|
18605
|
+
*/
|
|
18606
|
+
constructor(buffer_) {
|
|
18607
|
+
this.buffer_ = buffer_;
|
|
18608
|
+
}
|
|
18609
|
+
/**
|
|
18610
|
+
* Total logical size of the source bytes.
|
|
18611
|
+
*
|
|
18612
|
+
* @return {number} The byte length.
|
|
18613
|
+
*/
|
|
18614
|
+
get byteLength() {
|
|
18615
|
+
return this.buffer_.byteLength;
|
|
18616
|
+
}
|
|
18617
|
+
/**
|
|
18618
|
+
* Bytes currently held resident — the whole buffer.
|
|
18619
|
+
*
|
|
18620
|
+
* @return {number} The byte length.
|
|
18621
|
+
*/
|
|
18622
|
+
get residentBytes() {
|
|
18623
|
+
return this.buffer_.byteLength;
|
|
18624
|
+
}
|
|
18625
|
+
/**
|
|
18626
|
+
* Acquire the whole buffer at offset 0.
|
|
18627
|
+
*
|
|
18628
|
+
* @return {StepBufferAcquisition} The acquisition.
|
|
18629
|
+
*/
|
|
18630
|
+
acquire() {
|
|
18631
|
+
return { buffer: this.buffer_, offset: 0 };
|
|
18632
|
+
}
|
|
18633
|
+
/**
|
|
18634
|
+
* Always resident.
|
|
18635
|
+
*
|
|
18636
|
+
* @return {Promise< void >} Resolved promise.
|
|
18637
|
+
*/
|
|
18638
|
+
ensureResident() {
|
|
18639
|
+
return Promise.resolve();
|
|
18640
|
+
}
|
|
18641
|
+
};
|
|
18642
|
+
var WindowedStepBufferProvider = class {
|
|
18643
|
+
/**
|
|
18644
|
+
* Construct this over an external byte store.
|
|
18645
|
+
*
|
|
18646
|
+
* @param store_ The store holding the source bytes.
|
|
18647
|
+
* @param chunkBytes Chunk size in bytes (default 4MiB).
|
|
18648
|
+
* @param maxResidentChunks LRU residency cap in chunks (default 16).
|
|
18649
|
+
*/
|
|
18650
|
+
constructor(store_, chunkBytes = DEFAULT_CHUNK_BYTES, maxResidentChunks = DEFAULT_MAX_RESIDENT_CHUNKS) {
|
|
18651
|
+
this.store_ = store_;
|
|
18652
|
+
this.chunks_ = /* @__PURE__ */ new Map();
|
|
18653
|
+
this.loading_ = /* @__PURE__ */ new Map();
|
|
18654
|
+
this.ensurePins_ = /* @__PURE__ */ new Map();
|
|
18655
|
+
if (chunkBytes <= 0 || !Number.isInteger(chunkBytes)) {
|
|
18656
|
+
throw new Error(`Invalid chunkBytes ${chunkBytes}`);
|
|
18657
|
+
}
|
|
18658
|
+
this.chunkBytes_ = chunkBytes;
|
|
18659
|
+
this.maxResidentChunks_ = Math.max(1, maxResidentChunks);
|
|
18660
|
+
}
|
|
18661
|
+
/**
|
|
18662
|
+
* Total logical size of the source bytes.
|
|
18663
|
+
*
|
|
18664
|
+
* @return {number} The byte length.
|
|
18665
|
+
*/
|
|
18666
|
+
get byteLength() {
|
|
18667
|
+
return this.store_.byteLength;
|
|
18668
|
+
}
|
|
18669
|
+
/**
|
|
18670
|
+
* Bytes currently held resident by the provider.
|
|
18671
|
+
*
|
|
18672
|
+
* @return {number} The resident byte count.
|
|
18673
|
+
*/
|
|
18674
|
+
get residentBytes() {
|
|
18675
|
+
let total = 0;
|
|
18676
|
+
for (const chunk of this.chunks_.values()) {
|
|
18677
|
+
total += chunk.byteLength;
|
|
18678
|
+
}
|
|
18679
|
+
return total;
|
|
18680
|
+
}
|
|
18681
|
+
/**
|
|
18682
|
+
* Number of resident chunks (telemetry/tests).
|
|
18683
|
+
*
|
|
18684
|
+
* @return {number} The chunk count.
|
|
18685
|
+
*/
|
|
18686
|
+
get residentChunkCount() {
|
|
18687
|
+
return this.chunks_.size;
|
|
18688
|
+
}
|
|
18689
|
+
/**
|
|
18690
|
+
* Touch a chunk for LRU recency.
|
|
18691
|
+
*
|
|
18692
|
+
* @param chunkIndex The chunk to touch.
|
|
18693
|
+
* @param chunk The chunk bytes.
|
|
18694
|
+
*/
|
|
18695
|
+
touch_(chunkIndex, chunk) {
|
|
18696
|
+
this.chunks_.delete(chunkIndex);
|
|
18697
|
+
this.chunks_.set(chunkIndex, chunk);
|
|
18698
|
+
}
|
|
18699
|
+
/**
|
|
18700
|
+
* Synchronously acquire a view containing a byte range.
|
|
18701
|
+
*
|
|
18702
|
+
* Single-chunk ranges are served as the chunk itself (zero copy);
|
|
18703
|
+
* straddling ranges get a standalone merged copy spanning exactly
|
|
18704
|
+
* the requested range.
|
|
18705
|
+
*
|
|
18706
|
+
* @param address Absolute start of the range.
|
|
18707
|
+
* @param length Length of the range.
|
|
18708
|
+
* @throws { StepBufferNotResidentError } When any covering chunk isn't resident.
|
|
18709
|
+
* @return {StepBufferAcquisition} The view and its base address.
|
|
18710
|
+
*/
|
|
18711
|
+
acquire(address, length) {
|
|
18712
|
+
const chunkBytes = this.chunkBytes_;
|
|
18713
|
+
const firstChunk = Math.floor(address / chunkBytes);
|
|
18714
|
+
const lastChunk = Math.floor((address + Math.max(length, 1) - 1) / chunkBytes);
|
|
18715
|
+
if (firstChunk === lastChunk) {
|
|
18716
|
+
const chunk = this.chunks_.get(firstChunk);
|
|
18717
|
+
if (chunk === void 0) {
|
|
18718
|
+
throw new StepBufferNotResidentError(address, length);
|
|
18719
|
+
}
|
|
18720
|
+
this.touch_(firstChunk, chunk);
|
|
18721
|
+
return { buffer: chunk, offset: firstChunk * chunkBytes };
|
|
18722
|
+
}
|
|
18723
|
+
const merged = tagBufferBase(new Uint8Array(length), address);
|
|
18724
|
+
for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
|
|
18725
|
+
const chunk = this.chunks_.get(chunkIndex);
|
|
18726
|
+
if (chunk === void 0) {
|
|
18727
|
+
throw new StepBufferNotResidentError(address, length);
|
|
18728
|
+
}
|
|
18729
|
+
this.touch_(chunkIndex, chunk);
|
|
18730
|
+
const chunkBase = chunkIndex * chunkBytes;
|
|
18731
|
+
const copyFrom = Math.max(address, chunkBase);
|
|
18732
|
+
const copyTo = Math.min(address + length, chunkBase + chunk.byteLength);
|
|
18733
|
+
if (copyTo > copyFrom) {
|
|
18734
|
+
merged.set(chunk.subarray(copyFrom - chunkBase, copyTo - chunkBase), copyFrom - address);
|
|
18735
|
+
}
|
|
18736
|
+
}
|
|
18737
|
+
return { buffer: merged, offset: address };
|
|
18738
|
+
}
|
|
18739
|
+
/**
|
|
18740
|
+
* Make a byte range resident, paging missing chunks from the store
|
|
18741
|
+
* and evicting least-recently-used chunks beyond the cap (never the
|
|
18742
|
+
* chunks needed by this call).
|
|
18743
|
+
*
|
|
18744
|
+
* @param address Absolute start of the range.
|
|
18745
|
+
* @param length Length of the range.
|
|
18746
|
+
* @return {Promise< void >} Resolves when resident.
|
|
18747
|
+
*/
|
|
18748
|
+
async ensureResident(address, length) {
|
|
18749
|
+
const chunkBytes = this.chunkBytes_;
|
|
18750
|
+
const firstChunk = Math.floor(address / chunkBytes);
|
|
18751
|
+
const lastChunk = Math.floor((address + Math.max(length, 1) - 1) / chunkBytes);
|
|
18752
|
+
for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
|
|
18753
|
+
this.ensurePins_.set(chunkIndex, (this.ensurePins_.get(chunkIndex) ?? 0) + 1);
|
|
18754
|
+
}
|
|
18755
|
+
try {
|
|
18756
|
+
const loads = [];
|
|
18757
|
+
for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
|
|
18758
|
+
const resident = this.chunks_.get(chunkIndex);
|
|
18759
|
+
if (resident !== void 0) {
|
|
18760
|
+
this.touch_(chunkIndex, resident);
|
|
18761
|
+
continue;
|
|
18762
|
+
}
|
|
18763
|
+
let inflight = this.loading_.get(chunkIndex);
|
|
18764
|
+
if (inflight === void 0) {
|
|
18765
|
+
const chunkBase = chunkIndex * chunkBytes;
|
|
18766
|
+
const chunkLength = Math.min(chunkBytes, this.store_.byteLength - chunkBase);
|
|
18767
|
+
inflight = this.store_.read(chunkBase, chunkLength).then((chunk) => {
|
|
18768
|
+
tagBufferBase(chunk, chunkBase);
|
|
18769
|
+
this.chunks_.set(chunkIndex, chunk);
|
|
18770
|
+
this.loading_.delete(chunkIndex);
|
|
18771
|
+
return chunk;
|
|
18772
|
+
}, (error) => {
|
|
18773
|
+
this.loading_.delete(chunkIndex);
|
|
18774
|
+
throw error;
|
|
18775
|
+
});
|
|
18776
|
+
this.loading_.set(chunkIndex, inflight);
|
|
18777
|
+
}
|
|
18778
|
+
loads.push(inflight.then(() => void 0));
|
|
18779
|
+
}
|
|
18780
|
+
if (loads.length > 0) {
|
|
18781
|
+
await Promise.all(loads);
|
|
18782
|
+
}
|
|
18783
|
+
if (this.chunks_.size > this.maxResidentChunks_) {
|
|
18784
|
+
for (const candidate of this.chunks_.keys()) {
|
|
18785
|
+
if (this.chunks_.size <= this.maxResidentChunks_) {
|
|
18786
|
+
break;
|
|
18787
|
+
}
|
|
18788
|
+
if ((this.ensurePins_.get(candidate) ?? 0) > 0) {
|
|
18789
|
+
continue;
|
|
18790
|
+
}
|
|
18791
|
+
this.chunks_.delete(candidate);
|
|
18792
|
+
}
|
|
18793
|
+
}
|
|
18794
|
+
} finally {
|
|
18795
|
+
for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
|
|
18796
|
+
const pins = this.ensurePins_.get(chunkIndex) ?? 0;
|
|
18797
|
+
if (pins <= 1) {
|
|
18798
|
+
this.ensurePins_.delete(chunkIndex);
|
|
18799
|
+
} else {
|
|
18800
|
+
this.ensurePins_.set(chunkIndex, pins - 1);
|
|
18801
|
+
}
|
|
18802
|
+
}
|
|
18803
|
+
}
|
|
18804
|
+
}
|
|
18805
|
+
};
|
|
18806
|
+
|
|
18573
18807
|
// compiled/src/step/parsing/step_vtable_builder.js
|
|
18574
18808
|
var StepVtableBuilder = class {
|
|
18575
18809
|
/**
|
|
@@ -19010,6 +19244,7 @@ var StepModelBase = class {
|
|
|
19010
19244
|
this.descriptorCache_ = [];
|
|
19011
19245
|
this.elementMemoization = true;
|
|
19012
19246
|
this.nullOnErrors = true;
|
|
19247
|
+
this.bufferProvider_ = new ResidentStepBufferProvider(buffer_);
|
|
19013
19248
|
const localElementIndex = elementIndex;
|
|
19014
19249
|
let where = 0;
|
|
19015
19250
|
const firstInlineElement = localElementIndex.length;
|
|
@@ -19125,6 +19360,16 @@ var StepModelBase = class {
|
|
|
19125
19360
|
item.vtable = void 0;
|
|
19126
19361
|
item.vtableCount = void 0;
|
|
19127
19362
|
item.vtableIndex = void 0;
|
|
19363
|
+
item.multiEntity = void 0;
|
|
19364
|
+
if (item.multiMapping !== void 0) {
|
|
19365
|
+
for (const mapped of item.multiMapping) {
|
|
19366
|
+
mapped.buffer = void 0;
|
|
19367
|
+
mapped.entity = void 0;
|
|
19368
|
+
mapped.vtable = void 0;
|
|
19369
|
+
mapped.vtableCount = void 0;
|
|
19370
|
+
mapped.vtableIndex = void 0;
|
|
19371
|
+
}
|
|
19372
|
+
}
|
|
19128
19373
|
}
|
|
19129
19374
|
}
|
|
19130
19375
|
} else {
|
|
@@ -19150,14 +19395,16 @@ var StepModelBase = class {
|
|
|
19150
19395
|
if (element.vtableIndex !== void 0 || element.typeID === 0) {
|
|
19151
19396
|
return true;
|
|
19152
19397
|
}
|
|
19153
|
-
const
|
|
19398
|
+
const acquisition = this.bufferProvider_.acquire(element.address, element.length);
|
|
19399
|
+
const viewAddress = element.address - acquisition.offset;
|
|
19400
|
+
const extratedEntry = this.schema.parser.extractDataEntry(acquisition.buffer, viewAddress, viewAddress + element.length, this.vtableBuilder_);
|
|
19154
19401
|
if (extratedEntry === void 0) {
|
|
19155
19402
|
return false;
|
|
19156
19403
|
}
|
|
19157
19404
|
element.vtableIndex = extratedEntry[0];
|
|
19158
19405
|
element.vtableCount = extratedEntry[1];
|
|
19159
19406
|
element.endCursor = extratedEntry[2];
|
|
19160
|
-
element.buffer =
|
|
19407
|
+
element.buffer = acquisition.buffer;
|
|
19161
19408
|
element.vtable = this.vtableBuilder_.buffer;
|
|
19162
19409
|
return true;
|
|
19163
19410
|
}
|
|
@@ -19174,19 +19421,7 @@ var StepModelBase = class {
|
|
|
19174
19421
|
throw new Error(`Invalid localID ${localID}`);
|
|
19175
19422
|
}
|
|
19176
19423
|
const element = this.entry(localID);
|
|
19177
|
-
|
|
19178
|
-
return true;
|
|
19179
|
-
}
|
|
19180
|
-
const extratedEntry = this.schema.parser.extractDataEntry(this.buffer_, element.address, element.address + element.length, this.vtableBuilder_);
|
|
19181
|
-
if (extratedEntry === void 0) {
|
|
19182
|
-
return false;
|
|
19183
|
-
}
|
|
19184
|
-
element.vtableIndex = extratedEntry[0];
|
|
19185
|
-
element.vtableCount = extratedEntry[1];
|
|
19186
|
-
element.endCursor = extratedEntry[2];
|
|
19187
|
-
element.buffer = this.buffer_;
|
|
19188
|
-
element.vtable = this.vtableBuilder_.buffer;
|
|
19189
|
-
return true;
|
|
19424
|
+
return this.populateVtableEntryRaw(element);
|
|
19190
19425
|
}
|
|
19191
19426
|
/**
|
|
19192
19427
|
* Force the population of the the buffer entry for a particular element.
|
|
@@ -19199,7 +19434,7 @@ var StepModelBase = class {
|
|
|
19199
19434
|
throw new Error(`Invalid localID ${localID}`);
|
|
19200
19435
|
}
|
|
19201
19436
|
const element = this.entry(localID);
|
|
19202
|
-
element.buffer = this.
|
|
19437
|
+
element.buffer = this.bufferProvider_.acquire(element.address, element.length).buffer;
|
|
19203
19438
|
}
|
|
19204
19439
|
/**
|
|
19205
19440
|
* Get the size in bytes of the backing buffer for this.
|
|
@@ -19207,7 +19442,99 @@ var StepModelBase = class {
|
|
|
19207
19442
|
* @return {number} The number of elements.
|
|
19208
19443
|
*/
|
|
19209
19444
|
get bufferBytesize() {
|
|
19210
|
-
return this.
|
|
19445
|
+
return this.bufferProvider_.byteLength;
|
|
19446
|
+
}
|
|
19447
|
+
/**
|
|
19448
|
+
* Are the source bytes held externally (spilled), i.e. windowed in
|
|
19449
|
+
* on demand rather than fully resident?
|
|
19450
|
+
*
|
|
19451
|
+
* @return {boolean} True after a successful `spillSourceToExternalStore`.
|
|
19452
|
+
*/
|
|
19453
|
+
get isSourceExternal() {
|
|
19454
|
+
return this.buffer_ === void 0;
|
|
19455
|
+
}
|
|
19456
|
+
/**
|
|
19457
|
+
* Bytes of source currently held resident by the buffer provider
|
|
19458
|
+
* (the whole buffer before a spill; the windowed working set after).
|
|
19459
|
+
*
|
|
19460
|
+
* @return {number} The resident byte count.
|
|
19461
|
+
*/
|
|
19462
|
+
get residentSourceBytes() {
|
|
19463
|
+
return this.bufferProvider_.residentBytes;
|
|
19464
|
+
}
|
|
19465
|
+
/**
|
|
19466
|
+
* Release the resident source buffer and serve subsequent record
|
|
19467
|
+
* reads from fixed-size windows paged in from an external store.
|
|
19468
|
+
*
|
|
19469
|
+
* The store must contain EXACTLY the model's source bytes (same
|
|
19470
|
+
* length; byte-identical content is the caller's responsibility —
|
|
19471
|
+
* typically the original file already sitting in OPFS). All cached
|
|
19472
|
+
* descriptors/entities are invalidated, since they hold views over
|
|
19473
|
+
* the released buffer; they rematerialise on demand through the
|
|
19474
|
+
* windowed provider.
|
|
19475
|
+
*
|
|
19476
|
+
* After this, synchronous extraction of a record whose range isn't
|
|
19477
|
+
* resident throws StepBufferNotResidentError — async API surfaces
|
|
19478
|
+
* must call `ensureResidentByExpressID` / `ensureResidentByLocalID`
|
|
19479
|
+
* first. Parse and geometry extraction always run before any spill,
|
|
19480
|
+
* so those paths are unaffected.
|
|
19481
|
+
*
|
|
19482
|
+
* @param store The external store holding the source bytes.
|
|
19483
|
+
* @param chunkBytes Optional window size in bytes.
|
|
19484
|
+
* @param maxResidentChunks Optional residency cap in windows.
|
|
19485
|
+
*/
|
|
19486
|
+
spillSourceToExternalStore(store, chunkBytes, maxResidentChunks) {
|
|
19487
|
+
if (store.byteLength !== this.bufferProvider_.byteLength) {
|
|
19488
|
+
throw new Error(`External store byteLength ${store.byteLength} does not match source byteLength ${this.bufferProvider_.byteLength}`);
|
|
19489
|
+
}
|
|
19490
|
+
this.bufferProvider_ = new WindowedStepBufferProvider(store, chunkBytes, maxResidentChunks);
|
|
19491
|
+
this.buffer_ = void 0;
|
|
19492
|
+
this.invalidate(true);
|
|
19493
|
+
}
|
|
19494
|
+
/**
|
|
19495
|
+
* Page in the byte range(s) backing a record so following
|
|
19496
|
+
* synchronous extraction of it succeeds. Covers the record's own
|
|
19497
|
+
* range (which contains any inline elements) and, for complex /
|
|
19498
|
+
* external-mapped records, each mapped class record's range.
|
|
19499
|
+
*
|
|
19500
|
+
* No-op (fast resolved promise) while the source is fully resident.
|
|
19501
|
+
*
|
|
19502
|
+
* @param localID The local ID of the record.
|
|
19503
|
+
* @return {Promise< void >} Resolves when resident.
|
|
19504
|
+
*/
|
|
19505
|
+
async ensureResidentByLocalID(localID) {
|
|
19506
|
+
if (!this.isSourceExternal) {
|
|
19507
|
+
return;
|
|
19508
|
+
}
|
|
19509
|
+
if (localID >= this.count_) {
|
|
19510
|
+
throw new Error(`Invalid localID ${localID}`);
|
|
19511
|
+
}
|
|
19512
|
+
await this.bufferProvider_.ensureResident(this.address_[localID], this.length_[localID]);
|
|
19513
|
+
const complex = this.complexEntries_?.get(localID);
|
|
19514
|
+
if (complex?.multiMapping !== void 0) {
|
|
19515
|
+
for (const mapped of complex.multiMapping) {
|
|
19516
|
+
await this.bufferProvider_.ensureResident(mapped.address, mapped.length);
|
|
19517
|
+
}
|
|
19518
|
+
}
|
|
19519
|
+
}
|
|
19520
|
+
/**
|
|
19521
|
+
* Page in the byte range(s) backing a record by express ID — see
|
|
19522
|
+
* `ensureResidentByLocalID`. Unknown express IDs resolve silently
|
|
19523
|
+
* (the following read will surface the miss the same way it does
|
|
19524
|
+
* for a fully-resident model).
|
|
19525
|
+
*
|
|
19526
|
+
* @param expressID The express ID of the record.
|
|
19527
|
+
* @return {Promise< void >} Resolves when resident.
|
|
19528
|
+
*/
|
|
19529
|
+
async ensureResidentByExpressID(expressID) {
|
|
19530
|
+
if (!this.isSourceExternal) {
|
|
19531
|
+
return;
|
|
19532
|
+
}
|
|
19533
|
+
const localID = this.expressIDMap_.get(expressID);
|
|
19534
|
+
if (localID === void 0) {
|
|
19535
|
+
return;
|
|
19536
|
+
}
|
|
19537
|
+
await this.ensureResidentByLocalID(localID);
|
|
19211
19538
|
}
|
|
19212
19539
|
/**
|
|
19213
19540
|
* Get the number of elements/entities in this model.
|
|
@@ -24145,6 +24472,10 @@ var IfcTokenType;
|
|
|
24145
24472
|
IfcTokenType2[IfcTokenType2["SET_END"] = 8] = "SET_END";
|
|
24146
24473
|
IfcTokenType2[IfcTokenType2["LINE_END"] = 9] = "LINE_END";
|
|
24147
24474
|
})(IfcTokenType || (IfcTokenType = {}));
|
|
24475
|
+
function extractInlineElementAddress(buffer, cursor, endCursor) {
|
|
24476
|
+
const relative = stepExtractInlineElemement(buffer, cursor, endCursor);
|
|
24477
|
+
return relative === void 0 ? void 0 : relative + stepBufferBase(buffer);
|
|
24478
|
+
}
|
|
24148
24479
|
function merge(to, from) {
|
|
24149
24480
|
for (const key of Object.keys(from)) {
|
|
24150
24481
|
if (!to.hasOwnProperty(key)) {
|
|
@@ -24262,8 +24593,7 @@ var StepEntityBase = class {
|
|
|
24262
24593
|
if (!optional) {
|
|
24263
24594
|
throw new Error("Value in STEP was incorrectly typed");
|
|
24264
24595
|
}
|
|
24265
|
-
|
|
24266
|
-
if (!this.model.nullOnErrors && stepExtractOptional(buffer2, cursor, endCursor) !== null) {
|
|
24596
|
+
if (!this.model.nullOnErrors && stepExtractOptional(buffer, cursor, endCursor) !== null) {
|
|
24267
24597
|
throw new Error("Value in STEP was incorrectly typed");
|
|
24268
24598
|
}
|
|
24269
24599
|
return null;
|
|
@@ -24299,11 +24629,9 @@ var StepEntityBase = class {
|
|
|
24299
24629
|
return value;
|
|
24300
24630
|
}
|
|
24301
24631
|
extractReference(offset, baseOffset, depth, optional) {
|
|
24302
|
-
const cursor = this.
|
|
24303
|
-
const buffer = this.buffer;
|
|
24304
|
-
const endCursor = buffer.length;
|
|
24632
|
+
const [cursor, endCursor, buffer] = this.getOffsetAndEndCursor(offset, baseOffset, depth);
|
|
24305
24633
|
const expressID = stepExtractReference(buffer, cursor, endCursor);
|
|
24306
|
-
const value = expressID !== void 0 ? this.model.getElementByExpressID(expressID) : this.model.getInlineElementByAddress(
|
|
24634
|
+
const value = expressID !== void 0 ? this.model.getElementByExpressID(expressID) : this.model.getInlineElementByAddress(extractInlineElementAddress(buffer, cursor, endCursor));
|
|
24307
24635
|
if (value === void 0) {
|
|
24308
24636
|
if (!optional) {
|
|
24309
24637
|
throw new Error("Value in STEP was incorrectly typed");
|
|
@@ -24365,8 +24693,8 @@ var StepEntityBase = class {
|
|
|
24365
24693
|
extractLineArguments() {
|
|
24366
24694
|
this.guaranteeBuffer();
|
|
24367
24695
|
const internalReference = this.internalReference_;
|
|
24368
|
-
const cursor = internalReference.address;
|
|
24369
24696
|
const buffer = internalReference.buffer;
|
|
24697
|
+
const cursor = internalReference.address - stepBufferBase(buffer);
|
|
24370
24698
|
const endCursor = cursor + internalReference.length;
|
|
24371
24699
|
const subArray = buffer.subarray(cursor, endCursor);
|
|
24372
24700
|
return subArray;
|
|
@@ -24381,7 +24709,7 @@ var StepEntityBase = class {
|
|
|
24381
24709
|
*/
|
|
24382
24710
|
extractBufferReference(buffer, cursor, endCursor) {
|
|
24383
24711
|
const expressID = stepExtractReference(buffer, cursor, endCursor);
|
|
24384
|
-
const value = expressID !== void 0 ? this.model.getElementByExpressID(expressID) : this.model.getInlineElementByAddress(
|
|
24712
|
+
const value = expressID !== void 0 ? this.model.getElementByExpressID(expressID) : this.model.getInlineElementByAddress(extractInlineElementAddress(buffer, cursor, endCursor));
|
|
24385
24713
|
return value;
|
|
24386
24714
|
}
|
|
24387
24715
|
/**
|
|
@@ -24452,7 +24780,7 @@ var StepEntityBase = class {
|
|
|
24452
24780
|
const [cursor, endCursor, buffer] = this.getOffsetAndEndCursor(offset, baseOffset, depth);
|
|
24453
24781
|
const model = this.model;
|
|
24454
24782
|
const expressID = stepExtractReference(buffer, cursor, endCursor);
|
|
24455
|
-
const value = expressID !== void 0 ? model.getTypedElementByExpressID(expressID, entityConstructor) : model.getTypedInlineElementByAddress(
|
|
24783
|
+
const value = expressID !== void 0 ? model.getTypedElementByExpressID(expressID, entityConstructor) : model.getTypedInlineElementByAddress(extractInlineElementAddress(buffer, cursor, endCursor), entityConstructor);
|
|
24456
24784
|
if (value === void 0) {
|
|
24457
24785
|
if (!optional) {
|
|
24458
24786
|
throw new Error("Value in STEP was incorrectly typed");
|
|
@@ -24481,7 +24809,7 @@ var StepEntityBase = class {
|
|
|
24481
24809
|
extractBufferElement(buffer, cursor, endCursor, entityConstructor) {
|
|
24482
24810
|
const model = this.model;
|
|
24483
24811
|
const expressID = stepExtractReference(buffer, cursor, endCursor);
|
|
24484
|
-
const value = expressID !== void 0 ? model.getTypedElementByExpressID(expressID, entityConstructor) : model.getTypedInlineElementByAddress(
|
|
24812
|
+
const value = expressID !== void 0 ? model.getTypedElementByExpressID(expressID, entityConstructor) : model.getTypedInlineElementByAddress(extractInlineElementAddress(buffer, cursor, endCursor), entityConstructor);
|
|
24485
24813
|
if (value === void 0) {
|
|
24486
24814
|
return;
|
|
24487
24815
|
}
|
|
@@ -24524,7 +24852,7 @@ var StepEntityBase = class {
|
|
|
24524
24852
|
if (offset >= internalReference.vtableCount) {
|
|
24525
24853
|
throw new Error("Couldn't read field due to too few fields in record");
|
|
24526
24854
|
}
|
|
24527
|
-
const buffer =
|
|
24855
|
+
const buffer = internalReference.buffer;
|
|
24528
24856
|
const vtableSlot = internalReference.vtableIndex + offset;
|
|
24529
24857
|
const cursor = internalReference.vtable[vtableSlot];
|
|
24530
24858
|
const nextSlot = vtableSlot + 1;
|
|
@@ -24660,8 +24988,8 @@ var StepEntityBase = class {
|
|
|
24660
24988
|
if (!populated) {
|
|
24661
24989
|
throw new Error("Entity does not have matching table entry to read from model");
|
|
24662
24990
|
}
|
|
24663
|
-
this.internalReference_.buffer = classReference.buffer;
|
|
24664
24991
|
}
|
|
24992
|
+
this.internalReference_.buffer = classReference.buffer;
|
|
24665
24993
|
return classReference;
|
|
24666
24994
|
}
|
|
24667
24995
|
const internalReference = this.internalReference_;
|
|
@@ -85955,7 +86283,7 @@ var IfcSceneBuilder = class {
|
|
|
85955
86283
|
};
|
|
85956
86284
|
|
|
85957
86285
|
// compiled/src/version/version.js
|
|
85958
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
86286
|
+
var versionString = "Conway Web-Ifc Shim v1.375.1183";
|
|
85959
86287
|
|
|
85960
86288
|
// compiled/src/statistics/statistics.js
|
|
85961
86289
|
var Statistics = class {
|