minerender 2.1.0-alpha.70 → 2.1.0-alpha.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -498,7 +498,7 @@ var MineRender = (() => {
498
498
  Buffer2.isBuffer = function isBuffer2(b4) {
499
499
  return b4 != null && b4._isBuffer === true && b4 !== Buffer2.prototype;
500
500
  };
501
- Buffer2.compare = function compare(a4, b4) {
501
+ Buffer2.compare = function compare2(a4, b4) {
502
502
  if (isInstance(a4, Uint8Array)) a4 = Buffer2.from(a4, a4.offset, a4.byteLength);
503
503
  if (isInstance(b4, Uint8Array)) b4 = Buffer2.from(b4, b4.offset, b4.byteLength);
504
504
  if (!Buffer2.isBuffer(a4) || !Buffer2.isBuffer(b4)) {
@@ -720,7 +720,7 @@ var MineRender = (() => {
720
720
  if (customInspectSymbol) {
721
721
  Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
722
722
  }
723
- Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
723
+ Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) {
724
724
  if (isInstance(target, Uint8Array)) {
725
725
  target = Buffer2.from(target, target.offset, target.byteLength);
726
726
  }
@@ -4473,7 +4473,7 @@ var MineRender = (() => {
4473
4473
  }
4474
4474
  return true;
4475
4475
  }
4476
- function checkIntersection$1(object, material, raycaster, ray, pA, pB, pC, point) {
4476
+ function checkIntersection$1(object2, material, raycaster, ray, pA, pB, pC, point) {
4477
4477
  let intersect2;
4478
4478
  if (material.side === BackSide) {
4479
4479
  intersect2 = ray.intersectTriangle(pC, pB, pA, true, point);
@@ -4482,20 +4482,20 @@ var MineRender = (() => {
4482
4482
  }
4483
4483
  if (intersect2 === null) return null;
4484
4484
  _intersectionPointWorld.copy(point);
4485
- _intersectionPointWorld.applyMatrix4(object.matrixWorld);
4485
+ _intersectionPointWorld.applyMatrix4(object2.matrixWorld);
4486
4486
  const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);
4487
4487
  if (distance < raycaster.near || distance > raycaster.far) return null;
4488
4488
  return {
4489
4489
  distance,
4490
4490
  point: _intersectionPointWorld.clone(),
4491
- object
4491
+ object: object2
4492
4492
  };
4493
4493
  }
4494
- function checkGeometryIntersection(object, material, raycaster, ray, uv, uv1, normal, a4, b4, c4) {
4495
- object.getVertexPosition(a4, _vA);
4496
- object.getVertexPosition(b4, _vB);
4497
- object.getVertexPosition(c4, _vC);
4498
- const intersection = checkIntersection$1(object, material, raycaster, ray, _vA, _vB, _vC, _intersectionPoint);
4494
+ function checkGeometryIntersection(object2, material, raycaster, ray, uv, uv1, normal, a4, b4, c4) {
4495
+ object2.getVertexPosition(a4, _vA);
4496
+ object2.getVertexPosition(b4, _vB);
4497
+ object2.getVertexPosition(c4, _vC);
4498
+ const intersection = checkIntersection$1(object2, material, raycaster, ray, _vA, _vB, _vC, _intersectionPoint);
4499
4499
  if (intersection) {
4500
4500
  const barycoord = new Vector3();
4501
4501
  Triangle.getBarycoord(_intersectionPoint, _vA, _vB, _vC, barycoord);
@@ -4524,25 +4524,25 @@ var MineRender = (() => {
4524
4524
  }
4525
4525
  return intersection;
4526
4526
  }
4527
- function checkIntersection(object, raycaster, ray, thresholdSq, a4, b4, i4) {
4528
- const positionAttribute = object.geometry.attributes.position;
4527
+ function checkIntersection(object2, raycaster, ray, thresholdSq, a4, b4, i4) {
4528
+ const positionAttribute = object2.geometry.attributes.position;
4529
4529
  _vStart.fromBufferAttribute(positionAttribute, a4);
4530
4530
  _vEnd.fromBufferAttribute(positionAttribute, b4);
4531
4531
  const distSq = ray.distanceSqToSegment(_vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment);
4532
4532
  if (distSq > thresholdSq) return;
4533
- _intersectPointOnRay.applyMatrix4(object.matrixWorld);
4533
+ _intersectPointOnRay.applyMatrix4(object2.matrixWorld);
4534
4534
  const distance = raycaster.ray.origin.distanceTo(_intersectPointOnRay);
4535
4535
  if (distance < raycaster.near || distance > raycaster.far) return;
4536
4536
  return {
4537
4537
  distance,
4538
4538
  // What do we want? intersection point on the ray or on the segment??
4539
4539
  // point: raycaster.ray.at( distance ),
4540
- point: _intersectPointOnSegment.clone().applyMatrix4(object.matrixWorld),
4540
+ point: _intersectPointOnSegment.clone().applyMatrix4(object2.matrixWorld),
4541
4541
  index: i4,
4542
4542
  face: null,
4543
4543
  faceIndex: null,
4544
4544
  barycoord: null,
4545
- object
4545
+ object: object2
4546
4546
  };
4547
4547
  }
4548
4548
  function cloneUniforms(src) {
@@ -4642,22 +4642,22 @@ var MineRender = (() => {
4642
4642
  function ascSort(a4, b4) {
4643
4643
  return a4.distance - b4.distance;
4644
4644
  }
4645
- function intersect(object, raycaster, intersects, recursive) {
4645
+ function intersect(object2, raycaster, intersects, recursive) {
4646
4646
  let propagate = true;
4647
- if (object.layers.test(raycaster.layers)) {
4648
- const result = object.raycast(raycaster, intersects);
4647
+ if (object2.layers.test(raycaster.layers)) {
4648
+ const result = object2.raycast(raycaster, intersects);
4649
4649
  if (result === false) propagate = false;
4650
4650
  }
4651
4651
  if (propagate === true && recursive === true) {
4652
- const children = object.children;
4652
+ const children = object2.children;
4653
4653
  for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
4654
4654
  intersect(children[i4], raycaster, intersects, true);
4655
4655
  }
4656
4656
  }
4657
4657
  }
4658
- function getByteLength(width, height, format2, type) {
4658
+ function getByteLength(width, height, format3, type) {
4659
4659
  const typeByteLength = getTextureTypeByteLength(type);
4660
- switch (format2) {
4660
+ switch (format3) {
4661
4661
  // https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
4662
4662
  case AlphaFormat:
4663
4663
  return width * height;
@@ -4742,7 +4742,7 @@ var MineRender = (() => {
4742
4742
  return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;
4743
4743
  }
4744
4744
  throw new Error(
4745
- `Unable to determine texture byte length for ${format2} format.`
4745
+ `Unable to determine texture byte length for ${format3} format.`
4746
4746
  );
4747
4747
  }
4748
4748
  function getTextureTypeByteLength(type) {
@@ -8076,7 +8076,7 @@ var MineRender = (() => {
8076
8076
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
8077
8077
  * @param {string} [colorSpace=NoColorSpace] - The color space.
8078
8078
  */
8079
- constructor(image = _Texture.DEFAULT_IMAGE, mapping = _Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format2 = RGBAFormat, type = UnsignedByteType, anisotropy = _Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace) {
8079
+ constructor(image = _Texture.DEFAULT_IMAGE, mapping = _Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format3 = RGBAFormat, type = UnsignedByteType, anisotropy = _Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace) {
8080
8080
  super();
8081
8081
  this.isTexture = true;
8082
8082
  Object.defineProperty(this, "id", { value: _textureId++ });
@@ -8091,7 +8091,7 @@ var MineRender = (() => {
8091
8091
  this.magFilter = magFilter;
8092
8092
  this.minFilter = minFilter;
8093
8093
  this.anisotropy = anisotropy;
8094
- this.format = format2;
8094
+ this.format = format3;
8095
8095
  this.internalFormat = null;
8096
8096
  this.type = type;
8097
8097
  this.offset = new Vector2(0, 0);
@@ -11302,27 +11302,27 @@ var MineRender = (() => {
11302
11302
  * @param {Object3D} object - The 3D object to add.
11303
11303
  * @return {Object3D} A reference to this instance.
11304
11304
  */
11305
- add(object) {
11305
+ add(object2) {
11306
11306
  if (arguments.length > 1) {
11307
11307
  for (let i4 = 0; i4 < arguments.length; i4++) {
11308
11308
  this.add(arguments[i4]);
11309
11309
  }
11310
11310
  return this;
11311
11311
  }
11312
- if (object === this) {
11313
- error("Object3D.add: object can't be added as a child of itself.", object);
11312
+ if (object2 === this) {
11313
+ error("Object3D.add: object can't be added as a child of itself.", object2);
11314
11314
  return this;
11315
11315
  }
11316
- if (object && object.isObject3D) {
11317
- object.removeFromParent();
11318
- object.parent = this;
11319
- this.children.push(object);
11320
- object.dispatchEvent(_addedEvent);
11321
- _childaddedEvent.child = object;
11316
+ if (object2 && object2.isObject3D) {
11317
+ object2.removeFromParent();
11318
+ object2.parent = this;
11319
+ this.children.push(object2);
11320
+ object2.dispatchEvent(_addedEvent);
11321
+ _childaddedEvent.child = object2;
11322
11322
  this.dispatchEvent(_childaddedEvent);
11323
11323
  _childaddedEvent.child = null;
11324
11324
  } else {
11325
- error("Object3D.add: object not an instance of THREE.Object3D.", object);
11325
+ error("Object3D.add: object not an instance of THREE.Object3D.", object2);
11326
11326
  }
11327
11327
  return this;
11328
11328
  }
@@ -11335,19 +11335,19 @@ var MineRender = (() => {
11335
11335
  * @param {Object3D} object - The 3D object to remove.
11336
11336
  * @return {Object3D} A reference to this instance.
11337
11337
  */
11338
- remove(object) {
11338
+ remove(object2) {
11339
11339
  if (arguments.length > 1) {
11340
11340
  for (let i4 = 0; i4 < arguments.length; i4++) {
11341
11341
  this.remove(arguments[i4]);
11342
11342
  }
11343
11343
  return this;
11344
11344
  }
11345
- const index = this.children.indexOf(object);
11345
+ const index = this.children.indexOf(object2);
11346
11346
  if (index !== -1) {
11347
- object.parent = null;
11347
+ object2.parent = null;
11348
11348
  this.children.splice(index, 1);
11349
- object.dispatchEvent(_removedEvent);
11350
- _childremovedEvent.child = object;
11349
+ object2.dispatchEvent(_removedEvent);
11350
+ _childremovedEvent.child = object2;
11351
11351
  this.dispatchEvent(_childremovedEvent);
11352
11352
  _childremovedEvent.child = null;
11353
11353
  }
@@ -11386,20 +11386,20 @@ var MineRender = (() => {
11386
11386
  * @param {Object3D} object - The 3D object to attach.
11387
11387
  * @return {Object3D} A reference to this instance.
11388
11388
  */
11389
- attach(object) {
11389
+ attach(object2) {
11390
11390
  this.updateWorldMatrix(true, false);
11391
11391
  _m1$1.copy(this.matrixWorld).invert();
11392
- if (object.parent !== null) {
11393
- object.parent.updateWorldMatrix(true, false);
11394
- _m1$1.multiply(object.parent.matrixWorld);
11395
- }
11396
- object.applyMatrix4(_m1$1);
11397
- object.removeFromParent();
11398
- object.parent = this;
11399
- this.children.push(object);
11400
- object.updateWorldMatrix(false, true);
11401
- object.dispatchEvent(_addedEvent);
11402
- _childaddedEvent.child = object;
11392
+ if (object2.parent !== null) {
11393
+ object2.parent.updateWorldMatrix(true, false);
11394
+ _m1$1.multiply(object2.parent.matrixWorld);
11395
+ }
11396
+ object2.applyMatrix4(_m1$1);
11397
+ object2.removeFromParent();
11398
+ object2.parent = this;
11399
+ this.children.push(object2);
11400
+ object2.updateWorldMatrix(false, true);
11401
+ object2.dispatchEvent(_addedEvent);
11402
+ _childaddedEvent.child = object2;
11403
11403
  this.dispatchEvent(_childaddedEvent);
11404
11404
  _childaddedEvent.child = null;
11405
11405
  return this;
@@ -11436,9 +11436,9 @@ var MineRender = (() => {
11436
11436
  if (this[name2] === value) return this;
11437
11437
  for (let i4 = 0, l4 = this.children.length; i4 < l4; i4++) {
11438
11438
  const child = this.children[i4];
11439
- const object = child.getObjectByProperty(name2, value);
11440
- if (object !== void 0) {
11441
- return object;
11439
+ const object2 = child.getObjectByProperty(name2, value);
11440
+ if (object2 !== void 0) {
11441
+ return object2;
11442
11442
  }
11443
11443
  }
11444
11444
  return void 0;
@@ -11676,61 +11676,61 @@ var MineRender = (() => {
11676
11676
  generator: "Object3D.toJSON"
11677
11677
  };
11678
11678
  }
11679
- const object = {};
11680
- object.uuid = this.uuid;
11681
- object.type = this.type;
11682
- object.name = this.name;
11683
- object.castShadow = this.castShadow;
11684
- object.receiveShadow = this.receiveShadow;
11685
- object.visible = this.visible;
11686
- object.frustumCulled = this.frustumCulled;
11687
- object.renderOrder = this.renderOrder;
11688
- object.static = this.static;
11689
- object.matrixAutoUpdate = this.matrixAutoUpdate;
11690
- if (Object.keys(this.userData).length > 0) object.userData = this.userData;
11691
- object.layers = this.layers.mask;
11692
- object.matrix = this.matrix.toArray();
11693
- object.up = this.up.toArray();
11694
- if (this.pivot !== null) object.pivot = this.pivot.toArray();
11695
- if (this.morphTargetDictionary !== void 0) object.morphTargetDictionary = Object.assign({}, this.morphTargetDictionary);
11696
- if (this.morphTargetInfluences !== void 0) object.morphTargetInfluences = this.morphTargetInfluences.slice();
11679
+ const object2 = {};
11680
+ object2.uuid = this.uuid;
11681
+ object2.type = this.type;
11682
+ object2.name = this.name;
11683
+ object2.castShadow = this.castShadow;
11684
+ object2.receiveShadow = this.receiveShadow;
11685
+ object2.visible = this.visible;
11686
+ object2.frustumCulled = this.frustumCulled;
11687
+ object2.renderOrder = this.renderOrder;
11688
+ object2.static = this.static;
11689
+ object2.matrixAutoUpdate = this.matrixAutoUpdate;
11690
+ if (Object.keys(this.userData).length > 0) object2.userData = this.userData;
11691
+ object2.layers = this.layers.mask;
11692
+ object2.matrix = this.matrix.toArray();
11693
+ object2.up = this.up.toArray();
11694
+ if (this.pivot !== null) object2.pivot = this.pivot.toArray();
11695
+ if (this.morphTargetDictionary !== void 0) object2.morphTargetDictionary = Object.assign({}, this.morphTargetDictionary);
11696
+ if (this.morphTargetInfluences !== void 0) object2.morphTargetInfluences = this.morphTargetInfluences.slice();
11697
11697
  if (this.isInstancedMesh) {
11698
- object.type = "InstancedMesh";
11699
- object.count = this.count;
11700
- object.instanceMatrix = this.instanceMatrix.toJSON();
11701
- if (this.instanceColor !== null) object.instanceColor = this.instanceColor.toJSON();
11698
+ object2.type = "InstancedMesh";
11699
+ object2.count = this.count;
11700
+ object2.instanceMatrix = this.instanceMatrix.toJSON();
11701
+ if (this.instanceColor !== null) object2.instanceColor = this.instanceColor.toJSON();
11702
11702
  }
11703
11703
  if (this.isBatchedMesh) {
11704
- object.type = "BatchedMesh";
11705
- object.perObjectFrustumCulled = this.perObjectFrustumCulled;
11706
- object.sortObjects = this.sortObjects;
11707
- object.drawRanges = this._drawRanges;
11708
- object.reservedRanges = this._reservedRanges;
11709
- object.geometryInfo = this._geometryInfo.map((info) => ({
11704
+ object2.type = "BatchedMesh";
11705
+ object2.perObjectFrustumCulled = this.perObjectFrustumCulled;
11706
+ object2.sortObjects = this.sortObjects;
11707
+ object2.drawRanges = this._drawRanges;
11708
+ object2.reservedRanges = this._reservedRanges;
11709
+ object2.geometryInfo = this._geometryInfo.map((info) => ({
11710
11710
  ...info,
11711
11711
  boundingBox: info.boundingBox ? info.boundingBox.toJSON() : void 0,
11712
11712
  boundingSphere: info.boundingSphere ? info.boundingSphere.toJSON() : void 0
11713
11713
  }));
11714
- object.instanceInfo = this._instanceInfo.map((info) => ({ ...info }));
11715
- object.availableInstanceIds = this._availableInstanceIds.slice();
11716
- object.availableGeometryIds = this._availableGeometryIds.slice();
11717
- object.nextIndexStart = this._nextIndexStart;
11718
- object.nextVertexStart = this._nextVertexStart;
11719
- object.geometryCount = this._geometryCount;
11720
- object.maxInstanceCount = this._maxInstanceCount;
11721
- object.maxVertexCount = this._maxVertexCount;
11722
- object.maxIndexCount = this._maxIndexCount;
11723
- object.geometryInitialized = this._geometryInitialized;
11724
- object.matricesTexture = this._matricesTexture.toJSON(meta);
11725
- object.indirectTexture = this._indirectTexture.toJSON(meta);
11714
+ object2.instanceInfo = this._instanceInfo.map((info) => ({ ...info }));
11715
+ object2.availableInstanceIds = this._availableInstanceIds.slice();
11716
+ object2.availableGeometryIds = this._availableGeometryIds.slice();
11717
+ object2.nextIndexStart = this._nextIndexStart;
11718
+ object2.nextVertexStart = this._nextVertexStart;
11719
+ object2.geometryCount = this._geometryCount;
11720
+ object2.maxInstanceCount = this._maxInstanceCount;
11721
+ object2.maxVertexCount = this._maxVertexCount;
11722
+ object2.maxIndexCount = this._maxIndexCount;
11723
+ object2.geometryInitialized = this._geometryInitialized;
11724
+ object2.matricesTexture = this._matricesTexture.toJSON(meta);
11725
+ object2.indirectTexture = this._indirectTexture.toJSON(meta);
11726
11726
  if (this._colorsTexture !== null) {
11727
- object.colorsTexture = this._colorsTexture.toJSON(meta);
11727
+ object2.colorsTexture = this._colorsTexture.toJSON(meta);
11728
11728
  }
11729
11729
  if (this.boundingSphere !== null) {
11730
- object.boundingSphere = this.boundingSphere.toJSON();
11730
+ object2.boundingSphere = this.boundingSphere.toJSON();
11731
11731
  }
11732
11732
  if (this.boundingBox !== null) {
11733
- object.boundingBox = this.boundingBox.toJSON();
11733
+ object2.boundingBox = this.boundingBox.toJSON();
11734
11734
  }
11735
11735
  }
11736
11736
  function serialize(library, element) {
@@ -11742,16 +11742,16 @@ var MineRender = (() => {
11742
11742
  if (this.isScene) {
11743
11743
  if (this.background) {
11744
11744
  if (this.background.isColor) {
11745
- object.background = this.background.toJSON();
11745
+ object2.background = this.background.toJSON();
11746
11746
  } else if (this.background.isTexture) {
11747
- object.background = this.background.toJSON(meta).uuid;
11747
+ object2.background = this.background.toJSON(meta).uuid;
11748
11748
  }
11749
11749
  }
11750
11750
  if (this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true) {
11751
- object.environment = this.environment.toJSON(meta).uuid;
11751
+ object2.environment = this.environment.toJSON(meta).uuid;
11752
11752
  }
11753
11753
  } else if (this.isMesh || this.isLine || this.isPoints) {
11754
- object.geometry = serialize(meta.geometries, this.geometry);
11754
+ object2.geometry = serialize(meta.geometries, this.geometry);
11755
11755
  const parameters = this.geometry.parameters;
11756
11756
  if (parameters !== void 0 && parameters.shapes !== void 0) {
11757
11757
  const shapes = parameters.shapes;
@@ -11766,11 +11766,11 @@ var MineRender = (() => {
11766
11766
  }
11767
11767
  }
11768
11768
  if (this.isSkinnedMesh) {
11769
- object.bindMode = this.bindMode;
11770
- object.bindMatrix = this.bindMatrix.toArray();
11769
+ object2.bindMode = this.bindMode;
11770
+ object2.bindMatrix = this.bindMatrix.toArray();
11771
11771
  if (this.skeleton !== void 0) {
11772
11772
  serialize(meta.skeletons, this.skeleton);
11773
- object.skeleton = this.skeleton.uuid;
11773
+ object2.skeleton = this.skeleton.uuid;
11774
11774
  }
11775
11775
  }
11776
11776
  if (this.material !== void 0) {
@@ -11779,22 +11779,22 @@ var MineRender = (() => {
11779
11779
  for (let i4 = 0, l4 = this.material.length; i4 < l4; i4++) {
11780
11780
  uuids.push(serialize(meta.materials, this.material[i4]));
11781
11781
  }
11782
- object.material = uuids;
11782
+ object2.material = uuids;
11783
11783
  } else {
11784
- object.material = serialize(meta.materials, this.material);
11784
+ object2.material = serialize(meta.materials, this.material);
11785
11785
  }
11786
11786
  }
11787
11787
  if (this.children.length > 0) {
11788
- object.children = [];
11788
+ object2.children = [];
11789
11789
  for (let i4 = 0; i4 < this.children.length; i4++) {
11790
- object.children.push(this.children[i4].toJSON(meta).object);
11790
+ object2.children.push(this.children[i4].toJSON(meta).object);
11791
11791
  }
11792
11792
  }
11793
11793
  if (this.animations.length > 0) {
11794
- object.animations = [];
11794
+ object2.animations = [];
11795
11795
  for (let i4 = 0; i4 < this.animations.length; i4++) {
11796
11796
  const animation = this.animations[i4];
11797
- object.animations.push(serialize(meta.animations, animation));
11797
+ object2.animations.push(serialize(meta.animations, animation));
11798
11798
  }
11799
11799
  }
11800
11800
  if (isRootObject) {
@@ -11815,7 +11815,7 @@ var MineRender = (() => {
11815
11815
  if (animations.length > 0) output.animations = animations;
11816
11816
  if (nodes.length > 0) output.nodes = nodes;
11817
11817
  }
11818
- output.object = object;
11818
+ output.object = object2;
11819
11819
  return output;
11820
11820
  function extractFromCache(cache) {
11821
11821
  const values = [];
@@ -13407,9 +13407,9 @@ var MineRender = (() => {
13407
13407
  * world-axis-aligned bounding box at the expense of more computation.
13408
13408
  * @return {Box3} A reference to this bounding box.
13409
13409
  */
13410
- setFromObject(object, precise = false) {
13410
+ setFromObject(object2, precise = false) {
13411
13411
  this.makeEmpty();
13412
- return this.expandByObject(object, precise);
13412
+ return this.expandByObject(object2, precise);
13413
13413
  }
13414
13414
  /**
13415
13415
  * Returns a new box with copied values from this instance.
@@ -13517,38 +13517,38 @@ var MineRender = (() => {
13517
13517
  * as little as necessary at the expense of more computation.
13518
13518
  * @return {Box3} A reference to this bounding box.
13519
13519
  */
13520
- expandByObject(object, precise = false) {
13521
- object.updateWorldMatrix(false, false);
13522
- const geometry = object.geometry;
13520
+ expandByObject(object2, precise = false) {
13521
+ object2.updateWorldMatrix(false, false);
13522
+ const geometry = object2.geometry;
13523
13523
  if (geometry !== void 0) {
13524
13524
  const positionAttribute = geometry.getAttribute("position");
13525
- if (precise === true && positionAttribute !== void 0 && object.isInstancedMesh !== true) {
13525
+ if (precise === true && positionAttribute !== void 0 && object2.isInstancedMesh !== true) {
13526
13526
  for (let i4 = 0, l4 = positionAttribute.count; i4 < l4; i4++) {
13527
- if (object.isMesh === true) {
13528
- object.getVertexPosition(i4, _vector$b);
13527
+ if (object2.isMesh === true) {
13528
+ object2.getVertexPosition(i4, _vector$b);
13529
13529
  } else {
13530
13530
  _vector$b.fromBufferAttribute(positionAttribute, i4);
13531
13531
  }
13532
- _vector$b.applyMatrix4(object.matrixWorld);
13532
+ _vector$b.applyMatrix4(object2.matrixWorld);
13533
13533
  this.expandByPoint(_vector$b);
13534
13534
  }
13535
13535
  } else {
13536
- if (object.boundingBox !== void 0) {
13537
- if (object.boundingBox === null) {
13538
- object.computeBoundingBox();
13536
+ if (object2.boundingBox !== void 0) {
13537
+ if (object2.boundingBox === null) {
13538
+ object2.computeBoundingBox();
13539
13539
  }
13540
- _box$4.copy(object.boundingBox);
13540
+ _box$4.copy(object2.boundingBox);
13541
13541
  } else {
13542
13542
  if (geometry.boundingBox === null) {
13543
13543
  geometry.computeBoundingBox();
13544
13544
  }
13545
13545
  _box$4.copy(geometry.boundingBox);
13546
13546
  }
13547
- _box$4.applyMatrix4(object.matrixWorld);
13547
+ _box$4.applyMatrix4(object2.matrixWorld);
13548
13548
  this.union(_box$4);
13549
13549
  }
13550
13550
  }
13551
- const children = object.children;
13551
+ const children = object2.children;
13552
13552
  for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
13553
13553
  this.expandByObject(children[i4], precise);
13554
13554
  }
@@ -17419,8 +17419,8 @@ var MineRender = (() => {
17419
17419
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
17420
17420
  * @param {string} [colorSpace=NoColorSpace] - The color space.
17421
17421
  */
17422
- constructor(data = null, width = 1, height = 1, format2, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace) {
17423
- super(null, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, colorSpace);
17422
+ constructor(data = null, width = 1, height = 1, format3, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace) {
17423
+ super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace);
17424
17424
  this.isDataTexture = true;
17425
17425
  this.image = { data, width, height };
17426
17426
  this.generateMipmaps = false;
@@ -17564,8 +17564,8 @@ var MineRender = (() => {
17564
17564
  * @param {number} index - The instance index.
17565
17565
  * @param {Mesh} object - The target object that is used to store the method's result.
17566
17566
  */
17567
- getMorphAt(index, object) {
17568
- const objectInfluences = object.morphTargetInfluences;
17567
+ getMorphAt(index, object2) {
17568
+ const objectInfluences = object2.morphTargetInfluences;
17569
17569
  const array = this.morphTexture.source.data.data;
17570
17570
  const len = objectInfluences.length + 1;
17571
17571
  const dataIndex = index * len + 1;
@@ -17633,8 +17633,8 @@ var MineRender = (() => {
17633
17633
  * of a single instance.
17634
17634
  * @return {InstancedMesh} A reference to this instanced mesh.
17635
17635
  */
17636
- setMorphAt(index, object) {
17637
- const objectInfluences = object.morphTargetInfluences;
17636
+ setMorphAt(index, object2) {
17637
+ const objectInfluences = object2.morphTargetInfluences;
17638
17638
  const len = objectInfluences.length + 1;
17639
17639
  if (this.morphTexture === null) {
17640
17640
  this.morphTexture = new DataTexture(new Float32Array(len * this.count), len, this.count, RedFormat, FloatType);
@@ -17757,14 +17757,14 @@ var MineRender = (() => {
17757
17757
  * @param {Object3D} object - The 3D object to test.
17758
17758
  * @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not.
17759
17759
  */
17760
- intersectsObject(object) {
17761
- if (object.boundingSphere !== void 0) {
17762
- if (object.boundingSphere === null) object.computeBoundingSphere();
17763
- _sphere$3.copy(object.boundingSphere).applyMatrix4(object.matrixWorld);
17760
+ intersectsObject(object2) {
17761
+ if (object2.boundingSphere !== void 0) {
17762
+ if (object2.boundingSphere === null) object2.computeBoundingSphere();
17763
+ _sphere$3.copy(object2.boundingSphere).applyMatrix4(object2.matrixWorld);
17764
17764
  } else {
17765
- const geometry = object.geometry;
17765
+ const geometry = object2.geometry;
17766
17766
  if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
17767
- _sphere$3.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);
17767
+ _sphere$3.copy(geometry.boundingSphere).applyMatrix4(object2.matrixWorld);
17768
17768
  }
17769
17769
  return this.intersectsSphere(_sphere$3);
17770
17770
  }
@@ -18079,8 +18079,8 @@ var MineRender = (() => {
18079
18079
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
18080
18080
  * @param {string} [colorSpace=NoColorSpace] - The color space.
18081
18081
  */
18082
- constructor(mipmaps, width, height, format2, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace) {
18083
- super(null, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, colorSpace);
18082
+ constructor(mipmaps, width, height, format3, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace) {
18083
+ super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace);
18084
18084
  this.isCompressedTexture = true;
18085
18085
  this.image = { width, height };
18086
18086
  this.mipmaps = mipmaps;
@@ -18103,8 +18103,8 @@ var MineRender = (() => {
18103
18103
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
18104
18104
  * @param {string} [colorSpace=NoColorSpace] - The color space value.
18105
18105
  */
18106
- constructor(images = [], mapping = CubeReflectionMapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, colorSpace) {
18107
- super(images, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, colorSpace);
18106
+ constructor(images = [], mapping = CubeReflectionMapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace) {
18107
+ super(images, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace);
18108
18108
  this.isCubeTexture = true;
18109
18109
  this.flipY = false;
18110
18110
  }
@@ -18134,8 +18134,8 @@ var MineRender = (() => {
18134
18134
  * @param {number} [type=UnsignedByteType] - The texture type.
18135
18135
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
18136
18136
  */
18137
- constructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy) {
18138
- super(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy);
18137
+ constructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy) {
18138
+ super(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
18139
18139
  this.isCanvasTexture = true;
18140
18140
  this.needsUpdate = true;
18141
18141
  }
@@ -18156,12 +18156,12 @@ var MineRender = (() => {
18156
18156
  * @param {number} [format=DepthFormat] - The texture format.
18157
18157
  * @param {number} [depth=1] - The depth of the texture.
18158
18158
  */
18159
- constructor(width, height, type = UnsignedIntType, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format2 = DepthFormat, depth = 1) {
18160
- if (format2 !== DepthFormat && format2 !== DepthStencilFormat) {
18159
+ constructor(width, height, type = UnsignedIntType, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format3 = DepthFormat, depth = 1) {
18160
+ if (format3 !== DepthFormat && format3 !== DepthStencilFormat) {
18161
18161
  throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
18162
18162
  }
18163
18163
  const image = { width, height, depth };
18164
- super(image, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy);
18164
+ super(image, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
18165
18165
  this.isDepthTexture = true;
18166
18166
  this.flipY = false;
18167
18167
  this.generateMipmaps = false;
@@ -18193,10 +18193,10 @@ var MineRender = (() => {
18193
18193
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
18194
18194
  * @param {number} [format=DepthFormat] - The texture format.
18195
18195
  */
18196
- constructor(size, type = UnsignedIntType, mapping = CubeReflectionMapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format2 = DepthFormat) {
18196
+ constructor(size, type = UnsignedIntType, mapping = CubeReflectionMapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format3 = DepthFormat) {
18197
18197
  const image = { width: size, height: size, depth: 1 };
18198
18198
  const images = [image, image, image, image, image, image];
18199
- super(size, size, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format2);
18199
+ super(size, size, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format3);
18200
18200
  this.image = images;
18201
18201
  this.isCubeDepthTexture = true;
18202
18202
  this.isCubeTexture = true;
@@ -20926,8 +20926,8 @@ var MineRender = (() => {
20926
20926
  * @param {Array<Raycaster~Intersection>} [intersects=[]] The target array that holds the result of the method.
20927
20927
  * @return {Array<Raycaster~Intersection>} An array holding the intersection points.
20928
20928
  */
20929
- intersectObject(object, recursive = true, intersects = []) {
20930
- intersect(object, this, intersects, recursive);
20929
+ intersectObject(object2, recursive = true, intersects = []) {
20930
+ intersect(object2, this, intersects, recursive);
20931
20931
  intersects.sort(ascSort);
20932
20932
  return intersects;
20933
20933
  }
@@ -21836,21 +21836,21 @@ var MineRender = (() => {
21836
21836
  const defaultState = createBindingState(null);
21837
21837
  let currentState = defaultState;
21838
21838
  let forceUpdate = false;
21839
- function setup(object, material, program, geometry, index) {
21839
+ function setup(object2, material, program, geometry, index) {
21840
21840
  let updateBuffers = false;
21841
- const state = getBindingState(object, geometry, program, material);
21841
+ const state = getBindingState(object2, geometry, program, material);
21842
21842
  if (currentState !== state) {
21843
21843
  currentState = state;
21844
21844
  bindVertexArrayObject(currentState.object);
21845
21845
  }
21846
- updateBuffers = needsUpdate(object, geometry, program, index);
21847
- if (updateBuffers) saveCache(object, geometry, program, index);
21846
+ updateBuffers = needsUpdate(object2, geometry, program, index);
21847
+ if (updateBuffers) saveCache(object2, geometry, program, index);
21848
21848
  if (index !== null) {
21849
21849
  attributes.update(index, gl.ELEMENT_ARRAY_BUFFER);
21850
21850
  }
21851
21851
  if (updateBuffers || forceUpdate) {
21852
21852
  forceUpdate = false;
21853
- setupVertexAttributes(object, material, program, geometry);
21853
+ setupVertexAttributes(object2, material, program, geometry);
21854
21854
  if (index !== null) {
21855
21855
  gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index).buffer);
21856
21856
  }
@@ -21865,14 +21865,14 @@ var MineRender = (() => {
21865
21865
  function deleteVertexArrayObject(vao) {
21866
21866
  return gl.deleteVertexArray(vao);
21867
21867
  }
21868
- function getBindingState(object, geometry, program, material) {
21868
+ function getBindingState(object2, geometry, program, material) {
21869
21869
  const wireframe = material.wireframe === true;
21870
21870
  let objectMap = bindingStates[geometry.id];
21871
21871
  if (objectMap === void 0) {
21872
21872
  objectMap = {};
21873
21873
  bindingStates[geometry.id] = objectMap;
21874
21874
  }
21875
- const objectId = object.isInstancedMesh === true ? object.id : 0;
21875
+ const objectId = object2.isInstancedMesh === true ? object2.id : 0;
21876
21876
  let programMap = objectMap[objectId];
21877
21877
  if (programMap === void 0) {
21878
21878
  programMap = {};
@@ -21912,7 +21912,7 @@ var MineRender = (() => {
21912
21912
  index: null
21913
21913
  };
21914
21914
  }
21915
- function needsUpdate(object, geometry, program, index) {
21915
+ function needsUpdate(object2, geometry, program, index) {
21916
21916
  const cachedAttributes = currentState.attributes;
21917
21917
  const geometryAttributes = geometry.attributes;
21918
21918
  let attributesNum = 0;
@@ -21923,8 +21923,8 @@ var MineRender = (() => {
21923
21923
  const cachedAttribute = cachedAttributes[name2];
21924
21924
  let geometryAttribute = geometryAttributes[name2];
21925
21925
  if (geometryAttribute === void 0) {
21926
- if (name2 === "instanceMatrix" && object.instanceMatrix) geometryAttribute = object.instanceMatrix;
21927
- if (name2 === "instanceColor" && object.instanceColor) geometryAttribute = object.instanceColor;
21926
+ if (name2 === "instanceMatrix" && object2.instanceMatrix) geometryAttribute = object2.instanceMatrix;
21927
+ if (name2 === "instanceColor" && object2.instanceColor) geometryAttribute = object2.instanceColor;
21928
21928
  }
21929
21929
  if (cachedAttribute === void 0) return true;
21930
21930
  if (cachedAttribute.attribute !== geometryAttribute) return true;
@@ -21936,7 +21936,7 @@ var MineRender = (() => {
21936
21936
  if (currentState.index !== index) return true;
21937
21937
  return false;
21938
21938
  }
21939
- function saveCache(object, geometry, program, index) {
21939
+ function saveCache(object2, geometry, program, index) {
21940
21940
  const cache = {};
21941
21941
  const attributes2 = geometry.attributes;
21942
21942
  let attributesNum = 0;
@@ -21946,8 +21946,8 @@ var MineRender = (() => {
21946
21946
  if (programAttribute.location >= 0) {
21947
21947
  let attribute = attributes2[name2];
21948
21948
  if (attribute === void 0) {
21949
- if (name2 === "instanceMatrix" && object.instanceMatrix) attribute = object.instanceMatrix;
21950
- if (name2 === "instanceColor" && object.instanceColor) attribute = object.instanceColor;
21949
+ if (name2 === "instanceMatrix" && object2.instanceMatrix) attribute = object2.instanceMatrix;
21950
+ if (name2 === "instanceColor" && object2.instanceColor) attribute = object2.instanceColor;
21951
21951
  }
21952
21952
  const data = {};
21953
21953
  data.attribute = attribute;
@@ -21995,14 +21995,14 @@ var MineRender = (() => {
21995
21995
  }
21996
21996
  }
21997
21997
  }
21998
- function vertexAttribPointer(index, size, type, normalized, stride, offset, integer) {
21999
- if (integer === true) {
21998
+ function vertexAttribPointer(index, size, type, normalized, stride, offset, integer2) {
21999
+ if (integer2 === true) {
22000
22000
  gl.vertexAttribIPointer(index, size, type, stride, offset);
22001
22001
  } else {
22002
22002
  gl.vertexAttribPointer(index, size, type, normalized, stride, offset);
22003
22003
  }
22004
22004
  }
22005
- function setupVertexAttributes(object, material, program, geometry) {
22005
+ function setupVertexAttributes(object2, material, program, geometry) {
22006
22006
  initAttributes();
22007
22007
  const geometryAttributes = geometry.attributes;
22008
22008
  const programAttributes = program.getAttributes();
@@ -22012,8 +22012,8 @@ var MineRender = (() => {
22012
22012
  if (programAttribute.location >= 0) {
22013
22013
  let geometryAttribute = geometryAttributes[name2];
22014
22014
  if (geometryAttribute === void 0) {
22015
- if (name2 === "instanceMatrix" && object.instanceMatrix) geometryAttribute = object.instanceMatrix;
22016
- if (name2 === "instanceColor" && object.instanceColor) geometryAttribute = object.instanceColor;
22015
+ if (name2 === "instanceMatrix" && object2.instanceMatrix) geometryAttribute = object2.instanceMatrix;
22016
+ if (name2 === "instanceColor" && object2.instanceColor) geometryAttribute = object2.instanceColor;
22017
22017
  }
22018
22018
  if (geometryAttribute !== void 0) {
22019
22019
  const normalized = geometryAttribute.normalized;
@@ -22023,7 +22023,7 @@ var MineRender = (() => {
22023
22023
  const buffer2 = attribute.buffer;
22024
22024
  const type = attribute.type;
22025
22025
  const bytesPerElement = attribute.bytesPerElement;
22026
- const integer = type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType;
22026
+ const integer2 = type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType;
22027
22027
  if (geometryAttribute.isInterleavedBufferAttribute) {
22028
22028
  const data = geometryAttribute.data;
22029
22029
  const stride = data.stride;
@@ -22032,7 +22032,7 @@ var MineRender = (() => {
22032
22032
  for (let i4 = 0; i4 < programAttribute.locationSize; i4++) {
22033
22033
  enableAttributeAndDivisor(programAttribute.location + i4, data.meshPerAttribute);
22034
22034
  }
22035
- if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
22035
+ if (object2.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
22036
22036
  geometry._maxInstanceCount = data.meshPerAttribute * data.count;
22037
22037
  }
22038
22038
  } else {
@@ -22049,7 +22049,7 @@ var MineRender = (() => {
22049
22049
  normalized,
22050
22050
  stride * bytesPerElement,
22051
22051
  (offset + size / programAttribute.locationSize * i4) * bytesPerElement,
22052
- integer
22052
+ integer2
22053
22053
  );
22054
22054
  }
22055
22055
  } else {
@@ -22057,7 +22057,7 @@ var MineRender = (() => {
22057
22057
  for (let i4 = 0; i4 < programAttribute.locationSize; i4++) {
22058
22058
  enableAttributeAndDivisor(programAttribute.location + i4, geometryAttribute.meshPerAttribute);
22059
22059
  }
22060
- if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
22060
+ if (object2.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
22061
22061
  geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;
22062
22062
  }
22063
22063
  } else {
@@ -22074,7 +22074,7 @@ var MineRender = (() => {
22074
22074
  normalized,
22075
22075
  size * bytesPerElement,
22076
22076
  size / programAttribute.locationSize * i4 * bytesPerElement,
22077
- integer
22077
+ integer2
22078
22078
  );
22079
22079
  }
22080
22080
  }
@@ -22149,10 +22149,10 @@ var MineRender = (() => {
22149
22149
  }
22150
22150
  }
22151
22151
  }
22152
- function releaseStatesOfObject(object) {
22152
+ function releaseStatesOfObject(object2) {
22153
22153
  for (const geometryId in bindingStates) {
22154
22154
  const objectMap = bindingStates[geometryId];
22155
- const objectId = object.isInstancedMesh === true ? object.id : 0;
22155
+ const objectId = object2.isInstancedMesh === true ? object2.id : 0;
22156
22156
  const programMap = objectMap[objectId];
22157
22157
  if (programMap === void 0) continue;
22158
22158
  for (const programId in programMap) {
@@ -22940,7 +22940,7 @@ var MineRender = (() => {
22940
22940
  }
22941
22941
  info.memory.geometries--;
22942
22942
  }
22943
- function get(object, geometry) {
22943
+ function get(object2, geometry) {
22944
22944
  if (geometries[geometry.id] === true) return geometry;
22945
22945
  geometry.addEventListener("dispose", onGeometryDispose);
22946
22946
  geometries[geometry.id] = true;
@@ -23094,8 +23094,8 @@ var MineRender = (() => {
23094
23094
  function WebGLMorphtargets(gl, capabilities, textures) {
23095
23095
  const morphTextures = /* @__PURE__ */ new WeakMap();
23096
23096
  const morph = new Vector4();
23097
- function update(object, geometry, program) {
23098
- const objectInfluences = object.morphTargetInfluences;
23097
+ function update(object2, geometry, program) {
23098
+ const objectInfluences = object2.morphTargetInfluences;
23099
23099
  const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
23100
23100
  const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0;
23101
23101
  let entry = morphTextures.get(geometry);
@@ -23165,8 +23165,8 @@ var MineRender = (() => {
23165
23165
  morphTextures.set(geometry, entry);
23166
23166
  geometry.addEventListener("dispose", disposeTexture);
23167
23167
  }
23168
- if (object.isInstancedMesh === true && object.morphTexture !== null) {
23169
- program.getUniforms().setValue(gl, "morphTexture", object.morphTexture, textures);
23168
+ if (object2.isInstancedMesh === true && object2.morphTexture !== null) {
23169
+ program.getUniforms().setValue(gl, "morphTexture", object2.morphTexture, textures);
23170
23170
  } else {
23171
23171
  let morphInfluencesSum = 0;
23172
23172
  for (let i4 = 0; i4 < objectInfluences.length; i4++) {
@@ -23185,28 +23185,28 @@ var MineRender = (() => {
23185
23185
  }
23186
23186
  function WebGLObjects(gl, geometries, attributes, bindingStates, info) {
23187
23187
  let updateMap = /* @__PURE__ */ new WeakMap();
23188
- function update(object) {
23188
+ function update(object2) {
23189
23189
  const frame = info.render.frame;
23190
- const geometry = object.geometry;
23191
- const buffergeometry = geometries.get(object, geometry);
23190
+ const geometry = object2.geometry;
23191
+ const buffergeometry = geometries.get(object2, geometry);
23192
23192
  if (updateMap.get(buffergeometry) !== frame) {
23193
23193
  geometries.update(buffergeometry);
23194
23194
  updateMap.set(buffergeometry, frame);
23195
23195
  }
23196
- if (object.isInstancedMesh) {
23197
- if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) {
23198
- object.addEventListener("dispose", onInstancedMeshDispose);
23196
+ if (object2.isInstancedMesh) {
23197
+ if (object2.hasEventListener("dispose", onInstancedMeshDispose) === false) {
23198
+ object2.addEventListener("dispose", onInstancedMeshDispose);
23199
23199
  }
23200
- if (updateMap.get(object) !== frame) {
23201
- attributes.update(object.instanceMatrix, gl.ARRAY_BUFFER);
23202
- if (object.instanceColor !== null) {
23203
- attributes.update(object.instanceColor, gl.ARRAY_BUFFER);
23200
+ if (updateMap.get(object2) !== frame) {
23201
+ attributes.update(object2.instanceMatrix, gl.ARRAY_BUFFER);
23202
+ if (object2.instanceColor !== null) {
23203
+ attributes.update(object2.instanceColor, gl.ARRAY_BUFFER);
23204
23204
  }
23205
- updateMap.set(object, frame);
23205
+ updateMap.set(object2, frame);
23206
23206
  }
23207
23207
  }
23208
- if (object.isSkinnedMesh) {
23209
- const skeleton = object.skeleton;
23208
+ if (object2.isSkinnedMesh) {
23209
+ const skeleton = object2.skeleton;
23210
23210
  if (updateMap.get(skeleton) !== frame) {
23211
23211
  skeleton.update();
23212
23212
  updateMap.set(skeleton, frame);
@@ -24557,8 +24557,8 @@ var MineRender = (() => {
24557
24557
  this.fragmentShader = glFragmentShader;
24558
24558
  return this;
24559
24559
  }
24560
- function isPackedRGFormat(format2) {
24561
- return format2 === RGFormat || format2 === RG11_EAC_Format || format2 === RED_GREEN_RGTC2_Format;
24560
+ function isPackedRGFormat(format3) {
24561
+ return format3 === RGFormat || format3 === RG11_EAC_Format || format3 === RED_GREEN_RGTC2_Format;
24562
24562
  }
24563
24563
  function WebGLPrograms(renderer, environments, extensions, capabilities, bindingStates, clipping) {
24564
24564
  const _programLayers = new Layers();
@@ -24590,9 +24590,9 @@ var MineRender = (() => {
24590
24590
  if (value === 0) return "uv";
24591
24591
  return `uv${value}`;
24592
24592
  }
24593
- function getParameters(material, lights, shadows, scene, object, lightProbeGrids) {
24593
+ function getParameters(material, lights, shadows, scene, object2, lightProbeGrids) {
24594
24594
  const fog = scene.fog;
24595
- const geometry = object.geometry;
24595
+ const geometry = object2.geometry;
24596
24596
  const environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
24597
24597
  const usePMREM = material.isMeshStandardMaterial || material.isMeshLambertMaterial && !material.envMap || material.isMeshPhongMaterial && !material.envMap;
24598
24598
  const envMap = environments.get(material.envMap || environment, usePMREM);
@@ -24627,8 +24627,8 @@ var MineRender = (() => {
24627
24627
  }
24628
24628
  const currentRenderTarget = renderer.getRenderTarget();
24629
24629
  const reversedDepthBuffer = renderer.state.buffers.depth.getReversed();
24630
- const IS_INSTANCEDMESH = object.isInstancedMesh === true;
24631
- const IS_BATCHEDMESH = object.isBatchedMesh === true;
24630
+ const IS_INSTANCEDMESH = object2.isInstancedMesh === true;
24631
+ const IS_BATCHEDMESH = object2.isBatchedMesh === true;
24632
24632
  const HAS_MAP = !!material.map;
24633
24633
  const HAS_MATCAP = !!material.matcap;
24634
24634
  const HAS_ENVMAP = !!envMap;
@@ -24684,10 +24684,10 @@ var MineRender = (() => {
24684
24684
  glslVersion: material.glslVersion,
24685
24685
  precision,
24686
24686
  batching: IS_BATCHEDMESH,
24687
- batchingColor: IS_BATCHEDMESH && object._colorsTexture !== null,
24687
+ batchingColor: IS_BATCHEDMESH && object2._colorsTexture !== null,
24688
24688
  instancing: IS_INSTANCEDMESH,
24689
- instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
24690
- instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
24689
+ instancingColor: IS_INSTANCEDMESH && object2.instanceColor !== null,
24690
+ instancingMorph: IS_INSTANCEDMESH && object2.morphTexture !== null,
24691
24691
  outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : ColorManagement.workingColorSpace,
24692
24692
  alphaToCoverage: !!material.alphaToCoverage,
24693
24693
  map: HAS_MAP,
@@ -24761,7 +24761,7 @@ var MineRender = (() => {
24761
24761
  vertexNormals: !!geometry.attributes.normal,
24762
24762
  vertexColors: material.vertexColors,
24763
24763
  vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4,
24764
- pointsUvs: object.isPoints === true && !!geometry.attributes.uv && (HAS_MAP || HAS_ALPHAMAP),
24764
+ pointsUvs: object2.isPoints === true && !!geometry.attributes.uv && (HAS_MAP || HAS_ALPHAMAP),
24765
24765
  fog: !!fog,
24766
24766
  useFog: material.fog === true,
24767
24767
  fogExp2: !!fog && fog.isFogExp2,
@@ -24769,7 +24769,7 @@ var MineRender = (() => {
24769
24769
  sizeAttenuation: material.sizeAttenuation === true,
24770
24770
  logarithmicDepthBuffer,
24771
24771
  reversedDepthBuffer,
24772
- skinning: object.isSkinnedMesh === true,
24772
+ skinning: object2.isSkinnedMesh === true,
24773
24773
  hasPositionAttribute: geometry.attributes.position !== void 0,
24774
24774
  morphTargets: geometry.morphAttributes.position !== void 0,
24775
24775
  morphNormals: geometry.morphAttributes.normal !== void 0,
@@ -25044,22 +25044,22 @@ var MineRender = (() => {
25044
25044
  }
25045
25045
  function WebGLProperties() {
25046
25046
  let properties = /* @__PURE__ */ new WeakMap();
25047
- function has(object) {
25048
- return properties.has(object);
25047
+ function has(object2) {
25048
+ return properties.has(object2);
25049
25049
  }
25050
- function get(object) {
25051
- let map = properties.get(object);
25050
+ function get(object2) {
25051
+ let map = properties.get(object2);
25052
25052
  if (map === void 0) {
25053
25053
  map = {};
25054
- properties.set(object, map);
25054
+ properties.set(object2, map);
25055
25055
  }
25056
25056
  return map;
25057
25057
  }
25058
- function remove(object) {
25059
- properties.delete(object);
25058
+ function remove(object2) {
25059
+ properties.delete(object2);
25060
25060
  }
25061
- function update(object, key, value) {
25062
- properties.get(object)[key] = value;
25061
+ function update(object2, key, value) {
25062
+ properties.get(object2)[key] = value;
25063
25063
  }
25064
25064
  function dispose() {
25065
25065
  properties = /* @__PURE__ */ new WeakMap();
@@ -25110,44 +25110,44 @@ var MineRender = (() => {
25110
25110
  transmissive.length = 0;
25111
25111
  transparent.length = 0;
25112
25112
  }
25113
- function materialVariant(object) {
25113
+ function materialVariant(object2) {
25114
25114
  let variant = 0;
25115
- if (object.isInstancedMesh) variant += 2;
25116
- if (object.isSkinnedMesh) variant += 1;
25115
+ if (object2.isInstancedMesh) variant += 2;
25116
+ if (object2.isSkinnedMesh) variant += 1;
25117
25117
  return variant;
25118
25118
  }
25119
- function getNextRenderItem(object, geometry, material, groupOrder, z4, group) {
25119
+ function getNextRenderItem(object2, geometry, material, groupOrder, z4, group) {
25120
25120
  let renderItem = renderItems[renderItemsIndex];
25121
25121
  if (renderItem === void 0) {
25122
25122
  renderItem = {
25123
- id: object.id,
25124
- object,
25123
+ id: object2.id,
25124
+ object: object2,
25125
25125
  geometry,
25126
25126
  material,
25127
- materialVariant: materialVariant(object),
25127
+ materialVariant: materialVariant(object2),
25128
25128
  groupOrder,
25129
- renderOrder: object.renderOrder,
25129
+ renderOrder: object2.renderOrder,
25130
25130
  z: z4,
25131
25131
  group
25132
25132
  };
25133
25133
  renderItems[renderItemsIndex] = renderItem;
25134
25134
  } else {
25135
- renderItem.id = object.id;
25136
- renderItem.object = object;
25135
+ renderItem.id = object2.id;
25136
+ renderItem.object = object2;
25137
25137
  renderItem.geometry = geometry;
25138
25138
  renderItem.material = material;
25139
- renderItem.materialVariant = materialVariant(object);
25139
+ renderItem.materialVariant = materialVariant(object2);
25140
25140
  renderItem.groupOrder = groupOrder;
25141
- renderItem.renderOrder = object.renderOrder;
25141
+ renderItem.renderOrder = object2.renderOrder;
25142
25142
  renderItem.z = z4;
25143
25143
  renderItem.group = group;
25144
25144
  }
25145
25145
  renderItemsIndex++;
25146
25146
  return renderItem;
25147
25147
  }
25148
- function push(object, geometry, material, groupOrder, z4, group, camera) {
25148
+ function push(object2, geometry, material, groupOrder, z4, group, camera) {
25149
25149
  if (camera.reversedDepth === true) z4 = -z4;
25150
- const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z4, group);
25150
+ const renderItem = getNextRenderItem(object2, geometry, material, groupOrder, z4, group);
25151
25151
  if (material.transmission > 0) {
25152
25152
  transmissive.push(renderItem);
25153
25153
  } else if (material.transparent === true) {
@@ -25156,8 +25156,8 @@ var MineRender = (() => {
25156
25156
  opaque.push(renderItem);
25157
25157
  }
25158
25158
  }
25159
- function unshift(object, geometry, material, groupOrder, z4, group) {
25160
- const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z4, group);
25159
+ function unshift(object2, geometry, material, groupOrder, z4, group) {
25160
+ const renderItem = getNextRenderItem(object2, geometry, material, groupOrder, z4, group);
25161
25161
  if (material.transmission > 0) {
25162
25162
  transmissive.unshift(renderItem);
25163
25163
  } else if (material.transparent === true) {
@@ -25760,12 +25760,12 @@ var MineRender = (() => {
25760
25760
  _state.setScissorTest(false);
25761
25761
  const typeChanged = _previousType !== this.type;
25762
25762
  if (typeChanged) {
25763
- scene.traverse(function(object) {
25764
- if (object.material) {
25765
- if (Array.isArray(object.material)) {
25766
- object.material.forEach((mat) => mat.needsUpdate = true);
25763
+ scene.traverse(function(object2) {
25764
+ if (object2.material) {
25765
+ if (Array.isArray(object2.material)) {
25766
+ object2.material.forEach((mat) => mat.needsUpdate = true);
25767
25767
  } else {
25768
- object.material.needsUpdate = true;
25768
+ object2.material.needsUpdate = true;
25769
25769
  }
25770
25770
  }
25771
25771
  });
@@ -25929,9 +25929,9 @@ var MineRender = (() => {
25929
25929
  renderer.clear();
25930
25930
  renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);
25931
25931
  }
25932
- function getDepthMaterial(object, material, light, type) {
25932
+ function getDepthMaterial(object2, material, light, type) {
25933
25933
  let result = null;
25934
- const customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial;
25934
+ const customMaterial = light.isPointLight === true ? object2.customDistanceMaterial : object2.customDepthMaterial;
25935
25935
  if (customMaterial !== void 0) {
25936
25936
  result = customMaterial;
25937
25937
  } else {
@@ -25976,35 +25976,35 @@ var MineRender = (() => {
25976
25976
  }
25977
25977
  return result;
25978
25978
  }
25979
- function renderObject(object, camera, shadowCamera, light, type) {
25980
- if (object.visible === false) return;
25981
- const visible = object.layers.test(camera.layers);
25982
- if (visible && (object.isMesh || object.isLine || object.isPoints)) {
25983
- if ((object.castShadow || object.receiveShadow && type === VSMShadowMap) && (!object.frustumCulled || object.intersectsFrustum(_frustum))) {
25984
- object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object.matrixWorld);
25985
- const geometry = objects.update(object);
25986
- const material = object.material;
25979
+ function renderObject(object2, camera, shadowCamera, light, type) {
25980
+ if (object2.visible === false) return;
25981
+ const visible = object2.layers.test(camera.layers);
25982
+ if (visible && (object2.isMesh || object2.isLine || object2.isPoints)) {
25983
+ if ((object2.castShadow || object2.receiveShadow && type === VSMShadowMap) && (!object2.frustumCulled || object2.intersectsFrustum(_frustum))) {
25984
+ object2.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object2.matrixWorld);
25985
+ const geometry = objects.update(object2);
25986
+ const material = object2.material;
25987
25987
  if (Array.isArray(material)) {
25988
25988
  const groups = geometry.groups;
25989
25989
  for (let k4 = 0, kl = groups.length; k4 < kl; k4++) {
25990
25990
  const group = groups[k4];
25991
25991
  const groupMaterial = material[group.materialIndex];
25992
25992
  if (groupMaterial && groupMaterial.visible) {
25993
- const depthMaterial = getDepthMaterial(object, groupMaterial, light, type);
25994
- object.onBeforeShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, group);
25995
- renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group);
25996
- object.onAfterShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, group);
25993
+ const depthMaterial = getDepthMaterial(object2, groupMaterial, light, type);
25994
+ object2.onBeforeShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, group);
25995
+ renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object2, group);
25996
+ object2.onAfterShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, group);
25997
25997
  }
25998
25998
  }
25999
25999
  } else if (material.visible) {
26000
- const depthMaterial = getDepthMaterial(object, material, light, type);
26001
- object.onBeforeShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, null);
26002
- renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null);
26003
- object.onAfterShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, null);
26000
+ const depthMaterial = getDepthMaterial(object2, material, light, type);
26001
+ object2.onBeforeShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, null);
26002
+ renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object2, null);
26003
+ object2.onAfterShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, null);
26004
26004
  }
26005
26005
  }
26006
26006
  }
26007
- const children = object.children;
26007
+ const children = object2.children;
26008
26008
  for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
26009
26009
  renderObject(children[i4], camera, shadowCamera, light, type);
26010
26010
  }
@@ -28060,12 +28060,12 @@ var MineRender = (() => {
28060
28060
  }
28061
28061
  function verifyColorSpace(texture, image) {
28062
28062
  const colorSpace = texture.colorSpace;
28063
- const format2 = texture.format;
28063
+ const format3 = texture.format;
28064
28064
  const type = texture.type;
28065
28065
  if (texture.isCompressedTexture === true || texture.isVideoTexture === true) return image;
28066
28066
  if (colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace) {
28067
28067
  if (ColorManagement.getTransfer(colorSpace) === SRGBTransfer) {
28068
- if (format2 !== RGBAFormat || type !== UnsignedByteType) {
28068
+ if (format3 !== RGBAFormat || type !== UnsignedByteType) {
28069
28069
  warn("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.");
28070
28070
  }
28071
28071
  } else {
@@ -30096,8 +30096,8 @@ var MineRender = (() => {
30096
30096
  const u4 = this.map[name2];
30097
30097
  if (u4 !== void 0) u4.setValue(gl, value, textures);
30098
30098
  }
30099
- setOptional(gl, object, name2) {
30100
- const v5 = object[name2];
30099
+ setOptional(gl, object2, name2) {
30100
+ const v5 = object2[name2];
30101
30101
  if (v5 !== void 0) this.setValue(gl, name2, v5);
30102
30102
  }
30103
30103
  static upload(gl, seq, values, textures) {
@@ -31798,10 +31798,10 @@ void main() {
31798
31798
  }
31799
31799
  }
31800
31800
  }
31801
- this.renderBufferDirect = function(camera, scene, geometry, material, object, group) {
31801
+ this.renderBufferDirect = function(camera, scene, geometry, material, object2, group) {
31802
31802
  if (scene === null) scene = _emptyScene;
31803
- const frontFaceCW = object.isMesh && object.matrixWorld.determinantAffine() < 0;
31804
- const program = setProgram(camera, scene, geometry, material, object);
31803
+ const frontFaceCW = object2.isMesh && object2.matrixWorld.determinantAffine() < 0;
31804
+ const program = setProgram(camera, scene, geometry, material, object2);
31805
31805
  state.setMaterial(material, frontFaceCW);
31806
31806
  let index = geometry.index;
31807
31807
  let rangeFactor = 1;
@@ -31827,7 +31827,7 @@ void main() {
31827
31827
  }
31828
31828
  const drawCount = drawEnd - drawStart;
31829
31829
  if (drawCount < 0 || drawCount === Infinity) return;
31830
- bindingStates.setup(object, material, program, geometry, index);
31830
+ bindingStates.setup(object2, material, program, geometry, index);
31831
31831
  let attribute;
31832
31832
  let renderer = bufferRenderer;
31833
31833
  if (index !== null) {
@@ -31835,34 +31835,34 @@ void main() {
31835
31835
  renderer = indexedBufferRenderer;
31836
31836
  renderer.setIndex(attribute);
31837
31837
  }
31838
- if (object.isMesh) {
31838
+ if (object2.isMesh) {
31839
31839
  if (material.wireframe === true) {
31840
31840
  state.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio());
31841
31841
  renderer.setMode(_gl.LINES);
31842
31842
  } else {
31843
31843
  renderer.setMode(_gl.TRIANGLES);
31844
31844
  }
31845
- } else if (object.isLine) {
31845
+ } else if (object2.isLine) {
31846
31846
  let lineWidth = material.linewidth;
31847
31847
  if (lineWidth === void 0) lineWidth = 1;
31848
31848
  state.setLineWidth(lineWidth * getTargetPixelRatio());
31849
- if (object.isLineSegments) {
31849
+ if (object2.isLineSegments) {
31850
31850
  renderer.setMode(_gl.LINES);
31851
- } else if (object.isLineLoop) {
31851
+ } else if (object2.isLineLoop) {
31852
31852
  renderer.setMode(_gl.LINE_LOOP);
31853
31853
  } else {
31854
31854
  renderer.setMode(_gl.LINE_STRIP);
31855
31855
  }
31856
- } else if (object.isPoints) {
31856
+ } else if (object2.isPoints) {
31857
31857
  renderer.setMode(_gl.POINTS);
31858
- } else if (object.isSprite) {
31858
+ } else if (object2.isSprite) {
31859
31859
  renderer.setMode(_gl.TRIANGLES);
31860
31860
  }
31861
- if (object.isBatchedMesh) {
31861
+ if (object2.isBatchedMesh) {
31862
31862
  if (!extensions.get("WEBGL_multi_draw")) {
31863
- const starts = object._multiDrawStarts;
31864
- const counts = object._multiDrawCounts;
31865
- const drawCount2 = object._multiDrawCount;
31863
+ const starts = object2._multiDrawStarts;
31864
+ const counts = object2._multiDrawCounts;
31865
+ const drawCount2 = object2._multiDrawCount;
31866
31866
  const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1;
31867
31867
  const uniforms = properties.get(material).currentProgram.getUniforms();
31868
31868
  for (let i4 = 0; i4 < drawCount2; i4++) {
@@ -31870,10 +31870,10 @@ void main() {
31870
31870
  renderer.render(starts[i4] / bytesPerElement, counts[i4]);
31871
31871
  }
31872
31872
  } else {
31873
- renderer.renderMultiDraw(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount);
31873
+ renderer.renderMultiDraw(object2._multiDrawStarts, object2._multiDrawCounts, object2._multiDrawCount);
31874
31874
  }
31875
- } else if (object.isInstancedMesh) {
31876
- renderer.renderInstances(drawStart, drawCount, object.count);
31875
+ } else if (object2.isInstancedMesh) {
31876
+ renderer.renderInstances(drawStart, drawCount, object2.count);
31877
31877
  } else if (geometry.isInstancedBufferGeometry) {
31878
31878
  const maxInstanceCount = geometry._maxInstanceCount !== void 0 ? geometry._maxInstanceCount : Infinity;
31879
31879
  const instanceCount = Math.min(geometry.instanceCount, maxInstanceCount);
@@ -31882,19 +31882,19 @@ void main() {
31882
31882
  renderer.render(drawStart, drawCount);
31883
31883
  }
31884
31884
  };
31885
- function prepareMaterial(material, scene, camera, object) {
31886
- if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(object, material);
31885
+ function prepareMaterial(material, scene, camera, object2) {
31886
+ if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(object2, material);
31887
31887
  if (_clippingEnabled === true) clipping.setState(material, camera, false);
31888
31888
  if (material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false) {
31889
31889
  material.side = BackSide;
31890
31890
  material.needsUpdate = true;
31891
- getProgram(material, scene, object);
31891
+ getProgram(material, scene, object2);
31892
31892
  material.side = FrontSide;
31893
31893
  material.needsUpdate = true;
31894
- getProgram(material, scene, object);
31894
+ getProgram(material, scene, object2);
31895
31895
  material.side = DoubleSide;
31896
31896
  } else {
31897
- getProgram(material, scene, object);
31897
+ getProgram(material, scene, object2);
31898
31898
  }
31899
31899
  }
31900
31900
  this.compile = function(scene, camera, targetScene = null) {
@@ -31903,20 +31903,20 @@ void main() {
31903
31903
  currentRenderState = renderStates.get(targetScene);
31904
31904
  currentRenderState.init(camera);
31905
31905
  renderStateStack.push(currentRenderState);
31906
- targetScene.traverseVisible(function(object) {
31907
- if (object.isLight && object.layers.test(camera.layers)) {
31908
- currentRenderState.pushLight(object);
31909
- if (object.castShadow) {
31910
- currentRenderState.pushShadow(object);
31906
+ targetScene.traverseVisible(function(object2) {
31907
+ if (object2.isLight && object2.layers.test(camera.layers)) {
31908
+ currentRenderState.pushLight(object2);
31909
+ if (object2.castShadow) {
31910
+ currentRenderState.pushShadow(object2);
31911
31911
  }
31912
31912
  }
31913
31913
  });
31914
31914
  if (scene !== targetScene) {
31915
- scene.traverseVisible(function(object) {
31916
- if (object.isLight && object.layers.test(camera.layers)) {
31917
- currentRenderState.pushLight(object);
31918
- if (object.castShadow) {
31919
- currentRenderState.pushShadow(object);
31915
+ scene.traverseVisible(function(object2) {
31916
+ if (object2.isLight && object2.layers.test(camera.layers)) {
31917
+ currentRenderState.pushLight(object2);
31918
+ if (object2.castShadow) {
31919
+ currentRenderState.pushShadow(object2);
31920
31920
  }
31921
31921
  }
31922
31922
  });
@@ -31928,20 +31928,20 @@ void main() {
31928
31928
  if (_clippingEnabled === true) clipping.setGlobalState(this.clippingPlanes, camera);
31929
31929
  if (_nodesHandler !== null) shadowMap.render(currentRenderState.state.shadowsArray, targetScene, camera);
31930
31930
  const materials2 = /* @__PURE__ */ new Set();
31931
- scene.traverse(function(object) {
31932
- if (!(object.isMesh || object.isPoints || object.isLine || object.isSprite)) {
31931
+ scene.traverse(function(object2) {
31932
+ if (!(object2.isMesh || object2.isPoints || object2.isLine || object2.isSprite)) {
31933
31933
  return;
31934
31934
  }
31935
- const material = object.material;
31935
+ const material = object2.material;
31936
31936
  if (material) {
31937
31937
  if (Array.isArray(material)) {
31938
31938
  for (let i4 = 0; i4 < material.length; i4++) {
31939
31939
  const material2 = material[i4];
31940
- prepareMaterial(material2, targetScene, camera, object);
31940
+ prepareMaterial(material2, targetScene, camera, object2);
31941
31941
  materials2.add(material2);
31942
31942
  }
31943
31943
  } else {
31944
- prepareMaterial(material, targetScene, camera, object);
31944
+ prepareMaterial(material, targetScene, camera, object2);
31945
31945
  materials2.add(material);
31946
31946
  }
31947
31947
  }
@@ -32098,45 +32098,45 @@ void main() {
32098
32098
  _nodesHandler.renderEnd();
32099
32099
  }
32100
32100
  };
32101
- function projectObject(object, camera, groupOrder, sortObjects) {
32102
- if (object.visible === false) return;
32103
- const visible = object.layers.test(camera.layers);
32101
+ function projectObject(object2, camera, groupOrder, sortObjects) {
32102
+ if (object2.visible === false) return;
32103
+ const visible = object2.layers.test(camera.layers);
32104
32104
  if (visible) {
32105
- if (object.isGroup) {
32106
- groupOrder = object.renderOrder;
32107
- } else if (object.isLOD) {
32108
- if (object.autoUpdate === true) object.update(camera);
32109
- } else if (object.isLightProbeGrid) {
32110
- currentRenderState.pushLightProbeGrid(object);
32111
- } else if (object.isLight) {
32112
- currentRenderState.pushLight(object);
32113
- if (object.castShadow) {
32114
- currentRenderState.pushShadow(object);
32105
+ if (object2.isGroup) {
32106
+ groupOrder = object2.renderOrder;
32107
+ } else if (object2.isLOD) {
32108
+ if (object2.autoUpdate === true) object2.update(camera);
32109
+ } else if (object2.isLightProbeGrid) {
32110
+ currentRenderState.pushLightProbeGrid(object2);
32111
+ } else if (object2.isLight) {
32112
+ currentRenderState.pushLight(object2);
32113
+ if (object2.castShadow) {
32114
+ currentRenderState.pushShadow(object2);
32115
32115
  }
32116
- } else if (object.isSprite) {
32117
- if (!object.frustumCulled || object.intersectsFrustum(_frustum)) {
32116
+ } else if (object2.isSprite) {
32117
+ if (!object2.frustumCulled || object2.intersectsFrustum(_frustum)) {
32118
32118
  if (sortObjects) {
32119
- _vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix2);
32119
+ _vector4.setFromMatrixPosition(object2.matrixWorld).applyMatrix4(_projScreenMatrix2);
32120
32120
  }
32121
- const geometry = objects.update(object);
32122
- const material = object.material;
32121
+ const geometry = objects.update(object2);
32122
+ const material = object2.material;
32123
32123
  if (material.visible) {
32124
- currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null, camera);
32124
+ currentRenderList.push(object2, geometry, material, groupOrder, _vector4.z, null, camera);
32125
32125
  }
32126
32126
  }
32127
- } else if (object.isMesh || object.isLine || object.isPoints) {
32128
- if (!object.frustumCulled || object.intersectsFrustum(_frustum)) {
32129
- const geometry = objects.update(object);
32130
- const material = object.material;
32127
+ } else if (object2.isMesh || object2.isLine || object2.isPoints) {
32128
+ if (!object2.frustumCulled || object2.intersectsFrustum(_frustum)) {
32129
+ const geometry = objects.update(object2);
32130
+ const material = object2.material;
32131
32131
  if (sortObjects) {
32132
- if (object.boundingSphere !== void 0) {
32133
- if (object.boundingSphere === null) object.computeBoundingSphere();
32134
- _vector4.copy(object.boundingSphere.center);
32132
+ if (object2.boundingSphere !== void 0) {
32133
+ if (object2.boundingSphere === null) object2.computeBoundingSphere();
32134
+ _vector4.copy(object2.boundingSphere.center);
32135
32135
  } else {
32136
32136
  if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
32137
32137
  _vector4.copy(geometry.boundingSphere.center);
32138
32138
  }
32139
- _vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix2);
32139
+ _vector4.applyMatrix4(object2.matrixWorld).applyMatrix4(_projScreenMatrix2);
32140
32140
  }
32141
32141
  if (Array.isArray(material)) {
32142
32142
  const groups = geometry.groups;
@@ -32144,16 +32144,16 @@ void main() {
32144
32144
  const group = groups[i4];
32145
32145
  const groupMaterial = material[group.materialIndex];
32146
32146
  if (groupMaterial && groupMaterial.visible) {
32147
- currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector4.z, group, camera);
32147
+ currentRenderList.push(object2, geometry, groupMaterial, groupOrder, _vector4.z, group, camera);
32148
32148
  }
32149
32149
  }
32150
32150
  } else if (material.visible) {
32151
- currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null, camera);
32151
+ currentRenderList.push(object2, geometry, material, groupOrder, _vector4.z, null, camera);
32152
32152
  }
32153
32153
  }
32154
32154
  }
32155
32155
  }
32156
- const children = object.children;
32156
+ const children = object2.children;
32157
32157
  for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
32158
32158
  projectObject(children[i4], camera, groupOrder, sortObjects);
32159
32159
  }
@@ -32217,12 +32217,12 @@ void main() {
32217
32217
  let renderTargetNeedsUpdate = false;
32218
32218
  for (let i4 = 0, l4 = transmissiveObjects.length; i4 < l4; i4++) {
32219
32219
  const renderItem = transmissiveObjects[i4];
32220
- const { object, geometry, material, group } = renderItem;
32221
- if (material.side === DoubleSide && object.layers.test(camera.layers)) {
32220
+ const { object: object2, geometry, material, group } = renderItem;
32221
+ if (material.side === DoubleSide && object2.layers.test(camera.layers)) {
32222
32222
  const currentSide = material.side;
32223
32223
  material.side = BackSide;
32224
32224
  material.needsUpdate = true;
32225
- renderObject(object, scene, camera, geometry, material, group);
32225
+ renderObject(object2, scene, camera, geometry, material, group);
32226
32226
  material.side = currentSide;
32227
32227
  material.needsUpdate = true;
32228
32228
  renderTargetNeedsUpdate = true;
@@ -32242,42 +32242,42 @@ void main() {
32242
32242
  const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
32243
32243
  for (let i4 = 0, l4 = renderList.length; i4 < l4; i4++) {
32244
32244
  const renderItem = renderList[i4];
32245
- const { object, geometry, group } = renderItem;
32245
+ const { object: object2, geometry, group } = renderItem;
32246
32246
  let material = renderItem.material;
32247
32247
  if (material.allowOverride === true && overrideMaterial !== null) {
32248
32248
  material = overrideMaterial;
32249
32249
  }
32250
- if (object.layers.test(camera.layers)) {
32251
- renderObject(object, scene, camera, geometry, material, group);
32250
+ if (object2.layers.test(camera.layers)) {
32251
+ renderObject(object2, scene, camera, geometry, material, group);
32252
32252
  }
32253
32253
  }
32254
32254
  }
32255
- function renderObject(object, scene, camera, geometry, material, group) {
32256
- if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(object, material);
32257
- object.onBeforeRender(_this, scene, camera, geometry, material, group);
32258
- object.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object.matrixWorld);
32259
- object.normalMatrix.getNormalMatrix(object.modelViewMatrix);
32260
- material.onBeforeRender(_this, scene, camera, geometry, object, group);
32255
+ function renderObject(object2, scene, camera, geometry, material, group) {
32256
+ if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(object2, material);
32257
+ object2.onBeforeRender(_this, scene, camera, geometry, material, group);
32258
+ object2.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object2.matrixWorld);
32259
+ object2.normalMatrix.getNormalMatrix(object2.modelViewMatrix);
32260
+ material.onBeforeRender(_this, scene, camera, geometry, object2, group);
32261
32261
  if (material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false) {
32262
32262
  material.side = BackSide;
32263
32263
  material.needsUpdate = true;
32264
- _this.renderBufferDirect(camera, scene, geometry, material, object, group);
32264
+ _this.renderBufferDirect(camera, scene, geometry, material, object2, group);
32265
32265
  material.side = FrontSide;
32266
32266
  material.needsUpdate = true;
32267
- _this.renderBufferDirect(camera, scene, geometry, material, object, group);
32267
+ _this.renderBufferDirect(camera, scene, geometry, material, object2, group);
32268
32268
  material.side = DoubleSide;
32269
32269
  } else {
32270
- _this.renderBufferDirect(camera, scene, geometry, material, object, group);
32270
+ _this.renderBufferDirect(camera, scene, geometry, material, object2, group);
32271
32271
  }
32272
- object.onAfterRender(_this, scene, camera, geometry, material, group);
32272
+ object2.onAfterRender(_this, scene, camera, geometry, material, group);
32273
32273
  }
32274
- function getProgram(material, scene, object) {
32274
+ function getProgram(material, scene, object2) {
32275
32275
  if (scene.isScene !== true) scene = _emptyScene;
32276
32276
  const materialProperties = properties.get(material);
32277
32277
  const lights = currentRenderState.state.lights;
32278
32278
  const shadowsArray = currentRenderState.state.shadowsArray;
32279
32279
  const lightsStateVersion = lights.state.version;
32280
- const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object, currentRenderState.state.lightProbeGridArray);
32280
+ const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object2, currentRenderState.state.lightProbeGridArray);
32281
32281
  const programCacheKey = programCache.getProgramCacheKey(parameters2);
32282
32282
  let programs = materialProperties.programs;
32283
32283
  materialProperties.environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
@@ -32299,7 +32299,7 @@ void main() {
32299
32299
  } else {
32300
32300
  parameters2.uniforms = programCache.getUniforms(material);
32301
32301
  if (_nodesHandler !== null && material.isNodeMaterial) {
32302
- _nodesHandler.build(material, object, parameters2);
32302
+ _nodesHandler.build(material, object2, parameters2);
32303
32303
  }
32304
32304
  material.onBeforeCompile(parameters2, _this);
32305
32305
  program = programCache.acquireProgram(parameters2, programCacheKey);
@@ -32366,19 +32366,19 @@ void main() {
32366
32366
  materialProperties.vertexTangents = parameters2.vertexTangents;
32367
32367
  materialProperties.toneMapping = parameters2.toneMapping;
32368
32368
  }
32369
- function findLightProbeGrid(volumes, object) {
32369
+ function findLightProbeGrid(volumes, object2) {
32370
32370
  if (volumes.length === 0) return null;
32371
32371
  if (volumes.length === 1) {
32372
32372
  return volumes[0].texture !== null ? volumes[0] : null;
32373
32373
  }
32374
- objectPosition.setFromMatrixPosition(object.matrixWorld);
32374
+ objectPosition.setFromMatrixPosition(object2.matrixWorld);
32375
32375
  for (let i4 = 0, l4 = volumes.length; i4 < l4; i4++) {
32376
32376
  const v5 = volumes[i4];
32377
32377
  if (v5.texture !== null && v5.boundingBox.containsPoint(objectPosition)) return v5;
32378
32378
  }
32379
32379
  return null;
32380
32380
  }
32381
- function setProgram(camera, scene, geometry, material, object) {
32381
+ function setProgram(camera, scene, geometry, material, object2) {
32382
32382
  if (scene.isScene !== true) scene = _emptyScene;
32383
32383
  textures.resetTextureUnits();
32384
32384
  const fog = scene.fog;
@@ -32413,29 +32413,29 @@ void main() {
32413
32413
  needsProgramChange = true;
32414
32414
  } else if (materialProperties.outputColorSpace !== colorSpace) {
32415
32415
  needsProgramChange = true;
32416
- } else if (object.isBatchedMesh && materialProperties.batching === false) {
32416
+ } else if (object2.isBatchedMesh && materialProperties.batching === false) {
32417
32417
  needsProgramChange = true;
32418
- } else if (!object.isBatchedMesh && materialProperties.batching === true) {
32418
+ } else if (!object2.isBatchedMesh && materialProperties.batching === true) {
32419
32419
  needsProgramChange = true;
32420
- } else if (object.isBatchedMesh && materialProperties.batchingColor === true && object._colorsTexture === null) {
32420
+ } else if (object2.isBatchedMesh && materialProperties.batchingColor === true && object2._colorsTexture === null) {
32421
32421
  needsProgramChange = true;
32422
- } else if (object.isBatchedMesh && materialProperties.batchingColor === false && object._colorsTexture !== null) {
32422
+ } else if (object2.isBatchedMesh && materialProperties.batchingColor === false && object2._colorsTexture !== null) {
32423
32423
  needsProgramChange = true;
32424
- } else if (object.isInstancedMesh && materialProperties.instancing === false) {
32424
+ } else if (object2.isInstancedMesh && materialProperties.instancing === false) {
32425
32425
  needsProgramChange = true;
32426
- } else if (!object.isInstancedMesh && materialProperties.instancing === true) {
32426
+ } else if (!object2.isInstancedMesh && materialProperties.instancing === true) {
32427
32427
  needsProgramChange = true;
32428
- } else if (object.isSkinnedMesh && materialProperties.skinning === false) {
32428
+ } else if (object2.isSkinnedMesh && materialProperties.skinning === false) {
32429
32429
  needsProgramChange = true;
32430
- } else if (!object.isSkinnedMesh && materialProperties.skinning === true) {
32430
+ } else if (!object2.isSkinnedMesh && materialProperties.skinning === true) {
32431
32431
  needsProgramChange = true;
32432
- } else if (object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null) {
32432
+ } else if (object2.isInstancedMesh && materialProperties.instancingColor === true && object2.instanceColor === null) {
32433
32433
  needsProgramChange = true;
32434
- } else if (object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null) {
32434
+ } else if (object2.isInstancedMesh && materialProperties.instancingColor === false && object2.instanceColor !== null) {
32435
32435
  needsProgramChange = true;
32436
- } else if (object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null) {
32436
+ } else if (object2.isInstancedMesh && materialProperties.instancingMorph === true && object2.morphTexture === null) {
32437
32437
  needsProgramChange = true;
32438
- } else if (object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null) {
32438
+ } else if (object2.isInstancedMesh && materialProperties.instancingMorph === false && object2.morphTexture !== null) {
32439
32439
  needsProgramChange = true;
32440
32440
  } else if (materialProperties.envMap !== envMap) {
32441
32441
  needsProgramChange = true;
@@ -32466,7 +32466,7 @@ void main() {
32466
32466
  }
32467
32467
  let program = materialProperties.currentProgram;
32468
32468
  if (needsProgramChange === true) {
32469
- program = getProgram(material, scene, object);
32469
+ program = getProgram(material, scene, object2);
32470
32470
  if (_nodesHandler && material.isNodeMaterial) {
32471
32471
  _nodesHandler.onUpdateProgram(material, program, materialProperties);
32472
32472
  }
@@ -32485,7 +32485,7 @@ void main() {
32485
32485
  refreshMaterial = true;
32486
32486
  }
32487
32487
  if (materialProperties.needsLights) {
32488
- const objectVolume = findLightProbeGrid(currentRenderState.state.lightProbeGridArray, object);
32488
+ const objectVolume = findLightProbeGrid(currentRenderState.state.lightProbeGridArray, object2);
32489
32489
  if (materialProperties.lightProbeGrid !== objectVolume) {
32490
32490
  materialProperties.lightProbeGrid = objectVolume;
32491
32491
  refreshMaterial = true;
@@ -32533,32 +32533,32 @@ void main() {
32533
32533
  p_uniforms.setValue(_gl, "pointShadowMap", lights.state.pointShadowMap, textures);
32534
32534
  }
32535
32535
  }
32536
- if (object.isSkinnedMesh) {
32537
- p_uniforms.setOptional(_gl, object, "bindMatrix");
32538
- p_uniforms.setOptional(_gl, object, "bindMatrixInverse");
32539
- const skeleton = object.skeleton;
32536
+ if (object2.isSkinnedMesh) {
32537
+ p_uniforms.setOptional(_gl, object2, "bindMatrix");
32538
+ p_uniforms.setOptional(_gl, object2, "bindMatrixInverse");
32539
+ const skeleton = object2.skeleton;
32540
32540
  if (skeleton) {
32541
32541
  if (skeleton.boneTexture === null) skeleton.computeBoneTexture();
32542
32542
  p_uniforms.setValue(_gl, "boneTexture", skeleton.boneTexture, textures);
32543
32543
  }
32544
32544
  }
32545
- if (object.isBatchedMesh) {
32546
- p_uniforms.setOptional(_gl, object, "batchingTexture");
32547
- p_uniforms.setValue(_gl, "batchingTexture", object._matricesTexture, textures);
32548
- p_uniforms.setOptional(_gl, object, "batchingIdTexture");
32549
- p_uniforms.setValue(_gl, "batchingIdTexture", object._indirectTexture, textures);
32550
- p_uniforms.setOptional(_gl, object, "batchingColorTexture");
32551
- if (object._colorsTexture !== null) {
32552
- p_uniforms.setValue(_gl, "batchingColorTexture", object._colorsTexture, textures);
32545
+ if (object2.isBatchedMesh) {
32546
+ p_uniforms.setOptional(_gl, object2, "batchingTexture");
32547
+ p_uniforms.setValue(_gl, "batchingTexture", object2._matricesTexture, textures);
32548
+ p_uniforms.setOptional(_gl, object2, "batchingIdTexture");
32549
+ p_uniforms.setValue(_gl, "batchingIdTexture", object2._indirectTexture, textures);
32550
+ p_uniforms.setOptional(_gl, object2, "batchingColorTexture");
32551
+ if (object2._colorsTexture !== null) {
32552
+ p_uniforms.setValue(_gl, "batchingColorTexture", object2._colorsTexture, textures);
32553
32553
  }
32554
32554
  }
32555
32555
  const morphAttributes = geometry.morphAttributes;
32556
32556
  if (morphAttributes.position !== void 0 || morphAttributes.normal !== void 0 || morphAttributes.color !== void 0) {
32557
- morphtargets.update(object, geometry, program);
32557
+ morphtargets.update(object2, geometry, program);
32558
32558
  }
32559
- if (refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow) {
32560
- materialProperties.receiveShadow = object.receiveShadow;
32561
- p_uniforms.setValue(_gl, "receiveShadow", object.receiveShadow);
32559
+ if (refreshMaterial || materialProperties.receiveShadow !== object2.receiveShadow) {
32560
+ materialProperties.receiveShadow = object2.receiveShadow;
32561
+ p_uniforms.setValue(_gl, "receiveShadow", object2.receiveShadow);
32562
32562
  }
32563
32563
  if ((material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial) && material.envMap === null && scene.environment !== null) {
32564
32564
  m_uniforms.envMapIntensity.value = scene.environmentIntensity;
@@ -32589,11 +32589,11 @@ void main() {
32589
32589
  material.uniformsNeedUpdate = false;
32590
32590
  }
32591
32591
  if (material.isSpriteMaterial) {
32592
- p_uniforms.setValue(_gl, "center", object.center);
32592
+ p_uniforms.setValue(_gl, "center", object2.center);
32593
32593
  }
32594
- p_uniforms.setValue(_gl, "modelViewMatrix", object.modelViewMatrix);
32595
- p_uniforms.setValue(_gl, "normalMatrix", object.normalMatrix);
32596
- p_uniforms.setValue(_gl, "modelMatrix", object.matrixWorld);
32594
+ p_uniforms.setValue(_gl, "modelViewMatrix", object2.modelViewMatrix);
32595
+ p_uniforms.setValue(_gl, "normalMatrix", object2.normalMatrix);
32596
+ p_uniforms.setValue(_gl, "modelMatrix", object2.matrixWorld);
32597
32597
  if (material.uniformsGroups !== void 0) {
32598
32598
  const groups = material.uniformsGroups;
32599
32599
  for (let i4 = 0, l4 = groups.length; i4 < l4; i4++) {
@@ -36694,9 +36694,9 @@ void main() {
36694
36694
  *
36695
36695
  * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
36696
36696
  */
36697
- _parse: function(ciphertext, format2) {
36697
+ _parse: function(ciphertext, format3) {
36698
36698
  if (typeof ciphertext == "string") {
36699
- return format2.parse(ciphertext, this);
36699
+ return format3.parse(ciphertext, this);
36700
36700
  } else {
36701
36701
  return ciphertext;
36702
36702
  }
@@ -42301,7 +42301,7 @@ void main() {
42301
42301
  static createTexture() {
42302
42302
  return new Texture();
42303
42303
  }
42304
- static loadInBackground(src, format2 = RGBAFormat, rotation = 0) {
42304
+ static loadInBackground(src, format3 = RGBAFormat, rotation = 0) {
42305
42305
  const texture = this.createTexture();
42306
42306
  texture.colorSpace = SRGBColorSpace;
42307
42307
  const image = ImageLoader2.loadElement(src, () => {
@@ -42311,11 +42311,11 @@ void main() {
42311
42311
  console.warn("Failed to load texture", src, error2);
42312
42312
  });
42313
42313
  texture.image = image;
42314
- texture.format = format2;
42314
+ texture.format = format3;
42315
42315
  texture.rotation = rotation;
42316
42316
  return Textures.initTextureProps(texture);
42317
42317
  }
42318
- static load(src, format2 = RGBAFormat, rotation = 0) {
42318
+ static load(src, format3 = RGBAFormat, rotation = 0) {
42319
42319
  const texture = new Texture();
42320
42320
  texture.colorSpace = SRGBColorSpace;
42321
42321
  ImageLoader2.getData(src).then((image) => {
@@ -42325,7 +42325,7 @@ void main() {
42325
42325
  this.failedTextures.add(texture);
42326
42326
  console.warn("Failed to load texture", src, error2);
42327
42327
  });
42328
- texture.format = format2;
42328
+ texture.format = format3;
42329
42329
  texture.rotation = rotation;
42330
42330
  return Textures.initTextureProps(texture);
42331
42331
  }
@@ -42539,7 +42539,7 @@ void main() {
42539
42539
  };
42540
42540
  return material;
42541
42541
  }
42542
- static createShadedCanvasMaterial(canvas, transparent = false, shade = false) {
42542
+ static createShadedCanvasMaterial(canvas, transparent = false, shade = false, boundUvs = false) {
42543
42543
  const vertShader = `
42544
42544
  uniform bool SHADE;
42545
42545
 
@@ -42549,6 +42549,10 @@ void main() {
42549
42549
  #else
42550
42550
  varying vec2 vUv;
42551
42551
  #endif
42552
+ #ifdef BOUND_UVS
42553
+ attribute vec4 uvBounds;
42554
+ flat out vec4 vUvBounds;
42555
+ #endif
42552
42556
  varying vec3 vTint;
42553
42557
  varying float light;
42554
42558
  varying float lift;
@@ -42584,13 +42588,17 @@ void main() {
42584
42588
  }
42585
42589
 
42586
42590
  vUv = uv;
42591
+ #ifdef BOUND_UVS
42592
+ vUvBounds = uvBounds;
42593
+ #endif
42587
42594
  vTint = color;
42588
42595
 
42596
+ vec4 mvPosition = vec4(position, 1.0);
42589
42597
  #ifdef USE_INSTANCING
42590
- gl_Position = projectionMatrix * viewMatrix * modelMatrix * instanceMatrix * vec4(position, 1.0);
42591
- #else
42592
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
42598
+ mvPosition = instanceMatrix * mvPosition;
42593
42599
  #endif
42600
+ mvPosition = modelViewMatrix * mvPosition;
42601
+ gl_Position = projectionMatrix * mvPosition;
42594
42602
 
42595
42603
  }
42596
42604
  `;
@@ -42610,13 +42618,22 @@ void main() {
42610
42618
  #else
42611
42619
  varying vec2 vUv;
42612
42620
  #endif
42621
+ #ifdef BOUND_UVS
42622
+ flat in vec4 vUvBounds;
42623
+ #endif
42613
42624
  varying vec3 vTint;
42614
42625
  varying float light;
42615
42626
  varying float lift;
42616
42627
 
42617
42628
  void main(void)
42618
42629
  {
42619
- vec4 color = texture2D(map, vUv);
42630
+ #ifdef BOUND_UVS
42631
+ // Keep edge samples inside their texture even without centroid interpolation.
42632
+ vec2 mapUv = clamp(vUv, vUvBounds.xy, vUvBounds.zw);
42633
+ #else
42634
+ vec2 mapUv = vUv;
42635
+ #endif
42636
+ vec4 color = texture2D(map, mapUv);
42620
42637
  color.rgb *= vTint;
42621
42638
 
42622
42639
  if (color.a < 0.01) discard;
@@ -42637,7 +42654,8 @@ void main() {
42637
42654
  }
42638
42655
  `;
42639
42656
  try {
42640
- return new ShaderMaterial({
42657
+ const material = new ShaderMaterial({
42658
+ defines: boundUvs ? { BOUND_UVS: true } : {},
42641
42659
  uniforms: {
42642
42660
  SHADE: { value: true },
42643
42661
  BRIGHTNESS: { value: 1 },
@@ -42655,6 +42673,8 @@ void main() {
42655
42673
  side: transparent ? DoubleSide : FrontSide,
42656
42674
  alphaTest: 0.5
42657
42675
  });
42676
+ Object.assign(material.defaultAttributeValues, { uvBounds: [0, 0, 1, 1] });
42677
+ return material;
42658
42678
  } catch (e6) {
42659
42679
  console.warn(e6);
42660
42680
  }
@@ -43294,6 +43314,10 @@ void main() {
43294
43314
  AssetSource = class {
43295
43315
  constructor() {
43296
43316
  }
43317
+ /** Whether this source prevents lower-priority sources from supplying the key. Its own assets remain available. */
43318
+ blocks(key) {
43319
+ return false;
43320
+ }
43297
43321
  /**
43298
43322
  * Identifies this source's content across sessions for persistent caching. Sources that
43299
43323
  * cannot tell whether their content changed (an unnamed archive, for example) return
@@ -45328,7 +45352,7 @@ void main() {
45328
45352
  Buffer2.isBuffer = function isBuffer2(b4) {
45329
45353
  return b4 != null && b4._isBuffer === true && b4 !== Buffer2.prototype;
45330
45354
  };
45331
- Buffer2.compare = function compare(a4, b4) {
45355
+ Buffer2.compare = function compare2(a4, b4) {
45332
45356
  if (isInstance(a4, Uint8Array)) a4 = Buffer2.from(a4, a4.offset, a4.byteLength);
45333
45357
  if (isInstance(b4, Uint8Array)) b4 = Buffer2.from(b4, b4.offset, b4.byteLength);
45334
45358
  if (!Buffer2.isBuffer(a4) || !Buffer2.isBuffer(b4)) {
@@ -45550,7 +45574,7 @@ void main() {
45550
45574
  if (customInspectSymbol) {
45551
45575
  Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
45552
45576
  }
45553
- Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
45577
+ Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) {
45554
45578
  if (isInstance(target, Uint8Array)) {
45555
45579
  target = Buffer2.from(target, target.offset, target.byteLength);
45556
45580
  }
@@ -46691,12 +46715,12 @@ void main() {
46691
46715
  function dew$d() {
46692
46716
  if (_dewExec$d) return exports$d;
46693
46717
  _dewExec$d = true;
46694
- function ownKeys(object, enumerableOnly) {
46695
- var keys = Object.keys(object);
46718
+ function ownKeys(object2, enumerableOnly) {
46719
+ var keys = Object.keys(object2);
46696
46720
  if (Object.getOwnPropertySymbols) {
46697
- var symbols = Object.getOwnPropertySymbols(object);
46721
+ var symbols = Object.getOwnPropertySymbols(object2);
46698
46722
  if (enumerableOnly) symbols = symbols.filter(function(sym) {
46699
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
46723
+ return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
46700
46724
  });
46701
46725
  keys.push.apply(keys, symbols);
46702
46726
  }
@@ -47262,15 +47286,15 @@ void main() {
47262
47286
  if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
47263
47287
  realHasInstance = Function.prototype[Symbol.hasInstance];
47264
47288
  Object.defineProperty(Writable, Symbol.hasInstance, {
47265
- value: function value(object) {
47266
- if (realHasInstance.call(this, object)) return true;
47289
+ value: function value(object2) {
47290
+ if (realHasInstance.call(this, object2)) return true;
47267
47291
  if (this !== Writable) return false;
47268
- return object && object._writableState instanceof WritableState;
47292
+ return object2 && object2._writableState instanceof WritableState;
47269
47293
  }
47270
47294
  });
47271
47295
  } else {
47272
- realHasInstance = function realHasInstance2(object) {
47273
- return object instanceof this;
47296
+ realHasInstance = function realHasInstance2(object2) {
47297
+ return object2 instanceof this;
47274
47298
  };
47275
47299
  }
47276
47300
  function Writable(options) {
@@ -55765,8 +55789,8 @@ void main() {
55765
55789
  return false;
55766
55790
  }
55767
55791
  function baseProperty(key) {
55768
- return function(object) {
55769
- return object == null ? void 0 : object[key];
55792
+ return function(object2) {
55793
+ return object2 == null ? void 0 : object2[key];
55770
55794
  };
55771
55795
  }
55772
55796
  function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
@@ -55787,8 +55811,8 @@ void main() {
55787
55811
  return func(value);
55788
55812
  };
55789
55813
  }
55790
- function getValue(object, key) {
55791
- return object == null ? void 0 : object[key];
55814
+ function getValue(object2, key) {
55815
+ return object2 == null ? void 0 : object2[key];
55792
55816
  }
55793
55817
  function isHostObject(value) {
55794
55818
  var result = false;
@@ -56036,22 +56060,22 @@ void main() {
56036
56060
  }
56037
56061
  var baseEach = createBaseEach(baseForOwn);
56038
56062
  var baseFor = createBaseFor();
56039
- function baseForOwn(object, iteratee) {
56040
- return object && baseFor(object, iteratee, keys);
56063
+ function baseForOwn(object2, iteratee) {
56064
+ return object2 && baseFor(object2, iteratee, keys);
56041
56065
  }
56042
- function baseGet(object, path) {
56043
- path = isKey(path, object) ? [path] : castPath(path);
56066
+ function baseGet(object2, path) {
56067
+ path = isKey(path, object2) ? [path] : castPath(path);
56044
56068
  var index = 0, length = path.length;
56045
- while (object != null && index < length) {
56046
- object = object[toKey(path[index++])];
56069
+ while (object2 != null && index < length) {
56070
+ object2 = object2[toKey(path[index++])];
56047
56071
  }
56048
- return index && index == length ? object : void 0;
56072
+ return index && index == length ? object2 : void 0;
56049
56073
  }
56050
56074
  function baseGetTag(value) {
56051
56075
  return objectToString.call(value);
56052
56076
  }
56053
- function baseHasIn(object, key) {
56054
- return object != null && key in Object(object);
56077
+ function baseHasIn(object2, key) {
56078
+ return object2 != null && key in Object(object2);
56055
56079
  }
56056
56080
  function baseIsEqual(value, other, customizer, bitmask, stack) {
56057
56081
  if (value === other) {
@@ -56062,25 +56086,25 @@ void main() {
56062
56086
  }
56063
56087
  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
56064
56088
  }
56065
- function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
56066
- var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = arrayTag, othTag = arrayTag;
56089
+ function baseIsEqualDeep(object2, other, equalFunc, customizer, bitmask, stack) {
56090
+ var objIsArr = isArray2(object2), othIsArr = isArray2(other), objTag = arrayTag, othTag = arrayTag;
56067
56091
  if (!objIsArr) {
56068
- objTag = getTag(object);
56092
+ objTag = getTag(object2);
56069
56093
  objTag = objTag == argsTag ? objectTag : objTag;
56070
56094
  }
56071
56095
  if (!othIsArr) {
56072
56096
  othTag = getTag(other);
56073
56097
  othTag = othTag == argsTag ? objectTag : othTag;
56074
56098
  }
56075
- var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
56099
+ var objIsObj = objTag == objectTag && !isHostObject(object2), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
56076
56100
  if (isSameTag && !objIsObj) {
56077
56101
  stack || (stack = new Stack());
56078
- return objIsArr || isTypedArray2(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
56102
+ return objIsArr || isTypedArray2(object2) ? equalArrays(object2, other, equalFunc, customizer, bitmask, stack) : equalByTag(object2, other, objTag, equalFunc, customizer, bitmask, stack);
56079
56103
  }
56080
56104
  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
56081
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
56105
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
56082
56106
  if (objIsWrapped || othIsWrapped) {
56083
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
56107
+ var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
56084
56108
  stack || (stack = new Stack());
56085
56109
  return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
56086
56110
  }
@@ -56089,31 +56113,31 @@ void main() {
56089
56113
  return false;
56090
56114
  }
56091
56115
  stack || (stack = new Stack());
56092
- return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
56116
+ return equalObjects(object2, other, equalFunc, customizer, bitmask, stack);
56093
56117
  }
56094
- function baseIsMatch(object, source, matchData, customizer) {
56118
+ function baseIsMatch(object2, source, matchData, customizer) {
56095
56119
  var index = matchData.length, length = index, noCustomizer = !customizer;
56096
- if (object == null) {
56120
+ if (object2 == null) {
56097
56121
  return !length;
56098
56122
  }
56099
- object = Object(object);
56123
+ object2 = Object(object2);
56100
56124
  while (index--) {
56101
56125
  var data = matchData[index];
56102
- if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
56126
+ if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) {
56103
56127
  return false;
56104
56128
  }
56105
56129
  }
56106
56130
  while (++index < length) {
56107
56131
  data = matchData[index];
56108
- var key = data[0], objValue = object[key], srcValue = data[1];
56132
+ var key = data[0], objValue = object2[key], srcValue = data[1];
56109
56133
  if (noCustomizer && data[2]) {
56110
- if (objValue === void 0 && !(key in object)) {
56134
+ if (objValue === void 0 && !(key in object2)) {
56111
56135
  return false;
56112
56136
  }
56113
56137
  } else {
56114
56138
  var stack = new Stack();
56115
56139
  if (customizer) {
56116
- var result = customizer(objValue, srcValue, key, object, source, stack);
56140
+ var result = customizer(objValue, srcValue, key, object2, source, stack);
56117
56141
  }
56118
56142
  if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
56119
56143
  return false;
@@ -56126,8 +56150,8 @@ void main() {
56126
56150
  if (!isObject2(value) || isMasked(value)) {
56127
56151
  return false;
56128
56152
  }
56129
- var pattern = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
56130
- return pattern.test(toSource(value));
56153
+ var pattern2 = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
56154
+ return pattern2.test(toSource(value));
56131
56155
  }
56132
56156
  function baseIsTypedArray(value) {
56133
56157
  return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
@@ -56144,13 +56168,13 @@ void main() {
56144
56168
  }
56145
56169
  return property(value);
56146
56170
  }
56147
- function baseKeys(object) {
56148
- if (!isPrototype(object)) {
56149
- return nativeKeys(object);
56171
+ function baseKeys(object2) {
56172
+ if (!isPrototype(object2)) {
56173
+ return nativeKeys(object2);
56150
56174
  }
56151
56175
  var result = [];
56152
- for (var key in Object(object)) {
56153
- if (hasOwnProperty.call(object, key) && key != "constructor") {
56176
+ for (var key in Object(object2)) {
56177
+ if (hasOwnProperty.call(object2, key) && key != "constructor") {
56154
56178
  result.push(key);
56155
56179
  }
56156
56180
  }
@@ -56161,22 +56185,22 @@ void main() {
56161
56185
  if (matchData.length == 1 && matchData[0][2]) {
56162
56186
  return matchesStrictComparable(matchData[0][0], matchData[0][1]);
56163
56187
  }
56164
- return function(object) {
56165
- return object === source || baseIsMatch(object, source, matchData);
56188
+ return function(object2) {
56189
+ return object2 === source || baseIsMatch(object2, source, matchData);
56166
56190
  };
56167
56191
  }
56168
56192
  function baseMatchesProperty(path, srcValue) {
56169
56193
  if (isKey(path) && isStrictComparable(srcValue)) {
56170
56194
  return matchesStrictComparable(toKey(path), srcValue);
56171
56195
  }
56172
- return function(object) {
56173
- var objValue = get(object, path);
56174
- return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
56196
+ return function(object2) {
56197
+ var objValue = get(object2, path);
56198
+ return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
56175
56199
  };
56176
56200
  }
56177
56201
  function basePropertyDeep(path) {
56178
- return function(object) {
56179
- return baseGet(object, path);
56202
+ return function(object2) {
56203
+ return baseGet(object2, path);
56180
56204
  };
56181
56205
  }
56182
56206
  function baseToString(value) {
@@ -56210,15 +56234,15 @@ void main() {
56210
56234
  };
56211
56235
  }
56212
56236
  function createBaseFor(fromRight) {
56213
- return function(object, iteratee, keysFunc) {
56214
- var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
56237
+ return function(object2, iteratee, keysFunc) {
56238
+ var index = -1, iterable = Object(object2), props = keysFunc(object2), length = props.length;
56215
56239
  while (length--) {
56216
56240
  var key = props[fromRight ? length : ++index];
56217
56241
  if (iteratee(iterable[key], key, iterable) === false) {
56218
56242
  break;
56219
56243
  }
56220
56244
  }
56221
- return object;
56245
+ return object2;
56222
56246
  };
56223
56247
  }
56224
56248
  function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
@@ -56263,54 +56287,54 @@ void main() {
56263
56287
  stack["delete"](other);
56264
56288
  return result;
56265
56289
  }
56266
- function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
56290
+ function equalByTag(object2, other, tag, equalFunc, customizer, bitmask, stack) {
56267
56291
  switch (tag) {
56268
56292
  case dataViewTag:
56269
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
56293
+ if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
56270
56294
  return false;
56271
56295
  }
56272
- object = object.buffer;
56296
+ object2 = object2.buffer;
56273
56297
  other = other.buffer;
56274
56298
  case arrayBufferTag:
56275
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
56299
+ if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
56276
56300
  return false;
56277
56301
  }
56278
56302
  return true;
56279
56303
  case boolTag:
56280
56304
  case dateTag:
56281
56305
  case numberTag:
56282
- return eq(+object, +other);
56306
+ return eq(+object2, +other);
56283
56307
  case errorTag:
56284
- return object.name == other.name && object.message == other.message;
56308
+ return object2.name == other.name && object2.message == other.message;
56285
56309
  case regexpTag:
56286
56310
  case stringTag:
56287
- return object == other + "";
56311
+ return object2 == other + "";
56288
56312
  case mapTag:
56289
56313
  var convert = mapToArray;
56290
56314
  case setTag:
56291
56315
  var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
56292
56316
  convert || (convert = setToArray);
56293
- if (object.size != other.size && !isPartial) {
56317
+ if (object2.size != other.size && !isPartial) {
56294
56318
  return false;
56295
56319
  }
56296
- var stacked = stack.get(object);
56320
+ var stacked = stack.get(object2);
56297
56321
  if (stacked) {
56298
56322
  return stacked == other;
56299
56323
  }
56300
56324
  bitmask |= UNORDERED_COMPARE_FLAG;
56301
- stack.set(object, other);
56302
- var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
56303
- stack["delete"](object);
56325
+ stack.set(object2, other);
56326
+ var result = equalArrays(convert(object2), convert(other), equalFunc, customizer, bitmask, stack);
56327
+ stack["delete"](object2);
56304
56328
  return result;
56305
56329
  case symbolTag:
56306
56330
  if (symbolValueOf) {
56307
- return symbolValueOf.call(object) == symbolValueOf.call(other);
56331
+ return symbolValueOf.call(object2) == symbolValueOf.call(other);
56308
56332
  }
56309
56333
  }
56310
56334
  return false;
56311
56335
  }
56312
- function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
56313
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
56336
+ function equalObjects(object2, other, equalFunc, customizer, bitmask, stack) {
56337
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object2), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
56314
56338
  if (objLength != othLength && !isPartial) {
56315
56339
  return false;
56316
56340
  }
@@ -56321,19 +56345,19 @@ void main() {
56321
56345
  return false;
56322
56346
  }
56323
56347
  }
56324
- var stacked = stack.get(object);
56348
+ var stacked = stack.get(object2);
56325
56349
  if (stacked && stack.get(other)) {
56326
56350
  return stacked == other;
56327
56351
  }
56328
56352
  var result = true;
56329
- stack.set(object, other);
56330
- stack.set(other, object);
56353
+ stack.set(object2, other);
56354
+ stack.set(other, object2);
56331
56355
  var skipCtor = isPartial;
56332
56356
  while (++index < objLength) {
56333
56357
  key = objProps[index];
56334
- var objValue = object[key], othValue = other[key];
56358
+ var objValue = object2[key], othValue = other[key];
56335
56359
  if (customizer) {
56336
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
56360
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack);
56337
56361
  }
56338
56362
  if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
56339
56363
  result = false;
@@ -56342,12 +56366,12 @@ void main() {
56342
56366
  skipCtor || (skipCtor = key == "constructor");
56343
56367
  }
56344
56368
  if (result && !skipCtor) {
56345
- var objCtor = object.constructor, othCtor = other.constructor;
56346
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
56369
+ var objCtor = object2.constructor, othCtor = other.constructor;
56370
+ if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
56347
56371
  result = false;
56348
56372
  }
56349
56373
  }
56350
- stack["delete"](object);
56374
+ stack["delete"](object2);
56351
56375
  stack["delete"](other);
56352
56376
  return result;
56353
56377
  }
@@ -56355,16 +56379,16 @@ void main() {
56355
56379
  var data = map.__data__;
56356
56380
  return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
56357
56381
  }
56358
- function getMatchData(object) {
56359
- var result = keys(object), length = result.length;
56382
+ function getMatchData(object2) {
56383
+ var result = keys(object2), length = result.length;
56360
56384
  while (length--) {
56361
- var key = result[length], value = object[key];
56385
+ var key = result[length], value = object2[key];
56362
56386
  result[length] = [key, value, isStrictComparable(value)];
56363
56387
  }
56364
56388
  return result;
56365
56389
  }
56366
- function getNative(object, key) {
56367
- var value = getValue(object, key);
56390
+ function getNative(object2, key) {
56391
+ var value = getValue(object2, key);
56368
56392
  return baseIsNative(value) ? value : void 0;
56369
56393
  }
56370
56394
  var getTag = baseGetTag;
@@ -56388,27 +56412,27 @@ void main() {
56388
56412
  return result;
56389
56413
  };
56390
56414
  }
56391
- function hasPath(object, path, hasFunc) {
56392
- path = isKey(path, object) ? [path] : castPath(path);
56415
+ function hasPath(object2, path, hasFunc) {
56416
+ path = isKey(path, object2) ? [path] : castPath(path);
56393
56417
  var result, index = -1, length = path.length;
56394
56418
  while (++index < length) {
56395
56419
  var key = toKey(path[index]);
56396
- if (!(result = object != null && hasFunc(object, key))) {
56420
+ if (!(result = object2 != null && hasFunc(object2, key))) {
56397
56421
  break;
56398
56422
  }
56399
- object = object[key];
56423
+ object2 = object2[key];
56400
56424
  }
56401
56425
  if (result) {
56402
56426
  return result;
56403
56427
  }
56404
- var length = object ? object.length : 0;
56405
- return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
56428
+ var length = object2 ? object2.length : 0;
56429
+ return !!length && isLength(length) && isIndex(key, length) && (isArray2(object2) || isArguments(object2));
56406
56430
  }
56407
56431
  function isIndex(value, length) {
56408
56432
  length = length == null ? MAX_SAFE_INTEGER : length;
56409
56433
  return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
56410
56434
  }
56411
- function isKey(value, object) {
56435
+ function isKey(value, object2) {
56412
56436
  if (isArray2(value)) {
56413
56437
  return false;
56414
56438
  }
@@ -56416,7 +56440,7 @@ void main() {
56416
56440
  if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol2(value)) {
56417
56441
  return true;
56418
56442
  }
56419
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
56443
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object(object2);
56420
56444
  }
56421
56445
  function isKeyable(value) {
56422
56446
  var type = typeof value;
@@ -56433,11 +56457,11 @@ void main() {
56433
56457
  return value === value && !isObject2(value);
56434
56458
  }
56435
56459
  function matchesStrictComparable(key, srcValue) {
56436
- return function(object) {
56437
- if (object == null) {
56460
+ return function(object2) {
56461
+ if (object2 == null) {
56438
56462
  return false;
56439
56463
  }
56440
- return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
56464
+ return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2));
56441
56465
  };
56442
56466
  }
56443
56467
  var stringToPath = memoize(function(string) {
@@ -56526,15 +56550,15 @@ void main() {
56526
56550
  function toString(value) {
56527
56551
  return value == null ? "" : baseToString(value);
56528
56552
  }
56529
- function get(object, path, defaultValue) {
56530
- var result = object == null ? void 0 : baseGet(object, path);
56553
+ function get(object2, path, defaultValue) {
56554
+ var result = object2 == null ? void 0 : baseGet(object2, path);
56531
56555
  return result === void 0 ? defaultValue : result;
56532
56556
  }
56533
- function hasIn(object, path) {
56534
- return object != null && hasPath(object, path, baseHasIn);
56557
+ function hasIn(object2, path) {
56558
+ return object2 != null && hasPath(object2, path, baseHasIn);
56535
56559
  }
56536
- function keys(object) {
56537
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
56560
+ function keys(object2) {
56561
+ return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
56538
56562
  }
56539
56563
  function identity(value) {
56540
56564
  return value;
@@ -62833,9 +62857,9 @@ void main() {
62833
62857
  }
62834
62858
  return text.slice(0, -separator.length);
62835
62859
  }
62836
- function addFormat(name2, format2) {
62837
- if (typeof format2 == "string") format2 = new RegExp(format2);
62838
- this._formats[name2] = format2;
62860
+ function addFormat(name2, format3) {
62861
+ if (typeof format3 == "string") format3 = new RegExp(format3);
62862
+ this._formats[name2] = format3;
62839
62863
  return this;
62840
62864
  }
62841
62865
  function addDefaultMetaSchema(self2) {
@@ -62858,8 +62882,8 @@ void main() {
62858
62882
  }
62859
62883
  function addInitialFormats(self2) {
62860
62884
  for (var name2 in self2._opts.formats) {
62861
- var format2 = self2._opts.formats[name2];
62862
- self2.addFormat(name2, format2);
62885
+ var format3 = self2._opts.formats[name2];
62886
+ self2.addFormat(name2, format3);
62863
62887
  }
62864
62888
  }
62865
62889
  function addInitialKeywords(self2) {
@@ -63926,13 +63950,13 @@ void main() {
63926
63950
  }
63927
63951
  }
63928
63952
  };
63929
- var forEachObject = function forEachObject2(object, iterator, receiver) {
63930
- for (var k4 in object) {
63931
- if (hasOwnProperty.call(object, k4)) {
63953
+ var forEachObject = function forEachObject2(object2, iterator, receiver) {
63954
+ for (var k4 in object2) {
63955
+ if (hasOwnProperty.call(object2, k4)) {
63932
63956
  if (receiver == null) {
63933
- iterator(object[k4], k4, object);
63957
+ iterator(object2[k4], k4, object2);
63934
63958
  } else {
63935
- iterator.call(receiver, object[k4], k4, object);
63959
+ iterator.call(receiver, object2[k4], k4, object2);
63936
63960
  }
63937
63961
  }
63938
63962
  }
@@ -65785,36 +65809,36 @@ void main() {
65785
65809
  return false;
65786
65810
  }
65787
65811
  };
65788
- keysShim = function keys(object) {
65789
- var isObject2 = object !== null && typeof object === "object";
65790
- var isFunction2 = toStr.call(object) === "[object Function]";
65791
- var isArguments = isArgs(object);
65792
- var isString2 = isObject2 && toStr.call(object) === "[object String]";
65812
+ keysShim = function keys(object2) {
65813
+ var isObject2 = object2 !== null && typeof object2 === "object";
65814
+ var isFunction2 = toStr.call(object2) === "[object Function]";
65815
+ var isArguments = isArgs(object2);
65816
+ var isString2 = isObject2 && toStr.call(object2) === "[object String]";
65793
65817
  var theKeys = [];
65794
65818
  if (!isObject2 && !isFunction2 && !isArguments) {
65795
65819
  throw new TypeError("Object.keys called on a non-object");
65796
65820
  }
65797
65821
  var skipProto = hasProtoEnumBug && isFunction2;
65798
- if (isString2 && object.length > 0 && !has.call(object, 0)) {
65799
- for (var i4 = 0; i4 < object.length; ++i4) {
65822
+ if (isString2 && object2.length > 0 && !has.call(object2, 0)) {
65823
+ for (var i4 = 0; i4 < object2.length; ++i4) {
65800
65824
  theKeys.push(String(i4));
65801
65825
  }
65802
65826
  }
65803
- if (isArguments && object.length > 0) {
65804
- for (var j4 = 0; j4 < object.length; ++j4) {
65827
+ if (isArguments && object2.length > 0) {
65828
+ for (var j4 = 0; j4 < object2.length; ++j4) {
65805
65829
  theKeys.push(String(j4));
65806
65830
  }
65807
65831
  } else {
65808
- for (var name2 in object) {
65809
- if (!(skipProto && name2 === "prototype") && has.call(object, name2)) {
65832
+ for (var name2 in object2) {
65833
+ if (!(skipProto && name2 === "prototype") && has.call(object2, name2)) {
65810
65834
  theKeys.push(String(name2));
65811
65835
  }
65812
65836
  }
65813
65837
  }
65814
65838
  if (hasDontEnumBug) {
65815
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
65839
+ var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object2);
65816
65840
  for (var k4 = 0; k4 < dontEnums.length; ++k4) {
65817
- if (!(skipConstructor && dontEnums[k4] === "constructor") && has.call(object, dontEnums[k4])) {
65841
+ if (!(skipConstructor && dontEnums[k4] === "constructor") && has.call(object2, dontEnums[k4])) {
65818
65842
  theKeys.push(dontEnums[k4]);
65819
65843
  }
65820
65844
  }
@@ -65842,11 +65866,11 @@ void main() {
65842
65866
  return args && args.length === arguments.length;
65843
65867
  }(1, 2);
65844
65868
  if (!keysWorksWithArguments) {
65845
- Object.keys = function keys(object) {
65846
- if (isArgs(object)) {
65847
- return originalKeys(slice.call(object));
65869
+ Object.keys = function keys(object2) {
65870
+ if (isArgs(object2)) {
65871
+ return originalKeys(slice.call(object2));
65848
65872
  }
65849
- return originalKeys(object);
65873
+ return originalKeys(object2);
65850
65874
  };
65851
65875
  }
65852
65876
  } else {
@@ -65990,10 +66014,10 @@ void main() {
65990
66014
  return typeof fn === "function" && toStr.call(fn) === "[object Function]";
65991
66015
  };
65992
66016
  var supportsDescriptors = dew$33()();
65993
- var defineProperty = function(object, name2, value, predicate) {
65994
- if (name2 in object) {
66017
+ var defineProperty = function(object2, name2, value, predicate) {
66018
+ if (name2 in object2) {
65995
66019
  if (predicate === true) {
65996
- if (object[name2] === value) {
66020
+ if (object2[name2] === value) {
65997
66021
  return;
65998
66022
  }
65999
66023
  } else if (!isFunction2(predicate) || !predicate()) {
@@ -66001,19 +66025,19 @@ void main() {
66001
66025
  }
66002
66026
  }
66003
66027
  if (supportsDescriptors) {
66004
- defineDataProperty(object, name2, value, true);
66028
+ defineDataProperty(object2, name2, value, true);
66005
66029
  } else {
66006
- defineDataProperty(object, name2, value);
66030
+ defineDataProperty(object2, name2, value);
66007
66031
  }
66008
66032
  };
66009
- var defineProperties = function(object, map) {
66033
+ var defineProperties = function(object2, map) {
66010
66034
  var predicates = arguments.length > 2 ? arguments[2] : {};
66011
66035
  var props = keys(map);
66012
66036
  if (hasSymbols) {
66013
66037
  props = concat2.call(props, Object.getOwnPropertySymbols(map));
66014
66038
  }
66015
66039
  for (var i4 = 0; i4 < props.length; i4 += 1) {
66016
- defineProperty(object, props[i4], map[props[i4]], predicates[props[i4]]);
66040
+ defineProperty(object2, props[i4], map[props[i4]], predicates[props[i4]]);
66017
66041
  }
66018
66042
  };
66019
66043
  defineProperties.supportsDescriptors = !!supportsDescriptors;
@@ -66200,7 +66224,7 @@ void main() {
66200
66224
  function getOwnNonIndexProperties(value) {
66201
66225
  return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));
66202
66226
  }
66203
- function compare(a4, b4) {
66227
+ function compare2(a4, b4) {
66204
66228
  if (a4 === b4) {
66205
66229
  return 0;
66206
66230
  }
@@ -66245,10 +66269,10 @@ void main() {
66245
66269
  if (a4.byteLength !== b4.byteLength) {
66246
66270
  return false;
66247
66271
  }
66248
- return compare(new Uint8Array(a4.buffer, a4.byteOffset, a4.byteLength), new Uint8Array(b4.buffer, b4.byteOffset, b4.byteLength)) === 0;
66272
+ return compare2(new Uint8Array(a4.buffer, a4.byteOffset, a4.byteLength), new Uint8Array(b4.buffer, b4.byteOffset, b4.byteLength)) === 0;
66249
66273
  }
66250
66274
  function areEqualArrayBuffers(buf1, buf2) {
66251
- return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
66275
+ return buf1.byteLength === buf2.byteLength && compare2(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
66252
66276
  }
66253
66277
  function isEqualBoxedPrimitive(val1, val2) {
66254
66278
  if (isNumberObject(val1)) {
@@ -69360,8 +69384,8 @@ void main() {
69360
69384
  init_buffer2();
69361
69385
  init_process2();
69362
69386
  module2.exports = {
69363
- format(format2, ...args) {
69364
- return format2.replace(/%([sdifj])/g, function(...[_unused, type]) {
69387
+ format(format3, ...args) {
69388
+ return format3.replace(/%([sdifj])/g, function(...[_unused, type]) {
69365
69389
  const replacement = args.shift();
69366
69390
  if (type === "f") {
69367
69391
  return replacement.toFixed(6);
@@ -69413,7 +69437,7 @@ void main() {
69413
69437
  init_dirname();
69414
69438
  init_buffer2();
69415
69439
  init_process2();
69416
- var { format: format2, inspect: inspect2 } = require_inspect();
69440
+ var { format: format3, inspect: inspect2 } = require_inspect();
69417
69441
  var { AggregateError: CustomAggregateError } = require_primordials();
69418
69442
  var AggregateError2 = globalThis.AggregateError || CustomAggregateError;
69419
69443
  var kIsNodeError = Symbol("kIsNodeError");
@@ -69463,7 +69487,7 @@ void main() {
69463
69487
  if (args.length === 0) {
69464
69488
  return msg;
69465
69489
  }
69466
- return format2(msg, ...args);
69490
+ return format3(msg, ...args);
69467
69491
  }
69468
69492
  function E4(code2, message, Base) {
69469
69493
  if (!Base) {
@@ -69752,7 +69776,7 @@ void main() {
69752
69776
  init_buffer2();
69753
69777
  init_process2();
69754
69778
  var bufferModule = (init_buffer(), __toCommonJS(buffer_exports));
69755
- var { format: format2, inspect: inspect2 } = require_inspect();
69779
+ var { format: format3, inspect: inspect2 } = require_inspect();
69756
69780
  var {
69757
69781
  codes: { ERR_INVALID_ARG_TYPE }
69758
69782
  } = require_errors();
@@ -69817,7 +69841,7 @@ void main() {
69817
69841
  return function() {
69818
69842
  };
69819
69843
  },
69820
- format: format2,
69844
+ format: format3,
69821
69845
  inspect: inspect2,
69822
69846
  types: {
69823
69847
  isAsyncFunction(fn) {
@@ -72877,10 +72901,10 @@ void main() {
72877
72901
  }
72878
72902
  ObjectDefineProperty(Writable, SymbolHasInstance, {
72879
72903
  __proto__: null,
72880
- value: function(object) {
72881
- if (FunctionPrototypeSymbolHasInstance(this, object)) return true;
72904
+ value: function(object2) {
72905
+ if (FunctionPrototypeSymbolHasInstance(this, object2)) return true;
72882
72906
  if (this !== Writable) return false;
72883
- return object && object._writableState instanceof WritableState;
72907
+ return object2 && object2._writableState instanceof WritableState;
72884
72908
  }
72885
72909
  });
72886
72910
  Writable.prototype.pipe = function() {
@@ -75328,13 +75352,13 @@ void main() {
75328
75352
  module2.exports = {
75329
75353
  Read: {
75330
75354
  switch: ["parametrizable", (compiler, struct) => {
75331
- let compare = struct.compareTo ? struct.compareTo : struct.compareToValue;
75355
+ let compare2 = struct.compareTo ? struct.compareTo : struct.compareToValue;
75332
75356
  const args = [];
75333
- if (compare.startsWith("$")) args.push(compare);
75357
+ if (compare2.startsWith("$")) args.push(compare2);
75334
75358
  else if (struct.compareTo) {
75335
- compare = compiler.getField(compare, true);
75359
+ compare2 = compiler.getField(compare2, true);
75336
75360
  }
75337
- let code2 = `switch (${compare}) {
75361
+ let code2 = `switch (${compare2}) {
75338
75362
  `;
75339
75363
  for (const key in struct.fields) {
75340
75364
  let val = key;
@@ -75358,13 +75382,13 @@ void main() {
75358
75382
  },
75359
75383
  Write: {
75360
75384
  switch: ["parametrizable", (compiler, struct) => {
75361
- let compare = struct.compareTo ? struct.compareTo : struct.compareToValue;
75385
+ let compare2 = struct.compareTo ? struct.compareTo : struct.compareToValue;
75362
75386
  const args = [];
75363
- if (compare.startsWith("$")) args.push(compare);
75387
+ if (compare2.startsWith("$")) args.push(compare2);
75364
75388
  else if (struct.compareTo) {
75365
- compare = compiler.getField(compare, true);
75389
+ compare2 = compiler.getField(compare2, true);
75366
75390
  }
75367
- let code2 = `switch (${compare}) {
75391
+ let code2 = `switch (${compare2}) {
75368
75392
  `;
75369
75393
  for (const key in struct.fields) {
75370
75394
  let val = key;
@@ -75389,13 +75413,13 @@ void main() {
75389
75413
  },
75390
75414
  SizeOf: {
75391
75415
  switch: ["parametrizable", (compiler, struct) => {
75392
- let compare = struct.compareTo ? struct.compareTo : struct.compareToValue;
75416
+ let compare2 = struct.compareTo ? struct.compareTo : struct.compareToValue;
75393
75417
  const args = [];
75394
- if (compare.startsWith("$")) args.push(compare);
75418
+ if (compare2.startsWith("$")) args.push(compare2);
75395
75419
  else if (struct.compareTo) {
75396
- compare = compiler.getField(compare, true);
75420
+ compare2 = compiler.getField(compare2, true);
75397
75421
  }
75398
- let code2 = `switch (${compare}) {
75422
+ let code2 = `switch (${compare2}) {
75399
75423
  `;
75400
75424
  for (const key in struct.fields) {
75401
75425
  let val = key;
@@ -76950,18 +76974,18 @@ return ${compiler2.callType("value", tagType)}
76950
76974
  parsed.type = type;
76951
76975
  return parsed;
76952
76976
  }
76953
- async function parse(data, format2, callback) {
76977
+ async function parse(data, format3, callback) {
76954
76978
  let fmt = null;
76955
- if (typeof format2 === "function") {
76956
- callback = format2;
76957
- } else if (format2 === true || format2 === "little") {
76979
+ if (typeof format3 === "function") {
76980
+ callback = format3;
76981
+ } else if (format3 === true || format3 === "little") {
76958
76982
  fmt = "little";
76959
- } else if (format2 === "big") {
76983
+ } else if (format3 === "big") {
76960
76984
  fmt = "big";
76961
- } else if (format2 === "littleVarint") {
76985
+ } else if (format3 === "littleVarint") {
76962
76986
  fmt = "littleVarint";
76963
- } else if (format2) {
76964
- throw new Error("Unrecognized format: " + format2);
76987
+ } else if (format3) {
76988
+ throw new Error("Unrecognized format: " + format3);
76965
76989
  }
76966
76990
  data.startOffset = data.startOffset || 0;
76967
76991
  if (!fmt && !data.startOffset) {
@@ -77137,10 +77161,10 @@ return ${compiler2.callType("value", tagType)}
77137
77161
  init_process2();
77138
77162
  init_buffer();
77139
77163
  NBTHelper = class {
77140
- static async fromBuffer(data, format2) {
77164
+ static async fromBuffer(data, format3) {
77141
77165
  const buffer2 = Buffer.from(data instanceof Uint8Array ? data : new Uint8Array(data));
77142
77166
  const prismarineNbt = await Promise.resolve().then(() => __toESM(require_nbt2()));
77143
- const { parsed, type, metadata } = await prismarineNbt.parse(buffer2, format2);
77167
+ const { parsed, type, metadata } = await prismarineNbt.parse(buffer2, format3);
77144
77168
  return Object.assign(parsed, {
77145
77169
  format: type,
77146
77170
  metadata,
@@ -84995,10 +85019,10 @@ return ${compiler2.callType("value", tagType)}
84995
85019
  });
84996
85020
  return passwordVerification;
84997
85021
  }
84998
- async function importKey(format2, password, algorithm, extractable, keyUsages) {
85022
+ async function importKey(format3, password, algorithm, extractable, keyUsages) {
84999
85023
  if (IMPORT_KEY_SUPPORTED) {
85000
85024
  try {
85001
- return await subtle.importKey(format2, password, algorithm, extractable, keyUsages);
85025
+ return await subtle.importKey(format3, password, algorithm, extractable, keyUsages);
85002
85026
  } catch (_4) {
85003
85027
  IMPORT_KEY_SUPPORTED = false;
85004
85028
  return misc.importKey(password);
@@ -87004,6 +87028,168 @@ return ${compiler2.callType("value", tagType)}
87004
87028
  }
87005
87029
  });
87006
87030
 
87031
+ // src/assets/source/archive/PackMetadata.ts
87032
+ function object(value, field) {
87033
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
87034
+ throw new Error(`Invalid ${field}: expected an object`);
87035
+ }
87036
+ return value;
87037
+ }
87038
+ function integer(value, field) {
87039
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
87040
+ throw new Error(`Invalid ${field}: expected a nonnegative integer`);
87041
+ }
87042
+ return value;
87043
+ }
87044
+ function format2(value, field, upper = false) {
87045
+ const parts = Array.isArray(value) ? value : [value];
87046
+ if (parts.length < 1 || parts.length > 2) {
87047
+ throw new Error(`Invalid ${field}: expected a major version or [major, minor]`);
87048
+ }
87049
+ return [integer(parts[0], field), parts.length === 2 ? integer(parts[1], field) : upper ? Infinity : 0];
87050
+ }
87051
+ function compare(a4, b4) {
87052
+ return a4[0] === b4[0] ? a4[1] - b4[1] : a4[0] - b4[0];
87053
+ }
87054
+ function overlay(value, field) {
87055
+ const entry = object(value, field);
87056
+ const directory = entry.directory;
87057
+ if (typeof directory !== "string" || !directory || /[^-_a-zA-Z0-9.]/.test(directory) || directory === "." || directory === "..") {
87058
+ throw new Error(`Invalid ${field}.directory: expected a directory name without path separators`);
87059
+ }
87060
+ let min, max2;
87061
+ if ("min_format" in entry || "max_format" in entry) {
87062
+ min = format2(entry.min_format, `${field}.min_format`);
87063
+ max2 = format2(entry.max_format, `${field}.max_format`, true);
87064
+ } else {
87065
+ const range = entry.formats;
87066
+ let lower, upper;
87067
+ if (typeof range === "number") {
87068
+ lower = upper = range;
87069
+ } else if (Array.isArray(range)) {
87070
+ if (range.length !== 2) throw new Error(`Invalid ${field}.formats: expected [min, max]`);
87071
+ [lower, upper] = range;
87072
+ } else {
87073
+ const bounds = object(range, `${field}.formats`);
87074
+ lower = bounds.min_inclusive;
87075
+ upper = bounds.max_inclusive;
87076
+ }
87077
+ min = [integer(lower, `${field}.formats.min_inclusive`), 0];
87078
+ max2 = [integer(upper, `${field}.formats.max_inclusive`), Infinity];
87079
+ }
87080
+ if (compare(min, max2) > 0) throw new Error(`Invalid ${field}: minimum format exceeds maximum format`);
87081
+ return { directory, min, max: max2 };
87082
+ }
87083
+ function pattern(value, field) {
87084
+ if (value === void 0) return void 0;
87085
+ if (typeof value !== "string") throw new Error(`Invalid ${field}: expected a regular expression string`);
87086
+ try {
87087
+ return new RegExp(value);
87088
+ } catch (cause) {
87089
+ throw new Error(`Invalid ${field}: ${String(cause)}`);
87090
+ }
87091
+ }
87092
+ var PackMetadata;
87093
+ var init_PackMetadata = __esm({
87094
+ "src/assets/source/archive/PackMetadata.ts"() {
87095
+ init_dirname();
87096
+ init_buffer2();
87097
+ init_process2();
87098
+ PackMetadata = class _PackMetadata {
87099
+ constructor(overlays, filters) {
87100
+ this.overlays = overlays;
87101
+ this.filters = filters;
87102
+ this.hasOverlays = overlays.length > 0;
87103
+ }
87104
+ static parse(value) {
87105
+ const metadata = object(value, "pack.mcmeta");
87106
+ let overlays = [];
87107
+ if ("overlays" in metadata) {
87108
+ const entries = object(metadata.overlays, "overlays").entries;
87109
+ if (!Array.isArray(entries)) throw new Error("Invalid overlays.entries: expected an array");
87110
+ overlays = entries.map((entry, index) => overlay(entry, `overlays.entries[${index}]`));
87111
+ }
87112
+ let filters = [];
87113
+ if ("filter" in metadata) {
87114
+ const entries = object(metadata.filter, "filter").block;
87115
+ if (!Array.isArray(entries)) throw new Error("Invalid filter.block: expected an array");
87116
+ filters = entries.map((value2, index) => {
87117
+ const field = `filter.block[${index}]`;
87118
+ const entry = object(value2, field);
87119
+ return { namespace: pattern(entry.namespace, `${field}.namespace`), path: pattern(entry.path, `${field}.path`) };
87120
+ });
87121
+ }
87122
+ return new _PackMetadata(overlays, filters);
87123
+ }
87124
+ /** Returns applicable directories in lookup order, with the last declared overlay first. */
87125
+ overlayDirectories(target) {
87126
+ const selected = format2(target, "target format");
87127
+ return this.overlays.filter((entry) => compare(selected, entry.min) >= 0 && compare(selected, entry.max) <= 0).map((entry) => entry.directory).reverse();
87128
+ }
87129
+ blocks(namespace, path) {
87130
+ return this.filters.some((entry) => entry.namespace?.test(namespace) ?? true) && this.filters.some((entry) => entry.path?.test(path) ?? true);
87131
+ }
87132
+ };
87133
+ }
87134
+ });
87135
+
87136
+ // src/assets/source/archive/PackFormats.ts
87137
+ var PackFormats;
87138
+ var init_PackFormats = __esm({
87139
+ "src/assets/source/archive/PackFormats.ts"() {
87140
+ init_dirname();
87141
+ init_buffer2();
87142
+ init_process2();
87143
+ init_Requests();
87144
+ PackFormats = class {
87145
+ /** Resolves pack formats from Mojang's client metadata hosted on assets.mcasset.cloud. */
87146
+ static async get(version2, type) {
87147
+ let pending = this.versions.get(version2);
87148
+ if (!pending || pending.expires <= Date.now()) {
87149
+ pending = {
87150
+ formats: this.load(version2),
87151
+ expires: ["latest", "release", "snapshot"].includes(version2) ? Date.now() + 3e5 : Infinity
87152
+ };
87153
+ this.versions.set(version2, pending);
87154
+ }
87155
+ try {
87156
+ return (await pending.formats)[type];
87157
+ } catch (cause) {
87158
+ if (this.versions.get(version2) === pending) this.versions.delete(version2);
87159
+ const option = type === "assets" ? "resourcePackFormat" : "dataPackFormat";
87160
+ const reason = cause instanceof Error ? cause.message : String(cause);
87161
+ throw new Error(`Could not resolve the pack format for Minecraft ${version2}. Set ArchiveAssetSource ${option} explicitly. ${reason}`);
87162
+ }
87163
+ }
87164
+ static async load(version2) {
87165
+ const response = await Requests.genericRequest({
87166
+ url: `https://assets.mcasset.cloud/${encodeURIComponent(version2)}/game-version.json`,
87167
+ responseType: "json"
87168
+ });
87169
+ const data = response.data;
87170
+ if (!data || typeof data !== "object" || Array.isArray(data)) {
87171
+ throw new Error("Expected version metadata to be an object");
87172
+ }
87173
+ const packs = data.pack_version;
87174
+ if (typeof packs !== "number" && (!packs || typeof packs !== "object" || Array.isArray(packs))) {
87175
+ throw new Error("Expected pack_version to be a number or an object");
87176
+ }
87177
+ const format3 = (type) => {
87178
+ const modern = typeof packs === "object" && ["resource_major", "resource_minor", "data_major", "data_minor"].some((key) => key in packs);
87179
+ const major = typeof packs === "number" ? packs : packs[modern ? `${type}_major` : type];
87180
+ const minor = modern ? packs[`${type}_minor`] : 0;
87181
+ if (typeof major !== "number" || !Number.isSafeInteger(major) || major < 0 || typeof minor !== "number" || !Number.isSafeInteger(minor) || minor < 0) {
87182
+ throw new Error(`Invalid ${type} pack format in version metadata`);
87183
+ }
87184
+ return Object.freeze([major, minor]);
87185
+ };
87186
+ return { assets: format3("resource"), data: format3("data") };
87187
+ }
87188
+ };
87189
+ PackFormats.versions = /* @__PURE__ */ new Map();
87190
+ }
87191
+ });
87192
+
87007
87193
  // src/assets/source/archive/ArchiveAssetSource.ts
87008
87194
  var ArchiveAssetSource;
87009
87195
  var init_ArchiveAssetSource = __esm({
@@ -87015,35 +87201,77 @@ return ${compiler2.callType("value", tagType)}
87015
87201
  init_request();
87016
87202
  init_HostedAssetSource();
87017
87203
  init_BrowserArchiveProxy();
87204
+ init_AssetLoader();
87205
+ init_PackMetadata();
87206
+ init_PackFormats();
87018
87207
  ArchiveAssetSource = class _ArchiveAssetSource extends AssetSource {
87019
- constructor(archiveProxy) {
87208
+ constructor(archiveProxy, options = {}) {
87020
87209
  super();
87021
- console.log(archiveProxy);
87022
87210
  this._archiveProxy = archiveProxy;
87211
+ const copyFormat = (format3) => typeof format3 === "object" ? [format3[0], format3[1]] : format3;
87212
+ this.options = {
87213
+ resourcePackFormat: copyFormat(options.resourcePackFormat),
87214
+ dataPackFormat: copyFormat(options.dataPackFormat)
87215
+ };
87023
87216
  }
87024
- static blob(blob) {
87025
- return new _ArchiveAssetSource(new BrowserArchiveProxy(blob));
87217
+ static blob(blob, options) {
87218
+ return new _ArchiveAssetSource(new BrowserArchiveProxy(blob), options);
87026
87219
  }
87027
87220
  get cacheId() {
87028
87221
  const id = this._archiveProxy.id;
87029
- return id === void 0 ? void 0 : `archive:${id}`;
87222
+ const formats = [this.options.resourcePackFormat ?? AssetLoader.version, this.options.dataPackFormat ?? AssetLoader.version];
87223
+ return id === void 0 ? void 0 : `archive-metadata:1:${id}:${JSON.stringify(formats)}`;
87030
87224
  }
87031
87225
  async getEntries() {
87032
- return this._archiveProxy.getEntries();
87226
+ return this.entries ?? (this.entries = this._archiveProxy.getEntries().catch((error2) => {
87227
+ this.entries = void 0;
87228
+ throw error2;
87229
+ }));
87033
87230
  }
87034
87231
  async getEntry(path) {
87035
87232
  const entries = await this.getEntries();
87036
87233
  return entries.find((e6) => e6.filename === path);
87037
87234
  }
87235
+ async getMetadata(key) {
87236
+ try {
87237
+ return await (this.metadata ?? (this.metadata = this.getEntry("pack.mcmeta").then(async (entry) => PackMetadata.parse(entry ? JSON.parse(await (await entry.getData()).text()) : {})).catch((error2) => {
87238
+ this.metadata = void 0;
87239
+ throw error2;
87240
+ })));
87241
+ } catch (cause) {
87242
+ throw new AssetLoadError(this, key, "pack.mcmeta", cause);
87243
+ }
87244
+ }
87245
+ async blocks(key) {
87246
+ if (key.rootType !== "assets" && key.rootType !== "data") return false;
87247
+ const metadata = await this.getMetadata(key);
87248
+ const path = `${key.assetType !== void 0 ? key.assetType + "/" : ""}${key.getFullPath()}${key.extension}`;
87249
+ return metadata.blocks(key.namespace, path);
87250
+ }
87038
87251
  async get(key, parser) {
87039
87252
  const responseParser = HostedAssetSource.PARSER_MAP.get(parser);
87040
87253
  return this.load(key, responseParser);
87041
87254
  }
87042
87255
  async load(key, parser) {
87043
87256
  const path = `${this.assetBasePath(key)}${key.type !== void 0 ? key.type + "/" : ""}${key.path}${key.extension}`;
87257
+ const version2 = AssetLoader.version;
87258
+ let selectedPath = path;
87044
87259
  let url;
87045
87260
  try {
87046
- const entry = await this.getEntry(path);
87261
+ let directories = [];
87262
+ if (key.rootType === "assets" || key.rootType === "data") {
87263
+ const metadata = await this.getMetadata(key);
87264
+ if (metadata.hasOverlays) {
87265
+ const format3 = (key.rootType === "assets" ? this.options.resourcePackFormat : this.options.dataPackFormat) ?? await PackFormats.get(version2, key.rootType);
87266
+ directories = metadata.overlayDirectories(format3);
87267
+ }
87268
+ }
87269
+ let entry;
87270
+ for (const directory of [...directories, ""]) {
87271
+ selectedPath = directory ? `${directory}/${path}` : path;
87272
+ entry = await this.getEntry(selectedPath);
87273
+ if (entry) break;
87274
+ }
87047
87275
  if (!entry) {
87048
87276
  return void 0;
87049
87277
  }
@@ -87056,7 +87284,8 @@ return ${compiler2.callType("value", tagType)}
87056
87284
  }
87057
87285
  return await parser.parse(response);
87058
87286
  } catch (cause) {
87059
- throw new AssetLoadError(this, key, path, cause);
87287
+ if (cause instanceof AssetLoadError) throw cause;
87288
+ throw new AssetLoadError(this, key, selectedPath, cause);
87060
87289
  } finally {
87061
87290
  if (url !== void 0) {
87062
87291
  URL.revokeObjectURL(url);
@@ -87098,6 +87327,8 @@ return ${compiler2.callType("value", tagType)}
87098
87327
  init_ArchiveEntry();
87099
87328
  init_ArchiveProxy();
87100
87329
  init_BrowserArchiveProxy();
87330
+ init_PackFormats();
87331
+ init_PackMetadata();
87101
87332
  }
87102
87333
  });
87103
87334
 
@@ -87186,13 +87417,14 @@ ${key}` : key;
87186
87417
  return void 0;
87187
87418
  }
87188
87419
  static async getAll(key, parser) {
87189
- let promises = [];
87190
- for (const source of this._SOURCES) {
87191
- promises.push(source.source.get(key, parser));
87420
+ const sources = [...this._SOURCES];
87421
+ const results = [];
87422
+ for (const { source } of sources) {
87423
+ const asset = await source.get(key, parser);
87424
+ if (asset != void 0) results.push(asset);
87425
+ if (await source.blocks(key)) break;
87192
87426
  }
87193
- return Promise.all(promises).then((results) => {
87194
- return results.filter((r5) => r5 != void 0);
87195
- });
87427
+ return results;
87196
87428
  }
87197
87429
  /** Returns the first defined result in source-priority order, without merging assets. */
87198
87430
  static async get(key, parser) {
@@ -87213,13 +87445,17 @@ ${key}` : key;
87213
87445
  /** Tries each path within a source before considering lower-priority sources. */
87214
87446
  static async getFirst(keys, parser) {
87215
87447
  const sources = [...this._SOURCES];
87448
+ let remaining = [...keys];
87216
87449
  for (const source of sources) {
87217
- for (const key of keys) {
87450
+ for (const key of remaining) {
87218
87451
  const result = await source.source.get(key, parser);
87219
87452
  if (result !== void 0) {
87220
87453
  return { key, asset: result };
87221
87454
  }
87222
87455
  }
87456
+ const blocked = await Promise.all(remaining.map((key) => source.source.blocks(key)));
87457
+ remaining = remaining.filter((_4, index) => !blocked[index]);
87458
+ if (!remaining.length) break;
87223
87459
  }
87224
87460
  return void 0;
87225
87461
  }
@@ -87688,6 +87924,37 @@ ${key}` : key;
87688
87924
  static facesToUv(faces, originalTextureSize, actualTextureSize) {
87689
87925
  return new Float32BufferAttribute(this.facesToUvArray(faces, originalTextureSize, actualTextureSize), 2);
87690
87926
  }
87927
+ /** Bounds texture sampling to texel centres without changing cropped face UVs. */
87928
+ static setAtlasUvBounds(geometry, faces, atlas) {
87929
+ const uv = geometry.getAttribute("uv");
87930
+ const bounds = new Float32Array(uv.count * 4);
87931
+ for (const [faceIndex, faceName] of CUBE_FACES.entries()) {
87932
+ const texture = faces[faceName]?.texture?.substring(1);
87933
+ const position = texture && atlas.positions[texture];
87934
+ const size = texture && atlas.sizes[texture];
87935
+ let minU = Infinity, minV = Infinity, maxU = -Infinity, maxV = -Infinity;
87936
+ if (position && size) {
87937
+ minU = position[0] / atlas.image.width;
87938
+ maxU = (position[0] + size[0]) / atlas.image.width;
87939
+ minV = 1 - (position[1] + size[1]) / atlas.image.height;
87940
+ maxV = 1 - position[1] / atlas.image.height;
87941
+ } else {
87942
+ for (let corner = 0; corner < 4; corner++) {
87943
+ const index = faceIndex * 4 + corner;
87944
+ minU = Math.min(minU, uv.getX(index));
87945
+ minV = Math.min(minV, uv.getY(index));
87946
+ maxU = Math.max(maxU, uv.getX(index));
87947
+ maxV = Math.max(maxV, uv.getY(index));
87948
+ }
87949
+ }
87950
+ const insetU = Math.min(0.5 / atlas.image.width, (maxU - minU) / 2);
87951
+ const insetV = Math.min(0.5 / atlas.image.height, (maxV - minV) / 2);
87952
+ for (let corner = 0; corner < 4; corner++) {
87953
+ bounds.set([minU + insetU, minV + insetV, maxU - insetU, maxV - insetV], (faceIndex * 4 + corner) * 4);
87954
+ }
87955
+ }
87956
+ geometry.setAttribute("uvBounds", new Float32BufferAttribute(bounds, 4));
87957
+ }
87691
87958
  static lockUvs(geometry, faces, atlas, rotation) {
87692
87959
  const uv = geometry.getAttribute("uv");
87693
87960
  for (let faceIndex = 0; faceIndex < CUBE_FACES.length; faceIndex++) {
@@ -88359,27 +88626,27 @@ ${key}` : key;
88359
88626
  for (const layer of layers) {
88360
88627
  const objects = [];
88361
88628
  if (poses) {
88362
- layer.traverse((object) => {
88363
- if (poses.has(object)) objects.push(object);
88629
+ layer.traverse((object2) => {
88630
+ if (poses.has(object2)) objects.push(object2);
88364
88631
  });
88365
88632
  } else {
88366
88633
  for (const bone of Object.keys(animation.bones)) {
88367
- const object = layer.getObjectByName(`group:${bone}`);
88368
- if (object) objects.push(object);
88634
+ const object2 = layer.getObjectByName(`group:${bone}`);
88635
+ if (object2) objects.push(object2);
88369
88636
  }
88370
88637
  }
88371
- for (const object of objects) {
88372
- const bone = object.name.slice("group:".length);
88373
- const pose = poses?.get(object);
88638
+ for (const object2 of objects) {
88639
+ const bone = object2.name.slice("group:".length);
88640
+ const pose = poses?.get(object2);
88374
88641
  this.parts.push({
88375
88642
  bone,
88376
- object,
88377
- position: object.position.clone(),
88378
- rotation: object.rotation.clone(),
88379
- scale: object.scale.clone(),
88380
- basePosition: pose ? new Vector3(...pose.offset) : object.position.clone(),
88381
- baseRotation: pose ? new Euler(...pose.rotation, "ZYX") : object.rotation.clone(),
88382
- baseScale: pose ? new Vector3(...pose.scale ?? [1, 1, 1]) : object.scale.clone()
88643
+ object: object2,
88644
+ position: object2.position.clone(),
88645
+ rotation: object2.rotation.clone(),
88646
+ scale: object2.scale.clone(),
88647
+ basePosition: pose ? new Vector3(...pose.offset) : object2.position.clone(),
88648
+ baseRotation: pose ? new Euler(...pose.rotation, "ZYX") : object2.rotation.clone(),
88649
+ baseScale: pose ? new Vector3(...pose.scale ?? [1, 1, 1]) : object2.scale.clone()
88383
88650
  });
88384
88651
  }
88385
88652
  }
@@ -88904,15 +89171,15 @@ ${key}` : key;
88904
89171
  }
88905
89172
  }
88906
89173
  //</editor-fold>
88907
- toggleObjectVisibility(object, visible) {
88908
- if (object) {
89174
+ toggleObjectVisibility(object2, visible) {
89175
+ if (object2) {
88909
89176
  if (typeof visible !== "undefined") {
88910
- object.visible = visible;
89177
+ object2.visible = visible;
88911
89178
  } else {
88912
- object.visible = !object.visible;
89179
+ object2.visible = !object2.visible;
88913
89180
  }
88914
89181
  this.notifyDirty();
88915
- return object.visible;
89182
+ return object2.visible;
88916
89183
  }
88917
89184
  this.notifyDirty();
88918
89185
  return false;
@@ -89210,8 +89477,8 @@ ${key}` : key;
89210
89477
  this.scrollMaterials.push({ material: mat, offset: mat.map.offset, speed: scroll });
89211
89478
  }
89212
89479
  }
89213
- this.getLayerGroup(name2)?.traverse((object) => {
89214
- if (isMesh(object)) object.material = mat;
89480
+ this.getLayerGroup(name2)?.traverse((object2) => {
89481
+ if (isMesh(object2)) object2.material = mat;
89215
89482
  });
89216
89483
  }));
89217
89484
  if (!this.children.length) {
@@ -89541,8 +89808,8 @@ ${key}` : key;
89541
89808
  return geometry;
89542
89809
  }
89543
89810
  }
89544
- function computeMorphedAttributes(object) {
89545
- if (object.geometry.isBufferGeometry !== true) {
89811
+ function computeMorphedAttributes(object2) {
89812
+ if (object2.geometry.isBufferGeometry !== true) {
89546
89813
  console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry.");
89547
89814
  return null;
89548
89815
  }
@@ -89555,11 +89822,11 @@ ${key}` : key;
89555
89822
  const _morphA2 = new Vector3();
89556
89823
  const _morphB = new Vector3();
89557
89824
  const _morphC = new Vector3();
89558
- function _calculateMorphedAttributeData(object2, material2, attribute, morphAttribute, morphTargetsRelative2, a5, b5, c5, modifiedAttributeArray) {
89825
+ function _calculateMorphedAttributeData(object3, material2, attribute, morphAttribute, morphTargetsRelative2, a5, b5, c5, modifiedAttributeArray) {
89559
89826
  _vA2.fromBufferAttribute(attribute, a5);
89560
89827
  _vB2.fromBufferAttribute(attribute, b5);
89561
89828
  _vC2.fromBufferAttribute(attribute, c5);
89562
- const morphInfluences = object2.morphTargetInfluences;
89829
+ const morphInfluences = object3.morphTargetInfluences;
89563
89830
  if (material2.morphTargets && morphAttribute && morphInfluences) {
89564
89831
  _morphA2.set(0, 0, 0);
89565
89832
  _morphB.set(0, 0, 0);
@@ -89585,10 +89852,10 @@ ${key}` : key;
89585
89852
  _vB2.add(_morphB);
89586
89853
  _vC2.add(_morphC);
89587
89854
  }
89588
- if (object2.isSkinnedMesh) {
89589
- object2.boneTransform(a5, _vA2);
89590
- object2.boneTransform(b5, _vB2);
89591
- object2.boneTransform(c5, _vC2);
89855
+ if (object3.isSkinnedMesh) {
89856
+ object3.boneTransform(a5, _vA2);
89857
+ object3.boneTransform(b5, _vB2);
89858
+ object3.boneTransform(c5, _vC2);
89592
89859
  }
89593
89860
  modifiedAttributeArray[a5 * 3 + 0] = _vA2.x;
89594
89861
  modifiedAttributeArray[a5 * 3 + 1] = _vA2.y;
@@ -89600,8 +89867,8 @@ ${key}` : key;
89600
89867
  modifiedAttributeArray[c5 * 3 + 1] = _vC2.y;
89601
89868
  modifiedAttributeArray[c5 * 3 + 2] = _vC2.z;
89602
89869
  }
89603
- const geometry = object.geometry;
89604
- const material = object.material;
89870
+ const geometry = object2.geometry;
89871
+ const material = object2.material;
89605
89872
  let a4, b4, c4;
89606
89873
  const index = geometry.index;
89607
89874
  const positionAttribute = geometry.attributes.position;
@@ -89628,7 +89895,7 @@ ${key}` : key;
89628
89895
  b4 = index.getX(j4 + 1);
89629
89896
  c4 = index.getX(j4 + 2);
89630
89897
  _calculateMorphedAttributeData(
89631
- object,
89898
+ object2,
89632
89899
  groupMaterial,
89633
89900
  positionAttribute,
89634
89901
  morphPosition,
@@ -89639,7 +89906,7 @@ ${key}` : key;
89639
89906
  modifiedPosition
89640
89907
  );
89641
89908
  _calculateMorphedAttributeData(
89642
- object,
89909
+ object2,
89643
89910
  groupMaterial,
89644
89911
  normalAttribute,
89645
89912
  morphNormal,
@@ -89659,7 +89926,7 @@ ${key}` : key;
89659
89926
  b4 = index.getX(i4 + 1);
89660
89927
  c4 = index.getX(i4 + 2);
89661
89928
  _calculateMorphedAttributeData(
89662
- object,
89929
+ object2,
89663
89930
  material,
89664
89931
  positionAttribute,
89665
89932
  morphPosition,
@@ -89670,7 +89937,7 @@ ${key}` : key;
89670
89937
  modifiedPosition
89671
89938
  );
89672
89939
  _calculateMorphedAttributeData(
89673
- object,
89940
+ object2,
89674
89941
  material,
89675
89942
  normalAttribute,
89676
89943
  morphNormal,
@@ -89694,7 +89961,7 @@ ${key}` : key;
89694
89961
  b4 = j4 + 1;
89695
89962
  c4 = j4 + 2;
89696
89963
  _calculateMorphedAttributeData(
89697
- object,
89964
+ object2,
89698
89965
  groupMaterial,
89699
89966
  positionAttribute,
89700
89967
  morphPosition,
@@ -89705,7 +89972,7 @@ ${key}` : key;
89705
89972
  modifiedPosition
89706
89973
  );
89707
89974
  _calculateMorphedAttributeData(
89708
- object,
89975
+ object2,
89709
89976
  groupMaterial,
89710
89977
  normalAttribute,
89711
89978
  morphNormal,
@@ -89725,7 +89992,7 @@ ${key}` : key;
89725
89992
  b4 = i4 + 1;
89726
89993
  c4 = i4 + 2;
89727
89994
  _calculateMorphedAttributeData(
89728
- object,
89995
+ object2,
89729
89996
  material,
89730
89997
  positionAttribute,
89731
89998
  morphPosition,
@@ -89736,7 +90003,7 @@ ${key}` : key;
89736
90003
  modifiedPosition
89737
90004
  );
89738
90005
  _calculateMorphedAttributeData(
89739
- object,
90006
+ object2,
89740
90007
  material,
89741
90008
  normalAttribute,
89742
90009
  morphNormal,
@@ -90067,13 +90334,13 @@ ${shader.fragmentShader}`.replace(
90067
90334
  transform.multiply(new Matrix4().makeTranslation(-8, -8, -8));
90068
90335
  try {
90069
90336
  for (const part of parts) {
90070
- const object = new EntityObject(part.model, { flip: false, wireframe: this.options.wireframe });
90071
- object.matrix.copy(transform).multiply(part.transform);
90072
- object.matrixWorldNeedsUpdate = true;
90073
- object.matrixAutoUpdate = false;
90074
- this.add(object);
90075
- await object.init();
90076
- object.iterateAllMeshes((mesh) => {
90337
+ const object2 = new EntityObject(part.model, { flip: false, wireframe: this.options.wireframe });
90338
+ object2.matrix.copy(transform).multiply(part.transform);
90339
+ object2.matrixWorldNeedsUpdate = true;
90340
+ object2.matrixAutoUpdate = false;
90341
+ this.add(object2);
90342
+ await object2.init();
90343
+ object2.iterateAllMeshes((mesh) => {
90077
90344
  const source = mesh.material;
90078
90345
  let material = this.specialMaterials.get(source);
90079
90346
  if (!material) {
@@ -90084,7 +90351,7 @@ ${shader.fragmentShader}`.replace(
90084
90351
  mesh.material = material;
90085
90352
  });
90086
90353
  for (const [name2, rotation] of Object.entries(part.rotations)) {
90087
- object.getGroupByName(name2)?.rotation.set(...rotation, "ZYX");
90354
+ object2.getGroupByName(name2)?.rotation.set(...rotation, "ZYX");
90088
90355
  }
90089
90356
  }
90090
90357
  } catch (error2) {
@@ -90129,6 +90396,7 @@ ${shader.fragmentShader}`.replace(
90129
90396
  if (this.options.uvLockRotation) {
90130
90397
  UVMapper.lockUvs(elGeo, el.faces, this.atlas, new Euler(...this.options.uvLockRotation));
90131
90398
  }
90399
+ UVMapper.setAtlasUvBounds(elGeo, el.faces, this.atlas);
90132
90400
  if (this.options.tints) {
90133
90401
  const colors = new Float32Array(elGeo.getAttribute("position").count * 3).fill(1);
90134
90402
  for (const [faceIndex, faceName] of CUBE_FACES.entries()) {
@@ -90194,7 +90462,7 @@ ${shader.fragmentShader}`.replace(
90194
90462
  }
90195
90463
  applyTextures() {
90196
90464
  if (this.atlas) {
90197
- const mat = Materials.createShadedCanvasMaterial(this.atlas.image.canvas, this.atlas.hasTransparency, false);
90465
+ const mat = Materials.createShadedCanvasMaterial(this.atlas.image.canvas, this.atlas.hasTransparency, false, true);
90198
90466
  this.atlasMaterial = mat;
90199
90467
  this.atlasTexture = mat.uniforms?.map?.value ?? mat.map;
90200
90468
  this.iterateAllMeshes((mesh) => {
@@ -93379,6 +93647,8 @@ ${shader.fragmentShader}`.replace(
93379
93647
  Models: () => Models,
93380
93648
  NBTHelper: () => NBTHelper,
93381
93649
  OrbitControls: () => OrbitControls,
93650
+ PackFormats: () => PackFormats,
93651
+ PackMetadata: () => PackMetadata,
93382
93652
  PersistentCache: () => PersistentCache,
93383
93653
  Renderer: () => Renderer,
93384
93654
  RequestError: () => RequestError,
@@ -94027,7 +94297,7 @@ ${shader.fragmentShader}`.replace(
94027
94297
  * @param {Object3D} object - The 3D object to export.
94028
94298
  * @return {string} The exported OBJ.
94029
94299
  */
94030
- parse(object) {
94300
+ parse(object2) {
94031
94301
  let output = "";
94032
94302
  let indexVertex = 0;
94033
94303
  let indexVertexUvs = 0;
@@ -94146,7 +94416,7 @@ ${shader.fragmentShader}`.replace(
94146
94416
  }
94147
94417
  indexVertex += nbVertex;
94148
94418
  }
94149
- object.traverse(function(child) {
94419
+ object2.traverse(function(child) {
94150
94420
  if (child.isMesh === true) {
94151
94421
  parseMesh(child);
94152
94422
  }
@@ -94177,9 +94447,9 @@ ${shader.fragmentShader}`.replace(
94177
94447
  * @param {PLYExporter~Options} options - The export options.
94178
94448
  * @return {?(string|ArrayBuffer)} The exported PLY.
94179
94449
  */
94180
- parse(object, onDone, options = {}) {
94450
+ parse(object2, onDone, options = {}) {
94181
94451
  function traverseMeshes(cb) {
94182
- object.traverse(function(child) {
94452
+ object2.traverse(function(child) {
94183
94453
  if (child.isMesh === true || child.isPoints) {
94184
94454
  const mesh = child;
94185
94455
  const geometry = mesh.geometry;
@@ -94212,7 +94482,7 @@ ${shader.fragmentShader}`.replace(
94212
94482
  for (const name2 of customAttributeNames) customTypes[name2] = "float";
94213
94483
  let vertexCount = 0;
94214
94484
  let faceCount = 0;
94215
- object.traverse(function(child) {
94485
+ object2.traverse(function(child) {
94216
94486
  if (child.isMesh === true) {
94217
94487
  const mesh = child;
94218
94488
  const geometry = mesh.geometry;
@@ -95003,12 +95273,12 @@ property list uchar int vertex_index
95003
95273
  * @param {THREE.Object3D|THREE.Material|THREE.BufferGeometry|THREE.AnimationClip} object
95004
95274
  * @param {Object} objectDef
95005
95275
  */
95006
- serializeUserData(object, objectDef) {
95007
- if (Object.keys(object.userData).length === 0) return;
95276
+ serializeUserData(object2, objectDef) {
95277
+ if (Object.keys(object2.userData).length === 0) return;
95008
95278
  const options = this.options;
95009
95279
  const extensionsUsed = this.extensionsUsed;
95010
95280
  try {
95011
- const json = JSON.parse(JSON.stringify(object.userData));
95281
+ const json = JSON.parse(JSON.stringify(object2.userData));
95012
95282
  if (options.includeCustomExtensions && json.gltfExtensions) {
95013
95283
  if (objectDef.extensions === void 0) objectDef.extensions = {};
95014
95284
  for (const extensionName in json.gltfExtensions) {
@@ -95019,7 +95289,7 @@ property list uchar int vertex_index
95019
95289
  }
95020
95290
  if (Object.keys(json).length > 0) objectDef.extras = json;
95021
95291
  } catch (error2) {
95022
- console.warn("THREE.GLTFExporter: userData of '" + object.name + "' won't be serialized because of JSON.stringify error - " + error2.message);
95292
+ console.warn("THREE.GLTFExporter: userData of '" + object2.name + "' won't be serialized because of JSON.stringify error - " + error2.message);
95023
95293
  }
95024
95294
  }
95025
95295
  /**
@@ -95392,7 +95662,7 @@ property list uchar int vertex_index
95392
95662
  * @param {string} mimeType export format
95393
95663
  * @return {number} Index of the processed texture in the "images" array
95394
95664
  */
95395
- processImage(image, format2, flipY, mimeType = "image/png") {
95665
+ processImage(image, format3, flipY, mimeType = "image/png") {
95396
95666
  if (image !== null) {
95397
95667
  const writer = this;
95398
95668
  const cache = writer.cache;
@@ -95416,8 +95686,8 @@ property list uchar int vertex_index
95416
95686
  ctx2.scale(1, -1);
95417
95687
  }
95418
95688
  if (image.data !== void 0) {
95419
- if (format2 !== RGBAFormat) {
95420
- console.error("GLTFExporter: Only RGBAFormat is supported.", format2);
95689
+ if (format3 !== RGBAFormat) {
95690
+ console.error("GLTFExporter: Only RGBAFormat is supported.", format3);
95421
95691
  }
95422
95692
  if (image.width > options.maxTextureSize || image.height > options.maxTextureSize) {
95423
95693
  console.warn("GLTFExporter: Image size is bigger than maxTextureSize", image);
@@ -95945,13 +96215,13 @@ property list uchar int vertex_index
95945
96215
  * @param {THREE.Object3D} object
95946
96216
  * @return {?number}
95947
96217
  */
95948
- processSkin(object) {
96218
+ processSkin(object2) {
95949
96219
  const json = this.json;
95950
96220
  const nodeMap = this.nodeMap;
95951
- const node = json.nodes[nodeMap.get(object)];
95952
- const skeleton = object.skeleton;
96221
+ const node = json.nodes[nodeMap.get(object2)];
96222
+ const skeleton = object2.skeleton;
95953
96223
  if (skeleton === void 0) return null;
95954
- const rootJoint = object.skeleton.bones[0];
96224
+ const rootJoint = object2.skeleton.bones[0];
95955
96225
  if (rootJoint === void 0) return null;
95956
96226
  const joints = [];
95957
96227
  const inverseBindMatrices = new Float32Array(skeleton.bones.length * 16);
@@ -95959,7 +96229,7 @@ property list uchar int vertex_index
95959
96229
  for (let i4 = 0; i4 < skeleton.bones.length; ++i4) {
95960
96230
  joints.push(nodeMap.get(skeleton.bones[i4]));
95961
96231
  temporaryBoneInverse.copy(skeleton.boneInverses[i4]);
95962
- temporaryBoneInverse.multiply(object.bindMatrix).toArray(inverseBindMatrices, i4 * 16);
96232
+ temporaryBoneInverse.multiply(object2.bindMatrix).toArray(inverseBindMatrices, i4 * 16);
95963
96233
  }
95964
96234
  if (json.skins === void 0) json.skins = [];
95965
96235
  json.skins.push({
@@ -95975,19 +96245,19 @@ property list uchar int vertex_index
95975
96245
  * @param {THREE.Object3D} object Object3D to processNodeAsync
95976
96246
  * @return {Promise<number>} Index of the node in the nodes list
95977
96247
  */
95978
- async processNodeAsync(object) {
96248
+ async processNodeAsync(object2) {
95979
96249
  const json = this.json;
95980
96250
  const options = this.options;
95981
96251
  const nodeMap = this.nodeMap;
95982
96252
  if (!json.nodes) json.nodes = [];
95983
- if (object.pivot !== null) {
95984
- return await this._processNodeWithPivotAsync(object);
96253
+ if (object2.pivot !== null) {
96254
+ return await this._processNodeWithPivotAsync(object2);
95985
96255
  }
95986
96256
  const nodeDef = {};
95987
96257
  if (options.trs) {
95988
- const rotation = object.quaternion.toArray();
95989
- const position = object.position.toArray();
95990
- const scale = object.scale.toArray();
96258
+ const rotation = object2.quaternion.toArray();
96259
+ const position = object2.position.toArray();
96260
+ const scale = object2.scale.toArray();
95991
96261
  if (!equalArray(rotation, [0, 0, 0, 1])) {
95992
96262
  nodeDef.rotation = rotation;
95993
96263
  }
@@ -95998,28 +96268,28 @@ property list uchar int vertex_index
95998
96268
  nodeDef.scale = scale;
95999
96269
  }
96000
96270
  } else {
96001
- if (object.matrixAutoUpdate) {
96002
- object.updateMatrix();
96271
+ if (object2.matrixAutoUpdate) {
96272
+ object2.updateMatrix();
96003
96273
  }
96004
- if (isIdentityMatrix(object.matrix) === false) {
96005
- nodeDef.matrix = object.matrix.elements;
96274
+ if (isIdentityMatrix(object2.matrix) === false) {
96275
+ nodeDef.matrix = object2.matrix.elements;
96006
96276
  }
96007
96277
  }
96008
- if (object.name !== "") nodeDef.name = String(object.name);
96009
- this.serializeUserData(object, nodeDef);
96010
- if (object.isMesh || object.isLine || object.isPoints) {
96011
- const meshIndex = await this.processMeshAsync(object);
96278
+ if (object2.name !== "") nodeDef.name = String(object2.name);
96279
+ this.serializeUserData(object2, nodeDef);
96280
+ if (object2.isMesh || object2.isLine || object2.isPoints) {
96281
+ const meshIndex = await this.processMeshAsync(object2);
96012
96282
  if (meshIndex !== null) nodeDef.mesh = meshIndex;
96013
- } else if (object.isCamera) {
96014
- nodeDef.camera = this.processCamera(object);
96283
+ } else if (object2.isCamera) {
96284
+ nodeDef.camera = this.processCamera(object2);
96015
96285
  }
96016
- if (object.isSkinnedMesh) this.skins.push(object);
96286
+ if (object2.isSkinnedMesh) this.skins.push(object2);
96017
96287
  const nodeIndex = json.nodes.push(nodeDef) - 1;
96018
- nodeMap.set(object, nodeIndex);
96019
- if (object.children.length > 0) {
96288
+ nodeMap.set(object2, nodeIndex);
96289
+ if (object2.children.length > 0) {
96020
96290
  const children = [];
96021
- for (let i4 = 0, l4 = object.children.length; i4 < l4; i4++) {
96022
- const child = object.children[i4];
96291
+ for (let i4 = 0, l4 = object2.children.length; i4 < l4; i4++) {
96292
+ const child = object2.children[i4];
96023
96293
  if (child.visible || options.onlyVisible === false) {
96024
96294
  const childNodeIndex = await this.processNodeAsync(child);
96025
96295
  if (childNodeIndex !== null) children.push(childNodeIndex);
@@ -96028,7 +96298,7 @@ property list uchar int vertex_index
96028
96298
  if (children.length > 0) nodeDef.children = children;
96029
96299
  }
96030
96300
  await this._invokeAllAsync(function(ext) {
96031
- ext.writeNode && ext.writeNode(object, nodeDef);
96301
+ ext.writeNode && ext.writeNode(object2, nodeDef);
96032
96302
  });
96033
96303
  return nodeIndex;
96034
96304
  }
@@ -96037,19 +96307,19 @@ property list uchar int vertex_index
96037
96307
  * @param {THREE.Object3D} object Object3D with pivot
96038
96308
  * @return {Promise<number>} Index of the container node
96039
96309
  */
96040
- async _processNodeWithPivotAsync(object) {
96310
+ async _processNodeWithPivotAsync(object2) {
96041
96311
  const json = this.json;
96042
96312
  const options = this.options;
96043
96313
  const nodeMap = this.nodeMap;
96044
- const pivot = object.pivot;
96314
+ const pivot = object2.pivot;
96045
96315
  const containerDef = {};
96046
- const rotation = object.quaternion.toArray();
96316
+ const rotation = object2.quaternion.toArray();
96047
96317
  const position = [
96048
- object.position.x + pivot.x,
96049
- object.position.y + pivot.y,
96050
- object.position.z + pivot.z
96318
+ object2.position.x + pivot.x,
96319
+ object2.position.y + pivot.y,
96320
+ object2.position.z + pivot.z
96051
96321
  ];
96052
- const scale = object.scale.toArray();
96322
+ const scale = object2.scale.toArray();
96053
96323
  if (!equalArray(rotation, [0, 0, 0, 1])) {
96054
96324
  containerDef.rotation = rotation;
96055
96325
  }
@@ -96060,28 +96330,28 @@ property list uchar int vertex_index
96060
96330
  containerDef.scale = scale;
96061
96331
  }
96062
96332
  containerDef.extras = { pivot: pivot.toArray() };
96063
- if (object.name !== "") containerDef.name = String(object.name);
96064
- this.serializeUserData(object, containerDef);
96333
+ if (object2.name !== "") containerDef.name = String(object2.name);
96334
+ this.serializeUserData(object2, containerDef);
96065
96335
  const containerIndex = json.nodes.push(containerDef) - 1;
96066
- nodeMap.set(object, containerIndex);
96336
+ nodeMap.set(object2, containerIndex);
96067
96337
  const childDef = {};
96068
96338
  const childPosition = [-pivot.x, -pivot.y, -pivot.z];
96069
96339
  if (!equalArray(childPosition, [0, 0, 0])) {
96070
96340
  childDef.translation = childPosition;
96071
96341
  }
96072
- if (object.isMesh || object.isLine || object.isPoints) {
96073
- const meshIndex = await this.processMeshAsync(object);
96342
+ if (object2.isMesh || object2.isLine || object2.isPoints) {
96343
+ const meshIndex = await this.processMeshAsync(object2);
96074
96344
  if (meshIndex !== null) childDef.mesh = meshIndex;
96075
- } else if (object.isCamera) {
96076
- childDef.camera = this.processCamera(object);
96345
+ } else if (object2.isCamera) {
96346
+ childDef.camera = this.processCamera(object2);
96077
96347
  }
96078
- if (object.isSkinnedMesh) this.skins.push(object);
96348
+ if (object2.isSkinnedMesh) this.skins.push(object2);
96079
96349
  const childIndex = json.nodes.push(childDef) - 1;
96080
96350
  const containerChildren = [childIndex];
96081
- if (object.children.length > 0) {
96351
+ if (object2.children.length > 0) {
96082
96352
  const grandchildren = [];
96083
- for (let i4 = 0, l4 = object.children.length; i4 < l4; i4++) {
96084
- const child = object.children[i4];
96353
+ for (let i4 = 0, l4 = object2.children.length; i4 < l4; i4++) {
96354
+ const child = object2.children[i4];
96085
96355
  if (child.visible || options.onlyVisible === false) {
96086
96356
  const childNodeIndex = await this.processNodeAsync(child);
96087
96357
  if (childNodeIndex !== null) grandchildren.push(childNodeIndex);
@@ -96091,7 +96361,7 @@ property list uchar int vertex_index
96091
96361
  }
96092
96362
  containerDef.children = containerChildren;
96093
96363
  await this._invokeAllAsync(function(ext) {
96094
- ext.writeNode && ext.writeNode(object, containerDef);
96364
+ ext.writeNode && ext.writeNode(object2, containerDef);
96095
96365
  });
96096
96366
  return containerIndex;
96097
96367
  }
@@ -96534,10 +96804,10 @@ property list uchar int vertex_index
96534
96804
  this.writer = writer;
96535
96805
  this.name = "EXT_mesh_gpu_instancing";
96536
96806
  }
96537
- writeNode(object, nodeDef) {
96538
- if (!object.isInstancedMesh) return;
96807
+ writeNode(object2, nodeDef) {
96808
+ if (!object2.isInstancedMesh) return;
96539
96809
  const writer = this.writer;
96540
- const mesh = object;
96810
+ const mesh = object2;
96541
96811
  const translationAttr = new Float32Array(mesh.count * 3);
96542
96812
  const rotationAttr = new Float32Array(mesh.count * 4);
96543
96813
  const scaleAttr = new Float32Array(mesh.count * 3);
@@ -96727,8 +96997,8 @@ property list uchar int vertex_index
96727
96997
  }
96728
96998
  }
96729
96999
  };
96730
- function localMatrix(object) {
96731
- return object.matrixAutoUpdate ? new Matrix4().compose(object.position, object.quaternion, object.scale) : object.matrix.clone();
97000
+ function localMatrix(object2) {
97001
+ return object2.matrixAutoUpdate ? new Matrix4().compose(object2.position, object2.quaternion, object2.scale) : object2.matrix.clone();
96732
97002
  }
96733
97003
  function createSnapshot(root, gltf, bakeColors = false) {
96734
97004
  const scene = new Scene();
@@ -96832,10 +97102,10 @@ property list uchar int vertex_index
96832
97102
  scene.add(copy);
96833
97103
  }
96834
97104
  };
96835
- const visit = (object, parentWorld) => {
96836
- if (!object.visible) return;
96837
- const world = parentWorld.clone().multiply(localMatrix(object));
96838
- const mesh = object;
97105
+ const visit = (object2, parentWorld) => {
97106
+ if (!object2.visible) return;
97107
+ const world = parentWorld.clone().multiply(localMatrix(object2));
97108
+ const mesh = object2;
96839
97109
  if (mesh.isMesh) {
96840
97110
  const instanced = mesh;
96841
97111
  if (instanced.isInstancedMesh) {
@@ -96849,7 +97119,7 @@ property list uchar int vertex_index
96849
97119
  addMesh(mesh, world);
96850
97120
  }
96851
97121
  }
96852
- for (const child of object.children) visit(child, world);
97122
+ for (const child of object2.children) visit(child, world);
96853
97123
  };
96854
97124
  try {
96855
97125
  const ancestors = [];
@@ -97092,11 +97362,11 @@ property list uchar int vertex_index
97092
97362
  switch (recipe.type) {
97093
97363
  case "minecraft:crafting_shaped":
97094
97364
  case "crafting_shaped": {
97095
- const pattern = recipe.pattern;
97096
- if (!pattern.length || pattern.length > 3 || !pattern[0].length || pattern[0].length > 3 || pattern.some((row) => row.length !== pattern[0].length)) {
97365
+ const pattern2 = recipe.pattern;
97366
+ if (!pattern2.length || pattern2.length > 3 || !pattern2[0].length || pattern2[0].length > 3 || pattern2.some((row) => row.length !== pattern2[0].length)) {
97097
97367
  throw new Error("Crafting patterns must be rectangular, with 1\u20133 rows and columns");
97098
97368
  }
97099
- const cells = pattern.flatMap((row, y5) => row.split("").map((symbol, x4) => ({ symbol, x: x4, y: y5 }))).filter((cell) => cell.symbol !== " ");
97369
+ const cells = pattern2.flatMap((row, y5) => row.split("").map((symbol, x4) => ({ symbol, x: x4, y: y5 }))).filter((cell) => cell.symbol !== " ");
97100
97370
  if (!cells.length) throw new Error("Crafting patterns must contain an ingredient");
97101
97371
  const minX = Math.min(...cells.map((cell) => cell.x)), maxX = Math.max(...cells.map((cell) => cell.x));
97102
97372
  const minY = Math.min(...cells.map((cell) => cell.y)), maxY = Math.max(...cells.map((cell) => cell.y));
@@ -97532,29 +97802,29 @@ property list uchar int vertex_index
97532
97802
  this.objectControlsContainer.innerHTML = "";
97533
97803
  this.addControls(targetObject, targetIntersection, instance);
97534
97804
  }
97535
- addControls(object, intersection, instance) {
97805
+ addControls(object2, intersection, instance) {
97536
97806
  const container = document.createElement("div");
97537
97807
  container.append(this.separator("Select Parent/Child"));
97538
- if (object.parent) {
97539
- container.append(this.buttonControl("Select Parent " + object.parent.constructor.name + " " + object.parent.name, "P", () => {
97540
- this.selectObject(object.parent, intersection, instance);
97808
+ if (object2.parent) {
97809
+ container.append(this.buttonControl("Select Parent " + object2.parent.constructor.name + " " + object2.parent.name, "P", () => {
97810
+ this.selectObject(object2.parent, intersection, instance);
97541
97811
  }));
97542
97812
  }
97543
- if (object.children.length > 0) {
97813
+ if (object2.children.length > 0) {
97544
97814
  let i4 = 1;
97545
- for (let child of object.children) {
97815
+ for (let child of object2.children) {
97546
97816
  container.append(this.buttonControl("Select Child " + child.constructor.name + " " + child.name, "C" + i4++, () => {
97547
97817
  this.selectObject(child, intersection, instance);
97548
97818
  }));
97549
97819
  }
97550
97820
  }
97551
97821
  container.append(this.separator());
97552
- const selectedInstance = instance && (object === instance.instanceable || object === intersection?.object) ? instance : void 0;
97822
+ const selectedInstance = instance && (object2 === instance.instanceable || object2 === intersection?.object) ? instance : void 0;
97553
97823
  if (!selectedInstance) {
97554
- container.append(this.toggleControl("Visibility", "V", object.visible, (v5) => object.visible = v5));
97824
+ container.append(this.toggleControl("Visibility", "V", object2.visible, (v5) => object2.visible = v5));
97555
97825
  }
97556
97826
  container.append(this.separator("Mesh"));
97557
- this.addObjectControls(object, intersection, container, selectedInstance);
97827
+ this.addObjectControls(object2, intersection, container, selectedInstance);
97558
97828
  container.append(this.separator());
97559
97829
  this.objectControlsContainer.append(container);
97560
97830
  }
@@ -98185,8 +98455,8 @@ property list uchar int vertex_index
98185
98455
  return false;
98186
98456
  }
98187
98457
  return this._models.some((model) => {
98188
- const object = isInstanceReference(model) ? model.instanceable : model;
98189
- return object.isOpaqueFullCube && this.getModelCullMask(model, 63) === 63;
98458
+ const object2 = isInstanceReference(model) ? model.instanceable : model;
98459
+ return object2.isOpaqueFullCube && this.getModelCullMask(model, 63) === 63;
98190
98460
  });
98191
98461
  }
98192
98462
  getModelMatrix(model) {
@@ -98195,8 +98465,8 @@ property list uchar int vertex_index
98195
98465
  return model.matrix.clone();
98196
98466
  }
98197
98467
  getModelCullMask(model, worldMask) {
98198
- const object = isInstanceReference(model) ? model.instanceable : model;
98199
- if (object.options.displayPosition) return 0;
98468
+ const object2 = isInstanceReference(model) ? model.instanceable : model;
98469
+ if (object2.options.displayPosition) return 0;
98200
98470
  const position = new Vector3();
98201
98471
  const rotation = new Quaternion();
98202
98472
  const scale = new Vector3();
@@ -98213,14 +98483,14 @@ property list uchar int vertex_index
98213
98483
  replacements.push(model);
98214
98484
  continue;
98215
98485
  }
98216
- const object = isInstanceReference(model) ? model.instanceable : model;
98486
+ const object2 = isInstanceReference(model) ? model.instanceable : model;
98217
98487
  const cullMask = this.getModelCullMask(model, worldMask);
98218
- if (cullMask === (object.options.cullMask ?? 0)) {
98488
+ if (cullMask === (object2.options.cullMask ?? 0)) {
98219
98489
  replacements.push(model);
98220
98490
  continue;
98221
98491
  }
98222
98492
  const matrix = this.getModelMatrix(model);
98223
- const replacement = await this.scene.addModel(object.originalModel, { ...object.options, cullMask });
98493
+ const replacement = await this.scene.addModel(object2.originalModel, { ...object2.options, cullMask });
98224
98494
  replacements.push(replacement);
98225
98495
  if (isInstanceReference(replacement)) {
98226
98496
  replacement.setMatrix(matrix);
@@ -98228,8 +98498,8 @@ property list uchar int vertex_index
98228
98498
  replacement.matrix.copy(matrix);
98229
98499
  replacement.matrixWorldNeedsUpdate = true;
98230
98500
  matrix.decompose(replacement.position, replacement.quaternion, replacement.scale);
98231
- replacement.matrixAutoUpdate = object.matrixAutoUpdate;
98232
- replacement.visible = object.visible;
98501
+ replacement.matrixAutoUpdate = object2.matrixAutoUpdate;
98502
+ replacement.visible = object2.visible;
98233
98503
  }
98234
98504
  }
98235
98505
  } catch (error2) {
@@ -100167,9 +100437,9 @@ property list uchar int vertex_index
100167
100437
  * Parses a legacy schematic using custom mappings before the bundled defaults.
100168
100438
  * Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
100169
100439
  */
100170
- static async parse(nbt, customMappings = {}) {
100440
+ static async parse(nbt, customMappings = {}, options = {}) {
100171
100441
  const tags = nbt.value;
100172
- if (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha") {
100442
+ if (!options.lenient && (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha")) {
100173
100443
  throw new MineRenderError("Schematic Materials must be Alpha");
100174
100444
  }
100175
100445
  const size = ["Width", "Height", "Length"].map((name2) => {
@@ -100210,8 +100480,16 @@ property list uchar int vertex_index
100210
100480
  const id = high << 8 | ids.value[index] & 255;
100211
100481
  const metadata = data.value[index] & 255;
100212
100482
  const key = `${id}:${metadata}`;
100213
- const mapped = customMappings[key] ?? mapping[key];
100214
- if (!mapped) throw new MineRenderError(`Unsupported legacy block ${id}:${metadata} at schematic index ${index}`);
100483
+ let mapped = customMappings[key] ?? mapping[key];
100484
+ if (!mapped && options.lenient) {
100485
+ mapped = customMappings[`${id}:0`] ?? mapping[`${id}:0`];
100486
+ }
100487
+ if (!mapped) {
100488
+ if (options.lenient) {
100489
+ continue;
100490
+ }
100491
+ throw new MineRenderError(`Unsupported legacy block ${id}:${metadata} at schematic index ${index}`);
100492
+ }
100215
100493
  const [type, state] = mapped.split("[");
100216
100494
  if (type === "minecraft:air") continue;
100217
100495
  const properties = {};
@@ -101404,53 +101682,53 @@ property list uchar int vertex_index
101404
101682
  this.options = (0, import_ts_deepmerge8.default)({}, _MineRenderScene.DEFAULT_OPTIONS, options ?? {});
101405
101683
  }
101406
101684
  add(...objects) {
101407
- for (const object of objects) {
101685
+ for (const object2 of objects) {
101408
101686
  this.dirty = true;
101409
101687
  try {
101410
- super.add(object);
101688
+ super.add(object2);
101411
101689
  } finally {
101412
- if (object?.isObject3D && object !== this) {
101413
- this.updateObjectRegistration(object, object.parent === this);
101690
+ if (object2?.isObject3D && object2 !== this) {
101691
+ this.updateObjectRegistration(object2, object2.parent === this);
101414
101692
  }
101415
101693
  }
101416
101694
  }
101417
101695
  return this;
101418
101696
  }
101419
101697
  remove(...objects) {
101420
- for (const object of objects) {
101421
- if (!this.children.includes(object)) continue;
101698
+ for (const object2 of objects) {
101699
+ if (!this.children.includes(object2)) continue;
101422
101700
  this.dirty = true;
101423
- this.updateObjectRegistration(object, false);
101701
+ this.updateObjectRegistration(object2, false);
101424
101702
  try {
101425
- super.remove(object);
101703
+ super.remove(object2);
101426
101704
  } finally {
101427
- this.updateObjectRegistration(object, object.parent === this);
101705
+ this.updateObjectRegistration(object2, object2.parent === this);
101428
101706
  }
101429
101707
  }
101430
101708
  return this;
101431
101709
  }
101432
- updateObjectRegistration(object, attached) {
101433
- if (this.observedObjects.has(object) === attached) return;
101434
- const observable = object;
101710
+ updateObjectRegistration(object2, attached) {
101711
+ if (this.observedObjects.has(object2) === attached) return;
101712
+ const observable = object2;
101435
101713
  if (attached) {
101436
- this.observedObjects.add(object);
101714
+ this.observedObjects.add(object2);
101437
101715
  observable.addEventListener("change", this.onObjectChange);
101438
101716
  } else {
101439
- this.observedObjects.delete(object);
101717
+ this.observedObjects.delete(object2);
101440
101718
  observable.removeEventListener("change", this.onObjectChange);
101441
101719
  }
101442
101720
  const change = attached ? 1 : -1;
101443
101721
  this.stats.objectCount += change;
101444
- if (isSceneObject(object)) {
101722
+ if (isSceneObject(object2)) {
101445
101723
  this.stats.sceneObjectCount += change;
101446
101724
  }
101447
101725
  }
101448
- async initAndAdd(...object) {
101726
+ async initAndAdd(...object2) {
101449
101727
  this.dirty = true;
101450
- for (let obj of object) {
101728
+ for (let obj of object2) {
101451
101729
  await obj.init();
101452
101730
  }
101453
- return this.add(...object);
101731
+ return this.add(...object2);
101454
101732
  }
101455
101733
  async addSceneObject(asset, objectSupplier, _options, parent = this) {
101456
101734
  this.dirty = true;
@@ -103516,11 +103794,11 @@ gl_FragDepth=readDepth(vUv);
103516
103794
  var _startEvent = { type: "start" };
103517
103795
  var _endEvent = { type: "end" };
103518
103796
  var OrbitControls = class extends EventDispatcher {
103519
- constructor(object, domElement) {
103797
+ constructor(object2, domElement) {
103520
103798
  super();
103521
103799
  if (domElement === void 0) console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.');
103522
103800
  if (domElement === document) console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.');
103523
- this.object = object;
103801
+ this.object = object2;
103524
103802
  this.domElement = domElement;
103525
103803
  this.domElement.style.touchAction = "none";
103526
103804
  this.enabled = true;
@@ -103577,7 +103855,7 @@ gl_FragDepth=readDepth(vUv);
103577
103855
  };
103578
103856
  this.update = function() {
103579
103857
  const offset = new Vector3();
103580
- const quat = new Quaternion().setFromUnitVectors(object.up, new Vector3(0, 1, 0));
103858
+ const quat = new Quaternion().setFromUnitVectors(object2.up, new Vector3(0, 1, 0));
103581
103859
  const quatInverse = quat.clone().invert();
103582
103860
  const lastPosition = new Vector3();
103583
103861
  const lastQuaternion = new Quaternion();
@@ -104142,8 +104420,8 @@ gl_FragDepth=readDepth(vUv);
104142
104420
  }
104143
104421
  };
104144
104422
  var MapControls = class extends OrbitControls {
104145
- constructor(object, domElement) {
104146
- super(object, domElement);
104423
+ constructor(object2, domElement) {
104424
+ super(object2, domElement);
104147
104425
  this.screenSpacePanning = false;
104148
104426
  this.mouseButtons.LEFT = MOUSE.PAN;
104149
104427
  this.mouseButtons.RIGHT = MOUSE.ROTATE;
@@ -105119,16 +105397,16 @@ gl_FragDepth=readDepth(vUv);
105119
105397
  if (!models) this.models.set(model, models = /* @__PURE__ */ new Map());
105120
105398
  const key = JSON.stringify([rotation.x, rotation.y, rotation.z, variant.uvlock, tints]);
105121
105399
  const template = await cached(models, key, async () => {
105122
- const object = new SectionModel(model, {
105400
+ const object2 = new SectionModel(model, {
105123
105401
  instanceMeshes: false,
105124
105402
  mergeMeshes: false,
105125
105403
  tints,
105126
105404
  uvLockRotation: variant.uvlock && (rotation.x !== 0 || rotation.y !== 0) ? [rotation.x, rotation.y, rotation.z] : void 0
105127
105405
  });
105128
- await object.init();
105129
- const geometry = object.children[0].geometry;
105406
+ await object2.init();
105407
+ const geometry = object2.children[0].geometry;
105130
105408
  geometry.applyMatrix4(new Matrix4().makeRotationFromEuler(rotation));
105131
- object.clear();
105409
+ object2.clear();
105132
105410
  const cullFaces = CUBE_FACES.map((face) => {
105133
105411
  const local = CUBE_FACES.findIndex((name2) => name2 === atlas.model.elements[0].faces[face]?.cullface);
105134
105412
  if (local < 0) return 0;
@@ -105316,10 +105594,10 @@ gl_FragDepth=readDepth(vUv);
105316
105594
  await block.object.updateFluid((x4, y5, z4) => {
105317
105595
  const neighbor = pos.clone().add(new Vector3(x4, y5, z4));
105318
105596
  const section = this.getChunkAt(neighbor);
105319
- const object = section?.isBlockVisibleAt(neighbor) ? section.getBlockAt(neighbor)?.object : void 0;
105597
+ const object2 = section?.isBlockVisibleAt(neighbor) ? section.getBlockAt(neighbor)?.object : void 0;
105320
105598
  return {
105321
- fluid: object?.fluidKind,
105322
- level: object?.fluidLevel,
105599
+ fluid: object2?.fluidKind,
105600
+ level: object2?.fluidLevel,
105323
105601
  solid: section?.isOccludingAt(neighbor) ?? false
105324
105602
  };
105325
105603
  });
@@ -105442,14 +105720,17 @@ gl_FragDepth=readDepth(vUv);
105442
105720
  for (const { atlas, x: x4, y: y5 } of page.placements) {
105443
105721
  context.drawImage(atlas.image.canvas, x4, y5);
105444
105722
  }
105445
- const positions = [], normals = [], uvs = [], colors = [], indices = [];
105723
+ const positions = [], normals = [], uvs = [], uvBounds = [], colors = [], indices = [];
105446
105724
  for (const { index, template, cullMask } of page.entries) {
105447
105725
  const position = template.geometry.getAttribute("position");
105448
105726
  const normal = template.geometry.getAttribute("normal");
105449
105727
  const uv = template.geometry.getAttribute("uv");
105728
+ const bounds = template.geometry.getAttribute("uvBounds");
105450
105729
  const color2 = template.geometry.getAttribute("color");
105451
105730
  const sourceIndices = template.geometry.getIndex();
105452
105731
  const placement = locations.get(template.atlas).placement;
105732
+ const mapU = (u4) => (placement.x + u4 * template.atlas.image.width) / page.width;
105733
+ const mapV = (v5) => 1 - (placement.y + (1 - v5) * template.atlas.image.height) / page.height;
105453
105734
  const offsetX = index % 16 * 16;
105454
105735
  const offsetY = Math.floor(index / 256) * 16;
105455
105736
  const offsetZ = Math.floor(index / 16) % 16 * 16;
@@ -105460,9 +105741,12 @@ gl_FragDepth=readDepth(vUv);
105460
105741
  const vertex2 = face * 4 + corner;
105461
105742
  positions.push(position.getX(vertex2) + offsetX, position.getY(vertex2) + offsetY, position.getZ(vertex2) + offsetZ);
105462
105743
  normals.push(normal.getX(vertex2), normal.getY(vertex2), normal.getZ(vertex2));
105463
- uvs.push(
105464
- (placement.x + uv.getX(vertex2) * template.atlas.image.width) / page.width,
105465
- 1 - (placement.y + (1 - uv.getY(vertex2)) * template.atlas.image.height) / page.height
105744
+ uvs.push(mapU(uv.getX(vertex2)), mapV(uv.getY(vertex2)));
105745
+ uvBounds.push(
105746
+ mapU(bounds?.getX(vertex2) ?? 0),
105747
+ mapV(bounds?.getY(vertex2) ?? 0),
105748
+ mapU(bounds?.getZ(vertex2) ?? 1),
105749
+ mapV(bounds?.getW(vertex2) ?? 1)
105466
105750
  );
105467
105751
  colors.push(color2?.getX(vertex2) ?? 1, color2?.getY(vertex2) ?? 1, color2?.getZ(vertex2) ?? 1);
105468
105752
  }
@@ -105473,11 +105757,12 @@ gl_FragDepth=readDepth(vUv);
105473
105757
  geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
105474
105758
  geometry.setAttribute("normal", new Float32BufferAttribute(normals, 3));
105475
105759
  geometry.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
105760
+ geometry.setAttribute("uvBounds", new Float32BufferAttribute(uvBounds, 4));
105476
105761
  geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
105477
105762
  geometry.setIndex(indices);
105478
105763
  geometry.computeBoundingBox();
105479
105764
  geometry.computeBoundingSphere();
105480
- const material = Materials.createShadedCanvasMaterial(canvas, false);
105765
+ const material = Materials.createShadedCanvasMaterial(canvas, false, false, true);
105481
105766
  material.vertexColors = true;
105482
105767
  const texture = material.uniforms?.map?.value ?? material.map;
105483
105768
  const mesh = new Mesh(geometry, material);
@@ -105551,7 +105836,7 @@ gl_FragDepth=readDepth(vUv);
105551
105836
  this.renderedBlocks.get(index)?.object?.removeFromScene();
105552
105837
  if (this.sectionBlocks.delete(index)) this.meshDirty = true;
105553
105838
  this.renderedBlocks.delete(index);
105554
- let object;
105839
+ let object2;
105555
105840
  try {
105556
105841
  if (!readBlock) return void 0;
105557
105842
  const stored = readBlock();
@@ -105566,22 +105851,22 @@ gl_FragDepth=readDepth(vUv);
105566
105851
  this.sectionBlocks.set(index, { index, template, cullMask: 0 });
105567
105852
  this.meshDirty = true;
105568
105853
  } else {
105569
- object = await this.scene.addBlock(blockState, {
105854
+ object2 = await this.scene.addBlock(blockState, {
105570
105855
  mergeMeshes: true,
105571
105856
  instanceMeshes: true,
105572
105857
  maxInstanceCount: 2e3,
105573
105858
  initialState: stored.properties
105574
105859
  });
105575
- object.setPosition(MineRenderWorld.worldToScenePosition(worldPos));
105860
+ object2.setPosition(MineRenderWorld.worldToScenePosition(worldPos));
105576
105861
  }
105577
105862
  const info = { get block() {
105578
105863
  return readBlock();
105579
- }, object };
105864
+ }, object: object2 };
105580
105865
  this.renderedBlocks.set(index, info);
105581
105866
  return info;
105582
105867
  } catch (error2) {
105583
105868
  this.data.set(index, void 0);
105584
- object?.removeFromScene();
105869
+ object2?.removeFromScene();
105585
105870
  throw error2;
105586
105871
  } finally {
105587
105872
  await onBlocksChanged?.([worldPos]);