@galacean/effects-threejs 2.0.0-alpha.26 → 2.0.0-alpha.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.0.0-alpha.26
6
+ * Version: v2.0.0-alpha.27
7
7
  */
8
8
 
9
9
  'use strict';
@@ -4023,13 +4023,29 @@ var RenderFace;
4023
4023
  RenderFace["Front"] = "Front";
4024
4024
  })(RenderFace || (RenderFace = {}));
4025
4025
 
4026
- var END_BEHAVIOR_DESTROY = 0;
4027
- var END_BEHAVIOR_PAUSE = 1;
4028
- var END_BEHAVIOR_FORWARD = 2;
4029
- var END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
4030
- var END_BEHAVIOR_FREEZE = 4;
4031
- var END_BEHAVIOR_RESTART = 5;
4032
- var END_BEHAVIOR_DESTROY_CHILDREN = 6;
4026
+ /**
4027
+ * 销毁
4028
+ */ var END_BEHAVIOR_DESTROY = 0;
4029
+ /**
4030
+ * 暂停
4031
+ * @deprecated since 2.0 - use `END_BEHAVIOR_FREEZE` instead
4032
+ */ var END_BEHAVIOR_PAUSE = 1;
4033
+ /**
4034
+ * 无限播放
4035
+ */ var END_BEHAVIOR_FORWARD = 2;
4036
+ /**
4037
+ * 销毁并保留最后一帧
4038
+ * @deprecated since 2.0
4039
+ */ var END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
4040
+ /**
4041
+ * 冻结
4042
+ */ var END_BEHAVIOR_FREEZE = 4;
4043
+ /**
4044
+ * 重播
4045
+ */ var END_BEHAVIOR_RESTART = 5;
4046
+ /**
4047
+ *
4048
+ */ var END_BEHAVIOR_DESTROY_CHILDREN = 6;
4033
4049
  var CAMERA_CLIP_MODE_VERTICAL = 1;
4034
4050
  var CAMERA_CLIP_MODE_NORMAL = 0;
4035
4051
  var MESSAGE_ITEM_PHRASE_BEGIN = 2;
@@ -4044,29 +4060,6 @@ var CameraClipMode;
4044
4060
  * 剪裁左右
4045
4061
  */ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
4046
4062
  })(CameraClipMode || (CameraClipMode = {}));
4047
- /**
4048
- * 结束行为
4049
- */ var CompositionEndBehavior;
4050
- (function(CompositionEndBehavior) {
4051
- /**
4052
- * 销毁
4053
- */ CompositionEndBehavior[CompositionEndBehavior["destroy"] = 0] = "destroy";
4054
- /**
4055
- * 暂停
4056
- */ CompositionEndBehavior[CompositionEndBehavior["pause"] = 1] = "pause";
4057
- /**
4058
- * 重播
4059
- */ CompositionEndBehavior[CompositionEndBehavior["restart"] = 5] = "restart";
4060
- /**
4061
- * 无限播放
4062
- */ CompositionEndBehavior[CompositionEndBehavior["forward"] = 2] = "forward";
4063
- /**
4064
- * 销毁并保留最后一帧
4065
- */ CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = 3] = "pause_destroy";
4066
- /**
4067
- * 冻结
4068
- */ CompositionEndBehavior[CompositionEndBehavior["freeze"] = 4] = "freeze";
4069
- })(CompositionEndBehavior || (CompositionEndBehavior = {}));
4070
4063
 
4071
4064
  /**
4072
4065
  * 动态换图类型
@@ -4147,12 +4140,23 @@ var CameraClipMode;
4147
4140
  BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
4148
4141
  })(BezierKeyframeType || (BezierKeyframeType = {}));
4149
4142
 
4150
- var ItemEndBehavior;
4151
- (function(ItemEndBehavior) {
4152
- ItemEndBehavior[ItemEndBehavior["destroy"] = 0] = "destroy";
4153
- ItemEndBehavior[ItemEndBehavior["loop"] = 5] = "loop";
4154
- ItemEndBehavior[ItemEndBehavior["freeze"] = 4] = "freeze";
4155
- })(ItemEndBehavior || (ItemEndBehavior = {}));
4143
+ /**
4144
+ * 结束行为
4145
+ */ var EndBehavior;
4146
+ (function(EndBehavior) {
4147
+ /**
4148
+ * 销毁
4149
+ */ EndBehavior[EndBehavior["destroy"] = 0] = "destroy";
4150
+ /**
4151
+ * 重播
4152
+ */ EndBehavior[EndBehavior["restart"] = 5] = "restart";
4153
+ /**
4154
+ * 无限播放
4155
+ */ EndBehavior[EndBehavior["forward"] = 2] = "forward";
4156
+ /**
4157
+ * 冻结
4158
+ */ EndBehavior[EndBehavior["freeze"] = 4] = "freeze";
4159
+ })(EndBehavior || (EndBehavior = {}));
4156
4160
  var ParentItemEndBehavior;
4157
4161
  (function(ParentItemEndBehavior) {
4158
4162
  ParentItemEndBehavior[ParentItemEndBehavior["destroyChildren"] = 6] = "destroyChildren";
@@ -4477,7 +4481,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
4477
4481
  get RenderType () { return RenderType; },
4478
4482
  get RenderFace () { return RenderFace; },
4479
4483
  get CameraClipMode () { return CameraClipMode; },
4480
- get CompositionEndBehavior () { return CompositionEndBehavior; },
4481
4484
  get BackgroundType () { return BackgroundType; },
4482
4485
  END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY,
4483
4486
  END_BEHAVIOR_PAUSE: END_BEHAVIOR_PAUSE,
@@ -4492,7 +4495,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
4492
4495
  MESSAGE_ITEM_PHRASE_END: MESSAGE_ITEM_PHRASE_END,
4493
4496
  get ValueType () { return ValueType; },
4494
4497
  get BezierKeyframeType () { return BezierKeyframeType; },
4495
- get ItemEndBehavior () { return ItemEndBehavior; },
4498
+ get EndBehavior () { return EndBehavior; },
4496
4499
  get ParentItemEndBehavior () { return ParentItemEndBehavior; },
4497
4500
  get ParticleInteractionBehavior () { return ParticleInteractionBehavior; },
4498
4501
  get ShapeArcMode () { return ShapeArcMode; },
@@ -16642,7 +16645,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
16642
16645
  }
16643
16646
  }
16644
16647
  }
