exploria-ui 2026.2.31 → 2026.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +240 -16
  2. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  3. package/dist/components/basic/ECard/ECard.vue.d.ts +27 -0
  4. package/dist/components/index.d.ts +2 -1
  5. package/dist/components/index.js +60 -19368
  6. package/dist/directives/EDrag.d.ts +3 -1
  7. package/dist/directives/index.js +4 -23
  8. package/dist/index.css +1 -1
  9. package/dist/node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +1111 -0
  10. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/controls/OrbitControls.js +424 -0
  11. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSCurve.js +31 -0
  12. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSUtils.js +115 -0
  13. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/libs/fflate.module.js +250 -0
  14. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/FBXLoader.js +1385 -0
  15. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/FontLoader.js +69 -0
  16. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1346 -0
  17. package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +23 -0
  18. package/dist/packages/exploria-ui/src/components/advanced/EParallaxScrolling/EParallaxScrolling.vue.js +7 -0
  19. package/dist/packages/exploria-ui/src/components/advanced/EParallaxScrolling/EParallaxScrolling.vue_vue_type_script_setup_true_lang.js +38 -0
  20. package/dist/packages/exploria-ui/src/components/advanced/ERollingFollow/ERollingFollow.vue.js +7 -0
  21. package/dist/packages/exploria-ui/src/components/advanced/ERollingFollow/ERollingFollow.vue_vue_type_script_setup_true_lang.js +42 -0
  22. package/dist/packages/exploria-ui/src/components/advanced/EVirtualList/EVirtualList.vue.js +7 -0
  23. package/dist/packages/exploria-ui/src/components/advanced/EVirtualList/EVirtualList.vue_vue_type_script_setup_true_lang.js +43 -0
  24. package/dist/packages/exploria-ui/src/components/advanced/EWatermark/EWatermark.vue.js +7 -0
  25. package/dist/packages/exploria-ui/src/components/advanced/EWatermark/EWatermark.vue_vue_type_script_setup_true_lang.js +46 -0
  26. package/dist/packages/exploria-ui/src/components/basic/EButton/EButton.vue.js +7 -0
  27. package/dist/packages/exploria-ui/src/components/basic/EButton/EButton.vue_vue_type_script_setup_true_lang.js +42 -0
  28. package/dist/packages/exploria-ui/src/components/basic/EButton/loading.gif.js +4 -0
  29. package/dist/packages/exploria-ui/src/components/basic/ECard/ECard.vue.js +7 -0
  30. package/dist/packages/exploria-ui/src/components/basic/ECard/ECard.vue_vue_type_script_setup_true_lang.js +41 -0
  31. package/dist/packages/exploria-ui/src/components/basic/ESvgIcon/ESvgIcon.vue.js +5 -0
  32. package/dist/packages/exploria-ui/src/components/basic/ESvgIcon/ESvgIcon.vue_vue_type_script_setup_true_lang.js +11 -0
  33. package/dist/packages/exploria-ui/src/components/basic/EUnderLine/EUnderLine.vue.js +11 -0
  34. package/dist/packages/exploria-ui/src/components/data/EAvatar/EAvatar.vue.js +7 -0
  35. package/dist/packages/exploria-ui/src/components/data/EAvatar/EAvatar.vue_vue_type_script_setup_true_lang.js +14 -0
  36. package/dist/packages/exploria-ui/src/components/data/ECalendar.vue.js +7 -0
  37. package/dist/packages/exploria-ui/src/components/data/ECalendar.vue_vue_type_script_setup_true_lang.js +77 -0
  38. package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarousel.vue.js +7 -0
  39. package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarousel.vue_vue_type_script_setup_true_lang.js +83 -0
  40. package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarouselItem.vue.js +7 -0
  41. package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarouselItem.vue_vue_type_script_setup_true_lang.js +19 -0
  42. package/dist/packages/exploria-ui/src/components/data/ECodeCollapse/ECodeCollapse.vue.js +7 -0
  43. package/dist/packages/exploria-ui/src/components/data/ECodeCollapse/ECodeCollapse.vue_vue_type_script_setup_true_lang.js +46 -0
  44. package/dist/packages/exploria-ui/src/components/data/ECollapse/ECollapse.vue.js +7 -0
  45. package/dist/packages/exploria-ui/src/components/data/ECollapse/ECollapse.vue_vue_type_script_setup_true_lang.js +30 -0
  46. package/dist/packages/exploria-ui/src/components/data/EImage.vue.js +7 -0
  47. package/dist/packages/exploria-ui/src/components/data/EImage.vue_vue_type_script_setup_true_lang.js +31 -0
  48. package/dist/packages/exploria-ui/src/components/data/EList.vue.js +7 -0
  49. package/dist/packages/exploria-ui/src/components/data/EList.vue_vue_type_script_setup_true_lang.js +52 -0
  50. package/dist/packages/exploria-ui/src/components/data/EMediaViewer/EMediaViewer.js +36 -0
  51. package/dist/packages/exploria-ui/src/components/data/EMediaViewer/EMediaViewer.vue.js +7 -0
  52. package/dist/packages/exploria-ui/src/components/data/EMediaViewer/EMediaViewer.vue_vue_type_script_setup_true_lang.js +69 -0
  53. package/dist/packages/exploria-ui/src/components/data/EProgress.vue.js +7 -0
  54. package/dist/packages/exploria-ui/src/components/data/EProgress.vue_vue_type_script_setup_true_lang.js +22 -0
  55. package/dist/packages/exploria-ui/src/components/data/ERollingPagination.vue.js +7 -0
  56. package/dist/packages/exploria-ui/src/components/data/ERollingPagination.vue_vue_type_script_setup_true_lang.js +45 -0
  57. package/dist/packages/exploria-ui/src/components/data/ESkeleton/ESkeleton.vue.js +14 -0
  58. package/dist/packages/exploria-ui/src/components/data/ETable/ETable.vue.js +7 -0
  59. package/dist/packages/exploria-ui/src/components/data/ETable/ETable.vue_vue_type_script_setup_true_lang.js +60 -0
  60. package/dist/packages/exploria-ui/src/components/data/ETable/ETableColumn.vue.js +5 -0
  61. package/dist/packages/exploria-ui/src/components/data/ETable/ETableColumn.vue_vue_type_script_setup_true_lang.js +23 -0
  62. package/dist/packages/exploria-ui/src/components/data/ETable/no_data.svg.js +4 -0
  63. package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimeline.vue.js +7 -0
  64. package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimeline.vue_vue_type_script_setup_true_lang.js +40 -0
  65. package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimelineItem.vue.js +7 -0
  66. package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimelineItem.vue_vue_type_script_setup_true_lang.js +44 -0
  67. package/dist/packages/exploria-ui/src/components/feedback/EDialog/EDialog.vue.js +7 -0
  68. package/dist/packages/exploria-ui/src/components/feedback/EDialog/EDialog.vue_vue_type_script_setup_true_lang.js +95 -0
  69. package/dist/packages/exploria-ui/src/components/feedback/EDrawer/EDrawer.vue.js +7 -0
  70. package/dist/packages/exploria-ui/src/components/feedback/EDrawer/EDrawer.vue_vue_type_script_setup_true_lang.js +106 -0
  71. package/dist/packages/exploria-ui/src/components/feedback/EMessage/EMessage.js +56 -0
  72. package/dist/packages/exploria-ui/src/components/feedback/EMessage/EMessage.vue.js +7 -0
  73. package/dist/packages/exploria-ui/src/components/feedback/EMessage/EMessage.vue_vue_type_script_setup_true_lang.js +39 -0
  74. package/dist/packages/exploria-ui/src/components/feedback/EMessage/loading.gif.js +4 -0
  75. package/dist/packages/exploria-ui/src/components/feedback/EMessageBox/EMessageBox.js +31 -0
  76. package/dist/packages/exploria-ui/src/components/feedback/EMessageBox/EMessageBox.vue.js +7 -0
  77. package/dist/packages/exploria-ui/src/components/feedback/EMessageBox/EMessageBox.vue_vue_type_script_setup_true_lang.js +46 -0
  78. package/dist/packages/exploria-ui/src/components/feedback/ENotification/ENotification.js +141 -0
  79. package/dist/packages/exploria-ui/src/components/feedback/ENotification/ENotification.vue.js +7 -0
  80. package/dist/packages/exploria-ui/src/components/feedback/ENotification/ENotification.vue_vue_type_script_setup_true_lang.js +46 -0
  81. package/dist/packages/exploria-ui/src/components/feedback/EPopover.vue.js +7 -0
  82. package/dist/packages/exploria-ui/src/components/feedback/EPopover.vue_vue_type_script_setup_true_lang.js +100 -0
  83. package/dist/packages/exploria-ui/src/components/feedback/ETooltip.vue.js +7 -0
  84. package/dist/packages/exploria-ui/src/components/feedback/ETooltip.vue_vue_type_script_setup_true_lang.js +65 -0
  85. package/dist/packages/exploria-ui/src/components/form/ECheckbox.vue.js +7 -0
  86. package/dist/packages/exploria-ui/src/components/form/ECheckbox.vue_vue_type_script_setup_true_lang.js +36 -0
  87. package/dist/packages/exploria-ui/src/components/form/EColorPicker.vue.js +7 -0
  88. package/dist/packages/exploria-ui/src/components/form/EColorPicker.vue_vue_type_script_setup_true_lang.js +149 -0
  89. package/dist/packages/exploria-ui/src/components/form/EConditionGroup/EConditionGroup.vue.js +7 -0
  90. package/dist/packages/exploria-ui/src/components/form/EConditionGroup/EConditionGroup.vue_vue_type_script_setup_true_lang.js +101 -0
  91. package/dist/packages/exploria-ui/src/components/form/EFileSelector.vue.js +7 -0
  92. package/dist/packages/exploria-ui/src/components/form/EFileSelector.vue_vue_type_script_setup_true_lang.js +33 -0
  93. package/dist/packages/exploria-ui/src/components/form/EForm.vue.js +7 -0
  94. package/dist/packages/exploria-ui/src/components/form/EForm.vue_vue_type_script_setup_true_lang.js +19 -0
  95. package/dist/packages/exploria-ui/src/components/form/EFormItem.vue.js +7 -0
  96. package/dist/packages/exploria-ui/src/components/form/EFormItem.vue_vue_type_script_setup_true_lang.js +44 -0
  97. package/dist/packages/exploria-ui/src/components/form/EInput/EInput.vue.js +7 -0
  98. package/dist/packages/exploria-ui/src/components/form/EInput/EInput.vue_vue_type_script_setup_true_lang.js +165 -0
  99. package/dist/packages/exploria-ui/src/components/form/ERadio.vue.js +7 -0
  100. package/dist/packages/exploria-ui/src/components/form/ERadio.vue_vue_type_script_setup_true_lang.js +36 -0
  101. package/dist/packages/exploria-ui/src/components/form/ESelect/ESelect.vue.js +7 -0
  102. package/dist/packages/exploria-ui/src/components/form/ESelect/ESelect.vue_vue_type_script_setup_true_lang.js +82 -0
  103. package/dist/packages/exploria-ui/src/components/form/ESlider.vue.js +7 -0
  104. package/dist/packages/exploria-ui/src/components/form/ESlider.vue_vue_type_script_setup_true_lang.js +76 -0
  105. package/dist/packages/exploria-ui/src/components/form/ETimePicker.vue.js +7 -0
  106. package/dist/packages/exploria-ui/src/components/form/ETimePicker.vue_vue_type_script_setup_true_lang.js +89 -0
  107. package/dist/packages/exploria-ui/src/components/geometry/ECube.vue.js +11 -0
  108. package/dist/packages/exploria-ui/src/components/hooks/usePosition.js +42 -0
  109. package/dist/packages/exploria-ui/src/components/layout/EContainerWithScrollbar.vue.js +7 -0
  110. package/dist/packages/exploria-ui/src/components/layout/EContainerWithScrollbar.vue_vue_type_script_setup_true_lang.js +27 -0
  111. package/dist/packages/exploria-ui/src/components/layout/EDivider.vue.js +7 -0
  112. package/dist/packages/exploria-ui/src/components/layout/EDivider.vue_vue_type_script_setup_true_lang.js +15 -0
  113. package/dist/packages/exploria-ui/src/components/layout/EScrollX.vue.js +7 -0
  114. package/dist/packages/exploria-ui/src/components/layout/EScrollX.vue_vue_type_script_setup_true_lang.js +34 -0
  115. package/dist/packages/exploria-ui/src/components/layout/EScrollbar.vue.js +7 -0
  116. package/dist/packages/exploria-ui/src/components/layout/EScrollbar.vue_vue_type_script_setup_true_lang.js +55 -0
  117. package/dist/packages/exploria-ui/src/components/navigation/EDropdown.vue.js +7 -0
  118. package/dist/packages/exploria-ui/src/components/navigation/EDropdown.vue_vue_type_script_setup_true_lang.js +107 -0
  119. package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabPane.vue.js +7 -0
  120. package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabPane.vue_vue_type_script_setup_true_lang.js +20 -0
  121. package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabs.vue.js +7 -0
  122. package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabs.vue_vue_type_script_setup_true_lang.js +90 -0
  123. package/dist/packages/exploria-ui/src/directives/EDrag.js +27 -0
  124. package/dist/packages/exploria-ui/src/directives/ESizeOb.js +23 -0
  125. package/dist/packages/exploria-ui/src/directives/ESlideIn.js +24 -0
  126. package/dist/packages/exploria-ui/src/utils/EAnimateCSSUtil.js +13 -0
  127. package/dist/packages/exploria-ui/src/utils/EClipboardUtil.js +19 -0
  128. package/dist/packages/exploria-ui/src/utils/EDomUtil.js +9 -0
  129. package/dist/packages/exploria-ui/src/utils/EEchartsUtil.js +23 -0
  130. package/dist/packages/exploria-ui/src/utils/EImageUtil.js +26 -0
  131. package/dist/packages/exploria-ui/src/utils/ELocalStorageUtil.js +15 -0
  132. package/dist/packages/exploria-ui/src/utils/EMediaQueryUtil.js +28 -0
  133. package/dist/packages/exploria-ui/src/utils/EStringUtil.js +11 -0
  134. package/dist/packages/exploria-ui/src/utils/EThreeUtil.js +40 -0
  135. package/dist/packages/exploria-ui/src/utils/EUUIDUtil.js +11 -0
  136. package/dist/utils/EAnimateCSSUtil.d.ts +6 -0
  137. package/dist/utils/EClipboardUtil.d.ts +3 -0
  138. package/dist/utils/EDomUtil.d.ts +5 -0
  139. package/dist/utils/EEchartsUtil.d.ts +12 -0
  140. package/dist/utils/EEventBus.d.ts +8 -0
  141. package/dist/utils/EImageUtil.d.ts +3 -0
  142. package/dist/utils/EJSONUtil.d.ts +3 -0
  143. package/dist/utils/ELocalStorageUtil.d.ts +5 -0
  144. package/dist/utils/EMediaQueryUtil.d.ts +6 -0
  145. package/dist/utils/EStringUtil.d.ts +22 -0
  146. package/dist/utils/EThreeUtil.d.ts +21 -0
  147. package/dist/utils/ETimeUtil.d.ts +5 -0
  148. package/dist/utils/EUUIDUtil.d.ts +3 -0
  149. package/dist/utils/index.d.ts +8 -0
  150. package/dist/utils/index.js +8 -2
  151. package/package.json +25 -13
  152. package/src/plugins/EPreloadImageBuilder.ts +1 -1
  153. package/src/plugins/ESvgSpriteBuilder.ts +4 -5
  154. package/src/plugins/index.ts +3 -3
  155. package/dist/EDomUtil-Bm3Zqw96.js +0 -65
  156. package/dist/ESizeOb-VeHF4XTz.js +0 -44
  157. package/dist/plugins/EPreloadImageBuilder.d.ts +0 -5
  158. package/dist/plugins/ESvgPolyfill.d.ts +0 -3
  159. package/dist/plugins/ESvgSpriteBuilder.d.ts +0 -6
  160. package/dist/plugins/index.d.ts +0 -4
  161. package/dist/plugins/index.js +0 -3127
