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,1346 @@
1
+ import { toTrianglesDrawMode as e } from "../utils/BufferGeometryUtils.js";
2
+ import { AnimationClip as t, Bone as n, Box3 as r, BufferAttribute as i, BufferGeometry as a, ClampToEdgeWrapping as o, Color as s, ColorManagement as c, DirectionalLight as l, DoubleSide as u, FileLoader as d, FrontSide as f, Group as p, ImageBitmapLoader as m, InstancedBufferAttribute as h, InstancedMesh as g, InterleavedBuffer as _, InterleavedBufferAttribute as v, Interpolant as ee, InterpolateDiscrete as te, InterpolateLinear as y, Line as ne, LineBasicMaterial as re, LineLoop as ie, LineSegments as ae, LinearFilter as b, LinearMipmapLinearFilter as oe, LinearMipmapNearestFilter as se, LinearSRGBColorSpace as x, Loader as ce, LoaderUtils as S, Material as C, MathUtils as le, Matrix4 as w, Mesh as ue, MeshBasicMaterial as T, MeshPhysicalMaterial as E, MeshStandardMaterial as D, MirroredRepeatWrapping as de, NearestFilter as O, NearestMipmapLinearFilter as fe, NearestMipmapNearestFilter as pe, NumberKeyframeTrack as k, Object3D as A, OrthographicCamera as me, PerspectiveCamera as he, PointLight as ge, Points as _e, PointsMaterial as ve, PropertyBinding as ye, Quaternion as j, QuaternionKeyframeTrack as M, RepeatWrapping as N, SRGBColorSpace as P, Skeleton as be, SkinnedMesh as xe, Sphere as Se, SpotLight as Ce, Texture as F, TextureLoader as we, TriangleFanDrawMode as Te, TriangleStripDrawMode as Ee, Vector2 as I, Vector3 as L, VectorKeyframeTrack as R } from "three";
3
+ //#region ../../node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/GLTFLoader.js
4
+ var De = class extends ce {
5
+ constructor(e) {
6
+ super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
7
+ return new Me(e);
8
+ }), this.register(function(e) {
9
+ return new Ne(e);
10
+ }), this.register(function(e) {
11
+ return new He(e);
12
+ }), this.register(function(e) {
13
+ return new Ue(e);
14
+ }), this.register(function(e) {
15
+ return new We(e);
16
+ }), this.register(function(e) {
17
+ return new Fe(e);
18
+ }), this.register(function(e) {
19
+ return new Ie(e);
20
+ }), this.register(function(e) {
21
+ return new Le(e);
22
+ }), this.register(function(e) {
23
+ return new Re(e);
24
+ }), this.register(function(e) {
25
+ return new je(e);
26
+ }), this.register(function(e) {
27
+ return new ze(e);
28
+ }), this.register(function(e) {
29
+ return new Pe(e);
30
+ }), this.register(function(e) {
31
+ return new Ve(e);
32
+ }), this.register(function(e) {
33
+ return new Be(e);
34
+ }), this.register(function(e) {
35
+ return new ke(e);
36
+ }), this.register(function(e) {
37
+ return new Ge(e);
38
+ }), this.register(function(e) {
39
+ return new Ke(e);
40
+ });
41
+ }
42
+ load(e, t, n, r) {
43
+ let i = this, a;
44
+ if (this.resourcePath !== "") a = this.resourcePath;
45
+ else if (this.path !== "") {
46
+ let t = S.extractUrlBase(e);
47
+ a = S.resolveURL(t, this.path);
48
+ } else a = S.extractUrlBase(e);
49
+ this.manager.itemStart(e);
50
+ let o = function(t) {
51
+ r ? r(t) : console.error(t), i.manager.itemError(e), i.manager.itemEnd(e);
52
+ }, s = new d(this.manager);
53
+ s.setPath(this.path), s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(e, function(n) {
54
+ try {
55
+ i.parse(n, a, function(n) {
56
+ t(n), i.manager.itemEnd(e);
57
+ }, o);
58
+ } catch (e) {
59
+ o(e);
60
+ }
61
+ }, n, o);
62
+ }
63
+ setDRACOLoader(e) {
64
+ return this.dracoLoader = e, this;
65
+ }
66
+ setKTX2Loader(e) {
67
+ return this.ktx2Loader = e, this;
68
+ }
69
+ setMeshoptDecoder(e) {
70
+ return this.meshoptDecoder = e, this;
71
+ }
72
+ register(e) {
73
+ return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this;
74
+ }
75
+ unregister(e) {
76
+ return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
77
+ }
78
+ parse(e, t, n, r) {
79
+ let i, a = {}, o = {}, s = new TextDecoder();
80
+ if (typeof e == "string") i = JSON.parse(e);
81
+ else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) === B) {
82
+ try {
83
+ a[z.KHR_BINARY_GLTF] = new qe(e);
84
+ } catch (e) {
85
+ r && r(e);
86
+ return;
87
+ }
88
+ i = JSON.parse(a[z.KHR_BINARY_GLTF].content);
89
+ } else i = JSON.parse(s.decode(e));
90
+ else i = e;
91
+ if (i.asset === void 0 || i.asset.version[0] < 2) {
92
+ r && r(/* @__PURE__ */ Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
93
+ return;
94
+ }
95
+ let c = new ct(i, {
96
+ path: t || this.resourcePath || "",
97
+ crossOrigin: this.crossOrigin,
98
+ requestHeader: this.requestHeader,
99
+ manager: this.manager,
100
+ ktx2Loader: this.ktx2Loader,
101
+ meshoptDecoder: this.meshoptDecoder
102
+ });
103
+ c.fileLoader.setRequestHeader(this.requestHeader);
104
+ for (let e = 0; e < this.pluginCallbacks.length; e++) {
105
+ let t = this.pluginCallbacks[e](c);
106
+ t.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), o[t.name] = t, a[t.name] = !0;
107
+ }
108
+ if (i.extensionsUsed) for (let e = 0; e < i.extensionsUsed.length; ++e) {
109
+ let t = i.extensionsUsed[e], n = i.extensionsRequired || [];
110
+ switch (t) {
111
+ case z.KHR_MATERIALS_UNLIT:
112
+ a[t] = new Ae();
113
+ break;
114
+ case z.KHR_DRACO_MESH_COMPRESSION:
115
+ a[t] = new Je(i, this.dracoLoader);
116
+ break;
117
+ case z.KHR_TEXTURE_TRANSFORM:
118
+ a[t] = new Ye();
119
+ break;
120
+ case z.KHR_MESH_QUANTIZATION:
121
+ a[t] = new Xe();
122
+ break;
123
+ default: n.indexOf(t) >= 0 && o[t] === void 0 && console.warn("THREE.GLTFLoader: Unknown extension \"" + t + "\".");
124
+ }
125
+ }
126
+ c.setExtensions(a), c.setPlugins(o), c.parse(n, r);
127
+ }
128
+ parseAsync(e, t) {
129
+ let n = this;
130
+ return new Promise(function(r, i) {
131
+ n.parse(e, t, r, i);
132
+ });
133
+ }
134
+ };
135
+ function Oe() {
136
+ let e = {};
137
+ return {
138
+ get: function(t) {
139
+ return e[t];
140
+ },
141
+ add: function(t, n) {
142
+ e[t] = n;
143
+ },
144
+ remove: function(t) {
145
+ delete e[t];
146
+ },
147
+ removeAll: function() {
148
+ e = {};
149
+ }
150
+ };
151
+ }
152
+ var z = {
153
+ KHR_BINARY_GLTF: "KHR_binary_glTF",
154
+ KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
155
+ KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
156
+ KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat",
157
+ KHR_MATERIALS_DISPERSION: "KHR_materials_dispersion",
158
+ KHR_MATERIALS_IOR: "KHR_materials_ior",
159
+ KHR_MATERIALS_SHEEN: "KHR_materials_sheen",
160
+ KHR_MATERIALS_SPECULAR: "KHR_materials_specular",
161
+ KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission",
162
+ KHR_MATERIALS_IRIDESCENCE: "KHR_materials_iridescence",
163
+ KHR_MATERIALS_ANISOTROPY: "KHR_materials_anisotropy",
164
+ KHR_MATERIALS_UNLIT: "KHR_materials_unlit",
165
+ KHR_MATERIALS_VOLUME: "KHR_materials_volume",
166
+ KHR_TEXTURE_BASISU: "KHR_texture_basisu",
167
+ KHR_TEXTURE_TRANSFORM: "KHR_texture_transform",
168
+ KHR_MESH_QUANTIZATION: "KHR_mesh_quantization",
169
+ KHR_MATERIALS_EMISSIVE_STRENGTH: "KHR_materials_emissive_strength",
170
+ EXT_MATERIALS_BUMP: "EXT_materials_bump",
171
+ EXT_TEXTURE_WEBP: "EXT_texture_webp",
172
+ EXT_TEXTURE_AVIF: "EXT_texture_avif",
173
+ EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
174
+ EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
175
+ }, ke = class {
176
+ constructor(e) {
177
+ this.parser = e, this.name = z.KHR_LIGHTS_PUNCTUAL, this.cache = {
178
+ refs: {},
179
+ uses: {}
180
+ };
181
+ }
182
+ _markDefs() {
183
+ let e = this.parser, t = this.parser.json.nodes || [];
184
+ for (let n = 0, r = t.length; n < r; n++) {
185
+ let r = t[n];
186
+ r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
187
+ }
188
+ }
189
+ _loadLight(e) {
190
+ let t = this.parser, n = "light:" + e, r = t.cache.get(n);
191
+ if (r) return r;
192
+ let i = t.json, a = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e], o, c = new s(16777215);
193
+ a.color !== void 0 && c.setRGB(a.color[0], a.color[1], a.color[2], x);
194
+ let u = a.range === void 0 ? 0 : a.range;
195
+ switch (a.type) {
196
+ case "directional":
197
+ o = new l(c), o.target.position.set(0, 0, -1), o.add(o.target);
198
+ break;
199
+ case "point":
200
+ o = new ge(c), o.distance = u;
201
+ break;
202
+ case "spot":
203
+ o = new Ce(c), o.distance = u, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle === void 0 ? 0 : a.spot.innerConeAngle, a.spot.outerConeAngle = a.spot.outerConeAngle === void 0 ? Math.PI / 4 : a.spot.outerConeAngle, o.angle = a.spot.outerConeAngle, o.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, o.target.position.set(0, 0, -1), o.add(o.target);
204
+ break;
205
+ default: throw Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
206
+ }
207
+ return o.position.set(0, 0, 0), Z(o, a), a.intensity !== void 0 && (o.intensity = a.intensity), o.name = t.createUniqueName(a.name || "light_" + e), r = Promise.resolve(o), t.cache.add(n, r), r;
208
+ }
209
+ getDependency(e, t) {
210
+ if (e === "light") return this._loadLight(t);
211
+ }
212
+ createNodeAttachment(e) {
213
+ let t = this, n = this.parser, r = n.json.nodes[e], i = (r.extensions && r.extensions[this.name] || {}).light;
214
+ return i === void 0 ? null : this._loadLight(i).then(function(e) {
215
+ return n._getNodeRef(t.cache, i, e);
216
+ });
217
+ }
218
+ }, Ae = class {
219
+ constructor() {
220
+ this.name = z.KHR_MATERIALS_UNLIT;
221
+ }
222
+ getMaterialType() {
223
+ return T;
224
+ }
225
+ extendParams(e, t, n) {
226
+ let r = [];
227
+ e.color = new s(1, 1, 1), e.opacity = 1;
228
+ let i = t.pbrMetallicRoughness;
229
+ if (i) {
230
+ if (Array.isArray(i.baseColorFactor)) {
231
+ let t = i.baseColorFactor;
232
+ e.color.setRGB(t[0], t[1], t[2], x), e.opacity = t[3];
233
+ }
234
+ i.baseColorTexture !== void 0 && r.push(n.assignTexture(e, "map", i.baseColorTexture, P));
235
+ }
236
+ return Promise.all(r);
237
+ }
238
+ }, je = class {
239
+ constructor(e) {
240
+ this.parser = e, this.name = z.KHR_MATERIALS_EMISSIVE_STRENGTH;
241
+ }
242
+ extendMaterialParams(e, t) {
243
+ let n = this.parser.json.materials[e];
244
+ if (!n.extensions || !n.extensions[this.name]) return Promise.resolve();
245
+ let r = n.extensions[this.name].emissiveStrength;
246
+ return r !== void 0 && (t.emissiveIntensity = r), Promise.resolve();
247
+ }
248
+ }, Me = class {
249
+ constructor(e) {
250
+ this.parser = e, this.name = z.KHR_MATERIALS_CLEARCOAT;
251
+ }
252
+ getMaterialType(e) {
253
+ let t = this.parser.json.materials[e];
254
+ return !t.extensions || !t.extensions[this.name] ? null : E;
255
+ }
256
+ extendMaterialParams(e, t) {
257
+ let n = this.parser, r = n.json.materials[e];
258
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
259
+ let i = [], a = r.extensions[this.name];
260
+ if (a.clearcoatFactor !== void 0 && (t.clearcoat = a.clearcoatFactor), a.clearcoatTexture !== void 0 && i.push(n.assignTexture(t, "clearcoatMap", a.clearcoatTexture)), a.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = a.clearcoatRoughnessFactor), a.clearcoatRoughnessTexture !== void 0 && i.push(n.assignTexture(t, "clearcoatRoughnessMap", a.clearcoatRoughnessTexture)), a.clearcoatNormalTexture !== void 0 && (i.push(n.assignTexture(t, "clearcoatNormalMap", a.clearcoatNormalTexture)), a.clearcoatNormalTexture.scale !== void 0)) {
261
+ let e = a.clearcoatNormalTexture.scale;
262
+ t.clearcoatNormalScale = new I(e, e);
263
+ }
264
+ return Promise.all(i);
265
+ }
266
+ }, Ne = class {
267
+ constructor(e) {
268
+ this.parser = e, this.name = z.KHR_MATERIALS_DISPERSION;
269
+ }
270
+ getMaterialType(e) {
271
+ let t = this.parser.json.materials[e];
272
+ return !t.extensions || !t.extensions[this.name] ? null : E;
273
+ }
274
+ extendMaterialParams(e, t) {
275
+ let n = this.parser.json.materials[e];
276
+ if (!n.extensions || !n.extensions[this.name]) return Promise.resolve();
277
+ let r = n.extensions[this.name];
278
+ return t.dispersion = r.dispersion === void 0 ? 0 : r.dispersion, Promise.resolve();
279
+ }
280
+ }, Pe = class {
281
+ constructor(e) {
282
+ this.parser = e, this.name = z.KHR_MATERIALS_IRIDESCENCE;
283
+ }
284
+ getMaterialType(e) {
285
+ let t = this.parser.json.materials[e];
286
+ return !t.extensions || !t.extensions[this.name] ? null : E;
287
+ }
288
+ extendMaterialParams(e, t) {
289
+ let n = this.parser, r = n.json.materials[e];
290
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
291
+ let i = [], a = r.extensions[this.name];
292
+ return a.iridescenceFactor !== void 0 && (t.iridescence = a.iridescenceFactor), a.iridescenceTexture !== void 0 && i.push(n.assignTexture(t, "iridescenceMap", a.iridescenceTexture)), a.iridescenceIor !== void 0 && (t.iridescenceIOR = a.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), a.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = a.iridescenceThicknessMinimum), a.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = a.iridescenceThicknessMaximum), a.iridescenceThicknessTexture !== void 0 && i.push(n.assignTexture(t, "iridescenceThicknessMap", a.iridescenceThicknessTexture)), Promise.all(i);
293
+ }
294
+ }, Fe = class {
295
+ constructor(e) {
296
+ this.parser = e, this.name = z.KHR_MATERIALS_SHEEN;
297
+ }
298
+ getMaterialType(e) {
299
+ let t = this.parser.json.materials[e];
300
+ return !t.extensions || !t.extensions[this.name] ? null : E;
301
+ }
302
+ extendMaterialParams(e, t) {
303
+ let n = this.parser, r = n.json.materials[e];
304
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
305
+ let i = [];
306
+ t.sheenColor = new s(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
307
+ let a = r.extensions[this.name];
308
+ if (a.sheenColorFactor !== void 0) {
309
+ let e = a.sheenColorFactor;
310
+ t.sheenColor.setRGB(e[0], e[1], e[2], x);
311
+ }
312
+ return a.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = a.sheenRoughnessFactor), a.sheenColorTexture !== void 0 && i.push(n.assignTexture(t, "sheenColorMap", a.sheenColorTexture, P)), a.sheenRoughnessTexture !== void 0 && i.push(n.assignTexture(t, "sheenRoughnessMap", a.sheenRoughnessTexture)), Promise.all(i);
313
+ }
314
+ }, Ie = class {
315
+ constructor(e) {
316
+ this.parser = e, this.name = z.KHR_MATERIALS_TRANSMISSION;
317
+ }
318
+ getMaterialType(e) {
319
+ let t = this.parser.json.materials[e];
320
+ return !t.extensions || !t.extensions[this.name] ? null : E;
321
+ }
322
+ extendMaterialParams(e, t) {
323
+ let n = this.parser, r = n.json.materials[e];
324
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
325
+ let i = [], a = r.extensions[this.name];
326
+ return a.transmissionFactor !== void 0 && (t.transmission = a.transmissionFactor), a.transmissionTexture !== void 0 && i.push(n.assignTexture(t, "transmissionMap", a.transmissionTexture)), Promise.all(i);
327
+ }
328
+ }, Le = class {
329
+ constructor(e) {
330
+ this.parser = e, this.name = z.KHR_MATERIALS_VOLUME;
331
+ }
332
+ getMaterialType(e) {
333
+ let t = this.parser.json.materials[e];
334
+ return !t.extensions || !t.extensions[this.name] ? null : E;
335
+ }
336
+ extendMaterialParams(e, t) {
337
+ let n = this.parser, r = n.json.materials[e];
338
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
339
+ let i = [], a = r.extensions[this.name];
340
+ t.thickness = a.thicknessFactor === void 0 ? 0 : a.thicknessFactor, a.thicknessTexture !== void 0 && i.push(n.assignTexture(t, "thicknessMap", a.thicknessTexture)), t.attenuationDistance = a.attenuationDistance || Infinity;
341
+ let o = a.attenuationColor || [
342
+ 1,
343
+ 1,
344
+ 1
345
+ ];
346
+ return t.attenuationColor = new s().setRGB(o[0], o[1], o[2], x), Promise.all(i);
347
+ }
348
+ }, Re = class {
349
+ constructor(e) {
350
+ this.parser = e, this.name = z.KHR_MATERIALS_IOR;
351
+ }
352
+ getMaterialType(e) {
353
+ let t = this.parser.json.materials[e];
354
+ return !t.extensions || !t.extensions[this.name] ? null : E;
355
+ }
356
+ extendMaterialParams(e, t) {
357
+ let n = this.parser.json.materials[e];
358
+ if (!n.extensions || !n.extensions[this.name]) return Promise.resolve();
359
+ let r = n.extensions[this.name];
360
+ return t.ior = r.ior === void 0 ? 1.5 : r.ior, Promise.resolve();
361
+ }
362
+ }, ze = class {
363
+ constructor(e) {
364
+ this.parser = e, this.name = z.KHR_MATERIALS_SPECULAR;
365
+ }
366
+ getMaterialType(e) {
367
+ let t = this.parser.json.materials[e];
368
+ return !t.extensions || !t.extensions[this.name] ? null : E;
369
+ }
370
+ extendMaterialParams(e, t) {
371
+ let n = this.parser, r = n.json.materials[e];
372
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
373
+ let i = [], a = r.extensions[this.name];
374
+ t.specularIntensity = a.specularFactor === void 0 ? 1 : a.specularFactor, a.specularTexture !== void 0 && i.push(n.assignTexture(t, "specularIntensityMap", a.specularTexture));
375
+ let o = a.specularColorFactor || [
376
+ 1,
377
+ 1,
378
+ 1
379
+ ];
380
+ return t.specularColor = new s().setRGB(o[0], o[1], o[2], x), a.specularColorTexture !== void 0 && i.push(n.assignTexture(t, "specularColorMap", a.specularColorTexture, P)), Promise.all(i);
381
+ }
382
+ }, Be = class {
383
+ constructor(e) {
384
+ this.parser = e, this.name = z.EXT_MATERIALS_BUMP;
385
+ }
386
+ getMaterialType(e) {
387
+ let t = this.parser.json.materials[e];
388
+ return !t.extensions || !t.extensions[this.name] ? null : E;
389
+ }
390
+ extendMaterialParams(e, t) {
391
+ let n = this.parser, r = n.json.materials[e];
392
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
393
+ let i = [], a = r.extensions[this.name];
394
+ return t.bumpScale = a.bumpFactor === void 0 ? 1 : a.bumpFactor, a.bumpTexture !== void 0 && i.push(n.assignTexture(t, "bumpMap", a.bumpTexture)), Promise.all(i);
395
+ }
396
+ }, Ve = class {
397
+ constructor(e) {
398
+ this.parser = e, this.name = z.KHR_MATERIALS_ANISOTROPY;
399
+ }
400
+ getMaterialType(e) {
401
+ let t = this.parser.json.materials[e];
402
+ return !t.extensions || !t.extensions[this.name] ? null : E;
403
+ }
404
+ extendMaterialParams(e, t) {
405
+ let n = this.parser, r = n.json.materials[e];
406
+ if (!r.extensions || !r.extensions[this.name]) return Promise.resolve();
407
+ let i = [], a = r.extensions[this.name];
408
+ return a.anisotropyStrength !== void 0 && (t.anisotropy = a.anisotropyStrength), a.anisotropyRotation !== void 0 && (t.anisotropyRotation = a.anisotropyRotation), a.anisotropyTexture !== void 0 && i.push(n.assignTexture(t, "anisotropyMap", a.anisotropyTexture)), Promise.all(i);
409
+ }
410
+ }, He = class {
411
+ constructor(e) {
412
+ this.parser = e, this.name = z.KHR_TEXTURE_BASISU;
413
+ }
414
+ loadTexture(e) {
415
+ let t = this.parser, n = t.json, r = n.textures[e];
416
+ if (!r.extensions || !r.extensions[this.name]) return null;
417
+ let i = r.extensions[this.name], a = t.options.ktx2Loader;
418
+ if (!a) {
419
+ if (n.extensionsRequired && n.extensionsRequired.indexOf(this.name) >= 0) throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
420
+ return null;
421
+ }
422
+ return t.loadTextureImage(e, i.source, a);
423
+ }
424
+ }, Ue = class {
425
+ constructor(e) {
426
+ this.parser = e, this.name = z.EXT_TEXTURE_WEBP;
427
+ }
428
+ loadTexture(e) {
429
+ let t = this.name, n = this.parser, r = n.json, i = r.textures[e];
430
+ if (!i.extensions || !i.extensions[t]) return null;
431
+ let a = i.extensions[t], o = r.images[a.source], s = n.textureLoader;
432
+ if (o.uri) {
433
+ let e = n.options.manager.getHandler(o.uri);
434
+ e !== null && (s = e);
435
+ }
436
+ return n.loadTextureImage(e, a.source, s);
437
+ }
438
+ }, We = class {
439
+ constructor(e) {
440
+ this.parser = e, this.name = z.EXT_TEXTURE_AVIF;
441
+ }
442
+ loadTexture(e) {
443
+ let t = this.name, n = this.parser, r = n.json, i = r.textures[e];
444
+ if (!i.extensions || !i.extensions[t]) return null;
445
+ let a = i.extensions[t], o = r.images[a.source], s = n.textureLoader;
446
+ if (o.uri) {
447
+ let e = n.options.manager.getHandler(o.uri);
448
+ e !== null && (s = e);
449
+ }
450
+ return n.loadTextureImage(e, a.source, s);
451
+ }
452
+ }, Ge = class {
453
+ constructor(e) {
454
+ this.name = z.EXT_MESHOPT_COMPRESSION, this.parser = e;
455
+ }
456
+ loadBufferView(e) {
457
+ let t = this.parser.json, n = t.bufferViews[e];
458
+ if (n.extensions && n.extensions[this.name]) {
459
+ let e = n.extensions[this.name], r = this.parser.getDependency("buffer", e.buffer), i = this.parser.options.meshoptDecoder;
460
+ if (!i || !i.supported) {
461
+ if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
462
+ return null;
463
+ }
464
+ return r.then(function(t) {
465
+ let n = e.byteOffset || 0, r = e.byteLength || 0, a = e.count, o = e.byteStride, s = new Uint8Array(t, n, r);
466
+ return i.decodeGltfBufferAsync ? i.decodeGltfBufferAsync(a, o, s, e.mode, e.filter).then(function(e) {
467
+ return e.buffer;
468
+ }) : i.ready.then(function() {
469
+ let t = new ArrayBuffer(a * o);
470
+ return i.decodeGltfBuffer(new Uint8Array(t), a, o, s, e.mode, e.filter), t;
471
+ });
472
+ });
473
+ } else return null;
474
+ }
475
+ }, Ke = class {
476
+ constructor(e) {
477
+ this.name = z.EXT_MESH_GPU_INSTANCING, this.parser = e;
478
+ }
479
+ createNodeMesh(e) {
480
+ let t = this.parser.json, n = t.nodes[e];
481
+ if (!n.extensions || !n.extensions[this.name] || n.mesh === void 0) return null;
482
+ let r = t.meshes[n.mesh];
483
+ for (let e of r.primitives) if (e.mode !== W.TRIANGLES && e.mode !== W.TRIANGLE_STRIP && e.mode !== W.TRIANGLE_FAN && e.mode !== void 0) return null;
484
+ let i = n.extensions[this.name].attributes, a = [], o = {};
485
+ for (let e in i) a.push(this.parser.getDependency("accessor", i[e]).then((t) => (o[e] = t, o[e])));
486
+ return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((e) => {
487
+ let t = e.pop(), n = t.isGroup ? t.children : [t], r = e[0].count, i = [];
488
+ for (let e of n) {
489
+ let t = new w(), n = new L(), a = new j(), s = new L(1, 1, 1), c = new g(e.geometry, e.material, r);
490
+ for (let e = 0; e < r; e++) o.TRANSLATION && n.fromBufferAttribute(o.TRANSLATION, e), o.ROTATION && a.fromBufferAttribute(o.ROTATION, e), o.SCALE && s.fromBufferAttribute(o.SCALE, e), c.setMatrixAt(e, t.compose(n, a, s));
491
+ for (let t in o) if (t === "_COLOR_0") {
492
+ let e = o[t];
493
+ c.instanceColor = new h(e.array, e.itemSize, e.normalized);
494
+ } else t !== "TRANSLATION" && t !== "ROTATION" && t !== "SCALE" && e.geometry.setAttribute(t, o[t]);
495
+ A.prototype.copy.call(c, e), this.parser.assignFinalMaterial(c), i.push(c);
496
+ }
497
+ return t.isGroup ? (t.clear(), t.add(...i), t) : i[0];
498
+ }));
499
+ }
500
+ }, B = "glTF", V = 12, H = {
501
+ JSON: 1313821514,
502
+ BIN: 5130562
503
+ }, qe = class {
504
+ constructor(e) {
505
+ this.name = z.KHR_BINARY_GLTF, this.content = null, this.body = null;
506
+ let t = new DataView(e, 0, V), n = new TextDecoder();
507
+ if (this.header = {
508
+ magic: n.decode(new Uint8Array(e.slice(0, 4))),
509
+ version: t.getUint32(4, !0),
510
+ length: t.getUint32(8, !0)
511
+ }, this.header.magic !== B) throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
512
+ if (this.header.version < 2) throw Error("THREE.GLTFLoader: Legacy binary file detected.");
513
+ let r = this.header.length - V, i = new DataView(e, V), a = 0;
514
+ for (; a < r;) {
515
+ let t = i.getUint32(a, !0);
516
+ a += 4;
517
+ let r = i.getUint32(a, !0);
518
+ if (a += 4, r === H.JSON) {
519
+ let r = new Uint8Array(e, V + a, t);
520
+ this.content = n.decode(r);
521
+ } else if (r === H.BIN) {
522
+ let n = V + a;
523
+ this.body = e.slice(n, n + t);
524
+ }
525
+ a += t;
526
+ }
527
+ if (this.content === null) throw Error("THREE.GLTFLoader: JSON content not found.");
528
+ }
529
+ }, Je = class {
530
+ constructor(e, t) {
531
+ if (!t) throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
532
+ this.name = z.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
533
+ }
534
+ decodePrimitive(e, t) {
535
+ let n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, s = {}, c = {};
536
+ for (let e in a) {
537
+ let t = q[e] || e.toLowerCase();
538
+ o[t] = a[e];
539
+ }
540
+ for (let t in e.attributes) {
541
+ let r = q[t] || t.toLowerCase();
542
+ if (a[t] !== void 0) {
543
+ let i = n.accessors[e.attributes[t]];
544
+ c[r] = G[i.componentType].name, s[r] = i.normalized === !0;
545
+ }
546
+ }
547
+ return t.getDependency("bufferView", i).then(function(e) {
548
+ return new Promise(function(t, n) {
549
+ r.decodeDracoFile(e, function(e) {
550
+ for (let t in e.attributes) {
551
+ let n = e.attributes[t], r = s[t];
552
+ r !== void 0 && (n.normalized = r);
553
+ }
554
+ t(e);
555
+ }, o, c, x, n);
556
+ });
557
+ });
558
+ }
559
+ }, Ye = class {
560
+ constructor() {
561
+ this.name = z.KHR_TEXTURE_TRANSFORM;
562
+ }
563
+ extendTexture(e, t) {
564
+ return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 ? e : (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0, e);
565
+ }
566
+ }, Xe = class {
567
+ constructor() {
568
+ this.name = z.KHR_MESH_QUANTIZATION;
569
+ }
570
+ }, U = class extends ee {
571
+ constructor(e, t, n, r) {
572
+ super(e, t, n, r);
573
+ }
574
+ copySampleValue_(e) {
575
+ let t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r * 3 + r;
576
+ for (let e = 0; e !== r; e++) t[e] = n[i + e];
577
+ return t;
578
+ }
579
+ interpolate_(e, t, n, r) {
580
+ let i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = o * 2, c = o * 3, l = r - t, u = (n - t) / l, d = u * u, f = d * u, p = e * c, m = p - c, h = -2 * f + 3 * d, g = f - d, _ = 1 - h, v = g - d + u;
581
+ for (let e = 0; e !== o; e++) {
582
+ let t = a[m + e + o], n = a[m + e + s] * l, r = a[p + e + o], c = a[p + e] * l;
583
+ i[e] = _ * t + v * n + h * r + g * c;
584
+ }
585
+ return i;
586
+ }
587
+ }, Ze = new j(), Qe = class extends U {
588
+ interpolate_(e, t, n, r) {
589
+ let i = super.interpolate_(e, t, n, r);
590
+ return Ze.fromArray(i).normalize().toArray(i), i;
591
+ }
592
+ }, W = {
593
+ FLOAT: 5126,
594
+ FLOAT_MAT3: 35675,
595
+ FLOAT_MAT4: 35676,
596
+ FLOAT_VEC2: 35664,
597
+ FLOAT_VEC3: 35665,
598
+ FLOAT_VEC4: 35666,
599
+ LINEAR: 9729,
600
+ REPEAT: 10497,
601
+ SAMPLER_2D: 35678,
602
+ POINTS: 0,
603
+ LINES: 1,
604
+ LINE_LOOP: 2,
605
+ LINE_STRIP: 3,
606
+ TRIANGLES: 4,
607
+ TRIANGLE_STRIP: 5,
608
+ TRIANGLE_FAN: 6,
609
+ UNSIGNED_BYTE: 5121,
610
+ UNSIGNED_SHORT: 5123
611
+ }, G = {
612
+ 5120: Int8Array,
613
+ 5121: Uint8Array,
614
+ 5122: Int16Array,
615
+ 5123: Uint16Array,
616
+ 5125: Uint32Array,
617
+ 5126: Float32Array
618
+ }, $e = {
619
+ 9728: O,
620
+ 9729: b,
621
+ 9984: pe,
622
+ 9985: se,
623
+ 9986: fe,
624
+ 9987: oe
625
+ }, et = {
626
+ 33071: o,
627
+ 33648: de,
628
+ 10497: N
629
+ }, K = {
630
+ SCALAR: 1,
631
+ VEC2: 2,
632
+ VEC3: 3,
633
+ VEC4: 4,
634
+ MAT2: 4,
635
+ MAT3: 9,
636
+ MAT4: 16
637
+ }, q = {
638
+ POSITION: "position",
639
+ NORMAL: "normal",
640
+ TANGENT: "tangent",
641
+ TEXCOORD_0: "uv",
642
+ TEXCOORD_1: "uv1",
643
+ TEXCOORD_2: "uv2",
644
+ TEXCOORD_3: "uv3",
645
+ COLOR_0: "color",
646
+ WEIGHTS_0: "skinWeight",
647
+ JOINTS_0: "skinIndex"
648
+ }, J = {
649
+ scale: "scale",
650
+ translation: "position",
651
+ rotation: "quaternion",
652
+ weights: "morphTargetInfluences"
653
+ }, tt = {
654
+ CUBICSPLINE: void 0,
655
+ LINEAR: y,
656
+ STEP: te
657
+ }, Y = {
658
+ OPAQUE: "OPAQUE",
659
+ MASK: "MASK",
660
+ BLEND: "BLEND"
661
+ };
662
+ function nt(e) {
663
+ return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new D({
664
+ color: 16777215,
665
+ emissive: 0,
666
+ metalness: 1,
667
+ roughness: 1,
668
+ transparent: !1,
669
+ depthTest: !0,
670
+ side: f
671
+ })), e.DefaultMaterial;
672
+ }
673
+ function X(e, t, n) {
674
+ for (let r in n.extensions) e[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = n.extensions[r]);
675
+ }
676
+ function Z(e, t) {
677
+ t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
678
+ }
679
+ function rt(e, t, n) {
680
+ let r = !1, i = !1, a = !1;
681
+ for (let e = 0, n = t.length; e < n; e++) {
682
+ let n = t[e];
683
+ if (n.POSITION !== void 0 && (r = !0), n.NORMAL !== void 0 && (i = !0), n.COLOR_0 !== void 0 && (a = !0), r && i && a) break;
684
+ }
685
+ if (!r && !i && !a) return Promise.resolve(e);
686
+ let o = [], s = [], c = [];
687
+ for (let l = 0, u = t.length; l < u; l++) {
688
+ let u = t[l];
689
+ if (r) {
690
+ let t = u.POSITION === void 0 ? e.attributes.position : n.getDependency("accessor", u.POSITION);
691
+ o.push(t);
692
+ }
693
+ if (i) {
694
+ let t = u.NORMAL === void 0 ? e.attributes.normal : n.getDependency("accessor", u.NORMAL);
695
+ s.push(t);
696
+ }
697
+ if (a) {
698
+ let t = u.COLOR_0 === void 0 ? e.attributes.color : n.getDependency("accessor", u.COLOR_0);
699
+ c.push(t);
700
+ }
701
+ }
702
+ return Promise.all([
703
+ Promise.all(o),
704
+ Promise.all(s),
705
+ Promise.all(c)
706
+ ]).then(function(t) {
707
+ let n = t[0], o = t[1], s = t[2];
708
+ return r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), a && (e.morphAttributes.color = s), e.morphTargetsRelative = !0, e;
709
+ });
710
+ }
711
+ function it(e, t) {
712
+ if (e.updateMorphTargets(), t.weights !== void 0) for (let n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n];
713
+ if (t.extras && Array.isArray(t.extras.targetNames)) {
714
+ let n = t.extras.targetNames;
715
+ if (e.morphTargetInfluences.length === n.length) {
716
+ e.morphTargetDictionary = {};
717
+ for (let t = 0, r = n.length; t < r; t++) e.morphTargetDictionary[n[t]] = t;
718
+ } else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
719
+ }
720
+ }
721
+ function at(e) {
722
+ let t, n = e.extensions && e.extensions[z.KHR_DRACO_MESH_COMPRESSION];
723
+ if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" + Q(n.attributes) : e.indices + ":" + Q(e.attributes) + ":" + e.mode, e.targets !== void 0) for (let n = 0, r = e.targets.length; n < r; n++) t += ":" + Q(e.targets[n]);
724
+ return t;
725
+ }
726
+ function Q(e) {
727
+ let t = "", n = Object.keys(e).sort();
728
+ for (let r = 0, i = n.length; r < i; r++) t += n[r] + ":" + e[n[r]] + ";";
729
+ return t;
730
+ }
731
+ function $(e) {
732
+ switch (e) {
733
+ case Int8Array: return 1 / 127;
734
+ case Uint8Array: return 1 / 255;
735
+ case Int16Array: return 1 / 32767;
736
+ case Uint16Array: return 1 / 65535;
737
+ default: throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
738
+ }
739
+ }
740
+ function ot(e) {
741
+ return e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : e.search(/\.webp($|\?)/i) > 0 || e.search(/^data\:image\/webp/) === 0 ? "image/webp" : e.search(/\.ktx2($|\?)/i) > 0 || e.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
742
+ }
743
+ var st = new w(), ct = class {
744
+ constructor(e = {}, t = {}) {
745
+ this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Oe(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = {
746
+ refs: {},
747
+ uses: {}
748
+ }, this.cameraCache = {
749
+ refs: {},
750
+ uses: {}
751
+ }, this.lightCache = {
752
+ refs: {},
753
+ uses: {}
754
+ }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
755
+ let n = !1, r = -1, i = !1, a = -1;
756
+ if (typeof navigator < "u") {
757
+ let e = navigator.userAgent;
758
+ n = /^((?!chrome|android).)*safari/i.test(e) === !0;
759
+ let t = e.match(/Version\/(\d+)/);
760
+ r = n && t ? parseInt(t[1], 10) : -1, i = e.indexOf("Firefox") > -1, a = i ? e.match(/Firefox\/([0-9]+)\./)[1] : -1;
761
+ }
762
+ typeof createImageBitmap > "u" || n && r < 17 || i && a < 98 ? this.textureLoader = new we(this.options.manager) : this.textureLoader = new m(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new d(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
763
+ }
764
+ setExtensions(e) {
765
+ this.extensions = e;
766
+ }
767
+ setPlugins(e) {
768
+ this.plugins = e;
769
+ }
770
+ parse(e, t) {
771
+ let n = this, r = this.json, i = this.extensions;
772
+ this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(e) {
773
+ return e._markDefs && e._markDefs();
774
+ }), Promise.all(this._invokeAll(function(e) {
775
+ return e.beforeRoot && e.beforeRoot();
776
+ })).then(function() {
777
+ return Promise.all([
778
+ n.getDependencies("scene"),
779
+ n.getDependencies("animation"),
780
+ n.getDependencies("camera")
781
+ ]);
782
+ }).then(function(t) {
783
+ let a = {
784
+ scene: t[0][r.scene || 0],
785
+ scenes: t[0],
786
+ animations: t[1],
787
+ cameras: t[2],
788
+ asset: r.asset,
789
+ parser: n,
790
+ userData: {}
791
+ };
792
+ return X(i, a, r), Z(a, r), Promise.all(n._invokeAll(function(e) {
793
+ return e.afterRoot && e.afterRoot(a);
794
+ })).then(function() {
795
+ for (let e of a.scenes) e.updateMatrixWorld();
796
+ e(a);
797
+ });
798
+ }).catch(t);
799
+ }
800
+ _markDefs() {
801
+ let e = this.json.nodes || [], t = this.json.skins || [], n = this.json.meshes || [];
802
+ for (let n = 0, r = t.length; n < r; n++) {
803
+ let r = t[n].joints;
804
+ for (let t = 0, n = r.length; t < n; t++) e[r[t]].isBone = !0;
805
+ }
806
+ for (let t = 0, r = e.length; t < r; t++) {
807
+ let r = e[t];
808
+ r.mesh !== void 0 && (this._addNodeRef(this.meshCache, r.mesh), r.skin !== void 0 && (n[r.mesh].isSkinnedMesh = !0)), r.camera !== void 0 && this._addNodeRef(this.cameraCache, r.camera);
809
+ }
810
+ }
811
+ _addNodeRef(e, t) {
812
+ t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
813
+ }
814
+ _getNodeRef(e, t, n) {
815
+ if (e.refs[t] <= 1) return n;
816
+ let r = n.clone(), i = (e, t) => {
817
+ let n = this.associations.get(e);
818
+ n != null && this.associations.set(t, n);
819
+ for (let [n, r] of e.children.entries()) i(r, t.children[n]);
820
+ };
821
+ return i(n, r), r.name += "_instance_" + e.uses[t]++, r;
822
+ }
823
+ _invokeOne(e) {
824
+ let t = Object.values(this.plugins);
825
+ t.push(this);
826
+ for (let n = 0; n < t.length; n++) {
827
+ let r = e(t[n]);
828
+ if (r) return r;
829
+ }
830
+ return null;
831
+ }
832
+ _invokeAll(e) {
833
+ let t = Object.values(this.plugins);
834
+ t.unshift(this);
835
+ let n = [];
836
+ for (let r = 0; r < t.length; r++) {
837
+ let i = e(t[r]);
838
+ i && n.push(i);
839
+ }
840
+ return n;
841
+ }
842
+ getDependency(e, t) {
843
+ let n = e + ":" + t, r = this.cache.get(n);
844
+ if (!r) {
845
+ switch (e) {
846
+ case "scene":
847
+ r = this.loadScene(t);
848
+ break;
849
+ case "node":
850
+ r = this._invokeOne(function(e) {
851
+ return e.loadNode && e.loadNode(t);
852
+ });
853
+ break;
854
+ case "mesh":
855
+ r = this._invokeOne(function(e) {
856
+ return e.loadMesh && e.loadMesh(t);
857
+ });
858
+ break;
859
+ case "accessor":
860
+ r = this.loadAccessor(t);
861
+ break;
862
+ case "bufferView":
863
+ r = this._invokeOne(function(e) {
864
+ return e.loadBufferView && e.loadBufferView(t);
865
+ });
866
+ break;
867
+ case "buffer":
868
+ r = this.loadBuffer(t);
869
+ break;
870
+ case "material":
871
+ r = this._invokeOne(function(e) {
872
+ return e.loadMaterial && e.loadMaterial(t);
873
+ });
874
+ break;
875
+ case "texture":
876
+ r = this._invokeOne(function(e) {
877
+ return e.loadTexture && e.loadTexture(t);
878
+ });
879
+ break;
880
+ case "skin":
881
+ r = this.loadSkin(t);
882
+ break;
883
+ case "animation":
884
+ r = this._invokeOne(function(e) {
885
+ return e.loadAnimation && e.loadAnimation(t);
886
+ });
887
+ break;
888
+ case "camera":
889
+ r = this.loadCamera(t);
890
+ break;
891
+ default:
892
+ if (r = this._invokeOne(function(n) {
893
+ return n != this && n.getDependency && n.getDependency(e, t);
894
+ }), !r) throw Error("Unknown type: " + e);
895
+ break;
896
+ }
897
+ this.cache.add(n, r);
898
+ }
899
+ return r;
900
+ }
901
+ getDependencies(e) {
902
+ let t = this.cache.get(e);
903
+ if (!t) {
904
+ let n = this, r = this.json[e + (e === "mesh" ? "es" : "s")] || [];
905
+ t = Promise.all(r.map(function(t, r) {
906
+ return n.getDependency(e, r);
907
+ })), this.cache.add(e, t);
908
+ }
909
+ return t;
910
+ }
911
+ loadBuffer(e) {
912
+ let t = this.json.buffers[e], n = this.fileLoader;
913
+ if (t.type && t.type !== "arraybuffer") throw Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
914
+ if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[z.KHR_BINARY_GLTF].body);
915
+ let r = this.options;
916
+ return new Promise(function(e, i) {
917
+ n.load(S.resolveURL(t.uri, r.path), e, void 0, function() {
918
+ i(/* @__PURE__ */ Error("THREE.GLTFLoader: Failed to load buffer \"" + t.uri + "\"."));
919
+ });
920
+ });
921
+ }
922
+ loadBufferView(e) {
923
+ let t = this.json.bufferViews[e];
924
+ return this.getDependency("buffer", t.buffer).then(function(e) {
925
+ let n = t.byteLength || 0, r = t.byteOffset || 0;
926
+ return e.slice(r, r + n);
927
+ });
928
+ }
929
+ loadAccessor(e) {
930
+ let t = this, n = this.json, r = this.json.accessors[e];
931
+ if (r.bufferView === void 0 && r.sparse === void 0) {
932
+ let e = K[r.type], t = G[r.componentType], n = r.normalized === !0, a = new t(r.count * e);
933
+ return Promise.resolve(new i(a, e, n));
934
+ }
935
+ let a = [];
936
+ return r.bufferView === void 0 ? a.push(null) : a.push(this.getDependency("bufferView", r.bufferView)), r.sparse !== void 0 && (a.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), a.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(a).then(function(e) {
937
+ let a = e[0], o = K[r.type], s = G[r.componentType], c = s.BYTES_PER_ELEMENT, l = c * o, u = r.byteOffset || 0, d = r.bufferView === void 0 ? void 0 : n.bufferViews[r.bufferView].byteStride, f = r.normalized === !0, p, m;
938
+ if (d && d !== l) {
939
+ let e = Math.floor(u / d), n = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + e + ":" + r.count, i = t.cache.get(n);
940
+ i || (p = new s(a, e * d, r.count * d / c), i = new _(p, d / c), t.cache.add(n, i)), m = new v(i, o, u % d / c, f);
941
+ } else p = a === null ? new s(r.count * o) : new s(a, u, r.count * o), m = new i(p, o, f);
942
+ if (r.sparse !== void 0) {
943
+ let t = K.SCALAR, n = G[r.sparse.indices.componentType], c = r.sparse.indices.byteOffset || 0, l = r.sparse.values.byteOffset || 0, u = new n(e[1], c, r.sparse.count * t), d = new s(e[2], l, r.sparse.count * o);
944
+ a !== null && (m = new i(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
945
+ for (let e = 0, t = u.length; e < t; e++) {
946
+ let t = u[e];
947
+ if (m.setX(t, d[e * o]), o >= 2 && m.setY(t, d[e * o + 1]), o >= 3 && m.setZ(t, d[e * o + 2]), o >= 4 && m.setW(t, d[e * o + 3]), o >= 5) throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
948
+ }
949
+ m.normalized = f;
950
+ }
951
+ return m;
952
+ });
953
+ }
954
+ loadTexture(e) {
955
+ let t = this.json, n = this.options, r = t.textures[e].source, i = t.images[r], a = this.textureLoader;
956
+ if (i.uri) {
957
+ let e = n.manager.getHandler(i.uri);
958
+ e !== null && (a = e);
959
+ }
960
+ return this.loadTextureImage(e, r, a);
961
+ }
962
+ loadTextureImage(e, t, n) {
963
+ let r = this, i = this.json, a = i.textures[e], o = i.images[t], s = (o.uri || o.bufferView) + ":" + a.sampler;
964
+ if (this.textureCache[s]) return this.textureCache[s];
965
+ let c = this.loadImageSource(t, n).then(function(t) {
966
+ t.flipY = !1, t.name = a.name || o.name || "", t.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (t.name = o.uri);
967
+ let n = (i.samplers || {})[a.sampler] || {};
968
+ return t.magFilter = $e[n.magFilter] || b, t.minFilter = $e[n.minFilter] || oe, t.wrapS = et[n.wrapS] || N, t.wrapT = et[n.wrapT] || N, t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== O && t.minFilter !== b, r.associations.set(t, { textures: e }), t;
969
+ }).catch(function() {
970
+ return null;
971
+ });
972
+ return this.textureCache[s] = c, c;
973
+ }
974
+ loadImageSource(e, t) {
975
+ let n = this, r = this.json, i = this.options;
976
+ if (this.sourceCache[e] !== void 0) return this.sourceCache[e].then((e) => e.clone());
977
+ let a = r.images[e], o = self.URL || self.webkitURL, s = a.uri || "", c = !1;
978
+ if (a.bufferView !== void 0) s = n.getDependency("bufferView", a.bufferView).then(function(e) {
979
+ c = !0;
980
+ let t = new Blob([e], { type: a.mimeType });
981
+ return s = o.createObjectURL(t), s;
982
+ });
983
+ else if (a.uri === void 0) throw Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
984
+ let l = Promise.resolve(s).then(function(e) {
985
+ return new Promise(function(n, r) {
986
+ let a = n;
987
+ t.isImageBitmapLoader === !0 && (a = function(e) {
988
+ let t = new F(e);
989
+ t.needsUpdate = !0, n(t);
990
+ }), t.load(S.resolveURL(e, i.path), a, void 0, r);
991
+ });
992
+ }).then(function(e) {
993
+ return c === !0 && o.revokeObjectURL(s), Z(e, a), e.userData.mimeType = a.mimeType || ot(a.uri), e;
994
+ }).catch(function(e) {
995
+ throw console.error("THREE.GLTFLoader: Couldn't load texture", s), e;
996
+ });
997
+ return this.sourceCache[e] = l, l;
998
+ }
999
+ assignTexture(e, t, n, r) {
1000
+ let i = this;
1001
+ return this.getDependency("texture", n.index).then(function(a) {
1002
+ if (!a) return null;
1003
+ if (n.texCoord !== void 0 && n.texCoord > 0 && (a = a.clone(), a.channel = n.texCoord), i.extensions[z.KHR_TEXTURE_TRANSFORM]) {
1004
+ let e = n.extensions === void 0 ? void 0 : n.extensions[z.KHR_TEXTURE_TRANSFORM];
1005
+ if (e) {
1006
+ let t = i.associations.get(a);
1007
+ a = i.extensions[z.KHR_TEXTURE_TRANSFORM].extendTexture(a, e), i.associations.set(a, t);
1008
+ }
1009
+ }
1010
+ return r !== void 0 && (a.colorSpace = r), e[t] = a, a;
1011
+ });
1012
+ }
1013
+ assignFinalMaterial(e) {
1014
+ let t = e.geometry, n = e.material, r = t.attributes.tangent === void 0, i = t.attributes.color !== void 0, a = t.attributes.normal === void 0;
1015
+ if (e.isPoints) {
1016
+ let e = "PointsMaterial:" + n.uuid, t = this.cache.get(e);
1017
+ t || (t = new ve(), C.prototype.copy.call(t, n), t.color.copy(n.color), t.map = n.map, t.sizeAttenuation = !1, this.cache.add(e, t)), n = t;
1018
+ } else if (e.isLine) {
1019
+ let e = "LineBasicMaterial:" + n.uuid, t = this.cache.get(e);
1020
+ t || (t = new re(), C.prototype.copy.call(t, n), t.color.copy(n.color), t.map = n.map, this.cache.add(e, t)), n = t;
1021
+ }
1022
+ if (r || i || a) {
1023
+ let e = "ClonedMaterial:" + n.uuid + ":";
1024
+ r && (e += "derivative-tangents:"), i && (e += "vertex-colors:"), a && (e += "flat-shading:");
1025
+ let t = this.cache.get(e);
1026
+ t || (t = n.clone(), i && (t.vertexColors = !0), a && (t.flatShading = !0), r && (t.normalScale && (t.normalScale.y *= -1), t.clearcoatNormalScale && (t.clearcoatNormalScale.y *= -1)), this.cache.add(e, t), this.associations.set(t, this.associations.get(n))), n = t;
1027
+ }
1028
+ e.material = n;
1029
+ }
1030
+ getMaterialType() {
1031
+ return D;
1032
+ }
1033
+ loadMaterial(e) {
1034
+ let t = this, n = this.json, r = this.extensions, i = n.materials[e], a, o = {}, c = i.extensions || {}, l = [];
1035
+ if (c[z.KHR_MATERIALS_UNLIT]) {
1036
+ let e = r[z.KHR_MATERIALS_UNLIT];
1037
+ a = e.getMaterialType(), l.push(e.extendParams(o, i, t));
1038
+ } else {
1039
+ let n = i.pbrMetallicRoughness || {};
1040
+ if (o.color = new s(1, 1, 1), o.opacity = 1, Array.isArray(n.baseColorFactor)) {
1041
+ let e = n.baseColorFactor;
1042
+ o.color.setRGB(e[0], e[1], e[2], x), o.opacity = e[3];
1043
+ }
1044
+ n.baseColorTexture !== void 0 && l.push(t.assignTexture(o, "map", n.baseColorTexture, P)), o.metalness = n.metallicFactor === void 0 ? 1 : n.metallicFactor, o.roughness = n.roughnessFactor === void 0 ? 1 : n.roughnessFactor, n.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(o, "metalnessMap", n.metallicRoughnessTexture)), l.push(t.assignTexture(o, "roughnessMap", n.metallicRoughnessTexture))), a = this._invokeOne(function(t) {
1045
+ return t.getMaterialType && t.getMaterialType(e);
1046
+ }), l.push(Promise.all(this._invokeAll(function(t) {
1047
+ return t.extendMaterialParams && t.extendMaterialParams(e, o);
1048
+ })));
1049
+ }
1050
+ i.doubleSided === !0 && (o.side = u);
1051
+ let d = i.alphaMode || Y.OPAQUE;
1052
+ if (d === Y.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, d === Y.MASK && (o.alphaTest = i.alphaCutoff === void 0 ? .5 : i.alphaCutoff)), i.normalTexture !== void 0 && a !== T && (l.push(t.assignTexture(o, "normalMap", i.normalTexture)), o.normalScale = new I(1, 1), i.normalTexture.scale !== void 0)) {
1053
+ let e = i.normalTexture.scale;
1054
+ o.normalScale.set(e, e);
1055
+ }
1056
+ if (i.occlusionTexture !== void 0 && a !== T && (l.push(t.assignTexture(o, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && a !== T) {
1057
+ let e = i.emissiveFactor;
1058
+ o.emissive = new s().setRGB(e[0], e[1], e[2], x);
1059
+ }
1060
+ return i.emissiveTexture !== void 0 && a !== T && l.push(t.assignTexture(o, "emissiveMap", i.emissiveTexture, P)), Promise.all(l).then(function() {
1061
+ let n = new a(o);
1062
+ return i.name && (n.name = i.name), Z(n, i), t.associations.set(n, { materials: e }), i.extensions && X(r, n, i), n;
1063
+ });
1064
+ }
1065
+ createUniqueName(e) {
1066
+ let t = ye.sanitizeNodeName(e || "");
1067
+ return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
1068
+ }
1069
+ loadGeometries(e) {
1070
+ let t = this, n = this.extensions, r = this.primitiveCache;
1071
+ function i(e) {
1072
+ return n[z.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e, t).then(function(n) {
1073
+ return ut(n, e, t);
1074
+ });
1075
+ }
1076
+ let o = [];
1077
+ for (let n = 0, s = e.length; n < s; n++) {
1078
+ let s = e[n], c = at(s), l = r[c];
1079
+ if (l) o.push(l.promise);
1080
+ else {
1081
+ let e;
1082
+ e = s.extensions && s.extensions[z.KHR_DRACO_MESH_COMPRESSION] ? i(s) : ut(new a(), s, t), r[c] = {
1083
+ primitive: s,
1084
+ promise: e
1085
+ }, o.push(e);
1086
+ }
1087
+ }
1088
+ return Promise.all(o);
1089
+ }
1090
+ loadMesh(t) {
1091
+ let n = this, r = this.json, i = this.extensions, a = r.meshes[t], o = a.primitives, s = [];
1092
+ for (let e = 0, t = o.length; e < t; e++) {
1093
+ let t = o[e].material === void 0 ? nt(this.cache) : this.getDependency("material", o[e].material);
1094
+ s.push(t);
1095
+ }
1096
+ return s.push(n.loadGeometries(o)), Promise.all(s).then(function(r) {
1097
+ let s = r.slice(0, r.length - 1), c = r[r.length - 1], l = [];
1098
+ for (let r = 0, u = c.length; r < u; r++) {
1099
+ let u = c[r], d = o[r], f, p = s[r];
1100
+ if (d.mode === W.TRIANGLES || d.mode === W.TRIANGLE_STRIP || d.mode === W.TRIANGLE_FAN || d.mode === void 0) f = a.isSkinnedMesh === !0 ? new xe(u, p) : new ue(u, p), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), d.mode === W.TRIANGLE_STRIP ? f.geometry = e(f.geometry, Ee) : d.mode === W.TRIANGLE_FAN && (f.geometry = e(f.geometry, Te));
1101
+ else if (d.mode === W.LINES) f = new ae(u, p);
1102
+ else if (d.mode === W.LINE_STRIP) f = new ne(u, p);
1103
+ else if (d.mode === W.LINE_LOOP) f = new ie(u, p);
1104
+ else if (d.mode === W.POINTS) f = new _e(u, p);
1105
+ else throw Error("THREE.GLTFLoader: Primitive mode unsupported: " + d.mode);
1106
+ Object.keys(f.geometry.morphAttributes).length > 0 && it(f, a), f.name = n.createUniqueName(a.name || "mesh_" + t), Z(f, a), d.extensions && X(i, f, d), n.assignFinalMaterial(f), l.push(f);
1107
+ }
1108
+ for (let e = 0, r = l.length; e < r; e++) n.associations.set(l[e], {
1109
+ meshes: t,
1110
+ primitives: e
1111
+ });
1112
+ if (l.length === 1) return a.extensions && X(i, l[0], a), l[0];
1113
+ let u = new p();
1114
+ a.extensions && X(i, u, a), n.associations.set(u, { meshes: t });
1115
+ for (let e = 0, t = l.length; e < t; e++) u.add(l[e]);
1116
+ return u;
1117
+ });
1118
+ }
1119
+ loadCamera(e) {
1120
+ let t, n = this.json.cameras[e], r = n[n.type];
1121
+ if (!r) {
1122
+ console.warn("THREE.GLTFLoader: Missing camera parameters.");
1123
+ return;
1124
+ }
1125
+ return n.type === "perspective" ? t = new he(le.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new me(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Z(t, n), Promise.resolve(t);
1126
+ }
1127
+ loadSkin(e) {
1128
+ let t = this.json.skins[e], n = [];
1129
+ for (let e = 0, r = t.joints.length; e < r; e++) n.push(this._loadNodeShallow(t.joints[e]));
1130
+ return t.inverseBindMatrices === void 0 ? n.push(null) : n.push(this.getDependency("accessor", t.inverseBindMatrices)), Promise.all(n).then(function(e) {
1131
+ let n = e.pop(), r = e, i = [], a = [];
1132
+ for (let e = 0, o = r.length; e < o; e++) {
1133
+ let o = r[e];
1134
+ if (o) {
1135
+ i.push(o);
1136
+ let t = new w();
1137
+ n !== null && t.fromArray(n.array, e * 16), a.push(t);
1138
+ } else console.warn("THREE.GLTFLoader: Joint \"%s\" could not be found.", t.joints[e]);
1139
+ }
1140
+ return new be(i, a);
1141
+ });
1142
+ }
1143
+ loadAnimation(e) {
1144
+ let n = this.json, r = this, i = n.animations[e], a = i.name ? i.name : "animation_" + e, o = [], s = [], c = [], l = [], u = [];
1145
+ for (let e = 0, t = i.channels.length; e < t; e++) {
1146
+ let t = i.channels[e], n = i.samplers[t.sampler], r = t.target, a = r.node, d = i.parameters === void 0 ? n.input : i.parameters[n.input], f = i.parameters === void 0 ? n.output : i.parameters[n.output];
1147
+ r.node !== void 0 && (o.push(this.getDependency("node", a)), s.push(this.getDependency("accessor", d)), c.push(this.getDependency("accessor", f)), l.push(n), u.push(r));
1148
+ }
1149
+ return Promise.all([
1150
+ Promise.all(o),
1151
+ Promise.all(s),
1152
+ Promise.all(c),
1153
+ Promise.all(l),
1154
+ Promise.all(u)
1155
+ ]).then(function(e) {
1156
+ let n = e[0], o = e[1], s = e[2], c = e[3], l = e[4], u = [];
1157
+ for (let e = 0, t = n.length; e < t; e++) {
1158
+ let t = n[e], i = o[e], a = s[e], d = c[e], f = l[e];
1159
+ if (t === void 0) continue;
1160
+ t.updateMatrix && t.updateMatrix();
1161
+ let p = r._createAnimationTracks(t, i, a, d, f);
1162
+ if (p) for (let e = 0; e < p.length; e++) u.push(p[e]);
1163
+ }
1164
+ let d = new t(a, void 0, u);
1165
+ return Z(d, i), d;
1166
+ });
1167
+ }
1168
+ createNodeMesh(e) {
1169
+ let t = this.json, n = this, r = t.nodes[e];
1170
+ return r.mesh === void 0 ? null : n.getDependency("mesh", r.mesh).then(function(e) {
1171
+ let t = n._getNodeRef(n.meshCache, r.mesh, e);
1172
+ return r.weights !== void 0 && t.traverse(function(e) {
1173
+ if (e.isMesh) for (let t = 0, n = r.weights.length; t < n; t++) e.morphTargetInfluences[t] = r.weights[t];
1174
+ }), t;
1175
+ });
1176
+ }
1177
+ loadNode(e) {
1178
+ let t = this.json, n = this, r = t.nodes[e], i = n._loadNodeShallow(e), a = [], o = r.children || [];
1179
+ for (let e = 0, t = o.length; e < t; e++) a.push(n.getDependency("node", o[e]));
1180
+ let s = r.skin === void 0 ? Promise.resolve(null) : n.getDependency("skin", r.skin);
1181
+ return Promise.all([
1182
+ i,
1183
+ Promise.all(a),
1184
+ s
1185
+ ]).then(function(e) {
1186
+ let t = e[0], n = e[1], r = e[2];
1187
+ r !== null && t.traverse(function(e) {
1188
+ e.isSkinnedMesh && e.bind(r, st);
1189
+ });
1190
+ for (let e = 0, r = n.length; e < r; e++) t.add(n[e]);
1191
+ return t;
1192
+ });
1193
+ }
1194
+ _loadNodeShallow(e) {
1195
+ let t = this.json, r = this.extensions, i = this;
1196
+ if (this.nodeCache[e] !== void 0) return this.nodeCache[e];
1197
+ let a = t.nodes[e], o = a.name ? i.createUniqueName(a.name) : "", s = [], c = i._invokeOne(function(t) {
1198
+ return t.createNodeMesh && t.createNodeMesh(e);
1199
+ });
1200
+ return c && s.push(c), a.camera !== void 0 && s.push(i.getDependency("camera", a.camera).then(function(e) {
1201
+ return i._getNodeRef(i.cameraCache, a.camera, e);
1202
+ })), i._invokeAll(function(t) {
1203
+ return t.createNodeAttachment && t.createNodeAttachment(e);
1204
+ }).forEach(function(e) {
1205
+ s.push(e);
1206
+ }), this.nodeCache[e] = Promise.all(s).then(function(t) {
1207
+ let s;
1208
+ if (s = a.isBone === !0 ? new n() : t.length > 1 ? new p() : t.length === 1 ? t[0] : new A(), s !== t[0]) for (let e = 0, n = t.length; e < n; e++) s.add(t[e]);
1209
+ if (a.name && (s.userData.name = a.name, s.name = o), Z(s, a), a.extensions && X(r, s, a), a.matrix !== void 0) {
1210
+ let e = new w();
1211
+ e.fromArray(a.matrix), s.applyMatrix4(e);
1212
+ } else a.translation !== void 0 && s.position.fromArray(a.translation), a.rotation !== void 0 && s.quaternion.fromArray(a.rotation), a.scale !== void 0 && s.scale.fromArray(a.scale);
1213
+ if (!i.associations.has(s)) i.associations.set(s, {});
1214
+ else if (a.mesh !== void 0 && i.meshCache.refs[a.mesh] > 1) {
1215
+ let e = i.associations.get(s);
1216
+ i.associations.set(s, { ...e });
1217
+ }
1218
+ return i.associations.get(s).nodes = e, s;
1219
+ }), this.nodeCache[e];
1220
+ }
1221
+ loadScene(e) {
1222
+ let t = this.extensions, n = this.json.scenes[e], r = this, i = new p();
1223
+ n.name && (i.name = r.createUniqueName(n.name)), Z(i, n), n.extensions && X(t, i, n);
1224
+ let a = n.nodes || [], o = [];
1225
+ for (let e = 0, t = a.length; e < t; e++) o.push(r.getDependency("node", a[e]));
1226
+ return Promise.all(o).then(function(e) {
1227
+ for (let t = 0, n = e.length; t < n; t++) i.add(e[t]);
1228
+ return r.associations = ((e) => {
1229
+ let t = /* @__PURE__ */ new Map();
1230
+ for (let [e, n] of r.associations) (e instanceof C || e instanceof F) && t.set(e, n);
1231
+ return e.traverse((e) => {
1232
+ let n = r.associations.get(e);
1233
+ n != null && t.set(e, n);
1234
+ }), t;
1235
+ })(i), i;
1236
+ });
1237
+ }
1238
+ _createAnimationTracks(e, t, n, r, i) {
1239
+ let a = [], o = e.name ? e.name : e.uuid, s = [];
1240
+ J[i.path] === J.weights ? e.traverse(function(e) {
1241
+ e.morphTargetInfluences && s.push(e.name ? e.name : e.uuid);
1242
+ }) : s.push(o);
1243
+ let c;
1244
+ switch (J[i.path]) {
1245
+ case J.weights:
1246
+ c = k;
1247
+ break;
1248
+ case J.rotation:
1249
+ c = M;
1250
+ break;
1251
+ case J.translation:
1252
+ case J.scale:
1253
+ c = R;
1254
+ break;
1255
+ default:
1256
+ switch (n.itemSize) {
1257
+ case 1:
1258
+ c = k;
1259
+ break;
1260
+ default:
1261
+ c = R;
1262
+ break;
1263
+ }
1264
+ break;
1265
+ }
1266
+ let l = r.interpolation === void 0 ? y : tt[r.interpolation], u = this._getArrayFromAccessor(n);
1267
+ for (let e = 0, n = s.length; e < n; e++) {
1268
+ let n = new c(s[e] + "." + J[i.path], t.array, u, l);
1269
+ r.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(n), a.push(n);
1270
+ }
1271
+ return a;
1272
+ }
1273
+ _getArrayFromAccessor(e) {
1274
+ let t = e.array;
1275
+ if (e.normalized) {
1276
+ let e = $(t.constructor), n = new Float32Array(t.length);
1277
+ for (let r = 0, i = t.length; r < i; r++) n[r] = t[r] * e;
1278
+ t = n;
1279
+ }
1280
+ return t;
1281
+ }
1282
+ _createCubicSplineTrackInterpolant(e) {
1283
+ e.createInterpolant = function(e) {
1284
+ return new (this instanceof M ? Qe : U)(this.times, this.values, this.getValueSize() / 3, e);
1285
+ }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1286
+ }
1287
+ };
1288
+ function lt(e, t, n) {
1289
+ let i = t.attributes, a = new r();
1290
+ if (i.POSITION !== void 0) {
1291
+ let e = n.json.accessors[i.POSITION], t = e.min, r = e.max;
1292
+ if (t !== void 0 && r !== void 0) {
1293
+ if (a.set(new L(t[0], t[1], t[2]), new L(r[0], r[1], r[2])), e.normalized) {
1294
+ let t = $(G[e.componentType]);
1295
+ a.min.multiplyScalar(t), a.max.multiplyScalar(t);
1296
+ }
1297
+ } else {
1298
+ console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
1299
+ return;
1300
+ }
1301
+ } else return;
1302
+ let o = t.targets;
1303
+ if (o !== void 0) {
1304
+ let e = new L(), t = new L();
1305
+ for (let r = 0, i = o.length; r < i; r++) {
1306
+ let i = o[r];
1307
+ if (i.POSITION !== void 0) {
1308
+ let r = n.json.accessors[i.POSITION], a = r.min, o = r.max;
1309
+ if (a !== void 0 && o !== void 0) {
1310
+ if (t.setX(Math.max(Math.abs(a[0]), Math.abs(o[0]))), t.setY(Math.max(Math.abs(a[1]), Math.abs(o[1]))), t.setZ(Math.max(Math.abs(a[2]), Math.abs(o[2]))), r.normalized) {
1311
+ let e = $(G[r.componentType]);
1312
+ t.multiplyScalar(e);
1313
+ }
1314
+ e.max(t);
1315
+ } else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
1316
+ }
1317
+ }
1318
+ a.expandByVector(e);
1319
+ }
1320
+ e.boundingBox = a;
1321
+ let s = new Se();
1322
+ a.getCenter(s.center), s.radius = a.min.distanceTo(a.max) / 2, e.boundingSphere = s;
1323
+ }
1324
+ function ut(e, t, n) {
1325
+ let r = t.attributes, i = [];
1326
+ function a(t, r) {
1327
+ return n.getDependency("accessor", t).then(function(t) {
1328
+ e.setAttribute(r, t);
1329
+ });
1330
+ }
1331
+ for (let t in r) {
1332
+ let n = q[t] || t.toLowerCase();
1333
+ n in e.attributes || i.push(a(r[t], n));
1334
+ }
1335
+ if (t.indices !== void 0 && !e.index) {
1336
+ let r = n.getDependency("accessor", t.indices).then(function(t) {
1337
+ e.setIndex(t);
1338
+ });
1339
+ i.push(r);
1340
+ }
1341
+ return c.workingColorSpace !== x && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${c.workingColorSpace}" not supported.`), Z(e, t), lt(e, t, n), Promise.all(i).then(function() {
1342
+ return t.targets === void 0 ? e : rt(e, t.targets, n);
1343
+ });
1344
+ }
1345
+ //#endregion
1346
+ export { De as GLTFLoader };