16645
- } else if (this.item.endBehavior === ItemEndBehavior.loop) {
16648
+ } else if (this.item.endBehavior === EndBehavior.restart) {
16646
16649
  updateTrail();
16647
16650
  this.loopStartTime = now - duration;
16648
16651
  this.lastEmitTime -= duration;
@@ -16661,12 +16664,12 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
16661
16664
  this.ended = true;
16662
16665
  this.onEnd(this);
16663
16666
  var endBehavior = this.item.endBehavior;
16664
- if (endBehavior === ItemEndBehavior.freeze) {
16667
+ if (endBehavior === EndBehavior.freeze) {
16665
16668
  this.frozen = true;
16666
16669
  }
16667
16670
  }
16668
- } else if (this.item.endBehavior !== ItemEndBehavior.loop) {
16669
- if (ItemEndBehavior.destroy === this.item.endBehavior) {
16671
+ } else if (this.item.endBehavior !== EndBehavior.restart) {
16672
+ if (EndBehavior.destroy === this.item.endBehavior) {
16670
16673
  var node = link.last;
16671
16674
  if (node && node.content[0] < this.lastUpdate) {
16672
16675
  this.destroyed = true;
@@ -18746,9 +18749,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
18746
18749
  var localTime = time - this.start;
18747
18750
  var duration = this.duration;
18748
18751
  if (localTime - duration > 0.001) {
18749
- if (this.endBehavior === ItemEndBehavior.loop) {
18752
+ if (this.endBehavior === EndBehavior.restart) {
18750
18753
  localTime = localTime % duration;
18751
- } else if (this.endBehavior === ItemEndBehavior.freeze) {
18754
+ } else if (this.endBehavior === EndBehavior.freeze) {
18752
18755
  localTime = Math.min(duration, localTime);
18753
18756
  }
18754
18757
  }
@@ -18874,7 +18877,7 @@ var RuntimeClip = /*#__PURE__*/ function() {
18874
18877
  var ended = false;
18875
18878
  var started = false;
18876
18879
  var boundObject = this.track.binding;
18877
- if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === ItemEndBehavior.destroy) {
18880
+ if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === EndBehavior.destroy) {
18878
18881
  if (_instanceof1(boundObject, exports.VFXItem) && exports.VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
18879
18882
  weight = 1.0;
18880
18883
  } else {
@@ -19182,7 +19185,7 @@ function compareTracks(a, b) {
19182
19185
  this.resolveBindings();
19183
19186
  this.timelinePlayable = this.timelineAsset.createPlayable(this.graph);
19184
19187
  // 重播不销毁元素
19185
- if (this.item.endBehavior !== ItemEndBehavior.destroy) {
19188
+ if (this.item.endBehavior !== EndBehavior.destroy) {
19186
19189
  this.setReusable(true);
19187
19190
  }
19188
19191
  };
@@ -19249,7 +19252,7 @@ function compareTracks(a, b) {
19249
19252
  compositionComponent.refId = refId;
19250
19253
  item.transform.parentTransform = this.transform;
19251
19254
  this.item.composition.refContent.push(item);
19252
- if (item.endBehavior === ItemEndBehavior.loop) {
19255
+ if (item.endBehavior === EndBehavior.restart) {
19253
19256
  this.item.composition.autoRefTex = false;
19254
19257
  }
19255
19258
  compositionComponent.createContent();
@@ -22231,8 +22234,8 @@ function getStandardCameraContent(model) {
22231
22234
  json.compositions.forEach(function(composition) {
22232
22235
  composition.items.forEach(function(item) {
22233
22236
  if (item.type === ItemType.null) {
22234
- if (item.endBehavior === ItemEndBehavior.destroy) {
22235
- item.endBehavior = ItemEndBehavior.freeze;
22237
+ if (item.endBehavior === EndBehavior.destroy) {
22238
+ item.endBehavior = EndBehavior.freeze;
22236
22239
  }
22237
22240
  }
22238
22241
  });
@@ -22251,7 +22254,7 @@ function getStandardCameraContent(model) {
22251
22254
  json.compositions.forEach(function(composition) {
22252
22255
  composition.items.forEach(function(item) {
22253
22256
  if (item.type === ItemType.mesh || item.type === ItemType.light) {
22254
- item.endBehavior = item.endBehavior === 1 ? ItemEndBehavior.destroy : item.endBehavior;
22257
+ item.endBehavior = item.endBehavior === 1 ? EndBehavior.destroy : item.endBehavior;
22255
22258
  }
22256
22259
  });
22257
22260
  });
@@ -22263,7 +22266,11 @@ function getStandardCameraContent(model) {
22263
22266
  var _loop = function() {
22264
22267
  var composition = _step1.value;
22265
22268
  // composition 的 endBehavior 兼容
22266
- if (composition.endBehavior === CompositionEndBehavior.pause_destroy || composition.endBehavior === CompositionEndBehavior.pause) {
22269
+ if (// @ts-expect-error
22270
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
22271
+ composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || // @ts-expect-error
22272
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
22273
+ composition.endBehavior === END_BEHAVIOR_PAUSE) {
22267
22274
  composition.endBehavior = END_BEHAVIOR_FREEZE;
22268
22275
  }
22269
22276
  // 过滤掉滤镜元素
@@ -23050,13 +23057,13 @@ function getStandardItem(item, opt) {
23050
23057
  var looping = (_originContent_options = originContent.options) == null ? void 0 : _originContent_options.looping;
23051
23058
  if (looping) {
23052
23059
  if (Array.isArray(looping)) {
23053
- endBehavior = looping[1] ? ItemEndBehavior.loop : ItemEndBehavior.destroy;
23060
+ endBehavior = looping[1] ? EndBehavior.restart : EndBehavior.destroy;
23054
23061
  } else {
23055
- endBehavior = ItemEndBehavior.loop;
23062
+ endBehavior = EndBehavior.restart;
23056
23063
  }
23057
23064
  } else {
23058
23065
  var _originContent_options1;
23059
- endBehavior = endBehavior || (originContent == null ? void 0 : (_originContent_options1 = originContent.options) == null ? void 0 : _originContent_options1.endBehavior) || ItemEndBehavior.destroy;
23066
+ endBehavior = endBehavior || (originContent == null ? void 0 : (_originContent_options1 = originContent.options) == null ? void 0 : _originContent_options1.endBehavior) || EndBehavior.destroy;
23060
23067
  }
23061
23068
  if (originContent.options.renderLevel) {
23062
23069
  renderLevel = originContent.options.renderLevel;
@@ -24401,7 +24408,7 @@ var listOrder = 0;
24401
24408
  id: id,
24402
24409
  duration: duration,
24403
24410
  name: name,
24404
- endBehavior: isNaN(endBehavior) ? END_BEHAVIOR_PAUSE : endBehavior,
24411
+ endBehavior: isNaN(endBehavior) ? EndBehavior.freeze : endBehavior,
24405
24412
  // looping,
24406
24413
  items: items,
24407
24414
  camera: camera,
@@ -24585,7 +24592,7 @@ var listOrder = 0;
24585
24592
  };
24586
24593
  this.reusable = reusable;
24587
24594
  this.speed = speed;
24588
- this.autoRefTex = !this.keepResource && imageUsage && this.rootItem.endBehavior !== ItemEndBehavior.loop;
24595
+ this.autoRefTex = !this.keepResource && imageUsage && this.rootItem.endBehavior !== EndBehavior.restart;
24589
24596
  this.name = sourceContent.name;
24590
24597
  this.pluginSystem = pluginSystem;
24591
24598
  this.pluginSystem.initializeComposition(this, scene);
@@ -24785,7 +24792,7 @@ var listOrder = 0;
24785
24792
  * @returns 重新播放合成标志位
24786
24793
  */ _proto.shouldRestart = function shouldRestart() {
24787
24794
  var _this_rootItem = this.rootItem, ended = _this_rootItem.ended, endBehavior = _this_rootItem.endBehavior;
24788
- return ended && endBehavior === ItemEndBehavior.loop;
24795
+ return ended && endBehavior === EndBehavior.restart;
24789
24796
  };
24790
24797
  /**
24791
24798
  * 是否合成需要销毁
@@ -24838,9 +24845,9 @@ var listOrder = 0;
24838
24845
  var localTime = time - this.rootItem.start;
24839
24846
  var duration = this.rootItem.duration;
24840
24847
  if (localTime - duration > 0.001) {
24841
- if (this.rootItem.endBehavior === ItemEndBehavior.loop) {
24848
+ if (this.rootItem.endBehavior === EndBehavior.restart) {
24842
24849
  localTime = localTime % duration;
24843
- } else if (this.rootItem.endBehavior === ItemEndBehavior.freeze) {
24850
+ } else if (this.rootItem.endBehavior === EndBehavior.freeze) {
24844
24851
  localTime = Math.min(duration, localTime);
24845
24852
  }
24846
24853
  }
@@ -24891,7 +24898,7 @@ var listOrder = 0;
24891
24898
  for(var _iterator2 = _create_for_of_iterator_helper_loose(item.children), _step2; !(_step2 = _iterator2()).done;){
24892
24899
  var child = _step2.value;
24893
24900
  if (exports.VFXItem.isComposition(child)) {
24894
- if (child.ended && child.endBehavior === ItemEndBehavior.loop) {
24901
+ if (child.ended && child.endBehavior === EndBehavior.restart) {
24895
24902
  child.ended = false;
24896
24903
  // TODO K帧动画在元素重建后需要 tick ,否则会导致元素位置和 k 帧第一帧位置不一致
24897
24904
  this.callUpdate(child, 0);
@@ -25102,7 +25109,7 @@ var listOrder = 0;
25102
25109
  var _this = this;
25103
25110
  // 预合成元素销毁时销毁其中的item
25104
25111
  if (item.type == ItemType.composition) {
25105
- if (item.endBehavior !== ItemEndBehavior.freeze) {
25112
+ if (item.endBehavior !== EndBehavior.freeze) {
25106
25113
  var contentItems = item.getComponent(CompositionComponent).items;
25107
25114
  contentItems.forEach(function(it) {
25108
25115
  return _this.pluginSystem.plugins.forEach(function(loader) {
@@ -25361,6 +25368,1567 @@ var listOrder = 0;
25361
25368
  return Composition;
25362
25369
  }();
25363
25370
 
25371
+ var SIZEOF_SHORT = 2;
25372
+ var SIZEOF_INT = 4;
25373
+ var FILE_IDENTIFIER_LENGTH = 4;
25374
+ var SIZE_PREFIX_LENGTH = 4;
25375
+
25376
+ var int32 = new Int32Array(2);
25377
+ var float32 = new Float32Array(int32.buffer);
25378
+ var float64 = new Float64Array(int32.buffer);
25379
+ var isLittleEndian = new Uint16Array(new Uint8Array([
25380
+ 1,
25381
+ 0
25382
+ ]).buffer)[0] === 1;
25383
+
25384
+ var Encoding;
25385
+ (function(Encoding) {
25386
+ Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES";
25387
+ Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING";
25388
+ })(Encoding || (Encoding = {}));
25389
+
25390
+ var ByteBuffer = /*#__PURE__*/ function() {
25391
+ function ByteBuffer(bytes_) {
25392
+ this.bytes_ = bytes_;
25393
+ this.position_ = 0;
25394
+ this.text_decoder_ = new TextDecoder();
25395
+ }
25396
+ var _proto = ByteBuffer.prototype;
25397
+ _proto.clear = function clear() {
25398
+ this.position_ = 0;
25399
+ };
25400
+ /**
25401
+ * Get the underlying `Uint8Array`.
25402
+ */ _proto.bytes = function bytes() {
25403
+ return this.bytes_;
25404
+ };
25405
+ /**
25406
+ * Get the buffer's position.
25407
+ */ _proto.position = function position() {
25408
+ return this.position_;
25409
+ };
25410
+ /**
25411
+ * Set the buffer's position.
25412
+ */ _proto.setPosition = function setPosition(position) {
25413
+ this.position_ = position;
25414
+ };
25415
+ /**
25416
+ * Get the buffer's capacity.
25417
+ */ _proto.capacity = function capacity() {
25418
+ return this.bytes_.length;
25419
+ };
25420
+ _proto.readInt8 = function readInt8(offset) {
25421
+ return this.readUint8(offset) << 24 >> 24;
25422
+ };
25423
+ _proto.readUint8 = function readUint8(offset) {
25424
+ return this.bytes_[offset];
25425
+ };
25426
+ _proto.readInt16 = function readInt16(offset) {
25427
+ return this.readUint16(offset) << 16 >> 16;
25428
+ };
25429
+ _proto.readUint16 = function readUint16(offset) {
25430
+ return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
25431
+ };
25432
+ _proto.readInt32 = function readInt32(offset) {
25433
+ return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
25434
+ };
25435
+ _proto.readUint32 = function readUint32(offset) {
25436
+ return this.readInt32(offset) >>> 0;
25437
+ };
25438
+ _proto.readInt64 = function readInt64(offset) {
25439
+ return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
25440
+ };
25441
+ _proto.readUint64 = function readUint64(offset) {
25442
+ return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
25443
+ };
25444
+ _proto.readFloat32 = function readFloat32(offset) {
25445
+ int32[0] = this.readInt32(offset);
25446
+ return float32[0];
25447
+ };
25448
+ _proto.readFloat64 = function readFloat64(offset) {
25449
+ int32[isLittleEndian ? 0 : 1] = this.readInt32(offset);
25450
+ int32[isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
25451
+ return float64[0];
25452
+ };
25453
+ _proto.writeInt8 = function writeInt8(offset, value) {
25454
+ this.bytes_[offset] = value;
25455
+ };
25456
+ _proto.writeUint8 = function writeUint8(offset, value) {
25457
+ this.bytes_[offset] = value;
25458
+ };
25459
+ _proto.writeInt16 = function writeInt16(offset, value) {
25460
+ this.bytes_[offset] = value;
25461
+ this.bytes_[offset + 1] = value >> 8;
25462
+ };
25463
+ _proto.writeUint16 = function writeUint16(offset, value) {
25464
+ this.bytes_[offset] = value;
25465
+ this.bytes_[offset + 1] = value >> 8;
25466
+ };
25467
+ _proto.writeInt32 = function writeInt32(offset, value) {
25468
+ this.bytes_[offset] = value;
25469
+ this.bytes_[offset + 1] = value >> 8;
25470
+ this.bytes_[offset + 2] = value >> 16;
25471
+ this.bytes_[offset + 3] = value >> 24;
25472
+ };
25473
+ _proto.writeUint32 = function writeUint32(offset, value) {
25474
+ this.bytes_[offset] = value;
25475
+ this.bytes_[offset + 1] = value >> 8;
25476
+ this.bytes_[offset + 2] = value >> 16;
25477
+ this.bytes_[offset + 3] = value >> 24;
25478
+ };
25479
+ _proto.writeInt64 = function writeInt64(offset, value) {
25480
+ this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
25481
+ this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
25482
+ };
25483
+ _proto.writeUint64 = function writeUint64(offset, value) {
25484
+ this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
25485
+ this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
25486
+ };
25487
+ _proto.writeFloat32 = function writeFloat32(offset, value) {
25488
+ float32[0] = value;
25489
+ this.writeInt32(offset, int32[0]);
25490
+ };
25491
+ _proto.writeFloat64 = function writeFloat64(offset, value) {
25492
+ float64[0] = value;
25493
+ this.writeInt32(offset, int32[isLittleEndian ? 0 : 1]);
25494
+ this.writeInt32(offset + 4, int32[isLittleEndian ? 1 : 0]);
25495
+ };
25496
+ /**
25497
+ * Return the file identifier. Behavior is undefined for FlatBuffers whose
25498
+ * schema does not include a file_identifier (likely points at padding or the
25499
+ * start of a the root vtable).
25500
+ */ _proto.getBufferIdentifier = function getBufferIdentifier() {
25501
+ if (this.bytes_.length < this.position_ + SIZEOF_INT + FILE_IDENTIFIER_LENGTH) {
25502
+ throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
25503
+ }
25504
+ var result = "";
25505
+ for(var i = 0; i < FILE_IDENTIFIER_LENGTH; i++){
25506
+ result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));
25507
+ }
25508
+ return result;
25509
+ };
25510
+ /**
25511
+ * Look up a field in the vtable, return an offset into the object, or 0 if the
25512
+ * field is not present.
25513
+ */ _proto.__offset = function __offset(bb_pos, vtable_offset) {
25514
+ var vtable = bb_pos - this.readInt32(bb_pos);
25515
+ return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
25516
+ };
25517
+ /**
25518
+ * Initialize any Table-derived type to point to the union at the given offset.
25519
+ */ _proto.__union = function __union(t, offset) {
25520
+ t.bb_pos = offset + this.readInt32(offset);
25521
+ t.bb = this;
25522
+ return t;
25523
+ };
25524
+ /**
25525
+ * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
25526
+ * This allocates a new string and converts to wide chars upon each access.
25527
+ *
25528
+ * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
25529
+ * "optionalEncoding" argument. This is useful for avoiding conversion when
25530
+ * the data will just be packaged back up in another FlatBuffer later on.
25531
+ *
25532
+ * @param offset
25533
+ * @param opt_encoding Defaults to UTF16_STRING
25534
+ */ _proto.__string = function __string(offset, opt_encoding) {
25535
+ offset += this.readInt32(offset);
25536
+ var length = this.readInt32(offset);
25537
+ offset += SIZEOF_INT;
25538
+ var utf8bytes = this.bytes_.subarray(offset, offset + length);
25539
+ if (opt_encoding === Encoding.UTF8_BYTES) return utf8bytes;
25540
+ else return this.text_decoder_.decode(utf8bytes);
25541
+ };
25542
+ /**
25543
+ * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
25544
+ * if a string then return a new one
25545
+ *
25546
+ * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
25547
+ * makes the behaviour of __union_with_string different compared to __union
25548
+ */ _proto.__union_with_string = function __union_with_string(o, offset) {
25549
+ if (typeof o === "string") {
25550
+ return this.__string(offset);
25551
+ }
25552
+ return this.__union(o, offset);
25553
+ };
25554
+ /**
25555
+ * Retrieve the relative offset stored at "offset"
25556
+ */ _proto.__indirect = function __indirect(offset) {
25557
+ return offset + this.readInt32(offset);
25558
+ };
25559
+ /**
25560
+ * Get the start of data of a vector whose offset is stored at "offset" in this object.
25561
+ */ _proto.__vector = function __vector(offset) {
25562
+ return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length
25563
+ };
25564
+ /**
25565
+ * Get the length of a vector whose offset is stored at "offset" in this object.
25566
+ */ _proto.__vector_len = function __vector_len(offset) {
25567
+ return this.readInt32(offset + this.readInt32(offset));
25568
+ };
25569
+ _proto.__has_identifier = function __has_identifier(ident) {
25570
+ if (ident.length != FILE_IDENTIFIER_LENGTH) {
25571
+ throw new Error("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
25572
+ }
25573
+ for(var i = 0; i < FILE_IDENTIFIER_LENGTH; i++){
25574
+ if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {
25575
+ return false;
25576
+ }
25577
+ }
25578
+ return true;
25579
+ };
25580
+ /**
25581
+ * A helper function for generating list for obj api
25582
+ */ _proto.createScalarList = function createScalarList(listAccessor, listLength) {
25583
+ var ret = [];
25584
+ for(var i = 0; i < listLength; ++i){
25585
+ var val = listAccessor(i);
25586
+ if (val !== null) {
25587
+ ret.push(val);
25588
+ }
25589
+ }
25590
+ return ret;
25591
+ };
25592
+ /**
25593
+ * A helper function for generating list for obj api
25594
+ * @param listAccessor function that accepts an index and return data at that index
25595
+ * @param listLength listLength
25596
+ * @param res result list
25597
+ */ _proto.createObjList = function createObjList(listAccessor, listLength) {
25598
+ var ret = [];
25599
+ for(var i = 0; i < listLength; ++i){
25600
+ var val = listAccessor(i);
25601
+ if (val !== null) {
25602
+ ret.push(val.unpack());
25603
+ }
25604
+ }
25605
+ return ret;
25606
+ };
25607
+ /**
25608
+ * Create and allocate a new ByteBuffer with a given size.
25609
+ */ ByteBuffer.allocate = function allocate(byte_size) {
25610
+ return new ByteBuffer(new Uint8Array(byte_size));
25611
+ };
25612
+ return ByteBuffer;
25613
+ }();
25614
+
25615
+ var Builder = /*#__PURE__*/ function() {
25616
+ function Builder(opt_initial_size) {
25617
+ /** Minimum alignment encountered so far. */ this.minalign = 1;
25618
+ /** The vtable for the current table. */ this.vtable = null;
25619
+ /** The amount of fields we're actually using. */ this.vtable_in_use = 0;
25620
+ /** Whether we are currently serializing a table. */ this.isNested = false;
25621
+ /** Starting offset of the current struct/table. */ this.object_start = 0;
25622
+ /** List of offsets of all vtables. */ this.vtables = [];
25623
+ /** For the current vector being built. */ this.vector_num_elems = 0;
25624
+ /** False omits default values from the serialized data */ this.force_defaults = false;
25625
+ this.string_maps = null;
25626
+ this.text_encoder = new TextEncoder();
25627
+ var initial_size;
25628
+ if (!opt_initial_size) {
25629
+ initial_size = 1024;
25630
+ } else {
25631
+ initial_size = opt_initial_size;
25632
+ }
25633
+ /**
25634
+ * @type {ByteBuffer}
25635
+ * @private
25636
+ */ this.bb = ByteBuffer.allocate(initial_size);
25637
+ this.space = initial_size;
25638
+ }
25639
+ var _proto = Builder.prototype;
25640
+ _proto.clear = function clear() {
25641
+ this.bb.clear();
25642
+ this.space = this.bb.capacity();
25643
+ this.minalign = 1;
25644
+ this.vtable = null;
25645
+ this.vtable_in_use = 0;
25646
+ this.isNested = false;
25647
+ this.object_start = 0;
25648
+ this.vtables = [];
25649
+ this.vector_num_elems = 0;
25650
+ this.force_defaults = false;
25651
+ this.string_maps = null;
25652
+ };
25653
+ /**
25654
+ * In order to save space, fields that are set to their default value
25655
+ * don't get serialized into the buffer. Forcing defaults provides a
25656
+ * way to manually disable this optimization.
25657
+ *
25658
+ * @param forceDefaults true always serializes default values
25659
+ */ _proto.forceDefaults = function forceDefaults(forceDefaults) {
25660
+ this.force_defaults = forceDefaults;
25661
+ };
25662
+ /**
25663
+ * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
25664
+ * called finish(). The actual data starts at the ByteBuffer's current position,
25665
+ * not necessarily at 0.
25666
+ */ _proto.dataBuffer = function dataBuffer() {
25667
+ return this.bb;
25668
+ };
25669
+ /**
25670
+ * Get the bytes representing the FlatBuffer. Only call this after you've
25671
+ * called finish().
25672
+ */ _proto.asUint8Array = function asUint8Array() {
25673
+ return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
25674
+ };
25675
+ /**
25676
+ * Prepare to write an element of `size` after `additional_bytes` have been
25677
+ * written, e.g. if you write a string, you need to align such the int length
25678
+ * field is aligned to 4 bytes, and the string data follows it directly. If all
25679
+ * you need to do is alignment, `additional_bytes` will be 0.
25680
+ *
25681
+ * @param size This is the of the new element to write
25682
+ * @param additional_bytes The padding size
25683
+ */ _proto.prep = function prep(size, additional_bytes) {
25684
+ // Track the biggest thing we've ever aligned to.
25685
+ if (size > this.minalign) {
25686
+ this.minalign = size;
25687
+ }
25688
+ // Find the amount of alignment needed such that `size` is properly
25689
+ // aligned after `additional_bytes`
25690
+ var align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
25691
+ // Reallocate the buffer if needed.
25692
+ while(this.space < align_size + size + additional_bytes){
25693
+ var old_buf_size = this.bb.capacity();
25694
+ this.bb = Builder.growByteBuffer(this.bb);
25695
+ this.space += this.bb.capacity() - old_buf_size;
25696
+ }
25697
+ this.pad(align_size);
25698
+ };
25699
+ _proto.pad = function pad(byte_size) {
25700
+ for(var i = 0; i < byte_size; i++){
25701
+ this.bb.writeInt8(--this.space, 0);
25702
+ }
25703
+ };
25704
+ _proto.writeInt8 = function writeInt8(value) {
25705
+ this.bb.writeInt8(this.space -= 1, value);
25706
+ };
25707
+ _proto.writeInt16 = function writeInt16(value) {
25708
+ this.bb.writeInt16(this.space -= 2, value);
25709
+ };
25710
+ _proto.writeInt32 = function writeInt32(value) {
25711
+ this.bb.writeInt32(this.space -= 4, value);
25712
+ };
25713
+ _proto.writeInt64 = function writeInt64(value) {
25714
+ this.bb.writeInt64(this.space -= 8, value);
25715
+ };
25716
+ _proto.writeFloat32 = function writeFloat32(value) {
25717
+ this.bb.writeFloat32(this.space -= 4, value);
25718
+ };
25719
+ _proto.writeFloat64 = function writeFloat64(value) {
25720
+ this.bb.writeFloat64(this.space -= 8, value);
25721
+ };
25722
+ /**
25723
+ * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
25724
+ * @param value The `int8` to add the buffer.
25725
+ */ _proto.addInt8 = function addInt8(value) {
25726
+ this.prep(1, 0);
25727
+ this.writeInt8(value);
25728
+ };
25729
+ /**
25730
+ * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
25731
+ * @param value The `int16` to add the buffer.
25732
+ */ _proto.addInt16 = function addInt16(value) {
25733
+ this.prep(2, 0);
25734
+ this.writeInt16(value);
25735
+ };
25736
+ /**
25737
+ * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
25738
+ * @param value The `int32` to add the buffer.
25739
+ */ _proto.addInt32 = function addInt32(value) {
25740
+ this.prep(4, 0);
25741
+ this.writeInt32(value);
25742
+ };
25743
+ /**
25744
+ * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
25745
+ * @param value The `int64` to add the buffer.
25746
+ */ _proto.addInt64 = function addInt64(value) {
25747
+ this.prep(8, 0);
25748
+ this.writeInt64(value);
25749
+ };
25750
+ /**
25751
+ * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
25752
+ * @param value The `float32` to add the buffer.
25753
+ */ _proto.addFloat32 = function addFloat32(value) {
25754
+ this.prep(4, 0);
25755
+ this.writeFloat32(value);
25756
+ };
25757
+ /**
25758
+ * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
25759
+ * @param value The `float64` to add the buffer.
25760
+ */ _proto.addFloat64 = function addFloat64(value) {
25761
+ this.prep(8, 0);
25762
+ this.writeFloat64(value);
25763
+ };
25764
+ _proto.addFieldInt8 = function addFieldInt8(voffset, value, defaultValue) {
25765
+ if (this.force_defaults || value != defaultValue) {
25766
+ this.addInt8(value);
25767
+ this.slot(voffset);
25768
+ }
25769
+ };
25770
+ _proto.addFieldInt16 = function addFieldInt16(voffset, value, defaultValue) {
25771
+ if (this.force_defaults || value != defaultValue) {
25772
+ this.addInt16(value);
25773
+ this.slot(voffset);
25774
+ }
25775
+ };
25776
+ _proto.addFieldInt32 = function addFieldInt32(voffset, value, defaultValue) {
25777
+ if (this.force_defaults || value != defaultValue) {
25778
+ this.addInt32(value);
25779
+ this.slot(voffset);
25780
+ }
25781
+ };
25782
+ _proto.addFieldInt64 = function addFieldInt64(voffset, value, defaultValue) {
25783
+ if (this.force_defaults || value !== defaultValue) {
25784
+ this.addInt64(value);
25785
+ this.slot(voffset);
25786
+ }
25787
+ };
25788
+ _proto.addFieldFloat32 = function addFieldFloat32(voffset, value, defaultValue) {
25789
+ if (this.force_defaults || value != defaultValue) {
25790
+ this.addFloat32(value);
25791
+ this.slot(voffset);
25792
+ }
25793
+ };
25794
+ _proto.addFieldFloat64 = function addFieldFloat64(voffset, value, defaultValue) {
25795
+ if (this.force_defaults || value != defaultValue) {
25796
+ this.addFloat64(value);
25797
+ this.slot(voffset);
25798
+ }
25799
+ };
25800
+ _proto.addFieldOffset = function addFieldOffset(voffset, value, defaultValue) {
25801
+ if (this.force_defaults || value != defaultValue) {
25802
+ this.addOffset(value);
25803
+ this.slot(voffset);
25804
+ }
25805
+ };
25806
+ /**
25807
+ * Structs are stored inline, so nothing additional is being added. `d` is always 0.
25808
+ */ _proto.addFieldStruct = function addFieldStruct(voffset, value, defaultValue) {
25809
+ if (value != defaultValue) {
25810
+ this.nested(value);
25811
+ this.slot(voffset);
25812
+ }
25813
+ };
25814
+ /**
25815
+ * Structures are always stored inline, they need to be created right
25816
+ * where they're used. You'll get this assertion failure if you
25817
+ * created it elsewhere.
25818
+ */ _proto.nested = function nested(obj) {
25819
+ if (obj != this.offset()) {
25820
+ throw new TypeError("FlatBuffers: struct must be serialized inline.");
25821
+ }
25822
+ };
25823
+ /**
25824
+ * Should not be creating any other object, string or vector
25825
+ * while an object is being constructed
25826
+ */ _proto.notNested = function notNested() {
25827
+ if (this.isNested) {
25828
+ throw new TypeError("FlatBuffers: object serialization must not be nested.");
25829
+ }
25830
+ };
25831
+ /**
25832
+ * Set the current vtable at `voffset` to the current location in the buffer.
25833
+ */ _proto.slot = function slot(voffset) {
25834
+ if (this.vtable !== null) this.vtable[voffset] = this.offset();
25835
+ };
25836
+ /**
25837
+ * @returns Offset relative to the end of the buffer.
25838
+ */ _proto.offset = function offset() {
25839
+ return this.bb.capacity() - this.space;
25840
+ };
25841
+ /**
25842
+ * Adds on offset, relative to where it will be written.
25843
+ *
25844
+ * @param offset The offset to add.
25845
+ */ _proto.addOffset = function addOffset(offset) {
25846
+ this.prep(SIZEOF_INT, 0); // Ensure alignment is already done.
25847
+ this.writeInt32(this.offset() - offset + SIZEOF_INT);
25848
+ };
25849
+ /**
25850
+ * Start encoding a new object in the buffer. Users will not usually need to
25851
+ * call this directly. The FlatBuffers compiler will generate helper methods
25852
+ * that call this method internally.
25853
+ */ _proto.startObject = function startObject(numfields) {
25854
+ this.notNested();
25855
+ if (this.vtable == null) {
25856
+ this.vtable = [];
25857
+ }
25858
+ this.vtable_in_use = numfields;
25859
+ for(var i = 0; i < numfields; i++){
25860
+ this.vtable[i] = 0; // This will push additional elements as needed
25861
+ }
25862
+ this.isNested = true;
25863
+ this.object_start = this.offset();
25864
+ };
25865
+ /**
25866
+ * Finish off writing the object that is under construction.
25867
+ *
25868
+ * @returns The offset to the object inside `dataBuffer`
25869
+ */ _proto.endObject = function endObject() {
25870
+ if (this.vtable == null || !this.isNested) {
25871
+ throw new Error("FlatBuffers: endObject called without startObject");
25872
+ }
25873
+ this.addInt32(0);
25874
+ var vtableloc = this.offset();
25875
+ // Trim trailing zeroes.
25876
+ var i = this.vtable_in_use - 1;
25877
+ // eslint-disable-next-line no-empty
25878
+ for(; i >= 0 && this.vtable[i] == 0; i--){}
25879
+ var trimmed_size = i + 1;
25880
+ // Write out the current vtable.
25881
+ for(; i >= 0; i--){
25882
+ // Offset relative to the start of the table.
25883
+ this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
25884
+ }
25885
+ var standard_fields = 2; // The fields below:
25886
+ this.addInt16(vtableloc - this.object_start);
25887
+ var len = (trimmed_size + standard_fields) * SIZEOF_SHORT;
25888
+ this.addInt16(len);
25889
+ // Search for an existing vtable that matches the current one.
25890
+ var existing_vtable = 0;
25891
+ var vt1 = this.space;
25892
+ outer_loop: for(i = 0; i < this.vtables.length; i++){
25893
+ var vt2 = this.bb.capacity() - this.vtables[i];
25894
+ if (len == this.bb.readInt16(vt2)) {
25895
+ for(var j = SIZEOF_SHORT; j < len; j += SIZEOF_SHORT){
25896
+ if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
25897
+ continue outer_loop;
25898
+ }
25899
+ }
25900
+ existing_vtable = this.vtables[i];
25901
+ break;
25902
+ }
25903
+ }
25904
+ if (existing_vtable) {
25905
+ // Found a match:
25906
+ // Remove the current vtable.
25907
+ this.space = this.bb.capacity() - vtableloc;
25908
+ // Point table to existing vtable.
25909
+ this.bb.writeInt32(this.space, existing_vtable - vtableloc);
25910
+ } else {
25911
+ // No match:
25912
+ // Add the location of the current vtable to the list of vtables.
25913
+ this.vtables.push(this.offset());
25914
+ // Point table to current vtable.
25915
+ this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
25916
+ }
25917
+ this.isNested = false;
25918
+ return vtableloc;
25919
+ };
25920
+ /**
25921
+ * Finalize a buffer, poiting to the given `root_table`.
25922
+ */ _proto.finish = function finish(root_table, opt_file_identifier, opt_size_prefix) {
25923
+ var size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;
25924
+ if (opt_file_identifier) {
25925
+ var file_identifier = opt_file_identifier;
25926
+ this.prep(this.minalign, SIZEOF_INT + FILE_IDENTIFIER_LENGTH + size_prefix);
25927
+ if (file_identifier.length != FILE_IDENTIFIER_LENGTH) {
25928
+ throw new TypeError("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
25929
+ }
25930
+ for(var i = FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--){
25931
+ this.writeInt8(file_identifier.charCodeAt(i));
25932
+ }
25933
+ }
25934
+ this.prep(this.minalign, SIZEOF_INT + size_prefix);
25935
+ this.addOffset(root_table);
25936
+ if (size_prefix) {
25937
+ this.addInt32(this.bb.capacity() - this.space);
25938
+ }
25939
+ this.bb.setPosition(this.space);
25940
+ };
25941
+ /**
25942
+ * Finalize a size prefixed buffer, pointing to the given `root_table`.
25943
+ */ _proto.finishSizePrefixed = function finishSizePrefixed(root_table, opt_file_identifier) {
25944
+ this.finish(root_table, opt_file_identifier, true);
25945
+ };
25946
+ /**
25947
+ * This checks a required field has been set in a given table that has
25948
+ * just been constructed.
25949
+ */ _proto.requiredField = function requiredField(table, field) {
25950
+ var table_start = this.bb.capacity() - table;
25951
+ var vtable_start = table_start - this.bb.readInt32(table_start);
25952
+ var ok = field < this.bb.readInt16(vtable_start) && this.bb.readInt16(vtable_start + field) != 0;
25953
+ // If this fails, the caller will show what field needs to be set.
25954
+ if (!ok) {
25955
+ throw new TypeError("FlatBuffers: field " + field + " must be set");
25956
+ }
25957
+ };
25958
+ /**
25959
+ * Start a new array/vector of objects. Users usually will not call
25960
+ * this directly. The FlatBuffers compiler will create a start/end
25961
+ * method for vector types in generated code.
25962
+ *
25963
+ * @param elem_size The size of each element in the array
25964
+ * @param num_elems The number of elements in the array
25965
+ * @param alignment The alignment of the array
25966
+ */ _proto.startVector = function startVector(elem_size, num_elems, alignment) {
25967
+ this.notNested();
25968
+ this.vector_num_elems = num_elems;
25969
+ this.prep(SIZEOF_INT, elem_size * num_elems);
25970
+ this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
25971
+ };
25972
+ /**
25973
+ * Finish off the creation of an array and all its elements. The array must be
25974
+ * created with `startVector`.
25975
+ *
25976
+ * @returns The offset at which the newly created array
25977
+ * starts.
25978
+ */ _proto.endVector = function endVector() {
25979
+ this.writeInt32(this.vector_num_elems);
25980
+ return this.offset();
25981
+ };
25982
+ /**
25983
+ * Encode the string `s` in the buffer using UTF-8. If the string passed has
25984
+ * already been seen, we return the offset of the already written string
25985
+ *
25986
+ * @param s The string to encode
25987
+ * @return The offset in the buffer where the encoded string starts
25988
+ */ _proto.createSharedString = function createSharedString(s) {
25989
+ if (!s) {
25990
+ return 0;
25991
+ }
25992
+ if (!this.string_maps) {
25993
+ this.string_maps = new Map();
25994
+ }
25995
+ if (this.string_maps.has(s)) {
25996
+ return this.string_maps.get(s);
25997
+ }
25998
+ var offset = this.createString(s);
25999
+ this.string_maps.set(s, offset);
26000
+ return offset;
26001
+ };
26002
+ /**
26003
+ * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
26004
+ * instead of a string, it is assumed to contain valid UTF-8 encoded data.
26005
+ *
26006
+ * @param s The string to encode
26007
+ * @return The offset in the buffer where the encoded string starts
26008
+ */ _proto.createString = function createString(s) {
26009
+ if (s === null || s === undefined) {
26010
+ return 0;
26011
+ }
26012
+ var utf8;
26013
+ if (_instanceof1(s, Uint8Array)) {
26014
+ utf8 = s;
26015
+ } else {
26016
+ utf8 = this.text_encoder.encode(s);
26017
+ }
26018
+ this.addInt8(0);
26019
+ this.startVector(1, utf8.length, 1);
26020
+ this.bb.setPosition(this.space -= utf8.length);
26021
+ this.bb.bytes().set(utf8, this.space);
26022
+ return this.endVector();
26023
+ };
26024
+ /**
26025
+ * Create a byte vector.
26026
+ *
26027
+ * @param v The bytes to add
26028
+ * @returns The offset in the buffer where the byte vector starts
26029
+ */ _proto.createByteVector = function createByteVector(v) {
26030
+ if (v === null || v === undefined) {
26031
+ return 0;
26032
+ }
26033
+ this.startVector(1, v.length, 1);
26034
+ this.bb.setPosition(this.space -= v.length);
26035
+ this.bb.bytes().set(v, this.space);
26036
+ return this.endVector();
26037
+ };
26038
+ /**
26039
+ * A helper function to pack an object
26040
+ *
26041
+ * @returns offset of obj
26042
+ */ _proto.createObjectOffset = function createObjectOffset(obj) {
26043
+ if (obj === null) {
26044
+ return 0;
26045
+ }
26046
+ if (typeof obj === "string") {
26047
+ return this.createString(obj);
26048
+ } else {
26049
+ return obj.pack(this);
26050
+ }
26051
+ };
26052
+ /**
26053
+ * A helper function to pack a list of object
26054
+ *
26055
+ * @returns list of offsets of each non null object
26056
+ */ _proto.createObjectOffsetList = function createObjectOffsetList(list) {
26057
+ var ret = [];
26058
+ for(var i = 0; i < list.length; ++i){
26059
+ var val = list[i];
26060
+ if (val !== null) {
26061
+ ret.push(this.createObjectOffset(val));
26062
+ } else {
26063
+ throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");
26064
+ }
26065
+ }
26066
+ return ret;
26067
+ };
26068
+ _proto.createStructOffsetList = function createStructOffsetList(list, startFunc) {
26069
+ startFunc(this, list.length);
26070
+ this.createObjectOffsetList(list.slice().reverse());
26071
+ return this.endVector();
26072
+ };
26073
+ /**
26074
+ * Doubles the size of the backing ByteBuffer and copies the old data towards
26075
+ * the end of the new buffer (since we build the buffer backwards).
26076
+ *
26077
+ * @param bb The current buffer with the existing data
26078
+ * @returns A new byte buffer with the old data copied
26079
+ * to it. The data is located at the end of the buffer.
26080
+ *
26081
+ * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
26082
+ * it a uint8Array we need to suppress the type check:
26083
+ * @suppress {checkTypes}
26084
+ */ Builder.growByteBuffer = function growByteBuffer(bb) {
26085
+ var old_buf_size = bb.capacity();
26086
+ // Ensure we don't grow beyond what fits in an int.
26087
+ if (old_buf_size & 0xC0000000) {
26088
+ throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
26089
+ }
26090
+ var new_buf_size = old_buf_size << 1;
26091
+ var nbb = ByteBuffer.allocate(new_buf_size);
26092
+ nbb.setPosition(new_buf_size - old_buf_size);
26093
+ nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
26094
+ return nbb;
26095
+ };
26096
+ return Builder;
26097
+ }();
26098
+
26099
+ // automatically generated by the FlatBuffers compiler, do not modify
26100
+ var FBEffectsObjectData = /*#__PURE__*/ function() {
26101
+ function FBEffectsObjectData() {
26102
+ this.bb = null;
26103
+ this.bb_pos = 0;
26104
+ }
26105
+ var _proto = FBEffectsObjectData.prototype;
26106
+ _proto.__init = function __init(i, bb) {
26107
+ this.bb_pos = i;
26108
+ this.bb = bb;
26109
+ return this;
26110
+ };
26111
+ _proto.dataType = function dataType(optionalEncoding) {
26112
+ var offset = this.bb.__offset(this.bb_pos, 4);
26113
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
26114
+ };
26115
+ _proto.data = function data(index) {
26116
+ var offset = this.bb.__offset(this.bb_pos, 6);
26117
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
26118
+ };
26119
+ _proto.dataLength = function dataLength() {
26120
+ var offset = this.bb.__offset(this.bb_pos, 6);
26121
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26122
+ };
26123
+ _proto.dataArray = function dataArray() {
26124
+ var offset = this.bb.__offset(this.bb_pos, 6);
26125
+ return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
26126
+ };
26127
+ _proto.unpack = function unpack() {
26128
+ return new FBEffectsObjectDataT(this.dataType(), this.bb.createScalarList(this.data.bind(this), this.dataLength()));
26129
+ };
26130
+ _proto.unpackTo = function unpackTo(_o) {
26131
+ _o.dataType = this.dataType();
26132
+ _o.data = this.bb.createScalarList(this.data.bind(this), this.dataLength());
26133
+ };
26134
+ FBEffectsObjectData.getRootAsFBEffectsObjectData = function getRootAsFBEffectsObjectData(bb, obj) {
26135
+ return (obj || new FBEffectsObjectData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26136
+ };
26137
+ FBEffectsObjectData.getSizePrefixedRootAsFBEffectsObjectData = function getSizePrefixedRootAsFBEffectsObjectData(bb, obj) {
26138
+ bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
26139
+ return (obj || new FBEffectsObjectData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26140
+ };
26141
+ FBEffectsObjectData.startFBEffectsObjectData = function startFBEffectsObjectData(builder) {
26142
+ builder.startObject(2);
26143
+ };
26144
+ FBEffectsObjectData.addDataType = function addDataType(builder, dataTypeOffset) {
26145
+ builder.addFieldOffset(0, dataTypeOffset, 0);
26146
+ };
26147
+ FBEffectsObjectData.addData = function addData(builder, dataOffset) {
26148
+ builder.addFieldOffset(1, dataOffset, 0);
26149
+ };
26150
+ FBEffectsObjectData.createDataVector = function createDataVector(builder, data) {
26151
+ builder.startVector(1, data.length, 1);
26152
+ for(var i = data.length - 1; i >= 0; i--){
26153
+ builder.addInt8(data[i]);
26154
+ }
26155
+ return builder.endVector();
26156
+ };
26157
+ FBEffectsObjectData.startDataVector = function startDataVector(builder, numElems) {
26158
+ builder.startVector(1, numElems, 1);
26159
+ };
26160
+ FBEffectsObjectData.endFBEffectsObjectData = function endFBEffectsObjectData(builder) {
26161
+ var offset = builder.endObject();
26162
+ return offset;
26163
+ };
26164
+ FBEffectsObjectData.createFBEffectsObjectData = function createFBEffectsObjectData(builder, dataTypeOffset, dataOffset) {
26165
+ FBEffectsObjectData.startFBEffectsObjectData(builder);
26166
+ FBEffectsObjectData.addDataType(builder, dataTypeOffset);
26167
+ FBEffectsObjectData.addData(builder, dataOffset);
26168
+ return FBEffectsObjectData.endFBEffectsObjectData(builder);
26169
+ };
26170
+ return FBEffectsObjectData;
26171
+ }();
26172
+ var FBEffectsObjectDataT = /*#__PURE__*/ function() {
26173
+ function FBEffectsObjectDataT(dataType, data) {
26174
+ if (dataType === void 0) dataType = null;
26175
+ if (data === void 0) data = [];
26176
+ this.dataType = dataType;
26177
+ this.data = data;
26178
+ }
26179
+ var _proto = FBEffectsObjectDataT.prototype;
26180
+ _proto.pack = function pack(builder) {
26181
+ var dataType = this.dataType !== null ? builder.createString(this.dataType) : 0;
26182
+ var data = FBEffectsObjectData.createDataVector(builder, this.data);
26183
+ return FBEffectsObjectData.createFBEffectsObjectData(builder, dataType, data);
26184
+ };
26185
+ return FBEffectsObjectDataT;
26186
+ }();
26187
+
26188
+ // automatically generated by the FlatBuffers compiler, do not modify
26189
+ var FBEffectsPackageData = /*#__PURE__*/ function() {
26190
+ function FBEffectsPackageData() {
26191
+ this.bb = null;
26192
+ this.bb_pos = 0;
26193
+ }
26194
+ var _proto = FBEffectsPackageData.prototype;
26195
+ _proto.__init = function __init(i, bb) {
26196
+ this.bb_pos = i;
26197
+ this.bb = bb;
26198
+ return this;
26199
+ };
26200
+ _proto.exportObjects = function exportObjects(index, obj) {
26201
+ var offset = this.bb.__offset(this.bb_pos, 4);
26202
+ return offset ? (obj || new FBEffectsObjectData()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
26203
+ };
26204
+ _proto.exportObjectsLength = function exportObjectsLength() {
26205
+ var offset = this.bb.__offset(this.bb_pos, 4);
26206
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26207
+ };
26208
+ _proto.unpack = function unpack() {
26209
+ return new FBEffectsPackageDataT(this.bb.createObjList(this.exportObjects.bind(this), this.exportObjectsLength()));
26210
+ };
26211
+ _proto.unpackTo = function unpackTo(_o) {
26212
+ _o.exportObjects = this.bb.createObjList(this.exportObjects.bind(this), this.exportObjectsLength());
26213
+ };
26214
+ FBEffectsPackageData.getRootAsFBEffectsPackageData = function getRootAsFBEffectsPackageData(bb, obj) {
26215
+ return (obj || new FBEffectsPackageData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26216
+ };
26217
+ FBEffectsPackageData.getSizePrefixedRootAsFBEffectsPackageData = function getSizePrefixedRootAsFBEffectsPackageData(bb, obj) {
26218
+ bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
26219
+ return (obj || new FBEffectsPackageData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26220
+ };
26221
+ FBEffectsPackageData.startFBEffectsPackageData = function startFBEffectsPackageData(builder) {
26222
+ builder.startObject(1);
26223
+ };
26224
+ FBEffectsPackageData.addExportObjects = function addExportObjects(builder, exportObjectsOffset) {
26225
+ builder.addFieldOffset(0, exportObjectsOffset, 0);
26226
+ };
26227
+ FBEffectsPackageData.createExportObjectsVector = function createExportObjectsVector(builder, data) {
26228
+ builder.startVector(4, data.length, 4);
26229
+ for(var i = data.length - 1; i >= 0; i--){
26230
+ builder.addOffset(data[i]);
26231
+ }
26232
+ return builder.endVector();
26233
+ };
26234
+ FBEffectsPackageData.startExportObjectsVector = function startExportObjectsVector(builder, numElems) {
26235
+ builder.startVector(4, numElems, 4);
26236
+ };
26237
+ FBEffectsPackageData.endFBEffectsPackageData = function endFBEffectsPackageData(builder) {
26238
+ var offset = builder.endObject();
26239
+ return offset;
26240
+ };
26241
+ FBEffectsPackageData.finishFBEffectsPackageDataBuffer = function finishFBEffectsPackageDataBuffer(builder, offset) {
26242
+ builder.finish(offset);
26243
+ };
26244
+ FBEffectsPackageData.finishSizePrefixedFBEffectsPackageDataBuffer = function finishSizePrefixedFBEffectsPackageDataBuffer(builder, offset) {
26245
+ builder.finish(offset, undefined, true);
26246
+ };
26247
+ FBEffectsPackageData.createFBEffectsPackageData = function createFBEffectsPackageData(builder, exportObjectsOffset) {
26248
+ FBEffectsPackageData.startFBEffectsPackageData(builder);
26249
+ FBEffectsPackageData.addExportObjects(builder, exportObjectsOffset);
26250
+ return FBEffectsPackageData.endFBEffectsPackageData(builder);
26251
+ };
26252
+ return FBEffectsPackageData;
26253
+ }();
26254
+ var FBEffectsPackageDataT = /*#__PURE__*/ function() {
26255
+ function FBEffectsPackageDataT(exportObjects) {
26256
+ if (exportObjects === void 0) exportObjects = [];
26257
+ this.exportObjects = exportObjects;
26258
+ }
26259
+ var _proto = FBEffectsPackageDataT.prototype;
26260
+ _proto.pack = function pack(builder) {
26261
+ var exportObjects = FBEffectsPackageData.createExportObjectsVector(builder, builder.createObjectOffsetList(this.exportObjects));
26262
+ return FBEffectsPackageData.createFBEffectsPackageData(builder, exportObjects);
26263
+ };
26264
+ return FBEffectsPackageDataT;
26265
+ }();
26266
+
26267
+ // automatically generated by the FlatBuffers compiler, do not modify
26268
+ var FBSubMesh = /*#__PURE__*/ function() {
26269
+ function FBSubMesh() {
26270
+ this.bb = null;
26271
+ this.bb_pos = 0;
26272
+ }
26273
+ var _proto = FBSubMesh.prototype;
26274
+ _proto.__init = function __init(i, bb) {
26275
+ this.bb_pos = i;
26276
+ this.bb = bb;
26277
+ return this;
26278
+ };
26279
+ _proto.offset = function offset() {
26280
+ var offset = this.bb.__offset(this.bb_pos, 4);
26281
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26282
+ };
26283
+ _proto.indexCount = function indexCount() {
26284
+ var offset = this.bb.__offset(this.bb_pos, 6);
26285
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26286
+ };
26287
+ _proto.vertexCount = function vertexCount() {
26288
+ var offset = this.bb.__offset(this.bb_pos, 8);
26289
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26290
+ };
26291
+ _proto.unpack = function unpack() {
26292
+ return new FBSubMeshT(this.offset(), this.indexCount(), this.vertexCount());
26293
+ };
26294
+ _proto.unpackTo = function unpackTo(_o) {
26295
+ _o.offset = this.offset();
26296
+ _o.indexCount = this.indexCount();
26297
+ _o.vertexCount = this.vertexCount();
26298
+ };
26299
+ FBSubMesh.getRootAsFBSubMesh = function getRootAsFBSubMesh(bb, obj) {
26300
+ return (obj || new FBSubMesh()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26301
+ };
26302
+ FBSubMesh.getSizePrefixedRootAsFBSubMesh = function getSizePrefixedRootAsFBSubMesh(bb, obj) {
26303
+ bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
26304
+ return (obj || new FBSubMesh()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26305
+ };
26306
+ FBSubMesh.startFBSubMesh = function startFBSubMesh(builder) {
26307
+ builder.startObject(3);
26308
+ };
26309
+ FBSubMesh.addOffset = function addOffset(builder, offset) {
26310
+ builder.addFieldInt32(0, offset, 0);
26311
+ };
26312
+ FBSubMesh.addIndexCount = function addIndexCount(builder, indexCount) {
26313
+ builder.addFieldInt32(1, indexCount, 0);
26314
+ };
26315
+ FBSubMesh.addVertexCount = function addVertexCount(builder, vertexCount) {
26316
+ builder.addFieldInt32(2, vertexCount, 0);
26317
+ };
26318
+ FBSubMesh.endFBSubMesh = function endFBSubMesh(builder) {
26319
+ var offset = builder.endObject();
26320
+ return offset;
26321
+ };
26322
+ FBSubMesh.createFBSubMesh = function createFBSubMesh(builder, offset, indexCount, vertexCount) {
26323
+ FBSubMesh.startFBSubMesh(builder);
26324
+ FBSubMesh.addOffset(builder, offset);
26325
+ FBSubMesh.addIndexCount(builder, indexCount);
26326
+ FBSubMesh.addVertexCount(builder, vertexCount);
26327
+ return FBSubMesh.endFBSubMesh(builder);
26328
+ };
26329
+ return FBSubMesh;
26330
+ }();
26331
+ var FBSubMeshT = /*#__PURE__*/ function() {
26332
+ function FBSubMeshT(offset, indexCount, vertexCount) {
26333
+ if (offset === void 0) offset = 0;
26334
+ if (indexCount === void 0) indexCount = 0;
26335
+ if (vertexCount === void 0) vertexCount = 0;
26336
+ this.offset = offset;
26337
+ this.indexCount = indexCount;
26338
+ this.vertexCount = vertexCount;
26339
+ }
26340
+ var _proto = FBSubMeshT.prototype;
26341
+ _proto.pack = function pack(builder) {
26342
+ return FBSubMesh.createFBSubMesh(builder, this.offset, this.indexCount, this.vertexCount);
26343
+ };
26344
+ return FBSubMeshT;
26345
+ }();
26346
+
26347
+ // automatically generated by the FlatBuffers compiler, do not modify
26348
+ var FBVertexChannel = /*#__PURE__*/ function() {
26349
+ function FBVertexChannel() {
26350
+ this.bb = null;
26351
+ this.bb_pos = 0;
26352
+ }
26353
+ var _proto = FBVertexChannel.prototype;
26354
+ _proto.__init = function __init(i, bb) {
26355
+ this.bb_pos = i;
26356
+ this.bb = bb;
26357
+ return this;
26358
+ };
26359
+ _proto.semantic = function semantic(optionalEncoding) {
26360
+ var offset = this.bb.__offset(this.bb_pos, 4);
26361
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
26362
+ };
26363
+ _proto.offset = function offset() {
26364
+ var offset = this.bb.__offset(this.bb_pos, 6);
26365
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26366
+ };
26367
+ _proto.format = function format() {
26368
+ var offset = this.bb.__offset(this.bb_pos, 8);
26369
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26370
+ };
26371
+ _proto.dimension = function dimension() {
26372
+ var offset = this.bb.__offset(this.bb_pos, 10);
26373
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26374
+ };
26375
+ _proto.normalize = function normalize() {
26376
+ var offset = this.bb.__offset(this.bb_pos, 12);
26377
+ return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
26378
+ };
26379
+ _proto.unpack = function unpack() {
26380
+ return new FBVertexChannelT(this.semantic(), this.offset(), this.format(), this.dimension(), this.normalize());
26381
+ };
26382
+ _proto.unpackTo = function unpackTo(_o) {
26383
+ _o.semantic = this.semantic();
26384
+ _o.offset = this.offset();
26385
+ _o.format = this.format();
26386
+ _o.dimension = this.dimension();
26387
+ _o.normalize = this.normalize();
26388
+ };
26389
+ FBVertexChannel.getRootAsFBVertexChannel = function getRootAsFBVertexChannel(bb, obj) {
26390
+ return (obj || new FBVertexChannel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26391
+ };
26392
+ FBVertexChannel.getSizePrefixedRootAsFBVertexChannel = function getSizePrefixedRootAsFBVertexChannel(bb, obj) {
26393
+ bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
26394
+ return (obj || new FBVertexChannel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26395
+ };
26396
+ FBVertexChannel.startFBVertexChannel = function startFBVertexChannel(builder) {
26397
+ builder.startObject(5);
26398
+ };
26399
+ FBVertexChannel.addSemantic = function addSemantic(builder, semanticOffset) {
26400
+ builder.addFieldOffset(0, semanticOffset, 0);
26401
+ };
26402
+ FBVertexChannel.addOffset = function addOffset(builder, offset) {
26403
+ builder.addFieldInt32(1, offset, 0);
26404
+ };
26405
+ FBVertexChannel.addFormat = function addFormat(builder, format) {
26406
+ builder.addFieldInt32(2, format, 0);
26407
+ };
26408
+ FBVertexChannel.addDimension = function addDimension(builder, dimension) {
26409
+ builder.addFieldInt32(3, dimension, 0);
26410
+ };
26411
+ FBVertexChannel.addNormalize = function addNormalize(builder, normalize) {
26412
+ builder.addFieldInt8(4, +normalize, +false);
26413
+ };
26414
+ FBVertexChannel.endFBVertexChannel = function endFBVertexChannel(builder) {
26415
+ var offset = builder.endObject();
26416
+ return offset;
26417
+ };
26418
+ FBVertexChannel.createFBVertexChannel = function createFBVertexChannel(builder, semanticOffset, offset, format, dimension, normalize) {
26419
+ FBVertexChannel.startFBVertexChannel(builder);
26420
+ FBVertexChannel.addSemantic(builder, semanticOffset);
26421
+ FBVertexChannel.addOffset(builder, offset);
26422
+ FBVertexChannel.addFormat(builder, format);
26423
+ FBVertexChannel.addDimension(builder, dimension);
26424
+ FBVertexChannel.addNormalize(builder, normalize);
26425
+ return FBVertexChannel.endFBVertexChannel(builder);
26426
+ };
26427
+ return FBVertexChannel;
26428
+ }();
26429
+ var FBVertexChannelT = /*#__PURE__*/ function() {
26430
+ function FBVertexChannelT(semantic, offset, format, dimension, normalize) {
26431
+ if (semantic === void 0) semantic = null;
26432
+ if (offset === void 0) offset = 0;
26433
+ if (format === void 0) format = 0;
26434
+ if (dimension === void 0) dimension = 0;
26435
+ if (normalize === void 0) normalize = false;
26436
+ this.semantic = semantic;
26437
+ this.offset = offset;
26438
+ this.format = format;
26439
+ this.dimension = dimension;
26440
+ this.normalize = normalize;
26441
+ }
26442
+ var _proto = FBVertexChannelT.prototype;
26443
+ _proto.pack = function pack(builder) {
26444
+ var semantic = this.semantic !== null ? builder.createString(this.semantic) : 0;
26445
+ return FBVertexChannel.createFBVertexChannel(builder, semantic, this.offset, this.format, this.dimension, this.normalize);
26446
+ };
26447
+ return FBVertexChannelT;
26448
+ }();
26449
+
26450
+ // automatically generated by the FlatBuffers compiler, do not modify
26451
+ var FBVertexData = /*#__PURE__*/ function() {
26452
+ function FBVertexData() {
26453
+ this.bb = null;
26454
+ this.bb_pos = 0;
26455
+ }
26456
+ var _proto = FBVertexData.prototype;
26457
+ _proto.__init = function __init(i, bb) {
26458
+ this.bb_pos = i;
26459
+ this.bb = bb;
26460
+ return this;
26461
+ };
26462
+ _proto.vertexCount = function vertexCount() {
26463
+ var offset = this.bb.__offset(this.bb_pos, 4);
26464
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26465
+ };
26466
+ _proto.channels = function channels(index, obj) {
26467
+ var offset = this.bb.__offset(this.bb_pos, 6);
26468
+ return offset ? (obj || new FBVertexChannel()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
26469
+ };
26470
+ _proto.channelsLength = function channelsLength() {
26471
+ var offset = this.bb.__offset(this.bb_pos, 6);
26472
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26473
+ };
26474
+ _proto.unpack = function unpack() {
26475
+ return new FBVertexDataT(this.vertexCount(), this.bb.createObjList(this.channels.bind(this), this.channelsLength()));
26476
+ };
26477
+ _proto.unpackTo = function unpackTo(_o) {
26478
+ _o.vertexCount = this.vertexCount();
26479
+ _o.channels = this.bb.createObjList(this.channels.bind(this), this.channelsLength());
26480
+ };
26481
+ FBVertexData.getRootAsFBVertexData = function getRootAsFBVertexData(bb, obj) {
26482
+ return (obj || new FBVertexData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26483
+ };
26484
+ FBVertexData.getSizePrefixedRootAsFBVertexData = function getSizePrefixedRootAsFBVertexData(bb, obj) {
26485
+ bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
26486
+ return (obj || new FBVertexData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26487
+ };
26488
+ FBVertexData.startFBVertexData = function startFBVertexData(builder) {
26489
+ builder.startObject(2);
26490
+ };
26491
+ FBVertexData.addVertexCount = function addVertexCount(builder, vertexCount) {
26492
+ builder.addFieldInt32(0, vertexCount, 0);
26493
+ };
26494
+ FBVertexData.addChannels = function addChannels(builder, channelsOffset) {
26495
+ builder.addFieldOffset(1, channelsOffset, 0);
26496
+ };
26497
+ FBVertexData.createChannelsVector = function createChannelsVector(builder, data) {
26498
+ builder.startVector(4, data.length, 4);
26499
+ for(var i = data.length - 1; i >= 0; i--){
26500
+ builder.addOffset(data[i]);
26501
+ }
26502
+ return builder.endVector();
26503
+ };
26504
+ FBVertexData.startChannelsVector = function startChannelsVector(builder, numElems) {
26505
+ builder.startVector(4, numElems, 4);
26506
+ };
26507
+ FBVertexData.endFBVertexData = function endFBVertexData(builder) {
26508
+ var offset = builder.endObject();
26509
+ return offset;
26510
+ };
26511
+ FBVertexData.createFBVertexData = function createFBVertexData(builder, vertexCount, channelsOffset) {
26512
+ FBVertexData.startFBVertexData(builder);
26513
+ FBVertexData.addVertexCount(builder, vertexCount);
26514
+ FBVertexData.addChannels(builder, channelsOffset);
26515
+ return FBVertexData.endFBVertexData(builder);
26516
+ };
26517
+ return FBVertexData;
26518
+ }();
26519
+ var FBVertexDataT = /*#__PURE__*/ function() {
26520
+ function FBVertexDataT(vertexCount, channels) {
26521
+ if (vertexCount === void 0) vertexCount = 0;
26522
+ if (channels === void 0) channels = [];
26523
+ this.vertexCount = vertexCount;
26524
+ this.channels = channels;
26525
+ }
26526
+ var _proto = FBVertexDataT.prototype;
26527
+ _proto.pack = function pack(builder) {
26528
+ var channels = FBVertexData.createChannelsVector(builder, builder.createObjectOffsetList(this.channels));
26529
+ return FBVertexData.createFBVertexData(builder, this.vertexCount, channels);
26530
+ };
26531
+ return FBVertexDataT;
26532
+ }();
26533
+
26534
+ // automatically generated by the FlatBuffers compiler, do not modify
26535
+ var FBGeometryData = /*#__PURE__*/ function() {
26536
+ function FBGeometryData() {
26537
+ this.bb = null;
26538
+ this.bb_pos = 0;
26539
+ }
26540
+ var _proto = FBGeometryData.prototype;
26541
+ _proto.__init = function __init(i, bb) {
26542
+ this.bb_pos = i;
26543
+ this.bb = bb;
26544
+ return this;
26545
+ };
26546
+ _proto.id = function id(optionalEncoding) {
26547
+ var offset = this.bb.__offset(this.bb_pos, 4);
26548
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
26549
+ };
26550
+ _proto.name = function name(optionalEncoding) {
26551
+ var offset = this.bb.__offset(this.bb_pos, 6);
26552
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
26553
+ };
26554
+ _proto.vertexData = function vertexData(obj) {
26555
+ var offset = this.bb.__offset(this.bb_pos, 8);
26556
+ return offset ? (obj || new FBVertexData()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
26557
+ };
26558
+ _proto.indexFormat = function indexFormat() {
26559
+ var offset = this.bb.__offset(this.bb_pos, 10);
26560
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26561
+ };
26562
+ _proto.indexOffset = function indexOffset() {
26563
+ var offset = this.bb.__offset(this.bb_pos, 12);
26564
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26565
+ };
26566
+ _proto.subMeshes = function subMeshes(index, obj) {
26567
+ var offset = this.bb.__offset(this.bb_pos, 14);
26568
+ return offset ? (obj || new FBSubMesh()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
26569
+ };
26570
+ _proto.subMeshesLength = function subMeshesLength() {
26571
+ var offset = this.bb.__offset(this.bb_pos, 14);
26572
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26573
+ };
26574
+ _proto.mode = function mode() {
26575
+ var offset = this.bb.__offset(this.bb_pos, 16);
26576
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
26577
+ };
26578
+ _proto.buffer = function buffer(optionalEncoding) {
26579
+ var offset = this.bb.__offset(this.bb_pos, 18);
26580
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
26581
+ };
26582
+ _proto.binaryData = function binaryData(index) {
26583
+ var offset = this.bb.__offset(this.bb_pos, 20);
26584
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
26585
+ };
26586
+ _proto.binaryDataLength = function binaryDataLength() {
26587
+ var offset = this.bb.__offset(this.bb_pos, 20);
26588
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26589
+ };
26590
+ _proto.binaryDataArray = function binaryDataArray() {
26591
+ var offset = this.bb.__offset(this.bb_pos, 20);
26592
+ return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
26593
+ };
26594
+ _proto.boneNames = function boneNames(index, optionalEncoding) {
26595
+ var offset = this.bb.__offset(this.bb_pos, 22);
26596
+ return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
26597
+ };
26598
+ _proto.boneNamesLength = function boneNamesLength() {
26599
+ var offset = this.bb.__offset(this.bb_pos, 22);
26600
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26601
+ };
26602
+ _proto.rootBoneName = function rootBoneName(optionalEncoding) {
26603
+ var offset = this.bb.__offset(this.bb_pos, 24);
26604
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
26605
+ };
26606
+ _proto.inverseBindMatrices = function inverseBindMatrices(index) {
26607
+ var offset = this.bb.__offset(this.bb_pos, 26);
26608
+ return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
26609
+ };
26610
+ _proto.inverseBindMatricesLength = function inverseBindMatricesLength() {
26611
+ var offset = this.bb.__offset(this.bb_pos, 26);
26612
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
26613
+ };
26614
+ _proto.inverseBindMatricesArray = function inverseBindMatricesArray() {
26615
+ var offset = this.bb.__offset(this.bb_pos, 26);
26616
+ return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
26617
+ };
26618
+ _proto.unpack = function unpack() {
26619
+ return new FBGeometryDataT(this.id(), this.name(), this.vertexData() !== null ? this.vertexData().unpack() : null, this.indexFormat(), this.indexOffset(), this.bb.createObjList(this.subMeshes.bind(this), this.subMeshesLength()), this.mode(), this.buffer(), this.bb.createScalarList(this.binaryData.bind(this), this.binaryDataLength()), this.bb.createScalarList(this.boneNames.bind(this), this.boneNamesLength()), this.rootBoneName(), this.bb.createScalarList(this.inverseBindMatrices.bind(this), this.inverseBindMatricesLength()));
26620
+ };
26621
+ _proto.unpackTo = function unpackTo(_o) {
26622
+ _o.id = this.id();
26623
+ _o.name = this.name();
26624
+ _o.vertexData = this.vertexData() !== null ? this.vertexData().unpack() : null;
26625
+ _o.indexFormat = this.indexFormat();
26626
+ _o.indexOffset = this.indexOffset();
26627
+ _o.subMeshes = this.bb.createObjList(this.subMeshes.bind(this), this.subMeshesLength());
26628
+ _o.mode = this.mode();
26629
+ _o.buffer = this.buffer();
26630
+ _o.binaryData = this.bb.createScalarList(this.binaryData.bind(this), this.binaryDataLength());
26631
+ _o.boneNames = this.bb.createScalarList(this.boneNames.bind(this), this.boneNamesLength());
26632
+ _o.rootBoneName = this.rootBoneName();
26633
+ _o.inverseBindMatrices = this.bb.createScalarList(this.inverseBindMatrices.bind(this), this.inverseBindMatricesLength());
26634
+ };
26635
+ FBGeometryData.getRootAsFBGeometryData = function getRootAsFBGeometryData(bb, obj) {
26636
+ return (obj || new FBGeometryData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26637
+ };
26638
+ FBGeometryData.getSizePrefixedRootAsFBGeometryData = function getSizePrefixedRootAsFBGeometryData(bb, obj) {
26639
+ bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
26640
+ return (obj || new FBGeometryData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26641
+ };
26642
+ FBGeometryData.startFBGeometryData = function startFBGeometryData(builder) {
26643
+ builder.startObject(12);
26644
+ };
26645
+ FBGeometryData.addId = function addId(builder, idOffset) {
26646
+ builder.addFieldOffset(0, idOffset, 0);
26647
+ };
26648
+ FBGeometryData.addName = function addName(builder, nameOffset) {
26649
+ builder.addFieldOffset(1, nameOffset, 0);
26650
+ };
26651
+ FBGeometryData.addVertexData = function addVertexData(builder, vertexDataOffset) {
26652
+ builder.addFieldOffset(2, vertexDataOffset, 0);
26653
+ };
26654
+ FBGeometryData.addIndexFormat = function addIndexFormat(builder, indexFormat) {
26655
+ builder.addFieldInt32(3, indexFormat, 0);
26656
+ };
26657
+ FBGeometryData.addIndexOffset = function addIndexOffset(builder, indexOffset) {
26658
+ builder.addFieldInt32(4, indexOffset, 0);
26659
+ };
26660
+ FBGeometryData.addSubMeshes = function addSubMeshes(builder, subMeshesOffset) {
26661
+ builder.addFieldOffset(5, subMeshesOffset, 0);
26662
+ };
26663
+ FBGeometryData.createSubMeshesVector = function createSubMeshesVector(builder, data) {
26664
+ builder.startVector(4, data.length, 4);
26665
+ for(var i = data.length - 1; i >= 0; i--){
26666
+ builder.addOffset(data[i]);
26667
+ }
26668
+ return builder.endVector();
26669
+ };
26670
+ FBGeometryData.startSubMeshesVector = function startSubMeshesVector(builder, numElems) {
26671
+ builder.startVector(4, numElems, 4);
26672
+ };
26673
+ FBGeometryData.addMode = function addMode(builder, mode) {
26674
+ builder.addFieldInt32(6, mode, 0);
26675
+ };
26676
+ FBGeometryData.addBuffer = function addBuffer(builder, bufferOffset) {
26677
+ builder.addFieldOffset(7, bufferOffset, 0);
26678
+ };
26679
+ FBGeometryData.addBinaryData = function addBinaryData(builder, binaryDataOffset) {
26680
+ builder.addFieldOffset(8, binaryDataOffset, 0);
26681
+ };
26682
+ FBGeometryData.createBinaryDataVector = function createBinaryDataVector(builder, data) {
26683
+ builder.startVector(1, data.length, 1);
26684
+ for(var i = data.length - 1; i >= 0; i--){
26685
+ builder.addInt8(data[i]);
26686
+ }
26687
+ return builder.endVector();
26688
+ };
26689
+ FBGeometryData.startBinaryDataVector = function startBinaryDataVector(builder, numElems) {
26690
+ builder.startVector(1, numElems, 1);
26691
+ };
26692
+ FBGeometryData.addBoneNames = function addBoneNames(builder, boneNamesOffset) {
26693
+ builder.addFieldOffset(9, boneNamesOffset, 0);
26694
+ };
26695
+ FBGeometryData.createBoneNamesVector = function createBoneNamesVector(builder, data) {
26696
+ builder.startVector(4, data.length, 4);
26697
+ for(var i = data.length - 1; i >= 0; i--){
26698
+ builder.addOffset(data[i]);
26699
+ }
26700
+ return builder.endVector();
26701
+ };
26702
+ FBGeometryData.startBoneNamesVector = function startBoneNamesVector(builder, numElems) {
26703
+ builder.startVector(4, numElems, 4);
26704
+ };
26705
+ FBGeometryData.addRootBoneName = function addRootBoneName(builder, rootBoneNameOffset) {
26706
+ builder.addFieldOffset(10, rootBoneNameOffset, 0);
26707
+ };
26708
+ FBGeometryData.addInverseBindMatrices = function addInverseBindMatrices(builder, inverseBindMatricesOffset) {
26709
+ builder.addFieldOffset(11, inverseBindMatricesOffset, 0);
26710
+ };
26711
+ FBGeometryData.createInverseBindMatricesVector = function createInverseBindMatricesVector(builder, data) {
26712
+ builder.startVector(4, data.length, 4);
26713
+ for(var i = data.length - 1; i >= 0; i--){
26714
+ builder.addFloat32(data[i]);
26715
+ }
26716
+ return builder.endVector();
26717
+ };
26718
+ FBGeometryData.startInverseBindMatricesVector = function startInverseBindMatricesVector(builder, numElems) {
26719
+ builder.startVector(4, numElems, 4);
26720
+ };
26721
+ FBGeometryData.endFBGeometryData = function endFBGeometryData(builder) {
26722
+ var offset = builder.endObject();
26723
+ return offset;
26724
+ };
26725
+ return FBGeometryData;
26726
+ }();
26727
+ var FBGeometryDataT = /*#__PURE__*/ function() {
26728
+ function FBGeometryDataT(id, name, vertexData, indexFormat, indexOffset, subMeshes, mode, buffer, binaryData, boneNames, rootBoneName, inverseBindMatrices) {
26729
+ if (id === void 0) id = null;
26730
+ if (name === void 0) name = null;
26731
+ if (vertexData === void 0) vertexData = null;
26732
+ if (indexFormat === void 0) indexFormat = 0;
26733
+ if (indexOffset === void 0) indexOffset = 0;
26734
+ if (subMeshes === void 0) subMeshes = [];
26735
+ if (mode === void 0) mode = 0;
26736
+ if (buffer === void 0) buffer = null;
26737
+ if (binaryData === void 0) binaryData = [];
26738
+ if (boneNames === void 0) boneNames = [];
26739
+ if (rootBoneName === void 0) rootBoneName = null;
26740
+ if (inverseBindMatrices === void 0) inverseBindMatrices = [];
26741
+ this.id = id;
26742
+ this.name = name;
26743
+ this.vertexData = vertexData;
26744
+ this.indexFormat = indexFormat;
26745
+ this.indexOffset = indexOffset;
26746
+ this.subMeshes = subMeshes;
26747
+ this.mode = mode;
26748
+ this.buffer = buffer;
26749
+ this.binaryData = binaryData;
26750
+ this.boneNames = boneNames;
26751
+ this.rootBoneName = rootBoneName;
26752
+ this.inverseBindMatrices = inverseBindMatrices;
26753
+ }
26754
+ var _proto = FBGeometryDataT.prototype;
26755
+ _proto.pack = function pack(builder) {
26756
+ var id = this.id !== null ? builder.createString(this.id) : 0;
26757
+ var name = this.name !== null ? builder.createString(this.name) : 0;
26758
+ var vertexData = this.vertexData !== null ? this.vertexData.pack(builder) : 0;
26759
+ var subMeshes = FBGeometryData.createSubMeshesVector(builder, builder.createObjectOffsetList(this.subMeshes));
26760
+ var buffer = this.buffer !== null ? builder.createString(this.buffer) : 0;
26761
+ var binaryData = FBGeometryData.createBinaryDataVector(builder, this.binaryData);
26762
+ var boneNames = FBGeometryData.createBoneNamesVector(builder, builder.createObjectOffsetList(this.boneNames));
26763
+ var rootBoneName = this.rootBoneName !== null ? builder.createString(this.rootBoneName) : 0;
26764
+ var inverseBindMatrices = FBGeometryData.createInverseBindMatricesVector(builder, this.inverseBindMatrices);
26765
+ FBGeometryData.startFBGeometryData(builder);
26766
+ FBGeometryData.addId(builder, id);
26767
+ FBGeometryData.addName(builder, name);
26768
+ FBGeometryData.addVertexData(builder, vertexData);
26769
+ FBGeometryData.addIndexFormat(builder, this.indexFormat);
26770
+ FBGeometryData.addIndexOffset(builder, this.indexOffset);
26771
+ FBGeometryData.addSubMeshes(builder, subMeshes);
26772
+ FBGeometryData.addMode(builder, this.mode);
26773
+ FBGeometryData.addBuffer(builder, buffer);
26774
+ FBGeometryData.addBinaryData(builder, binaryData);
26775
+ FBGeometryData.addBoneNames(builder, boneNames);
26776
+ FBGeometryData.addRootBoneName(builder, rootBoneName);
26777
+ FBGeometryData.addInverseBindMatrices(builder, inverseBindMatrices);
26778
+ return FBGeometryData.endFBGeometryData(builder);
26779
+ };
26780
+ return FBGeometryDataT;
26781
+ }();
26782
+
26783
+ var EffectsPackage = /*#__PURE__*/ function() {
26784
+ function EffectsPackage() {
26785
+ this.exportObjectDatas = [];
26786
+ }
26787
+ var _proto = EffectsPackage.prototype;
26788
+ _proto.addData = function addData(effectsObjectData) {
26789
+ this.exportObjectDatas.push(effectsObjectData);
26790
+ };
26791
+ _proto.serializeToBinary = function serializeToBinary() {
26792
+ var fbb = new Builder(1);
26793
+ var effectsPackage = new FBEffectsPackageDataT();
26794
+ var exportObjects = [];
26795
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.exportObjectDatas), _step; !(_step = _iterator()).done;){
26796
+ var effectsObjectData = _step.value;
26797
+ var fbEffectsObjectData = void 0;
26798
+ if (effectsObjectData.dataType === DataType.Geometry) {
26799
+ fbEffectsObjectData = new FBEffectsObjectDataT("Geometry", this.geometryDataToBinary(effectsObjectData));
26800
+ }
26801
+ if (!fbEffectsObjectData) {
26802
+ continue;
26803
+ }
26804
+ exportObjects.push(fbEffectsObjectData);
26805
+ }
26806
+ effectsPackage.exportObjects = exportObjects;
26807
+ FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, effectsPackage.pack(fbb));
26808
+ var buffer = fbb.asUint8Array(); // Of type `Uint8Array`.
26809
+ return buffer;
26810
+ };
26811
+ _proto.deserializeFromBinary = function deserializeFromBinary(buffer) {
26812
+ var buf = new ByteBuffer(buffer);
26813
+ var fbEffectsPackage = FBEffectsPackageData.getRootAsFBEffectsPackageData(buf);
26814
+ for(var i = 0; i < fbEffectsPackage.exportObjectsLength(); i++){
26815
+ var fbEffectsObjectData = fbEffectsPackage.exportObjects(i);
26816
+ if (!fbEffectsObjectData) {
26817
+ continue;
26818
+ }
26819
+ var dataBuffer = fbEffectsObjectData.dataArray();
26820
+ var dataType = fbEffectsObjectData.dataType();
26821
+ if (!dataBuffer) {
26822
+ continue;
26823
+ }
26824
+ var effectsObjectData = void 0;
26825
+ if (dataType === DataType.Geometry) {
26826
+ effectsObjectData = this.binaryToGeometryData(dataBuffer);
26827
+ }
26828
+ if (!effectsObjectData) {
26829
+ continue;
26830
+ }
26831
+ this.exportObjectDatas.push(effectsObjectData);
26832
+ }
26833
+ };
26834
+ _proto.geometryDataToBinary = function geometryDataToBinary(geometryData) {
26835
+ var fbb = new Builder(1);
26836
+ var fbGeometryData = new FBGeometryDataT();
26837
+ fbGeometryData.indexFormat = geometryData.indexFormat;
26838
+ fbGeometryData.indexOffset = geometryData.indexOffset;
26839
+ fbGeometryData.mode = geometryData.mode;
26840
+ fbGeometryData.id = geometryData.id;
26841
+ var _geometryData_boneNames;
26842
+ fbGeometryData.boneNames = (_geometryData_boneNames = geometryData.boneNames) != null ? _geometryData_boneNames : [];
26843
+ var _geometryData_rootBoneName;
26844
+ fbGeometryData.rootBoneName = (_geometryData_rootBoneName = geometryData.rootBoneName) != null ? _geometryData_rootBoneName : "";
26845
+ var _geometryData_inverseBindMatrices;
26846
+ fbGeometryData.inverseBindMatrices = (_geometryData_inverseBindMatrices = geometryData.inverseBindMatrices) != null ? _geometryData_inverseBindMatrices : [];
26847
+ var _geometryData_binaryData;
26848
+ fbGeometryData.binaryData = (_geometryData_binaryData = geometryData.binaryData) != null ? _geometryData_binaryData : [];
26849
+ var fbVertexdata = new FBVertexDataT();
26850
+ fbVertexdata.vertexCount = geometryData.vertexData.vertexCount;
26851
+ fbVertexdata.channels = [];
26852
+ for(var _iterator = _create_for_of_iterator_helper_loose(geometryData.vertexData.channels), _step; !(_step = _iterator()).done;){
26853
+ var channel = _step.value;
26854
+ var fbChannel = new FBVertexChannelT(channel.semantic, channel.offset, channel.format, channel.dimension, channel.normalize);
26855
+ fbVertexdata.channels.push(fbChannel);
26856
+ }
26857
+ fbGeometryData.vertexData = fbVertexdata;
26858
+ var fbSubMeshes = [];
26859
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(geometryData.subMeshes), _step1; !(_step1 = _iterator1()).done;){
26860
+ var subMesh = _step1.value;
26861
+ var fbSubMesh = new FBSubMeshT(subMesh.offset, subMesh.indexCount, subMesh.vertexCount);
26862
+ fbSubMeshes.push(fbSubMesh);
26863
+ }
26864
+ fbGeometryData.subMeshes = fbSubMeshes;
26865
+ FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, fbGeometryData.pack(fbb));
26866
+ var buffer = fbb.asUint8Array(); // Of type `Uint8Array`.
26867
+ return buffer;
26868
+ };
26869
+ _proto.binaryToGeometryData = function binaryToGeometryData(buffer) {
26870
+ var buf = new ByteBuffer(buffer);
26871
+ var fbGeometryData = FBGeometryData.getRootAsFBGeometryData(buf);
26872
+ var vertexData = {
26873
+ vertexCount: 0,
26874
+ channels: []
26875
+ };
26876
+ var fbVertexData = fbGeometryData.vertexData();
26877
+ if (fbVertexData) {
26878
+ vertexData.vertexCount = fbVertexData.vertexCount();
26879
+ for(var i = 0; i < fbVertexData.channelsLength(); i++){
26880
+ var channel = fbVertexData.channels(i);
26881
+ if (!channel) {
26882
+ continue;
26883
+ }
26884
+ var _channel_semantic;
26885
+ var vertexChannel = {
26886
+ semantic: (_channel_semantic = channel.semantic()) != null ? _channel_semantic : "",
26887
+ offset: channel.offset(),
26888
+ format: channel.format(),
26889
+ dimension: channel.dimension()
26890
+ };
26891
+ vertexData.channels.push(vertexChannel);
26892
+ }
26893
+ }
26894
+ var subMeshes = [];
26895
+ for(var i1 = 0; i1 < fbGeometryData.subMeshesLength(); i1++){
26896
+ var fbSubMesh = fbGeometryData.subMeshes(i1);
26897
+ if (!fbSubMesh) {
26898
+ continue;
26899
+ }
26900
+ var subMesh = {
26901
+ offset: fbSubMesh.offset(),
26902
+ vertexCount: fbSubMesh.vertexCount()
26903
+ };
26904
+ subMeshes.push(subMesh);
26905
+ }
26906
+ var boneNames = [];
26907
+ for(var i2 = 0; i2 < fbGeometryData.boneNamesLength(); i2++){
26908
+ var boneName = fbGeometryData.boneNames(i2);
26909
+ boneNames.push(boneName);
26910
+ }
26911
+ var inverseBindMatricesArray = fbGeometryData.inverseBindMatricesArray();
26912
+ var _fbGeometryData_buffer, _fbGeometryData_rootBoneName, _fbGeometryData_binaryDataArray, _fbGeometryData_id;
26913
+ var geometryData = {
26914
+ vertexData: vertexData,
26915
+ indexFormat: fbGeometryData.indexFormat(),
26916
+ indexOffset: fbGeometryData.indexOffset(),
26917
+ subMeshes: subMeshes,
26918
+ mode: fbGeometryData.mode(),
26919
+ buffer: (_fbGeometryData_buffer = fbGeometryData.buffer()) != null ? _fbGeometryData_buffer : "",
26920
+ boneNames: boneNames,
26921
+ rootBoneName: (_fbGeometryData_rootBoneName = fbGeometryData.rootBoneName()) != null ? _fbGeometryData_rootBoneName : "",
26922
+ inverseBindMatrices: inverseBindMatricesArray ? Array.from(inverseBindMatricesArray) : undefined,
26923
+ binaryData: (_fbGeometryData_binaryDataArray = fbGeometryData.binaryDataArray()) != null ? _fbGeometryData_binaryDataArray : undefined,
26924
+ id: (_fbGeometryData_id = fbGeometryData.id()) != null ? _fbGeometryData_id : "",
26925
+ dataType: DataType.Geometry
26926
+ };
26927
+ return geometryData;
26928
+ };
26929
+ return EffectsPackage;
26930
+ }();
26931
+
25364
26932
  /**
25365
26933
  * Engine 基类,负责维护所有 GPU 资源的管理及销毁
25366
26934
  */ var Engine = /*#__PURE__*/ function() {
@@ -25434,16 +27002,23 @@ var listOrder = 0;
25434
27002
  for(var i = 0; i < bins.length; i++){
25435
27003
  var binaryData = bins[i];
25436
27004
  var binaryBuffer = scene.bins[i];
25437
- //@ts-expect-error
25438
- binaryData.buffer = binaryBuffer;
25439
- //@ts-expect-error
25440
- if (binaryData.id) {
27005
+ if (binaryData.dataType === DataType.BinaryAsset) {
25441
27006
  //@ts-expect-error
25442
- this.addEffectsObjectData(binaryData);
27007
+ binaryData.buffer = binaryBuffer;
27008
+ if (binaryData.id) {
27009
+ this.addEffectsObjectData(binaryData);
27010
+ }
27011
+ } else {
27012
+ var effectsPackage = new EffectsPackage();
27013
+ effectsPackage.deserializeFromBinary(new Uint8Array(binaryBuffer));
27014
+ for(var _iterator7 = _create_for_of_iterator_helper_loose(effectsPackage.exportObjectDatas), _step7; !(_step7 = _iterator7()).done;){
27015
+ var effectsObjectData = _step7.value;
27016
+ this.addEffectsObjectData(effectsObjectData);
27017
+ }
25443
27018
  }
25444
27019
  }
25445
- for(var _iterator7 = _create_for_of_iterator_helper_loose(textureOptions), _step7; !(_step7 = _iterator7()).done;){
25446
- var textureData = _step7.value;
27020
+ for(var _iterator8 = _create_for_of_iterator_helper_loose(textureOptions), _step8; !(_step8 = _iterator8()).done;){
27021
+ var textureData = _step8.value;
25447
27022
  this.addEffectsObjectData(textureData);
25448
27023
  }
25449
27024
  };
@@ -25753,7 +27328,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
25753
27328
  registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
25754
27329
  registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
25755
27330
  registerPlugin("interact", InteractLoader, exports.VFXItem, true);
25756
- var version$1 = "2.0.0-alpha.26";
27331
+ var version$1 = "2.0.0-alpha.27";
25757
27332
  logger.info("Core version: " + version$1 + ".");
25758
27333
 
25759
27334
  var _obj;
@@ -27386,7 +28961,7 @@ setMaxSpriteMeshItemCount(8);
27386
28961
  */ Mesh.create = function(engine, props) {
27387
28962
  return new ThreeMesh(engine, props);
27388
28963
  };
27389
- var version = "2.0.0-alpha.26";
28964
+ var version = "2.0.0-alpha.27";
27390
28965
  logger.info("THREEJS plugin version: " + version + ".");
27391
28966
 
27392
28967
  exports.AbstractPlugin = AbstractPlugin;
@@ -27422,6 +28997,7 @@ exports.EVENT_TYPE_TOUCH_END = EVENT_TYPE_TOUCH_END;
27422
28997
  exports.EVENT_TYPE_TOUCH_MOVE = EVENT_TYPE_TOUCH_MOVE;
27423
28998
  exports.EVENT_TYPE_TOUCH_START = EVENT_TYPE_TOUCH_START;
27424
28999
  exports.EffectsObject = EffectsObject;
29000
+ exports.EffectsPackage = EffectsPackage;
27425
29001
  exports.Engine = Engine;
27426
29002
  exports.EventSystem = EventSystem;
27427
29003
  exports.Float16ArrayWrapper = Float16ArrayWrapper;