@@ -0,0 +1,1385 @@
1
+ import { unzlibSync as e } from "../libs/fflate.module.js";
2
+ import { NURBSCurve as t } from "../curves/NURBSCurve.js";
3
+ import { AmbientLight as n, AnimationClip as r, Bone as i, BufferGeometry as a, ClampToEdgeWrapping as o, Color as s, ColorManagement as c, DirectionalLight as l, EquirectangularReflectionMapping as u, Euler as d, FileLoader as f, Float32BufferAttribute as p, Group as m, Line as h, LineBasicMaterial as g, Loader as _, LoaderUtils as v, MathUtils as y, Matrix3 as b, Matrix4 as x, Mesh as S, MeshLambertMaterial as C, MeshPhongMaterial as w, NumberKeyframeTrack as T, Object3D as E, PerspectiveCamera as D, PointLight as O, PropertyBinding as k, Quaternion as A, QuaternionKeyframeTrack as j, RepeatWrapping as M, SRGBColorSpace as N, ShapeUtils as ee, Skeleton as te, SkinnedMesh as ne, SpotLight as re, Texture as ie, TextureLoader as ae, Uint16BufferAttribute as oe, Vector2 as se, Vector3 as P, Vector4 as ce, VectorKeyframeTrack as le } from "three";
4
+ //#region ../../node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/FBXLoader.js
5
+ var F, I, L, ue = class extends _ {
6
+ constructor(e) {
7
+ super(e);
8
+ }
9
+ load(e, t, n, r) {
10
+ let i = this, a = i.path === "" ? v.extractUrlBase(e) : i.path, o = new f(this.manager);
11
+ o.setPath(i.path), o.setResponseType("arraybuffer"), o.setRequestHeader(i.requestHeader), o.setWithCredentials(i.withCredentials), o.load(e, function(n) {
12
+ try {
13
+ t(i.parse(n, a));
14
+ } catch (t) {
15
+ r ? r(t) : console.error(t), i.manager.itemError(e);
16
+ }
17
+ }, n, r);
18
+ }
19
+ parse(e, t) {
20
+ if (de(e)) F = new H().parse(e);
21
+ else {
22
+ let t = $(e);
23
+ if (!fe(t)) throw Error("THREE.FBXLoader: Unknown format.");
24
+ if (G(t) < 7e3) throw Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + G(t));
25
+ F = new V().parse(t);
26
+ }
27
+ return new R(new ae(this.manager).setPath(this.resourcePath || t).setCrossOrigin(this.crossOrigin), this.manager).parse(F);
28
+ }
29
+ }, R = class {
30
+ constructor(e, t) {
31
+ this.textureLoader = e, this.manager = t;
32
+ }
33
+ parse() {
34
+ I = this.parseConnections();
35
+ let e = this.parseImages(), t = this.parseTextures(e), n = this.parseMaterials(t), r = this.parseDeformers(), i = new z().parse(r);
36
+ return this.parseScene(r, i, n), L;
37
+ }
38
+ parseConnections() {
39
+ let e = /* @__PURE__ */ new Map();
40
+ return "Connections" in F && F.Connections.connections.forEach(function(t) {
41
+ let n = t[0], r = t[1], i = t[2];
42
+ e.has(n) || e.set(n, {
43
+ parents: [],
44
+ children: []
45
+ });
46
+ let a = {
47
+ ID: r,
48
+ relationship: i
49
+ };
50
+ e.get(n).parents.push(a), e.has(r) || e.set(r, {
51
+ parents: [],
52
+ children: []
53
+ });
54
+ let o = {
55
+ ID: n,
56
+ relationship: i
57
+ };
58
+ e.get(r).children.push(o);
59
+ }), e;
60
+ }
61
+ parseImages() {
62
+ let e = {}, t = {};
63
+ if ("Video" in F.Objects) {
64
+ let n = F.Objects.Video;
65
+ for (let r in n) {
66
+ let i = n[r], a = parseInt(r);
67
+ if (e[a] = i.RelativeFilename || i.Filename, "Content" in i) {
68
+ let e = i.Content instanceof ArrayBuffer && i.Content.byteLength > 0, a = typeof i.Content == "string" && i.Content !== "";
69
+ if (e || a) {
70
+ let e = this.parseImage(n[r]);
71
+ t[i.RelativeFilename || i.Filename] = e;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ for (let n in e) {
77
+ let r = e[n];
78
+ t[r] === void 0 ? e[n] = e[n].split("\\").pop() : e[n] = t[r];
79
+ }
80
+ return e;
81
+ }
82
+ parseImage(e) {
83
+ let t = e.Content, n = e.RelativeFilename || e.Filename, r = n.slice(n.lastIndexOf(".") + 1).toLowerCase(), i;
84
+ switch (r) {
85
+ case "bmp":
86
+ i = "image/bmp";
87
+ break;
88
+ case "jpg":
89
+ case "jpeg":
90
+ i = "image/jpeg";
91
+ break;
92
+ case "png":
93
+ i = "image/png";
94
+ break;
95
+ case "tif":
96
+ i = "image/tiff";
97
+ break;
98
+ case "tga":
99
+ this.manager.getHandler(".tga") === null && console.warn("FBXLoader: TGA loader not found, skipping ", n), i = "image/tga";
100
+ break;
101
+ case "webp":
102
+ i = "image/webp";
103
+ break;
104
+ default:
105
+ console.warn("FBXLoader: Image type \"" + r + "\" is not supported.");
106
+ return;
107
+ }
108
+ if (typeof t == "string") return "data:" + i + ";base64," + t;
109
+ {
110
+ let e = new Uint8Array(t);
111
+ return window.URL.createObjectURL(new Blob([e], { type: i }));
112
+ }
113
+ }
114
+ parseTextures(e) {
115
+ let t = /* @__PURE__ */ new Map();
116
+ if ("Texture" in F.Objects) {
117
+ let n = F.Objects.Texture;
118
+ for (let r in n) {
119
+ let i = this.parseTexture(n[r], e);
120
+ t.set(parseInt(r), i);
121
+ }
122
+ }
123
+ return t;
124
+ }
125
+ parseTexture(e, t) {
126
+ let n = this.loadTexture(e, t);
127
+ n.ID = e.id, n.name = e.attrName;
128
+ let r = e.WrapModeU, i = e.WrapModeV, a = r === void 0 ? 0 : r.value, s = i === void 0 ? 0 : i.value;
129
+ if (n.wrapS = a === 0 ? M : o, n.wrapT = s === 0 ? M : o, "Scaling" in e) {
130
+ let t = e.Scaling.value;
131
+ n.repeat.x = t[0], n.repeat.y = t[1];
132
+ }
133
+ if ("Translation" in e) {
134
+ let t = e.Translation.value;
135
+ n.offset.x = t[0], n.offset.y = t[1];
136
+ }
137
+ return n;
138
+ }
139
+ loadTexture(e, t) {
140
+ let n = e.FileName.split(".").pop().toLowerCase(), r = this.manager.getHandler(`.${n}`);
141
+ r === null && (r = this.textureLoader);
142
+ let i = r.path;
143
+ i || r.setPath(this.textureLoader.path);
144
+ let a = I.get(e.id).children, o;
145
+ if (a !== void 0 && a.length > 0 && t[a[0].ID] !== void 0 && (o = t[a[0].ID], (o.indexOf("blob:") === 0 || o.indexOf("data:") === 0) && r.setPath(void 0)), o === void 0) return console.warn("FBXLoader: Undefined filename, creating placeholder texture."), new ie();
146
+ let s = r.load(o);
147
+ return r.setPath(i), s;
148
+ }
149
+ parseMaterials(e) {
150
+ let t = /* @__PURE__ */ new Map();
151
+ if ("Material" in F.Objects) {
152
+ let n = F.Objects.Material;
153
+ for (let r in n) {
154
+ let i = this.parseMaterial(n[r], e);
155
+ i !== null && t.set(parseInt(r), i);
156
+ }
157
+ }
158
+ return t;
159
+ }
160
+ parseMaterial(e, t) {
161
+ let n = e.id, r = e.attrName, i = e.ShadingModel;
162
+ if (typeof i == "object" && (i = i.value), !I.has(n)) return null;
163
+ let a = this.parseParameters(e, t, n), o;
164
+ switch (i.toLowerCase()) {
165
+ case "phong":
166
+ o = new w();
167
+ break;
168
+ case "lambert":
169
+ o = new C();
170
+ break;
171
+ default:
172
+ console.warn("THREE.FBXLoader: unknown material type \"%s\". Defaulting to MeshPhongMaterial.", i), o = new w();
173
+ break;
174
+ }
175
+ return o.setValues(a), o.name = r, o;
176
+ }
177
+ parseParameters(e, t, n) {
178
+ let r = {};
179
+ e.BumpFactor && (r.bumpScale = e.BumpFactor.value), e.Diffuse ? r.color = c.colorSpaceToWorking(new s().fromArray(e.Diffuse.value), N) : e.DiffuseColor && (e.DiffuseColor.type === "Color" || e.DiffuseColor.type === "ColorRGB") && (r.color = c.colorSpaceToWorking(new s().fromArray(e.DiffuseColor.value), N)), e.DisplacementFactor && (r.displacementScale = e.DisplacementFactor.value), e.Emissive ? r.emissive = c.colorSpaceToWorking(new s().fromArray(e.Emissive.value), N) : e.EmissiveColor && (e.EmissiveColor.type === "Color" || e.EmissiveColor.type === "ColorRGB") && (r.emissive = c.colorSpaceToWorking(new s().fromArray(e.EmissiveColor.value), N)), e.EmissiveFactor && (r.emissiveIntensity = parseFloat(e.EmissiveFactor.value)), r.opacity = 1 - (e.TransparencyFactor ? parseFloat(e.TransparencyFactor.value) : 0), (r.opacity === 1 || r.opacity === 0) && (r.opacity = e.Opacity ? parseFloat(e.Opacity.value) : null, r.opacity === null && (r.opacity = 1 - (e.TransparentColor ? parseFloat(e.TransparentColor.value[0]) : 0))), r.opacity < 1 && (r.transparent = !0), e.ReflectionFactor && (r.reflectivity = e.ReflectionFactor.value), e.Shininess && (r.shininess = e.Shininess.value), e.Specular ? r.specular = c.colorSpaceToWorking(new s().fromArray(e.Specular.value), N) : e.SpecularColor && e.SpecularColor.type === "Color" && (r.specular = c.colorSpaceToWorking(new s().fromArray(e.SpecularColor.value), N));
180
+ let i = this;
181
+ return I.get(n).children.forEach(function(e) {
182
+ let n = e.relationship;
183
+ switch (n) {
184
+ case "Bump":
185
+ r.bumpMap = i.getTexture(t, e.ID);
186
+ break;
187
+ case "Maya|TEX_ao_map":
188
+ r.aoMap = i.getTexture(t, e.ID);
189
+ break;
190
+ case "DiffuseColor":
191
+ case "Maya|TEX_color_map":
192
+ r.map = i.getTexture(t, e.ID), r.map !== void 0 && (r.map.colorSpace = N);
193
+ break;
194
+ case "DisplacementColor":
195
+ r.displacementMap = i.getTexture(t, e.ID);
196
+ break;
197
+ case "EmissiveColor":
198
+ r.emissiveMap = i.getTexture(t, e.ID), r.emissiveMap !== void 0 && (r.emissiveMap.colorSpace = N);
199
+ break;
200
+ case "NormalMap":
201
+ case "Maya|TEX_normal_map":
202
+ r.normalMap = i.getTexture(t, e.ID);
203
+ break;
204
+ case "ReflectionColor":
205
+ r.envMap = i.getTexture(t, e.ID), r.envMap !== void 0 && (r.envMap.mapping = u, r.envMap.colorSpace = N);
206
+ break;
207
+ case "SpecularColor":
208
+ r.specularMap = i.getTexture(t, e.ID), r.specularMap !== void 0 && (r.specularMap.colorSpace = N);
209
+ break;
210
+ case "TransparentColor":
211
+ case "TransparencyFactor":
212
+ r.alphaMap = i.getTexture(t, e.ID), r.transparent = !0;
213
+ break;
214
+ default:
215
+ console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.", n);
216
+ break;
217
+ }
218
+ }), r;
219
+ }
220
+ getTexture(e, t) {
221
+ return "LayeredTexture" in F.Objects && t in F.Objects.LayeredTexture && (console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."), t = I.get(t).children[0].ID), e.get(t);
222
+ }
223
+ parseDeformers() {
224
+ let e = {}, t = {};
225
+ if ("Deformer" in F.Objects) {
226
+ let n = F.Objects.Deformer;
227
+ for (let r in n) {
228
+ let i = n[r], a = I.get(parseInt(r));
229
+ if (i.attrType === "Skin") {
230
+ let t = this.parseSkeleton(a, n);
231
+ t.ID = r, a.parents.length > 1 && console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."), t.geometryID = a.parents[0].ID, e[r] = t;
232
+ } else if (i.attrType === "BlendShape") {
233
+ let e = { id: r };
234
+ e.rawTargets = this.parseMorphTargets(a, n), e.id = r, a.parents.length > 1 && console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."), t[r] = e;
235
+ }
236
+ }
237
+ }
238
+ return {
239
+ skeletons: e,
240
+ morphTargets: t
241
+ };
242
+ }
243
+ parseSkeleton(e, t) {
244
+ let n = [];
245
+ return e.children.forEach(function(e) {
246
+ let r = t[e.ID];
247
+ if (r.attrType !== "Cluster") return;
248
+ let i = {
249
+ ID: e.ID,
250
+ indices: [],
251
+ weights: [],
252
+ transformLink: new x().fromArray(r.TransformLink.a)
253
+ };
254
+ "Indexes" in r && (i.indices = r.Indexes.a, i.weights = r.Weights.a), n.push(i);
255
+ }), {
256
+ rawBones: n,
257
+ bones: []
258
+ };
259
+ }
260
+ parseMorphTargets(e, t) {
261
+ let n = [];
262
+ for (let r = 0; r < e.children.length; r++) {
263
+ let i = e.children[r], a = t[i.ID], o = {
264
+ name: a.attrName,
265
+ initialWeight: a.DeformPercent,
266
+ id: a.id,
267
+ fullWeights: a.FullWeights.a
268
+ };
269
+ if (a.attrType !== "BlendShapeChannel") return;
270
+ o.geoID = I.get(parseInt(i.ID)).children.filter(function(e) {
271
+ return e.relationship === void 0;
272
+ })[0].ID, n.push(o);
273
+ }
274
+ return n;
275
+ }
276
+ parseScene(e, t, n) {
277
+ L = new m();
278
+ let r = this.parseModels(e.skeletons, t, n), i = F.Objects.Model, a = this;
279
+ r.forEach(function(e) {
280
+ let t = i[e.ID];
281
+ a.setLookAtProperties(e, t), I.get(e.ID).parents.forEach(function(t) {
282
+ let n = r.get(t.ID);
283
+ n !== void 0 && n.add(e);
284
+ }), e.parent === null && L.add(e);
285
+ }), this.bindSkeleton(e.skeletons, t, r), this.addGlobalSceneSettings(), L.traverse(function(e) {
286
+ if (e.userData.transformData) {
287
+ e.parent && (e.userData.transformData.parentMatrix = e.parent.matrix, e.userData.transformData.parentMatrixWorld = e.parent.matrixWorld);
288
+ let t = X(e.userData.transformData);
289
+ e.applyMatrix4(t), e.updateWorldMatrix();
290
+ }
291
+ });
292
+ let o = new B().parse();
293
+ L.children.length === 1 && L.children[0].isGroup && (L.children[0].animations = o, L = L.children[0]), L.animations = o;
294
+ }
295
+ parseModels(e, t, n) {
296
+ let r = /* @__PURE__ */ new Map(), a = F.Objects.Model;
297
+ for (let o in a) {
298
+ let s = parseInt(o), c = a[o], l = I.get(s), u = this.buildSkeleton(l, e, s, c.attrName);
299
+ if (!u) {
300
+ switch (c.attrType) {
301
+ case "Camera":
302
+ u = this.createCamera(l);
303
+ break;
304
+ case "Light":
305
+ u = this.createLight(l);
306
+ break;
307
+ case "Mesh":
308
+ u = this.createMesh(l, t, n);
309
+ break;
310
+ case "NurbsCurve":
311
+ u = this.createCurve(l, t);
312
+ break;
313
+ case "LimbNode":
314
+ case "Root":
315
+ u = new i();
316
+ break;
317
+ default:
318
+ u = new m();
319
+ break;
320
+ }
321
+ u.name = c.attrName ? k.sanitizeNodeName(c.attrName) : "", u.userData.originalName = c.attrName, u.ID = s;
322
+ }
323
+ this.getTransformData(u, c), r.set(s, u);
324
+ }
325
+ return r;
326
+ }
327
+ buildSkeleton(e, t, n, r) {
328
+ let a = null;
329
+ return e.parents.forEach(function(e) {
330
+ for (let o in t) {
331
+ let s = t[o];
332
+ s.rawBones.forEach(function(t, o) {
333
+ if (t.ID === e.ID) {
334
+ let e = a;
335
+ a = new i(), a.matrixWorld.copy(t.transformLink), a.name = r ? k.sanitizeNodeName(r) : "", a.userData.originalName = r, a.ID = n, s.bones[o] = a, e !== null && a.add(e);
336
+ }
337
+ });
338
+ }
339
+ }), a;
340
+ }
341
+ createCamera(e) {
342
+ let t, n;
343
+ if (e.children.forEach(function(e) {
344
+ let t = F.Objects.NodeAttribute[e.ID];
345
+ t !== void 0 && (n = t);
346
+ }), n === void 0) t = new E();
347
+ else {
348
+ let e = 0;
349
+ n.CameraProjectionType !== void 0 && n.CameraProjectionType.value === 1 && (e = 1);
350
+ let r = 1;
351
+ n.NearPlane !== void 0 && (r = n.NearPlane.value / 1e3);
352
+ let i = 1e3;
353
+ n.FarPlane !== void 0 && (i = n.FarPlane.value / 1e3);
354
+ let a = window.innerWidth, o = window.innerHeight;
355
+ n.AspectWidth !== void 0 && n.AspectHeight !== void 0 && (a = n.AspectWidth.value, o = n.AspectHeight.value);
356
+ let s = a / o, c = 45;
357
+ n.FieldOfView !== void 0 && (c = n.FieldOfView.value);
358
+ let l = n.FocalLength ? n.FocalLength.value : null;
359
+ switch (e) {
360
+ case 0:
361
+ t = new D(c, s, r, i), l !== null && t.setFocalLength(l);
362
+ break;
363
+ case 1:
364
+ console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."), t = new E();
365
+ break;
366
+ default:
367
+ console.warn("THREE.FBXLoader: Unknown camera type " + e + "."), t = new E();
368
+ break;
369
+ }
370
+ }
371
+ return t;
372
+ }
373
+ createLight(e) {
374
+ let t, n;
375
+ if (e.children.forEach(function(e) {
376
+ let t = F.Objects.NodeAttribute[e.ID];
377
+ t !== void 0 && (n = t);
378
+ }), n === void 0) t = new E();
379
+ else {
380
+ let e;
381
+ e = n.LightType === void 0 ? 0 : n.LightType.value;
382
+ let r = 16777215;
383
+ n.Color !== void 0 && (r = c.colorSpaceToWorking(new s().fromArray(n.Color.value), N));
384
+ let i = n.Intensity === void 0 ? 1 : n.Intensity.value / 100;
385
+ n.CastLightOnObject !== void 0 && n.CastLightOnObject.value === 0 && (i = 0);
386
+ let a = 0;
387
+ switch (n.FarAttenuationEnd !== void 0 && (a = n.EnableFarAttenuation !== void 0 && n.EnableFarAttenuation.value === 0 ? 0 : n.FarAttenuationEnd.value), e) {
388
+ case 0:
389
+ t = new O(r, i, a, 1);
390
+ break;
391
+ case 1:
392
+ t = new l(r, i);
393
+ break;
394
+ case 2:
395
+ let e = Math.PI / 3;
396
+ n.InnerAngle !== void 0 && (e = y.degToRad(n.InnerAngle.value));
397
+ let o = 0;
398
+ n.OuterAngle !== void 0 && (o = y.degToRad(n.OuterAngle.value), o = Math.max(o, 1)), t = new re(r, i, a, e, o, 1);
399
+ break;
400
+ default:
401
+ console.warn("THREE.FBXLoader: Unknown light type " + n.LightType.value + ", defaulting to a PointLight."), t = new O(r, i);
402
+ break;
403
+ }
404
+ n.CastShadows !== void 0 && n.CastShadows.value === 1 && (t.castShadow = !0);
405
+ }
406
+ return t;
407
+ }
408
+ createMesh(e, t, n) {
409
+ let r, i = null, a = null, o = [];
410
+ if (e.children.forEach(function(e) {
411
+ t.has(e.ID) && (i = t.get(e.ID)), n.has(e.ID) && o.push(n.get(e.ID));
412
+ }), o.length > 1 ? a = o : o.length > 0 ? a = o[0] : (a = new w({
413
+ name: _.DEFAULT_MATERIAL_NAME,
414
+ color: 13421772
415
+ }), o.push(a)), "color" in i.attributes && o.forEach(function(e) {
416
+ e.vertexColors = !0;
417
+ }), i.groups.length > 0) {
418
+ let e = !1;
419
+ for (let t = 0, n = i.groups.length; t < n; t++) {
420
+ let n = i.groups[t];
421
+ (n.materialIndex < 0 || n.materialIndex >= o.length) && (n.materialIndex = o.length, e = !0);
422
+ }
423
+ if (e) {
424
+ let e = new w();
425
+ o.push(e);
426
+ }
427
+ }
428
+ return i.FBX_Deformer ? (r = new ne(i, a), r.normalizeSkinWeights()) : r = new S(i, a), r;
429
+ }
430
+ createCurve(e, t) {
431
+ return new h(e.children.reduce(function(e, n) {
432
+ return t.has(n.ID) && (e = t.get(n.ID)), e;
433
+ }, null), new g({
434
+ name: _.DEFAULT_MATERIAL_NAME,
435
+ color: 3342591,
436
+ linewidth: 1
437
+ }));
438
+ }
439
+ getTransformData(e, t) {
440
+ let n = {};
441
+ "InheritType" in t && (n.inheritType = parseInt(t.InheritType.value)), "RotationOrder" in t ? n.eulerOrder = Z(t.RotationOrder.value) : n.eulerOrder = Z(0), "Lcl_Translation" in t && (n.translation = t.Lcl_Translation.value), "PreRotation" in t && (n.preRotation = t.PreRotation.value), "Lcl_Rotation" in t && (n.rotation = t.Lcl_Rotation.value), "PostRotation" in t && (n.postRotation = t.PostRotation.value), "Lcl_Scaling" in t && (n.scale = t.Lcl_Scaling.value), "ScalingOffset" in t && (n.scalingOffset = t.ScalingOffset.value), "ScalingPivot" in t && (n.scalingPivot = t.ScalingPivot.value), "RotationOffset" in t && (n.rotationOffset = t.RotationOffset.value), "RotationPivot" in t && (n.rotationPivot = t.RotationPivot.value), e.userData.transformData = n;
442
+ }
443
+ setLookAtProperties(e, t) {
444
+ "LookAtProperty" in t && I.get(e.ID).children.forEach(function(t) {
445
+ if (t.relationship === "LookAtProperty") {
446
+ let n = F.Objects.Model[t.ID];
447
+ if ("Lcl_Translation" in n) {
448
+ let t = n.Lcl_Translation.value;
449
+ e.target === void 0 ? e.lookAt(new P().fromArray(t)) : (e.target.position.fromArray(t), L.add(e.target));
450
+ }
451
+ }
452
+ });
453
+ }
454
+ bindSkeleton(e, t, n) {
455
+ let r = this.parsePoseNodes();
456
+ for (let i in e) {
457
+ let a = e[i];
458
+ I.get(parseInt(a.ID)).parents.forEach(function(e) {
459
+ if (t.has(e.ID)) {
460
+ let t = e.ID;
461
+ I.get(t).parents.forEach(function(e) {
462
+ n.has(e.ID) && n.get(e.ID).bind(new te(a.bones), r[e.ID]);
463
+ });
464
+ }
465
+ });
466
+ }
467
+ }
468
+ parsePoseNodes() {
469
+ let e = {};
470
+ if ("Pose" in F.Objects) {
471
+ let t = F.Objects.Pose;
472
+ for (let n in t) if (t[n].attrType === "BindPose" && t[n].NbPoseNodes > 0) {
473
+ let r = t[n].PoseNode;
474
+ Array.isArray(r) ? r.forEach(function(t) {
475
+ e[t.Node] = new x().fromArray(t.Matrix.a);
476
+ }) : e[r.Node] = new x().fromArray(r.Matrix.a);
477
+ }
478
+ }
479
+ return e;
480
+ }
481
+ addGlobalSceneSettings() {
482
+ if ("GlobalSettings" in F) {
483
+ if ("AmbientColor" in F.GlobalSettings) {
484
+ let e = F.GlobalSettings.AmbientColor.value, t = e[0], r = e[1], i = e[2];
485
+ if (t !== 0 || r !== 0 || i !== 0) {
486
+ let e = new s().setRGB(t, r, i, N);
487
+ L.add(new n(e, 1));
488
+ }
489
+ }
490
+ "UnitScaleFactor" in F.GlobalSettings && (L.userData.unitScaleFactor = F.GlobalSettings.UnitScaleFactor.value);
491
+ }
492
+ }
493
+ }, z = class {
494
+ constructor() {
495
+ this.negativeMaterialIndices = !1;
496
+ }
497
+ parse(e) {
498
+ let t = /* @__PURE__ */ new Map();
499
+ if ("Geometry" in F.Objects) {
500
+ let n = F.Objects.Geometry;
501
+ for (let r in n) {
502
+ let i = I.get(parseInt(r)), a = this.parseGeometry(i, n[r], e);
503
+ t.set(parseInt(r), a);
504
+ }
505
+ }
506
+ return this.negativeMaterialIndices === !0 && console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."), t;
507
+ }
508
+ parseGeometry(e, t, n) {
509
+ switch (t.attrType) {
510
+ case "Mesh": return this.parseMeshGeometry(e, t, n);
511
+ case "NurbsCurve": return this.parseNurbsGeometry(t);
512
+ }
513
+ }
514
+ parseMeshGeometry(e, t, n) {
515
+ let r = n.skeletons, i = [], a = e.parents.map(function(e) {
516
+ return F.Objects.Model[e.ID];
517
+ });
518
+ if (a.length === 0) return;
519
+ let o = e.children.reduce(function(e, t) {
520
+ return r[t.ID] !== void 0 && (e = r[t.ID]), e;
521
+ }, null);
522
+ e.children.forEach(function(e) {
523
+ n.morphTargets[e.ID] !== void 0 && i.push(n.morphTargets[e.ID]);
524
+ });
525
+ let s = a[0], c = {};
526
+ "RotationOrder" in s && (c.eulerOrder = Z(s.RotationOrder.value)), "InheritType" in s && (c.inheritType = parseInt(s.InheritType.value)), "GeometricTranslation" in s && (c.translation = s.GeometricTranslation.value), "GeometricRotation" in s && (c.rotation = s.GeometricRotation.value), "GeometricScaling" in s && (c.scale = s.GeometricScaling.value);
527
+ let l = X(c);
528
+ return this.genGeometry(t, o, i, l);
529
+ }
530
+ genGeometry(e, t, n, r) {
531
+ let i = new a();
532
+ e.attrName && (i.name = e.attrName);
533
+ let o = this.parseGeoNode(e, t), s = this.genBuffers(o), c = new p(s.vertex, 3);
534
+ if (c.applyMatrix4(r), i.setAttribute("position", c), s.colors.length > 0 && i.setAttribute("color", new p(s.colors, 3)), t && (i.setAttribute("skinIndex", new oe(s.weightsIndices, 4)), i.setAttribute("skinWeight", new p(s.vertexWeights, 4)), i.FBX_Deformer = t), s.normal.length > 0) {
535
+ let e = new b().getNormalMatrix(r), t = new p(s.normal, 3);
536
+ t.applyNormalMatrix(e), i.setAttribute("normal", t);
537
+ }
538
+ if (s.uvs.forEach(function(e, t) {
539
+ let n = t === 0 ? "uv" : `uv${t}`;
540
+ i.setAttribute(n, new p(s.uvs[t], 2));
541
+ }), o.material && o.material.mappingType !== "AllSame") {
542
+ let e = s.materialIndex[0], t = 0;
543
+ if (s.materialIndex.forEach(function(n, r) {
544
+ n !== e && (i.addGroup(t, r - t, e), e = n, t = r);
545
+ }), i.groups.length > 0) {
546
+ let t = i.groups[i.groups.length - 1], n = t.start + t.count;
547
+ n !== s.materialIndex.length && i.addGroup(n, s.materialIndex.length - n, e);
548
+ }
549
+ i.groups.length === 0 && i.addGroup(0, s.materialIndex.length, s.materialIndex[0]);
550
+ }
551
+ return this.addMorphTargets(i, e, n, r), i;
552
+ }
553
+ parseGeoNode(e, t) {
554
+ let n = {};
555
+ if (n.vertexPositions = e.Vertices === void 0 ? [] : e.Vertices.a, n.vertexIndices = e.PolygonVertexIndex === void 0 ? [] : e.PolygonVertexIndex.a, e.LayerElementColor && e.LayerElementColor[0].Colors && (n.color = this.parseVertexColors(e.LayerElementColor[0])), e.LayerElementMaterial && (n.material = this.parseMaterialIndices(e.LayerElementMaterial[0])), e.LayerElementNormal && (n.normal = this.parseNormals(e.LayerElementNormal[0])), e.LayerElementUV) {
556
+ n.uv = [];
557
+ let t = 0;
558
+ for (; e.LayerElementUV[t];) e.LayerElementUV[t].UV && n.uv.push(this.parseUVs(e.LayerElementUV[t])), t++;
559
+ }
560
+ return n.weightTable = {}, t !== null && (n.skeleton = t, t.rawBones.forEach(function(e, t) {
561
+ e.indices.forEach(function(r, i) {
562
+ n.weightTable[r] === void 0 && (n.weightTable[r] = []), n.weightTable[r].push({
563
+ id: t,
564
+ weight: e.weights[i]
565
+ });
566
+ });
567
+ })), n;
568
+ }
569
+ genBuffers(e) {
570
+ let t = {
571
+ vertex: [],
572
+ normal: [],
573
+ colors: [],
574
+ uvs: [],
575
+ materialIndex: [],
576
+ vertexWeights: [],
577
+ weightsIndices: []
578
+ }, n = 0, r = 0, i = !1, a = [], o = [], s = [], c = [], l = [], u = [], d = this;
579
+ return e.vertexIndices.forEach(function(f, p) {
580
+ let m, h = !1;
581
+ f < 0 && (f ^= -1, h = !0);
582
+ let g = [], _ = [];
583
+ if (a.push(f * 3, f * 3 + 1, f * 3 + 2), e.color) {
584
+ let t = q(p, n, f, e.color);
585
+ s.push(t[0], t[1], t[2]);
586
+ }
587
+ if (e.skeleton) {
588
+ if (e.weightTable[f] !== void 0 && e.weightTable[f].forEach(function(e) {
589
+ _.push(e.weight), g.push(e.id);
590
+ }), _.length > 4) {
591
+ i ||= (console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."), !0);
592
+ let e = [
593
+ 0,
594
+ 0,
595
+ 0,
596
+ 0
597
+ ], t = [
598
+ 0,
599
+ 0,
600
+ 0,
601
+ 0
602
+ ];
603
+ _.forEach(function(n, r) {
604
+ let i = n, a = g[r];
605
+ t.forEach(function(t, n, r) {
606
+ if (i > t) {
607
+ r[n] = i, i = t;
608
+ let o = e[n];
609
+ e[n] = a, a = o;
610
+ }
611
+ });
612
+ }), g = e, _ = t;
613
+ }
614
+ for (; _.length < 4;) _.push(0), g.push(0);
615
+ for (let e = 0; e < 4; ++e) l.push(_[e]), u.push(g[e]);
616
+ }
617
+ if (e.normal) {
618
+ let t = q(p, n, f, e.normal);
619
+ o.push(t[0], t[1], t[2]);
620
+ }
621
+ e.material && e.material.mappingType !== "AllSame" && (m = q(p, n, f, e.material)[0], m < 0 && (d.negativeMaterialIndices = !0, m = 0)), e.uv && e.uv.forEach(function(e, t) {
622
+ let r = q(p, n, f, e);
623
+ c[t] === void 0 && (c[t] = []), c[t].push(r[0]), c[t].push(r[1]);
624
+ }), r++, h && (d.genFace(t, e, a, m, o, s, c, l, u, r), n++, r = 0, a = [], o = [], s = [], c = [], l = [], u = []);
625
+ }), t;
626
+ }
627
+ getNormalNewell(e) {
628
+ let t = new P(0, 0, 0);
629
+ for (let n = 0; n < e.length; n++) {
630
+ let r = e[n], i = e[(n + 1) % e.length];
631
+ t.x += (r.y - i.y) * (r.z + i.z), t.y += (r.z - i.z) * (r.x + i.x), t.z += (r.x - i.x) * (r.y + i.y);
632
+ }
633
+ return t.normalize(), t;
634
+ }
635
+ getNormalTangentAndBitangent(e) {
636
+ let t = this.getNormalNewell(e), n = (Math.abs(t.z) > .5 ? new P(0, 1, 0) : new P(0, 0, 1)).cross(t).normalize();
637
+ return {
638
+ normal: t,
639
+ tangent: n,
640
+ bitangent: t.clone().cross(n).normalize()
641
+ };
642
+ }
643
+ flattenVertex(e, t, n) {
644
+ return new se(e.dot(t), e.dot(n));
645
+ }
646
+ genFace(e, t, n, r, i, a, o, s, c, l) {
647
+ let u;
648
+ if (l > 3) {
649
+ let e = [], r = t.baseVertexPositions || t.vertexPositions;
650
+ for (let t = 0; t < n.length; t += 3) e.push(new P(r[n[t]], r[n[t + 1]], r[n[t + 2]]));
651
+ let { tangent: i, bitangent: a } = this.getNormalTangentAndBitangent(e), o = [];
652
+ for (let t of e) o.push(this.flattenVertex(t, i, a));
653
+ u = ee.triangulateShape(o, []);
654
+ } else u = [[
655
+ 0,
656
+ 1,
657
+ 2
658
+ ]];
659
+ for (let [l, d, f] of u) e.vertex.push(t.vertexPositions[n[l * 3]]), e.vertex.push(t.vertexPositions[n[l * 3 + 1]]), e.vertex.push(t.vertexPositions[n[l * 3 + 2]]), e.vertex.push(t.vertexPositions[n[d * 3]]), e.vertex.push(t.vertexPositions[n[d * 3 + 1]]), e.vertex.push(t.vertexPositions[n[d * 3 + 2]]), e.vertex.push(t.vertexPositions[n[f * 3]]), e.vertex.push(t.vertexPositions[n[f * 3 + 1]]), e.vertex.push(t.vertexPositions[n[f * 3 + 2]]), t.skeleton && (e.vertexWeights.push(s[l * 4]), e.vertexWeights.push(s[l * 4 + 1]), e.vertexWeights.push(s[l * 4 + 2]), e.vertexWeights.push(s[l * 4 + 3]), e.vertexWeights.push(s[d * 4]), e.vertexWeights.push(s[d * 4 + 1]), e.vertexWeights.push(s[d * 4 + 2]), e.vertexWeights.push(s[d * 4 + 3]), e.vertexWeights.push(s[f * 4]), e.vertexWeights.push(s[f * 4 + 1]), e.vertexWeights.push(s[f * 4 + 2]), e.vertexWeights.push(s[f * 4 + 3]), e.weightsIndices.push(c[l * 4]), e.weightsIndices.push(c[l * 4 + 1]), e.weightsIndices.push(c[l * 4 + 2]), e.weightsIndices.push(c[l * 4 + 3]), e.weightsIndices.push(c[d * 4]), e.weightsIndices.push(c[d * 4 + 1]), e.weightsIndices.push(c[d * 4 + 2]), e.weightsIndices.push(c[d * 4 + 3]), e.weightsIndices.push(c[f * 4]), e.weightsIndices.push(c[f * 4 + 1]), e.weightsIndices.push(c[f * 4 + 2]), e.weightsIndices.push(c[f * 4 + 3])), t.color && (e.colors.push(a[l * 3]), e.colors.push(a[l * 3 + 1]), e.colors.push(a[l * 3 + 2]), e.colors.push(a[d * 3]), e.colors.push(a[d * 3 + 1]), e.colors.push(a[d * 3 + 2]), e.colors.push(a[f * 3]), e.colors.push(a[f * 3 + 1]), e.colors.push(a[f * 3 + 2])), t.material && t.material.mappingType !== "AllSame" && (e.materialIndex.push(r), e.materialIndex.push(r), e.materialIndex.push(r)), t.normal && (e.normal.push(i[l * 3]), e.normal.push(i[l * 3 + 1]), e.normal.push(i[l * 3 + 2]), e.normal.push(i[d * 3]), e.normal.push(i[d * 3 + 1]), e.normal.push(i[d * 3 + 2]), e.normal.push(i[f * 3]), e.normal.push(i[f * 3 + 1]), e.normal.push(i[f * 3 + 2])), t.uv && t.uv.forEach(function(t, n) {
660
+ e.uvs[n] === void 0 && (e.uvs[n] = []), e.uvs[n].push(o[n][l * 2]), e.uvs[n].push(o[n][l * 2 + 1]), e.uvs[n].push(o[n][d * 2]), e.uvs[n].push(o[n][d * 2 + 1]), e.uvs[n].push(o[n][f * 2]), e.uvs[n].push(o[n][f * 2 + 1]);
661
+ });
662
+ }
663
+ addMorphTargets(e, t, n, r) {
664
+ if (n.length === 0) return;
665
+ e.morphTargetsRelative = !0, e.morphAttributes.position = [];
666
+ let i = this;
667
+ n.forEach(function(n) {
668
+ n.rawTargets.forEach(function(n) {
669
+ let a = F.Objects.Geometry[n.geoID];
670
+ a !== void 0 && i.genMorphGeometry(e, t, a, r, n.name);
671
+ });
672
+ });
673
+ }
674
+ genMorphGeometry(e, t, n, r, i) {
675
+ let a = t.Vertices === void 0 ? [] : t.Vertices.a, o = t.PolygonVertexIndex === void 0 ? [] : t.PolygonVertexIndex.a, s = n.Vertices === void 0 ? [] : n.Vertices.a, c = n.Indexes === void 0 ? [] : n.Indexes.a, l = e.attributes.position.count * 3, u = new Float32Array(l);
676
+ for (let e = 0; e < c.length; e++) {
677
+ let t = c[e] * 3;
678
+ u[t] = s[e * 3], u[t + 1] = s[e * 3 + 1], u[t + 2] = s[e * 3 + 2];
679
+ }
680
+ let d = {
681
+ vertexIndices: o,
682
+ vertexPositions: u,
683
+ baseVertexPositions: a
684
+ }, f = new p(this.genBuffers(d).vertex, 3);
685
+ f.name = i || n.attrName, f.applyMatrix4(r), e.morphAttributes.position.push(f);
686
+ }
687
+ parseNormals(e) {
688
+ let t = e.MappingInformationType, n = e.ReferenceInformationType, r = e.Normals.a, i = [];
689
+ return n === "IndexToDirect" && ("NormalIndex" in e ? i = e.NormalIndex.a : "NormalsIndex" in e && (i = e.NormalsIndex.a)), {
690
+ dataSize: 3,
691
+ buffer: r,
692
+ indices: i,
693
+ mappingType: t,
694
+ referenceType: n
695
+ };
696
+ }
697
+ parseUVs(e) {
698
+ let t = e.MappingInformationType, n = e.ReferenceInformationType, r = e.UV.a, i = [];
699
+ return n === "IndexToDirect" && (i = e.UVIndex.a), {
700
+ dataSize: 2,
701
+ buffer: r,
702
+ indices: i,
703
+ mappingType: t,
704
+ referenceType: n
705
+ };
706
+ }
707
+ parseVertexColors(e) {
708
+ let t = e.MappingInformationType, n = e.ReferenceInformationType, r = e.Colors.a, i = [];
709
+ n === "IndexToDirect" && (i = e.ColorIndex.a);
710
+ for (let e = 0, t = new s(); e < r.length; e += 4) t.fromArray(r, e), c.colorSpaceToWorking(t, N), t.toArray(r, e);
711
+ return {
712
+ dataSize: 4,
713
+ buffer: r,
714
+ indices: i,
715
+ mappingType: t,
716
+ referenceType: n
717
+ };
718
+ }
719
+ parseMaterialIndices(e) {
720
+ let t = e.MappingInformationType, n = e.ReferenceInformationType;
721
+ if (t === "NoMappingInformation") return {
722
+ dataSize: 1,
723
+ buffer: [0],
724
+ indices: [0],
725
+ mappingType: "AllSame",
726
+ referenceType: n
727
+ };
728
+ let r = e.Materials.a, i = [];
729
+ for (let e = 0; e < r.length; ++e) i.push(e);
730
+ return {
731
+ dataSize: 1,
732
+ buffer: r,
733
+ indices: i,
734
+ mappingType: t,
735
+ referenceType: n
736
+ };
737
+ }
738
+ parseNurbsGeometry(e) {
739
+ let n = parseInt(e.Order);
740
+ if (isNaN(n)) return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s", e.Order, e.id), new a();
741
+ let r = n - 1, i = e.KnotVector.a, o = [], s = e.Points.a;
742
+ for (let e = 0, t = s.length; e < t; e += 4) o.push(new ce().fromArray(s, e));
743
+ let c, l;
744
+ if (e.Form === "Closed") o.push(o[0]);
745
+ else if (e.Form === "Periodic") {
746
+ c = r, l = i.length - 1 - c;
747
+ for (let e = 0; e < r; ++e) o.push(o[e]);
748
+ }
749
+ let u = new t(r, i, o, c, l).getPoints(o.length * 12);
750
+ return new a().setFromPoints(u);
751
+ }
752
+ }, B = class {
753
+ parse() {
754
+ let e = [], t = this.parseClips();
755
+ if (t !== void 0) for (let n in t) {
756
+ let r = t[n], i = this.addClip(r);
757
+ e.push(i);
758
+ }
759
+ return e;
760
+ }
761
+ parseClips() {
762
+ if (F.Objects.AnimationCurve === void 0) return;
763
+ let e = this.parseAnimationCurveNodes();
764
+ this.parseAnimationCurves(e);
765
+ let t = this.parseAnimationLayers(e);
766
+ return this.parseAnimStacks(t);
767
+ }
768
+ parseAnimationCurveNodes() {
769
+ let e = F.Objects.AnimationCurveNode, t = /* @__PURE__ */ new Map();
770
+ for (let n in e) {
771
+ let r = e[n];
772
+ if (r.attrName.match(/S|R|T|DeformPercent/) !== null) {
773
+ let e = {
774
+ id: r.id,
775
+ attr: r.attrName,
776
+ curves: {}
777
+ };
778
+ t.set(e.id, e);
779
+ }
780
+ }
781
+ return t;
782
+ }
783
+ parseAnimationCurves(e) {
784
+ let t = F.Objects.AnimationCurve;
785
+ for (let n in t) {
786
+ let r = {
787
+ id: t[n].id,
788
+ times: t[n].KeyTime.a.map(pe),
789
+ values: t[n].KeyValueFloat.a
790
+ }, i = I.get(r.id);
791
+ if (i !== void 0) {
792
+ let t = i.parents[0].ID, n = i.parents[0].relationship;
793
+ n.match(/X/) ? e.get(t).curves.x = r : n.match(/Y/) ? e.get(t).curves.y = r : n.match(/Z/) ? e.get(t).curves.z = r : n.match(/DeformPercent/) && e.has(t) && (e.get(t).curves.morph = r);
794
+ }
795
+ }
796
+ }
797
+ parseAnimationLayers(e) {
798
+ let t = F.Objects.AnimationLayer, n = /* @__PURE__ */ new Map();
799
+ for (let r in t) {
800
+ let t = [], i = I.get(parseInt(r));
801
+ i !== void 0 && (i.children.forEach(function(n, r) {
802
+ if (e.has(n.ID)) {
803
+ let i = e.get(n.ID);
804
+ if (i.curves.x !== void 0 || i.curves.y !== void 0 || i.curves.z !== void 0) {
805
+ if (t[r] === void 0) {
806
+ let e = I.get(n.ID).parents.filter(function(e) {
807
+ return e.relationship !== void 0;
808
+ })[0].ID;
809
+ if (e !== void 0) {
810
+ let i = F.Objects.Model[e.toString()];
811
+ if (i === void 0) {
812
+ console.warn("THREE.FBXLoader: Encountered a unused curve.", n);
813
+ return;
814
+ }
815
+ let a = {
816
+ modelName: i.attrName ? k.sanitizeNodeName(i.attrName) : "",
817
+ ID: i.id,
818
+ initialPosition: [
819
+ 0,
820
+ 0,
821
+ 0
822
+ ],
823
+ initialRotation: [
824
+ 0,
825
+ 0,
826
+ 0
827
+ ],
828
+ initialScale: [
829
+ 1,
830
+ 1,
831
+ 1
832
+ ]
833
+ };
834
+ L.traverse(function(e) {
835
+ e.ID === i.id && (a.transform = e.matrix, e.userData.transformData && (a.eulerOrder = e.userData.transformData.eulerOrder));
836
+ }), a.transform ||= new x(), "PreRotation" in i && (a.preRotation = i.PreRotation.value), "PostRotation" in i && (a.postRotation = i.PostRotation.value), t[r] = a;
837
+ }
838
+ }
839
+ t[r] && (t[r][i.attr] = i);
840
+ } else if (i.curves.morph !== void 0) {
841
+ if (t[r] === void 0) {
842
+ let e = I.get(n.ID).parents.filter(function(e) {
843
+ return e.relationship !== void 0;
844
+ })[0].ID, i = I.get(e).parents[0].ID, a = I.get(i).parents[0].ID, o = I.get(a).parents[0].ID, s = F.Objects.Model[o];
845
+ t[r] = {
846
+ modelName: s.attrName ? k.sanitizeNodeName(s.attrName) : "",
847
+ morphName: F.Objects.Deformer[e].attrName
848
+ };
849
+ }
850
+ t[r][i.attr] = i;
851
+ }
852
+ }
853
+ }), n.set(parseInt(r), t));
854
+ }
855
+ return n;
856
+ }
857
+ parseAnimStacks(e) {
858
+ let t = F.Objects.AnimationStack, n = {};
859
+ for (let r in t) {
860
+ let i = I.get(parseInt(r)).children;
861
+ i.length > 1 && console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");
862
+ let a = e.get(i[0].ID);
863
+ n[r] = {
864
+ name: t[r].attrName,
865
+ layer: a
866
+ };
867
+ }
868
+ return n;
869
+ }
870
+ addClip(e) {
871
+ let t = [], n = this;
872
+ return e.layer.forEach(function(e) {
873
+ t = t.concat(n.generateTracks(e));
874
+ }), new r(e.name, -1, t);
875
+ }
876
+ generateTracks(e) {
877
+ let t = [], n = new P(), r = new P();
878
+ if (e.transform && e.transform.decompose(n, new A(), r), n = n.toArray(), r = r.toArray(), e.T !== void 0 && Object.keys(e.T.curves).length > 0) {
879
+ let r = this.generateVectorTrack(e.modelName, e.T.curves, n, "position");
880
+ r !== void 0 && t.push(r);
881
+ }
882
+ if (e.R !== void 0 && Object.keys(e.R.curves).length > 0) {
883
+ let n = this.generateRotationTrack(e.modelName, e.R.curves, e.preRotation, e.postRotation, e.eulerOrder);
884
+ n !== void 0 && t.push(n);
885
+ }
886
+ if (e.S !== void 0 && Object.keys(e.S.curves).length > 0) {
887
+ let n = this.generateVectorTrack(e.modelName, e.S.curves, r, "scale");
888
+ n !== void 0 && t.push(n);
889
+ }
890
+ if (e.DeformPercent !== void 0) {
891
+ let n = this.generateMorphTrack(e);
892
+ n !== void 0 && t.push(n);
893
+ }
894
+ return t;
895
+ }
896
+ generateVectorTrack(e, t, n, r) {
897
+ let i = this.getTimesForAllAxes(t), a = this.getKeyframeTrackValues(i, t, n);
898
+ return new le(e + "." + r, i, a);
899
+ }
900
+ generateRotationTrack(e, t, n, r, i) {
901
+ let a, o;
902
+ if (t.x !== void 0 && t.y !== void 0 && t.z !== void 0) {
903
+ let e = this.interpolateRotations(t.x, t.y, t.z, i);
904
+ a = e[0], o = e[1];
905
+ }
906
+ let s = Z(0);
907
+ n !== void 0 && (n = n.map(y.degToRad), n.push(s), n = new d().fromArray(n), n = new A().setFromEuler(n)), r !== void 0 && (r = r.map(y.degToRad), r.push(s), r = new d().fromArray(r), r = new A().setFromEuler(r).invert());
908
+ let c = new A(), l = new d(), u = [];
909
+ if (!o || !a) return new j(e + ".quaternion", [0], [0]);
910
+ for (let e = 0; e < o.length; e += 3) l.set(o[e], o[e + 1], o[e + 2], i), c.setFromEuler(l), n !== void 0 && c.premultiply(n), r !== void 0 && c.multiply(r), e > 2 && new A().fromArray(u, (e - 3) / 3 * 4).dot(c) < 0 && c.set(-c.x, -c.y, -c.z, -c.w), c.toArray(u, e / 3 * 4);
911
+ return new j(e + ".quaternion", a, u);
912
+ }
913
+ generateMorphTrack(e) {
914
+ let t = e.DeformPercent.curves.morph, n = t.values.map(function(e) {
915
+ return e / 100;
916
+ }), r = L.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];
917
+ return new T(e.modelName + ".morphTargetInfluences[" + r + "]", t.times, n);
918
+ }
919
+ getTimesForAllAxes(e) {
920
+ let t = [];
921
+ if (e.x !== void 0 && (t = t.concat(e.x.times)), e.y !== void 0 && (t = t.concat(e.y.times)), e.z !== void 0 && (t = t.concat(e.z.times)), t = t.sort(function(e, t) {
922
+ return e - t;
923
+ }), t.length > 1) {
924
+ let e = 1, n = t[0];
925
+ for (let r = 1; r < t.length; r++) {
926
+ let i = t[r];
927
+ i !== n && (t[e] = i, n = i, e++);
928
+ }
929
+ t = t.slice(0, e);
930
+ }
931
+ return t;
932
+ }
933
+ getKeyframeTrackValues(e, t, n) {
934
+ let r = n, i = [], a = -1, o = -1, s = -1;
935
+ return e.forEach(function(e) {
936
+ if (t.x && (a = t.x.times.indexOf(e)), t.y && (o = t.y.times.indexOf(e)), t.z && (s = t.z.times.indexOf(e)), a !== -1) {
937
+ let e = t.x.values[a];
938
+ i.push(e), r[0] = e;
939
+ } else i.push(r[0]);
940
+ if (o !== -1) {
941
+ let e = t.y.values[o];
942
+ i.push(e), r[1] = e;
943
+ } else i.push(r[1]);
944
+ if (s !== -1) {
945
+ let e = t.z.values[s];
946
+ i.push(e), r[2] = e;
947
+ } else i.push(r[2]);
948
+ }), i;
949
+ }
950
+ interpolateRotations(e, t, n, r) {
951
+ let i = [], a = [];
952
+ i.push(e.times[0]), a.push(y.degToRad(e.values[0])), a.push(y.degToRad(t.values[0])), a.push(y.degToRad(n.values[0]));
953
+ for (let o = 1; o < e.values.length; o++) {
954
+ let s = [
955
+ e.values[o - 1],
956
+ t.values[o - 1],
957
+ n.values[o - 1]
958
+ ];
959
+ if (isNaN(s[0]) || isNaN(s[1]) || isNaN(s[2])) continue;
960
+ let c = s.map(y.degToRad), l = [
961
+ e.values[o],
962
+ t.values[o],
963
+ n.values[o]
964
+ ];
965
+ if (isNaN(l[0]) || isNaN(l[1]) || isNaN(l[2])) continue;
966
+ let u = l.map(y.degToRad), f = [
967
+ l[0] - s[0],
968
+ l[1] - s[1],
969
+ l[2] - s[2]
970
+ ], p = [
971
+ Math.abs(f[0]),
972
+ Math.abs(f[1]),
973
+ Math.abs(f[2])
974
+ ];
975
+ if (p[0] >= 180 || p[1] >= 180 || p[2] >= 180) {
976
+ let t = Math.max(...p) / 180, n = new d(...c, r), s = new d(...u, r), l = new A().setFromEuler(n), f = new A().setFromEuler(s);
977
+ l.dot(f) && f.set(-f.x, -f.y, -f.z, -f.w);
978
+ let m = e.times[o - 1], h = e.times[o] - m, g = new A(), _ = new d();
979
+ for (let e = 0; e < 1; e += 1 / t) g.copy(l.clone().slerp(f.clone(), e)), i.push(m + e * h), _.setFromQuaternion(g, r), a.push(_.x), a.push(_.y), a.push(_.z);
980
+ } else i.push(e.times[o]), a.push(y.degToRad(e.values[o])), a.push(y.degToRad(t.values[o])), a.push(y.degToRad(n.values[o]));
981
+ }
982
+ return [i, a];
983
+ }
984
+ }, V = class {
985
+ getPrevNode() {
986
+ return this.nodeStack[this.currentIndent - 2];
987
+ }
988
+ getCurrentNode() {
989
+ return this.nodeStack[this.currentIndent - 1];
990
+ }
991
+ getCurrentProp() {
992
+ return this.currentProp;
993
+ }
994
+ pushStack(e) {
995
+ this.nodeStack.push(e), this.currentIndent += 1;
996
+ }
997
+ popStack() {
998
+ this.nodeStack.pop(), --this.currentIndent;
999
+ }
1000
+ setCurrentProp(e, t) {
1001
+ this.currentProp = e, this.currentPropName = t;
1002
+ }
1003
+ parse(e) {
1004
+ this.currentIndent = 0, this.allNodes = new W(), this.nodeStack = [], this.currentProp = [], this.currentPropName = "";
1005
+ let t = this, n = e.split(/[\r\n]+/);
1006
+ return n.forEach(function(e, r) {
1007
+ let i = e.match(/^[\s\t]*;/), a = e.match(/^[\s\t]*$/);
1008
+ if (i || a) return;
1009
+ let o = e.match("^\\t{" + t.currentIndent + "}(\\w+):(.*){", ""), s = e.match("^\\t{" + t.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"), c = e.match("^\\t{" + (t.currentIndent - 1) + "}}");
1010
+ o ? t.parseNodeBegin(e, o) : s ? t.parseNodeProperty(e, s, n[++r]) : c ? t.popStack() : e.match(/^[^\s\t}]/) && t.parseNodePropertyContinued(e);
1011
+ }), this.allNodes;
1012
+ }
1013
+ parseNodeBegin(e, t) {
1014
+ let n = t[1].trim().replace(/^"/, "").replace(/"$/, ""), r = t[2].split(",").map(function(e) {
1015
+ return e.trim().replace(/^"/, "").replace(/"$/, "");
1016
+ }), i = { name: n }, a = this.parseNodeAttr(r), o = this.getCurrentNode();
1017
+ this.currentIndent === 0 ? this.allNodes.add(n, i) : n in o ? (n === "PoseNode" ? o.PoseNode.push(i) : o[n].id !== void 0 && (o[n] = {}, o[n][o[n].id] = o[n]), a.id !== "" && (o[n][a.id] = i)) : typeof a.id == "number" ? (o[n] = {}, o[n][a.id] = i) : n !== "Properties70" && (n === "PoseNode" ? o[n] = [i] : o[n] = i), typeof a.id == "number" && (i.id = a.id), a.name !== "" && (i.attrName = a.name), a.type !== "" && (i.attrType = a.type), this.pushStack(i);
1018
+ }
1019
+ parseNodeAttr(e) {
1020
+ let t = e[0];
1021
+ e[0] !== "" && (t = parseInt(e[0]), isNaN(t) && (t = e[0]));
1022
+ let n = "", r = "";
1023
+ return e.length > 1 && (n = e[1].replace(/^(\w+)::/, ""), r = e[2]), {
1024
+ id: t,
1025
+ name: n,
1026
+ type: r
1027
+ };
1028
+ }
1029
+ parseNodeProperty(e, t, n) {
1030
+ let r = t[1].replace(/^"/, "").replace(/"$/, "").trim(), i = t[2].replace(/^"/, "").replace(/"$/, "").trim();
1031
+ r === "Content" && i === "," && (i = n.replace(/"/g, "").replace(/,$/, "").trim());
1032
+ let a = this.getCurrentNode();
1033
+ if (a.name === "Properties70") {
1034
+ this.parseNodeSpecialProperty(e, r, i);
1035
+ return;
1036
+ }
1037
+ if (r === "C") {
1038
+ let e = i.split(",").slice(1), t = parseInt(e[0]), n = parseInt(e[1]), o = i.split(",").slice(3);
1039
+ o = o.map(function(e) {
1040
+ return e.trim().replace(/^"/, "");
1041
+ }), r = "connections", i = [t, n], me(i, o), a[r] === void 0 && (a[r] = []);
1042
+ }
1043
+ r === "Node" && (a.id = i), r in a && Array.isArray(a[r]) ? a[r].push(i) : r === "a" ? a.a = i : a[r] = i, this.setCurrentProp(a, r), r === "a" && i.slice(-1) !== "," && (a.a = Q(i));
1044
+ }
1045
+ parseNodePropertyContinued(e) {
1046
+ let t = this.getCurrentNode();
1047
+ t.a += e, e.slice(-1) !== "," && (t.a = Q(t.a));
1048
+ }
1049
+ parseNodeSpecialProperty(e, t, n) {
1050
+ let r = n.split("\",").map(function(e) {
1051
+ return e.trim().replace(/^\"/, "").replace(/\s/, "_");
1052
+ }), i = r[0], a = r[1], o = r[2], s = r[3], c = r[4];
1053
+ switch (a) {
1054
+ case "int":
1055
+ case "enum":
1056
+ case "bool":
1057
+ case "ULongLong":
1058
+ case "double":
1059
+ case "Number":
1060
+ case "FieldOfView":
1061
+ c = parseFloat(c);
1062
+ break;
1063
+ case "Color":
1064
+ case "ColorRGB":
1065
+ case "Vector3D":
1066
+ case "Lcl_Translation":
1067
+ case "Lcl_Rotation":
1068
+ case "Lcl_Scaling":
1069
+ c = Q(c);
1070
+ break;
1071
+ }
1072
+ this.getPrevNode()[i] = {
1073
+ type: a,
1074
+ type2: o,
1075
+ flag: s,
1076
+ value: c
1077
+ }, this.setCurrentProp(this.getPrevNode(), i);
1078
+ }
1079
+ }, H = class {
1080
+ parse(e) {
1081
+ let t = new U(e);
1082
+ t.skip(23);
1083
+ let n = t.getUint32();
1084
+ if (n < 6400) throw Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + n);
1085
+ let r = new W();
1086
+ for (; !this.endOfContent(t);) {
1087
+ let e = this.parseNode(t, n);
1088
+ e !== null && r.add(e.name, e);
1089
+ }
1090
+ return r;
1091
+ }
1092
+ endOfContent(e) {
1093
+ return e.size() % 16 == 0 ? (e.getOffset() + 160 + 16 & -16) >= e.size() : e.getOffset() + 160 + 16 >= e.size();
1094
+ }
1095
+ parseNode(e, t) {
1096
+ let n = {}, r = t >= 7500 ? e.getUint64() : e.getUint32(), i = t >= 7500 ? e.getUint64() : e.getUint32();
1097
+ t >= 7500 ? e.getUint64() : e.getUint32();
1098
+ let a = e.getUint8(), o = e.getString(a);
1099
+ if (r === 0) return null;
1100
+ let s = [];
1101
+ for (let t = 0; t < i; t++) s.push(this.parseProperty(e));
1102
+ let c = s.length > 0 ? s[0] : "", l = s.length > 1 ? s[1] : "", u = s.length > 2 ? s[2] : "";
1103
+ for (n.singleProperty = i === 1 && e.getOffset() === r; r > e.getOffset();) {
1104
+ let r = this.parseNode(e, t);
1105
+ r !== null && this.parseSubNode(o, n, r);
1106
+ }
1107
+ return n.propertyList = s, typeof c == "number" && (n.id = c), l !== "" && (n.attrName = l), u !== "" && (n.attrType = u), o !== "" && (n.name = o), n;
1108
+ }
1109
+ parseSubNode(e, t, n) {
1110
+ if (n.singleProperty === !0) {
1111
+ let e = n.propertyList[0];
1112
+ Array.isArray(e) ? (t[n.name] = n, n.a = e) : t[n.name] = e;
1113
+ } else if (e === "Connections" && n.name === "C") {
1114
+ let e = [];
1115
+ n.propertyList.forEach(function(t, n) {
1116
+ n !== 0 && e.push(t);
1117
+ }), t.connections === void 0 && (t.connections = []), t.connections.push(e);
1118
+ } else if (n.name === "Properties70") Object.keys(n).forEach(function(e) {
1119
+ t[e] = n[e];
1120
+ });
1121
+ else if (e === "Properties70" && n.name === "P") {
1122
+ let e = n.propertyList[0], r = n.propertyList[1], i = n.propertyList[2], a = n.propertyList[3], o;
1123
+ e.indexOf("Lcl ") === 0 && (e = e.replace("Lcl ", "Lcl_")), r.indexOf("Lcl ") === 0 && (r = r.replace("Lcl ", "Lcl_")), o = r === "Color" || r === "ColorRGB" || r === "Vector" || r === "Vector3D" || r.indexOf("Lcl_") === 0 ? [
1124
+ n.propertyList[4],
1125
+ n.propertyList[5],
1126
+ n.propertyList[6]
1127
+ ] : n.propertyList[4], t[e] = {
1128
+ type: r,
1129
+ type2: i,
1130
+ flag: a,
1131
+ value: o
1132
+ };
1133
+ } else t[n.name] === void 0 ? typeof n.id == "number" ? (t[n.name] = {}, t[n.name][n.id] = n) : t[n.name] = n : n.name === "PoseNode" ? (Array.isArray(t[n.name]) || (t[n.name] = [t[n.name]]), t[n.name].push(n)) : t[n.name][n.id] === void 0 && (t[n.name][n.id] = n);
1134
+ }
1135
+ parseProperty(t) {
1136
+ let n = t.getString(1), r;
1137
+ switch (n) {
1138
+ case "C": return t.getBoolean();
1139
+ case "D": return t.getFloat64();
1140
+ case "F": return t.getFloat32();
1141
+ case "I": return t.getInt32();
1142
+ case "L": return t.getInt64();
1143
+ case "R": return r = t.getUint32(), t.getArrayBuffer(r);
1144
+ case "S": return r = t.getUint32(), t.getString(r);
1145
+ case "Y": return t.getInt16();
1146
+ case "b":
1147
+ case "c":
1148
+ case "d":
1149
+ case "f":
1150
+ case "i":
1151
+ case "l":
1152
+ let i = t.getUint32(), a = t.getUint32(), o = t.getUint32();
1153
+ if (a === 0) switch (n) {
1154
+ case "b":
1155
+ case "c": return t.getBooleanArray(i);
1156
+ case "d": return t.getFloat64Array(i);
1157
+ case "f": return t.getFloat32Array(i);
1158
+ case "i": return t.getInt32Array(i);
1159
+ case "l": return t.getInt64Array(i);
1160
+ }
1161
+ let s = new U(e(new Uint8Array(t.getArrayBuffer(o))).buffer);
1162
+ switch (n) {
1163
+ case "b":
1164
+ case "c": return s.getBooleanArray(i);
1165
+ case "d": return s.getFloat64Array(i);
1166
+ case "f": return s.getFloat32Array(i);
1167
+ case "i": return s.getInt32Array(i);
1168
+ case "l": return s.getInt64Array(i);
1169
+ }
1170
+ break;
1171
+ default: throw Error("THREE.FBXLoader: Unknown property type " + n);
1172
+ }
1173
+ }
1174
+ }, U = class {
1175
+ constructor(e, t) {
1176
+ this.dv = new DataView(e), this.offset = 0, this.littleEndian = t === void 0 ? !0 : t, this._textDecoder = new TextDecoder();
1177
+ }
1178
+ getOffset() {
1179
+ return this.offset;
1180
+ }
1181
+ size() {
1182
+ return this.dv.buffer.byteLength;
1183
+ }
1184
+ skip(e) {
1185
+ this.offset += e;
1186
+ }
1187
+ getBoolean() {
1188
+ return (this.getUint8() & 1) == 1;
1189
+ }
1190
+ getBooleanArray(e) {
1191
+ let t = [];
1192
+ for (let n = 0; n < e; n++) t.push(this.getBoolean());
1193
+ return t;
1194
+ }
1195
+ getUint8() {
1196
+ let e = this.dv.getUint8(this.offset);
1197
+ return this.offset += 1, e;
1198
+ }
1199
+ getInt16() {
1200
+ let e = this.dv.getInt16(this.offset, this.littleEndian);
1201
+ return this.offset += 2, e;
1202
+ }
1203
+ getInt32() {
1204
+ let e = this.dv.getInt32(this.offset, this.littleEndian);
1205
+ return this.offset += 4, e;
1206
+ }
1207
+ getInt32Array(e) {
1208
+ let t = [];
1209
+ for (let n = 0; n < e; n++) t.push(this.getInt32());
1210
+ return t;
1211
+ }
1212
+ getUint32() {
1213
+ let e = this.dv.getUint32(this.offset, this.littleEndian);
1214
+ return this.offset += 4, e;
1215
+ }
1216
+ getInt64() {
1217
+ let e, t;
1218
+ return this.littleEndian ? (e = this.getUint32(), t = this.getUint32()) : (t = this.getUint32(), e = this.getUint32()), t & 2147483648 ? (t = ~t & 4294967295, e = ~e & 4294967295, e === 4294967295 && (t = t + 1 & 4294967295), e = e + 1 & 4294967295, -(t * 4294967296 + e)) : t * 4294967296 + e;
1219
+ }
1220
+ getInt64Array(e) {
1221
+ let t = [];
1222
+ for (let n = 0; n < e; n++) t.push(this.getInt64());
1223
+ return t;
1224
+ }
1225
+ getUint64() {
1226
+ let e, t;
1227
+ return this.littleEndian ? (e = this.getUint32(), t = this.getUint32()) : (t = this.getUint32(), e = this.getUint32()), t * 4294967296 + e;
1228
+ }
1229
+ getFloat32() {
1230
+ let e = this.dv.getFloat32(this.offset, this.littleEndian);
1231
+ return this.offset += 4, e;
1232
+ }
1233
+ getFloat32Array(e) {
1234
+ let t = [];
1235
+ for (let n = 0; n < e; n++) t.push(this.getFloat32());
1236
+ return t;
1237
+ }
1238
+ getFloat64() {
1239
+ let e = this.dv.getFloat64(this.offset, this.littleEndian);
1240
+ return this.offset += 8, e;
1241
+ }
1242
+ getFloat64Array(e) {
1243
+ let t = [];
1244
+ for (let n = 0; n < e; n++) t.push(this.getFloat64());
1245
+ return t;
1246
+ }
1247
+ getArrayBuffer(e) {
1248
+ let t = this.dv.buffer.slice(this.offset, this.offset + e);
1249
+ return this.offset += e, t;
1250
+ }
1251
+ getString(e) {
1252
+ let t = this.offset, n = new Uint8Array(this.dv.buffer, t, e);
1253
+ this.skip(e);
1254
+ let r = n.indexOf(0);
1255
+ return r >= 0 && (n = new Uint8Array(this.dv.buffer, t, r)), this._textDecoder.decode(n);
1256
+ }
1257
+ }, W = class {
1258
+ add(e, t) {
1259
+ this[e] = t;
1260
+ }
1261
+ };
1262
+ function de(e) {
1263
+ return e.byteLength >= 21 && $(e, 0, 21) === "Kaydara FBX Binary \0";
1264
+ }
1265
+ function fe(e) {
1266
+ let t = [
1267
+ "K",
1268
+ "a",
1269
+ "y",
1270
+ "d",
1271
+ "a",
1272
+ "r",
1273
+ "a",
1274
+ "\\",
1275
+ "F",
1276
+ "B",
1277
+ "X",
1278
+ "\\",
1279
+ "B",
1280
+ "i",
1281
+ "n",
1282
+ "a",
1283
+ "r",
1284
+ "y",
1285
+ "\\",
1286
+ "\\"
1287
+ ], n = 0;
1288
+ function r(t) {
1289
+ let r = e[t - 1];
1290
+ return e = e.slice(n + t), n++, r;
1291
+ }
1292
+ for (let e = 0; e < t.length; ++e) if (r(1) === t[e]) return !1;
1293
+ return !0;
1294
+ }
1295
+ function G(e) {
1296
+ let t = e.match(/FBXVersion: (\d+)/);
1297
+ if (t) return parseInt(t[1]);
1298
+ throw Error("THREE.FBXLoader: Cannot find the version number for the file given.");
1299
+ }
1300
+ function pe(e) {
1301
+ return e / 46186158e3;
1302
+ }
1303
+ var K = [];
1304
+ function q(e, t, n, r) {
1305
+ let i;
1306
+ switch (r.mappingType) {
1307
+ case "ByPolygonVertex":
1308
+ i = e;
1309
+ break;
1310
+ case "ByPolygon":
1311
+ i = t;
1312
+ break;
1313
+ case "ByVertice":
1314
+ i = n;
1315
+ break;
1316
+ case "AllSame":
1317
+ i = r.indices[0];
1318
+ break;
1319
+ default: console.warn("THREE.FBXLoader: unknown attribute mapping type " + r.mappingType);
1320
+ }
1321
+ r.referenceType === "IndexToDirect" && (i = r.indices[i]);
1322
+ let a = i * r.dataSize, o = a + r.dataSize;
1323
+ return he(K, r.buffer, a, o);
1324
+ }
1325
+ var J = new d(), Y = new P();
1326
+ function X(e) {
1327
+ let t = new x(), n = new x(), r = new x(), i = new x(), a = new x(), o = new x(), s = new x(), c = new x(), l = new x(), u = new x(), d = new x(), f = new x(), p = e.inheritType ? e.inheritType : 0;
1328
+ e.translation && t.setPosition(Y.fromArray(e.translation));
1329
+ let m = Z(0);
1330
+ if (e.preRotation) {
1331
+ let t = e.preRotation.map(y.degToRad);
1332
+ t.push(m), n.makeRotationFromEuler(J.fromArray(t));
1333
+ }
1334
+ if (e.rotation) {
1335
+ let t = e.rotation.map(y.degToRad);
1336
+ t.push(e.eulerOrder || m), r.makeRotationFromEuler(J.fromArray(t));
1337
+ }
1338
+ if (e.postRotation) {
1339
+ let t = e.postRotation.map(y.degToRad);
1340
+ t.push(m), i.makeRotationFromEuler(J.fromArray(t)), i.invert();
1341
+ }
1342
+ e.scale && a.scale(Y.fromArray(e.scale)), e.scalingOffset && s.setPosition(Y.fromArray(e.scalingOffset)), e.scalingPivot && o.setPosition(Y.fromArray(e.scalingPivot)), e.rotationOffset && c.setPosition(Y.fromArray(e.rotationOffset)), e.rotationPivot && l.setPosition(Y.fromArray(e.rotationPivot)), e.parentMatrixWorld && (d.copy(e.parentMatrix), u.copy(e.parentMatrixWorld));
1343
+ let h = n.clone().multiply(r).multiply(i), g = new x();
1344
+ g.extractRotation(u);
1345
+ let _ = new x();
1346
+ _.copyPosition(u);
1347
+ let v = _.clone().invert().multiply(u), b = g.clone().invert().multiply(v), S = a, C = new x();
1348
+ if (p === 0) C.copy(g).multiply(h).multiply(b).multiply(S);
1349
+ else if (p === 1) C.copy(g).multiply(b).multiply(h).multiply(S);
1350
+ else {
1351
+ let e = new x().scale(new P().setFromMatrixScale(d)).clone().invert(), t = b.clone().multiply(e);
1352
+ C.copy(g).multiply(h).multiply(t).multiply(S);
1353
+ }
1354
+ let w = l.clone().invert(), T = o.clone().invert(), E = t.clone().multiply(c).multiply(l).multiply(n).multiply(r).multiply(i).multiply(w).multiply(s).multiply(o).multiply(a).multiply(T), D = new x().copyPosition(E), O = u.clone().multiply(D);
1355
+ return f.copyPosition(O), E = f.clone().multiply(C), E.premultiply(u.invert()), E;
1356
+ }
1357
+ function Z(e) {
1358
+ e ||= 0;
1359
+ let t = [
1360
+ "ZYX",
1361
+ "YZX",
1362
+ "XZY",
1363
+ "ZXY",
1364
+ "YXZ",
1365
+ "XYZ"
1366
+ ];
1367
+ return e === 6 ? (console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."), t[0]) : t[e];
1368
+ }
1369
+ function Q(e) {
1370
+ return e.split(",").map(function(e) {
1371
+ return parseFloat(e);
1372
+ });
1373
+ }
1374
+ function $(e, t, n) {
1375
+ return t === void 0 && (t = 0), n === void 0 && (n = e.byteLength), new TextDecoder().decode(new Uint8Array(e, t, n));
1376
+ }
1377
+ function me(e, t) {
1378
+ for (let n = 0, r = e.length, i = t.length; n < i; n++, r++) e[r] = t[n];
1379
+ }
1380
+ function he(e, t, n, r) {
1381
+ for (let i = n, a = 0; i < r; i++, a++) e[a] = t[i];
1382
+ return e;
1383
+ }
1384
+ //#endregion
1385
+ export { ue as FBXLoader };