@needle-tools/engine 4.11.5 → 4.12.0-next.ca2cebd

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 (477) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/components.needle.json +1 -1
  3. package/custom-elements.json +420 -0
  4. package/dist/generateMeshBVH.worker-mO20N_b8.js +21 -0
  5. package/dist/{gltf-progressive-GwdQV1Qx.umd.cjs → gltf-progressive-DWcmTMCh.umd.cjs} +1 -1
  6. package/dist/{gltf-progressive-CftVUJy3.min.js → gltf-progressive-DZrY8VT6.min.js} +2 -2
  7. package/dist/{gltf-progressive-BvlZQAkt.js → gltf-progressive-DgYz5BYa.js} +19 -19
  8. package/dist/loader.worker-Dip-PthR.js +23 -0
  9. package/dist/{needle-engine.bundle-DYdft7n9.min.js → needle-engine.bundle-4A5NjznD.min.js} +130 -135
  10. package/dist/{needle-engine.bundle-DMqWdPzL.umd.cjs → needle-engine.bundle-BJg4_HhU.umd.cjs} +138 -143
  11. package/dist/{needle-engine.bundle-DSm5itjo.js → needle-engine.bundle-CFkbGdL5.js} +4368 -4241
  12. package/dist/needle-engine.d.ts +18198 -1
  13. package/dist/needle-engine.js +336 -335
  14. package/dist/needle-engine.min.js +1 -1
  15. package/dist/needle-engine.umd.cjs +1 -1
  16. package/dist/{postprocessing-CJC0Npcd.js → postprocessing-BTW9pD_s.js} +1822 -1723
  17. package/dist/{postprocessing-DrM4PWU3.umd.cjs → postprocessing-CMgoN5t5.umd.cjs} +229 -158
  18. package/dist/{postprocessing-l7zsdO_Q.min.js → postprocessing-DYDtB188.min.js} +227 -156
  19. package/dist/rapier-B3oL1ap-.js +5217 -0
  20. package/dist/rapier-DJ-luMxr.min.js +1 -0
  21. package/dist/rapier-DQltNJbN.umd.cjs +1 -0
  22. package/dist/{three-BDW9I486.min.js → three-B7CT31Bt.min.js} +1 -5
  23. package/dist/{three-MHVqtJYj.js → three-DfMvBzXi.js} +0 -5
  24. package/dist/{three-examples-CgwGHSgz.umd.cjs → three-examples-CsW4_6LI.umd.cjs} +2 -7
  25. package/dist/{three-examples-fvEPSC8L.min.js → three-examples-D1P7eEhn.min.js} +2 -7
  26. package/dist/{three-examples-C5Ht-QFN.js → three-examples-D1SK93ek.js} +1 -7
  27. package/dist/{three-mesh-ui-BjWTTk1R.js → three-mesh-ui-C_uSB5dD.js} +1 -1
  28. package/dist/{three-mesh-ui-Bm32sS2a.umd.cjs → three-mesh-ui-DpATDXwU.umd.cjs} +1 -1
  29. package/dist/{three-mesh-ui-CLdkp21K.min.js → three-mesh-ui-LQ44s0AL.min.js} +1 -1
  30. package/dist/{three-iFaDq9U3.umd.cjs → three-qj71I7J3.umd.cjs} +2 -6
  31. package/dist/{vendor-CsyK1CFs.min.js → vendor-BKGa4GE0.min.js} +34 -39
  32. package/dist/{vendor-petGQl0N.js → vendor-D0zoswDa.js} +1626 -1605
  33. package/dist/{vendor-6kAXU6fm.umd.cjs → vendor-UCpFAwt1.umd.cjs} +30 -35
  34. package/lib/engine/api.d.ts +0 -1
  35. package/lib/engine/api.js +0 -1
  36. package/lib/engine/api.js.map +1 -1
  37. package/lib/engine/debug/debug_spector.d.ts +16 -0
  38. package/lib/engine/debug/debug_spector.js +28 -0
  39. package/lib/engine/debug/debug_spector.js.map +1 -0
  40. package/lib/engine/engine_application.d.ts +7 -0
  41. package/lib/engine/engine_application.js +8 -1
  42. package/lib/engine/engine_application.js.map +1 -1
  43. package/lib/engine/engine_context.js +4 -1
  44. package/lib/engine/engine_context.js.map +1 -1
  45. package/lib/engine/engine_license.js +1 -1
  46. package/lib/engine/engine_license.js.map +1 -1
  47. package/lib/engine/engine_physics.js +6 -2
  48. package/lib/engine/engine_physics.js.map +1 -1
  49. package/lib/engine/engine_physics_rapier.d.ts +11 -2
  50. package/lib/engine/engine_physics_rapier.js +9 -0
  51. package/lib/engine/engine_physics_rapier.js.map +1 -1
  52. package/lib/engine/engine_texture.d.ts +1 -1
  53. package/lib/engine/engine_tonemapping.d.ts +1 -1
  54. package/lib/engine/engine_types.d.ts +16 -0
  55. package/lib/engine/engine_typestore.d.ts +1 -0
  56. package/lib/engine/engine_typestore.js +5 -6
  57. package/lib/engine/engine_typestore.js.map +1 -1
  58. package/lib/engine/webcomponents/logo-element.d.ts +11 -0
  59. package/lib/engine/webcomponents/logo-element.js +6 -0
  60. package/lib/engine/webcomponents/logo-element.js.map +1 -1
  61. package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +24 -3
  62. package/lib/engine/webcomponents/needle menu/needle-menu.js +18 -3
  63. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  64. package/lib/engine/webcomponents/needle-button.d.ts +5 -0
  65. package/lib/engine/webcomponents/needle-button.js.map +1 -1
  66. package/lib/engine/webcomponents/needle-engine.d.ts +220 -8
  67. package/lib/engine/webcomponents/needle-engine.js +94 -13
  68. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  69. package/lib/engine/xr/NeedleXRSession.js +2 -1
  70. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  71. package/lib/engine-components/AlignmentConstraint.d.ts +8 -0
  72. package/lib/engine-components/AlignmentConstraint.js +8 -0
  73. package/lib/engine-components/AlignmentConstraint.js.map +1 -1
  74. package/lib/engine-components/Animation.d.ts +2 -0
  75. package/lib/engine-components/Animation.js +2 -0
  76. package/lib/engine-components/Animation.js.map +1 -1
  77. package/lib/engine-components/Animator.d.ts +2 -0
  78. package/lib/engine-components/Animator.js +1 -0
  79. package/lib/engine-components/Animator.js.map +1 -1
  80. package/lib/engine-components/AudioListener.d.ts +2 -0
  81. package/lib/engine-components/AudioListener.js +2 -0
  82. package/lib/engine-components/AudioListener.js.map +1 -1
  83. package/lib/engine-components/AudioSource.d.ts +1 -0
  84. package/lib/engine-components/AudioSource.js +1 -0
  85. package/lib/engine-components/AudioSource.js.map +1 -1
  86. package/lib/engine-components/AxesHelper.d.ts +2 -0
  87. package/lib/engine-components/AxesHelper.js +2 -0
  88. package/lib/engine-components/AxesHelper.js.map +1 -1
  89. package/lib/engine-components/BasicIKConstraint.d.ts +8 -0
  90. package/lib/engine-components/BasicIKConstraint.js +8 -0
  91. package/lib/engine-components/BasicIKConstraint.js.map +1 -1
  92. package/lib/engine-components/BoxHelperComponent.d.ts +1 -0
  93. package/lib/engine-components/BoxHelperComponent.js +1 -0
  94. package/lib/engine-components/BoxHelperComponent.js.map +1 -1
  95. package/lib/engine-components/Camera.d.ts +1 -0
  96. package/lib/engine-components/Camera.js +1 -0
  97. package/lib/engine-components/Camera.js.map +1 -1
  98. package/lib/engine-components/CharacterController.d.ts +4 -1
  99. package/lib/engine-components/CharacterController.js +4 -1
  100. package/lib/engine-components/CharacterController.js.map +1 -1
  101. package/lib/engine-components/Collider.d.ts +1 -1
  102. package/lib/engine-components/Collider.js +1 -1
  103. package/lib/engine-components/Component.d.ts +5 -0
  104. package/lib/engine-components/Component.js +7 -0
  105. package/lib/engine-components/Component.js.map +1 -1
  106. package/lib/engine-components/ContactShadows.d.ts +1 -1
  107. package/lib/engine-components/ContactShadows.js +1 -1
  108. package/lib/engine-components/DeleteBox.d.ts +2 -0
  109. package/lib/engine-components/DeleteBox.js +2 -0
  110. package/lib/engine-components/DeleteBox.js.map +1 -1
  111. package/lib/engine-components/DeviceFlag.d.ts +4 -0
  112. package/lib/engine-components/DeviceFlag.js +4 -0
  113. package/lib/engine-components/DeviceFlag.js.map +1 -1
  114. package/lib/engine-components/DragControls.d.ts +1 -0
  115. package/lib/engine-components/DragControls.js +1 -0
  116. package/lib/engine-components/DragControls.js.map +1 -1
  117. package/lib/engine-components/DropListener.d.ts +1 -0
  118. package/lib/engine-components/DropListener.js +1 -0
  119. package/lib/engine-components/DropListener.js.map +1 -1
  120. package/lib/engine-components/Duplicatable.d.ts +1 -0
  121. package/lib/engine-components/Duplicatable.js +1 -0
  122. package/lib/engine-components/Duplicatable.js.map +1 -1
  123. package/lib/engine-components/EventTrigger.d.ts +2 -0
  124. package/lib/engine-components/EventTrigger.js +2 -0
  125. package/lib/engine-components/EventTrigger.js.map +1 -1
  126. package/lib/engine-components/Gizmos.d.ts +2 -0
  127. package/lib/engine-components/Gizmos.js +2 -0
  128. package/lib/engine-components/Gizmos.js.map +1 -1
  129. package/lib/engine-components/GridHelper.d.ts +2 -0
  130. package/lib/engine-components/GridHelper.js +2 -0
  131. package/lib/engine-components/GridHelper.js.map +1 -1
  132. package/lib/engine-components/GroundProjection.d.ts +1 -0
  133. package/lib/engine-components/GroundProjection.js +1 -0
  134. package/lib/engine-components/GroundProjection.js.map +1 -1
  135. package/lib/engine-components/Joints.d.ts +6 -0
  136. package/lib/engine-components/Joints.js +6 -0
  137. package/lib/engine-components/Joints.js.map +1 -1
  138. package/lib/engine-components/LODGroup.d.ts +2 -0
  139. package/lib/engine-components/LODGroup.js +2 -0
  140. package/lib/engine-components/LODGroup.js.map +1 -1
  141. package/lib/engine-components/Light.d.ts +1 -0
  142. package/lib/engine-components/Light.js +1 -0
  143. package/lib/engine-components/Light.js.map +1 -1
  144. package/lib/engine-components/LookAtConstraint.d.ts +1 -0
  145. package/lib/engine-components/LookAtConstraint.js +1 -0
  146. package/lib/engine-components/LookAtConstraint.js.map +1 -1
  147. package/lib/engine-components/NeedleMenu.d.ts +1 -0
  148. package/lib/engine-components/NeedleMenu.js +1 -0
  149. package/lib/engine-components/NeedleMenu.js.map +1 -1
  150. package/lib/engine-components/NestedGltf.d.ts +1 -0
  151. package/lib/engine-components/NestedGltf.js +1 -0
  152. package/lib/engine-components/NestedGltf.js.map +1 -1
  153. package/lib/engine-components/Networking.d.ts +1 -0
  154. package/lib/engine-components/Networking.js +1 -0
  155. package/lib/engine-components/Networking.js.map +1 -1
  156. package/lib/engine-components/OffsetConstraint.d.ts +7 -0
  157. package/lib/engine-components/OffsetConstraint.js +7 -0
  158. package/lib/engine-components/OffsetConstraint.js.map +1 -1
  159. package/lib/engine-components/OrbitControls.d.ts +1 -0
  160. package/lib/engine-components/OrbitControls.js +1 -0
  161. package/lib/engine-components/OrbitControls.js.map +1 -1
  162. package/lib/engine-components/PlayerColor.d.ts +2 -0
  163. package/lib/engine-components/PlayerColor.js +2 -0
  164. package/lib/engine-components/PlayerColor.js.map +1 -1
  165. package/lib/engine-components/ReflectionProbe.d.ts +1 -0
  166. package/lib/engine-components/ReflectionProbe.js +1 -0
  167. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  168. package/lib/engine-components/RendererInstancing.d.ts +5 -3
  169. package/lib/engine-components/RendererInstancing.js +64 -31
  170. package/lib/engine-components/RendererInstancing.js.map +1 -1
  171. package/lib/engine-components/RigidBody.d.ts +1 -0
  172. package/lib/engine-components/RigidBody.js +1 -0
  173. package/lib/engine-components/RigidBody.js.map +1 -1
  174. package/lib/engine-components/SceneSwitcher.d.ts +1 -0
  175. package/lib/engine-components/SceneSwitcher.js +1 -0
  176. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  177. package/lib/engine-components/ScreenCapture.d.ts +1 -0
  178. package/lib/engine-components/ScreenCapture.js +1 -0
  179. package/lib/engine-components/ScreenCapture.js.map +1 -1
  180. package/lib/engine-components/SeeThrough.d.ts +1 -0
  181. package/lib/engine-components/SeeThrough.js +1 -0
  182. package/lib/engine-components/SeeThrough.js.map +1 -1
  183. package/lib/engine-components/ShadowCatcher.d.ts +2 -0
  184. package/lib/engine-components/ShadowCatcher.js +2 -0
  185. package/lib/engine-components/ShadowCatcher.js.map +1 -1
  186. package/lib/engine-components/Skybox.d.ts +16 -5
  187. package/lib/engine-components/Skybox.js +38 -25
  188. package/lib/engine-components/Skybox.js.map +1 -1
  189. package/lib/engine-components/SmoothFollow.d.ts +1 -0
  190. package/lib/engine-components/SmoothFollow.js +1 -0
  191. package/lib/engine-components/SmoothFollow.js.map +1 -1
  192. package/lib/engine-components/SpatialTrigger.d.ts +1 -0
  193. package/lib/engine-components/SpatialTrigger.js +1 -0
  194. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  195. package/lib/engine-components/SpectatorCamera.d.ts +1 -0
  196. package/lib/engine-components/SpectatorCamera.js +1 -0
  197. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  198. package/lib/engine-components/SpriteRenderer.d.ts +1 -0
  199. package/lib/engine-components/SpriteRenderer.js +1 -0
  200. package/lib/engine-components/SpriteRenderer.js.map +1 -1
  201. package/lib/engine-components/SyncedCamera.d.ts +2 -0
  202. package/lib/engine-components/SyncedCamera.js +2 -0
  203. package/lib/engine-components/SyncedCamera.js.map +1 -1
  204. package/lib/engine-components/SyncedRoom.d.ts +1 -0
  205. package/lib/engine-components/SyncedRoom.js +1 -0
  206. package/lib/engine-components/SyncedRoom.js.map +1 -1
  207. package/lib/engine-components/SyncedTransform.d.ts +2 -0
  208. package/lib/engine-components/SyncedTransform.js +2 -0
  209. package/lib/engine-components/SyncedTransform.js.map +1 -1
  210. package/lib/engine-components/TransformGizmo.d.ts +2 -0
  211. package/lib/engine-components/TransformGizmo.js +2 -0
  212. package/lib/engine-components/TransformGizmo.js.map +1 -1
  213. package/lib/engine-components/VideoPlayer.d.ts +1 -0
  214. package/lib/engine-components/VideoPlayer.js +1 -0
  215. package/lib/engine-components/VideoPlayer.js.map +1 -1
  216. package/lib/engine-components/Voip.d.ts +1 -0
  217. package/lib/engine-components/Voip.js +1 -0
  218. package/lib/engine-components/Voip.js.map +1 -1
  219. package/lib/engine-components/export/gltf/GltfExport.d.ts +5 -0
  220. package/lib/engine-components/export/gltf/GltfExport.js +5 -0
  221. package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
  222. package/lib/engine-components/export/usdz/USDZExporter.d.ts +25 -3
  223. package/lib/engine-components/export/usdz/USDZExporter.js +37 -2
  224. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  225. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +18 -0
  226. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +18 -0
  227. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
  228. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -0
  229. package/lib/engine-components/particlesystem/ParticleSystem.js +1 -0
  230. package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
  231. package/lib/engine-components/physics/Attractor.d.ts +3 -0
  232. package/lib/engine-components/physics/Attractor.js +3 -0
  233. package/lib/engine-components/physics/Attractor.js.map +1 -1
  234. package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -0
  235. package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -0
  236. package/lib/engine-components/postprocessing/Effects/BloomEffect.js.map +1 -1
  237. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +4 -0
  238. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +4 -0
  239. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js.map +1 -1
  240. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +3 -0
  241. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +3 -0
  242. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js.map +1 -1
  243. package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +4 -0
  244. package/lib/engine-components/postprocessing/Effects/DepthOfField.js +4 -0
  245. package/lib/engine-components/postprocessing/Effects/DepthOfField.js.map +1 -1
  246. package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
  247. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
  248. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
  249. package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +3 -0
  250. package/lib/engine-components/postprocessing/Effects/Pixelation.js +3 -0
  251. package/lib/engine-components/postprocessing/Effects/Pixelation.js.map +1 -1
  252. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +4 -0
  253. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +4 -0
  254. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js.map +1 -1
  255. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +4 -0
  256. package/lib/engine-components/postprocessing/Effects/Sharpening.js +4 -0
  257. package/lib/engine-components/postprocessing/Effects/Sharpening.js.map +1 -1
  258. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +4 -0
  259. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +4 -0
  260. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js.map +1 -1
  261. package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +4 -0
  262. package/lib/engine-components/postprocessing/Effects/Tonemapping.js +4 -0
  263. package/lib/engine-components/postprocessing/Effects/Tonemapping.js.map +1 -1
  264. package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +4 -0
  265. package/lib/engine-components/postprocessing/Effects/Vignette.js +4 -0
  266. package/lib/engine-components/postprocessing/Effects/Vignette.js.map +1 -1
  267. package/lib/engine-components/postprocessing/Volume.d.ts +1 -0
  268. package/lib/engine-components/postprocessing/Volume.js +1 -0
  269. package/lib/engine-components/postprocessing/Volume.js.map +1 -1
  270. package/lib/engine-components/splines/Spline.d.ts +1 -0
  271. package/lib/engine-components/splines/Spline.js +1 -0
  272. package/lib/engine-components/splines/Spline.js.map +1 -1
  273. package/lib/engine-components/splines/SplineWalker.d.ts +1 -0
  274. package/lib/engine-components/splines/SplineWalker.js +1 -0
  275. package/lib/engine-components/splines/SplineWalker.js.map +1 -1
  276. package/lib/engine-components/timeline/PlayableDirector.d.ts +1 -0
  277. package/lib/engine-components/timeline/PlayableDirector.js +1 -0
  278. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  279. package/lib/engine-components/timeline/SignalAsset.d.ts +1 -0
  280. package/lib/engine-components/timeline/SignalAsset.js +1 -0
  281. package/lib/engine-components/timeline/SignalAsset.js.map +1 -1
  282. package/lib/engine-components/ui/Button.d.ts +4 -0
  283. package/lib/engine-components/ui/Button.js +4 -0
  284. package/lib/engine-components/ui/Button.js.map +1 -1
  285. package/lib/engine-components/ui/Canvas.d.ts +5 -0
  286. package/lib/engine-components/ui/Canvas.js +5 -0
  287. package/lib/engine-components/ui/Canvas.js.map +1 -1
  288. package/lib/engine-components/ui/CanvasGroup.d.ts +4 -0
  289. package/lib/engine-components/ui/CanvasGroup.js +4 -0
  290. package/lib/engine-components/ui/CanvasGroup.js.map +1 -1
  291. package/lib/engine-components/ui/EventSystem.d.ts +2 -0
  292. package/lib/engine-components/ui/EventSystem.js +2 -0
  293. package/lib/engine-components/ui/EventSystem.js.map +1 -1
  294. package/lib/engine-components/ui/Image.d.ts +4 -0
  295. package/lib/engine-components/ui/Image.js +4 -0
  296. package/lib/engine-components/ui/Image.js.map +1 -1
  297. package/lib/engine-components/ui/InputField.d.ts +4 -0
  298. package/lib/engine-components/ui/InputField.js +4 -0
  299. package/lib/engine-components/ui/InputField.js.map +1 -1
  300. package/lib/engine-components/ui/Outline.d.ts +7 -0
  301. package/lib/engine-components/ui/Outline.js +7 -0
  302. package/lib/engine-components/ui/Outline.js.map +1 -1
  303. package/lib/engine-components/ui/SpatialHtml.d.ts +7 -0
  304. package/lib/engine-components/ui/SpatialHtml.js +7 -0
  305. package/lib/engine-components/ui/SpatialHtml.js.map +1 -1
  306. package/lib/engine-components/ui/Text.d.ts +3 -0
  307. package/lib/engine-components/ui/Text.js +3 -0
  308. package/lib/engine-components/ui/Text.js.map +1 -1
  309. package/lib/engine-components/utils/LookAt.d.ts +1 -0
  310. package/lib/engine-components/utils/LookAt.js +1 -0
  311. package/lib/engine-components/utils/LookAt.js.map +1 -1
  312. package/lib/engine-components/web/Clickthrough.d.ts +1 -1
  313. package/lib/engine-components/web/Clickthrough.js +1 -1
  314. package/lib/engine-components/web/CursorFollow.d.ts +2 -0
  315. package/lib/engine-components/web/CursorFollow.js +3 -0
  316. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  317. package/lib/engine-components/web/HoverAnimation.d.ts +1 -0
  318. package/lib/engine-components/web/HoverAnimation.js +1 -0
  319. package/lib/engine-components/web/HoverAnimation.js.map +1 -1
  320. package/lib/engine-components/web/ScrollFollow.d.ts +2 -0
  321. package/lib/engine-components/web/ScrollFollow.js +2 -0
  322. package/lib/engine-components/web/ScrollFollow.js.map +1 -1
  323. package/lib/engine-components/web/ViewBox.d.ts +1 -0
  324. package/lib/engine-components/web/ViewBox.js +1 -0
  325. package/lib/engine-components/web/ViewBox.js.map +1 -1
  326. package/lib/engine-components/webxr/Avatar.d.ts +5 -0
  327. package/lib/engine-components/webxr/Avatar.js +5 -0
  328. package/lib/engine-components/webxr/Avatar.js.map +1 -1
  329. package/lib/engine-components/webxr/WebARCameraBackground.d.ts +1 -0
  330. package/lib/engine-components/webxr/WebARCameraBackground.js +1 -0
  331. package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
  332. package/lib/engine-components/webxr/WebARSessionRoot.d.ts +1 -0
  333. package/lib/engine-components/webxr/WebARSessionRoot.js +1 -0
  334. package/lib/engine-components/webxr/WebARSessionRoot.js.map +1 -1
  335. package/lib/engine-components/webxr/WebXR.d.ts +1 -1
  336. package/lib/engine-components/webxr/WebXR.js +5 -1
  337. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  338. package/lib/engine-components/webxr/controllers/XRControllerFollow.d.ts +1 -0
  339. package/lib/engine-components/webxr/controllers/XRControllerFollow.js +1 -0
  340. package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
  341. package/lib/engine-components/webxr/controllers/XRControllerModel.d.ts +4 -0
  342. package/lib/engine-components/webxr/controllers/XRControllerModel.js +4 -0
  343. package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
  344. package/lib/engine-components/webxr/controllers/XRControllerMovement.d.ts +1 -0
  345. package/lib/engine-components/webxr/controllers/XRControllerMovement.js +1 -0
  346. package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
  347. package/lib/engine-components-experimental/networking/PlayerSync.d.ts +2 -0
  348. package/lib/engine-components-experimental/networking/PlayerSync.js +2 -0
  349. package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
  350. package/lib/needle-engine.js +2 -1
  351. package/lib/needle-engine.js.map +1 -1
  352. package/package.json +20 -13
  353. package/plugins/types/needleConfig.d.ts +1 -1
  354. package/plugins/types/next.d.ts +1 -1
  355. package/plugins/types/userconfig.d.ts +4 -1
  356. package/plugins/vite/custom-element-data.js +80 -0
  357. package/plugins/vite/index.js +4 -0
  358. package/src/engine/api.ts +0 -1
  359. package/src/engine/debug/debug_spector.ts +43 -0
  360. package/src/engine/engine_application.ts +16 -1
  361. package/src/engine/engine_context.ts +5 -1
  362. package/src/engine/engine_license.ts +1 -1
  363. package/src/engine/engine_physics.ts +6 -2
  364. package/src/engine/engine_physics_rapier.ts +11 -2
  365. package/src/engine/engine_texture.ts +1 -1
  366. package/src/engine/engine_tonemapping.ts +1 -1
  367. package/src/engine/engine_types.ts +17 -0
  368. package/src/engine/engine_typestore.ts +5 -6
  369. package/src/engine/webcomponents/logo-element.ts +12 -0
  370. package/src/engine/webcomponents/needle menu/needle-menu.ts +24 -3
  371. package/src/engine/webcomponents/needle-button.ts +6 -0
  372. package/src/engine/webcomponents/needle-engine.ts +331 -22
  373. package/src/engine/xr/NeedleXRSession.ts +3 -1
  374. package/src/engine-components/AlignmentConstraint.ts +8 -0
  375. package/src/engine-components/Animation.ts +2 -0
  376. package/src/engine-components/Animator.ts +2 -0
  377. package/src/engine-components/AudioListener.ts +2 -0
  378. package/src/engine-components/AudioSource.ts +1 -0
  379. package/src/engine-components/AxesHelper.ts +2 -0
  380. package/src/engine-components/BasicIKConstraint.ts +8 -0
  381. package/src/engine-components/BoxHelperComponent.ts +1 -0
  382. package/src/engine-components/Camera.ts +1 -0
  383. package/src/engine-components/CharacterController.ts +4 -1
  384. package/src/engine-components/Collider.ts +1 -1
  385. package/src/engine-components/Component.ts +9 -1
  386. package/src/engine-components/ContactShadows.ts +1 -1
  387. package/src/engine-components/DeleteBox.ts +2 -0
  388. package/src/engine-components/DeviceFlag.ts +4 -0
  389. package/src/engine-components/DragControls.ts +1 -0
  390. package/src/engine-components/DropListener.ts +1 -0
  391. package/src/engine-components/Duplicatable.ts +1 -0
  392. package/src/engine-components/EventTrigger.ts +2 -0
  393. package/src/engine-components/Gizmos.ts +2 -0
  394. package/src/engine-components/GridHelper.ts +2 -0
  395. package/src/engine-components/GroundProjection.ts +1 -0
  396. package/src/engine-components/Joints.ts +6 -0
  397. package/src/engine-components/LODGroup.ts +2 -0
  398. package/src/engine-components/Light.ts +1 -0
  399. package/src/engine-components/LookAtConstraint.ts +1 -0
  400. package/src/engine-components/NeedleMenu.ts +1 -0
  401. package/src/engine-components/NestedGltf.ts +1 -0
  402. package/src/engine-components/Networking.ts +1 -0
  403. package/src/engine-components/OffsetConstraint.ts +7 -0
  404. package/src/engine-components/OrbitControls.ts +1 -0
  405. package/src/engine-components/PlayerColor.ts +2 -0
  406. package/src/engine-components/ReflectionProbe.ts +1 -0
  407. package/src/engine-components/RendererInstancing.ts +69 -33
  408. package/src/engine-components/RigidBody.ts +1 -0
  409. package/src/engine-components/SceneSwitcher.ts +1 -0
  410. package/src/engine-components/ScreenCapture.ts +1 -0
  411. package/src/engine-components/SeeThrough.ts +1 -0
  412. package/src/engine-components/ShadowCatcher.ts +2 -0
  413. package/src/engine-components/Skybox.ts +48 -36
  414. package/src/engine-components/SmoothFollow.ts +1 -0
  415. package/src/engine-components/SpatialTrigger.ts +1 -0
  416. package/src/engine-components/SpectatorCamera.ts +1 -0
  417. package/src/engine-components/SpriteRenderer.ts +1 -0
  418. package/src/engine-components/SyncedCamera.ts +2 -0
  419. package/src/engine-components/SyncedRoom.ts +1 -0
  420. package/src/engine-components/SyncedTransform.ts +2 -0
  421. package/src/engine-components/TransformGizmo.ts +2 -0
  422. package/src/engine-components/VideoPlayer.ts +1 -0
  423. package/src/engine-components/Voip.ts +1 -0
  424. package/src/engine-components/export/gltf/GltfExport.ts +5 -0
  425. package/src/engine-components/export/usdz/USDZExporter.ts +53 -5
  426. package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +18 -0
  427. package/src/engine-components/particlesystem/ParticleSystem.ts +1 -0
  428. package/src/engine-components/physics/Attractor.ts +3 -0
  429. package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -0
  430. package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +4 -0
  431. package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +3 -0
  432. package/src/engine-components/postprocessing/Effects/DepthOfField.ts +4 -0
  433. package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
  434. package/src/engine-components/postprocessing/Effects/Pixelation.ts +3 -0
  435. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +4 -0
  436. package/src/engine-components/postprocessing/Effects/Sharpening.ts +4 -0
  437. package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +4 -0
  438. package/src/engine-components/postprocessing/Effects/Tonemapping.ts +4 -0
  439. package/src/engine-components/postprocessing/Effects/Vignette.ts +4 -0
  440. package/src/engine-components/postprocessing/Volume.ts +1 -0
  441. package/src/engine-components/splines/Spline.ts +1 -0
  442. package/src/engine-components/splines/SplineWalker.ts +1 -0
  443. package/src/engine-components/timeline/PlayableDirector.ts +1 -0
  444. package/src/engine-components/timeline/SignalAsset.ts +1 -0
  445. package/src/engine-components/ui/Button.ts +4 -0
  446. package/src/engine-components/ui/Canvas.ts +5 -0
  447. package/src/engine-components/ui/CanvasGroup.ts +4 -0
  448. package/src/engine-components/ui/EventSystem.ts +2 -0
  449. package/src/engine-components/ui/Image.ts +4 -0
  450. package/src/engine-components/ui/InputField.ts +4 -0
  451. package/src/engine-components/ui/Outline.ts +7 -0
  452. package/src/engine-components/ui/SpatialHtml.ts +7 -0
  453. package/src/engine-components/ui/Text.ts +3 -0
  454. package/src/engine-components/utils/LookAt.ts +1 -0
  455. package/src/engine-components/web/Clickthrough.ts +1 -1
  456. package/src/engine-components/web/CursorFollow.ts +4 -0
  457. package/src/engine-components/web/HoverAnimation.ts +1 -0
  458. package/src/engine-components/web/ScrollFollow.ts +2 -0
  459. package/src/engine-components/web/ViewBox.ts +1 -0
  460. package/src/engine-components/webxr/Avatar.ts +5 -0
  461. package/src/engine-components/webxr/WebARCameraBackground.ts +1 -0
  462. package/src/engine-components/webxr/WebARSessionRoot.ts +1 -0
  463. package/src/engine-components/webxr/WebXR.ts +5 -1
  464. package/src/engine-components/webxr/controllers/XRControllerFollow.ts +1 -0
  465. package/src/engine-components/webxr/controllers/XRControllerModel.ts +4 -0
  466. package/src/engine-components/webxr/controllers/XRControllerMovement.ts +1 -0
  467. package/src/engine-components-experimental/networking/PlayerSync.ts +2 -0
  468. package/src/needle-engine.ts +4 -2
  469. package/dist/generateMeshBVH.worker-B9bjdr6J.js +0 -25
  470. package/dist/loader.worker-CiTwpNPW.js +0 -27
  471. package/dist/rapier-BqdcSmKY.umd.cjs +0 -1
  472. package/dist/rapier-Cg3w3nFI.min.js +0 -1
  473. package/dist/rapier-sU12SWAs.js +0 -5217
  474. package/lib/engine/webcomponents/needle-engine.attributes.d.ts +0 -70
  475. package/lib/engine/webcomponents/needle-engine.attributes.js +0 -2
  476. package/lib/engine/webcomponents/needle-engine.attributes.js.map +0 -1
  477. package/src/engine/webcomponents/needle-engine.attributes.ts +0 -85
@@ -1,8 +1,4 @@
1
- "use strict";var mo=typeof document<"u"?document.currentScript:null;/**
2
- * @license
3
- * Copyright 2010-2024 Three.js Authors
4
- * SPDX-License-Identifier: MIT
5
- */const Ks="169",G_={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},H_={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},W_=0,sf=1,X_=2,tA=3,nA=0,Lf=1,Df=2,oi=3,fs=0,ln=1,Ji=2,Fi=0,Ps=1,cc=2,rf=3,of=4,Uf=5,Zs=100,q_=101,$_=102,Y_=103,Ff=104,Z_=200,J_=201,K_=202,j_=203,Ou=204,Vu=205,Q_=206,ey=207,ty=208,ny=209,iy=210,sy=211,ry=212,oy=213,ay=214,lc=0,uc=1,hc=2,nr=3,dc=4,pc=5,fc=6,mc=7,fa=0,Of=1,Vf=2,Ti=0,Ah=1,Nh=2,Bf=3,Eh=4,cy=5,Ch=6,Rh=7,af="attached",ly="detached",Ih=300,wi=301,Vi=302,ir=303,sr=304,hr=306,rr=1e3,Si=1001,ea=1002,Qt=1003,Ph=1004,iA=1004,Cs=1005,sA=1005,Ut=1006,js=1007,rA=1007,Jn=1008,uy=1008,es=1009,zf=1010,kf=1011,ta=1012,ma=1013,Bi=1014,Gn=1015,Ln=1016,Lh=1017,Dh=1018,or=1020,Uh=35902,Fh=35899,Gf=1021,Oh=1022,Rn=1023,Hf=1024,Wf=1025,Qs=1026,ar=1027,Hc=1028,Wc=1029,na=1030,Vh=1031,oA=1032,Bh=1033,$o=33776,Yo=33777,Zo=33778,Jo=33779,gc=35840,Bu=35841,xc=35842,zu=35843,_c=36196,yc=37492,vc=37496,Mc=37808,ku=37809,Gu=37810,Hu=37811,Sc=37812,Wu=37813,Xu=37814,qu=37815,$u=37816,Yu=37817,Zu=37818,Ju=37819,Ku=37820,ju=37821,Ko=36492,Qu=36494,Tc=36495,Xf=36283,eh=36284,th=36285,nh=36286,qf=2200,$f=2201,hy=2202,ia=2300,bc=2301,Eu=2302,zr=2400,kr=2401,wc=2402,zh=2500,Yf=2501,dy=0,py=1,fy=2,Zf=3200,Jf=3201,aA=3202,cA=3203,ms=0,Kf=1,Li="",kn="srgb",li="srgb-linear",kh="display-p3",Xc="display-p3-linear",Ac="linear",Vt="srgb",Nc="rec709",Ec="p3",my=0,$s=7680,gy=7681,xy=7682,_y=7683,yy=34055,vy=34056,My=5386,Sy=512,Ty=513,by=514,wy=515,Ay=516,Ny=517,Ey=518,ih=519,Cy=512,jf=513,Ry=514,Qf=515,Iy=516,Py=517,Ly=518,Dy=519,sa=35044,Gr=35048,lA=35040,uA=35045,hA=35049,dA=35041,pA=35046,fA=35050,mA=35042,gA="100",sh="300 es",Di=2e3,Qr=2001;class Ai{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,o=i.length;r<o;r++)i[r].call(this,e);e.target=null}}}const Vn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let _0=1234567;const $r=Math.PI/180,ra=180/Math.PI;function bi(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Vn[s&255]+Vn[s>>8&255]+Vn[s>>16&255]+Vn[s>>24&255]+"-"+Vn[e&255]+Vn[e>>8&255]+"-"+Vn[e>>16&15|64]+Vn[e>>24&255]+"-"+Vn[t&63|128]+Vn[t>>8&255]+"-"+Vn[t>>16&255]+Vn[t>>24&255]+Vn[n&255]+Vn[n>>8&255]+Vn[n>>16&255]+Vn[n>>24&255]).toLowerCase()}function jt(s,e,t){return Math.max(e,Math.min(t,s))}function em(s,e){return(s%e+e)%e}function xA(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function _A(s,e,t){return s!==e?(t-s)/(e-s):0}function Ka(s,e,t){return(1-t)*s+t*e}function yA(s,e,t,n){return Ka(s,e,1-Math.exp(-t*n))}function vA(s,e=1){return e-Math.abs(em(s,e*2)-e)}function MA(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function SA(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function TA(s,e){return s+Math.floor(Math.random()*(e-s+1))}function bA(s,e){return s+Math.random()*(e-s)}function wA(s){return s*(.5-Math.random())}function AA(s){s!==void 0&&(_0=s);let e=_0+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function NA(s){return s*$r}function EA(s){return s*ra}function CA(s){return(s&s-1)===0&&s!==0}function RA(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function IA(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function PA(s,e,t,n,i){const r=Math.cos,o=Math.sin,a=r(t/2),c=o(t/2),l=r((e+n)/2),u=o((e+n)/2),h=r((e-n)/2),d=o((e-n)/2),p=r((n-e)/2),f=o((n-e)/2);switch(i){case"XYX":s.set(a*u,c*h,c*d,a*l);break;case"YZY":s.set(c*d,a*u,c*h,a*l);break;case"ZXZ":s.set(c*h,c*d,a*u,a*l);break;case"XZX":s.set(a*u,c*f,c*p,a*l);break;case"YXY":s.set(c*p,a*u,c*f,a*l);break;case"ZYZ":s.set(c*f,c*p,a*u,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Yn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function ut(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Gh={DEG2RAD:$r,RAD2DEG:ra,generateUUID:bi,clamp:jt,euclideanModulo:em,mapLinear:xA,inverseLerp:_A,lerp:Ka,damp:yA,pingpong:vA,smoothstep:MA,smootherstep:SA,randInt:TA,randFloat:bA,randFloatSpread:wA,seededRandom:AA,degToRad:NA,radToDeg:EA,isPowerOfTwo:CA,ceilPowerOfTwo:RA,floorPowerOfTwo:IA,setQuaternionFromProperEuler:PA,normalize:ut,denormalize:Yn};class J{constructor(e=0,t=0){J.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(jt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*n-o*i+e.x,this.y=r*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ke{constructor(e,t,n,i,r,o,a,c,l){Ke.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,o,a,c,l)}set(e,t,n,i,r,o,a,c,l){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=r,u[5]=c,u[6]=n,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],u=n[4],h=n[7],d=n[2],p=n[5],f=n[8],x=i[0],m=i[3],g=i[6],y=i[1],_=i[4],v=i[7],I=i[2],T=i[5],w=i[8];return r[0]=o*x+a*y+c*I,r[3]=o*m+a*_+c*T,r[6]=o*g+a*v+c*w,r[1]=l*x+u*y+h*I,r[4]=l*m+u*_+h*T,r[7]=l*g+u*v+h*w,r[2]=d*x+p*y+f*I,r[5]=d*m+p*_+f*T,r[8]=d*g+p*v+f*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return t*o*u-t*a*l-n*r*u+n*a*c+i*r*l-i*o*c}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=u*o-a*l,d=a*c-u*r,p=l*r-o*c,f=t*h+n*d+i*p;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/f;return e[0]=h*x,e[1]=(i*l-u*n)*x,e[2]=(a*n-i*o)*x,e[3]=d*x,e[4]=(u*t-i*c)*x,e[5]=(i*r-a*t)*x,e[6]=p*x,e[7]=(n*c-l*t)*x,e[8]=(o*t-n*r)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,o,a){const c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*o+l*a)+o+e,-i*l,i*c,-i*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(qd.makeScale(e,t)),this}rotate(e){return this.premultiply(qd.makeRotation(-e)),this}translate(e,t){return this.premultiply(qd.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const qd=new Ke;function Uy(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}const LA={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ko(s,e){return new LA[s](e)}function Cc(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Fy(){const s=Cc("canvas");return s.style.display="block",s}const y0={};function Cu(s){s in y0||(y0[s]=!0,console.warn(s))}function DA(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function UA(s){const e=s.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function FA(s){const e=s.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const v0=new Ke().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),M0=new Ke().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ca={[li]:{transfer:Ac,primaries:Nc,luminanceCoefficients:[.2126,.7152,.0722],toReference:s=>s,fromReference:s=>s},[kn]:{transfer:Vt,primaries:Nc,luminanceCoefficients:[.2126,.7152,.0722],toReference:s=>s.convertSRGBToLinear(),fromReference:s=>s.convertLinearToSRGB()},[Xc]:{transfer:Ac,primaries:Ec,luminanceCoefficients:[.2289,.6917,.0793],toReference:s=>s.applyMatrix3(M0),fromReference:s=>s.applyMatrix3(v0)},[kh]:{transfer:Vt,primaries:Ec,luminanceCoefficients:[.2289,.6917,.0793],toReference:s=>s.convertSRGBToLinear().applyMatrix3(M0),fromReference:s=>s.applyMatrix3(v0).convertLinearToSRGB()}},OA=new Set([li,Xc]),gt={enabled:!0,_workingColorSpace:li,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(s){if(!OA.has(s))throw new Error(`Unsupported working color space, "${s}".`);this._workingColorSpace=s},convert:function(s,e,t){if(this.enabled===!1||e===t||!e||!t)return s;const n=Ca[e].toReference,i=Ca[t].fromReference;return i(n(s))},fromWorkingColorSpace:function(s,e){return this.convert(s,this._workingColorSpace,e)},toWorkingColorSpace:function(s,e){return this.convert(s,e,this._workingColorSpace)},getPrimaries:function(s){return Ca[s].primaries},getTransfer:function(s){return s===Li?Ac:Ca[s].transfer},getLuminanceCoefficients:function(s,e=this._workingColorSpace){return s.fromArray(Ca[e].luminanceCoefficients)}};function jo(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function $d(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let go;class Oy{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{go===void 0&&(go=Cc("canvas")),go.width=e.width,go.height=e.height;const n=go.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=go}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Cc("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let o=0;o<r.length;o++)r[o]=jo(r[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(jo(t[n]/255)*255):t[n]=jo(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let VA=0;class Js{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:VA++}),this.uuid=bi(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?r.push(Yd(i[o].image)):r.push(Yd(i[o]))}else r=Yd(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function Yd(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Oy.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let BA=0;class Xt extends Ai{constructor(e=Xt.DEFAULT_IMAGE,t=Xt.DEFAULT_MAPPING,n=Si,i=Si,r=Ut,o=Jn,a=Rn,c=es,l=Xt.DEFAULT_ANISOTROPY,u=Li){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:BA++}),this.uuid=bi(),this.name="",this.source=new Js(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=c,this.offset=new J(0,0),this.repeat=new J(1,1),this.center=new J(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ke,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ih)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case rr:e.x=e.x-Math.floor(e.x);break;case Si:e.x=e.x<0?0:1;break;case ea:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case rr:e.y=e.y-Math.floor(e.y);break;case Si:e.y=e.y<0?0:1;break;case ea:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Xt.DEFAULT_IMAGE=null;Xt.DEFAULT_MAPPING=Ih;Xt.DEFAULT_ANISOTROPY=4;class st{constructor(e=0,t=0,n=0,i=1){st.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const c=e.elements,l=c[0],u=c[4],h=c[8],d=c[1],p=c[5],f=c[9],x=c[2],m=c[6],g=c[10];if(Math.abs(u-d)<.01&&Math.abs(h-x)<.01&&Math.abs(f-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+x)<.1&&Math.abs(f+m)<.1&&Math.abs(l+p+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(l+1)/2,v=(p+1)/2,I=(g+1)/2,T=(u+d)/4,w=(h+x)/4,C=(f+m)/4;return _>v&&_>I?_<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(_),i=T/n,r=w/n):v>I?v<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(v),n=T/i,r=C/i):I<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(I),n=w/r,i=C/r),this.set(n,i,r,t),this}let y=Math.sqrt((m-f)*(m-f)+(h-x)*(h-x)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-f)/y,this.y=(h-x)/y,this.z=(d-u)/y,this.w=Math.acos((l+p+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class fn extends Ai{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new st(0,0,e,t),this.scissorTest=!1,this.viewport=new st(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ut,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Xt(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let a=0;a<o;a++)this.textures[a]=r.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Js(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class zi extends fn{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class qc extends Xt{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Qt,this.minFilter=Qt,this.wrapR=Si,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class zA extends zi{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new qc(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Hh extends Xt{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Qt,this.minFilter=Qt,this.wrapR=Si,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class kA extends zi{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Hh(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Qn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,o,a){let c=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const d=r[o+0],p=r[o+1],f=r[o+2],x=r[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=d,e[t+1]=p,e[t+2]=f,e[t+3]=x;return}if(h!==x||c!==d||l!==p||u!==f){let m=1-a;const g=c*d+l*p+u*f+h*x,y=g>=0?1:-1,_=1-g*g;if(_>Number.EPSILON){const I=Math.sqrt(_),T=Math.atan2(I,g*y);m=Math.sin(m*T)/I,a=Math.sin(a*T)/I}const v=a*y;if(c=c*m+d*v,l=l*m+p*v,u=u*m+f*v,h=h*m+x*v,m===1-a){const I=1/Math.sqrt(c*c+l*l+u*u+h*h);c*=I,l*=I,u*=I,h*=I}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,r,o){const a=n[i],c=n[i+1],l=n[i+2],u=n[i+3],h=r[o],d=r[o+1],p=r[o+2],f=r[o+3];return e[t]=a*f+u*h+c*p-l*d,e[t+1]=c*f+u*d+l*h-a*p,e[t+2]=l*f+u*p+a*d-c*h,e[t+3]=u*f-a*h-c*d-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),d=c(n/2),p=c(i/2),f=c(r/2);switch(o){case"XYZ":this._x=d*u*h+l*p*f,this._y=l*p*h-d*u*f,this._z=l*u*f+d*p*h,this._w=l*u*h-d*p*f;break;case"YXZ":this._x=d*u*h+l*p*f,this._y=l*p*h-d*u*f,this._z=l*u*f-d*p*h,this._w=l*u*h+d*p*f;break;case"ZXY":this._x=d*u*h-l*p*f,this._y=l*p*h+d*u*f,this._z=l*u*f+d*p*h,this._w=l*u*h-d*p*f;break;case"ZYX":this._x=d*u*h-l*p*f,this._y=l*p*h+d*u*f,this._z=l*u*f-d*p*h,this._w=l*u*h+d*p*f;break;case"YZX":this._x=d*u*h+l*p*f,this._y=l*p*h+d*u*f,this._z=l*u*f-d*p*h,this._w=l*u*h-d*p*f;break;case"XZY":this._x=d*u*h-l*p*f,this._y=l*p*h-d*u*f,this._z=l*u*f+d*p*h,this._w=l*u*h+d*p*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],o=t[1],a=t[5],c=t[9],l=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-c)*p,this._y=(r-l)*p,this._z=(o-i)*p}else if(n>a&&n>h){const p=2*Math.sqrt(1+n-a-h);this._w=(u-c)/p,this._x=.25*p,this._y=(i+o)/p,this._z=(r+l)/p}else if(a>h){const p=2*Math.sqrt(1+a-n-h);this._w=(r-l)/p,this._x=(i+o)/p,this._y=.25*p,this._z=(c+u)/p}else{const p=2*Math.sqrt(1+h-n-a);this._w=(o-i)/p,this._x=(r+l)/p,this._y=(c+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(jt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,o=e._w,a=t._x,c=t._y,l=t._z,u=t._w;return this._x=n*u+o*a+i*l-r*c,this._y=i*u+o*c+r*a-n*l,this._z=r*u+o*l+n*c-i*a,this._w=o*u-n*a-i*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*e._w+n*e._x+i*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const p=1-t;return this._w=p*o+t*this._w,this._x=p*n+t*this._x,this._y=p*i+t*this._y,this._z=p*r+t*this._z,this.normalize(),this}const l=Math.sqrt(c),u=Math.atan2(l,a),h=Math.sin((1-t)*u)/l,d=Math.sin(t*u)/l;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class E{constructor(e=0,t=0,n=0){E.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(S0.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(S0.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,o=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*i-a*n),u=2*(a*t-r*i),h=2*(r*n-o*t);return this.x=t+c*l+o*h-a*u,this.y=n+c*u+a*l-r*h,this.z=i+c*h+r*u-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,o=t.x,a=t.y,c=t.z;return this.x=i*c-r*a,this.y=r*o-n*c,this.z=n*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Zd.copy(this).projectOnVector(e),this.sub(Zd)}reflect(e){return this.sub(Zd.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(jt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Zd=new E,S0=new Qn;class Hn{constructor(e=new E(1/0,1/0,1/0),t=new E(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=qi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=r.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,qi):qi.fromBufferAttribute(r,o),qi.applyMatrix4(e.matrixWorld),this.expandByPoint(qi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),wl.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),wl.copy(n.boundingBox)),wl.applyMatrix4(e.matrixWorld),this.union(wl)}const i=e.children;for(let r=0,o=i.length;r<o;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qi),qi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ra),Al.subVectors(this.max,Ra),xo.subVectors(e.a,Ra),_o.subVectors(e.b,Ra),yo.subVectors(e.c,Ra),Bs.subVectors(_o,xo),zs.subVectors(yo,_o),Mr.subVectors(xo,yo);let t=[0,-Bs.z,Bs.y,0,-zs.z,zs.y,0,-Mr.z,Mr.y,Bs.z,0,-Bs.x,zs.z,0,-zs.x,Mr.z,0,-Mr.x,-Bs.y,Bs.x,0,-zs.y,zs.x,0,-Mr.y,Mr.x,0];return!Jd(t,xo,_o,yo,Al)||(t=[1,0,0,0,1,0,0,0,1],!Jd(t,xo,_o,yo,Al))?!1:(Nl.crossVectors(Bs,zs),t=[Nl.x,Nl.y,Nl.z],Jd(t,xo,_o,yo,Al))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ms[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ms[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ms[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ms[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ms[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ms[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ms[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ms[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ms),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ms=[new E,new E,new E,new E,new E,new E,new E,new E],qi=new E,wl=new Hn,xo=new E,_o=new E,yo=new E,Bs=new E,zs=new E,Mr=new E,Ra=new E,Al=new E,Nl=new E,Sr=new E;function Jd(s,e,t,n,i){for(let r=0,o=s.length-3;r<=o;r+=3){Sr.fromArray(s,r);const a=i.x*Math.abs(Sr.x)+i.y*Math.abs(Sr.y)+i.z*Math.abs(Sr.z),c=e.dot(Sr),l=t.dot(Sr),u=n.dot(Sr);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>a)return!1}return!0}const GA=new Hn,Ia=new E,Kd=new E;class Dn{constructor(e=new E,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):GA.setFromPoints(e).getCenter(n);let i=0;for(let r=0,o=e.length;r<o;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ia.subVectors(e,this.center);const t=Ia.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Ia,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Kd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ia.copy(e.center).add(Kd)),this.expandByPoint(Ia.copy(e.center).sub(Kd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ss=new E,jd=new E,El=new E,ks=new E,Qd=new E,Cl=new E,ep=new E;class io{constructor(e=new E,t=new E(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ss)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ss.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ss.copy(this.origin).addScaledVector(this.direction,t),Ss.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){jd.copy(e).add(t).multiplyScalar(.5),El.copy(t).sub(e).normalize(),ks.copy(this.origin).sub(jd);const r=e.distanceTo(t)*.5,o=-this.direction.dot(El),a=ks.dot(this.direction),c=-ks.dot(El),l=ks.lengthSq(),u=Math.abs(1-o*o);let h,d,p,f;if(u>0)if(h=o*c-a,d=o*a-c,f=r*u,h>=0)if(d>=-f)if(d<=f){const x=1/u;h*=x,d*=x,p=h*(h+o*d+2*a)+d*(o*h+d+2*c)+l}else d=r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*c)+l;else d=-r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*c)+l;else d<=-f?(h=Math.max(0,-(-o*r+a)),d=h>0?-r:Math.min(Math.max(-r,-c),r),p=-h*h+d*(d+2*c)+l):d<=f?(h=0,d=Math.min(Math.max(-r,-c),r),p=d*(d+2*c)+l):(h=Math.max(0,-(o*r+a)),d=h>0?r:Math.min(Math.max(-r,-c),r),p=-h*h+d*(d+2*c)+l);else d=o>0?-r:r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(jd).addScaledVector(El,d),p}intersectSphere(e,t){Ss.subVectors(e.center,this.origin);const n=Ss.dot(this.direction),i=Ss.dot(Ss)-n*n,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=n-o,c=n+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,o,a,c;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||r>i||((r>n||isNaN(n))&&(n=r),(o<i||isNaN(i))&&(i=o),h>=0?(a=(e.min.z-d.z)*h,c=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,c=(e.min.z-d.z)*h),n>c||a>i)||((a>n||n!==n)&&(n=a),(c<i||i!==i)&&(i=c),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Ss)!==null}intersectTriangle(e,t,n,i,r){Qd.subVectors(t,e),Cl.subVectors(n,e),ep.crossVectors(Qd,Cl);let o=this.direction.dot(ep),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ks.subVectors(this.origin,e);const c=a*this.direction.dot(Cl.crossVectors(ks,Cl));if(c<0)return null;const l=a*this.direction.dot(Qd.cross(ks));if(l<0||c+l>o)return null;const u=-a*ks.dot(ep);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Fe{constructor(e,t,n,i,r,o,a,c,l,u,h,d,p,f,x,m){Fe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,o,a,c,l,u,h,d,p,f,x,m)}set(e,t,n,i,r,o,a,c,l,u,h,d,p,f,x,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=c,g[2]=l,g[6]=u,g[10]=h,g[14]=d,g[3]=p,g[7]=f,g[11]=x,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Fe().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/vo.setFromMatrixColumn(e,0).length(),r=1/vo.setFromMatrixColumn(e,1).length(),o=1/vo.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const d=o*u,p=o*h,f=a*u,x=a*h;t[0]=c*u,t[4]=-c*h,t[8]=l,t[1]=p+f*l,t[5]=d-x*l,t[9]=-a*c,t[2]=x-d*l,t[6]=f+p*l,t[10]=o*c}else if(e.order==="YXZ"){const d=c*u,p=c*h,f=l*u,x=l*h;t[0]=d+x*a,t[4]=f*a-p,t[8]=o*l,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=p*a-f,t[6]=x+d*a,t[10]=o*c}else if(e.order==="ZXY"){const d=c*u,p=c*h,f=l*u,x=l*h;t[0]=d-x*a,t[4]=-o*h,t[8]=f+p*a,t[1]=p+f*a,t[5]=o*u,t[9]=x-d*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const d=o*u,p=o*h,f=a*u,x=a*h;t[0]=c*u,t[4]=f*l-p,t[8]=d*l+x,t[1]=c*h,t[5]=x*l+d,t[9]=p*l-f,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const d=o*c,p=o*l,f=a*c,x=a*l;t[0]=c*u,t[4]=x-d*h,t[8]=f*h+p,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-l*u,t[6]=p*h+f,t[10]=d-x*h}else if(e.order==="XZY"){const d=o*c,p=o*l,f=a*c,x=a*l;t[0]=c*u,t[4]=-h,t[8]=l*u,t[1]=d*h+x,t[5]=o*u,t[9]=p*h-f,t[2]=f*h-p,t[6]=a*u,t[10]=x*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(HA,e,WA)}lookAt(e,t,n){const i=this.elements;return gi.subVectors(e,t),gi.lengthSq()===0&&(gi.z=1),gi.normalize(),Gs.crossVectors(n,gi),Gs.lengthSq()===0&&(Math.abs(n.z)===1?gi.x+=1e-4:gi.z+=1e-4,gi.normalize(),Gs.crossVectors(n,gi)),Gs.normalize(),Rl.crossVectors(gi,Gs),i[0]=Gs.x,i[4]=Rl.x,i[8]=gi.x,i[1]=Gs.y,i[5]=Rl.y,i[9]=gi.y,i[2]=Gs.z,i[6]=Rl.z,i[10]=gi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],u=n[1],h=n[5],d=n[9],p=n[13],f=n[2],x=n[6],m=n[10],g=n[14],y=n[3],_=n[7],v=n[11],I=n[15],T=i[0],w=i[4],C=i[8],F=i[12],M=i[1],b=i[5],G=i[9],W=i[13],$=i[2],ie=i[6],q=i[10],he=i[14],Q=i[3],we=i[7],Ne=i[11],Ee=i[15];return r[0]=o*T+a*M+c*$+l*Q,r[4]=o*w+a*b+c*ie+l*we,r[8]=o*C+a*G+c*q+l*Ne,r[12]=o*F+a*W+c*he+l*Ee,r[1]=u*T+h*M+d*$+p*Q,r[5]=u*w+h*b+d*ie+p*we,r[9]=u*C+h*G+d*q+p*Ne,r[13]=u*F+h*W+d*he+p*Ee,r[2]=f*T+x*M+m*$+g*Q,r[6]=f*w+x*b+m*ie+g*we,r[10]=f*C+x*G+m*q+g*Ne,r[14]=f*F+x*W+m*he+g*Ee,r[3]=y*T+_*M+v*$+I*Q,r[7]=y*w+_*b+v*ie+I*we,r[11]=y*C+_*G+v*q+I*Ne,r[15]=y*F+_*W+v*he+I*Ee,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],h=e[6],d=e[10],p=e[14],f=e[3],x=e[7],m=e[11],g=e[15];return f*(+r*c*h-i*l*h-r*a*d+n*l*d+i*a*p-n*c*p)+x*(+t*c*p-t*l*d+r*o*d-i*o*p+i*l*u-r*c*u)+m*(+t*l*h-t*a*p-r*o*h+n*o*p+r*a*u-n*l*u)+g*(-i*a*u-t*c*h+t*a*d+i*o*h-n*o*d+n*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],x=e[13],m=e[14],g=e[15],y=h*m*l-x*d*l+x*c*p-a*m*p-h*c*g+a*d*g,_=f*d*l-u*m*l-f*c*p+o*m*p+u*c*g-o*d*g,v=u*x*l-f*h*l+f*a*p-o*x*p-u*a*g+o*h*g,I=f*h*c-u*x*c-f*a*d+o*x*d+u*a*m-o*h*m,T=t*y+n*_+i*v+r*I;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/T;return e[0]=y*w,e[1]=(x*d*r-h*m*r-x*i*p+n*m*p+h*i*g-n*d*g)*w,e[2]=(a*m*r-x*c*r+x*i*l-n*m*l-a*i*g+n*c*g)*w,e[3]=(h*c*r-a*d*r-h*i*l+n*d*l+a*i*p-n*c*p)*w,e[4]=_*w,e[5]=(u*m*r-f*d*r+f*i*p-t*m*p-u*i*g+t*d*g)*w,e[6]=(f*c*r-o*m*r-f*i*l+t*m*l+o*i*g-t*c*g)*w,e[7]=(o*d*r-u*c*r+u*i*l-t*d*l-o*i*p+t*c*p)*w,e[8]=v*w,e[9]=(f*h*r-u*x*r-f*n*p+t*x*p+u*n*g-t*h*g)*w,e[10]=(o*x*r-f*a*r+f*n*l-t*x*l-o*n*g+t*a*g)*w,e[11]=(u*a*r-o*h*r-u*n*l+t*h*l+o*n*p-t*a*p)*w,e[12]=I*w,e[13]=(u*x*i-f*h*i+f*n*d-t*x*d-u*n*m+t*h*m)*w,e[14]=(f*a*i-o*x*i-f*n*c+t*x*c+o*n*m-t*a*m)*w,e[15]=(o*h*i-u*a*i+u*n*c-t*h*c-o*n*d+t*a*d)*w,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,o=e.x,a=e.y,c=e.z,l=r*o,u=r*a;return this.set(l*o+n,l*a-i*c,l*c+i*a,0,l*a+i*c,u*a+n,u*c-i*o,0,l*c-i*a,u*c+i*o,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,o){return this.set(1,n,r,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,o=t._y,a=t._z,c=t._w,l=r+r,u=o+o,h=a+a,d=r*l,p=r*u,f=r*h,x=o*u,m=o*h,g=a*h,y=c*l,_=c*u,v=c*h,I=n.x,T=n.y,w=n.z;return i[0]=(1-(x+g))*I,i[1]=(p+v)*I,i[2]=(f-_)*I,i[3]=0,i[4]=(p-v)*T,i[5]=(1-(d+g))*T,i[6]=(m+y)*T,i[7]=0,i[8]=(f+_)*w,i[9]=(m-y)*w,i[10]=(1-(d+x))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=vo.set(i[0],i[1],i[2]).length();const o=vo.set(i[4],i[5],i[6]).length(),a=vo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],$i.copy(this);const l=1/r,u=1/o,h=1/a;return $i.elements[0]*=l,$i.elements[1]*=l,$i.elements[2]*=l,$i.elements[4]*=u,$i.elements[5]*=u,$i.elements[6]*=u,$i.elements[8]*=h,$i.elements[9]*=h,$i.elements[10]*=h,t.setFromRotationMatrix($i),n.x=r,n.y=o,n.z=a,this}makePerspective(e,t,n,i,r,o,a=Di){const c=this.elements,l=2*r/(t-e),u=2*r/(n-i),h=(t+e)/(t-e),d=(n+i)/(n-i);let p,f;if(a===Di)p=-(o+r)/(o-r),f=-2*o*r/(o-r);else if(a===Qr)p=-o/(o-r),f=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=l,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=u,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=f,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,r,o,a=Di){const c=this.elements,l=1/(t-e),u=1/(n-i),h=1/(o-r),d=(t+e)*l,p=(n+i)*u;let f,x;if(a===Di)f=(o+r)*h,x=-2*h;else if(a===Qr)f=r*h,x=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-p,c[2]=0,c[6]=0,c[10]=x,c[14]=-f,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const vo=new E,$i=new Fe,HA=new E(0,0,0),WA=new E(1,1,1),Gs=new E,Rl=new E,gi=new E,T0=new Fe,b0=new Qn;class ui{constructor(e=0,t=0,n=0,i=ui.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],o=i[4],a=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];switch(t){case"XYZ":this._y=Math.asin(jt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-jt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(jt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-jt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(jt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-jt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return T0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(T0,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return b0.setFromEuler(this),this.setFromQuaternion(b0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ui.DEFAULT_ORDER="XYZ";class $c{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let XA=0;const w0=new E,Mo=new Qn,Ts=new Fe,Il=new E,Pa=new E,qA=new E,$A=new Qn,A0=new E(1,0,0),N0=new E(0,1,0),E0=new E(0,0,1),C0={type:"added"},YA={type:"removed"},So={type:"childadded",child:null},tp={type:"childremoved",child:null};class yt extends Ai{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:XA++}),this.uuid=bi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yt.DEFAULT_UP.clone();const e=new E,t=new ui,n=new Qn,i=new E(1,1,1);function r(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Fe},normalMatrix:{value:new Ke}}),this.matrix=new Fe,this.matrixWorld=new Fe,this.matrixAutoUpdate=yt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new $c,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Mo.setFromAxisAngle(e,t),this.quaternion.multiply(Mo),this}rotateOnWorldAxis(e,t){return Mo.setFromAxisAngle(e,t),this.quaternion.premultiply(Mo),this}rotateX(e){return this.rotateOnAxis(A0,e)}rotateY(e){return this.rotateOnAxis(N0,e)}rotateZ(e){return this.rotateOnAxis(E0,e)}translateOnAxis(e,t){return w0.copy(e).applyQuaternion(this.quaternion),this.position.add(w0.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(A0,e)}translateY(e){return this.translateOnAxis(N0,e)}translateZ(e){return this.translateOnAxis(E0,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ts.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Il.copy(e):Il.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Pa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ts.lookAt(Pa,Il,this.up):Ts.lookAt(Il,Pa,this.up),this.quaternion.setFromRotationMatrix(Ts),i&&(Ts.extractRotation(i.matrixWorld),Mo.setFromRotationMatrix(Ts),this.quaternion.premultiply(Mo.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(C0),So.child=e,this.dispatchEvent(So),So.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(YA),tp.child=e,this.dispatchEvent(tp),tp.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ts.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ts.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ts),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(C0),So.child=e,this.dispatchEvent(So),So.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,o=i.length;r<o;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pa,e,qA),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pa,$A,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function r(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let l=0,u=c.length;l<u;l++){const h=c[l];r(e.shapes,h)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let c=0,l=this.material.length;c<l;c++)a.push(r(e.materials,this.material[c]));i.material=a}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const c=this.animations[a];i.animations.push(r(e.animations,c))}}if(t){const a=o(e.geometries),c=o(e.materials),l=o(e.textures),u=o(e.images),h=o(e.shapes),d=o(e.skeletons),p=o(e.animations),f=o(e.nodes);a.length>0&&(n.geometries=a),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),p.length>0&&(n.animations=p),f.length>0&&(n.nodes=f)}return n.object=i,n;function o(a){const c=[];for(const l in a){const u=a[l];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}yt.DEFAULT_UP=new E(0,1,0);yt.DEFAULT_MATRIX_AUTO_UPDATE=!0;yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Yi=new E,bs=new E,np=new E,ws=new E,To=new E,bo=new E,R0=new E,ip=new E,sp=new E,rp=new E,op=new st,ap=new st,cp=new st;class Zn{constructor(e=new E,t=new E,n=new E){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Yi.subVectors(e,t),i.cross(Yi);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Yi.subVectors(i,t),bs.subVectors(n,t),np.subVectors(e,t);const o=Yi.dot(Yi),a=Yi.dot(bs),c=Yi.dot(np),l=bs.dot(bs),u=bs.dot(np),h=o*l-a*a;if(h===0)return r.set(0,0,0),null;const d=1/h,p=(l*c-a*u)*d,f=(o*u-a*c)*d;return r.set(1-p-f,f,p)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ws)===null?!1:ws.x>=0&&ws.y>=0&&ws.x+ws.y<=1}static getInterpolation(e,t,n,i,r,o,a,c){return this.getBarycoord(e,t,n,i,ws)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,ws.x),c.addScaledVector(o,ws.y),c.addScaledVector(a,ws.z),c)}static getInterpolatedAttribute(e,t,n,i,r,o){return op.setScalar(0),ap.setScalar(0),cp.setScalar(0),op.fromBufferAttribute(e,t),ap.fromBufferAttribute(e,n),cp.fromBufferAttribute(e,i),o.setScalar(0),o.addScaledVector(op,r.x),o.addScaledVector(ap,r.y),o.addScaledVector(cp,r.z),o}static isFrontFacing(e,t,n,i){return Yi.subVectors(n,t),bs.subVectors(e,t),Yi.cross(bs).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Yi.subVectors(this.c,this.b),bs.subVectors(this.a,this.b),Yi.cross(bs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return Zn.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return Zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let o,a;To.subVectors(i,n),bo.subVectors(r,n),ip.subVectors(e,n);const c=To.dot(ip),l=bo.dot(ip);if(c<=0&&l<=0)return t.copy(n);sp.subVectors(e,i);const u=To.dot(sp),h=bo.dot(sp);if(u>=0&&h<=u)return t.copy(i);const d=c*h-u*l;if(d<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(n).addScaledVector(To,o);rp.subVectors(e,r);const p=To.dot(rp),f=bo.dot(rp);if(f>=0&&p<=f)return t.copy(r);const x=p*l-c*f;if(x<=0&&l>=0&&f<=0)return a=l/(l-f),t.copy(n).addScaledVector(bo,a);const m=u*f-p*h;if(m<=0&&h-u>=0&&p-f>=0)return R0.subVectors(r,i),a=(h-u)/(h-u+(p-f)),t.copy(i).addScaledVector(R0,a);const g=1/(m+x+d);return o=x*g,a=d*g,t.copy(n).addScaledVector(To,o).addScaledVector(bo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Vy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Hs={h:0,s:0,l:0},Pl={h:0,s:0,l:0};function lp(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class _e{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,gt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=gt.workingColorSpace){return this.r=e,this.g=t,this.b=n,gt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=gt.workingColorSpace){if(e=em(e,1),t=jt(t,0,1),n=jt(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,o=2*n-r;this.r=lp(o,r,e+1/3),this.g=lp(o,r,e),this.b=lp(o,r,e-1/3)}return gt.toWorkingColorSpace(this,i),this}setStyle(e,t=kn){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kn){const n=Vy[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=jo(e.r),this.g=jo(e.g),this.b=jo(e.b),this}copyLinearToSRGB(e){return this.r=$d(e.r),this.g=$d(e.g),this.b=$d(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kn){return gt.fromWorkingColorSpace(Bn.copy(this),e),Math.round(jt(Bn.r*255,0,255))*65536+Math.round(jt(Bn.g*255,0,255))*256+Math.round(jt(Bn.b*255,0,255))}getHexString(e=kn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=gt.workingColorSpace){gt.fromWorkingColorSpace(Bn.copy(this),t);const n=Bn.r,i=Bn.g,r=Bn.b,o=Math.max(n,i,r),a=Math.min(n,i,r);let c,l;const u=(a+o)/2;if(a===o)c=0,l=0;else{const h=o-a;switch(l=u<=.5?h/(o+a):h/(2-o-a),o){case n:c=(i-r)/h+(i<r?6:0);break;case i:c=(r-n)/h+2;break;case r:c=(n-i)/h+4;break}c/=6}return e.h=c,e.s=l,e.l=u,e}getRGB(e,t=gt.workingColorSpace){return gt.fromWorkingColorSpace(Bn.copy(this),t),e.r=Bn.r,e.g=Bn.g,e.b=Bn.b,e}getStyle(e=kn){gt.fromWorkingColorSpace(Bn.copy(this),e);const t=Bn.r,n=Bn.g,i=Bn.b;return e!==kn?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Hs),this.setHSL(Hs.h+e,Hs.s+t,Hs.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Hs),e.getHSL(Pl);const n=Ka(Hs.h,Pl.h,t),i=Ka(Hs.s,Pl.s,t),r=Ka(Hs.l,Pl.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Bn=new _e;_e.NAMES=Vy;let ZA=0;class mn extends Ai{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ZA++}),this.uuid=bi(),this.name="",this.type="Material",this.blending=Ps,this.side=fs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ou,this.blendDst=Vu,this.blendEquation=Zs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new _e(0,0,0),this.blendAlpha=0,this.depthFunc=nr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ih,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=$s,this.stencilZFail=$s,this.stencilZPass=$s,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Ps&&(n.blending=this.blending),this.side!==fs&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Ou&&(n.blendSrc=this.blendSrc),this.blendDst!==Vu&&(n.blendDst=this.blendDst),this.blendEquation!==Zs&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==nr&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ih&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==$s&&(n.stencilFail=this.stencilFail),this.stencilZFail!==$s&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==$s&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const o=[];for(const a in r){const c=r[a];delete c.metadata,o.push(c)}return o}if(t){const r=i(e.textures),o=i(e.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ss extends mn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new _e(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ui,this.combine=fa,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Es=JA();function JA(){const s=new ArrayBuffer(4),e=new Float32Array(s),t=new Uint32Array(s),n=new Uint32Array(512),i=new Uint32Array(512);for(let c=0;c<256;++c){const l=c-127;l<-27?(n[c]=0,n[c|256]=32768,i[c]=24,i[c|256]=24):l<-14?(n[c]=1024>>-l-14,n[c|256]=1024>>-l-14|32768,i[c]=-l-1,i[c|256]=-l-1):l<=15?(n[c]=l+15<<10,n[c|256]=l+15<<10|32768,i[c]=13,i[c|256]=13):l<128?(n[c]=31744,n[c|256]=64512,i[c]=24,i[c|256]=24):(n[c]=31744,n[c|256]=64512,i[c]=13,i[c|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let c=1;c<1024;++c){let l=c<<13,u=0;for(;(l&8388608)===0;)l<<=1,u-=8388608;l&=-8388609,u+=947912704,r[c]=l|u}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(a[c]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:r,exponentTable:o,offsetTable:a}}function si(s){Math.abs(s)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),s=jt(s,-65504,65504),Es.floatView[0]=s;const e=Es.uint32View[0],t=e>>23&511;return Es.baseTable[t]+((e&8388607)>>Es.shiftTable[t])}function Za(s){const e=s>>10;return Es.uint32View[0]=Es.mantissaTable[Es.offsetTable[e]+(s&1023)]+Es.exponentTable[e],Es.floatView[0]}const By={toHalfFloat:si,fromHalfFloat:Za},an=new E,Ll=new J;class At{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=sa,this.updateRanges=[],this.gpuType=Gn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ll.fromBufferAttribute(this,t),Ll.applyMatrix3(e),this.setXY(t,Ll.x,Ll.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyMatrix3(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyMatrix4(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyNormalMatrix(e),this.setXYZ(t,an.x,an.y,an.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.transformDirection(e),this.setXYZ(t,an.x,an.y,an.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Yn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=ut(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Yn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Yn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Yn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Yn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array),r=ut(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==sa&&(e.usage=this.usage),e}}class KA extends At{constructor(e,t,n){super(new Int8Array(e),t,n)}}class jA extends At{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class QA extends At{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class e1 extends At{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Wh extends At{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class t1 extends At{constructor(e,t,n){super(new Int32Array(e),t,n)}}class tm extends At{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class zy extends At{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Za(this.array[e*this.itemSize]);return this.normalized&&(t=Yn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize]=si(t),this}getY(e){let t=Za(this.array[e*this.itemSize+1]);return this.normalized&&(t=Yn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+1]=si(t),this}getZ(e){let t=Za(this.array[e*this.itemSize+2]);return this.normalized&&(t=Yn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+2]=si(t),this}getW(e){let t=Za(this.array[e*this.itemSize+3]);return this.normalized&&(t=Yn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+3]=si(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array)),this.array[e+0]=si(t),this.array[e+1]=si(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array)),this.array[e+0]=si(t),this.array[e+1]=si(n),this.array[e+2]=si(i),this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array),r=ut(r,this.array)),this.array[e+0]=si(t),this.array[e+1]=si(n),this.array[e+2]=si(i),this.array[e+3]=si(r),this}}class Ve extends At{constructor(e,t,n){super(new Float32Array(e),t,n)}}let n1=0;const Ei=new Fe,up=new yt,wo=new E,xi=new Hn,La=new Hn,_n=new E;class at extends Ai{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:n1++}),this.uuid=bi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Uy(e)?tm:Wh)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new Ke().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Ei.makeRotationFromQuaternion(e),this.applyMatrix4(Ei),this}rotateX(e){return Ei.makeRotationX(e),this.applyMatrix4(Ei),this}rotateY(e){return Ei.makeRotationY(e),this.applyMatrix4(Ei),this}rotateZ(e){return Ei.makeRotationZ(e),this.applyMatrix4(Ei),this}translate(e,t,n){return Ei.makeTranslation(e,t,n),this.applyMatrix4(Ei),this}scale(e,t,n){return Ei.makeScale(e,t,n),this.applyMatrix4(Ei),this}lookAt(e){return up.lookAt(e),up.updateMatrix(),this.applyMatrix4(up.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wo).negate(),this.translate(wo.x,wo.y,wo.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Ve(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Hn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new E(-1/0,-1/0,-1/0),new E(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];xi.setFromBufferAttribute(r),this.morphTargetsRelative?(_n.addVectors(this.boundingBox.min,xi.min),this.boundingBox.expandByPoint(_n),_n.addVectors(this.boundingBox.max,xi.max),this.boundingBox.expandByPoint(_n)):(this.boundingBox.expandByPoint(xi.min),this.boundingBox.expandByPoint(xi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Dn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new E,1/0);return}if(e){const n=this.boundingSphere.center;if(xi.setFromBufferAttribute(e),t)for(let r=0,o=t.length;r<o;r++){const a=t[r];La.setFromBufferAttribute(a),this.morphTargetsRelative?(_n.addVectors(xi.min,La.min),xi.expandByPoint(_n),_n.addVectors(xi.max,La.max),xi.expandByPoint(_n)):(xi.expandByPoint(La.min),xi.expandByPoint(La.max))}xi.getCenter(n);let i=0;for(let r=0,o=e.count;r<o;r++)_n.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(_n));if(t)for(let r=0,o=t.length;r<o;r++){const a=t[r],c=this.morphTargetsRelative;for(let l=0,u=a.count;l<u;l++)_n.fromBufferAttribute(a,l),c&&(wo.fromBufferAttribute(e,l),_n.add(wo)),i=Math.max(i,n.distanceToSquared(_n))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new At(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),a=[],c=[];for(let C=0;C<n.count;C++)a[C]=new E,c[C]=new E;const l=new E,u=new E,h=new E,d=new J,p=new J,f=new J,x=new E,m=new E;function g(C,F,M){l.fromBufferAttribute(n,C),u.fromBufferAttribute(n,F),h.fromBufferAttribute(n,M),d.fromBufferAttribute(r,C),p.fromBufferAttribute(r,F),f.fromBufferAttribute(r,M),u.sub(l),h.sub(l),p.sub(d),f.sub(d);const b=1/(p.x*f.y-f.x*p.y);isFinite(b)&&(x.copy(u).multiplyScalar(f.y).addScaledVector(h,-p.y).multiplyScalar(b),m.copy(h).multiplyScalar(p.x).addScaledVector(u,-f.x).multiplyScalar(b),a[C].add(x),a[F].add(x),a[M].add(x),c[C].add(m),c[F].add(m),c[M].add(m))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let C=0,F=y.length;C<F;++C){const M=y[C],b=M.start,G=M.count;for(let W=b,$=b+G;W<$;W+=3)g(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const _=new E,v=new E,I=new E,T=new E;function w(C){I.fromBufferAttribute(i,C),T.copy(I);const F=a[C];_.copy(F),_.sub(I.multiplyScalar(I.dot(F))).normalize(),v.crossVectors(T,F);const b=v.dot(c[C])<0?-1:1;o.setXYZW(C,_.x,_.y,_.z,b)}for(let C=0,F=y.length;C<F;++C){const M=y[C],b=M.start,G=M.count;for(let W=b,$=b+G;W<$;W+=3)w(e.getX(W+0)),w(e.getX(W+1)),w(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new At(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,p=n.count;d<p;d++)n.setXYZ(d,0,0,0);const i=new E,r=new E,o=new E,a=new E,c=new E,l=new E,u=new E,h=new E;if(e)for(let d=0,p=e.count;d<p;d+=3){const f=e.getX(d+0),x=e.getX(d+1),m=e.getX(d+2);i.fromBufferAttribute(t,f),r.fromBufferAttribute(t,x),o.fromBufferAttribute(t,m),u.subVectors(o,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,f),c.fromBufferAttribute(n,x),l.fromBufferAttribute(n,m),a.add(u),c.add(u),l.add(u),n.setXYZ(f,a.x,a.y,a.z),n.setXYZ(x,c.x,c.y,c.z),n.setXYZ(m,l.x,l.y,l.z)}else for(let d=0,p=t.count;d<p;d+=3)i.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),o.fromBufferAttribute(t,d+2),u.subVectors(o,r),h.subVectors(i,r),u.cross(h),n.setXYZ(d+0,u.x,u.y,u.z),n.setXYZ(d+1,u.x,u.y,u.z),n.setXYZ(d+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)_n.fromBufferAttribute(e,t),_n.normalize(),e.setXYZ(t,_n.x,_n.y,_n.z)}toNonIndexed(){function e(a,c){const l=a.array,u=a.itemSize,h=a.normalized,d=new l.constructor(c.length*u);let p=0,f=0;for(let x=0,m=c.length;x<m;x++){a.isInterleavedBufferAttribute?p=c[x]*a.data.stride+a.offset:p=c[x]*u;for(let g=0;g<u;g++)d[f++]=l[p++]}return new At(d,u,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new at,n=this.index.array,i=this.attributes;for(const a in i){const c=i[a],l=e(c,n);t.setAttribute(a,l)}const r=this.morphAttributes;for(const a in r){const c=[],l=r[a];for(let u=0,h=l.length;u<h;u++){const d=l[u],p=e(d,n);c.push(p)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,c=o.length;a<c;a++){const l=o[a];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n){const l=n[c];e.data.attributes[c]=l.toJSON(e.data)}const i={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],u=[];for(let h=0,d=l.length;h<d;h++){const p=l[h];u.push(p.toJSON(e.data))}u.length>0&&(i[c]=u,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const l in i){const u=i[l];this.setAttribute(l,u.clone(t))}const r=e.morphAttributes;for(const l in r){const u=[],h=r[l];for(let d=0,p=h.length;d<p;d++)u.push(h[d].clone(t));this.morphAttributes[l]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let l=0,u=o.length;l<u;l++){const h=o[l];this.addGroup(h.start,h.count,h.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const I0=new Fe,Tr=new io,Dl=new Dn,P0=new E,Ul=new E,Fl=new E,Ol=new E,hp=new E,Vl=new E,L0=new E,Bl=new E;class kt extends yt{constructor(e=new at,t=new ss){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r<o;r++){const a=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const a=this.morphTargetInfluences;if(r&&a){Vl.set(0,0,0);for(let c=0,l=r.length;c<l;c++){const u=a[c],h=r[c];u!==0&&(hp.fromBufferAttribute(h,e),o?Vl.addScaledVector(hp,u):Vl.addScaledVector(hp.sub(t),u))}t.add(Vl)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Dl.copy(n.boundingSphere),Dl.applyMatrix4(r),Tr.copy(e.ray).recast(e.near),!(Dl.containsPoint(Tr.origin)===!1&&(Tr.intersectSphere(Dl,P0)===null||Tr.origin.distanceToSquared(P0)>(e.far-e.near)**2))&&(I0.copy(r).invert(),Tr.copy(e.ray).applyMatrix4(I0),!(n.boundingBox!==null&&Tr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Tr)))}_computeIntersections(e,t,n){let i;const r=this.geometry,o=this.material,a=r.index,c=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,d=r.groups,p=r.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,x=d.length;f<x;f++){const m=d[f],g=o[m.materialIndex],y=Math.max(m.start,p.start),_=Math.min(a.count,Math.min(m.start+m.count,p.start+p.count));for(let v=y,I=_;v<I;v+=3){const T=a.getX(v),w=a.getX(v+1),C=a.getX(v+2);i=zl(this,g,e,n,l,u,h,T,w,C),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const f=Math.max(0,p.start),x=Math.min(a.count,p.start+p.count);for(let m=f,g=x;m<g;m+=3){const y=a.getX(m),_=a.getX(m+1),v=a.getX(m+2);i=zl(this,o,e,n,l,u,h,y,_,v),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(c!==void 0)if(Array.isArray(o))for(let f=0,x=d.length;f<x;f++){const m=d[f],g=o[m.materialIndex],y=Math.max(m.start,p.start),_=Math.min(c.count,Math.min(m.start+m.count,p.start+p.count));for(let v=y,I=_;v<I;v+=3){const T=v,w=v+1,C=v+2;i=zl(this,g,e,n,l,u,h,T,w,C),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const f=Math.max(0,p.start),x=Math.min(c.count,p.start+p.count);for(let m=f,g=x;m<g;m+=3){const y=m,_=m+1,v=m+2;i=zl(this,o,e,n,l,u,h,y,_,v),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function i1(s,e,t,n,i,r,o,a){let c;if(e.side===ln?c=n.intersectTriangle(o,r,i,!0,a):c=n.intersectTriangle(i,r,o,e.side===fs,a),c===null)return null;Bl.copy(a),Bl.applyMatrix4(s.matrixWorld);const l=t.ray.origin.distanceTo(Bl);return l<t.near||l>t.far?null:{distance:l,point:Bl.clone(),object:s}}function zl(s,e,t,n,i,r,o,a,c,l){s.getVertexPosition(a,Ul),s.getVertexPosition(c,Fl),s.getVertexPosition(l,Ol);const u=i1(s,e,t,n,Ul,Fl,Ol,L0);if(u){const h=new E;Zn.getBarycoord(L0,Ul,Fl,Ol,h),i&&(u.uv=Zn.getInterpolatedAttribute(i,a,c,l,h,new J)),r&&(u.uv1=Zn.getInterpolatedAttribute(r,a,c,l,h,new J)),o&&(u.normal=Zn.getInterpolatedAttribute(o,a,c,l,h,new E),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:c,c:l,normal:new E,materialIndex:0};Zn.getNormal(Ul,Fl,Ol,d.normal),u.face=d,u.barycoord=h}return u}class _s extends at{constructor(e=1,t=1,n=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const c=[],l=[],u=[],h=[];let d=0,p=0;f("z","y","x",-1,-1,n,t,e,o,r,0),f("z","y","x",1,-1,n,t,-e,o,r,1),f("x","z","y",1,1,e,n,t,i,o,2),f("x","z","y",1,-1,e,n,-t,i,o,3),f("x","y","z",1,-1,e,t,n,i,r,4),f("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(c),this.setAttribute("position",new Ve(l,3)),this.setAttribute("normal",new Ve(u,3)),this.setAttribute("uv",new Ve(h,2));function f(x,m,g,y,_,v,I,T,w,C,F){const M=v/w,b=I/C,G=v/2,W=I/2,$=T/2,ie=w+1,q=C+1;let he=0,Q=0;const we=new E;for(let Ne=0;Ne<q;Ne++){const Ee=Ne*b-W;for(let Qe=0;Qe<ie;Qe++){const ht=Qe*M-G;we[x]=ht*y,we[m]=Ee*_,we[g]=$,l.push(we.x,we.y,we.z),we[x]=0,we[m]=0,we[g]=T>0?1:-1,u.push(we.x,we.y,we.z),h.push(Qe/w),h.push(1-Ne/C),he+=1}}for(let Ne=0;Ne<C;Ne++)for(let Ee=0;Ee<w;Ee++){const Qe=d+Ee+ie*Ne,ht=d+Ee+ie*(Ne+1),ne=d+(Ee+1)+ie*(Ne+1),ue=d+(Ee+1)+ie*Ne;c.push(Qe,ht,ue),c.push(ht,ne,ue),Q+=6}a.addGroup(p,Q,F),p+=Q,d+=he}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _s(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function oa(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function $n(s){const e={};for(let t=0;t<s.length;t++){const n=oa(s[t]);for(const i in n)e[i]=n[i]}return e}function s1(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function ky(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:gt.workingColorSpace}const nm={clone:oa,merge:$n};var r1=`void main() {
1
+ "use strict";var mo=typeof document<"u"?document.currentScript:null;const Ks="169",G_={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},H_={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},W_=0,sf=1,X_=2,tA=3,nA=0,Lf=1,Df=2,oi=3,fs=0,ln=1,Ji=2,Fi=0,Ps=1,cc=2,rf=3,of=4,Uf=5,Zs=100,q_=101,$_=102,Y_=103,Ff=104,Z_=200,J_=201,K_=202,j_=203,Ou=204,Vu=205,Q_=206,ey=207,ty=208,ny=209,iy=210,sy=211,ry=212,oy=213,ay=214,lc=0,uc=1,hc=2,nr=3,dc=4,pc=5,fc=6,mc=7,fa=0,Of=1,Vf=2,Ti=0,Ah=1,Nh=2,Bf=3,Eh=4,cy=5,Ch=6,Rh=7,af="attached",ly="detached",Ih=300,wi=301,Vi=302,ir=303,sr=304,hr=306,rr=1e3,Si=1001,ea=1002,Qt=1003,Ph=1004,iA=1004,Cs=1005,sA=1005,Ut=1006,js=1007,rA=1007,Jn=1008,uy=1008,es=1009,zf=1010,kf=1011,ta=1012,ma=1013,Bi=1014,Gn=1015,Ln=1016,Lh=1017,Dh=1018,or=1020,Uh=35902,Fh=35899,Gf=1021,Oh=1022,Rn=1023,Hf=1024,Wf=1025,Qs=1026,ar=1027,Hc=1028,Wc=1029,na=1030,Vh=1031,oA=1032,Bh=1033,$o=33776,Yo=33777,Zo=33778,Jo=33779,gc=35840,Bu=35841,xc=35842,zu=35843,_c=36196,yc=37492,vc=37496,Mc=37808,ku=37809,Gu=37810,Hu=37811,Sc=37812,Wu=37813,Xu=37814,qu=37815,$u=37816,Yu=37817,Zu=37818,Ju=37819,Ku=37820,ju=37821,Ko=36492,Qu=36494,Tc=36495,Xf=36283,eh=36284,th=36285,nh=36286,qf=2200,$f=2201,hy=2202,ia=2300,bc=2301,Eu=2302,zr=2400,kr=2401,wc=2402,zh=2500,Yf=2501,dy=0,py=1,fy=2,Zf=3200,Jf=3201,aA=3202,cA=3203,ms=0,Kf=1,Li="",kn="srgb",li="srgb-linear",kh="display-p3",Xc="display-p3-linear",Ac="linear",Vt="srgb",Nc="rec709",Ec="p3",my=0,$s=7680,gy=7681,xy=7682,_y=7683,yy=34055,vy=34056,My=5386,Sy=512,Ty=513,by=514,wy=515,Ay=516,Ny=517,Ey=518,ih=519,Cy=512,jf=513,Ry=514,Qf=515,Iy=516,Py=517,Ly=518,Dy=519,sa=35044,Gr=35048,lA=35040,uA=35045,hA=35049,dA=35041,pA=35046,fA=35050,mA=35042,gA="100",sh="300 es",Di=2e3,Qr=2001;class Ai{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,o=i.length;r<o;r++)i[r].call(this,e);e.target=null}}}const Vn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let _0=1234567;const $r=Math.PI/180,ra=180/Math.PI;function bi(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Vn[s&255]+Vn[s>>8&255]+Vn[s>>16&255]+Vn[s>>24&255]+"-"+Vn[e&255]+Vn[e>>8&255]+"-"+Vn[e>>16&15|64]+Vn[e>>24&255]+"-"+Vn[t&63|128]+Vn[t>>8&255]+"-"+Vn[t>>16&255]+Vn[t>>24&255]+Vn[n&255]+Vn[n>>8&255]+Vn[n>>16&255]+Vn[n>>24&255]).toLowerCase()}function jt(s,e,t){return Math.max(e,Math.min(t,s))}function em(s,e){return(s%e+e)%e}function xA(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function _A(s,e,t){return s!==e?(t-s)/(e-s):0}function Ka(s,e,t){return(1-t)*s+t*e}function yA(s,e,t,n){return Ka(s,e,1-Math.exp(-t*n))}function vA(s,e=1){return e-Math.abs(em(s,e*2)-e)}function MA(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function SA(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function TA(s,e){return s+Math.floor(Math.random()*(e-s+1))}function bA(s,e){return s+Math.random()*(e-s)}function wA(s){return s*(.5-Math.random())}function AA(s){s!==void 0&&(_0=s);let e=_0+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function NA(s){return s*$r}function EA(s){return s*ra}function CA(s){return(s&s-1)===0&&s!==0}function RA(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function IA(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function PA(s,e,t,n,i){const r=Math.cos,o=Math.sin,a=r(t/2),c=o(t/2),l=r((e+n)/2),u=o((e+n)/2),h=r((e-n)/2),d=o((e-n)/2),p=r((n-e)/2),f=o((n-e)/2);switch(i){case"XYX":s.set(a*u,c*h,c*d,a*l);break;case"YZY":s.set(c*d,a*u,c*h,a*l);break;case"ZXZ":s.set(c*h,c*d,a*u,a*l);break;case"XZX":s.set(a*u,c*f,c*p,a*l);break;case"YXY":s.set(c*p,a*u,c*f,a*l);break;case"ZYZ":s.set(c*f,c*p,a*u,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Yn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function ut(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Gh={DEG2RAD:$r,RAD2DEG:ra,generateUUID:bi,clamp:jt,euclideanModulo:em,mapLinear:xA,inverseLerp:_A,lerp:Ka,damp:yA,pingpong:vA,smoothstep:MA,smootherstep:SA,randInt:TA,randFloat:bA,randFloatSpread:wA,seededRandom:AA,degToRad:NA,radToDeg:EA,isPowerOfTwo:CA,ceilPowerOfTwo:RA,floorPowerOfTwo:IA,setQuaternionFromProperEuler:PA,normalize:ut,denormalize:Yn};class J{constructor(e=0,t=0){J.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(jt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*n-o*i+e.x,this.y=r*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ke{constructor(e,t,n,i,r,o,a,c,l){Ke.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,o,a,c,l)}set(e,t,n,i,r,o,a,c,l){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=r,u[5]=c,u[6]=n,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],u=n[4],h=n[7],d=n[2],p=n[5],f=n[8],x=i[0],m=i[3],g=i[6],y=i[1],_=i[4],v=i[7],I=i[2],T=i[5],w=i[8];return r[0]=o*x+a*y+c*I,r[3]=o*m+a*_+c*T,r[6]=o*g+a*v+c*w,r[1]=l*x+u*y+h*I,r[4]=l*m+u*_+h*T,r[7]=l*g+u*v+h*w,r[2]=d*x+p*y+f*I,r[5]=d*m+p*_+f*T,r[8]=d*g+p*v+f*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return t*o*u-t*a*l-n*r*u+n*a*c+i*r*l-i*o*c}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=u*o-a*l,d=a*c-u*r,p=l*r-o*c,f=t*h+n*d+i*p;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/f;return e[0]=h*x,e[1]=(i*l-u*n)*x,e[2]=(a*n-i*o)*x,e[3]=d*x,e[4]=(u*t-i*c)*x,e[5]=(i*r-a*t)*x,e[6]=p*x,e[7]=(n*c-l*t)*x,e[8]=(o*t-n*r)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,o,a){const c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*o+l*a)+o+e,-i*l,i*c,-i*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(qd.makeScale(e,t)),this}rotate(e){return this.premultiply(qd.makeRotation(-e)),this}translate(e,t){return this.premultiply(qd.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const qd=new Ke;function Uy(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}const LA={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ko(s,e){return new LA[s](e)}function Cc(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Fy(){const s=Cc("canvas");return s.style.display="block",s}const y0={};function Cu(s){s in y0||(y0[s]=!0,console.warn(s))}function DA(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function UA(s){const e=s.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function FA(s){const e=s.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const v0=new Ke().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),M0=new Ke().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ca={[li]:{transfer:Ac,primaries:Nc,luminanceCoefficients:[.2126,.7152,.0722],toReference:s=>s,fromReference:s=>s},[kn]:{transfer:Vt,primaries:Nc,luminanceCoefficients:[.2126,.7152,.0722],toReference:s=>s.convertSRGBToLinear(),fromReference:s=>s.convertLinearToSRGB()},[Xc]:{transfer:Ac,primaries:Ec,luminanceCoefficients:[.2289,.6917,.0793],toReference:s=>s.applyMatrix3(M0),fromReference:s=>s.applyMatrix3(v0)},[kh]:{transfer:Vt,primaries:Ec,luminanceCoefficients:[.2289,.6917,.0793],toReference:s=>s.convertSRGBToLinear().applyMatrix3(M0),fromReference:s=>s.applyMatrix3(v0).convertLinearToSRGB()}},OA=new Set([li,Xc]),gt={enabled:!0,_workingColorSpace:li,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(s){if(!OA.has(s))throw new Error(`Unsupported working color space, "${s}".`);this._workingColorSpace=s},convert:function(s,e,t){if(this.enabled===!1||e===t||!e||!t)return s;const n=Ca[e].toReference,i=Ca[t].fromReference;return i(n(s))},fromWorkingColorSpace:function(s,e){return this.convert(s,this._workingColorSpace,e)},toWorkingColorSpace:function(s,e){return this.convert(s,e,this._workingColorSpace)},getPrimaries:function(s){return Ca[s].primaries},getTransfer:function(s){return s===Li?Ac:Ca[s].transfer},getLuminanceCoefficients:function(s,e=this._workingColorSpace){return s.fromArray(Ca[e].luminanceCoefficients)}};function jo(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function $d(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let go;class Oy{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{go===void 0&&(go=Cc("canvas")),go.width=e.width,go.height=e.height;const n=go.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=go}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Cc("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let o=0;o<r.length;o++)r[o]=jo(r[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(jo(t[n]/255)*255):t[n]=jo(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let VA=0;class Js{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:VA++}),this.uuid=bi(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?r.push(Yd(i[o].image)):r.push(Yd(i[o]))}else r=Yd(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function Yd(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Oy.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let BA=0;class Xt extends Ai{constructor(e=Xt.DEFAULT_IMAGE,t=Xt.DEFAULT_MAPPING,n=Si,i=Si,r=Ut,o=Jn,a=Rn,c=es,l=Xt.DEFAULT_ANISOTROPY,u=Li){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:BA++}),this.uuid=bi(),this.name="",this.source=new Js(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=c,this.offset=new J(0,0),this.repeat=new J(1,1),this.center=new J(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ke,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ih)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case rr:e.x=e.x-Math.floor(e.x);break;case Si:e.x=e.x<0?0:1;break;case ea:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case rr:e.y=e.y-Math.floor(e.y);break;case Si:e.y=e.y<0?0:1;break;case ea:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Xt.DEFAULT_IMAGE=null;Xt.DEFAULT_MAPPING=Ih;Xt.DEFAULT_ANISOTROPY=4;class st{constructor(e=0,t=0,n=0,i=1){st.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const c=e.elements,l=c[0],u=c[4],h=c[8],d=c[1],p=c[5],f=c[9],x=c[2],m=c[6],g=c[10];if(Math.abs(u-d)<.01&&Math.abs(h-x)<.01&&Math.abs(f-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+x)<.1&&Math.abs(f+m)<.1&&Math.abs(l+p+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(l+1)/2,v=(p+1)/2,I=(g+1)/2,T=(u+d)/4,w=(h+x)/4,C=(f+m)/4;return _>v&&_>I?_<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(_),i=T/n,r=w/n):v>I?v<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(v),n=T/i,r=C/i):I<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(I),n=w/r,i=C/r),this.set(n,i,r,t),this}let y=Math.sqrt((m-f)*(m-f)+(h-x)*(h-x)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-f)/y,this.y=(h-x)/y,this.z=(d-u)/y,this.w=Math.acos((l+p+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class fn extends Ai{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new st(0,0,e,t),this.scissorTest=!1,this.viewport=new st(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ut,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Xt(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let a=0;a<o;a++)this.textures[a]=r.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Js(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class zi extends fn{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class qc extends Xt{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Qt,this.minFilter=Qt,this.wrapR=Si,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class zA extends zi{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new qc(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Hh extends Xt{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Qt,this.minFilter=Qt,this.wrapR=Si,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class kA extends zi{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Hh(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Qn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,o,a){let c=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const d=r[o+0],p=r[o+1],f=r[o+2],x=r[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=d,e[t+1]=p,e[t+2]=f,e[t+3]=x;return}if(h!==x||c!==d||l!==p||u!==f){let m=1-a;const g=c*d+l*p+u*f+h*x,y=g>=0?1:-1,_=1-g*g;if(_>Number.EPSILON){const I=Math.sqrt(_),T=Math.atan2(I,g*y);m=Math.sin(m*T)/I,a=Math.sin(a*T)/I}const v=a*y;if(c=c*m+d*v,l=l*m+p*v,u=u*m+f*v,h=h*m+x*v,m===1-a){const I=1/Math.sqrt(c*c+l*l+u*u+h*h);c*=I,l*=I,u*=I,h*=I}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,r,o){const a=n[i],c=n[i+1],l=n[i+2],u=n[i+3],h=r[o],d=r[o+1],p=r[o+2],f=r[o+3];return e[t]=a*f+u*h+c*p-l*d,e[t+1]=c*f+u*d+l*h-a*p,e[t+2]=l*f+u*p+a*d-c*h,e[t+3]=u*f-a*h-c*d-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),d=c(n/2),p=c(i/2),f=c(r/2);switch(o){case"XYZ":this._x=d*u*h+l*p*f,this._y=l*p*h-d*u*f,this._z=l*u*f+d*p*h,this._w=l*u*h-d*p*f;break;case"YXZ":this._x=d*u*h+l*p*f,this._y=l*p*h-d*u*f,this._z=l*u*f-d*p*h,this._w=l*u*h+d*p*f;break;case"ZXY":this._x=d*u*h-l*p*f,this._y=l*p*h+d*u*f,this._z=l*u*f+d*p*h,this._w=l*u*h-d*p*f;break;case"ZYX":this._x=d*u*h-l*p*f,this._y=l*p*h+d*u*f,this._z=l*u*f-d*p*h,this._w=l*u*h+d*p*f;break;case"YZX":this._x=d*u*h+l*p*f,this._y=l*p*h+d*u*f,this._z=l*u*f-d*p*h,this._w=l*u*h-d*p*f;break;case"XZY":this._x=d*u*h-l*p*f,this._y=l*p*h-d*u*f,this._z=l*u*f+d*p*h,this._w=l*u*h+d*p*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],o=t[1],a=t[5],c=t[9],l=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-c)*p,this._y=(r-l)*p,this._z=(o-i)*p}else if(n>a&&n>h){const p=2*Math.sqrt(1+n-a-h);this._w=(u-c)/p,this._x=.25*p,this._y=(i+o)/p,this._z=(r+l)/p}else if(a>h){const p=2*Math.sqrt(1+a-n-h);this._w=(r-l)/p,this._x=(i+o)/p,this._y=.25*p,this._z=(c+u)/p}else{const p=2*Math.sqrt(1+h-n-a);this._w=(o-i)/p,this._x=(r+l)/p,this._y=(c+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(jt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,o=e._w,a=t._x,c=t._y,l=t._z,u=t._w;return this._x=n*u+o*a+i*l-r*c,this._y=i*u+o*c+r*a-n*l,this._z=r*u+o*l+n*c-i*a,this._w=o*u-n*a-i*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*e._w+n*e._x+i*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const p=1-t;return this._w=p*o+t*this._w,this._x=p*n+t*this._x,this._y=p*i+t*this._y,this._z=p*r+t*this._z,this.normalize(),this}const l=Math.sqrt(c),u=Math.atan2(l,a),h=Math.sin((1-t)*u)/l,d=Math.sin(t*u)/l;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class E{constructor(e=0,t=0,n=0){E.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(S0.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(S0.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,o=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*i-a*n),u=2*(a*t-r*i),h=2*(r*n-o*t);return this.x=t+c*l+o*h-a*u,this.y=n+c*u+a*l-r*h,this.z=i+c*h+r*u-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,o=t.x,a=t.y,c=t.z;return this.x=i*c-r*a,this.y=r*o-n*c,this.z=n*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Zd.copy(this).projectOnVector(e),this.sub(Zd)}reflect(e){return this.sub(Zd.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(jt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Zd=new E,S0=new Qn;class Hn{constructor(e=new E(1/0,1/0,1/0),t=new E(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=qi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=r.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,qi):qi.fromBufferAttribute(r,o),qi.applyMatrix4(e.matrixWorld),this.expandByPoint(qi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),wl.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),wl.copy(n.boundingBox)),wl.applyMatrix4(e.matrixWorld),this.union(wl)}const i=e.children;for(let r=0,o=i.length;r<o;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qi),qi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ra),Al.subVectors(this.max,Ra),xo.subVectors(e.a,Ra),_o.subVectors(e.b,Ra),yo.subVectors(e.c,Ra),Bs.subVectors(_o,xo),zs.subVectors(yo,_o),Mr.subVectors(xo,yo);let t=[0,-Bs.z,Bs.y,0,-zs.z,zs.y,0,-Mr.z,Mr.y,Bs.z,0,-Bs.x,zs.z,0,-zs.x,Mr.z,0,-Mr.x,-Bs.y,Bs.x,0,-zs.y,zs.x,0,-Mr.y,Mr.x,0];return!Jd(t,xo,_o,yo,Al)||(t=[1,0,0,0,1,0,0,0,1],!Jd(t,xo,_o,yo,Al))?!1:(Nl.crossVectors(Bs,zs),t=[Nl.x,Nl.y,Nl.z],Jd(t,xo,_o,yo,Al))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ms[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ms[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ms[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ms[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ms[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ms[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ms[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ms[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ms),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ms=[new E,new E,new E,new E,new E,new E,new E,new E],qi=new E,wl=new Hn,xo=new E,_o=new E,yo=new E,Bs=new E,zs=new E,Mr=new E,Ra=new E,Al=new E,Nl=new E,Sr=new E;function Jd(s,e,t,n,i){for(let r=0,o=s.length-3;r<=o;r+=3){Sr.fromArray(s,r);const a=i.x*Math.abs(Sr.x)+i.y*Math.abs(Sr.y)+i.z*Math.abs(Sr.z),c=e.dot(Sr),l=t.dot(Sr),u=n.dot(Sr);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>a)return!1}return!0}const GA=new Hn,Ia=new E,Kd=new E;class Dn{constructor(e=new E,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):GA.setFromPoints(e).getCenter(n);let i=0;for(let r=0,o=e.length;r<o;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ia.subVectors(e,this.center);const t=Ia.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Ia,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Kd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ia.copy(e.center).add(Kd)),this.expandByPoint(Ia.copy(e.center).sub(Kd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ss=new E,jd=new E,El=new E,ks=new E,Qd=new E,Cl=new E,ep=new E;class io{constructor(e=new E,t=new E(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ss)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ss.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ss.copy(this.origin).addScaledVector(this.direction,t),Ss.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){jd.copy(e).add(t).multiplyScalar(.5),El.copy(t).sub(e).normalize(),ks.copy(this.origin).sub(jd);const r=e.distanceTo(t)*.5,o=-this.direction.dot(El),a=ks.dot(this.direction),c=-ks.dot(El),l=ks.lengthSq(),u=Math.abs(1-o*o);let h,d,p,f;if(u>0)if(h=o*c-a,d=o*a-c,f=r*u,h>=0)if(d>=-f)if(d<=f){const x=1/u;h*=x,d*=x,p=h*(h+o*d+2*a)+d*(o*h+d+2*c)+l}else d=r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*c)+l;else d=-r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*c)+l;else d<=-f?(h=Math.max(0,-(-o*r+a)),d=h>0?-r:Math.min(Math.max(-r,-c),r),p=-h*h+d*(d+2*c)+l):d<=f?(h=0,d=Math.min(Math.max(-r,-c),r),p=d*(d+2*c)+l):(h=Math.max(0,-(o*r+a)),d=h>0?r:Math.min(Math.max(-r,-c),r),p=-h*h+d*(d+2*c)+l);else d=o>0?-r:r,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(jd).addScaledVector(El,d),p}intersectSphere(e,t){Ss.subVectors(e.center,this.origin);const n=Ss.dot(this.direction),i=Ss.dot(Ss)-n*n,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=n-o,c=n+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,o,a,c;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||r>i||((r>n||isNaN(n))&&(n=r),(o<i||isNaN(i))&&(i=o),h>=0?(a=(e.min.z-d.z)*h,c=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,c=(e.min.z-d.z)*h),n>c||a>i)||((a>n||n!==n)&&(n=a),(c<i||i!==i)&&(i=c),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Ss)!==null}intersectTriangle(e,t,n,i,r){Qd.subVectors(t,e),Cl.subVectors(n,e),ep.crossVectors(Qd,Cl);let o=this.direction.dot(ep),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ks.subVectors(this.origin,e);const c=a*this.direction.dot(Cl.crossVectors(ks,Cl));if(c<0)return null;const l=a*this.direction.dot(Qd.cross(ks));if(l<0||c+l>o)return null;const u=-a*ks.dot(ep);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Fe{constructor(e,t,n,i,r,o,a,c,l,u,h,d,p,f,x,m){Fe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,o,a,c,l,u,h,d,p,f,x,m)}set(e,t,n,i,r,o,a,c,l,u,h,d,p,f,x,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=c,g[2]=l,g[6]=u,g[10]=h,g[14]=d,g[3]=p,g[7]=f,g[11]=x,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Fe().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/vo.setFromMatrixColumn(e,0).length(),r=1/vo.setFromMatrixColumn(e,1).length(),o=1/vo.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const d=o*u,p=o*h,f=a*u,x=a*h;t[0]=c*u,t[4]=-c*h,t[8]=l,t[1]=p+f*l,t[5]=d-x*l,t[9]=-a*c,t[2]=x-d*l,t[6]=f+p*l,t[10]=o*c}else if(e.order==="YXZ"){const d=c*u,p=c*h,f=l*u,x=l*h;t[0]=d+x*a,t[4]=f*a-p,t[8]=o*l,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=p*a-f,t[6]=x+d*a,t[10]=o*c}else if(e.order==="ZXY"){const d=c*u,p=c*h,f=l*u,x=l*h;t[0]=d-x*a,t[4]=-o*h,t[8]=f+p*a,t[1]=p+f*a,t[5]=o*u,t[9]=x-d*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const d=o*u,p=o*h,f=a*u,x=a*h;t[0]=c*u,t[4]=f*l-p,t[8]=d*l+x,t[1]=c*h,t[5]=x*l+d,t[9]=p*l-f,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const d=o*c,p=o*l,f=a*c,x=a*l;t[0]=c*u,t[4]=x-d*h,t[8]=f*h+p,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-l*u,t[6]=p*h+f,t[10]=d-x*h}else if(e.order==="XZY"){const d=o*c,p=o*l,f=a*c,x=a*l;t[0]=c*u,t[4]=-h,t[8]=l*u,t[1]=d*h+x,t[5]=o*u,t[9]=p*h-f,t[2]=f*h-p,t[6]=a*u,t[10]=x*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(HA,e,WA)}lookAt(e,t,n){const i=this.elements;return gi.subVectors(e,t),gi.lengthSq()===0&&(gi.z=1),gi.normalize(),Gs.crossVectors(n,gi),Gs.lengthSq()===0&&(Math.abs(n.z)===1?gi.x+=1e-4:gi.z+=1e-4,gi.normalize(),Gs.crossVectors(n,gi)),Gs.normalize(),Rl.crossVectors(gi,Gs),i[0]=Gs.x,i[4]=Rl.x,i[8]=gi.x,i[1]=Gs.y,i[5]=Rl.y,i[9]=gi.y,i[2]=Gs.z,i[6]=Rl.z,i[10]=gi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],u=n[1],h=n[5],d=n[9],p=n[13],f=n[2],x=n[6],m=n[10],g=n[14],y=n[3],_=n[7],v=n[11],I=n[15],T=i[0],w=i[4],C=i[8],F=i[12],M=i[1],b=i[5],G=i[9],W=i[13],$=i[2],ie=i[6],q=i[10],he=i[14],Q=i[3],we=i[7],Ne=i[11],Ee=i[15];return r[0]=o*T+a*M+c*$+l*Q,r[4]=o*w+a*b+c*ie+l*we,r[8]=o*C+a*G+c*q+l*Ne,r[12]=o*F+a*W+c*he+l*Ee,r[1]=u*T+h*M+d*$+p*Q,r[5]=u*w+h*b+d*ie+p*we,r[9]=u*C+h*G+d*q+p*Ne,r[13]=u*F+h*W+d*he+p*Ee,r[2]=f*T+x*M+m*$+g*Q,r[6]=f*w+x*b+m*ie+g*we,r[10]=f*C+x*G+m*q+g*Ne,r[14]=f*F+x*W+m*he+g*Ee,r[3]=y*T+_*M+v*$+I*Q,r[7]=y*w+_*b+v*ie+I*we,r[11]=y*C+_*G+v*q+I*Ne,r[15]=y*F+_*W+v*he+I*Ee,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],h=e[6],d=e[10],p=e[14],f=e[3],x=e[7],m=e[11],g=e[15];return f*(+r*c*h-i*l*h-r*a*d+n*l*d+i*a*p-n*c*p)+x*(+t*c*p-t*l*d+r*o*d-i*o*p+i*l*u-r*c*u)+m*(+t*l*h-t*a*p-r*o*h+n*o*p+r*a*u-n*l*u)+g*(-i*a*u-t*c*h+t*a*d+i*o*h-n*o*d+n*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],x=e[13],m=e[14],g=e[15],y=h*m*l-x*d*l+x*c*p-a*m*p-h*c*g+a*d*g,_=f*d*l-u*m*l-f*c*p+o*m*p+u*c*g-o*d*g,v=u*x*l-f*h*l+f*a*p-o*x*p-u*a*g+o*h*g,I=f*h*c-u*x*c-f*a*d+o*x*d+u*a*m-o*h*m,T=t*y+n*_+i*v+r*I;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/T;return e[0]=y*w,e[1]=(x*d*r-h*m*r-x*i*p+n*m*p+h*i*g-n*d*g)*w,e[2]=(a*m*r-x*c*r+x*i*l-n*m*l-a*i*g+n*c*g)*w,e[3]=(h*c*r-a*d*r-h*i*l+n*d*l+a*i*p-n*c*p)*w,e[4]=_*w,e[5]=(u*m*r-f*d*r+f*i*p-t*m*p-u*i*g+t*d*g)*w,e[6]=(f*c*r-o*m*r-f*i*l+t*m*l+o*i*g-t*c*g)*w,e[7]=(o*d*r-u*c*r+u*i*l-t*d*l-o*i*p+t*c*p)*w,e[8]=v*w,e[9]=(f*h*r-u*x*r-f*n*p+t*x*p+u*n*g-t*h*g)*w,e[10]=(o*x*r-f*a*r+f*n*l-t*x*l-o*n*g+t*a*g)*w,e[11]=(u*a*r-o*h*r-u*n*l+t*h*l+o*n*p-t*a*p)*w,e[12]=I*w,e[13]=(u*x*i-f*h*i+f*n*d-t*x*d-u*n*m+t*h*m)*w,e[14]=(f*a*i-o*x*i-f*n*c+t*x*c+o*n*m-t*a*m)*w,e[15]=(o*h*i-u*a*i+u*n*c-t*h*c-o*n*d+t*a*d)*w,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,o=e.x,a=e.y,c=e.z,l=r*o,u=r*a;return this.set(l*o+n,l*a-i*c,l*c+i*a,0,l*a+i*c,u*a+n,u*c-i*o,0,l*c-i*a,u*c+i*o,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,o){return this.set(1,n,r,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,o=t._y,a=t._z,c=t._w,l=r+r,u=o+o,h=a+a,d=r*l,p=r*u,f=r*h,x=o*u,m=o*h,g=a*h,y=c*l,_=c*u,v=c*h,I=n.x,T=n.y,w=n.z;return i[0]=(1-(x+g))*I,i[1]=(p+v)*I,i[2]=(f-_)*I,i[3]=0,i[4]=(p-v)*T,i[5]=(1-(d+g))*T,i[6]=(m+y)*T,i[7]=0,i[8]=(f+_)*w,i[9]=(m-y)*w,i[10]=(1-(d+x))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=vo.set(i[0],i[1],i[2]).length();const o=vo.set(i[4],i[5],i[6]).length(),a=vo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],$i.copy(this);const l=1/r,u=1/o,h=1/a;return $i.elements[0]*=l,$i.elements[1]*=l,$i.elements[2]*=l,$i.elements[4]*=u,$i.elements[5]*=u,$i.elements[6]*=u,$i.elements[8]*=h,$i.elements[9]*=h,$i.elements[10]*=h,t.setFromRotationMatrix($i),n.x=r,n.y=o,n.z=a,this}makePerspective(e,t,n,i,r,o,a=Di){const c=this.elements,l=2*r/(t-e),u=2*r/(n-i),h=(t+e)/(t-e),d=(n+i)/(n-i);let p,f;if(a===Di)p=-(o+r)/(o-r),f=-2*o*r/(o-r);else if(a===Qr)p=-o/(o-r),f=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=l,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=u,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=f,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,r,o,a=Di){const c=this.elements,l=1/(t-e),u=1/(n-i),h=1/(o-r),d=(t+e)*l,p=(n+i)*u;let f,x;if(a===Di)f=(o+r)*h,x=-2*h;else if(a===Qr)f=r*h,x=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-p,c[2]=0,c[6]=0,c[10]=x,c[14]=-f,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const vo=new E,$i=new Fe,HA=new E(0,0,0),WA=new E(1,1,1),Gs=new E,Rl=new E,gi=new E,T0=new Fe,b0=new Qn;class ui{constructor(e=0,t=0,n=0,i=ui.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],o=i[4],a=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];switch(t){case"XYZ":this._y=Math.asin(jt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-jt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(jt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-jt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(jt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-jt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return T0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(T0,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return b0.setFromEuler(this),this.setFromQuaternion(b0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ui.DEFAULT_ORDER="XYZ";class $c{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let XA=0;const w0=new E,Mo=new Qn,Ts=new Fe,Il=new E,Pa=new E,qA=new E,$A=new Qn,A0=new E(1,0,0),N0=new E(0,1,0),E0=new E(0,0,1),C0={type:"added"},YA={type:"removed"},So={type:"childadded",child:null},tp={type:"childremoved",child:null};class yt extends Ai{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:XA++}),this.uuid=bi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yt.DEFAULT_UP.clone();const e=new E,t=new ui,n=new Qn,i=new E(1,1,1);function r(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Fe},normalMatrix:{value:new Ke}}),this.matrix=new Fe,this.matrixWorld=new Fe,this.matrixAutoUpdate=yt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new $c,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Mo.setFromAxisAngle(e,t),this.quaternion.multiply(Mo),this}rotateOnWorldAxis(e,t){return Mo.setFromAxisAngle(e,t),this.quaternion.premultiply(Mo),this}rotateX(e){return this.rotateOnAxis(A0,e)}rotateY(e){return this.rotateOnAxis(N0,e)}rotateZ(e){return this.rotateOnAxis(E0,e)}translateOnAxis(e,t){return w0.copy(e).applyQuaternion(this.quaternion),this.position.add(w0.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(A0,e)}translateY(e){return this.translateOnAxis(N0,e)}translateZ(e){return this.translateOnAxis(E0,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ts.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Il.copy(e):Il.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Pa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ts.lookAt(Pa,Il,this.up):Ts.lookAt(Il,Pa,this.up),this.quaternion.setFromRotationMatrix(Ts),i&&(Ts.extractRotation(i.matrixWorld),Mo.setFromRotationMatrix(Ts),this.quaternion.premultiply(Mo.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(C0),So.child=e,this.dispatchEvent(So),So.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(YA),tp.child=e,this.dispatchEvent(tp),tp.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ts.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ts.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ts),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(C0),So.child=e,this.dispatchEvent(So),So.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,o=i.length;r<o;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pa,e,qA),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pa,$A,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function r(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let l=0,u=c.length;l<u;l++){const h=c[l];r(e.shapes,h)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let c=0,l=this.material.length;c<l;c++)a.push(r(e.materials,this.material[c]));i.material=a}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const c=this.animations[a];i.animations.push(r(e.animations,c))}}if(t){const a=o(e.geometries),c=o(e.materials),l=o(e.textures),u=o(e.images),h=o(e.shapes),d=o(e.skeletons),p=o(e.animations),f=o(e.nodes);a.length>0&&(n.geometries=a),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),p.length>0&&(n.animations=p),f.length>0&&(n.nodes=f)}return n.object=i,n;function o(a){const c=[];for(const l in a){const u=a[l];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}yt.DEFAULT_UP=new E(0,1,0);yt.DEFAULT_MATRIX_AUTO_UPDATE=!0;yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Yi=new E,bs=new E,np=new E,ws=new E,To=new E,bo=new E,R0=new E,ip=new E,sp=new E,rp=new E,op=new st,ap=new st,cp=new st;class Zn{constructor(e=new E,t=new E,n=new E){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Yi.subVectors(e,t),i.cross(Yi);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Yi.subVectors(i,t),bs.subVectors(n,t),np.subVectors(e,t);const o=Yi.dot(Yi),a=Yi.dot(bs),c=Yi.dot(np),l=bs.dot(bs),u=bs.dot(np),h=o*l-a*a;if(h===0)return r.set(0,0,0),null;const d=1/h,p=(l*c-a*u)*d,f=(o*u-a*c)*d;return r.set(1-p-f,f,p)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ws)===null?!1:ws.x>=0&&ws.y>=0&&ws.x+ws.y<=1}static getInterpolation(e,t,n,i,r,o,a,c){return this.getBarycoord(e,t,n,i,ws)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,ws.x),c.addScaledVector(o,ws.y),c.addScaledVector(a,ws.z),c)}static getInterpolatedAttribute(e,t,n,i,r,o){return op.setScalar(0),ap.setScalar(0),cp.setScalar(0),op.fromBufferAttribute(e,t),ap.fromBufferAttribute(e,n),cp.fromBufferAttribute(e,i),o.setScalar(0),o.addScaledVector(op,r.x),o.addScaledVector(ap,r.y),o.addScaledVector(cp,r.z),o}static isFrontFacing(e,t,n,i){return Yi.subVectors(n,t),bs.subVectors(e,t),Yi.cross(bs).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Yi.subVectors(this.c,this.b),bs.subVectors(this.a,this.b),Yi.cross(bs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return Zn.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return Zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let o,a;To.subVectors(i,n),bo.subVectors(r,n),ip.subVectors(e,n);const c=To.dot(ip),l=bo.dot(ip);if(c<=0&&l<=0)return t.copy(n);sp.subVectors(e,i);const u=To.dot(sp),h=bo.dot(sp);if(u>=0&&h<=u)return t.copy(i);const d=c*h-u*l;if(d<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(n).addScaledVector(To,o);rp.subVectors(e,r);const p=To.dot(rp),f=bo.dot(rp);if(f>=0&&p<=f)return t.copy(r);const x=p*l-c*f;if(x<=0&&l>=0&&f<=0)return a=l/(l-f),t.copy(n).addScaledVector(bo,a);const m=u*f-p*h;if(m<=0&&h-u>=0&&p-f>=0)return R0.subVectors(r,i),a=(h-u)/(h-u+(p-f)),t.copy(i).addScaledVector(R0,a);const g=1/(m+x+d);return o=x*g,a=d*g,t.copy(n).addScaledVector(To,o).addScaledVector(bo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Vy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Hs={h:0,s:0,l:0},Pl={h:0,s:0,l:0};function lp(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class _e{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,gt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=gt.workingColorSpace){return this.r=e,this.g=t,this.b=n,gt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=gt.workingColorSpace){if(e=em(e,1),t=jt(t,0,1),n=jt(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,o=2*n-r;this.r=lp(o,r,e+1/3),this.g=lp(o,r,e),this.b=lp(o,r,e-1/3)}return gt.toWorkingColorSpace(this,i),this}setStyle(e,t=kn){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kn){const n=Vy[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=jo(e.r),this.g=jo(e.g),this.b=jo(e.b),this}copyLinearToSRGB(e){return this.r=$d(e.r),this.g=$d(e.g),this.b=$d(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kn){return gt.fromWorkingColorSpace(Bn.copy(this),e),Math.round(jt(Bn.r*255,0,255))*65536+Math.round(jt(Bn.g*255,0,255))*256+Math.round(jt(Bn.b*255,0,255))}getHexString(e=kn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=gt.workingColorSpace){gt.fromWorkingColorSpace(Bn.copy(this),t);const n=Bn.r,i=Bn.g,r=Bn.b,o=Math.max(n,i,r),a=Math.min(n,i,r);let c,l;const u=(a+o)/2;if(a===o)c=0,l=0;else{const h=o-a;switch(l=u<=.5?h/(o+a):h/(2-o-a),o){case n:c=(i-r)/h+(i<r?6:0);break;case i:c=(r-n)/h+2;break;case r:c=(n-i)/h+4;break}c/=6}return e.h=c,e.s=l,e.l=u,e}getRGB(e,t=gt.workingColorSpace){return gt.fromWorkingColorSpace(Bn.copy(this),t),e.r=Bn.r,e.g=Bn.g,e.b=Bn.b,e}getStyle(e=kn){gt.fromWorkingColorSpace(Bn.copy(this),e);const t=Bn.r,n=Bn.g,i=Bn.b;return e!==kn?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Hs),this.setHSL(Hs.h+e,Hs.s+t,Hs.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Hs),e.getHSL(Pl);const n=Ka(Hs.h,Pl.h,t),i=Ka(Hs.s,Pl.s,t),r=Ka(Hs.l,Pl.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Bn=new _e;_e.NAMES=Vy;let ZA=0;class mn extends Ai{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ZA++}),this.uuid=bi(),this.name="",this.type="Material",this.blending=Ps,this.side=fs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ou,this.blendDst=Vu,this.blendEquation=Zs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new _e(0,0,0),this.blendAlpha=0,this.depthFunc=nr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ih,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=$s,this.stencilZFail=$s,this.stencilZPass=$s,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Ps&&(n.blending=this.blending),this.side!==fs&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Ou&&(n.blendSrc=this.blendSrc),this.blendDst!==Vu&&(n.blendDst=this.blendDst),this.blendEquation!==Zs&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==nr&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ih&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==$s&&(n.stencilFail=this.stencilFail),this.stencilZFail!==$s&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==$s&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const o=[];for(const a in r){const c=r[a];delete c.metadata,o.push(c)}return o}if(t){const r=i(e.textures),o=i(e.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ss extends mn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new _e(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ui,this.combine=fa,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Es=JA();function JA(){const s=new ArrayBuffer(4),e=new Float32Array(s),t=new Uint32Array(s),n=new Uint32Array(512),i=new Uint32Array(512);for(let c=0;c<256;++c){const l=c-127;l<-27?(n[c]=0,n[c|256]=32768,i[c]=24,i[c|256]=24):l<-14?(n[c]=1024>>-l-14,n[c|256]=1024>>-l-14|32768,i[c]=-l-1,i[c|256]=-l-1):l<=15?(n[c]=l+15<<10,n[c|256]=l+15<<10|32768,i[c]=13,i[c|256]=13):l<128?(n[c]=31744,n[c|256]=64512,i[c]=24,i[c|256]=24):(n[c]=31744,n[c|256]=64512,i[c]=13,i[c|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let c=1;c<1024;++c){let l=c<<13,u=0;for(;(l&8388608)===0;)l<<=1,u-=8388608;l&=-8388609,u+=947912704,r[c]=l|u}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(a[c]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:r,exponentTable:o,offsetTable:a}}function si(s){Math.abs(s)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),s=jt(s,-65504,65504),Es.floatView[0]=s;const e=Es.uint32View[0],t=e>>23&511;return Es.baseTable[t]+((e&8388607)>>Es.shiftTable[t])}function Za(s){const e=s>>10;return Es.uint32View[0]=Es.mantissaTable[Es.offsetTable[e]+(s&1023)]+Es.exponentTable[e],Es.floatView[0]}const By={toHalfFloat:si,fromHalfFloat:Za},an=new E,Ll=new J;class At{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=sa,this.updateRanges=[],this.gpuType=Gn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ll.fromBufferAttribute(this,t),Ll.applyMatrix3(e),this.setXY(t,Ll.x,Ll.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyMatrix3(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyMatrix4(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyNormalMatrix(e),this.setXYZ(t,an.x,an.y,an.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.transformDirection(e),this.setXYZ(t,an.x,an.y,an.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Yn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=ut(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Yn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Yn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Yn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Yn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array),r=ut(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==sa&&(e.usage=this.usage),e}}class KA extends At{constructor(e,t,n){super(new Int8Array(e),t,n)}}class jA extends At{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class QA extends At{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class e1 extends At{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Wh extends At{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class t1 extends At{constructor(e,t,n){super(new Int32Array(e),t,n)}}class tm extends At{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class zy extends At{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Za(this.array[e*this.itemSize]);return this.normalized&&(t=Yn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize]=si(t),this}getY(e){let t=Za(this.array[e*this.itemSize+1]);return this.normalized&&(t=Yn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+1]=si(t),this}getZ(e){let t=Za(this.array[e*this.itemSize+2]);return this.normalized&&(t=Yn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+2]=si(t),this}getW(e){let t=Za(this.array[e*this.itemSize+3]);return this.normalized&&(t=Yn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ut(t,this.array)),this.array[e*this.itemSize+3]=si(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array)),this.array[e+0]=si(t),this.array[e+1]=si(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array)),this.array[e+0]=si(t),this.array[e+1]=si(n),this.array[e+2]=si(i),this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=ut(t,this.array),n=ut(n,this.array),i=ut(i,this.array),r=ut(r,this.array)),this.array[e+0]=si(t),this.array[e+1]=si(n),this.array[e+2]=si(i),this.array[e+3]=si(r),this}}class Ve extends At{constructor(e,t,n){super(new Float32Array(e),t,n)}}let n1=0;const Ei=new Fe,up=new yt,wo=new E,xi=new Hn,La=new Hn,_n=new E;class at extends Ai{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:n1++}),this.uuid=bi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Uy(e)?tm:Wh)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new Ke().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Ei.makeRotationFromQuaternion(e),this.applyMatrix4(Ei),this}rotateX(e){return Ei.makeRotationX(e),this.applyMatrix4(Ei),this}rotateY(e){return Ei.makeRotationY(e),this.applyMatrix4(Ei),this}rotateZ(e){return Ei.makeRotationZ(e),this.applyMatrix4(Ei),this}translate(e,t,n){return Ei.makeTranslation(e,t,n),this.applyMatrix4(Ei),this}scale(e,t,n){return Ei.makeScale(e,t,n),this.applyMatrix4(Ei),this}lookAt(e){return up.lookAt(e),up.updateMatrix(),this.applyMatrix4(up.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wo).negate(),this.translate(wo.x,wo.y,wo.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Ve(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Hn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new E(-1/0,-1/0,-1/0),new E(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];xi.setFromBufferAttribute(r),this.morphTargetsRelative?(_n.addVectors(this.boundingBox.min,xi.min),this.boundingBox.expandByPoint(_n),_n.addVectors(this.boundingBox.max,xi.max),this.boundingBox.expandByPoint(_n)):(this.boundingBox.expandByPoint(xi.min),this.boundingBox.expandByPoint(xi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Dn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new E,1/0);return}if(e){const n=this.boundingSphere.center;if(xi.setFromBufferAttribute(e),t)for(let r=0,o=t.length;r<o;r++){const a=t[r];La.setFromBufferAttribute(a),this.morphTargetsRelative?(_n.addVectors(xi.min,La.min),xi.expandByPoint(_n),_n.addVectors(xi.max,La.max),xi.expandByPoint(_n)):(xi.expandByPoint(La.min),xi.expandByPoint(La.max))}xi.getCenter(n);let i=0;for(let r=0,o=e.count;r<o;r++)_n.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(_n));if(t)for(let r=0,o=t.length;r<o;r++){const a=t[r],c=this.morphTargetsRelative;for(let l=0,u=a.count;l<u;l++)_n.fromBufferAttribute(a,l),c&&(wo.fromBufferAttribute(e,l),_n.add(wo)),i=Math.max(i,n.distanceToSquared(_n))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new At(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),a=[],c=[];for(let C=0;C<n.count;C++)a[C]=new E,c[C]=new E;const l=new E,u=new E,h=new E,d=new J,p=new J,f=new J,x=new E,m=new E;function g(C,F,M){l.fromBufferAttribute(n,C),u.fromBufferAttribute(n,F),h.fromBufferAttribute(n,M),d.fromBufferAttribute(r,C),p.fromBufferAttribute(r,F),f.fromBufferAttribute(r,M),u.sub(l),h.sub(l),p.sub(d),f.sub(d);const b=1/(p.x*f.y-f.x*p.y);isFinite(b)&&(x.copy(u).multiplyScalar(f.y).addScaledVector(h,-p.y).multiplyScalar(b),m.copy(h).multiplyScalar(p.x).addScaledVector(u,-f.x).multiplyScalar(b),a[C].add(x),a[F].add(x),a[M].add(x),c[C].add(m),c[F].add(m),c[M].add(m))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let C=0,F=y.length;C<F;++C){const M=y[C],b=M.start,G=M.count;for(let W=b,$=b+G;W<$;W+=3)g(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const _=new E,v=new E,I=new E,T=new E;function w(C){I.fromBufferAttribute(i,C),T.copy(I);const F=a[C];_.copy(F),_.sub(I.multiplyScalar(I.dot(F))).normalize(),v.crossVectors(T,F);const b=v.dot(c[C])<0?-1:1;o.setXYZW(C,_.x,_.y,_.z,b)}for(let C=0,F=y.length;C<F;++C){const M=y[C],b=M.start,G=M.count;for(let W=b,$=b+G;W<$;W+=3)w(e.getX(W+0)),w(e.getX(W+1)),w(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new At(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,p=n.count;d<p;d++)n.setXYZ(d,0,0,0);const i=new E,r=new E,o=new E,a=new E,c=new E,l=new E,u=new E,h=new E;if(e)for(let d=0,p=e.count;d<p;d+=3){const f=e.getX(d+0),x=e.getX(d+1),m=e.getX(d+2);i.fromBufferAttribute(t,f),r.fromBufferAttribute(t,x),o.fromBufferAttribute(t,m),u.subVectors(o,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,f),c.fromBufferAttribute(n,x),l.fromBufferAttribute(n,m),a.add(u),c.add(u),l.add(u),n.setXYZ(f,a.x,a.y,a.z),n.setXYZ(x,c.x,c.y,c.z),n.setXYZ(m,l.x,l.y,l.z)}else for(let d=0,p=t.count;d<p;d+=3)i.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),o.fromBufferAttribute(t,d+2),u.subVectors(o,r),h.subVectors(i,r),u.cross(h),n.setXYZ(d+0,u.x,u.y,u.z),n.setXYZ(d+1,u.x,u.y,u.z),n.setXYZ(d+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)_n.fromBufferAttribute(e,t),_n.normalize(),e.setXYZ(t,_n.x,_n.y,_n.z)}toNonIndexed(){function e(a,c){const l=a.array,u=a.itemSize,h=a.normalized,d=new l.constructor(c.length*u);let p=0,f=0;for(let x=0,m=c.length;x<m;x++){a.isInterleavedBufferAttribute?p=c[x]*a.data.stride+a.offset:p=c[x]*u;for(let g=0;g<u;g++)d[f++]=l[p++]}return new At(d,u,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new at,n=this.index.array,i=this.attributes;for(const a in i){const c=i[a],l=e(c,n);t.setAttribute(a,l)}const r=this.morphAttributes;for(const a in r){const c=[],l=r[a];for(let u=0,h=l.length;u<h;u++){const d=l[u],p=e(d,n);c.push(p)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,c=o.length;a<c;a++){const l=o[a];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n){const l=n[c];e.data.attributes[c]=l.toJSON(e.data)}const i={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],u=[];for(let h=0,d=l.length;h<d;h++){const p=l[h];u.push(p.toJSON(e.data))}u.length>0&&(i[c]=u,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const l in i){const u=i[l];this.setAttribute(l,u.clone(t))}const r=e.morphAttributes;for(const l in r){const u=[],h=r[l];for(let d=0,p=h.length;d<p;d++)u.push(h[d].clone(t));this.morphAttributes[l]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let l=0,u=o.length;l<u;l++){const h=o[l];this.addGroup(h.start,h.count,h.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const I0=new Fe,Tr=new io,Dl=new Dn,P0=new E,Ul=new E,Fl=new E,Ol=new E,hp=new E,Vl=new E,L0=new E,Bl=new E;class kt extends yt{constructor(e=new at,t=new ss){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r<o;r++){const a=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const a=this.morphTargetInfluences;if(r&&a){Vl.set(0,0,0);for(let c=0,l=r.length;c<l;c++){const u=a[c],h=r[c];u!==0&&(hp.fromBufferAttribute(h,e),o?Vl.addScaledVector(hp,u):Vl.addScaledVector(hp.sub(t),u))}t.add(Vl)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Dl.copy(n.boundingSphere),Dl.applyMatrix4(r),Tr.copy(e.ray).recast(e.near),!(Dl.containsPoint(Tr.origin)===!1&&(Tr.intersectSphere(Dl,P0)===null||Tr.origin.distanceToSquared(P0)>(e.far-e.near)**2))&&(I0.copy(r).invert(),Tr.copy(e.ray).applyMatrix4(I0),!(n.boundingBox!==null&&Tr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Tr)))}_computeIntersections(e,t,n){let i;const r=this.geometry,o=this.material,a=r.index,c=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,d=r.groups,p=r.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,x=d.length;f<x;f++){const m=d[f],g=o[m.materialIndex],y=Math.max(m.start,p.start),_=Math.min(a.count,Math.min(m.start+m.count,p.start+p.count));for(let v=y,I=_;v<I;v+=3){const T=a.getX(v),w=a.getX(v+1),C=a.getX(v+2);i=zl(this,g,e,n,l,u,h,T,w,C),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const f=Math.max(0,p.start),x=Math.min(a.count,p.start+p.count);for(let m=f,g=x;m<g;m+=3){const y=a.getX(m),_=a.getX(m+1),v=a.getX(m+2);i=zl(this,o,e,n,l,u,h,y,_,v),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(c!==void 0)if(Array.isArray(o))for(let f=0,x=d.length;f<x;f++){const m=d[f],g=o[m.materialIndex],y=Math.max(m.start,p.start),_=Math.min(c.count,Math.min(m.start+m.count,p.start+p.count));for(let v=y,I=_;v<I;v+=3){const T=v,w=v+1,C=v+2;i=zl(this,g,e,n,l,u,h,T,w,C),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const f=Math.max(0,p.start),x=Math.min(c.count,p.start+p.count);for(let m=f,g=x;m<g;m+=3){const y=m,_=m+1,v=m+2;i=zl(this,o,e,n,l,u,h,y,_,v),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function i1(s,e,t,n,i,r,o,a){let c;if(e.side===ln?c=n.intersectTriangle(o,r,i,!0,a):c=n.intersectTriangle(i,r,o,e.side===fs,a),c===null)return null;Bl.copy(a),Bl.applyMatrix4(s.matrixWorld);const l=t.ray.origin.distanceTo(Bl);return l<t.near||l>t.far?null:{distance:l,point:Bl.clone(),object:s}}function zl(s,e,t,n,i,r,o,a,c,l){s.getVertexPosition(a,Ul),s.getVertexPosition(c,Fl),s.getVertexPosition(l,Ol);const u=i1(s,e,t,n,Ul,Fl,Ol,L0);if(u){const h=new E;Zn.getBarycoord(L0,Ul,Fl,Ol,h),i&&(u.uv=Zn.getInterpolatedAttribute(i,a,c,l,h,new J)),r&&(u.uv1=Zn.getInterpolatedAttribute(r,a,c,l,h,new J)),o&&(u.normal=Zn.getInterpolatedAttribute(o,a,c,l,h,new E),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:c,c:l,normal:new E,materialIndex:0};Zn.getNormal(Ul,Fl,Ol,d.normal),u.face=d,u.barycoord=h}return u}class _s extends at{constructor(e=1,t=1,n=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const c=[],l=[],u=[],h=[];let d=0,p=0;f("z","y","x",-1,-1,n,t,e,o,r,0),f("z","y","x",1,-1,n,t,-e,o,r,1),f("x","z","y",1,1,e,n,t,i,o,2),f("x","z","y",1,-1,e,n,-t,i,o,3),f("x","y","z",1,-1,e,t,n,i,r,4),f("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(c),this.setAttribute("position",new Ve(l,3)),this.setAttribute("normal",new Ve(u,3)),this.setAttribute("uv",new Ve(h,2));function f(x,m,g,y,_,v,I,T,w,C,F){const M=v/w,b=I/C,G=v/2,W=I/2,$=T/2,ie=w+1,q=C+1;let he=0,Q=0;const we=new E;for(let Ne=0;Ne<q;Ne++){const Ee=Ne*b-W;for(let Qe=0;Qe<ie;Qe++){const ht=Qe*M-G;we[x]=ht*y,we[m]=Ee*_,we[g]=$,l.push(we.x,we.y,we.z),we[x]=0,we[m]=0,we[g]=T>0?1:-1,u.push(we.x,we.y,we.z),h.push(Qe/w),h.push(1-Ne/C),he+=1}}for(let Ne=0;Ne<C;Ne++)for(let Ee=0;Ee<w;Ee++){const Qe=d+Ee+ie*Ne,ht=d+Ee+ie*(Ne+1),ne=d+(Ee+1)+ie*(Ne+1),ue=d+(Ee+1)+ie*Ne;c.push(Qe,ht,ue),c.push(ht,ne,ue),Q+=6}a.addGroup(p,Q,F),p+=Q,d+=he}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _s(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function oa(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function $n(s){const e={};for(let t=0;t<s.length;t++){const n=oa(s[t]);for(const i in n)e[i]=n[i]}return e}function s1(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function ky(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:gt.workingColorSpace}const nm={clone:oa,merge:$n};var r1=`void main() {
6
2
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
7
3
  }`,o1=`void main() {
8
4
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -3871,4 +3867,4 @@ ${e.tab}if ( ${u} ) {
3871
3867
  `}}class Nb{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.startTime=null,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let n=e.get(t);return n===void 0&&(n={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,n)),n}updateBeforeNode(e){const t=e.getUpdateBeforeType(),n=e.updateReference(this);if(t===We.FRAME){const{frameMap:i}=this._getMaps(this.updateBeforeMap,n);i.get(n)!==this.frameId&&e.updateBefore(this)!==!1&&i.set(n,this.frameId)}else if(t===We.RENDER){const{renderMap:i}=this._getMaps(this.updateBeforeMap,n);i.get(n)!==this.renderId&&e.updateBefore(this)!==!1&&i.set(n,this.renderId)}else t===We.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),n=e.updateReference(this);if(t===We.FRAME){const{frameMap:i}=this._getMaps(this.updateAfterMap,n);i.get(n)!==this.frameId&&e.updateAfter(this)!==!1&&i.set(n,this.frameId)}else if(t===We.RENDER){const{renderMap:i}=this._getMaps(this.updateAfterMap,n);i.get(n)!==this.renderId&&e.updateAfter(this)!==!1&&i.set(n,this.renderId)}else t===We.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),n=e.updateReference(this);if(t===We.FRAME){const{frameMap:i}=this._getMaps(this.updateMap,n);i.get(n)!==this.frameId&&e.update(this)!==!1&&i.set(n,this.frameId)}else if(t===We.RENDER){const{renderMap:i}=this._getMaps(this.updateMap,n);i.get(n)!==this.renderId&&e.update(this)!==!1&&i.set(n,this.renderId)}else t===We.OBJECT&&e.update(this)}update(){this.frameId++,this.lastTime===void 0&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class Kg{constructor(e,t,n=null,i="",r=!1){this.type=e,this.name=t,this.count=n,this.qualifier=i,this.isConst=r}}Kg.isNodeFunctionInput=!0;class I3 extends Ye{static get type(){return"StructTypeNode"}constructor(e){super(),this.types=e,this.isStructTypeNode=!0}getMemberTypes(){return this.types}}class jg extends Ye{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}setup(e){super.setup(e);const t=this.members,n=[];for(let i=0;i<t.length;i++)n.push(t[i].getNodeType(e));this.nodeType=e.getStructTypeFromNode(new I3(n)).name}generate(e,t){const n=e.getOutputStructName(),i=this.members,r=n!==""?n+".":"";for(let o=0;o<i.length;o++){const a=i[o].build(e,t);e.addLineFlowCode(`${r}m${o} = ${a}`,this)}return n}}const P3=K(jg);function Qg(s,e){for(let t=0;t<s.length;t++)if(s[t].name===e)return t;return-1}class Eb extends jg{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.isMRTNode=!0}has(e){return this.outputNodes[e]!==void 0}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes};return Vd(t)}setup(e){const t=this.outputNodes,n=e.renderer.getRenderTarget(),i=[],r=n.textures;for(const o in t){const a=Qg(r,o);i[a]=oe(t[o])}return this.members=i,super.setup(e)}}const Vd=K(Eb);class Cb extends Ye{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let n=this._candidateFnCall;if(n===null){let i=null,r=-1;for(const o of this.functionNodes){const c=o.shaderNode.layout;if(c===null)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const l=c.inputs;if(t.length===l.length){let u=0;for(let h=0;h<t.length;h++){const d=t[h],p=l[h];d.getNodeType(e)===p.type?u++:u=0}u>r&&(i=o,r=u)}}this._candidateFnCall=n=i(...t)}return n}}const L3=K(Cb),On=s=>(...e)=>L3(s,...e);class Sn extends uo{static get type(){return"TimerNode"}constructor(e=Sn.LOCAL,t=1,n=0){super(n),this.scope=e,this.scale=t,this.updateType=We.FRAME}update(e){const t=this.scope,n=this.scale;t===Sn.LOCAL?this.value+=e.deltaTime*n:t===Sn.DELTA?this.value=e.deltaTime*n:t===Sn.FRAME?this.value=e.frameId:this.value=e.time*n}serialize(e){super.serialize(e),e.scope=this.scope,e.scale=this.scale}deserialize(e){super.deserialize(e),this.scope=e.scope,this.scale=e.scale}}Sn.LOCAL="local";Sn.GLOBAL="global";Sn.DELTA="delta";Sn.FRAME="frame";const e0=(s,e=0)=>H(new Sn(Sn.LOCAL,s,e)),D3=(s,e=0)=>H(new Sn(Sn.GLOBAL,s,e)),U3=(s,e=0)=>H(new Sn(Sn.DELTA,s,e)),F3=fe(Sn,Sn.FRAME).toUint();class pn extends Ye{static get type(){return"OscNode"}constructor(e=pn.SINE,t=e0()){super(),this.method=e,this.timeNode=t}getNodeType(e){return this.timeNode.getNodeType(e)}setup(){const e=this.method,t=H(this.timeNode);let n=null;return e===pn.SINE?n=t.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5):e===pn.SQUARE?n=t.fract().round():e===pn.TRIANGLE?n=t.add(.5).fract().mul(2).sub(1).abs():e===pn.SAWTOOTH&&(n=t.fract()),n}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}pn.SINE="sine";pn.SQUARE="square";pn.TRIANGLE="triangle";pn.SAWTOOTH="sawtooth";const O3=K(pn,pn.SINE),V3=K(pn,pn.SQUARE),B3=K(pn,pn.TRIANGLE),z3=K(pn,pn.SAWTOOTH);class Rb extends Ye{static get type(){return"SpriteSheetUVNode"}constructor(e,t=rt(),n=A(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=n}setup(){const{frameNode:e,uvNode:t,countNode:n}=this,{width:i,height:r}=n,o=e.mod(i.mul(r)).floor(),a=o.mod(i),c=r.sub(o.add(1).div(i).ceil()),l=n.reciprocal(),u=z(a,c);return t.add(u).mul(l)}}const k3=K(Rb);class Ib extends mr{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}setup(e){return e.isAvailable("storageBuffer")===!1&&this.node.bufferObject===!0&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let n;const i=e.context.assign;if(e.isAvailable("storageBuffer")===!1?this.node.bufferObject===!0&&i!==!0?n=e.generatePBO(this):n=this.node.build(e):n=super.generate(e),i!==!0){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}const G3=K(Ib);class Pb extends Ye{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,n=null,i=A(1),r=en,o=hi){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=n,this.scaleNode=i,this.positionNode=r,this.normalNode=o}setup(){const{textureXNode:e,textureYNode:t,textureZNode:n,scaleNode:i,positionNode:r,normalNode:o}=this;let a=o.abs().normalize();a=a.div(a.dot(D(1)));const c=r.yz.mul(i),l=r.zx.mul(i),u=r.xy.mul(i),h=e.value,d=t!==null?t.value:h,p=n!==null?n.value:h,f=xt(h,c).mul(a.x),x=xt(d,l).mul(a.y),m=xt(p,u).mul(a.z);return Wt(f,x,m)}}const Lb=K(Pb),H3=(...s)=>Lb(...s),Uo=new cs,Pr=new E,Fo=new E,Jp=new E,Xa=new Fe,Su=new E(0,0,-1),Ns=new st,qa=new E,Tu=new E,$a=new st,bu=new J,E_=new fn,W3=_r.flipX();let Kp=!1;class Db extends gs{static get type(){return"ReflectorNode"}constructor(e={}){super(E_.texture,W3);const{target:t=new yt,resolution:n=1,generateMipmaps:i=!1,bounces:r=!0}=e;this.target=t,this.resolution=n,this.generateMipmaps=i,this.bounces=r,this.updateBeforeType=r?We.RENDER:We.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new WeakMap}_updateResolution(e,t){const n=this.resolution;t.getDrawingBufferSize(bu),e.setSize(Math.round(bu.width*n),Math.round(bu.height*n))}setup(e){return this._updateResolution(E_,e.renderer),super.setup(e)}getTextureNode(){return this.textureNode}getVirtualCamera(e){let t=this.virtualCameras.get(e);return t===void 0&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return t===void 0&&(t=new fn(0,0,{type:Ln}),this.generateMipmaps===!0&&(t.texture.minFilter=uy,t.texture.generateMipmaps=!0),this.renderTargets.set(e,t)),t}updateBefore(e){if(this.bounces===!1&&Kp)return!1;Kp=!0;const{scene:t,camera:n,renderer:i,material:r}=e,{target:o}=this,a=this.getVirtualCamera(n),c=this.getRenderTarget(a);if(i.getDrawingBufferSize(bu),this._updateResolution(c,i),Fo.setFromMatrixPosition(o.matrixWorld),Jp.setFromMatrixPosition(n.matrixWorld),Xa.extractRotation(o.matrixWorld),Pr.set(0,0,1),Pr.applyMatrix4(Xa),qa.subVectors(Fo,Jp),qa.dot(Pr)>0)return;qa.reflect(Pr).negate(),qa.add(Fo),Xa.extractRotation(n.matrixWorld),Su.set(0,0,-1),Su.applyMatrix4(Xa),Su.add(Jp),Tu.subVectors(Fo,Su),Tu.reflect(Pr).negate(),Tu.add(Fo),a.coordinateSystem=n.coordinateSystem,a.position.copy(qa),a.up.set(0,1,0),a.up.applyMatrix4(Xa),a.up.reflect(Pr),a.lookAt(Tu),a.near=n.near,a.far=n.far,a.updateMatrixWorld(),a.projectionMatrix.copy(n.projectionMatrix),Uo.setFromNormalAndCoplanarPoint(Pr,Fo),Uo.applyMatrix4(a.matrixWorldInverse),Ns.set(Uo.normal.x,Uo.normal.y,Uo.normal.z,Uo.constant);const l=a.projectionMatrix;$a.x=(Math.sign(Ns.x)+l.elements[8])/l.elements[0],$a.y=(Math.sign(Ns.y)+l.elements[9])/l.elements[5],$a.z=-1,$a.w=(1+l.elements[10])/l.elements[14],Ns.multiplyScalar(1/Ns.dot($a));const u=0;l.elements[2]=Ns.x,l.elements[6]=Ns.y,l.elements[10]=Ns.z-u,l.elements[14]=Ns.w,this.value=c.texture,r.visible=!1;const h=i.getRenderTarget(),d=i.getMRT();i.setMRT(null),i.setRenderTarget(c),i.render(t,a),i.setMRT(d),i.setRenderTarget(h),r.visible=!0,Kp=!1}}const X3=s=>H(new Db(s)),jp=new oo(-1,1,1,-1,0,1);class q3 extends at{constructor(e=!1){super();const t=e===!1?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Ve([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Ve(t,2))}}const $3=new q3;class ys extends kt{constructor(e=null){super($3,e),this.camera=jp,this.isQuadMesh=!0}renderAsync(e){return e.renderAsync(this,jp)}render(e){e.render(this,jp)}}const Y3=new J;class Ub extends gs{static get type(){return"RTTNode"}constructor(e,t=null,n=null,i={type:Ln}){const r=new fn(t,n,i);super(r.texture,rt()),this.node=e,this.width=t,this.height=n,this.renderTarget=r,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this.updateMap=new WeakMap,this._rttNode=null,this._quadMesh=new ys(new Tt),this.updateBeforeType=We.RENDER}get autoSize(){return this.width===null}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const n=e*this.pixelRatio,i=t*this.pixelRatio;this.renderTarget.setSize(n,i),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(this.textureNeedsUpdate===!1&&this.autoUpdate===!1)return;if(this.textureNeedsUpdate=!1,this.autoSize===!0){this.pixelRatio=e.getPixelRatio();const n=e.getSize(Y3);this.setSize(n.width,n.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new gs(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const Fb=(s,...e)=>H(new Ub(H(s),...e)),ei=(s,...e)=>s.isTextureNode?s:Fb(s,...e);class Ob extends Ag{static get type(){return"VertexColorNode"}constructor(e=0){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e),n=e.hasGeometryAttribute(t);let i;return n===!0?i=super.generate(e):i=e.generateConst(this.nodeType,new st(1,1,1,1)),i}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const Z3=(...s)=>H(new Ob(...s));class Vb extends Ye{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const J3=fe(Vb);class Qi extends Ye{static get type(){return"SceneNode"}constructor(e=Qi.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,n=this.scene!==null?this.scene:e.scene;let i;return t===Qi.BACKGROUND_BLURRINESS?i=dn("backgroundBlurriness","float",n):t===Qi.BACKGROUND_INTENSITY?i=dn("backgroundIntensity","float",n):console.error("THREE.SceneNode: Unknown scope:",t),i}}Qi.BACKGROUND_BLURRINESS="backgroundBlurriness";Qi.BACKGROUND_INTENSITY="backgroundIntensity";const K3=fe(Qi,Qi.BACKGROUND_BLURRINESS),j3=fe(Qi,Qi.BACKGROUND_INTENSITY),C_={Storage:"storage",ReadOnlyStorage:"read-only-storage"},Qp={WriteOnly:"write-only",ReadOnly:"read-only"};class t0 extends Rd{static get type(){return"StorageBufferNode"}constructor(e,t,n=0){super(e,t,n),this.isStorageBufferNode=!0,this.access=C_.Storage,this.isAtomic=!1,this.bufferObject=!1,this.bufferCount=n,this._attribute=null,this._varying=null,this.global=!0,e.isStorageBufferAttribute!==!0&&e.isStorageInstancedBufferAttribute!==!0&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(this.bufferCount===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return"storageBuffer"}element(e){return G3(this,e)}setBufferObject(e){return this.bufferObject=e,this}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(C_.ReadOnlyStorage)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}generate(e){if(e.isAvailable("storageBuffer"))return super.generate(e);const t=this.getNodeType(e);this._attribute===null&&(this._attribute=dl(this.value),this._varying=Un(this._attribute));const n=this._varying.build(e,t);return e.registerTransform(n,this._attribute),n}}const Q3=(s,e,t)=>H(new t0(s,e,t)),eD=(s,e,t)=>H(new t0(s,e,t).setBufferObject(!0));class Bb extends gs{static get type(){return"StorageTextureNode"}constructor(e,t,n=null){super(e,t),this.storeNode=n,this.isStorageTextureNode=!0,this.access=Qp.WriteOnly}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);t.storeNode=this.storeNode}setAccess(e){return this.access=e,this}generate(e,t){let n;return this.storeNode!==null?n=this.generateStore(e):n=super.generate(e,t),n}toReadOnly(){return this.setAccess(Qp.ReadOnly)}toWriteOnly(){return this.setAccess(Qp.WriteOnly)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:n,storeNode:i}=t,r=super.generate(e,"property"),o=n.build(e,"uvec2"),a=i.build(e,"vec4"),c=e.generateTextureStore(e,r,o,a);e.addLineFlowCode(c,this)}}const zb=K(Bb),tD=(s,e,t)=>{const n=zb(s,e,t);return t!==null&&n.append(),n};class kb extends ml{static get type(){return"UserDataNode"}constructor(e,t,n=null){super(e,t,n),this.userData=n}updateReference(e){return this.reference=this.userData!==null?this.userData:e.object.userData,this.reference}}const nD=(s,e,t)=>H(new kb(s,e,t));class Gb extends pt{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const iD=K(Gb);let ef=null;class Hb extends vl{static get type(){return"ViewportSharedTextureNode"}constructor(e=_r,t=null){ef===null&&(ef=new fm),super(e,t,ef)}updateReference(){return this}}const sD=K(Hb),rD=new J;class Wb extends gs{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class R_ extends Wb{static get type(){return"PassMultipleTextureNode"}constructor(e,t,n=!1){super(e,null),this.textureName=t,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class bn extends pt{static get type(){return"PassNode"}constructor(e,t,n,i={}){super("vec4"),this.scope=e,this.scene=t,this.camera=n,this.options=i,this._pixelRatio=1,this._width=1,this._height=1;const r=new ao;r.isRenderTargetTexture=!0,r.name="depth";const o=new fn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Ln,...i});o.texture.name="output",o.depthTexture=r,this.renderTarget=o,this.updateBeforeType=We.FRAME,this._textures={output:o.texture,depth:r},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=pe(0),this._cameraFar=pe(0),this._mrt=null,this.isPassNode=!0}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.isRenderTargetTexture=!0,t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),t.isRenderTargetTexture=!0,this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const n=this._textures[e],i=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[i]=t,this._textures[e]=t,this._previousTextures[e]=n,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(this._textureNodes[e]=t=H(new R_(this,e)),this._textureNodes[e].updateTexture()),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),this._previousTextureNodes[e]=t=H(new R_(this,e,!0)),this._previousTextureNodes[e].updateTexture()),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const n=this._cameraNear,i=this._cameraFar;this._viewZNodes[e]=t=Vg(this.getTextureNode(e),n,i)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const n=this._cameraNear,i=this._cameraFar,r=this.getViewZNode(e);this._linearDepthNodes[e]=t=rc(r,n,i)}return t}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,e.backend.isWebGLBackend===!0&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===bn.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:n,camera:i}=this;this._pixelRatio=t.getPixelRatio();const r=t.getSize(rD);this.setSize(r.width,r.height);const o=t.getRenderTarget(),a=t.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const c in this._previousTextures)this.toggleTexture(c);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(n,i),t.setRenderTarget(o),t.setMRT(a)}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget.setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}bn.COLOR="color";bn.DEPTH="depth";const oD=(s,e,t)=>H(new bn(bn.COLOR,s,e,t)),Na=(s,e)=>H(new Wb(s,e)),aD=(s,e)=>H(new bn(bn.DEPTH,s,e)),I_=new ys,P_=new ys;class Xb extends pt{static get type(){return"GaussianBlurNode"}constructor(e,t=null,n=2){super("vec4"),this.textureNode=e,this.directionNode=t,this.sigma=n,this._invSize=pe(new J),this._passDirection=pe(new J),this._horizontalRT=new fn,this._horizontalRT.texture.name="GaussianBlurNode.horizontal",this._verticalRT=new fn,this._verticalRT.texture.name="GaussianBlurNode.vertical",this._textureNode=Na(this,this._verticalRT.texture),this.updateBeforeType=We.RENDER,this.resolution=new J(1,1)}setSize(e,t){e=Math.max(Math.round(e*this.resolution.x),1),t=Math.max(Math.round(t*this.resolution.y),1),this._invSize.value.set(1/e,1/t),this._horizontalRT.setSize(e,t),this._verticalRT.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=this.textureNode,i=n.value,r=t.getRenderTarget(),o=t.getMRT(),a=n.value;I_.material=this._material,P_.material=this._material,this.setSize(i.image.width,i.image.height);const c=i.type;this._horizontalRT.texture.type=c,this._verticalRT.texture.type=c,t.setMRT(null),t.setRenderTarget(this._horizontalRT),this._passDirection.value.set(1,0),I_.render(t),n.value=this._horizontalRT.texture,t.setRenderTarget(this._verticalRT),this._passDirection.value.set(0,1),P_.render(t),t.setRenderTarget(r),t.setMRT(o),n.value=a}getTextureNode(){return this._textureNode}setup(e){const t=this.textureNode;if(t.isTextureNode!==!0)return console.error("GaussianBlurNode requires a TextureNode."),oe();const n=t.uvNode||rt(),i=z(this.directionNode||1),r=l=>t.uv(l),o=U(()=>{const l=3+2*this.sigma,u=this._getCoefficients(l),h=this._invSize,d=i.mul(this._passDirection),p=A(u[0]).toVar(),f=oe(r(n).mul(p)).toVar();for(let x=1;x<l;x++){const m=A(x),g=A(u[x]),y=z(d.mul(h.mul(m))).toVar(),_=oe(r(n.add(y))),v=oe(r(n.sub(y)));f.addAssign(_.add(v).mul(g)),p.addAssign(ot(2,g))}return f.div(p)}),a=this._material||(this._material=new Tt);a.fragmentNode=o().context(e.getSharedContext()),a.name="Gaussian_blur",a.needsUpdate=!0;const c=e.getNodeProperties(this);return c.textureNode=t,this._textureNode}dispose(){this._horizontalRT.dispose(),this._verticalRT.dispose()}_getCoefficients(e){const t=[];for(let n=0;n<e;n++)t.push(.39894*Math.exp(-.5*n*n/(e*e))/e);return t}}const cD=(s,e,t)=>H(new Xb(ei(s),e,t)),tf=new J,L_=new ys;class qb extends pt{static get type(){return"AfterImageNode"}constructor(e,t=.96){super(e),this.textureNode=e,this.textureNodeOld=xt(),this.damp=pe(t),this._compRT=new fn,this._compRT.texture.name="AfterImageNode.comp",this._oldRT=new fn,this._oldRT.texture.name="AfterImageNode.old",this._textureNode=Na(this,this._compRT.texture),this.updateBeforeType=We.RENDER}getTextureNode(){return this._textureNode}setSize(e,t){this._compRT.setSize(e,t),this._oldRT.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=this.textureNode,r=n.value.type;this._compRT.texture.type=r,this._oldRT.texture.type=r,t.getDrawingBufferSize(tf),this.setSize(tf.x,tf.y);const o=t.getRenderTarget(),a=n.value;this.textureNodeOld.value=this._oldRT.texture,t.setRenderTarget(this._compRT),L_.render(t);const c=this._oldRT;this._oldRT=this._compRT,this._compRT=c,t.setRenderTarget(o),n.value=a}setup(e){const t=this.textureNode,n=this.textureNodeOld,i=t.uvNode||rt();n.uvNode=i;const r=u=>t.uv(u),o=U(([u,h])=>{const d=A(h).toVar(),p=oe(u).toVar();return ft(cl(p.sub(d)),0)}),a=U(()=>{const u=oe(n),h=oe(r(i));return u.mulAssign(this.damp.mul(o(u,.1))),ft(h,u)}),c=this._materialComposed||(this._materialComposed=new Tt);c.name="AfterImage",c.fragmentNode=a(),L_.material=c;const l=e.getNodeProperties(this);return l.textureNode=t,this._textureNode}dispose(){this._compRT.dispose(),this._oldRT.dispose()}}const lD=(s,e)=>H(new qb(ei(s),e)),uD=U(([s])=>En(s.rgb)),hD=U(([s,e=A(1)])=>e.mix(En(s.rgb),s.rgb)),dD=U(([s,e=A(1)])=>{const t=Wt(s.r,s.g,s.b).div(3),n=s.r.max(s.g.max(s.b)),i=n.sub(t).mul(e).mul(-3);return it(s.rgb,n,i)}),pD=U(([s,e=A(1)])=>{const t=D(.57735,.57735,.57735),n=e.cos();return D(s.rgb.mul(n).add(t.cross(s.rgb).mul(e.sin()).add(t.mul($t(t,s.rgb).mul(n.oneMinus())))))}),fD=new E,En=(s,e=D(...gt.getLuminanceCoefficients(fD)))=>$t(s,e),$b=(s,e)=>it(D(0),s,En(s).sub(e).max(0)),D_=new ys;class Yb extends pt{static get type(){return"AnamorphicNode"}constructor(e,t,n,i){super("vec4"),this.textureNode=e,this.tresholdNode=t,this.scaleNode=n,this.colorNode=D(.1,0,1),this.samples=i,this.resolution=new J(1,1),this._renderTarget=new fn,this._renderTarget.texture.name="anamorphic",this._invSize=pe(new J),this._textureNode=Na(this,this._renderTarget.texture),this.updateBeforeType=We.RENDER}getTextureNode(){return this._textureNode}setSize(e,t){this._invSize.value.set(1/e,1/t),e=Math.max(Math.round(e*this.resolution.x),1),t=Math.max(Math.round(t*this.resolution.y),1),this._renderTarget.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=this.textureNode,i=n.value;this._renderTarget.texture.type=i.type;const r=t.getRenderTarget(),o=n.value;D_.material=this._material,this.setSize(i.image.width,i.image.height),t.setRenderTarget(this._renderTarget),D_.render(t),t.setRenderTarget(r),n.value=o}setup(e){const t=this.textureNode,n=t.uvNode||rt(),i=c=>t.uv(c),r=U(()=>{const c=this.samples,l=Math.floor(c/2),u=D(0).toVar();return mt({start:-l,end:l},({i:h})=>{const d=A(h).abs().div(l).oneMinus(),p=z(n.x.add(this._invSize.x.mul(h).mul(this.scaleNode)),n.y),f=i(p),x=$b(f,this.tresholdNode).mul(d);u.addAssign(x)}),u.mul(this.colorNode)}),o=this._material||(this._material=new Tt);o.name="Anamorphic",o.fragmentNode=r();const a=e.getNodeProperties(this);return a.textureNode=t,this._textureNode}dispose(){this._renderTarget.dispose()}}const mD=(s,e=.9,t=3,n=32)=>H(new Yb(ei(s),H(e),H(t),n));class Zb extends pt{static get type(){return"SobelOperatorNode"}constructor(e){super(),this.textureNode=e,this.updateBeforeType=We.RENDER,this._invSize=pe(new J)}updateBefore(){const e=this.textureNode.value;this._invSize.value.set(1/e.image.width,1/e.image.height)}setup(){const{textureNode:e}=this,t=e.uvNode||rt(),n=o=>e.uv(o);return U(()=>{const o=this._invSize,a=Tn(-1,-2,-1,0,0,0,1,2,1),c=Tn(-1,0,1,-2,0,2,-1,0,1),l=En(n(t.add(o.mul(z(-1,-1)))).xyz),u=En(n(t.add(o.mul(z(-1,0)))).xyz),h=En(n(t.add(o.mul(z(-1,1)))).xyz),d=En(n(t.add(o.mul(z(0,-1)))).xyz),p=En(n(t.add(o.mul(z(0,0)))).xyz),f=En(n(t.add(o.mul(z(0,1)))).xyz),x=En(n(t.add(o.mul(z(1,-1)))).xyz),m=En(n(t.add(o.mul(z(1,0)))).xyz),g=En(n(t.add(o.mul(z(1,1)))).xyz),y=Wt(a[0][0].mul(l),a[1][0].mul(d),a[2][0].mul(x),a[0][1].mul(u),a[1][1].mul(p),a[2][1].mul(m),a[0][2].mul(h),a[1][2].mul(f),a[2][2].mul(g)),_=Wt(c[0][0].mul(l),c[1][0].mul(d),c[2][0].mul(x),c[0][1].mul(u),c[1][1].mul(p),c[2][1].mul(m),c[0][2].mul(h),c[1][2].mul(f),c[2][2].mul(g)),v=y.mul(y).add(_.mul(_)).sqrt();return oe(D(v),1)})()}}const gD=s=>H(new Zb(ei(s)));class Jb extends pt{static get type(){return"DepthOfFieldNode"}constructor(e,t,n,i,r){super(),this.textureNode=e,this.viewZNode=t,this.focusNode=n,this.apertureNode=i,this.maxblurNode=r,this._aspect=pe(0),this.updateBeforeType=We.RENDER}updateBefore(){const e=this.textureNode.value;this._aspect.value=e.image.width/e.image.height}setup(){const e=this.textureNode,t=e.uvNode||rt(),n=o=>e.uv(o);return U(()=>{const o=z(1,this._aspect),a=this.focusNode.add(this.viewZNode),c=z(cn(a.mul(this.apertureNode),this.maxblurNode.negate(),this.maxblurNode)),l=c.mul(.9),u=c.mul(.7),h=c.mul(.4);let d=oe(0);return d=d.add(n(t)),d=d.add(n(t.add(z(0,.4).mul(o).mul(c)))),d=d.add(n(t.add(z(.15,.37).mul(o).mul(c)))),d=d.add(n(t.add(z(.29,.29).mul(o).mul(c)))),d=d.add(n(t.add(z(-.37,.15).mul(o).mul(c)))),d=d.add(n(t.add(z(.4,0).mul(o).mul(c)))),d=d.add(n(t.add(z(.37,-.15).mul(o).mul(c)))),d=d.add(n(t.add(z(.29,-.29).mul(o).mul(c)))),d=d.add(n(t.add(z(-.15,-.37).mul(o).mul(c)))),d=d.add(n(t.add(z(0,-.4).mul(o).mul(c)))),d=d.add(n(t.add(z(-.15,.37).mul(o).mul(c)))),d=d.add(n(t.add(z(-.29,.29).mul(o).mul(c)))),d=d.add(n(t.add(z(.37,.15).mul(o).mul(c)))),d=d.add(n(t.add(z(-.4,0).mul(o).mul(c)))),d=d.add(n(t.add(z(-.37,-.15).mul(o).mul(c)))),d=d.add(n(t.add(z(-.29,-.29).mul(o).mul(c)))),d=d.add(n(t.add(z(.15,-.37).mul(o).mul(c)))),d=d.add(n(t.add(z(.15,.37).mul(o).mul(l)))),d=d.add(n(t.add(z(-.37,.15).mul(o).mul(l)))),d=d.add(n(t.add(z(.37,-.15).mul(o).mul(l)))),d=d.add(n(t.add(z(-.15,-.37).mul(o).mul(l)))),d=d.add(n(t.add(z(-.15,.37).mul(o).mul(l)))),d=d.add(n(t.add(z(.37,.15).mul(o).mul(l)))),d=d.add(n(t.add(z(-.37,-.15).mul(o).mul(l)))),d=d.add(n(t.add(z(.15,-.37).mul(o).mul(l)))),d=d.add(n(t.add(z(.29,.29).mul(o).mul(u)))),d=d.add(n(t.add(z(.4,0).mul(o).mul(u)))),d=d.add(n(t.add(z(.29,-.29).mul(o).mul(u)))),d=d.add(n(t.add(z(0,-.4).mul(o).mul(u)))),d=d.add(n(t.add(z(-.29,.29).mul(o).mul(u)))),d=d.add(n(t.add(z(-.4,0).mul(o).mul(u)))),d=d.add(n(t.add(z(-.29,-.29).mul(o).mul(u)))),d=d.add(n(t.add(z(0,.4).mul(o).mul(u)))),d=d.add(n(t.add(z(.29,.29).mul(o).mul(h)))),d=d.add(n(t.add(z(.4,0).mul(o).mul(h)))),d=d.add(n(t.add(z(.29,-.29).mul(o).mul(h)))),d=d.add(n(t.add(z(0,-.4).mul(o).mul(h)))),d=d.add(n(t.add(z(-.29,.29).mul(o).mul(h)))),d=d.add(n(t.add(z(-.4,0).mul(o).mul(h)))),d=d.add(n(t.add(z(-.29,-.29).mul(o).mul(h)))),d=d.add(n(t.add(z(0,.4).mul(o).mul(h)))),d=d.div(41),d.a=1,oe(d)})()}}const xD=(s,e,t=1,n=.025,i=1)=>H(new Jb(ei(s),H(e),H(t),H(n),H(i)));class Kb extends pt{static get type(){return"DotScreenNode"}constructor(e,t=new J(.5,.5),n=1.57,i=1){super("vec4"),this.inputNode=e,this.center=pe(t),this.angle=pe(n),this.scale=pe(i)}setup(){const e=this.inputNode,t=U(()=>{const r=Cn(this.angle),o=Mi(this.angle),a=rt().mul(da).sub(this.center),c=z(o.mul(a.x).sub(r.mul(a.y)),r.mul(a.x).add(o.mul(a.y))).mul(this.scale);return Cn(c.x).mul(Cn(c.y)).mul(4)});return U(()=>{const r=e,o=Wt(r.r,r.g,r.b).div(3);return oe(D(o.mul(10).sub(5).add(t())),r.a)})()}}const _D=(s,e,t,n)=>H(new Kb(H(s),e,t,n));class jb extends pt{static get type(){return"RGBShiftNode"}constructor(e,t=.005,n=0){super("vec4"),this.textureNode=e,this.amount=pe(t),this.angle=pe(n)}setup(){const{textureNode:e}=this,t=e.uvNode||rt(),n=r=>e.uv(r);return U(()=>{const r=z(Mi(this.angle),Cn(this.angle)).mul(this.amount),o=n(t.add(r)),a=n(t),c=n(t.sub(r));return oe(o.r,a.g,c.b,a.a)})()}}const yD=(s,e,t)=>H(new jb(ei(s),e,t));class Qb extends pt{static get type(){return"FilmNode"}constructor(e,t=null,n=null){super(),this.inputNode=e,this.intensityNode=t,this.uvNode=n}setup(){const e=this.uvNode||rt();return U(()=>{const i=this.inputNode.rgb,r=yg(xr(e.add(e0())));let o=i.add(i.mul(cn(r.add(.1),0,1)));return this.intensityNode!==null&&(o=it(i,o,this.intensityNode)),oe(o,this.inputNode.a)})()}}const vD=K(Qb);class ew extends pt{static get type(){return"Lut3DNode"}constructor(e,t,n,i){super(),this.inputNode=e,this.lutNode=t,this.size=pe(n),this.intensityNode=i}setup(){const{inputNode:e,lutNode:t}=this,n=o=>t.uv(o);return U(()=>{const o=e,a=A(1).div(this.size),c=A(.5).div(this.size),l=D(c).add(o.rgb.mul(A(1).sub(a))),u=oe(n(l).rgb,o.a);return oe(it(o,u,this.intensityNode))})()}}const MD=(s,e,t,n)=>H(new ew(H(s),H(e),t,H(n))),U_=new ys,F_=new _e,SD=new J;class tw extends pt{static get type(){return"GTAONode"}constructor(e,t,n){super(),this.depthNode=e,this.normalNode=t,this.radius=pe(.25),this.resolution=pe(new J),this.thickness=pe(1),this.distanceExponent=pe(1),this.distanceFallOff=pe(1),this.scale=pe(1),this.noiseNode=xt(TD()),this.cameraProjectionMatrix=pe(n.projectionMatrix),this.cameraProjectionMatrixInverse=pe(n.projectionMatrixInverse),this.SAMPLES=pe(16),this._aoRenderTarget=new fn,this._aoRenderTarget.texture.name="GTAONode.AO",this._material=null,this._textureNode=Na(this,this._aoRenderTarget.texture),this.updateBeforeType=We.FRAME}getTextureNode(){return this._textureNode}setSize(e,t){this.resolution.value.set(e,t),this._aoRenderTarget.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=t.getDrawingBufferSize(SD),i=t.getRenderTarget(),r=t.getMRT();t.getClearColor(F_);const o=t.getClearAlpha();U_.material=this._material,this.setSize(n.width,n.height),t.setMRT(null),t.setClearColor(16777215,1),t.setRenderTarget(this._aoRenderTarget),U_.render(t),t.setRenderTarget(i),t.setMRT(r),t.setClearColor(F_,o)}setup(e){const t=rt(),n=l=>this.depthNode.uv(l).x,i=l=>this.noiseNode.uv(l),r=U(([l])=>{const u=this.cameraProjectionMatrix.mul(oe(l,1));let h=u.xy.div(u.w).mul(.5).add(.5).toVar();h=z(h.x,h.y.oneMinus());const d=n(h);return D(h,d)}),o=U(([l,u])=>{l=z(l.x,l.y.oneMinus()).mul(2).sub(1);const h=oe(D(l,u),1),d=oe(this.cameraProjectionMatrixInverse.mul(h));return d.xyz.div(d.w)}),a=U(()=>{const l=n(t);l.greaterThanEqual(1).discard();const u=o(t,l),h=this.normalNode.rgb.normalize(),d=this.radius,p=tr(this.noiseNode,0);let f=z(t.x,t.y.oneMinus());f=f.mul(this.resolution.div(p));const x=i(f),m=x.xyz.mul(2).sub(1),g=D(m.xy,0).normalize(),y=D(g.y.mul(-1),g.x,0),_=Tn(g,y,D(0,0,1)),v=this.SAMPLES.lessThan(30).select(3,5),I=Wt(this.SAMPLES,v.sub(1)).div(v),T=A(0).toVar();return mt({start:L(0),end:v,type:"int",condition:"<"},({i:w})=>{const C=A(w).div(A(v)).mul(to),F=oe(Mi(C),Cn(C),0,Wt(.5,ot(.5,x.w)));F.xyz=vi(_.mul(F.xyz));const M=vi(u.xyz.negate()),b=vi(Qo(F.xyz,M)),G=Qo(b,M),W=vi(h.sub(b.mul($t(h,b)))),$=Qo(W,b),ie=z($t(M,$),$t(M,$.negate())).toVar();mt({end:I,type:"int",name:"j",condition:"<"},({j:Qe})=>{const ht=F.xyz.mul(d).mul(F.w).mul(Kn(ns(A(Qe).add(1),A(I)),this.distanceExponent)),ne=r(u.add(ht)),Ae=o(ne.xy,ne.z).sub(u);Oe(Dt(Ae.z).lessThan(this.thickness),()=>{const Je=$t(M,vi(Ae));ie.x.addAssign(ft(0,ot(Je.sub(ie.x),it(1,A(2).div(A(Qe).add(2)),this.distanceFallOff))))});const ge=r(u.sub(ht)),Xe=o(ge.xy,ge.z).sub(u);Oe(Dt(Xe.z).lessThan(this.thickness),()=>{const Je=$t(M,vi(Xe));ie.y.addAssign(ft(0,ot(Je.sub(ie.y),it(1,A(2).div(A(Qe).add(2)),this.distanceFallOff))))})});const q=os(Ft(1,ie.mul(ie))),he=$t(W,G),Q=$t(W,M),we=ot(.5,gh(ie.y).sub(gh(ie.x)).add(q.x.mul(ie.x).sub(q.y.mul(ie.y)))),Ne=ot(.5,Ft(2,ie.x.mul(ie.x)).sub(ie.y.mul(ie.y))),Ee=he.mul(we).add(Q.mul(Ne));T.addAssign(Ee)}),T.assign(cn(T.div(v),0,1)),T.assign(Kn(T,this.scale)),oe(D(T),1)}),c=this._material||(this._material=new Tt);return c.fragmentNode=a().context(e.getSharedContext()),c.name="GTAO",c.needsUpdate=!0,this._textureNode}dispose(){this._aoRenderTarget.dispose()}}function TD(s=5){const e=Math.floor(s)%2===0?Math.floor(s)+1:Math.floor(s),t=bD(e),n=t.length,i=new Uint8Array(n*4);for(let o=0;o<n;++o){const a=t[o],c=2*Math.PI*a/n,l=new E(Math.cos(c),Math.sin(c),0).normalize();i[o*4]=(l.x*.5+.5)*255,i[o*4+1]=(l.y*.5+.5)*255,i[o*4+2]=127,i[o*4+3]=255}const r=new Oi(i,e,e);return r.wrapS=rr,r.wrapT=rr,r.needsUpdate=!0,r}function bD(s){const e=Math.floor(s)%2===0?Math.floor(s)+1:Math.floor(s),t=e*e,n=Array(t).fill(0);let i=Math.floor(e/2),r=e-1;for(let o=1;o<=t;){if(i===-1&&r===e?(r=e-2,i=0):(r===e&&(r=0),i<0&&(i=e-1)),n[i*e+r]!==0){r-=2,i++;continue}else n[i*e+r]=o++;r++,i--}return n}const wD=(s,e,t)=>H(new tw(H(s),H(e),t));class nw extends pt{static get type(){return"DenoiseNode"}constructor(e,t,n,i,r){super(),this.textureNode=e,this.depthNode=t,this.normalNode=n,this.noiseNode=i,this.cameraProjectionMatrixInverse=pe(r.projectionMatrixInverse),this.lumaPhi=pe(5),this.depthPhi=pe(5),this.normalPhi=pe(5),this.radius=pe(5),this.index=pe(0),this._resolution=pe(new J),this._sampleVectors=ds(AD(16,2,1)),this.updateBeforeType=We.RENDER}updateBefore(){const e=this.textureNode.value;this._resolution.value.set(e.image.width,e.image.height)}setup(){const e=rt(),t=h=>this.textureNode.uv(h),n=h=>this.depthNode.uv(h).x,i=h=>this.normalNode.uv(h),r=h=>this.noiseNode.uv(h),o=U(([h,d])=>{h=z(h.x,h.y.oneMinus()).mul(2).sub(1);const p=oe(D(h,d),1),f=oe(this.cameraProjectionMatrixInverse.mul(p));return f.xyz.div(f.w)}),a=U(([h,d,p,f])=>{const x=t(f),m=n(f),g=i(f).rgb.normalize(),y=x.rgb,_=o(f,m),v=$t(d,g).toVar(),I=Kn(ft(v,0),this.normalPhi).toVar(),T=Dt(En(y).sub(En(h))).toVar(),w=ft(A(1).sub(T.div(this.lumaPhi)),0).toVar(),C=Dt($t(p.sub(_),d)).toVar(),F=ft(A(1).sub(C.div(this.depthPhi)),0),M=w.mul(F).mul(I);return oe(y.mul(M),M)}),c=U(([h])=>{const d=n(h),p=i(h).rgb.normalize(),f=t(h);Oe(d.greaterThanEqual(1).or($t(p,p).equal(0)),()=>f);const x=D(f.rgb),m=o(h,d),g=tr(this.noiseNode,0);let y=z(h.x,h.y.oneMinus());y=y.mul(this._resolution.div(g));const _=r(y),v=Cn(_.element(this.index.mod(4).mul(2).mul(to))),I=Mi(_.element(this.index.mod(4).mul(2).mul(to))),T=z(v,I),w=ol(T.x,T.y.negate(),T.x,T.y),C=A(1).toVar(),F=D(f.rgb).toVar();return mt({start:L(0),end:L(16),type:"int",condition:"<"},({i:M})=>{const b=this._sampleVectors.element(M).toVar(),G=w.mul(b.xy.mul(A(1).add(b.z.mul(this.radius.sub(1))))).div(this._resolution).toVar(),W=h.add(G).toVar(),$=a(x,p,m,W);F.addAssign($.xyz),C.addAssign($.w)}),Oe(C.greaterThan(A(0)),()=>{F.divAssign(C)}),oe(F,f.a)}).setLayout({name:"denoise",type:"vec4",inputs:[{name:"uv",type:"vec2"}]});return U(()=>c(e))()}}function AD(s,e,t){const n=ND(s,e,t),i=[];for(let r=0;r<s;r++){const o=n[r];i.push(o)}return i}function ND(s,e,t){const n=[];for(let i=0;i<s;i++){const r=2*Math.PI*e*i/s,o=Math.pow(i/(s-1),t);n.push(new E(Math.cos(r),Math.sin(r),o))}return n}const ED=(s,e,t,n,i)=>H(new nw(ei(s),H(e),H(t),H(n),i));class iw extends pt{static get type(){return"FXAANode"}constructor(e){super(),this.textureNode=e,this.updateBeforeType=We.RENDER,this._invSize=pe(new J)}updateBefore(){const e=this.textureNode.value;this._invSize.value.set(1/e.image.width,1/e.image.height)}setup(){const e=this.textureNode.bias(-100),t=e.uvNode||rt(),n=u=>e.uv(u),i=(u,h,d)=>e.uv(u.add(h.mul(d))),r=L(5),o=U(([u,h])=>{const d=oe(h).toVar(),p=oe(u).toVar(),f=oe(Dt(p.sub(d))).toVar();return ft(ft(ft(f.r,f.g),f.b),f.a)}),a=U(([u,h,d,p])=>{const f=n(u).toVar(),x=i(u,z(0,-1),h.xy).toVar(),m=i(u,z(1,0),h.xy).toVar(),g=i(u,z(0,1),h.xy).toVar(),y=i(u,z(-1,0),h.xy).toVar(),_=o(f,g).toVar(),v=o(f,x).toVar(),I=o(f,m).toVar(),T=o(f,y).toVar(),w=ft(_,ft(v,ft(I,T))).toVar();Oe(w.lessThan(d),()=>f);const C=Ft(_.add(v),I.add(T)).toVar();C.mulAssign(p),Oe(Dt(C).lessThan(.3),()=>{const ht=I.greaterThan(T).select(1,-1).toVar(),ne=v.greaterThan(_).select(1,-1).toVar(),ue=z(ht,ne).toVar(),Ae=i(u,z(ue.x,ue.y),h.xy),ge=o(f,Ae).toVar(),Ze=i(u,z(ue.x.negate(),ue.y.negate()),h.xy),Xe=o(f,Ze).toVar();C.assign(Xe.sub(ge)),C.mulAssign(p),Oe(Dt(C).lessThan(.3),()=>{const Je=g.add(x).add(m).add(y);return it(f,Je.mul(.25),.4)})});const F=z().toVar();Oe(C.lessThanEqual(0),()=>{g.assign(y),x.assign(m),F.x.assign(0),F.y.assign(h.y)}).Else(()=>{F.x.assign(h.x),F.y.assign(0)});const M=o(f,g).toVar(),b=o(f,x).toVar();Oe(M.lessThanEqual(b),()=>{g.assign(x)});const G=L(0).toVar(),W=L(0).toVar(),$=A(0).toVar(),ie=A(0).toVar(),q=z(u).toVar(),he=z(u).toVar(),Q=L(0).toVar(),we=L(0).toVar();mt(r,({i:ht})=>{const ne=ht.add(1).toVar();Oe(G.equal(0),()=>{$.addAssign(ne),q.assign(u.add(F.mul($)));const ue=n(q.xy),Ae=o(ue,f).toVar(),ge=o(ue,g).toVar();Oe(Ae.greaterThan(ge),()=>{G.assign(1)}),Q.assign(ht)}),Oe(W.equal(0),()=>{ie.addAssign(ne),he.assign(u.sub(F.mul(ie)));const ue=n(he.xy),Ae=o(ue,f).toVar(),ge=o(ue,g).toVar();Oe(Ae.greaterThan(ge),()=>{W.assign(1)}),we.assign(ht)}),Oe(G.equal(1).or(W.equal(1)),()=>{Ld()})}),Oe(G.equal(0).and(W.equal(0)),()=>f);const Ne=A(1).toVar(),Ee=A(1).toVar();Oe(G.equal(1),()=>{Ne.assign(A(Q).div(A(r.sub(1))))}),Oe(W.equal(1),()=>{Ee.assign(A(we).div(A(r.sub(1))))});const Qe=Mn(Ne,Ee);return Qe.assign(Kn(Qe,.5)),Qe.assign(A(1).sub(Qe)),it(f,g,Qe.mul(.5))}).setLayout({name:"FxaaPixelShader",type:"vec4",inputs:[{name:"uv",type:"vec2"},{name:"fxaaQualityRcpFrame",type:"vec2"},{name:"fxaaQualityEdgeThreshold",type:"float"},{name:"fxaaQualityinvEdgeThreshold",type:"float"}]});return U(()=>{const u=A(.2),h=A(1).div(u);return a(t,this._invSize,u,h)})()}}const CD=s=>H(new iw(ei(s))),Lr=new ys,RD=new _e(0,0,0),O_=new _e,ID=new J,PD=new J(1,0),LD=new J(0,1);class sw extends pt{static get type(){return"BloomNode"}constructor(e,t=1,n=0,i=0){super(),this.inputNode=e,this.strength=pe(t),this.radius=pe(n),this.threshold=pe(i),this.smoothWidth=pe(.01),this._renderTargetsHorizontal=[],this._renderTargetsVertical=[],this._nMips=5,this._renderTargetBright=new fn(1,1,{type:Ln}),this._renderTargetBright.texture.name="UnrealBloomPass.bright",this._renderTargetBright.texture.generateMipmaps=!1;for(let r=0;r<this._nMips;r++){const o=new fn(1,1,{type:Ln});o.texture.name="UnrealBloomPass.h"+r,o.texture.generateMipmaps=!1,this._renderTargetsHorizontal.push(o);const a=new fn(1,1,{type:Ln});a.texture.name="UnrealBloomPass.v"+r,a.texture.generateMipmaps=!1,this._renderTargetsVertical.push(a)}this._compositeMaterial=null,this._highPassFilterMaterial=null,this._separableBlurMaterials=[],this._textureNodeBright=xt(this._renderTargetBright.texture),this._textureNodeBlur0=xt(this._renderTargetsVertical[0].texture),this._textureNodeBlur1=xt(this._renderTargetsVertical[1].texture),this._textureNodeBlur2=xt(this._renderTargetsVertical[2].texture),this._textureNodeBlur3=xt(this._renderTargetsVertical[3].texture),this._textureNodeBlur4=xt(this._renderTargetsVertical[4].texture),this._textureOutput=Na(this,this._renderTargetsHorizontal[0].texture),this.updateBeforeType=We.FRAME}getTextureNode(){return this._textureOutput}setSize(e,t){let n=Math.round(e/2),i=Math.round(t/2);this._renderTargetBright.setSize(n,i);for(let r=0;r<this._nMips;r++)this._renderTargetsHorizontal[r].setSize(n,i),this._renderTargetsVertical[r].setSize(n,i),this._separableBlurMaterials[r].invSize.value.set(1/n,1/i),n=Math.round(n/2),i=Math.round(i/2)}updateBefore(e){const{renderer:t}=e,n=t.getDrawingBufferSize(ID);this.setSize(n.width,n.height);const i=t.getRenderTarget(),r=t.getMRT();t.getClearColor(O_);const o=t.getClearAlpha();this.setSize(n.width,n.height),t.setMRT(null),t.setClearColor(RD,0),t.setRenderTarget(this._renderTargetBright),Lr.material=this._highPassFilterMaterial,Lr.render(t);let a=this._renderTargetBright;for(let c=0;c<this._nMips;c++)Lr.material=this._separableBlurMaterials[c],this._separableBlurMaterials[c].colorTexture.value=a.texture,this._separableBlurMaterials[c].direction.value=PD,t.setRenderTarget(this._renderTargetsHorizontal[c]),t.clear(),Lr.render(t),this._separableBlurMaterials[c].colorTexture.value=this._renderTargetsHorizontal[c].texture,this._separableBlurMaterials[c].direction.value=LD,t.setRenderTarget(this._renderTargetsVertical[c]),t.clear(),Lr.render(t),a=this._renderTargetsVertical[c];t.setRenderTarget(this._renderTargetsHorizontal[0]),t.clear(),Lr.material=this._compositeMaterial,Lr.render(t),t.setRenderTarget(i),t.setMRT(r),t.setClearColor(O_,o)}setup(e){const t=U(()=>{const c=this.inputNode,l=En(c.rgb),u=ti(this.threshold,this.threshold.add(this.smoothWidth),l);return it(oe(0),c,u)});this._highPassFilterMaterial=this._highPassFilterMaterial||new Tt,this._highPassFilterMaterial.fragmentNode=t().context(e.getSharedContext()),this._highPassFilterMaterial.name="Bloom_highPass",this._highPassFilterMaterial.needsUpdate=!0;const n=[3,5,7,9,11];for(let c=0;c<this._nMips;c++)this._separableBlurMaterials.push(this._getSeperableBlurMaterial(e,n[c]));const i=ds([1,.8,.6,.4,.2]),r=ds([new E(1,1,1),new E(1,1,1),new E(1,1,1),new E(1,1,1),new E(1,1,1)]),o=U(([c,l])=>{const u=A(1.2).sub(c);return it(c,u,l)}).setLayout({name:"lerpBloomFactor",type:"float",inputs:[{name:"factor",type:"float"},{name:"radius",type:"float"}]}),a=U(()=>{const c=o(i.element(0),this.radius).mul(oe(r.element(0),1)).mul(this._textureNodeBlur0),l=o(i.element(1),this.radius).mul(oe(r.element(1),1)).mul(this._textureNodeBlur1),u=o(i.element(2),this.radius).mul(oe(r.element(2),1)).mul(this._textureNodeBlur2),h=o(i.element(3),this.radius).mul(oe(r.element(3),1)).mul(this._textureNodeBlur3),d=o(i.element(4),this.radius).mul(oe(r.element(4),1)).mul(this._textureNodeBlur4);return c.add(l).add(u).add(h).add(d).mul(this.strength)});return this._compositeMaterial=this._compositeMaterial||new Tt,this._compositeMaterial.fragmentNode=a().context(e.getSharedContext()),this._compositeMaterial.name="Bloom_comp",this._compositeMaterial.needsUpdate=!0,this._textureOutput}dispose(){for(let e=0;e<this._renderTargetsHorizontal.length;e++)this._renderTargetsHorizontal[e].dispose();for(let e=0;e<this._renderTargetsVertical.length;e++)this._renderTargetsVertical[e].dispose();this._renderTargetBright.dispose()}_getSeperableBlurMaterial(e,t){const n=[];for(let d=0;d<t;d++)n.push(.39894*Math.exp(-.5*d*d/(t*t))/t);const i=xt(),r=ds(n),o=pe(new J),a=pe(new J(.5,.5)),c=rt(),l=d=>i.uv(d),u=U(()=>{const d=r.element(0).toVar(),p=l(c).rgb.mul(d).toVar();return mt({start:L(1),end:L(t),type:"int",condition:"<"},({i:f})=>{const x=A(f),m=r.element(f),g=a.mul(o).mul(x),y=l(c.add(g)).rgb,_=l(c.sub(g)).rgb;p.addAssign(Wt(y,_).mul(m)),d.addAssign(A(2).mul(m))}),oe(p.div(d),1)}),h=new Tt;return h.fragmentNode=u().context(e.getSharedContext()),h.name="Bloom_seperable",h.needsUpdate=!0,h.colorTexture=i,h.direction=a,h.invSize=o,h}}const DD=(s,e,t,n)=>H(new sw(H(s),e,t,n));class rw extends pt{static get type(){return"TransitionNode"}constructor(e,t,n,i,r,o){super(),this.textureNodeA=e,this.textureNodeB=t,this.mixTextureNode=n,this.mixRatioNode=i,this.thresholdNode=r,this.useTextureNode=o}setup(){const{textureNodeA:e,textureNodeB:t,mixTextureNode:n,mixRatioNode:i,thresholdNode:r,useTextureNode:o}=this,a=u=>{const h=u.uvNode||rt();return u.uv(h)};return U(()=>{const u=a(e),h=a(t),d=oe().toVar();return Oe(o.equal(L(1)),()=>{const p=a(n),f=i.mul(r.mul(2).add(1)).sub(r),x=cn(Ft(p.r,f).mul(A(1).div(r)),0,1);d.assign(it(u,h,x))}).Else(()=>{d.assign(it(h,u,i))}),d})()}}const UD=(s,e,t,n=0,i=.1,r=0)=>H(new rw(ei(s),ei(e),ei(t),H(n),H(i),H(r)));class FD extends pt{static get type(){return"PixelationNode"}constructor(e,t,n,i,r,o){super(),this.textureNode=e,this.depthNode=t,this.normalNode=n,this.pixelSize=i,this.normalEdgeStrength=r,this.depthEdgeStrength=o,this._resolution=pe(new st),this.updateBeforeType=We.RENDER}updateBefore(){const e=this.textureNode.value,t=e.image.width,n=e.image.height;this._resolution.value.set(t,n,1/t,1/n)}setup(){const{textureNode:e,depthNode:t,normalNode:n}=this,i=e.uvNode||rt(),r=t.uvNode||rt(),o=n.uvNode||rt(),a=()=>e.uv(i),c=(x,m)=>t.uv(r.add(z(x,m).mul(this._resolution.zw))).r,l=(x,m)=>n.uv(o.add(z(x,m).mul(this._resolution.zw))).rgb.normalize(),u=x=>{const m=ai("float","diff");return m.addAssign(cn(c(1,0).sub(x))),m.addAssign(cn(c(-1,0).sub(x))),m.addAssign(cn(c(0,1).sub(x))),m.addAssign(cn(c(0,-1).sub(x))),gr(ti(.01,.02,m).mul(2)).div(2)},h=(x,m,g,y)=>{const _=c(x,m).sub(g),v=l(x,m),I=D(1,1,1),T=$t(y.sub(v),I),w=cn(ti(-.01,.01,T),0,1),C=cn(cl(_.mul(.25).add(.0025)),0,1);return A(1).sub($t(y,v)).mul(C).mul(w)},d=(x,m)=>{const g=ai("float","indicator");return g.addAssign(h(0,-1,x,m)),g.addAssign(h(0,1,x,m)),g.addAssign(h(-1,0,x,m)),g.addAssign(h(1,0,x,m)),ll(.1,g)};return U(()=>{const x=a(),m=ai("float","depth"),g=ai("vec3","normal");Oe(this.depthEdgeStrength.greaterThan(0).or(this.normalEdgeStrength.greaterThan(0)),()=>{m.assign(c(0,0)),g.assign(l(0,0))});const y=ai("float","dei");Oe(this.depthEdgeStrength.greaterThan(0),()=>{y.assign(u(m))});const _=ai("float","nei");Oe(this.normalEdgeStrength.greaterThan(0),()=>{_.assign(d(m,g))});const v=y.greaterThan(0).select(A(1).sub(y.mul(this.depthEdgeStrength)),_.mul(this.normalEdgeStrength).add(1));return x.mul(v)})()}}const OD=(s,e,t,n=6,i=.3,r=.4)=>H(new FD(ei(s),ei(e),ei(t),H(n),H(i),H(r)));class ow extends bn{static get type(){return"PixelationPassNode"}constructor(e,t,n=6,i=.3,r=.4){super("color",e,t,{minFilter:Qt,magFilter:Qt}),this.pixelSize=n,this.normalEdgeStrength=i,this.depthEdgeStrength=r,this.isPixelationPassNode=!0,this._mrt=Vd({output:sg,normal:di})}setSize(e,t){const n=this.pixelSize.value?this.pixelSize.value:this.pixelSize,i=Math.floor(e/n),r=Math.floor(t/n);super.setSize(i,r)}setup(){const e=super.getTextureNode("output"),t=super.getTextureNode("depth"),n=super.getTextureNode("normal");return OD(e,t,n,this.pixelSize,this.normalEdgeStrength,this.depthEdgeStrength)}}const VD=(s,e,t,n,i)=>H(new ow(s,e,t,n,i)),BD=new J;class aw extends bn{static get type(){return"SSAAPassNode"}constructor(e,t){super(bn.COLOR,e,t),this.isSSAAPassNode=!0,this.sampleLevel=4,this.unbiased=!0,this.clearColor=new _e(0),this.clearAlpha=0,this._currentClearColor=new _e,this.sampleWeight=pe(1),this.sampleRenderTarget=null,this._quadMesh=new ys}updateBefore(e){const{renderer:t}=e,{scene:n,camera:i}=this;this._pixelRatio=t.getPixelRatio();const r=t.getSize(BD);this.setSize(r.width,r.height),this.sampleRenderTarget.setSize(this.renderTarget.width,this.renderTarget.height),t.getClearColor(this._currentClearColor);const o=t.getClearAlpha(),a=t.getRenderTarget(),c=t.getMRT(),l=t.autoClear;this._cameraNear.value=i.near,this._cameraFar.value=i.far,t.setMRT(this.getMRT()),t.autoClear=!1;const u=zD[Math.max(0,Math.min(this.sampleLevel,5))],h=1/u.length,d=1/32,p={fullWidth:this.renderTarget.width,fullHeight:this.renderTarget.height,offsetX:0,offsetY:0,width:this.renderTarget.width,height:this.renderTarget.height},f=Object.assign({},i.view);f.enabled&&Object.assign(p,f);for(let x=0;x<u.length;x++){const m=u[x];if(i.setViewOffset&&i.setViewOffset(p.fullWidth,p.fullHeight,p.offsetX+m[0]*.0625,p.offsetY+m[1]*.0625,p.width,p.height),this.sampleWeight.value=h,this.unbiased){const g=-.5+(x+.5)/u.length;this.sampleWeight.value+=d*g}t.setClearColor(this.clearColor,this.clearAlpha),t.setRenderTarget(this.sampleRenderTarget),t.clear(),t.render(n,i),t.setRenderTarget(this.renderTarget),x===0&&(t.setClearColor(0,0),t.clear()),this._quadMesh.render(t)}t.copyTextureToTexture(this.sampleRenderTarget.depthTexture,this.renderTarget.depthTexture),i.setViewOffset&&f.enabled?i.setViewOffset(f.fullWidth,f.fullHeight,f.offsetX,f.offsetY,f.width,f.height):i.clearViewOffset&&i.clearViewOffset(),t.setRenderTarget(a),t.setMRT(c),t.autoClear=l,t.setClearColor(this._currentClearColor,o)}setup(e){this.sampleRenderTarget===null&&(this.sampleRenderTarget=this.renderTarget.clone());let t;const n=this.getMRT();if(n!==null){const i={};for(const r in n.outputNodes){const o=Qg(this.sampleRenderTarget.textures,r);o>=0&&(i[r]=xt(this.sampleRenderTarget.textures[o]).mul(this.sampleWeight))}t=Vd(i)}else t=xt(this.sampleRenderTarget.texture).mul(this.sampleWeight);return this._quadMesh.material=new Tt,this._quadMesh.material.fragmentNode=t,this._quadMesh.material.transparent=!0,this._quadMesh.material.depthTest=!1,this._quadMesh.material.depthWrite=!1,this._quadMesh.material.premultipliedAlpha=!0,this._quadMesh.material.blending=cc,this._quadMesh.material.normals=!1,this._quadMesh.material.name="SSAA",super.setup(e)}dispose(){super.dispose(),this.sampleRenderTarget!==null&&this.sampleRenderTarget.dispose()}}const zD=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]],kD=(s,e)=>H(new aw(s,e)),GD=new J;class cw extends bn{static get type(){return"StereoPassNode"}constructor(e,t){super(bn.COLOR,e,t),this.isStereoPassNode=!0,this.stereo=new Dm,this.stereo.aspect=.5}updateBefore(e){const{renderer:t}=e,{scene:n,camera:i,stereo:r,renderTarget:o}=this;this._pixelRatio=t.getPixelRatio(),r.cameraL.coordinateSystem=t.coordinateSystem,r.cameraR.coordinateSystem=t.coordinateSystem,r.update(i);const a=t.getSize(GD);this.setSize(a.width,a.height);const c=t.autoClear;t.autoClear=!1;const l=t.getRenderTarget(),u=t.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const h in this._previousTextures)this.toggleTexture(h);t.setRenderTarget(o),t.setMRT(this._mrt),t.clear(),o.scissorTest=!0,o.scissor.set(0,0,o.width/2,o.height),o.viewport.set(0,0,o.width/2,o.height),t.render(n,r.cameraL),o.scissor.set(o.width/2,0,o.width/2,o.height),o.viewport.set(o.width/2,0,o.width/2,o.height),t.render(n,r.cameraR),o.scissorTest=!1,t.setRenderTarget(l),t.setMRT(u),t.autoClear=c}}const HD=(s,e)=>H(new cw(s,e)),WD=new J,V_=new ys;class lw extends bn{static get type(){return"StereoCompositePassNode"}constructor(e,t){super(bn.COLOR,e,t),this.isStereoCompositePassNode=!0,this.stereo=new Dm;const n={minFilter:Ut,magFilter:Qt,type:Ln};this._renderTargetL=new fn(1,1,n),this._renderTargetR=new fn(1,1,n),this._mapLeft=xt(this._renderTargetL.texture),this._mapRight=xt(this._renderTargetR.texture),this._material=null}updateStereoCamera(e){this.stereo.cameraL.coordinateSystem=e,this.stereo.cameraR.coordinateSystem=e,this.stereo.update(this.camera)}setSize(e,t){super.setSize(e,t),this._renderTargetL.setSize(this.renderTarget.width,this.renderTarget.height),this._renderTargetR.setSize(this.renderTarget.width,this.renderTarget.height)}updateBefore(e){const{renderer:t}=e,{scene:n,stereo:i,renderTarget:r}=this;this._pixelRatio=t.getPixelRatio(),this.updateStereoCamera(t.coordinateSystem);const o=t.getSize(WD);this.setSize(o.width,o.height);const a=t.getRenderTarget();t.setRenderTarget(this._renderTargetL),t.render(n,i.cameraL),t.setRenderTarget(this._renderTargetR),t.render(n,i.cameraR),t.setRenderTarget(r),V_.material=this._material,V_.render(t),t.setRenderTarget(a)}dispose(){super.dispose(),this._renderTargetL.dispose(),this._renderTargetR.dispose(),this._material!==null&&this._material.dispose()}}class uw extends lw{static get type(){return"AnaglyphPassNode"}constructor(e,t){super(e,t),this.isAnaglyphPassNode=!0,this._colorMatrixLeft=pe(new Ke().fromArray([.4561,-.0400822,-.0152161,.500484,-.0378246,-.0205971,.176381,-.0157589,-.00546856])),this._colorMatrixRight=pe(new Ke().fromArray([-.0434706,.378476,-.0721527,-.0879388,.73364,-.112961,-.00155529,-.0184503,1.2264]))}setup(e){const t=rt(),n=U(()=>{const r=this._mapLeft.uv(t),o=this._mapRight.uv(t),a=cn(this._colorMatrixLeft.mul(r.rgb).add(this._colorMatrixRight.mul(o.rgb)));return oe(a.rgb,ft(r.a,o.a))}),i=this._material||(this._material=new Tt);return i.fragmentNode=n().context(e.getSharedContext()),i.name="Anaglyph",i.needsUpdate=!0,super.setup(e)}}const XD=(s,e)=>H(new uw(s,e));class hw extends lw{static get type(){return"ParallaxBarrierPassNode"}constructor(e,t){super(e,t),this.isParallaxBarrierPassNode=!0}setup(e){const t=rt(),n=U(()=>{const r=oe().toVar();return Oe(Ad(Aa.y,2).greaterThan(1),()=>{r.assign(this._mapLeft.uv(t))}).Else(()=>{r.assign(this._mapRight.uv(t))}),r}),i=this._material||(this._material=new Tt);return i.fragmentNode=n().context(e.getSharedContext()),i.needsUpdate=!0,super.setup(e)}}const qD=(s,e)=>H(new hw(s,e));class dw extends bn{static get type(){return"ToonOutlinePassNode"}constructor(e,t,n,i,r){super(bn.COLOR,e,t),this.colorNode=n,this.thicknessNode=i,this.alphaNode=r,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,n=t.getRenderObjectFunction();t.setRenderObjectFunction((i,r,o,a,c,l,u)=>{if((c.isMeshToonMaterial||c.isMeshToonNodeMaterial)&&c.wireframe===!1){const h=this._getOutlineMaterial(c);t.renderObject(i,r,o,a,h,l,u)}t.renderObject(i,r,o,a,c,l,u)}),super.updateBefore(e),t.setRenderObjectFunction(n)}_createMaterial(){const e=new Tt;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=ln;const t=hi.negate(),n=ci.mul(xs),i=A(1),r=n.mul(oe(en,1)),o=n.mul(oe(en.add(t),1)),a=vi(r.sub(o));return e.vertexNode=r.add(a.mul(this.thicknessNode).mul(r.w).mul(i)),e.colorNode=oe(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return t===void 0&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const $D=(s,e,t=new _e(0,0,0),n=.003,i=1)=>H(new dw(s,e,H(t),H(n),H(i)));class pw extends Ye{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outpuType=null,this.events=new Ai,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return this.outputType!==null}set value(e){this._value!==e&&(this._cache&&this.inputType==="URL"&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&this._cache===null&&this.inputType==="URL"&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&e.value!==null&&e.value!==void 0&&((this.inputType==="URL"||this.inputType==="String")&&typeof e.value=="string"||this.inputType==="Number"&&typeof e.value=="number"||this.inputType==="Vector2"&&e.value.isVector2||this.inputType==="Vector3"&&e.value.isVector3||this.inputType==="Vector4"&&e.value.isVector4||this.inputType==="Color"&&e.value.isColor||this.inputType==="Matrix3"&&e.value.isMatrix3||this.inputType==="Matrix4"&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:A()}serialize(e){super.serialize(e),this.value!==null?this.inputType==="ArrayBuffer"?e.value=Wm(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;e.value!==null&&(e.inputType==="ArrayBuffer"?t=Xm(e.value):e.inputType==="Texture"?t=e.meta.textures[e.value]:t=e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Uu=K(pw);class fw extends Map{get(e,t=null,...n){if(this.has(e))return super.get(e);if(t!==null){const i=t(...n);return this.set(e,i),i}}}class YD{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Fu=new fw;class mw extends Ye{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new fw,this._output=Uu(),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const n=this._outputs;return n[e]===void 0?n[e]=Uu(t):n[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const n=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),n[e]=t,n[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),n[e]=t,n[e].events.addEventListener("refresh",this.onRefresh)):n[e]===void 0?(n[e]=Uu(t),n[e].events.addEventListener("refresh",this.onRefresh)):n[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const i=this.getObject()[e];if(typeof i=="function")return i(...t)}async callAsync(e,...t){const i=this.getObject()[e];if(typeof i=="function")return i.constructor.name==="AsyncFunction"?await i(...t):i(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){e!==null?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),this._object!==null)return this._object;const e=()=>this.refresh(),t=(l,u)=>this.setOutput(l,u),n=new YD(this),i=Fu.get("THREE"),r=Fu.get("TSL"),o=this.getMethod(this.codeNode),a=[n,this._local,Fu,e,t,i,r];this._object=o(...a);const c=this._object.layout;if(c&&(c.cache===!1&&this._local.clear(),this._output.outputType=c.outputType||null,Array.isArray(c.elements)))for(const l of c.elements){const u=l.id||l.name;l.inputType&&(this.getParameter(u)===void 0&&this.setParameter(u,null),this.getParameter(u).inputType=l.inputType),l.outputType&&(this.getOutput(u)===void 0&&this.setOutput(u,null),this.getOutput(u).outputType=l.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const t in this.parameters){let n=this.parameters[t];n.isScriptableNode&&(n=n.getDefaultOutput()),n.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:A()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),this._method!==null)return this._method;const e=["parameters","local","global","refresh","setOutput","THREE","TSL"],n=["layout","init","main","dispose"].join(", "),i="var "+n+`; var output = {};
3872
3868
  `,r=`
3873
3869
  return { ...output, `+n+" };",o=i+this.codeNode.code+r;return this._method=new Function(...e,o),this._method}dispose(){this._method!==null&&(this._object&&typeof this._object.dispose=="function"&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[zv(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const n in this.parameters)t.push(this.parameters[n].getCacheKey(e));return kv(t)}set needsUpdate(e){e===!0&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return this.codeNode===null?this:(this._needsOutputUpdate===!0&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value,this)}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const ZD=K(mw);class Bd extends Ye{static get type(){return"FogNode"}constructor(e,t){super("float"),this.isFogNode=!0,this.colorNode=e,this.factorNode=t}getViewZNode(e){let t;const n=e.context.getViewZ;return n!==void 0&&(t=n(this)),(t||Pn.z).negate()}setup(){return this.factorNode}}const JD=K(Bd);class gw extends Bd{static get type(){return"FogRangeNode"}constructor(e,t,n){super(e),this.isFogRangeNode=!0,this.nearNode=t,this.farNode=n}setup(e){const t=this.getViewZNode(e);return ti(this.nearNode,this.farNode,t)}}const KD=K(gw);class xw extends Bd{static get type(){return"FogExp2Node"}constructor(e,t){super(e),this.isFogExp2Node=!0,this.densityNode=t}setup(e){const t=this.getViewZNode(e),n=this.densityNode;return n.mul(n,t,t).negate().exp().oneMinus()}}const jD=K(xw);let Dr=null,Ur=null;class _w extends Ye{static get type(){return"RangeNode"}constructor(e=A(),t=A()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Is(this.minNode.value)),n=e.getTypeLength(Is(this.maxNode.value));return t>n?t:n}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let n=null;if(t.count>1){const i=this.minNode.value,r=this.maxNode.value,o=e.getTypeLength(Is(i)),a=e.getTypeLength(Is(r));Dr=Dr||new st,Ur=Ur||new st,Dr.setScalar(0),Ur.setScalar(0),o===1?Dr.setScalar(i):i.isColor?Dr.set(i.r,i.g,i.b):Dr.set(i.x,i.y,i.z||0,i.w||0),a===1?Ur.setScalar(r):r.isColor?Ur.set(r.r,r.g,r.b):Ur.set(r.x,r.y,r.z||0,r.w||0);const c=4,l=c*t.count,u=new Float32Array(l);for(let d=0;d<l;d++){const p=d%c,f=Dr.getComponent(p),x=Ur.getComponent(p);u[d]=Gh.lerp(f,x,Math.random())}const h=this.getNodeType(e);if(t.count<=4096)n=fl(u,"vec4",t.count).element(yl).convert(h);else{const d=new Us(u,4);e.geometry.setAttribute("__range"+this.id,d),n=_h(d).convert(h)}}else n=A(0);return n}}const QD=K(_w),eU=U(({depthTexture:s,shadowCoord:e})=>xt(s,e.xy).compare(e.z)),tU=U(({depthTexture:s,shadowCoord:e,shadow:t})=>{const n=(x,m)=>xt(s,x).compare(m),i=dn("mapSize","vec2",t).setGroup(_t),r=dn("radius","float",t).setGroup(_t),o=z(1).div(i),a=o.x.negate().mul(r),c=o.y.negate().mul(r),l=o.x.mul(r),u=o.y.mul(r),h=a.div(2),d=c.div(2),p=l.div(2),f=u.div(2);return Wt(n(e.xy.add(z(a,c)),e.z),n(e.xy.add(z(0,c)),e.z),n(e.xy.add(z(l,c)),e.z),n(e.xy.add(z(h,d)),e.z),n(e.xy.add(z(0,d)),e.z),n(e.xy.add(z(p,d)),e.z),n(e.xy.add(z(a,0)),e.z),n(e.xy.add(z(h,0)),e.z),n(e.xy,e.z),n(e.xy.add(z(p,0)),e.z),n(e.xy.add(z(l,0)),e.z),n(e.xy.add(z(h,f)),e.z),n(e.xy.add(z(0,f)),e.z),n(e.xy.add(z(p,f)),e.z),n(e.xy.add(z(a,u)),e.z),n(e.xy.add(z(0,u)),e.z),n(e.xy.add(z(l,u)),e.z)).mul(1/17)}),nU=U(({depthTexture:s,shadowCoord:e,shadow:t})=>{const n=(u,h)=>xt(s,u).compare(h),i=dn("mapSize","vec2",t).setGroup(_t),r=z(1).div(i),o=r.x,a=r.y,c=e.xy,l=xr(c.mul(i).add(.5));return c.subAssign(l.mul(r)),Wt(n(c,e.z),n(c.add(z(o,0)),e.z),n(c.add(z(0,a)),e.z),n(c.add(r),e.z),it(n(c.add(z(o.negate(),0)),e.z),n(c.add(z(o.mul(2),0)),e.z),l.x),it(n(c.add(z(o.negate(),a)),e.z),n(c.add(z(o.mul(2),a)),e.z),l.x),it(n(c.add(z(0,a.negate())),e.z),n(c.add(z(0,a.mul(2))),e.z),l.y),it(n(c.add(z(o,a.negate())),e.z),n(c.add(z(o,a.mul(2))),e.z),l.y),it(it(n(c.add(z(o.negate(),a.negate())),e.z),n(c.add(z(o.mul(2),a.negate())),e.z),l.x),it(n(c.add(z(o.negate(),a.mul(2))),e.z),n(c.add(z(o.mul(2),a.mul(2))),e.z),l.x),l.y)).mul(1/9)}),iU=U(({depthTexture:s,shadowCoord:e})=>{const t=A(1).toVar(),n=xt(s).uv(e.xy).rg,i=ll(e.z,n.x);return Oe(i.notEqual(A(1)),()=>{const r=e.z.sub(n.x),o=ft(0,n.y.mul(n.y));let a=o.div(o.add(r.mul(r)));a=cn(Ft(a,.3).div(.95-.3)),t.assign(cn(ft(i,a)))}),t}),sU=U(({samples:s,radius:e,size:t,shadowPass:n})=>{const i=A(0).toVar(),r=A(0).toVar(),o=s.lessThanEqual(A(1)).select(A(0),A(2).div(s.sub(1))),a=s.lessThanEqual(A(1)).select(A(0),A(-1));mt({start:L(0),end:L(s),type:"int",condition:"<"},({i:l})=>{const u=a.add(A(l).mul(o)),h=n.uv(Wt(Aa.xy,z(0,u).mul(e)).div(t)).x;i.addAssign(h),r.addAssign(h.mul(h))}),i.divAssign(s),r.divAssign(s);const c=os(r.sub(i.mul(i)));return z(i,c)}),rU=U(({samples:s,radius:e,size:t,shadowPass:n})=>{const i=A(0).toVar(),r=A(0).toVar(),o=s.lessThanEqual(A(1)).select(A(0),A(2).div(s.sub(1))),a=s.lessThanEqual(A(1)).select(A(0),A(-1));mt({start:L(0),end:L(s),type:"int",condition:"<"},({i:l})=>{const u=a.add(A(l).mul(o)),h=n.uv(Wt(Aa.xy,z(u,0).mul(e)).div(t));i.addAssign(h.x),r.addAssign(Wt(h.y.mul(h.y),h.x.mul(h.x)))}),i.divAssign(s),r.divAssign(s);const c=os(r.sub(i.mul(i)));return z(i,c)}),oU=[eU,tU,nU,iU];let Oo=null;const wu=new ys;class yr extends ho{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.updateType=We.FRAME,this.light=e,this.color=new _e,this.colorNode=pe(this.color).setGroup(_t),this.baseColorNode=null,this.shadowMap=null,this.shadowNode=null,this.shadowColorNode=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this.isAnalyticLightNode=!0}getCacheKey(){return km(super.getCacheKey(),this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}setupShadow(e){const{object:t,renderer:n}=e;if(n.shadowMap.enabled===!1)return;let i=this.shadowColorNode;if(i===null){Oo===null&&(Oo=new Tt,Oo.fragmentNode=oe(0,0,0,1),Oo.isShadowNodeMaterial=!0,Oo.name="ShadowMaterial");const r=n.shadowMap.type,o=this.light.shadow,a=new ao;a.compareFunction=jf;const c=e.createRenderTarget(o.mapSize.width,o.mapSize.height);if(c.depthTexture=a,o.camera.updateProjectionMatrix(),r===oi){a.compareFunction=null,this.vsmShadowMapVertical=e.createRenderTarget(o.mapSize.width,o.mapSize.height,{format:na,type:Ln}),this.vsmShadowMapHorizontal=e.createRenderTarget(o.mapSize.width,o.mapSize.height,{format:na,type:Ln});const _=xt(a),v=xt(this.vsmShadowMapVertical.texture),I=dn("blurSamples","float",o).setGroup(_t),T=dn("radius","float",o).setGroup(_t),w=dn("mapSize","vec2",o).setGroup(_t);let C=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Tt);C.fragmentNode=sU({samples:I,radius:T,size:w,shadowPass:_}).context(e.getSharedContext()),C.name="VSMVertical",C=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Tt),C.fragmentNode=rU({samples:I,radius:T,size:w,shadowPass:v}).context(e.getSharedContext()),C.name="VSMHorizontal"}const l=dn("intensity","float",o).setGroup(_t),u=dn("bias","float",o).setGroup(_t),h=dn("normalBias","float",o).setGroup(_t),d=t.material.shadowPositionNode||vh;let p=pe(o.matrix).setGroup(_t).mul(d.add(Ed.mul(h)));p=p.xyz.div(p.w);let f=p.z.add(u);n.coordinateSystem===Qr&&(f=f.mul(2).sub(1)),p=D(p.x,p.y.oneMinus(),f);const x=p.x.greaterThanEqual(0).and(p.x.lessThanEqual(1)).and(p.y.greaterThanEqual(0)).and(p.y.lessThanEqual(1)).and(p.z.lessThanEqual(1)),m=o.filterNode||oU[n.shadowMap.type]||null;if(m===null)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const g=xt(c.texture,p),y=x.select(m({depthTexture:r===oi?this.vsmShadowMapHorizontal.texture:a,shadowCoord:p,shadow:o}),A(1));this.shadowMap=c,this.light.shadow.map=c,this.shadowNode=y,this.shadowColorNode=i=this.colorNode.mul(it(1,y.rgb.mix(g,1),l.mul(g.a))),this.baseColorNode=this.colorNode}this.colorNode=i,this.updateBeforeType=We.RENDER}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):this.shadowNode!==null&&this.disposeShadow()}updateShadow(e){const{shadowMap:t,light:n}=this,{renderer:i,scene:r,camera:o}=e,a=i.shadowMap.type,c=t.depthTexture.version;this._depthVersionCached=c;const l=r.overrideMaterial;r.overrideMaterial=Oo,t.setSize(n.shadow.mapSize.width,n.shadow.mapSize.height),n.shadow.updateMatrices(n),n.shadow.camera.layers.mask=o.layers.mask;const u=i.getRenderTarget(),h=i.getRenderObjectFunction();i.setRenderObjectFunction((d,...p)=>{(d.castShadow===!0||d.receiveShadow&&a===oi)&&i.renderObject(d,...p)}),i.setRenderTarget(t),i.render(r,n.shadow.camera),i.setRenderObjectFunction(h),n.isPointLight!==!0&&a===oi&&this.vsmPass(e,n),i.setRenderTarget(u),r.overrideMaterial=l}vsmPass(e,t){const{renderer:n}=e;this.vsmShadowMapVertical.setSize(t.shadow.mapSize.width,t.shadow.mapSize.height),this.vsmShadowMapHorizontal.setSize(t.shadow.mapSize.width,t.shadow.mapSize.height),n.setRenderTarget(this.vsmShadowMapVertical),wu.material=this.vsmMaterialVertical,wu.render(n),n.setRenderTarget(this.vsmShadowMapHorizontal),wu.material=this.vsmMaterialHorizontal,wu.render(n)}disposeShadow(){this.shadowMap.dispose(),this.shadowMap=null,this.vsmShadowMapVertical!==null&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),this.vsmShadowMapHorizontal!==null&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),this.shadowNode=null,this.shadowColorNode=null,this.baseColorNode=null,this.updateBeforeType=We.NONE}updateBefore(e){const t=this.light.shadow;(t.needsUpdate||t.autoUpdate)&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const n0=U(s=>{const{lightDistance:e,cutoffDistance:t,decayExponent:n}=s,i=e.pow(n).max(.01).reciprocal();return t.greaterThan(0).select(i.mul(e.div(t).pow4().oneMinus().clamp().pow2()),i)});let Au;function i0(s){Au=Au||new WeakMap;let e=Au.get(s);return e===void 0&&Au.set(s,e={}),e}function s0(s){const e=i0(s);return e.position||(e.position=pe(new E).setGroup(_t).onRenderUpdate((t,n)=>n.value.setFromMatrixPosition(s.matrixWorld)))}function yw(s){const e=i0(s);return e.targetPosition||(e.targetPosition=pe(new E).setGroup(_t).onRenderUpdate((t,n)=>n.value.setFromMatrixPosition(s.target.matrixWorld)))}function zd(s){const e=i0(s);return e.viewPosition||(e.viewPosition=pe(new E).setGroup(_t).onRenderUpdate(({camera:t},n)=>{n.value=n.value||new E,n.value.setFromMatrixPosition(s.matrixWorld),n.value.applyMatrix4(t.matrixWorldInverse)}))}const r0=s=>pi.transformDirection(s0(s).sub(yw(s))),aU=U(([s])=>{const e=s.toUint().mul(747796405).add(2891336453),t=e.shiftRight(e.shiftRight(28).add(4)).bitXor(e).mul(277803737);return t.shiftRight(22).bitXor(t).toFloat().mul(1/2**32)}),Pf=(s,e)=>Kn(ot(4,s.mul(Ft(1,s))),e),cU=(s,e)=>s.lessThan(.5)?Pf(s.mul(2),e).div(2):Ft(1,Pf(ot(Ft(1,s),2),e).div(2)),lU=(s,e,t)=>Kn(ns(Kn(s,e),Wt(Kn(s,e),Kn(Ft(1,s),t))),1/e),uU=(s,e)=>Cn(to.mul(e.mul(s).sub(1))).div(to.mul(e.mul(s).sub(1))),us=U(([s])=>s.fract().sub(.5).abs()).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),vw=U(([s])=>D(us(s.z.add(us(s.y.mul(1)))),us(s.z.add(us(s.x.mul(1)))),us(s.y.add(us(s.x.mul(1)))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),hU=U(([s,e,t])=>{const n=D(s).toVar(),i=A(1.4).toVar(),r=A(0).toVar(),o=D(n).toVar();return mt({start:A(0),end:A(3),type:"float",condition:"<="},()=>{const a=D(vw(o.mul(2))).toVar();n.addAssign(a.add(t.mul(A(.1).mul(e)))),o.mulAssign(1.8),i.mulAssign(1.5),n.mulAssign(1.2);const c=A(us(n.z.add(us(n.x.add(us(n.y)))))).toVar();r.addAssign(c.div(i)),o.addAssign(.14)}),r}).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"p",type:"vec3"},{name:"spd",type:"float"},{name:"time",type:"float"}]}),dU=U(([s,e,t=z(.5)])=>Wg(s.sub(t),e).add(t)),pU=U(([s,e,t=z(.5)])=>{const n=s.sub(t),i=n.dot(n),o=i.mul(i).mul(e);return s.add(n.mul(o))}),fU=U(({position:s=null,horizontal:e=!0,vertical:t=!1})=>{let n;s!==null?(n=Ui.toVar(),n[3][0]=s.x,n[3][1]=s.y,n[3][2]=s.z):n=Ui;const i=pi.mul(n);return Oc(e)&&(i[0][0]=Ui[0].length(),i[0][1]=0,i[0][2]=0),Oc(t)&&(i[1][0]=0,i[1][1]=Ui[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,ci.mul(i).mul(en)}),mU=U(([s=null])=>{const e=Sh();return Sh(Og(s)).sub(e).lessThan(0).select(_r,s)}),B_=new WeakMap;class gU extends pt{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.updateType=We.OBJECT,this.updateAfterType=We.OBJECT,this.previousModelWorldMatrix=pe(new Fe),this.previousProjectionMatrix=pe(new Fe).setGroup(_t),this.previousCameraViewMatrix=pe(new Fe)}update({frameId:e,camera:t,object:n}){const i=z_(n);this.previousModelWorldMatrix.value.copy(i);const r=Mw(t);r.frameId!==e&&(r.frameId=e,r.previousProjectionMatrix===void 0?(r.previousProjectionMatrix=new Fe,r.previousCameraViewMatrix=new Fe,r.currentProjectionMatrix=new Fe,r.currentCameraViewMatrix=new Fe,r.previousProjectionMatrix.copy(t.projectionMatrix),r.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(r.previousProjectionMatrix.copy(r.currentProjectionMatrix),r.previousCameraViewMatrix.copy(r.currentCameraViewMatrix)),r.currentProjectionMatrix.copy(t.projectionMatrix),r.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(r.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(r.previousCameraViewMatrix))}updateAfter({object:e}){z_(e).copy(e.matrixWorld)}setup(){const e=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),t=ci.mul(xs).mul(en),n=this.previousProjectionMatrix.mul(e).mul(yh),i=t.xy.div(t.w),r=n.xy.div(n.w);return Ft(i,r)}}function Mw(s){let e=B_.get(s);return e===void 0&&(e={},B_.set(s,e)),e}function z_(s,e=0){const t=Mw(s);let n=t[e];return n===void 0&&(t[e]=n=new Fe),n}const xU=fe(gU),_U=U(([s,e])=>Mn(1,s.oneMinus().div(e)).oneMinus()).setLayout({name:"burnBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),yU=U(([s,e])=>Mn(s.div(e.oneMinus()),1)).setLayout({name:"dodgeBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),vU=U(([s,e])=>s.oneMinus().mul(e.oneMinus()).oneMinus()).setLayout({name:"screenBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),MU=U(([s,e])=>it(s.mul(2).mul(e),s.oneMinus().mul(2).mul(e.oneMinus()).oneMinus(),ll(.5,s))).setLayout({name:"overlayBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),SU=U(([s,e,t=L(16)])=>{const n=a=>s.uv(a),i=rt(),r=n(i).toVar(),o=A(t);return mt({start:L(1),end:t,type:"int",condition:"<="},({i:a})=>{const c=e.mul(A(a).div(o.sub(1)).sub(.5));r.addAssign(n(i.add(c)))}),r.divAssign(o),r}),TU=U(([s,e=1])=>{const t=s,n=En(t.rgb),i=D(n),r=Mn(1,ft(0,A(10).mul(n.sub(.45)))),o=i.mul(t.rgb).mul(2),a=A(2).mul(i.oneMinus()).mul(t.rgb.oneMinus()).oneMinus(),c=it(o,a,r),l=t.a.mul(e),u=l.mul(c.rgb);return u.addAssign(t.rgb.mul(l.oneMinus())),oe(u,t.a)}),bU=U(([s])=>{const e=D(s);return oe($t(e,D(.393,.769,.189)),$t(e,D(.349,.686,.168)),$t(e,D(.272,.534,.131)),s.a)}),Sw=U(([s])=>{const e=s.mul(.9478672986).add(.0521327014).pow(2.4),t=s.mul(.0773993808),n=s.lessThanEqual(.04045);return it(e,t,n)}).setLayout({name:"sRGBToLinearSRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Tw=U(([s])=>{const e=s.pow(.41666).mul(1.055).sub(.055),t=s.mul(12.92),n=s.lessThanEqual(.0031308);return it(e,t,n)}).setLayout({name:"linearSRGBTosRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),bw=U(([s,e])=>s.mul(e).clamp()).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),ww=U(([s,e])=>(s=s.mul(e),s.div(s.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Aw=U(([s,e])=>{s=s.mul(e),s=s.sub(.004).max(0);const t=s.mul(s.mul(6.2).add(.5)),n=s.mul(s.mul(6.2).add(1.7)).add(.06);return t.div(n).pow(2.2)}).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),wU=U(([s])=>{const e=s.mul(s.add(.0245786)).sub(90537e-9),t=s.mul(s.add(.432951).mul(.983729)).add(.238081);return e.div(t)}),Nw=U(([s,e])=>{const t=Tn(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),n=Tn(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return s=s.mul(e).div(.6),s=t.mul(s),s=wU(s),s=n.mul(s),s.clamp()}).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),AU=Tn(D(1.6605,-.1246,-.0182),D(-.5876,1.1329,-.1006),D(-.0728,-.0083,1.1187)),NU=Tn(D(.6274,.0691,.0164),D(.3293,.9195,.088),D(.0433,.0113,.8956)),EU=U(([s])=>{const e=D(s).toVar(),t=D(e.mul(e)).toVar(),n=D(t.mul(t)).toVar();return A(15.5).mul(n.mul(t)).sub(ot(40.14,n.mul(e))).add(ot(31.96,n).sub(ot(6.868,t.mul(e))).add(ot(.4298,t).add(ot(.1191,e).sub(.00232))))}),Ew=U(([s,e])=>{const t=D(s).toVar(),n=Tn(D(.856627153315983,.137318972929847,.11189821299995),D(.0951212405381588,.761241990602591,.0767994186031903),D(.0482516061458583,.101439036467562,.811302368396859)),i=Tn(D(1.1271005818144368,-.1413297634984383,-.14132976349843826),D(-.11060664309660323,1.157823702216272,-.11060664309660294),D(-.016493938717834573,-.016493938717834257,1.2519364065950405)),r=A(-12.47393),o=A(4.026069);return t.mulAssign(e),t.assign(NU.mul(t)),t.assign(n.mul(t)),t.assign(ft(t,1e-10)),t.assign(al(t)),t.assign(t.sub(r).div(o.sub(r))),t.assign(cn(t,0,1)),t.assign(EU(t)),t.assign(i.mul(t)),t.assign(Kn(ft(D(0),t),D(2.2))),t.assign(AU.mul(t)),t.assign(cn(t,0,1)),t}).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Cw=U(([s,e])=>{const t=A(.76),n=A(.15);s=s.mul(e);const i=Mn(s.r,Mn(s.g,s.b)),r=In(i.lessThan(.08),i.sub(ot(6.25,i.mul(i))),.04);s.subAssign(r);const o=ft(s.r,ft(s.g,s.b));Oe(o.lessThan(t),()=>s);const a=Ft(1,t),c=Ft(1,a.mul(a).div(o.add(a.sub(t))));s.mulAssign(c.div(o));const l=Ft(1,ns(1,n.mul(o.sub(c)).add(1)));return it(s,D(c),l)}).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class CU extends Ye{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}getNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){e.hasBuiltin(this._builtinName)}generate(e,t){const n=this.getBuiltinName(e),i=this.getNodeType(e);return e.shaderStage==="compute"?e.format(n,i,t):(console.warn(`ComputeBuiltinNode: Compute built-in value ${n} can not be accessed in the ${e.shaderStage} stage`),e.generateConst(i))}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const kd=(s,e)=>H(new CU(s,e)),RU=kd("numWorkgroups","uvec3"),IU=kd("workgroupId","uvec3"),PU=kd("localId","uvec3"),LU=kd("subgroupSize","uint");class DU extends Ye{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:n}=e;n.backend.isWebGLBackend===!0?e.addFlowCode(` // ${t}Barrier
3874
- `):e.addLineFlowCode(`${t}Barrier()`,this)}}const o0=K(DU),UU=()=>o0("workgroup").append(),FU=()=>o0("storage").append(),OU=()=>o0("texture").append();class VU extends mr{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let n;const i=e.context.assign;if(n=super.generate(e),i!==!0){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}class BU extends Ye{constructor(e,t,n=0){super(t),this.bufferType=t,this.bufferCount=n,this.isWorkgroupInfoNode=!0,this.scope=e}label(e){return this.name=e,this}getHash(){return this.uuid}setScope(e){return this.scope=e,this}getInputType(){return`${this.scope}Array`}element(e){return H(new VU(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const zU=(s,e)=>H(new BU("Workgroup",s,e));class wn extends pt{static get type(){return"AtomicFunctionNode"}constructor(e,t,n,i=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.storeNode=i}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,n=this.getNodeType(e),i=this.getInputType(e),r=this.pointerNode,o=this.valueNode,a=[];a.push(`&${r.build(e,i)}`),a.push(o.build(e,i));const c=`${e.getMethod(t,n)}( ${a.join(", ")} )`;if(this.storeNode!==null){const l=this.storeNode.build(e,i);e.addLineFlowCode(`${l} = ${c}`,this)}else e.addLineFlowCode(c,this)}}wn.ATOMIC_LOAD="atomicLoad";wn.ATOMIC_STORE="atomicStore";wn.ATOMIC_ADD="atomicAdd";wn.ATOMIC_SUB="atomicSub";wn.ATOMIC_MAX="atomicMax";wn.ATOMIC_MIN="atomicMin";wn.ATOMIC_AND="atomicAnd";wn.ATOMIC_OR="atomicOr";wn.ATOMIC_XOR="atomicXor";const kU=K(wn),Os=(s,e,t,n)=>{const i=kU(s,e,t,n);return i.append(),i},GU=(s,e,t=null)=>Os(wn.ATOMIC_STORE,s,e,t),HU=(s,e,t=null)=>Os(wn.ATOMIC_ADD,s,e,t),WU=(s,e,t=null)=>Os(wn.ATOMIC_SUB,s,e,t),XU=(s,e,t=null)=>Os(wn.ATOMIC_MAX,s,e,t),qU=(s,e,t=null)=>Os(wn.ATOMIC_MIN,s,e,t),$U=(s,e,t=null)=>Os(wn.ATOMIC_AND,s,e,t),YU=(s,e,t=null)=>Os(wn.ATOMIC_OR,s,e,t),ZU=(s,e,t=null)=>Os(wn.ATOMIC_XOR,s,e,t),JU=U(([s=rt()])=>{const e=s.mul(2),t=e.x.floor(),n=e.y.floor();return t.add(n).mod(2).sign()}),ac=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=cr(s).toVar();return In(r,i,n)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),bh=U(([s,e])=>{const t=cr(e).toVar(),n=A(s).toVar();return In(t,n.negate(),n)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),rn=U(([s])=>{const e=A(s).toVar();return L(gr(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),Ht=U(([s,e])=>{const t=A(s).toVar();return e.assign(rn(t)),t.sub(A(e))}),KU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=A(n).toVar(),l=A(t).toVar(),u=A(e).toVar(),h=A(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),jU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=D(n).toVar(),l=D(t).toVar(),u=D(e).toVar(),h=D(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),Rw=On([KU,jU]),QU=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=A(a).toVar(),x=A(o).toVar(),m=A(r).toVar(),g=A(i).toVar(),y=A(n).toVar(),_=A(t).toVar(),v=A(e).toVar(),I=A(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),eF=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=D(a).toVar(),x=D(o).toVar(),m=D(r).toVar(),g=D(i).toVar(),y=D(n).toVar(),_=D(t).toVar(),v=D(e).toVar(),I=D(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),Iw=On([QU,eF]),tF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=ve(s).toVar(),o=ve(r.bitAnd(ve(7))).toVar(),a=A(ac(o.lessThan(ve(4)),i,n)).toVar(),c=A(ot(2,ac(o.lessThan(ve(4)),n,i))).toVar();return bh(a,cr(o.bitAnd(ve(1)))).add(bh(c,cr(o.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),nF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=ve(s).toVar(),c=ve(a.bitAnd(ve(15))).toVar(),l=A(ac(c.lessThan(ve(8)),o,r)).toVar(),u=A(ac(c.lessThan(ve(4)),r,ac(c.equal(ve(12)).or(c.equal(ve(14))),o,i))).toVar();return bh(l,cr(c.bitAnd(ve(1)))).add(bh(u,cr(c.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yn=On([tF,nF]),iF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=wa(s).toVar();return D(yn(r.x,i,n),yn(r.y,i,n),yn(r.z,i,n))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),sF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=wa(s).toVar();return D(yn(a.x,o,r,i),yn(a.y,o,r,i),yn(a.z,o,r,i))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),Ri=On([iF,sF]),rF=U(([s])=>{const e=A(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),oF=U(([s])=>{const e=A(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),aF=U(([s])=>{const e=D(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Pw=On([rF,aF]),cF=U(([s])=>{const e=D(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Lw=On([oF,cF]),yi=U(([s,e])=>{const t=L(e).toVar(),n=ve(s).toVar();return n.shiftLeft(t).bitOr(n.shiftRight(L(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),Dw=U(([s,e,t])=>{s.subAssign(t),s.bitXorAssign(yi(t,L(4))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(6))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(8))),e.addAssign(s),s.subAssign(t),s.bitXorAssign(yi(t,L(16))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(19))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(4))),e.addAssign(s)}),Sl=U(([s,e,t])=>{const n=ve(t).toVar(),i=ve(e).toVar(),r=ve(s).toVar();return n.bitXorAssign(i),n.subAssign(yi(i,L(14))),r.bitXorAssign(n),r.subAssign(yi(n,L(11))),i.bitXorAssign(r),i.subAssign(yi(r,L(25))),n.bitXorAssign(i),n.subAssign(yi(i,L(16))),r.bitXorAssign(n),r.subAssign(yi(n,L(4))),i.bitXorAssign(r),i.subAssign(yi(r,L(14))),n.bitXorAssign(i),n.subAssign(yi(i,L(24))),n}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Wn=U(([s])=>{const e=ve(s).toVar();return A(e).div(A(ve(L(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),ps=U(([s])=>{const e=A(s).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),lF=U(([s])=>{const e=L(s).toVar(),t=ve(ve(1)).toVar(),n=ve(ve(L(3735928559)).add(t.shiftLeft(ve(2))).add(ve(13))).toVar();return Sl(n.add(ve(e)),n,n)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),uF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(ve(2)).toVar(),r=ve().toVar(),o=ve().toVar(),a=ve().toVar();return r.assign(o.assign(a.assign(ve(L(3735928559)).add(i.shiftLeft(ve(2))).add(ve(13))))),r.addAssign(ve(n)),o.addAssign(ve(t)),Sl(r,o,a)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),hF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(ve(3)).toVar(),a=ve().toVar(),c=ve().toVar(),l=ve().toVar();return a.assign(c.assign(l.assign(ve(L(3735928559)).add(o.shiftLeft(ve(2))).add(ve(13))))),a.addAssign(ve(r)),c.addAssign(ve(i)),l.addAssign(ve(n)),Sl(a,c,l)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),dF=U(([s,e,t,n])=>{const i=L(n).toVar(),r=L(t).toVar(),o=L(e).toVar(),a=L(s).toVar(),c=ve(ve(4)).toVar(),l=ve().toVar(),u=ve().toVar(),h=ve().toVar();return l.assign(u.assign(h.assign(ve(L(3735928559)).add(c.shiftLeft(ve(2))).add(ve(13))))),l.addAssign(ve(a)),u.addAssign(ve(o)),h.addAssign(ve(r)),Dw(l,u,h),l.addAssign(ve(i)),Sl(l,u,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),pF=U(([s,e,t,n,i])=>{const r=L(i).toVar(),o=L(n).toVar(),a=L(t).toVar(),c=L(e).toVar(),l=L(s).toVar(),u=ve(ve(5)).toVar(),h=ve().toVar(),d=ve().toVar(),p=ve().toVar();return h.assign(d.assign(p.assign(ve(L(3735928559)).add(u.shiftLeft(ve(2))).add(ve(13))))),h.addAssign(ve(l)),d.addAssign(ve(c)),p.addAssign(ve(a)),Dw(h,d,p),h.addAssign(ve(o)),d.addAssign(ve(r)),Sl(h,d,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Pt=On([lF,uF,hF,dF,pF]),fF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(Pt(n,t)).toVar(),r=wa().toVar();return r.x.assign(i.bitAnd(L(255))),r.y.assign(i.shiftRight(L(8)).bitAnd(L(255))),r.z.assign(i.shiftRight(L(16)).bitAnd(L(255))),r}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),mF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(Pt(r,i,n)).toVar(),a=wa().toVar();return a.x.assign(o.bitAnd(L(255))),a.y.assign(o.shiftRight(L(8)).bitAnd(L(255))),a.z.assign(o.shiftRight(L(16)).bitAnd(L(255))),a}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),Ii=On([fF,mF]),gF=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=A(Rw(yn(Pt(t,n),i,r),yn(Pt(t.add(L(1)),n),i.sub(1),r),yn(Pt(t,n.add(L(1))),i,r.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),xF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=A(Iw(yn(Pt(t,n,i),r,o,a),yn(Pt(t.add(L(1)),n,i),r.sub(1),o,a),yn(Pt(t,n.add(L(1)),i),r,o.sub(1),a),yn(Pt(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),yn(Pt(t,n,i.add(L(1))),r,o,a.sub(1)),yn(Pt(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),yn(Pt(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),a0=On([gF,xF]),_F=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=D(Rw(Ri(Ii(t,n),i,r),Ri(Ii(t.add(L(1)),n),i.sub(1),r),Ri(Ii(t,n.add(L(1))),i,r.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),yF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=D(Iw(Ri(Ii(t,n,i),r,o,a),Ri(Ii(t.add(L(1)),n,i),r.sub(1),o,a),Ri(Ii(t,n.add(L(1)),i),r,o.sub(1),a),Ri(Ii(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),Ri(Ii(t,n,i.add(L(1))),r,o,a.sub(1)),Ri(Ii(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),Ri(Ii(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),c0=On([_F,yF]),vF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return Wn(Pt(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),MF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return Wn(Pt(t,n))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),SF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return Wn(Pt(t,n,i))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),TF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return Wn(Pt(t,n,i,r))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),bF=On([vF,MF,SF,TF]),wF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return D(Wn(Pt(t,L(0))),Wn(Pt(t,L(1))),Wn(Pt(t,L(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),AF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return D(Wn(Pt(t,n,L(0))),Wn(Pt(t,n,L(1))),Wn(Pt(t,n,L(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),NF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return D(Wn(Pt(t,n,i,L(0))),Wn(Pt(t,n,i,L(1))),Wn(Pt(t,n,i,L(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),EF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return D(Wn(Pt(t,n,i,r,L(0))),Wn(Pt(t,n,i,r,L(1))),Wn(Pt(t,n,i,r,L(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),Uw=On([wF,AF,NF,EF]),wh=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=A(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(a0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),Fw=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(c0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar();return z(wh(a,o,r,i),wh(a.add(D(L(19),L(193),L(17))),o,r,i))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),RF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(Fw(a,o,r,i)).toVar(),l=A(wh(a.add(D(L(19),L(193),L(17))),o,r,i)).toVar();return oe(c,l)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IF=U(([s,e,t,n,i,r,o])=>{const a=L(o).toVar(),c=A(r).toVar(),l=L(i).toVar(),u=L(n).toVar(),h=L(t).toVar(),d=L(e).toVar(),p=z(s).toVar(),f=D(Uw(z(d.add(u),h.add(l)))).toVar(),x=z(f.x,f.y).toVar();x.subAssign(.5),x.mulAssign(c),x.addAssign(.5);const m=z(z(A(d),A(h)).add(x)).toVar(),g=z(m.sub(p)).toVar();return Oe(a.equal(L(2)),()=>Dt(g.x).add(Dt(g.y))),Oe(a.equal(L(3)),()=>ft(Dt(g.x),Dt(g.y))),$t(g,g)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),PF=U(([s,e,t,n,i,r,o,a,c])=>{const l=L(c).toVar(),u=A(a).toVar(),h=L(o).toVar(),d=L(r).toVar(),p=L(i).toVar(),f=L(n).toVar(),x=L(t).toVar(),m=L(e).toVar(),g=D(s).toVar(),y=D(Uw(D(m.add(p),x.add(d),f.add(h)))).toVar();y.subAssign(.5),y.mulAssign(u),y.addAssign(.5);const _=D(D(A(m),A(x),A(f)).add(y)).toVar(),v=D(_.sub(g)).toVar();return Oe(l.equal(L(2)),()=>Dt(v.x).add(Dt(v.y)).add(Dt(v.z))),Oe(l.equal(L(3)),()=>ft(ft(Dt(v.x),Dt(v.y)),Dt(v.z))),$t(v,v)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),Ea=On([IF,PF]),LF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();l.assign(Mn(l,d))})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.y.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.z.assign(l.y),l.y.assign(d)}).ElseIf(d.lessThan(l.z),()=>{l.z.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),FF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();u.assign(Mn(u,f))})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OF=On([LF,FF]),VF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.y.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),BF=On([DF,VF]),zF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(f)}).ElseIf(f.lessThan(u.z),()=>{u.z.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kF=On([UF,zF]),GF=U(([s])=>{const e=s.y,t=s.z,n=D().toVar();return Oe(e.lessThan(1e-4),()=>{n.assign(D(t,t,t))}).Else(()=>{let i=s.x;i=i.sub(gr(i)).mul(6).toVar();const r=L(mg(i)),o=i.sub(A(r)),a=t.mul(e.oneMinus()),c=t.mul(e.mul(o).oneMinus()),l=t.mul(e.mul(o.oneMinus()).oneMinus());Oe(r.equal(L(0)),()=>{n.assign(D(t,l,a))}).ElseIf(r.equal(L(1)),()=>{n.assign(D(c,t,a))}).ElseIf(r.equal(L(2)),()=>{n.assign(D(a,t,l))}).ElseIf(r.equal(L(3)),()=>{n.assign(D(a,c,t))}).ElseIf(r.equal(L(4)),()=>{n.assign(D(l,a,t))}).Else(()=>{n.assign(D(t,a,c))})}),n}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),HF=U(([s])=>{const e=D(s).toVar(),t=A(e.x).toVar(),n=A(e.y).toVar(),i=A(e.z).toVar(),r=A(Mn(t,Mn(n,i))).toVar(),o=A(ft(t,ft(n,i))).toVar(),a=A(o.sub(r)).toVar(),c=A().toVar(),l=A().toVar(),u=A().toVar();return u.assign(o),Oe(o.greaterThan(0),()=>{l.assign(a.div(o))}).Else(()=>{l.assign(0)}),Oe(l.lessThanEqual(0),()=>{c.assign(0)}).Else(()=>{Oe(t.greaterThanEqual(o),()=>{c.assign(n.sub(i).div(a))}).ElseIf(n.greaterThanEqual(o),()=>{c.assign(Wt(2,i.sub(t).div(a)))}).Else(()=>{c.assign(Wt(4,t.sub(n).div(a)))}),c.mulAssign(1/6),Oe(c.lessThan(0),()=>{c.addAssign(1)})}),D(c,l,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),WF=U(([s])=>{const e=D(s).toVar(),t=Qm(ug(e,D(.04045))).toVar(),n=D(e.div(12.92)).toVar(),i=D(Kn(ft(e.add(D(.055)),D(0)).div(1.055),D(2.4))).toVar();return it(n,i,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Ow=(s,e)=>{s=A(s),e=A(e);const t=z(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return ti(s.sub(t),s.add(t),e)},Vw=(s,e,t,n)=>it(s,e,t[n].clamp()),XF=(s,e,t=rt())=>Vw(s,e,t,"x"),qF=(s,e,t=rt())=>Vw(s,e,t,"y"),Bw=(s,e,t,n,i)=>it(s,e,Ow(t,n[i])),$F=(s,e,t,n=rt())=>Bw(s,e,t,n,"x"),YF=(s,e,t,n=rt())=>Bw(s,e,t,n,"y"),ZF=(s=1,e=0,t=rt())=>t.mul(s).add(e),JF=(s,e=1)=>(s=A(s),s.abs().pow(e).mul(s.sign())),KF=(s,e=1,t=.5)=>A(s).sub(t).mul(e).add(t),jF=(s=rt(),e=1,t=0)=>a0(s.convert("vec2|vec3")).mul(e).add(t),QF=(s=rt(),e=1,t=0)=>c0(s.convert("vec2|vec3")).mul(e).add(t),eO=(s=rt(),e=1,t=0)=>(s=s.convert("vec2|vec3"),oe(c0(s),a0(s.add(z(19,73)))).mul(e).add(t)),tO=(s=rt(),e=1)=>OF(s.convert("vec2|vec3"),e,L(1)),nO=(s=rt(),e=1)=>BF(s.convert("vec2|vec3"),e,L(1)),iO=(s=rt(),e=1)=>kF(s.convert("vec2|vec3"),e,L(1)),sO=(s=rt())=>bF(s.convert("vec2|vec3")),rO=(s=rt(),e=3,t=2,n=.5,i=1)=>wh(s,L(e),t,n).mul(i),oO=(s=rt(),e=3,t=2,n=.5,i=1)=>CF(s,L(e),t,n).mul(i),aO=(s=rt(),e=3,t=2,n=.5,i=1)=>Fw(s,L(e),t,n).mul(i),cO=(s=rt(),e=3,t=2,n=.5,i=1)=>RF(s,L(e),t,n).mul(i),zw=U(([s,e])=>{const t=s.x,n=s.y,i=s.z;let r=e.element(0).mul(.886227);return r=r.add(e.element(1).mul(2*.511664).mul(n)),r=r.add(e.element(2).mul(2*.511664).mul(i)),r=r.add(e.element(3).mul(2*.511664).mul(t)),r=r.add(e.element(4).mul(2*.429043).mul(t).mul(n)),r=r.add(e.element(5).mul(2*.429043).mul(n).mul(i)),r=r.add(e.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),r=r.add(e.element(7).mul(2*.429043).mul(t).mul(i)),r=r.add(e.element(8).mul(.429043).mul(ot(t,t).sub(ot(n,n)))),r});class kw extends yr{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setup(e){const{colorNode:t,cutoffDistanceNode:n,decayExponentNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r).sub(Pn),c=a.normalize(),l=a.length(),u=n0({lightDistance:l,cutoffDistance:n,decayExponent:i}),h=t.mul(u),d=e.context.reflectedLight;o.direct({lightDirection:c,lightColor:h,reflectedLight:d},e.stack,e)}}class Gw extends yr{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,n=this.colorNode,i=r0(this.light),r=e.context.reflectedLight;t.direct({lightDirection:i,lightColor:n,reflectedLight:r},e.stack,e)}}const nf=new Fe,Nu=new Fe;let Ya=null;class Hw extends yr{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=pe(new E).setGroup(_t),this.halfWidth=pe(new E).setGroup(_t)}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;Nu.identity(),nf.copy(t.matrixWorld),nf.premultiply(n),Nu.extractRotation(nf),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(Nu),this.halfHeight.value.applyMatrix4(Nu)}setup(e){super.setup(e);let t,n;e.isAvailable("float32Filterable")?(t=xt(Ya.LTC_FLOAT_1),n=xt(Ya.LTC_FLOAT_2)):(t=xt(Ya.LTC_HALF_1),n=xt(Ya.LTC_HALF_2));const{colorNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r),c=e.context.reflectedLight;o.directRectArea({lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:c,ltc_1:t,ltc_2:n},e.stack,e)}static setLTC(e){Ya=e}}class l0 extends yr{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=pe(0).setGroup(_t),this.penumbraCosNode=pe(0).setGroup(_t),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:n}=this;return ti(t,n,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:n,cutoffDistanceNode:i,decayExponentNode:r,light:o}=this,a=zd(o).sub(Pn),c=a.normalize(),l=c.dot(r0(o)),u=this.getSpotAttenuation(l),h=a.length(),d=n0({lightDistance:h,cutoffDistance:i,decayExponent:r}),p=n.mul(u).mul(d),f=e.context.reflectedLight;t.direct({lightDirection:c,lightColor:p,reflectedLight:f},e.stack,e)}}class Ww extends l0{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let n=null;if(t&&t.isTexture===!0){const i=e.acos().mul(1/Math.PI);n=xt(t,z(i,0),0).r}else n=super.getSpotAttenuation(e);return n}}class Xw extends yr{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class qw extends yr{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=s0(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=pe(new _e).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:i}=this,o=di.dot(i).mul(.5).add(.5),a=it(n,t,o);e.context.irradiance.addAssign(a)}}class $w extends yr{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let n=0;n<9;n++)t.push(new E);this.lightProbe=ds(t)}update(e){const{light:t}=this;super.update(e);for(let n=0;n<9;n++)this.lightProbe.array[n].copy(t.sh.coefficients[n]).multiplyScalar(t.intensity)}setup(e){const t=zw(Ed,this.lightProbe);e.context.irradiance.addAssign(t)}}class lO{parseFunction(){console.warn("Abstract function.")}}class Yw{constructor(e,t,n="",i=""){this.type=e,this.inputs=t,this.name=n,this.precision=i}getCode(){console.warn("Abstract function.")}}Yw.isNodeFunction=!0;const uO=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,hO=/[a-z_0-9]+/ig,k_="#pragma main",dO=s=>{s=s.trim();const e=s.indexOf(k_),t=e!==-1?s.slice(e+k_.length):s,n=t.match(uO);if(n!==null&&n.length===5){const i=n[4],r=[];let o=null;for(;(o=hO.exec(i))!==null;)r.push(o);const a=[];let c=0;for(;c<r.length;){const f=r[c][0]==="const";f===!0&&c++;let x=r[c][0];x==="in"||x==="out"||x==="inout"?c++:x="";const m=r[c++][0];let g=Number.parseInt(r[c][0]);Number.isNaN(g)===!1?c++:g=null;const y=r[c++][0];a.push(new Kg(m,y,g,x,f))}const l=t.substring(n[0].length),u=n[3]!==void 0?n[3]:"",h=n[2],d=n[1]!==void 0?n[1]:"",p=e!==-1?s.slice(0,e):"";return{type:h,inputs:a,name:u,precision:d,inputsCode:i,blockCode:l,headerCode:p}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class pO extends Yw{constructor(e){const{type:t,inputs:n,name:i,precision:r,inputsCode:o,blockCode:a,headerCode:c}=dO(e);super(t,n,i,r),this.inputsCode=o,this.blockCode=a,this.headerCode=c}getCode(e=this.name){let t;const n=this.blockCode;if(n!==""){const{type:i,inputsCode:r,headerCode:o,precision:a}=this;let c=`${i} ${e} ( ${r.trim()} )`;a!==""&&(c=`${a} ${c}`),t=o+c+n}else t="";return t}}class Zw extends lO{parseFunction(e){return new pO(e)}}class fO{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(n!==null){t=new n;for(const i in e)t[i]=e[i]}return t}addColorSpace(e,t){this.addType(e,t,this.colorSpaceNodes)}getColorSpaceFunction(e){return this.colorSpaceNodes.get(e)||null}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t.name,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}addClass(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}class mO extends il{constructor(e,t,n,i,r,o){super(e,t,n,i,r,o),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class Jw extends fO{constructor(){super(),this.addLight(kw,_d),this.addLight(Gw,yd),this.addLight(Hw,Im),this.addLight(l0,il),this.addLight(Xw,vd),this.addLight(qw,xd),this.addLight($w,Pm),this.addLight(Ww,mO),this.addToneMapping(bw,Ah),this.addToneMapping(ww,Nh),this.addToneMapping(Aw,Bf),this.addToneMapping(Nw,Eh),this.addToneMapping(Ew,Ch),this.addToneMapping(Cw,Rh),this.addColorSpace(Tw,xh(li,kn)),this.addColorSpace(Sw,xh(kn,li))}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ks}}));if(typeof window<"u"){try{typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-iFaDq9U3.umd.cjs",document.baseURI).href,window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-iFaDq9U3.umd.cjs",document.baseURI).href,revision:Ks})}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Ks),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Ks}const gO=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Eh,AONode:OT,AddEquation:Zs,AddOperation:Vf,AdditiveAnimationBlendMode:Yf,AdditiveBlending:cc,AfterImageNode:qb,AgXToneMapping:Ch,AlphaFormat:Gf,AlwaysCompare:Dy,AlwaysDepth:uc,AlwaysStencilFunc:ih,AmbientLight:vd,AmbientLightNode:Xw,AnaglyphPassNode:uw,AnalyticLightNode:yr,AnamorphicNode:Yb,AnimationAction:Tv,AnimationClip:la,AnimationLoader:FI,AnimationMixer:bv,AnimationObjectGroup:tP,AnimationUtils:PI,ArcCurve:tv,ArrayCamera:rm,ArrayElementNode:mr,ArrowHelper:mP,AssignNode:oM,AttachedBindMode:af,AttributeNode:Ag,Audio:Fm,AudioAnalyser:XI,AudioContext:Md,AudioListener:vv,AudioLoader:yv,AxesHelper:Fv,BRDF_GGX:Af,BRDF_Lambert:no,BackSide:ln,BasicDepthPacking:Zf,BasicEnvironmentNode:Dd,BasicNodeLibrary:Jw,BasicShadowMap:nA,BatchNode:CT,BatchedMesh:hm,BloomNode:sw,Bone:Kh,BooleanKeyframeTrack:pr,Box2:aP,Box3:Hn,Box3Helper:Uv,BoxGeometry:_s,BoxHelper:Dv,Break:Ld,BufferAttribute:At,BufferAttributeNode:fS,BufferGeometry:at,BufferGeometryLoader:gv,BufferNode:Rd,BumpMapNode:JS,BypassNode:yS,ByteType:zf,Cache:Rs,CacheNode:_S,Camera:Yc,CameraHelper:Lv,CanvasTexture:ev,CapsuleGeometry:Qh,CatmullRomCurve3:gm,CineonToneMapping:Bf,CircleGeometry:ed,ClampToEdgeWrapping:Si,Clock:Um,CodeNode:$g,Color:_e,ColorKeyframeTrack:md,ColorManagement:gt,ColorSpaceNode:hl,CompressedArrayTexture:jy,CompressedCubeTexture:Qy,CompressedTexture:Kc,CompressedTextureLoader:OI,ComputeNode:gS,ConeGeometry:td,ConstNode:Wi,ConstantAlphaFactor:oy,ConstantColorFactor:sy,ContextNode:vg,Continue:wL,Controls:Vv,ConvertNode:$m,CubeCamera:Xh,CubeReflectionMapping:wi,CubeRefractionMapping:Vi,CubeTexture:so,CubeTextureLoader:VI,CubeTextureNode:GS,CubeUVReflectionMapping:hr,CubicBezierCurve:xm,CubicBezierCurve3:nv,CubicInterpolant:uv,CullFaceBack:sf,CullFaceFront:X_,CullFaceFrontBack:tA,CullFaceNone:W_,Curve:Gi,CurvePath:sv,CustomBlending:Uf,CustomToneMapping:cy,CylinderGeometry:co,Cylindrical:oP,DFGApprox:Hg,D_GGX:eb,Data3DTexture:Hh,DataArrayTexture:qc,DataTexture:Oi,DataTextureLoader:pv,DataUtils:By,DecrementStencilOp:_y,DecrementWrapStencilOp:vy,DefaultLoadingManager:Cm,DenoiseNode:nw,DepthFormat:Qs,DepthOfFieldNode:Jb,DepthStencilFormat:ar,DepthTexture:ao,DetachedBindMode:ly,DirectionalLight:yd,DirectionalLightHelper:Pv,DirectionalLightNode:Gw,Discard:bS,DiscreteInterpolant:hv,DisplayP3ColorSpace:kh,DodecahedronGeometry:nd,DotScreenNode:Kb,DoubleSide:Ji,DstAlphaFactor:Q_,DstColorFactor:ty,DynamicCopyUsage:fA,DynamicDrawUsage:Gr,DynamicReadUsage:hA,EPSILON:AM,EdgesGeometry:Sm,EllipseCurve:jh,EnvironmentNode:hb,EqualCompare:Ry,EqualDepth:dc,EqualStencilFunc:by,EquirectUVNode:YT,EquirectangularReflectionMapping:ir,EquirectangularRefractionMapping:sr,Euler:ui,EventDispatcher:Ai,ExpressionNode:TS,ExtrudeGeometry:Qc,FXAANode:iw,F_Schlick:pa,FileLoader:ts,FilmNode:Qb,Float16BufferAttribute:zy,Float32BufferAttribute:Ve,FloatType:Gn,Fn:U,Fog:om,FogExp2:Zh,FogExp2Node:xw,FogNode:Bd,FogRangeNode:gw,FramebufferTexture:fm,FrontFacingNode:LS,FrontSide:fs,Frustum:ga,FunctionCallNode:cM,FunctionNode:Yg,FunctionOverloadingNode:Cb,GLBufferAttribute:rP,GLSL1:gA,GLSL3:sh,GLSLNodeParser:Zw,GTAONode:tw,GaussianBlurNode:Xb,GreaterCompare:Iy,GreaterDepth:fc,GreaterEqualCompare:Ly,GreaterEqualDepth:pc,GreaterEqualStencilFunc:Ey,GreaterStencilFunc:Ay,GridHelper:Iv,Group:Hr,HalfFloatType:Ln,HemisphereLight:xd,HemisphereLightHelper:dP,HemisphereLightNode:qw,IESSpotLightNode:Ww,INFINITY:zP,IcosahedronGeometry:sd,If:Oe,ImageBitmapLoader:_v,ImageLoader:Dc,ImageUtils:Oy,IncrementStencilOp:xy,IncrementWrapStencilOp:yy,IndexNode:zt,InstanceNode:NT,InstancedBufferAttribute:Us,InstancedBufferGeometry:Lm,InstancedInterleavedBuffer:Bm,InstancedMesh:um,InstancedPointsNodeMaterial:zL,Int16BufferAttribute:e1,Int32BufferAttribute:t1,Int8BufferAttribute:KA,IntType:ma,InterleavedBuffer:_a,InterleavedBufferAttribute:Ds,Interpolant:Sa,InterpolateDiscrete:ia,InterpolateLinear:bc,InterpolateSmooth:Eu,InvertStencilOp:My,IrradianceNode:zT,JoinNode:Gv,KeepStencilOp:$s,KeyframeTrack:Hi,LOD:cm,LatheGeometry:jc,Layers:$c,LessCompare:jf,LessDepth:hc,LessEqualCompare:Qf,LessEqualDepth:nr,LessEqualStencilFunc:wy,LessStencilFunc:Ty,Light:fr,LightProbe:Pm,LightProbeNode:$w,LightingContextNode:VT,LightingModel:Ml,LightingNode:ho,LightsNode:UT,Line:Fs,Line2NodeMaterial:qL,Line3:Cv,LineBasicMaterial:Fn,LineBasicNodeMaterial:GL,LineCurve:_m,LineCurve3:iv,LineDashedMaterial:fd,LineDashedNodeMaterial:WL,LineLoop:dm,LineSegments:rs,LinearDisplayP3ColorSpace:Xc,LinearFilter:Ut,LinearInterpolant:Em,LinearMipMapLinearFilter:uy,LinearMipMapNearestFilter:rA,LinearMipmapLinearFilter:Jn,LinearMipmapNearestFilter:js,LinearSRGBColorSpace:li,LinearToneMapping:Ah,LinearTransfer:Ac,Loader:Xn,LoaderUtils:lh,LoadingManager:gd,Loop:mt,LoopNode:PT,LoopOnce:qf,LoopPingPong:hy,LoopRepeat:$f,LuminanceAlphaFormat:Wf,LuminanceFormat:Hf,Lut3DNode:ew,MOUSE:G_,MRTNode:Eb,MatcapUVNode:fb,Material:mn,MaterialLoader:sl,MaterialNode:j,MaterialReferenceNode:HS,MathUtils:Gh,Matrix2:zm,Matrix3:Ke,Matrix4:Fe,MaxEquation:Ff,MaxMipLevelNode:ES,Mesh:kt,MeshBasicMaterial:ss,MeshBasicNodeMaterial:t2,MeshDepthMaterial:Yh,MeshDistanceMaterial:sm,MeshLambertMaterial:pd,MeshLambertNodeMaterial:o2,MeshMatcapMaterial:Am,MeshMatcapNodeMaterial:W2,MeshNormalMaterial:dd,MeshNormalNodeMaterial:ZL,MeshPhongMaterial:hd,MeshPhongNodeMaterial:c2,MeshPhysicalMaterial:ud,MeshPhysicalNodeMaterial:pb,MeshSSSNodeMaterial:V2,MeshStandardMaterial:nl,MeshStandardNodeMaterial:db,MeshToonMaterial:wm,MeshToonNodeMaterial:G2,MinEquation:Y_,MirroredRepeatWrapping:ea,MixOperation:Of,ModelNode:is,ModelViewProjectionNode:bT,MorphNode:LT,MultiplyBlending:of,MultiplyOperation:fa,NearestFilter:Qt,NearestMipMapLinearFilter:sA,NearestMipMapNearestFilter:iA,NearestMipmapLinearFilter:Cs,NearestMipmapNearestFilter:Ph,NeutralToneMapping:Rh,NeverCompare:Cy,NeverDepth:lc,NeverStencilFunc:Sy,NoBlending:Fi,NoColorSpace:Li,NoToneMapping:Ti,Node:Ye,NodeAttribute:If,NodeBuilder:Ab,NodeCache:Lu,NodeCode:Tb,NodeFrame:Nb,NodeFunctionInput:Kg,NodeLoader:yb,NodeMaterial:Tt,NodeMaterialLoader:vb,NodeMaterialObserver:Bv,NodeObjectLoader:e3,NodeShaderStage:mf,NodeType:yP,NodeUniform:Mb,NodeUpdateType:We,NodeUtils:_P,NodeVar:Xg,NodeVarying:Sb,NormalAnimationBlendMode:zh,NormalBlending:Ps,NormalMapNode:ZS,NotEqualCompare:Py,NotEqualDepth:mc,NotEqualStencilFunc:Ny,NumberKeyframeTrack:aa,Object3D:yt,Object3DNode:wt,ObjectLoader:xv,ObjectSpaceNormalMap:Kf,OctahedronGeometry:va,OneFactor:J_,OneMinusConstantAlphaFactor:ay,OneMinusConstantColorFactor:ry,OneMinusDstAlphaFactor:ey,OneMinusDstColorFactor:ny,OneMinusSrcAlphaFactor:Vu,OneMinusSrcColorFactor:j_,OrthographicCamera:oo,OscNode:pn,OutputStructNode:jg,P3Primaries:Ec,PCFShadowMap:Lf,PCFSoftShadowMap:Df,PI:to,PI2:kP,PMREMGenerator:rh,PMREMNode:lb,ParallaxBarrierPassNode:hw,ParameterNode:qg,PassNode:bn,Path:Rc,PerspectiveCamera:hn,PhongLightingModel:kg,PhysicalLightingModel:Fd,PixelationPassNode:ow,Plane:cs,PlaneGeometry:ro,PlaneHelper:fP,PointLight:_d,PointLightHelper:uP,PointLightNode:kw,PointUVNode:Vb,Points:pm,PointsMaterial:ya,PointsNodeMaterial:q2,PolarGridHelper:pP,PolyhedronGeometry:dr,PositionalAudio:Mv,PosterizeNode:Gb,PropertyBinding:St,PropertyMixer:Sv,PropertyNode:Nt,QuadraticBezierCurve:ym,QuadraticBezierCurve3:vm,Quaternion:Qn,QuaternionKeyframeTrack:Ta,QuaternionLinearInterpolant:dv,RED_GREEN_RGTC2_Format:th,RED_RGTC1_Format:Xf,REVISION:Ks,RGBADepthPacking:Jf,RGBAFormat:Rn,RGBAIntegerFormat:Bh,RGBA_ASTC_10x10_Format:Ju,RGBA_ASTC_10x5_Format:$u,RGBA_ASTC_10x6_Format:Yu,RGBA_ASTC_10x8_Format:Zu,RGBA_ASTC_12x10_Format:Ku,RGBA_ASTC_12x12_Format:ju,RGBA_ASTC_4x4_Format:Mc,RGBA_ASTC_5x4_Format:ku,RGBA_ASTC_5x5_Format:Gu,RGBA_ASTC_6x5_Format:Hu,RGBA_ASTC_6x6_Format:Sc,RGBA_ASTC_8x5_Format:Wu,RGBA_ASTC_8x6_Format:Xu,RGBA_ASTC_8x8_Format:qu,RGBA_BPTC_Format:Ko,RGBA_ETC2_EAC_Format:vc,RGBA_PVRTC_2BPPV1_Format:zu,RGBA_PVRTC_4BPPV1_Format:xc,RGBA_S3TC_DXT1_Format:Yo,RGBA_S3TC_DXT3_Format:Zo,RGBA_S3TC_DXT5_Format:Jo,RGBDepthPacking:aA,RGBFormat:Oh,RGBIntegerFormat:oA,RGBShiftNode:jb,RGB_BPTC_SIGNED_Format:Qu,RGB_BPTC_UNSIGNED_Format:Tc,RGB_ETC1_Format:_c,RGB_ETC2_Format:yc,RGB_PVRTC_2BPPV1_Format:Bu,RGB_PVRTC_4BPPV1_Format:gc,RGB_S3TC_DXT1_Format:$o,RGDepthPacking:cA,RGFormat:na,RGIntegerFormat:Vh,RTTNode:Ub,RangeNode:_w,RawShaderMaterial:bm,Ray:io,Raycaster:Nv,Rec709Primaries:Nc,RectAreaLight:Im,RectAreaLightNode:Hw,RedFormat:Hc,RedIntegerFormat:Wc,ReferenceNode:ml,ReflectorNode:Db,ReinhardToneMapping:Nh,RemapNode:wg,RenderOutputNode:wS,RenderTarget:fn,RendererReferenceNode:lS,RepeatWrapping:rr,ReplaceStencilOp:gy,Return:qP,ReverseSubtractEquation:$_,RingGeometry:el,RotateNode:gb,SIGNED_RED_GREEN_RGTC2_Format:nh,SIGNED_RED_RGTC1_Format:eh,SRGBColorSpace:kn,SRGBTransfer:Vt,SSAAPassNode:aw,Scene:Jh,SceneNode:Qi,Schlick_to_F0:nb,ScreenNode:sn,ScriptableNode:mw,ScriptableValueNode:pw,SetNode:Hv,ShaderChunk:lt,ShaderLib:Pi,ShaderMaterial:ki,ShaderNode:ec,ShadowMaterial:ld,ShadowNodeMaterial:K2,Shape:er,ShapeGeometry:rd,ShapePath:Ov,ShapeUtils:ji,ShortType:kf,Skeleton:Jc,SkeletonHelper:lP,SkinnedMesh:lm,SkinningNode:Fg,SobelOperatorNode:Zb,Source:Js,Sphere:Dn,SphereGeometry:Ma,Spherical:Ev,SphericalHarmonics3:mv,SplineCurve:Mm,SplitNode:uh,SpotLight:il,SpotLightHelper:cP,SpotLightNode:l0,Sprite:am,SpriteMaterial:Zc,SpriteNodeMaterial:Y2,SpriteSheetUVNode:Rb,SrcAlphaFactor:Ou,SrcAlphaSaturateFactor:iy,SrcColorFactor:K_,StackNode:wb,StaticCopyUsage:pA,StaticDrawUsage:sa,StaticReadUsage:uA,StereoCamera:Dm,StereoPassNode:cw,StorageArrayElementNode:Ib,StorageBufferNode:t0,StorageTextureNode:Bb,StreamCopyUsage:mA,StreamDrawUsage:lA,StreamReadUsage:dA,StringKeyframeTrack:lo,SubtractEquation:q_,SubtractiveBlending:rf,TBNViewMatrix:qr,TOUCH:H_,TangentSpaceNormalMap:ms,TempNode:pt,TetrahedronGeometry:od,Texture:Xt,Texture3DNode:xb,TextureLoader:fv,TextureNode:gs,TextureSizeNode:NS,TextureUtils:OR,TimerNode:Sn,ToneMappingNode:hS,ToonOutlinePassNode:dw,TorusGeometry:tl,TorusKnotGeometry:ad,TransitionNode:rw,Triangle:Zn,TriangleFanDrawMode:fy,TriangleStripDrawMode:py,TrianglesDrawMode:dy,TriplanarTexturesNode:Pb,TubeGeometry:cd,UVMapping:Ih,Uint16BufferAttribute:Wh,Uint32BufferAttribute:tm,Uint8BufferAttribute:jA,Uint8ClampedBufferAttribute:QA,Uniform:wv,UniformArrayNode:Ig,UniformGroupNode:eg,UniformNode:uo,UniformsGroup:sP,UniformsLib:Se,UniformsUtils:nm,UnsignedByteType:es,UnsignedInt101111Type:Fh,UnsignedInt248Type:or,UnsignedInt5999Type:Uh,UnsignedIntType:Bi,UnsignedShort4444Type:Lh,UnsignedShort5551Type:Dh,UnsignedShortType:ta,UserDataNode:kb,VSMShadowMap:oi,V_GGX_SmithCorrelated:QT,VarNode:iS,VaryingNode:sS,Vector2:J,Vector3:E,Vector4:st,VectorKeyframeTrack:ca,VertexColorNode:Ob,VideoTexture:Ky,ViewportDepthNode:jn,ViewportDepthTextureNode:WT,ViewportSharedTextureNode:Hb,ViewportTextureNode:vl,VolumeNodeMaterial:Q2,WebGL3DRenderTarget:kA,WebGLArrayRenderTarget:zA,WebGLCoordinateSystem:Di,WebGLCubeRenderTarget:qh,WebGLMultipleRenderTargets:gP,WebGLRenderTarget:zi,WebGLRenderer:Yy,WebGLUtils:$y,WebGPUCoordinateSystem:Qr,WireframeGeometry:Tm,WrapAroundEnding:wc,ZeroCurvatureEnding:zr,ZeroFactor:Z_,ZeroSlopeEnding:kr,ZeroStencilOp:my,abs:Dt,acesFilmicToneMapping:Nw,acos:gh,add:Wt,addMethodChaining:te,addNodeElement:$P,afterImage:lD,agxToneMapping:Ew,all:hg,alphaT:dh,anaglyphPass:XD,anamorphic:mD,and:mM,anisotropy:Ys,anisotropyB:Jr,anisotropyT:tc,any:NM,ao:wD,append:Yv,arrayBuffer:FP,asin:LM,assign:aM,atan:DM,atan2:HM,atomicAdd:HU,atomicAnd:$U,atomicFunc:Os,atomicMax:XU,atomicMin:qU,atomicOr:YU,atomicStore:GU,atomicSub:WU,atomicXor:ZU,attenuationColor:ag,attenuationDistance:og,attribute:vn,backgroundBlurriness:K3,backgroundIntensity:j3,batch:RT,billboarding:fU,bitAnd:yM,bitNot:vM,bitOr:MM,bitXor:SM,bitangentGeometry:pL,bitangentLocal:fL,bitangentView:XS,bitangentWorld:mL,bitcast:GP,bleach:TU,bloom:DD,blur:cb,bool:cr,buffer:fl,bufferAttribute:dl,bumpMap:KS,burn:_U,bvec2:Kv,bvec3:Qm,bvec4:tM,bypass:vS,cache:ic,call:lM,cameraFar:Bo,cameraLogDepth:RS,cameraNear:Vo,cameraNormalMatrix:KP,cameraPosition:Ng,cameraProjectionMatrix:ci,cameraProjectionMatrixInverse:ZP,cameraViewMatrix:pi,cameraWorldMatrix:JP,cbrt:JM,ceil:fg,checker:JU,cineonToneMapping:Aw,clamp:cn,clearcoat:hh,clearcoatRoughness:zc,code:Od,color:Zv,colorSpaceToWorking:bg,colorToDirection:$L,compute:xS,cond:tS,context:Mg,convert:iM,convertToTexture:ei,cos:Mi,createCanvasElement:Fy,cross:Qo,cubeTexture:Cd,dFdx:OM,dFdy:VM,dashSize:Kr,defaultBuildStages:gf,defaultShaderStages:qm,defined:Oc,degrees:RM,denoise:ED,densityFog:jD,depth:Bg,depthPass:aD,difference:qM,diffuseColor:Ct,directionToColor:$T,dispersion:cg,distance:XM,div:ns,dodge:yU,dof:xD,dot:$t,dotScreen:_D,drawIndex:AT,dynamicBufferAttribute:mS,element:nM,emissive:yf,equal:uM,equals:EM,equirectUV:zg,exp:dg,exp2:mh,expression:lr,faceDirection:pl,faceForward:jM,film:vD,float:A,floor:gr,fog:JD,fract:xr,frameGroup:VP,frameId:F3,frontFacing:DS,fwidth:kM,fxaa:CD,gain:cU,gapSize:Gc,gaussianBlur:cD,getColorSpaceMethod:xh,getConstNodeType:$v,getCurrentStack:jm,getDirection:ob,getDistanceAttenuation:n0,getGeometryRoughness:jT,getRoughness:Gg,getShIrradianceAt:zw,getTextureIndex:Qg,global:Fu,glsl:r3,glslFn:o3,grayscale:uD,greaterThan:ug,greaterThanEqual:fM,hash:aU,highPrecisionModelNormalViewMatrix:cL,highPrecisionModelViewMatrix:aL,hue:pD,instance:ET,instanceIndex:yl,instancedBufferAttribute:_h,instancedDynamicBufferAttribute:vf,int:L,inverseSqrt:IM,invocationLocalIndex:TL,invocationSubgroupIndex:SL,ior:nc,iridescence:wd,iridescenceIOR:ng,iridescenceThickness:ig,ivec2:ls,ivec3:jv,ivec4:Qv,js:i3,label:nS,length:jr,lengthSq:xg,lessThan:dM,lessThanEqual:pM,lightPosition:s0,lightTargetDirection:r0,lightTargetPosition:yw,lightViewPosition:zd,lightingContext:BT,lights:FT,linearDepth:Sh,linearSRGBTosRGB:Tw,linearToneMapping:bw,localId:PU,log:pg,log2:al,loop:AL,luminance:En,lut3D:MD,mat2:ol,mat3:Tn,mat4:Zr,matcapUV:mb,materialAOMap:TT,materialAlphaTest:jS,materialAnisotropy:dT,materialAnisotropyVector:zo,materialAttenuationColor:vT,materialAttenuationDistance:yT,materialClearcoat:oT,materialClearcoatNormal:cT,materialClearcoatRoughness:aT,materialColor:ha,materialDispersion:ST,materialEmissive:eT,materialIOR:_T,materialIridescence:pT,materialIridescenceIOR:fT,materialIridescenceThickness:mT,materialLightMap:Ug,materialLineDashOffset:bf,materialLineDashSize:Lg,materialLineGapSize:Dg,materialLineScale:Mh,materialLineWidth:Pu,materialMetalness:sT,materialNormal:rT,materialOpacity:Pd,materialPointWidth:MT,materialReference:Ki,materialReflectivity:Iu,materialRefractionRatio:OS,materialRotation:lT,materialRoughness:iT,materialSheen:uT,materialSheenRoughness:hT,materialShininess:QS,materialSpecular:tT,materialSpecularColor:nT,materialSpecularIntensity:Tf,materialSpecularStrength:sc,materialThickness:xT,materialTransmission:gT,max:ft,maxMipLevel:CS,metalness:Bc,min:Mn,mix:it,mixElement:QM,mod:Ad,modInt:lg,modelDirection:iL,modelNormalMatrix:IS,modelPosition:sL,modelScale:rL,modelViewMatrix:xs,modelViewPosition:oL,modelViewProjection:wf,modelWorldMatrix:Ui,modelWorldMatrixInverse:PS,morphReference:DT,motionBlur:SU,mrt:Vd,mul:ot,mx_aastep:Ow,mx_cell_noise_float:sO,mx_contrast:KF,mx_fractal_noise_float:rO,mx_fractal_noise_vec2:oO,mx_fractal_noise_vec3:aO,mx_fractal_noise_vec4:cO,mx_hsvtorgb:GF,mx_noise_float:jF,mx_noise_vec3:QF,mx_noise_vec4:eO,mx_ramplr:XF,mx_ramptb:qF,mx_rgbtohsv:HF,mx_safepower:JF,mx_splitlr:$F,mx_splittb:YF,mx_srgb_texture_to_lin_rec709:WF,mx_transform_uv:ZF,mx_worley_noise_float:tO,mx_worley_noise_vec2:nO,mx_worley_noise_vec3:iO,negate:UM,neutralToneMapping:Cw,nodeArray:Yr,nodeImmutable:fe,nodeObject:H,nodeObjects:rl,nodeProxy:K,normalFlat:US,normalGeometry:Nd,normalLocal:hi,normalMap:Sf,normalView:di,normalWorld:Ed,normalize:vi,not:xM,notEqual:hM,numWorkgroups:RU,objectDirection:jP,objectGroup:rM,objectPosition:eL,objectScale:tL,objectViewPosition:nL,objectWorldMatrix:QP,oneMinus:FM,or:gM,orthographicDepthToViewZ:UL,oscSawtooth:z3,oscSine:O3,oscSquare:V3,oscTriangle:B3,output:sg,outputStruct:P3,overlay:MU,overloadingFn:On,parabola:Pf,parallaxBarrierPass:qD,parallaxDirection:$S,parallaxUV:xL,parameter:n3,pass:oD,passTexture:Na,pcurve:lU,perspectiveDepthToViewZ:Vg,pixelationPass:VD,pmremTexture:ub,pointUV:J3,pointWidth:BP,positionGeometry:Nn,positionLocal:en,positionPrevious:yh,positionView:Pn,positionViewDirection:Bt,positionWorld:vh,positionWorldDirection:Eg,posterize:iD,pow:Kn,pow2:gg,pow3:$M,pow4:YM,property:ai,radians:CM,rand:yg,range:QD,rangeFog:KD,reciprocal:zM,reference:dn,referenceBuffer:Mf,reflect:WM,reflectVector:zS,reflectView:VS,reflector:X3,refract:_g,refractVector:kS,refractView:BS,reinhardToneMapping:ww,remainder:wM,remap:MS,remapClamp:SS,renderGroup:_t,renderOutput:AS,rendererReference:uS,rgbShift:yD,rotate:Wg,rotateUV:dU,roughness:hs,round:BM,rtt:Fb,sRGBToLinearSRGB:Sw,sampler:YP,saturate:KM,saturation:hD,screen:vU,screenCoordinate:Aa,screenSize:da,screenUV:_r,scriptable:ZD,scriptableValue:Uu,select:In,sepia:bU,setCurrentStack:Vc,shaderStages:xf,sharedUniformGroup:tg,sheen:Xr,sheenRoughness:bd,shiftLeft:TM,shiftRight:bM,shininess:ph,sign:cl,sin:Cn,sinc:uU,skinning:bL,skinningReference:IT,smoothstep:ti,smoothstepElement:eS,sobel:gD,specularColor:ri,specularF90:kc,spherizeUV:pU,split:OP,spritesheetUV:k3,sqrt:os,ssaaPass:kD,stack:Du,step:ll,stereoPass:HD,storage:Q3,storageBarrier:FU,storageObject:eD,storageTexture:zb,string:UP,sub:Ft,subgroupIndex:ML,subgroupSize:LU,tan:PM,tangentGeometry:Id,tangentLocal:gl,tangentView:xl,tangentWorld:WS,temp:Sg,texture:xt,texture3D:_b,textureBarrier:OU,textureBicubic:rb,textureCubeUV:ab,textureLoad:Ci,textureSize:tr,textureStore:tD,thickness:rg,threshold:$b,timerDelta:U3,timerGlobal:D3,timerLocal:e0,toOutputColorSpace:rS,toWorkingColorSpace:oS,toneMapping:dS,toneMappingExposure:pS,toonOutlinePass:$D,transformDirection:ZM,transformNormal:FS,transformNormalToView:Rg,transformedBentNormalView:YS,transformedBitangentView:qS,transformedBitangentWorld:gL,transformedClearcoatNormalView:Xo,transformedNormalView:Yt,transformedNormalWorld:Cg,transformedTangentView:Pg,transformedTangentWorld:dL,transition:UD,transmission:fh,transpose:GM,tri:us,tri3:vw,triNoise3D:hU,triplanarTexture:H3,triplanarTextures:Lb,trunc:mg,tslFn:DP,uint:ve,uniform:pe,uniformArray:ds,uniformGroup:sM,uniforms:uL,userData:nD,uv:rt,uvec2:Jv,uvec3:wa,uvec4:eM,varying:Un,varyingProperty:Zi,vec2:z,vec3:D,vec4:oe,vectorComponents:ba,velocity:xU,vertexColor:Z3,vertexIndex:wT,vibrance:dD,viewZToOrthographicDepth:rc,viewZToPerspectiveDepth:XT,viewport:Ls,viewportBottomLeft:LL,viewportCoordinate:GT,viewportDepthTexture:Og,viewportLinearDepth:FL,viewportMipTexture:HT,viewportResolution:IL,viewportSafeUV:mU,viewportSharedTexture:sD,viewportSize:kT,viewportTexture:DL,viewportTopLeft:PL,viewportUV:RL,wgsl:s3,wgslFn:a3,workgroupArray:zU,workgroupBarrier:UU,workgroupId:IU,workingToColorSpace:aS,xor:_M},Symbol.toStringTag,{value:"Module"}));exports.ACESFilmicToneMapping=Eh;exports.AdditiveBlending=cc;exports.AgXToneMapping=Ch;exports.AlwaysDepth=uc;exports.AlwaysStencilFunc=ih;exports.AmbientLight=vd;exports.AnimationClip=la;exports.AnimationMixer=bv;exports.ArrayCamera=rm;exports.Audio=Fm;exports.AudioContext=Md;exports.AudioListener=vv;exports.AudioLoader=yv;exports.AxesHelper=Fv;exports.BackSide=ln;exports.BasicDepthPacking=Zf;exports.BasicNodeLibrary=Jw;exports.BatchedMesh=hm;exports.Bone=Kh;exports.BooleanKeyframeTrack=pr;exports.Box3=Hn;exports.Box3Helper=Uv;exports.BoxGeometry=_s;exports.BoxHelper=Dv;exports.BufferAttribute=At;exports.BufferGeometry=at;exports.Camera=Yc;exports.CameraHelper=Lv;exports.CanvasTexture=ev;exports.CatmullRomCurve3=gm;exports.ClampToEdgeWrapping=Si;exports.Clock=Um;exports.Color=_e;exports.ColorKeyframeTrack=md;exports.ColorManagement=gt;exports.CompressedArrayTexture=jy;exports.CompressedCubeTexture=Qy;exports.CompressedTexture=Kc;exports.Controls=Vv;exports.CubeCamera=Xh;exports.CubeTexture=so;exports.CubeUVReflectionMapping=hr;exports.Curve=Gi;exports.CustomBlending=Uf;exports.CylinderGeometry=co;exports.Data3DTexture=Hh;exports.DataTexture=Oi;exports.DataTextureLoader=pv;exports.DataUtils=By;exports.DecrementStencilOp=_y;exports.DecrementWrapStencilOp=vy;exports.DefaultLoadingManager=Cm;exports.DepthFormat=Qs;exports.DepthStencilFormat=ar;exports.DepthTexture=ao;exports.DirectionalLight=yd;exports.DirectionalLightHelper=Pv;exports.DoubleSide=Ji;exports.DynamicDrawUsage=Gr;exports.EdgesGeometry=Sm;exports.EqualDepth=dc;exports.EqualStencilFunc=by;exports.EquirectangularReflectionMapping=ir;exports.EquirectangularRefractionMapping=sr;exports.Euler=ui;exports.EventDispatcher=Ai;exports.ExtrudeGeometry=Qc;exports.FileLoader=ts;exports.Float32BufferAttribute=Ve;exports.FloatType=Gn;exports.Fog=om;exports.FrontSide=fs;exports.Frustum=ga;exports.GLSL3=sh;exports.GLSLNodeParser=Zw;exports.GreaterDepth=fc;exports.GreaterEqualDepth=pc;exports.GreaterEqualStencilFunc=Ey;exports.GreaterStencilFunc=Ay;exports.GridHelper=Iv;exports.Group=Hr;exports.HalfFloatType=Ln;exports.HemisphereLight=xd;exports.ImageBitmapLoader=_v;exports.IncrementStencilOp=xy;exports.IncrementWrapStencilOp=yy;exports.InstancedBufferAttribute=Us;exports.InstancedBufferGeometry=Lm;exports.InstancedInterleavedBuffer=Bm;exports.InstancedMesh=um;exports.InterleavedBuffer=_a;exports.InterleavedBufferAttribute=Ds;exports.Interpolant=Sa;exports.InterpolateDiscrete=ia;exports.InterpolateLinear=bc;exports.InvertStencilOp=My;exports.KeepStencilOp=$s;exports.KeyframeTrack=Hi;exports.LOD=cm;exports.Layers=$c;exports.LessDepth=hc;exports.LessEqualDepth=nr;exports.LessEqualStencilFunc=wy;exports.LessStencilFunc=Ty;exports.Line=Fs;exports.Line3=Cv;exports.LineBasicMaterial=Fn;exports.LineLoop=dm;exports.LineSegments=rs;exports.LinearFilter=Ut;exports.LinearMipmapLinearFilter=Jn;exports.LinearMipmapNearestFilter=js;exports.LinearSRGBColorSpace=li;exports.LinearToneMapping=Ah;exports.Loader=Xn;exports.LoaderUtils=lh;exports.LoadingManager=gd;exports.LoopOnce=qf;exports.LoopRepeat=$f;exports.MOUSE=G_;exports.Material=mn;exports.MathUtils=Gh;exports.Matrix3=Ke;exports.Matrix4=Fe;exports.MaxEquation=Ff;exports.Mesh=kt;exports.MeshBasicMaterial=ss;exports.MeshDepthMaterial=Yh;exports.MeshLambertMaterial=pd;exports.MeshNormalMaterial=dd;exports.MeshPhongMaterial=hd;exports.MeshPhysicalMaterial=ud;exports.MeshStandardMaterial=nl;exports.MirroredRepeatWrapping=ea;exports.NearestFilter=Qt;exports.NearestMipmapLinearFilter=Cs;exports.NearestMipmapNearestFilter=Ph;exports.NeutralToneMapping=Rh;exports.NeverDepth=lc;exports.NeverStencilFunc=Sy;exports.NoBlending=Fi;exports.NoColorSpace=Li;exports.NoToneMapping=Ti;exports.Node=Ye;exports.NodeBuilder=Ab;exports.NodeFrame=Nb;exports.NormalBlending=Ps;exports.NotEqualDepth=mc;exports.NotEqualStencilFunc=Ny;exports.NumberKeyframeTrack=aa;exports.Object3D=yt;exports.OctahedronGeometry=va;exports.OrthographicCamera=oo;exports.PCFSoftShadowMap$1=Df;exports.PMREMGenerator$1=rh;exports.PerspectiveCamera=hn;exports.Plane=cs;exports.PlaneGeometry=ro;exports.PointLight=_d;exports.Points=pm;exports.PointsMaterial=ya;exports.PositionalAudio=Mv;exports.PropertyBinding=St;exports.Quaternion=Qn;exports.QuaternionKeyframeTrack=Ta;exports.REVISION=Ks;exports.RGBADepthPacking=Jf;exports.RGBAFormat=Rn;exports.RGBA_ASTC_4x4_Format=Mc;exports.RGBA_ASTC_6x6_Format=Sc;exports.RGBA_BPTC_Format=Ko;exports.RGBA_ETC2_EAC_Format=vc;exports.RGBA_PVRTC_4BPPV1_Format=xc;exports.RGBA_S3TC_DXT1_Format=Yo;exports.RGBA_S3TC_DXT3_Format=Zo;exports.RGBA_S3TC_DXT5_Format=Jo;exports.RGBFormat=Oh;exports.RGB_BPTC_UNSIGNED_Format=Tc;exports.RGB_ETC1_Format=_c;exports.RGB_ETC2_Format=yc;exports.RGB_PVRTC_4BPPV1_Format=gc;exports.RGB_S3TC_DXT1_Format=$o;exports.RGFormat=na;exports.RawShaderMaterial=bm;exports.Ray=io;exports.Raycaster=Nv;exports.RedFormat=Hc;exports.ReinhardToneMapping=Nh;exports.RepeatWrapping=rr;exports.ReplaceStencilOp=gy;exports.RingGeometry=el;exports.SRGBColorSpace=kn;exports.Scene=Jh;exports.ShaderChunk=lt;exports.ShaderLib=Pi;exports.ShaderMaterial=ki;exports.ShadowMaterial=ld;exports.Shape=er;exports.ShapePath=Ov;exports.ShapeUtils=ji;exports.Skeleton=Jc;exports.SkinnedMesh=lm;exports.Source=Js;exports.Sphere=Dn;exports.SphereGeometry=Ma;exports.Spherical=Ev;exports.SpotLight=il;exports.Sprite=am;exports.SpriteMaterial=Zc;exports.THREE=gO;exports.TOUCH=H_;exports.Texture=Xt;exports.TextureLoader=fv;exports.TorusGeometry=tl;exports.Triangle=Zn;exports.TriangleFanDrawMode=fy;exports.TriangleStripDrawMode=py;exports.TrianglesDrawMode=dy;exports.Uint16BufferAttribute=Wh;exports.Uniform$1=wv;exports.UniformsLib=Se;exports.UniformsUtils=nm;exports.UnsignedByteType=es;exports.UnsignedInt101111Type=Fh;exports.UnsignedInt248Type=or;exports.UnsignedInt5999Type=Uh;exports.UnsignedIntType=Bi;exports.Vector2=J;exports.Vector3=E;exports.Vector4=st;exports.VectorKeyframeTrack=ca;exports.VideoTexture=Ky;exports.WebGLCubeRenderTarget=qh;exports.WebGLRenderTarget=zi;exports.WebGLRenderer=Yy;exports.WireframeGeometry=Tm;exports.ZeroStencilOp=my;exports.defaultShaderStages=qm;exports.normalView=di;
3870
+ `):e.addLineFlowCode(`${t}Barrier()`,this)}}const o0=K(DU),UU=()=>o0("workgroup").append(),FU=()=>o0("storage").append(),OU=()=>o0("texture").append();class VU extends mr{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let n;const i=e.context.assign;if(n=super.generate(e),i!==!0){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}class BU extends Ye{constructor(e,t,n=0){super(t),this.bufferType=t,this.bufferCount=n,this.isWorkgroupInfoNode=!0,this.scope=e}label(e){return this.name=e,this}getHash(){return this.uuid}setScope(e){return this.scope=e,this}getInputType(){return`${this.scope}Array`}element(e){return H(new VU(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const zU=(s,e)=>H(new BU("Workgroup",s,e));class wn extends pt{static get type(){return"AtomicFunctionNode"}constructor(e,t,n,i=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.storeNode=i}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,n=this.getNodeType(e),i=this.getInputType(e),r=this.pointerNode,o=this.valueNode,a=[];a.push(`&${r.build(e,i)}`),a.push(o.build(e,i));const c=`${e.getMethod(t,n)}( ${a.join(", ")} )`;if(this.storeNode!==null){const l=this.storeNode.build(e,i);e.addLineFlowCode(`${l} = ${c}`,this)}else e.addLineFlowCode(c,this)}}wn.ATOMIC_LOAD="atomicLoad";wn.ATOMIC_STORE="atomicStore";wn.ATOMIC_ADD="atomicAdd";wn.ATOMIC_SUB="atomicSub";wn.ATOMIC_MAX="atomicMax";wn.ATOMIC_MIN="atomicMin";wn.ATOMIC_AND="atomicAnd";wn.ATOMIC_OR="atomicOr";wn.ATOMIC_XOR="atomicXor";const kU=K(wn),Os=(s,e,t,n)=>{const i=kU(s,e,t,n);return i.append(),i},GU=(s,e,t=null)=>Os(wn.ATOMIC_STORE,s,e,t),HU=(s,e,t=null)=>Os(wn.ATOMIC_ADD,s,e,t),WU=(s,e,t=null)=>Os(wn.ATOMIC_SUB,s,e,t),XU=(s,e,t=null)=>Os(wn.ATOMIC_MAX,s,e,t),qU=(s,e,t=null)=>Os(wn.ATOMIC_MIN,s,e,t),$U=(s,e,t=null)=>Os(wn.ATOMIC_AND,s,e,t),YU=(s,e,t=null)=>Os(wn.ATOMIC_OR,s,e,t),ZU=(s,e,t=null)=>Os(wn.ATOMIC_XOR,s,e,t),JU=U(([s=rt()])=>{const e=s.mul(2),t=e.x.floor(),n=e.y.floor();return t.add(n).mod(2).sign()}),ac=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=cr(s).toVar();return In(r,i,n)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),bh=U(([s,e])=>{const t=cr(e).toVar(),n=A(s).toVar();return In(t,n.negate(),n)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),rn=U(([s])=>{const e=A(s).toVar();return L(gr(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),Ht=U(([s,e])=>{const t=A(s).toVar();return e.assign(rn(t)),t.sub(A(e))}),KU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=A(n).toVar(),l=A(t).toVar(),u=A(e).toVar(),h=A(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),jU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=D(n).toVar(),l=D(t).toVar(),u=D(e).toVar(),h=D(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),Rw=On([KU,jU]),QU=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=A(a).toVar(),x=A(o).toVar(),m=A(r).toVar(),g=A(i).toVar(),y=A(n).toVar(),_=A(t).toVar(),v=A(e).toVar(),I=A(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),eF=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=D(a).toVar(),x=D(o).toVar(),m=D(r).toVar(),g=D(i).toVar(),y=D(n).toVar(),_=D(t).toVar(),v=D(e).toVar(),I=D(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),Iw=On([QU,eF]),tF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=ve(s).toVar(),o=ve(r.bitAnd(ve(7))).toVar(),a=A(ac(o.lessThan(ve(4)),i,n)).toVar(),c=A(ot(2,ac(o.lessThan(ve(4)),n,i))).toVar();return bh(a,cr(o.bitAnd(ve(1)))).add(bh(c,cr(o.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),nF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=ve(s).toVar(),c=ve(a.bitAnd(ve(15))).toVar(),l=A(ac(c.lessThan(ve(8)),o,r)).toVar(),u=A(ac(c.lessThan(ve(4)),r,ac(c.equal(ve(12)).or(c.equal(ve(14))),o,i))).toVar();return bh(l,cr(c.bitAnd(ve(1)))).add(bh(u,cr(c.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yn=On([tF,nF]),iF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=wa(s).toVar();return D(yn(r.x,i,n),yn(r.y,i,n),yn(r.z,i,n))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),sF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=wa(s).toVar();return D(yn(a.x,o,r,i),yn(a.y,o,r,i),yn(a.z,o,r,i))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),Ri=On([iF,sF]),rF=U(([s])=>{const e=A(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),oF=U(([s])=>{const e=A(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),aF=U(([s])=>{const e=D(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Pw=On([rF,aF]),cF=U(([s])=>{const e=D(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Lw=On([oF,cF]),yi=U(([s,e])=>{const t=L(e).toVar(),n=ve(s).toVar();return n.shiftLeft(t).bitOr(n.shiftRight(L(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),Dw=U(([s,e,t])=>{s.subAssign(t),s.bitXorAssign(yi(t,L(4))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(6))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(8))),e.addAssign(s),s.subAssign(t),s.bitXorAssign(yi(t,L(16))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(19))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(4))),e.addAssign(s)}),Sl=U(([s,e,t])=>{const n=ve(t).toVar(),i=ve(e).toVar(),r=ve(s).toVar();return n.bitXorAssign(i),n.subAssign(yi(i,L(14))),r.bitXorAssign(n),r.subAssign(yi(n,L(11))),i.bitXorAssign(r),i.subAssign(yi(r,L(25))),n.bitXorAssign(i),n.subAssign(yi(i,L(16))),r.bitXorAssign(n),r.subAssign(yi(n,L(4))),i.bitXorAssign(r),i.subAssign(yi(r,L(14))),n.bitXorAssign(i),n.subAssign(yi(i,L(24))),n}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Wn=U(([s])=>{const e=ve(s).toVar();return A(e).div(A(ve(L(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),ps=U(([s])=>{const e=A(s).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),lF=U(([s])=>{const e=L(s).toVar(),t=ve(ve(1)).toVar(),n=ve(ve(L(3735928559)).add(t.shiftLeft(ve(2))).add(ve(13))).toVar();return Sl(n.add(ve(e)),n,n)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),uF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(ve(2)).toVar(),r=ve().toVar(),o=ve().toVar(),a=ve().toVar();return r.assign(o.assign(a.assign(ve(L(3735928559)).add(i.shiftLeft(ve(2))).add(ve(13))))),r.addAssign(ve(n)),o.addAssign(ve(t)),Sl(r,o,a)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),hF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(ve(3)).toVar(),a=ve().toVar(),c=ve().toVar(),l=ve().toVar();return a.assign(c.assign(l.assign(ve(L(3735928559)).add(o.shiftLeft(ve(2))).add(ve(13))))),a.addAssign(ve(r)),c.addAssign(ve(i)),l.addAssign(ve(n)),Sl(a,c,l)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),dF=U(([s,e,t,n])=>{const i=L(n).toVar(),r=L(t).toVar(),o=L(e).toVar(),a=L(s).toVar(),c=ve(ve(4)).toVar(),l=ve().toVar(),u=ve().toVar(),h=ve().toVar();return l.assign(u.assign(h.assign(ve(L(3735928559)).add(c.shiftLeft(ve(2))).add(ve(13))))),l.addAssign(ve(a)),u.addAssign(ve(o)),h.addAssign(ve(r)),Dw(l,u,h),l.addAssign(ve(i)),Sl(l,u,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),pF=U(([s,e,t,n,i])=>{const r=L(i).toVar(),o=L(n).toVar(),a=L(t).toVar(),c=L(e).toVar(),l=L(s).toVar(),u=ve(ve(5)).toVar(),h=ve().toVar(),d=ve().toVar(),p=ve().toVar();return h.assign(d.assign(p.assign(ve(L(3735928559)).add(u.shiftLeft(ve(2))).add(ve(13))))),h.addAssign(ve(l)),d.addAssign(ve(c)),p.addAssign(ve(a)),Dw(h,d,p),h.addAssign(ve(o)),d.addAssign(ve(r)),Sl(h,d,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Pt=On([lF,uF,hF,dF,pF]),fF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(Pt(n,t)).toVar(),r=wa().toVar();return r.x.assign(i.bitAnd(L(255))),r.y.assign(i.shiftRight(L(8)).bitAnd(L(255))),r.z.assign(i.shiftRight(L(16)).bitAnd(L(255))),r}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),mF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(Pt(r,i,n)).toVar(),a=wa().toVar();return a.x.assign(o.bitAnd(L(255))),a.y.assign(o.shiftRight(L(8)).bitAnd(L(255))),a.z.assign(o.shiftRight(L(16)).bitAnd(L(255))),a}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),Ii=On([fF,mF]),gF=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=A(Rw(yn(Pt(t,n),i,r),yn(Pt(t.add(L(1)),n),i.sub(1),r),yn(Pt(t,n.add(L(1))),i,r.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),xF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=A(Iw(yn(Pt(t,n,i),r,o,a),yn(Pt(t.add(L(1)),n,i),r.sub(1),o,a),yn(Pt(t,n.add(L(1)),i),r,o.sub(1),a),yn(Pt(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),yn(Pt(t,n,i.add(L(1))),r,o,a.sub(1)),yn(Pt(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),yn(Pt(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),a0=On([gF,xF]),_F=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=D(Rw(Ri(Ii(t,n),i,r),Ri(Ii(t.add(L(1)),n),i.sub(1),r),Ri(Ii(t,n.add(L(1))),i,r.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),yF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=D(Iw(Ri(Ii(t,n,i),r,o,a),Ri(Ii(t.add(L(1)),n,i),r.sub(1),o,a),Ri(Ii(t,n.add(L(1)),i),r,o.sub(1),a),Ri(Ii(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),Ri(Ii(t,n,i.add(L(1))),r,o,a.sub(1)),Ri(Ii(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),Ri(Ii(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),c0=On([_F,yF]),vF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return Wn(Pt(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),MF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return Wn(Pt(t,n))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),SF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return Wn(Pt(t,n,i))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),TF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return Wn(Pt(t,n,i,r))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),bF=On([vF,MF,SF,TF]),wF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return D(Wn(Pt(t,L(0))),Wn(Pt(t,L(1))),Wn(Pt(t,L(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),AF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return D(Wn(Pt(t,n,L(0))),Wn(Pt(t,n,L(1))),Wn(Pt(t,n,L(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),NF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return D(Wn(Pt(t,n,i,L(0))),Wn(Pt(t,n,i,L(1))),Wn(Pt(t,n,i,L(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),EF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return D(Wn(Pt(t,n,i,r,L(0))),Wn(Pt(t,n,i,r,L(1))),Wn(Pt(t,n,i,r,L(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),Uw=On([wF,AF,NF,EF]),wh=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=A(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(a0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),Fw=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(c0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar();return z(wh(a,o,r,i),wh(a.add(D(L(19),L(193),L(17))),o,r,i))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),RF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(Fw(a,o,r,i)).toVar(),l=A(wh(a.add(D(L(19),L(193),L(17))),o,r,i)).toVar();return oe(c,l)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IF=U(([s,e,t,n,i,r,o])=>{const a=L(o).toVar(),c=A(r).toVar(),l=L(i).toVar(),u=L(n).toVar(),h=L(t).toVar(),d=L(e).toVar(),p=z(s).toVar(),f=D(Uw(z(d.add(u),h.add(l)))).toVar(),x=z(f.x,f.y).toVar();x.subAssign(.5),x.mulAssign(c),x.addAssign(.5);const m=z(z(A(d),A(h)).add(x)).toVar(),g=z(m.sub(p)).toVar();return Oe(a.equal(L(2)),()=>Dt(g.x).add(Dt(g.y))),Oe(a.equal(L(3)),()=>ft(Dt(g.x),Dt(g.y))),$t(g,g)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),PF=U(([s,e,t,n,i,r,o,a,c])=>{const l=L(c).toVar(),u=A(a).toVar(),h=L(o).toVar(),d=L(r).toVar(),p=L(i).toVar(),f=L(n).toVar(),x=L(t).toVar(),m=L(e).toVar(),g=D(s).toVar(),y=D(Uw(D(m.add(p),x.add(d),f.add(h)))).toVar();y.subAssign(.5),y.mulAssign(u),y.addAssign(.5);const _=D(D(A(m),A(x),A(f)).add(y)).toVar(),v=D(_.sub(g)).toVar();return Oe(l.equal(L(2)),()=>Dt(v.x).add(Dt(v.y)).add(Dt(v.z))),Oe(l.equal(L(3)),()=>ft(ft(Dt(v.x),Dt(v.y)),Dt(v.z))),$t(v,v)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),Ea=On([IF,PF]),LF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();l.assign(Mn(l,d))})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.y.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.z.assign(l.y),l.y.assign(d)}).ElseIf(d.lessThan(l.z),()=>{l.z.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),FF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();u.assign(Mn(u,f))})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OF=On([LF,FF]),VF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.y.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),BF=On([DF,VF]),zF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(f)}).ElseIf(f.lessThan(u.z),()=>{u.z.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kF=On([UF,zF]),GF=U(([s])=>{const e=s.y,t=s.z,n=D().toVar();return Oe(e.lessThan(1e-4),()=>{n.assign(D(t,t,t))}).Else(()=>{let i=s.x;i=i.sub(gr(i)).mul(6).toVar();const r=L(mg(i)),o=i.sub(A(r)),a=t.mul(e.oneMinus()),c=t.mul(e.mul(o).oneMinus()),l=t.mul(e.mul(o.oneMinus()).oneMinus());Oe(r.equal(L(0)),()=>{n.assign(D(t,l,a))}).ElseIf(r.equal(L(1)),()=>{n.assign(D(c,t,a))}).ElseIf(r.equal(L(2)),()=>{n.assign(D(a,t,l))}).ElseIf(r.equal(L(3)),()=>{n.assign(D(a,c,t))}).ElseIf(r.equal(L(4)),()=>{n.assign(D(l,a,t))}).Else(()=>{n.assign(D(t,a,c))})}),n}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),HF=U(([s])=>{const e=D(s).toVar(),t=A(e.x).toVar(),n=A(e.y).toVar(),i=A(e.z).toVar(),r=A(Mn(t,Mn(n,i))).toVar(),o=A(ft(t,ft(n,i))).toVar(),a=A(o.sub(r)).toVar(),c=A().toVar(),l=A().toVar(),u=A().toVar();return u.assign(o),Oe(o.greaterThan(0),()=>{l.assign(a.div(o))}).Else(()=>{l.assign(0)}),Oe(l.lessThanEqual(0),()=>{c.assign(0)}).Else(()=>{Oe(t.greaterThanEqual(o),()=>{c.assign(n.sub(i).div(a))}).ElseIf(n.greaterThanEqual(o),()=>{c.assign(Wt(2,i.sub(t).div(a)))}).Else(()=>{c.assign(Wt(4,t.sub(n).div(a)))}),c.mulAssign(1/6),Oe(c.lessThan(0),()=>{c.addAssign(1)})}),D(c,l,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),WF=U(([s])=>{const e=D(s).toVar(),t=Qm(ug(e,D(.04045))).toVar(),n=D(e.div(12.92)).toVar(),i=D(Kn(ft(e.add(D(.055)),D(0)).div(1.055),D(2.4))).toVar();return it(n,i,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Ow=(s,e)=>{s=A(s),e=A(e);const t=z(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return ti(s.sub(t),s.add(t),e)},Vw=(s,e,t,n)=>it(s,e,t[n].clamp()),XF=(s,e,t=rt())=>Vw(s,e,t,"x"),qF=(s,e,t=rt())=>Vw(s,e,t,"y"),Bw=(s,e,t,n,i)=>it(s,e,Ow(t,n[i])),$F=(s,e,t,n=rt())=>Bw(s,e,t,n,"x"),YF=(s,e,t,n=rt())=>Bw(s,e,t,n,"y"),ZF=(s=1,e=0,t=rt())=>t.mul(s).add(e),JF=(s,e=1)=>(s=A(s),s.abs().pow(e).mul(s.sign())),KF=(s,e=1,t=.5)=>A(s).sub(t).mul(e).add(t),jF=(s=rt(),e=1,t=0)=>a0(s.convert("vec2|vec3")).mul(e).add(t),QF=(s=rt(),e=1,t=0)=>c0(s.convert("vec2|vec3")).mul(e).add(t),eO=(s=rt(),e=1,t=0)=>(s=s.convert("vec2|vec3"),oe(c0(s),a0(s.add(z(19,73)))).mul(e).add(t)),tO=(s=rt(),e=1)=>OF(s.convert("vec2|vec3"),e,L(1)),nO=(s=rt(),e=1)=>BF(s.convert("vec2|vec3"),e,L(1)),iO=(s=rt(),e=1)=>kF(s.convert("vec2|vec3"),e,L(1)),sO=(s=rt())=>bF(s.convert("vec2|vec3")),rO=(s=rt(),e=3,t=2,n=.5,i=1)=>wh(s,L(e),t,n).mul(i),oO=(s=rt(),e=3,t=2,n=.5,i=1)=>CF(s,L(e),t,n).mul(i),aO=(s=rt(),e=3,t=2,n=.5,i=1)=>Fw(s,L(e),t,n).mul(i),cO=(s=rt(),e=3,t=2,n=.5,i=1)=>RF(s,L(e),t,n).mul(i),zw=U(([s,e])=>{const t=s.x,n=s.y,i=s.z;let r=e.element(0).mul(.886227);return r=r.add(e.element(1).mul(2*.511664).mul(n)),r=r.add(e.element(2).mul(2*.511664).mul(i)),r=r.add(e.element(3).mul(2*.511664).mul(t)),r=r.add(e.element(4).mul(2*.429043).mul(t).mul(n)),r=r.add(e.element(5).mul(2*.429043).mul(n).mul(i)),r=r.add(e.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),r=r.add(e.element(7).mul(2*.429043).mul(t).mul(i)),r=r.add(e.element(8).mul(.429043).mul(ot(t,t).sub(ot(n,n)))),r});class kw extends yr{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setup(e){const{colorNode:t,cutoffDistanceNode:n,decayExponentNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r).sub(Pn),c=a.normalize(),l=a.length(),u=n0({lightDistance:l,cutoffDistance:n,decayExponent:i}),h=t.mul(u),d=e.context.reflectedLight;o.direct({lightDirection:c,lightColor:h,reflectedLight:d},e.stack,e)}}class Gw extends yr{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,n=this.colorNode,i=r0(this.light),r=e.context.reflectedLight;t.direct({lightDirection:i,lightColor:n,reflectedLight:r},e.stack,e)}}const nf=new Fe,Nu=new Fe;let Ya=null;class Hw extends yr{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=pe(new E).setGroup(_t),this.halfWidth=pe(new E).setGroup(_t)}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;Nu.identity(),nf.copy(t.matrixWorld),nf.premultiply(n),Nu.extractRotation(nf),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(Nu),this.halfHeight.value.applyMatrix4(Nu)}setup(e){super.setup(e);let t,n;e.isAvailable("float32Filterable")?(t=xt(Ya.LTC_FLOAT_1),n=xt(Ya.LTC_FLOAT_2)):(t=xt(Ya.LTC_HALF_1),n=xt(Ya.LTC_HALF_2));const{colorNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r),c=e.context.reflectedLight;o.directRectArea({lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:c,ltc_1:t,ltc_2:n},e.stack,e)}static setLTC(e){Ya=e}}class l0 extends yr{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=pe(0).setGroup(_t),this.penumbraCosNode=pe(0).setGroup(_t),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:n}=this;return ti(t,n,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:n,cutoffDistanceNode:i,decayExponentNode:r,light:o}=this,a=zd(o).sub(Pn),c=a.normalize(),l=c.dot(r0(o)),u=this.getSpotAttenuation(l),h=a.length(),d=n0({lightDistance:h,cutoffDistance:i,decayExponent:r}),p=n.mul(u).mul(d),f=e.context.reflectedLight;t.direct({lightDirection:c,lightColor:p,reflectedLight:f},e.stack,e)}}class Ww extends l0{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let n=null;if(t&&t.isTexture===!0){const i=e.acos().mul(1/Math.PI);n=xt(t,z(i,0),0).r}else n=super.getSpotAttenuation(e);return n}}class Xw extends yr{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class qw extends yr{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=s0(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=pe(new _e).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:i}=this,o=di.dot(i).mul(.5).add(.5),a=it(n,t,o);e.context.irradiance.addAssign(a)}}class $w extends yr{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let n=0;n<9;n++)t.push(new E);this.lightProbe=ds(t)}update(e){const{light:t}=this;super.update(e);for(let n=0;n<9;n++)this.lightProbe.array[n].copy(t.sh.coefficients[n]).multiplyScalar(t.intensity)}setup(e){const t=zw(Ed,this.lightProbe);e.context.irradiance.addAssign(t)}}class lO{parseFunction(){console.warn("Abstract function.")}}class Yw{constructor(e,t,n="",i=""){this.type=e,this.inputs=t,this.name=n,this.precision=i}getCode(){console.warn("Abstract function.")}}Yw.isNodeFunction=!0;const uO=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,hO=/[a-z_0-9]+/ig,k_="#pragma main",dO=s=>{s=s.trim();const e=s.indexOf(k_),t=e!==-1?s.slice(e+k_.length):s,n=t.match(uO);if(n!==null&&n.length===5){const i=n[4],r=[];let o=null;for(;(o=hO.exec(i))!==null;)r.push(o);const a=[];let c=0;for(;c<r.length;){const f=r[c][0]==="const";f===!0&&c++;let x=r[c][0];x==="in"||x==="out"||x==="inout"?c++:x="";const m=r[c++][0];let g=Number.parseInt(r[c][0]);Number.isNaN(g)===!1?c++:g=null;const y=r[c++][0];a.push(new Kg(m,y,g,x,f))}const l=t.substring(n[0].length),u=n[3]!==void 0?n[3]:"",h=n[2],d=n[1]!==void 0?n[1]:"",p=e!==-1?s.slice(0,e):"";return{type:h,inputs:a,name:u,precision:d,inputsCode:i,blockCode:l,headerCode:p}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class pO extends Yw{constructor(e){const{type:t,inputs:n,name:i,precision:r,inputsCode:o,blockCode:a,headerCode:c}=dO(e);super(t,n,i,r),this.inputsCode=o,this.blockCode=a,this.headerCode=c}getCode(e=this.name){let t;const n=this.blockCode;if(n!==""){const{type:i,inputsCode:r,headerCode:o,precision:a}=this;let c=`${i} ${e} ( ${r.trim()} )`;a!==""&&(c=`${a} ${c}`),t=o+c+n}else t="";return t}}class Zw extends lO{parseFunction(e){return new pO(e)}}class fO{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(n!==null){t=new n;for(const i in e)t[i]=e[i]}return t}addColorSpace(e,t){this.addType(e,t,this.colorSpaceNodes)}getColorSpaceFunction(e){return this.colorSpaceNodes.get(e)||null}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t.name,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}addClass(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}class mO extends il{constructor(e,t,n,i,r,o){super(e,t,n,i,r,o),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class Jw extends fO{constructor(){super(),this.addLight(kw,_d),this.addLight(Gw,yd),this.addLight(Hw,Im),this.addLight(l0,il),this.addLight(Xw,vd),this.addLight(qw,xd),this.addLight($w,Pm),this.addLight(Ww,mO),this.addToneMapping(bw,Ah),this.addToneMapping(ww,Nh),this.addToneMapping(Aw,Bf),this.addToneMapping(Nw,Eh),this.addToneMapping(Ew,Ch),this.addToneMapping(Cw,Rh),this.addColorSpace(Tw,xh(li,kn)),this.addColorSpace(Sw,xh(kn,li))}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ks}}));if(typeof window<"u"){try{typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-qj71I7J3.umd.cjs",document.baseURI).href,window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-qj71I7J3.umd.cjs",document.baseURI).href,revision:Ks})}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Ks),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Ks}const gO=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Eh,AONode:OT,AddEquation:Zs,AddOperation:Vf,AdditiveAnimationBlendMode:Yf,AdditiveBlending:cc,AfterImageNode:qb,AgXToneMapping:Ch,AlphaFormat:Gf,AlwaysCompare:Dy,AlwaysDepth:uc,AlwaysStencilFunc:ih,AmbientLight:vd,AmbientLightNode:Xw,AnaglyphPassNode:uw,AnalyticLightNode:yr,AnamorphicNode:Yb,AnimationAction:Tv,AnimationClip:la,AnimationLoader:FI,AnimationMixer:bv,AnimationObjectGroup:tP,AnimationUtils:PI,ArcCurve:tv,ArrayCamera:rm,ArrayElementNode:mr,ArrowHelper:mP,AssignNode:oM,AttachedBindMode:af,AttributeNode:Ag,Audio:Fm,AudioAnalyser:XI,AudioContext:Md,AudioListener:vv,AudioLoader:yv,AxesHelper:Fv,BRDF_GGX:Af,BRDF_Lambert:no,BackSide:ln,BasicDepthPacking:Zf,BasicEnvironmentNode:Dd,BasicNodeLibrary:Jw,BasicShadowMap:nA,BatchNode:CT,BatchedMesh:hm,BloomNode:sw,Bone:Kh,BooleanKeyframeTrack:pr,Box2:aP,Box3:Hn,Box3Helper:Uv,BoxGeometry:_s,BoxHelper:Dv,Break:Ld,BufferAttribute:At,BufferAttributeNode:fS,BufferGeometry:at,BufferGeometryLoader:gv,BufferNode:Rd,BumpMapNode:JS,BypassNode:yS,ByteType:zf,Cache:Rs,CacheNode:_S,Camera:Yc,CameraHelper:Lv,CanvasTexture:ev,CapsuleGeometry:Qh,CatmullRomCurve3:gm,CineonToneMapping:Bf,CircleGeometry:ed,ClampToEdgeWrapping:Si,Clock:Um,CodeNode:$g,Color:_e,ColorKeyframeTrack:md,ColorManagement:gt,ColorSpaceNode:hl,CompressedArrayTexture:jy,CompressedCubeTexture:Qy,CompressedTexture:Kc,CompressedTextureLoader:OI,ComputeNode:gS,ConeGeometry:td,ConstNode:Wi,ConstantAlphaFactor:oy,ConstantColorFactor:sy,ContextNode:vg,Continue:wL,Controls:Vv,ConvertNode:$m,CubeCamera:Xh,CubeReflectionMapping:wi,CubeRefractionMapping:Vi,CubeTexture:so,CubeTextureLoader:VI,CubeTextureNode:GS,CubeUVReflectionMapping:hr,CubicBezierCurve:xm,CubicBezierCurve3:nv,CubicInterpolant:uv,CullFaceBack:sf,CullFaceFront:X_,CullFaceFrontBack:tA,CullFaceNone:W_,Curve:Gi,CurvePath:sv,CustomBlending:Uf,CustomToneMapping:cy,CylinderGeometry:co,Cylindrical:oP,DFGApprox:Hg,D_GGX:eb,Data3DTexture:Hh,DataArrayTexture:qc,DataTexture:Oi,DataTextureLoader:pv,DataUtils:By,DecrementStencilOp:_y,DecrementWrapStencilOp:vy,DefaultLoadingManager:Cm,DenoiseNode:nw,DepthFormat:Qs,DepthOfFieldNode:Jb,DepthStencilFormat:ar,DepthTexture:ao,DetachedBindMode:ly,DirectionalLight:yd,DirectionalLightHelper:Pv,DirectionalLightNode:Gw,Discard:bS,DiscreteInterpolant:hv,DisplayP3ColorSpace:kh,DodecahedronGeometry:nd,DotScreenNode:Kb,DoubleSide:Ji,DstAlphaFactor:Q_,DstColorFactor:ty,DynamicCopyUsage:fA,DynamicDrawUsage:Gr,DynamicReadUsage:hA,EPSILON:AM,EdgesGeometry:Sm,EllipseCurve:jh,EnvironmentNode:hb,EqualCompare:Ry,EqualDepth:dc,EqualStencilFunc:by,EquirectUVNode:YT,EquirectangularReflectionMapping:ir,EquirectangularRefractionMapping:sr,Euler:ui,EventDispatcher:Ai,ExpressionNode:TS,ExtrudeGeometry:Qc,FXAANode:iw,F_Schlick:pa,FileLoader:ts,FilmNode:Qb,Float16BufferAttribute:zy,Float32BufferAttribute:Ve,FloatType:Gn,Fn:U,Fog:om,FogExp2:Zh,FogExp2Node:xw,FogNode:Bd,FogRangeNode:gw,FramebufferTexture:fm,FrontFacingNode:LS,FrontSide:fs,Frustum:ga,FunctionCallNode:cM,FunctionNode:Yg,FunctionOverloadingNode:Cb,GLBufferAttribute:rP,GLSL1:gA,GLSL3:sh,GLSLNodeParser:Zw,GTAONode:tw,GaussianBlurNode:Xb,GreaterCompare:Iy,GreaterDepth:fc,GreaterEqualCompare:Ly,GreaterEqualDepth:pc,GreaterEqualStencilFunc:Ey,GreaterStencilFunc:Ay,GridHelper:Iv,Group:Hr,HalfFloatType:Ln,HemisphereLight:xd,HemisphereLightHelper:dP,HemisphereLightNode:qw,IESSpotLightNode:Ww,INFINITY:zP,IcosahedronGeometry:sd,If:Oe,ImageBitmapLoader:_v,ImageLoader:Dc,ImageUtils:Oy,IncrementStencilOp:xy,IncrementWrapStencilOp:yy,IndexNode:zt,InstanceNode:NT,InstancedBufferAttribute:Us,InstancedBufferGeometry:Lm,InstancedInterleavedBuffer:Bm,InstancedMesh:um,InstancedPointsNodeMaterial:zL,Int16BufferAttribute:e1,Int32BufferAttribute:t1,Int8BufferAttribute:KA,IntType:ma,InterleavedBuffer:_a,InterleavedBufferAttribute:Ds,Interpolant:Sa,InterpolateDiscrete:ia,InterpolateLinear:bc,InterpolateSmooth:Eu,InvertStencilOp:My,IrradianceNode:zT,JoinNode:Gv,KeepStencilOp:$s,KeyframeTrack:Hi,LOD:cm,LatheGeometry:jc,Layers:$c,LessCompare:jf,LessDepth:hc,LessEqualCompare:Qf,LessEqualDepth:nr,LessEqualStencilFunc:wy,LessStencilFunc:Ty,Light:fr,LightProbe:Pm,LightProbeNode:$w,LightingContextNode:VT,LightingModel:Ml,LightingNode:ho,LightsNode:UT,Line:Fs,Line2NodeMaterial:qL,Line3:Cv,LineBasicMaterial:Fn,LineBasicNodeMaterial:GL,LineCurve:_m,LineCurve3:iv,LineDashedMaterial:fd,LineDashedNodeMaterial:WL,LineLoop:dm,LineSegments:rs,LinearDisplayP3ColorSpace:Xc,LinearFilter:Ut,LinearInterpolant:Em,LinearMipMapLinearFilter:uy,LinearMipMapNearestFilter:rA,LinearMipmapLinearFilter:Jn,LinearMipmapNearestFilter:js,LinearSRGBColorSpace:li,LinearToneMapping:Ah,LinearTransfer:Ac,Loader:Xn,LoaderUtils:lh,LoadingManager:gd,Loop:mt,LoopNode:PT,LoopOnce:qf,LoopPingPong:hy,LoopRepeat:$f,LuminanceAlphaFormat:Wf,LuminanceFormat:Hf,Lut3DNode:ew,MOUSE:G_,MRTNode:Eb,MatcapUVNode:fb,Material:mn,MaterialLoader:sl,MaterialNode:j,MaterialReferenceNode:HS,MathUtils:Gh,Matrix2:zm,Matrix3:Ke,Matrix4:Fe,MaxEquation:Ff,MaxMipLevelNode:ES,Mesh:kt,MeshBasicMaterial:ss,MeshBasicNodeMaterial:t2,MeshDepthMaterial:Yh,MeshDistanceMaterial:sm,MeshLambertMaterial:pd,MeshLambertNodeMaterial:o2,MeshMatcapMaterial:Am,MeshMatcapNodeMaterial:W2,MeshNormalMaterial:dd,MeshNormalNodeMaterial:ZL,MeshPhongMaterial:hd,MeshPhongNodeMaterial:c2,MeshPhysicalMaterial:ud,MeshPhysicalNodeMaterial:pb,MeshSSSNodeMaterial:V2,MeshStandardMaterial:nl,MeshStandardNodeMaterial:db,MeshToonMaterial:wm,MeshToonNodeMaterial:G2,MinEquation:Y_,MirroredRepeatWrapping:ea,MixOperation:Of,ModelNode:is,ModelViewProjectionNode:bT,MorphNode:LT,MultiplyBlending:of,MultiplyOperation:fa,NearestFilter:Qt,NearestMipMapLinearFilter:sA,NearestMipMapNearestFilter:iA,NearestMipmapLinearFilter:Cs,NearestMipmapNearestFilter:Ph,NeutralToneMapping:Rh,NeverCompare:Cy,NeverDepth:lc,NeverStencilFunc:Sy,NoBlending:Fi,NoColorSpace:Li,NoToneMapping:Ti,Node:Ye,NodeAttribute:If,NodeBuilder:Ab,NodeCache:Lu,NodeCode:Tb,NodeFrame:Nb,NodeFunctionInput:Kg,NodeLoader:yb,NodeMaterial:Tt,NodeMaterialLoader:vb,NodeMaterialObserver:Bv,NodeObjectLoader:e3,NodeShaderStage:mf,NodeType:yP,NodeUniform:Mb,NodeUpdateType:We,NodeUtils:_P,NodeVar:Xg,NodeVarying:Sb,NormalAnimationBlendMode:zh,NormalBlending:Ps,NormalMapNode:ZS,NotEqualCompare:Py,NotEqualDepth:mc,NotEqualStencilFunc:Ny,NumberKeyframeTrack:aa,Object3D:yt,Object3DNode:wt,ObjectLoader:xv,ObjectSpaceNormalMap:Kf,OctahedronGeometry:va,OneFactor:J_,OneMinusConstantAlphaFactor:ay,OneMinusConstantColorFactor:ry,OneMinusDstAlphaFactor:ey,OneMinusDstColorFactor:ny,OneMinusSrcAlphaFactor:Vu,OneMinusSrcColorFactor:j_,OrthographicCamera:oo,OscNode:pn,OutputStructNode:jg,P3Primaries:Ec,PCFShadowMap:Lf,PCFSoftShadowMap:Df,PI:to,PI2:kP,PMREMGenerator:rh,PMREMNode:lb,ParallaxBarrierPassNode:hw,ParameterNode:qg,PassNode:bn,Path:Rc,PerspectiveCamera:hn,PhongLightingModel:kg,PhysicalLightingModel:Fd,PixelationPassNode:ow,Plane:cs,PlaneGeometry:ro,PlaneHelper:fP,PointLight:_d,PointLightHelper:uP,PointLightNode:kw,PointUVNode:Vb,Points:pm,PointsMaterial:ya,PointsNodeMaterial:q2,PolarGridHelper:pP,PolyhedronGeometry:dr,PositionalAudio:Mv,PosterizeNode:Gb,PropertyBinding:St,PropertyMixer:Sv,PropertyNode:Nt,QuadraticBezierCurve:ym,QuadraticBezierCurve3:vm,Quaternion:Qn,QuaternionKeyframeTrack:Ta,QuaternionLinearInterpolant:dv,RED_GREEN_RGTC2_Format:th,RED_RGTC1_Format:Xf,REVISION:Ks,RGBADepthPacking:Jf,RGBAFormat:Rn,RGBAIntegerFormat:Bh,RGBA_ASTC_10x10_Format:Ju,RGBA_ASTC_10x5_Format:$u,RGBA_ASTC_10x6_Format:Yu,RGBA_ASTC_10x8_Format:Zu,RGBA_ASTC_12x10_Format:Ku,RGBA_ASTC_12x12_Format:ju,RGBA_ASTC_4x4_Format:Mc,RGBA_ASTC_5x4_Format:ku,RGBA_ASTC_5x5_Format:Gu,RGBA_ASTC_6x5_Format:Hu,RGBA_ASTC_6x6_Format:Sc,RGBA_ASTC_8x5_Format:Wu,RGBA_ASTC_8x6_Format:Xu,RGBA_ASTC_8x8_Format:qu,RGBA_BPTC_Format:Ko,RGBA_ETC2_EAC_Format:vc,RGBA_PVRTC_2BPPV1_Format:zu,RGBA_PVRTC_4BPPV1_Format:xc,RGBA_S3TC_DXT1_Format:Yo,RGBA_S3TC_DXT3_Format:Zo,RGBA_S3TC_DXT5_Format:Jo,RGBDepthPacking:aA,RGBFormat:Oh,RGBIntegerFormat:oA,RGBShiftNode:jb,RGB_BPTC_SIGNED_Format:Qu,RGB_BPTC_UNSIGNED_Format:Tc,RGB_ETC1_Format:_c,RGB_ETC2_Format:yc,RGB_PVRTC_2BPPV1_Format:Bu,RGB_PVRTC_4BPPV1_Format:gc,RGB_S3TC_DXT1_Format:$o,RGDepthPacking:cA,RGFormat:na,RGIntegerFormat:Vh,RTTNode:Ub,RangeNode:_w,RawShaderMaterial:bm,Ray:io,Raycaster:Nv,Rec709Primaries:Nc,RectAreaLight:Im,RectAreaLightNode:Hw,RedFormat:Hc,RedIntegerFormat:Wc,ReferenceNode:ml,ReflectorNode:Db,ReinhardToneMapping:Nh,RemapNode:wg,RenderOutputNode:wS,RenderTarget:fn,RendererReferenceNode:lS,RepeatWrapping:rr,ReplaceStencilOp:gy,Return:qP,ReverseSubtractEquation:$_,RingGeometry:el,RotateNode:gb,SIGNED_RED_GREEN_RGTC2_Format:nh,SIGNED_RED_RGTC1_Format:eh,SRGBColorSpace:kn,SRGBTransfer:Vt,SSAAPassNode:aw,Scene:Jh,SceneNode:Qi,Schlick_to_F0:nb,ScreenNode:sn,ScriptableNode:mw,ScriptableValueNode:pw,SetNode:Hv,ShaderChunk:lt,ShaderLib:Pi,ShaderMaterial:ki,ShaderNode:ec,ShadowMaterial:ld,ShadowNodeMaterial:K2,Shape:er,ShapeGeometry:rd,ShapePath:Ov,ShapeUtils:ji,ShortType:kf,Skeleton:Jc,SkeletonHelper:lP,SkinnedMesh:lm,SkinningNode:Fg,SobelOperatorNode:Zb,Source:Js,Sphere:Dn,SphereGeometry:Ma,Spherical:Ev,SphericalHarmonics3:mv,SplineCurve:Mm,SplitNode:uh,SpotLight:il,SpotLightHelper:cP,SpotLightNode:l0,Sprite:am,SpriteMaterial:Zc,SpriteNodeMaterial:Y2,SpriteSheetUVNode:Rb,SrcAlphaFactor:Ou,SrcAlphaSaturateFactor:iy,SrcColorFactor:K_,StackNode:wb,StaticCopyUsage:pA,StaticDrawUsage:sa,StaticReadUsage:uA,StereoCamera:Dm,StereoPassNode:cw,StorageArrayElementNode:Ib,StorageBufferNode:t0,StorageTextureNode:Bb,StreamCopyUsage:mA,StreamDrawUsage:lA,StreamReadUsage:dA,StringKeyframeTrack:lo,SubtractEquation:q_,SubtractiveBlending:rf,TBNViewMatrix:qr,TOUCH:H_,TangentSpaceNormalMap:ms,TempNode:pt,TetrahedronGeometry:od,Texture:Xt,Texture3DNode:xb,TextureLoader:fv,TextureNode:gs,TextureSizeNode:NS,TextureUtils:OR,TimerNode:Sn,ToneMappingNode:hS,ToonOutlinePassNode:dw,TorusGeometry:tl,TorusKnotGeometry:ad,TransitionNode:rw,Triangle:Zn,TriangleFanDrawMode:fy,TriangleStripDrawMode:py,TrianglesDrawMode:dy,TriplanarTexturesNode:Pb,TubeGeometry:cd,UVMapping:Ih,Uint16BufferAttribute:Wh,Uint32BufferAttribute:tm,Uint8BufferAttribute:jA,Uint8ClampedBufferAttribute:QA,Uniform:wv,UniformArrayNode:Ig,UniformGroupNode:eg,UniformNode:uo,UniformsGroup:sP,UniformsLib:Se,UniformsUtils:nm,UnsignedByteType:es,UnsignedInt101111Type:Fh,UnsignedInt248Type:or,UnsignedInt5999Type:Uh,UnsignedIntType:Bi,UnsignedShort4444Type:Lh,UnsignedShort5551Type:Dh,UnsignedShortType:ta,UserDataNode:kb,VSMShadowMap:oi,V_GGX_SmithCorrelated:QT,VarNode:iS,VaryingNode:sS,Vector2:J,Vector3:E,Vector4:st,VectorKeyframeTrack:ca,VertexColorNode:Ob,VideoTexture:Ky,ViewportDepthNode:jn,ViewportDepthTextureNode:WT,ViewportSharedTextureNode:Hb,ViewportTextureNode:vl,VolumeNodeMaterial:Q2,WebGL3DRenderTarget:kA,WebGLArrayRenderTarget:zA,WebGLCoordinateSystem:Di,WebGLCubeRenderTarget:qh,WebGLMultipleRenderTargets:gP,WebGLRenderTarget:zi,WebGLRenderer:Yy,WebGLUtils:$y,WebGPUCoordinateSystem:Qr,WireframeGeometry:Tm,WrapAroundEnding:wc,ZeroCurvatureEnding:zr,ZeroFactor:Z_,ZeroSlopeEnding:kr,ZeroStencilOp:my,abs:Dt,acesFilmicToneMapping:Nw,acos:gh,add:Wt,addMethodChaining:te,addNodeElement:$P,afterImage:lD,agxToneMapping:Ew,all:hg,alphaT:dh,anaglyphPass:XD,anamorphic:mD,and:mM,anisotropy:Ys,anisotropyB:Jr,anisotropyT:tc,any:NM,ao:wD,append:Yv,arrayBuffer:FP,asin:LM,assign:aM,atan:DM,atan2:HM,atomicAdd:HU,atomicAnd:$U,atomicFunc:Os,atomicMax:XU,atomicMin:qU,atomicOr:YU,atomicStore:GU,atomicSub:WU,atomicXor:ZU,attenuationColor:ag,attenuationDistance:og,attribute:vn,backgroundBlurriness:K3,backgroundIntensity:j3,batch:RT,billboarding:fU,bitAnd:yM,bitNot:vM,bitOr:MM,bitXor:SM,bitangentGeometry:pL,bitangentLocal:fL,bitangentView:XS,bitangentWorld:mL,bitcast:GP,bleach:TU,bloom:DD,blur:cb,bool:cr,buffer:fl,bufferAttribute:dl,bumpMap:KS,burn:_U,bvec2:Kv,bvec3:Qm,bvec4:tM,bypass:vS,cache:ic,call:lM,cameraFar:Bo,cameraLogDepth:RS,cameraNear:Vo,cameraNormalMatrix:KP,cameraPosition:Ng,cameraProjectionMatrix:ci,cameraProjectionMatrixInverse:ZP,cameraViewMatrix:pi,cameraWorldMatrix:JP,cbrt:JM,ceil:fg,checker:JU,cineonToneMapping:Aw,clamp:cn,clearcoat:hh,clearcoatRoughness:zc,code:Od,color:Zv,colorSpaceToWorking:bg,colorToDirection:$L,compute:xS,cond:tS,context:Mg,convert:iM,convertToTexture:ei,cos:Mi,createCanvasElement:Fy,cross:Qo,cubeTexture:Cd,dFdx:OM,dFdy:VM,dashSize:Kr,defaultBuildStages:gf,defaultShaderStages:qm,defined:Oc,degrees:RM,denoise:ED,densityFog:jD,depth:Bg,depthPass:aD,difference:qM,diffuseColor:Ct,directionToColor:$T,dispersion:cg,distance:XM,div:ns,dodge:yU,dof:xD,dot:$t,dotScreen:_D,drawIndex:AT,dynamicBufferAttribute:mS,element:nM,emissive:yf,equal:uM,equals:EM,equirectUV:zg,exp:dg,exp2:mh,expression:lr,faceDirection:pl,faceForward:jM,film:vD,float:A,floor:gr,fog:JD,fract:xr,frameGroup:VP,frameId:F3,frontFacing:DS,fwidth:kM,fxaa:CD,gain:cU,gapSize:Gc,gaussianBlur:cD,getColorSpaceMethod:xh,getConstNodeType:$v,getCurrentStack:jm,getDirection:ob,getDistanceAttenuation:n0,getGeometryRoughness:jT,getRoughness:Gg,getShIrradianceAt:zw,getTextureIndex:Qg,global:Fu,glsl:r3,glslFn:o3,grayscale:uD,greaterThan:ug,greaterThanEqual:fM,hash:aU,highPrecisionModelNormalViewMatrix:cL,highPrecisionModelViewMatrix:aL,hue:pD,instance:ET,instanceIndex:yl,instancedBufferAttribute:_h,instancedDynamicBufferAttribute:vf,int:L,inverseSqrt:IM,invocationLocalIndex:TL,invocationSubgroupIndex:SL,ior:nc,iridescence:wd,iridescenceIOR:ng,iridescenceThickness:ig,ivec2:ls,ivec3:jv,ivec4:Qv,js:i3,label:nS,length:jr,lengthSq:xg,lessThan:dM,lessThanEqual:pM,lightPosition:s0,lightTargetDirection:r0,lightTargetPosition:yw,lightViewPosition:zd,lightingContext:BT,lights:FT,linearDepth:Sh,linearSRGBTosRGB:Tw,linearToneMapping:bw,localId:PU,log:pg,log2:al,loop:AL,luminance:En,lut3D:MD,mat2:ol,mat3:Tn,mat4:Zr,matcapUV:mb,materialAOMap:TT,materialAlphaTest:jS,materialAnisotropy:dT,materialAnisotropyVector:zo,materialAttenuationColor:vT,materialAttenuationDistance:yT,materialClearcoat:oT,materialClearcoatNormal:cT,materialClearcoatRoughness:aT,materialColor:ha,materialDispersion:ST,materialEmissive:eT,materialIOR:_T,materialIridescence:pT,materialIridescenceIOR:fT,materialIridescenceThickness:mT,materialLightMap:Ug,materialLineDashOffset:bf,materialLineDashSize:Lg,materialLineGapSize:Dg,materialLineScale:Mh,materialLineWidth:Pu,materialMetalness:sT,materialNormal:rT,materialOpacity:Pd,materialPointWidth:MT,materialReference:Ki,materialReflectivity:Iu,materialRefractionRatio:OS,materialRotation:lT,materialRoughness:iT,materialSheen:uT,materialSheenRoughness:hT,materialShininess:QS,materialSpecular:tT,materialSpecularColor:nT,materialSpecularIntensity:Tf,materialSpecularStrength:sc,materialThickness:xT,materialTransmission:gT,max:ft,maxMipLevel:CS,metalness:Bc,min:Mn,mix:it,mixElement:QM,mod:Ad,modInt:lg,modelDirection:iL,modelNormalMatrix:IS,modelPosition:sL,modelScale:rL,modelViewMatrix:xs,modelViewPosition:oL,modelViewProjection:wf,modelWorldMatrix:Ui,modelWorldMatrixInverse:PS,morphReference:DT,motionBlur:SU,mrt:Vd,mul:ot,mx_aastep:Ow,mx_cell_noise_float:sO,mx_contrast:KF,mx_fractal_noise_float:rO,mx_fractal_noise_vec2:oO,mx_fractal_noise_vec3:aO,mx_fractal_noise_vec4:cO,mx_hsvtorgb:GF,mx_noise_float:jF,mx_noise_vec3:QF,mx_noise_vec4:eO,mx_ramplr:XF,mx_ramptb:qF,mx_rgbtohsv:HF,mx_safepower:JF,mx_splitlr:$F,mx_splittb:YF,mx_srgb_texture_to_lin_rec709:WF,mx_transform_uv:ZF,mx_worley_noise_float:tO,mx_worley_noise_vec2:nO,mx_worley_noise_vec3:iO,negate:UM,neutralToneMapping:Cw,nodeArray:Yr,nodeImmutable:fe,nodeObject:H,nodeObjects:rl,nodeProxy:K,normalFlat:US,normalGeometry:Nd,normalLocal:hi,normalMap:Sf,normalView:di,normalWorld:Ed,normalize:vi,not:xM,notEqual:hM,numWorkgroups:RU,objectDirection:jP,objectGroup:rM,objectPosition:eL,objectScale:tL,objectViewPosition:nL,objectWorldMatrix:QP,oneMinus:FM,or:gM,orthographicDepthToViewZ:UL,oscSawtooth:z3,oscSine:O3,oscSquare:V3,oscTriangle:B3,output:sg,outputStruct:P3,overlay:MU,overloadingFn:On,parabola:Pf,parallaxBarrierPass:qD,parallaxDirection:$S,parallaxUV:xL,parameter:n3,pass:oD,passTexture:Na,pcurve:lU,perspectiveDepthToViewZ:Vg,pixelationPass:VD,pmremTexture:ub,pointUV:J3,pointWidth:BP,positionGeometry:Nn,positionLocal:en,positionPrevious:yh,positionView:Pn,positionViewDirection:Bt,positionWorld:vh,positionWorldDirection:Eg,posterize:iD,pow:Kn,pow2:gg,pow3:$M,pow4:YM,property:ai,radians:CM,rand:yg,range:QD,rangeFog:KD,reciprocal:zM,reference:dn,referenceBuffer:Mf,reflect:WM,reflectVector:zS,reflectView:VS,reflector:X3,refract:_g,refractVector:kS,refractView:BS,reinhardToneMapping:ww,remainder:wM,remap:MS,remapClamp:SS,renderGroup:_t,renderOutput:AS,rendererReference:uS,rgbShift:yD,rotate:Wg,rotateUV:dU,roughness:hs,round:BM,rtt:Fb,sRGBToLinearSRGB:Sw,sampler:YP,saturate:KM,saturation:hD,screen:vU,screenCoordinate:Aa,screenSize:da,screenUV:_r,scriptable:ZD,scriptableValue:Uu,select:In,sepia:bU,setCurrentStack:Vc,shaderStages:xf,sharedUniformGroup:tg,sheen:Xr,sheenRoughness:bd,shiftLeft:TM,shiftRight:bM,shininess:ph,sign:cl,sin:Cn,sinc:uU,skinning:bL,skinningReference:IT,smoothstep:ti,smoothstepElement:eS,sobel:gD,specularColor:ri,specularF90:kc,spherizeUV:pU,split:OP,spritesheetUV:k3,sqrt:os,ssaaPass:kD,stack:Du,step:ll,stereoPass:HD,storage:Q3,storageBarrier:FU,storageObject:eD,storageTexture:zb,string:UP,sub:Ft,subgroupIndex:ML,subgroupSize:LU,tan:PM,tangentGeometry:Id,tangentLocal:gl,tangentView:xl,tangentWorld:WS,temp:Sg,texture:xt,texture3D:_b,textureBarrier:OU,textureBicubic:rb,textureCubeUV:ab,textureLoad:Ci,textureSize:tr,textureStore:tD,thickness:rg,threshold:$b,timerDelta:U3,timerGlobal:D3,timerLocal:e0,toOutputColorSpace:rS,toWorkingColorSpace:oS,toneMapping:dS,toneMappingExposure:pS,toonOutlinePass:$D,transformDirection:ZM,transformNormal:FS,transformNormalToView:Rg,transformedBentNormalView:YS,transformedBitangentView:qS,transformedBitangentWorld:gL,transformedClearcoatNormalView:Xo,transformedNormalView:Yt,transformedNormalWorld:Cg,transformedTangentView:Pg,transformedTangentWorld:dL,transition:UD,transmission:fh,transpose:GM,tri:us,tri3:vw,triNoise3D:hU,triplanarTexture:H3,triplanarTextures:Lb,trunc:mg,tslFn:DP,uint:ve,uniform:pe,uniformArray:ds,uniformGroup:sM,uniforms:uL,userData:nD,uv:rt,uvec2:Jv,uvec3:wa,uvec4:eM,varying:Un,varyingProperty:Zi,vec2:z,vec3:D,vec4:oe,vectorComponents:ba,velocity:xU,vertexColor:Z3,vertexIndex:wT,vibrance:dD,viewZToOrthographicDepth:rc,viewZToPerspectiveDepth:XT,viewport:Ls,viewportBottomLeft:LL,viewportCoordinate:GT,viewportDepthTexture:Og,viewportLinearDepth:FL,viewportMipTexture:HT,viewportResolution:IL,viewportSafeUV:mU,viewportSharedTexture:sD,viewportSize:kT,viewportTexture:DL,viewportTopLeft:PL,viewportUV:RL,wgsl:s3,wgslFn:a3,workgroupArray:zU,workgroupBarrier:UU,workgroupId:IU,workingToColorSpace:aS,xor:_M},Symbol.toStringTag,{value:"Module"}));exports.ACESFilmicToneMapping=Eh;exports.AdditiveBlending=cc;exports.AgXToneMapping=Ch;exports.AlwaysDepth=uc;exports.AlwaysStencilFunc=ih;exports.AmbientLight=vd;exports.AnimationClip=la;exports.AnimationMixer=bv;exports.ArrayCamera=rm;exports.Audio=Fm;exports.AudioContext=Md;exports.AudioListener=vv;exports.AudioLoader=yv;exports.AxesHelper=Fv;exports.BackSide=ln;exports.BasicDepthPacking=Zf;exports.BasicNodeLibrary=Jw;exports.BatchedMesh=hm;exports.Bone=Kh;exports.BooleanKeyframeTrack=pr;exports.Box3=Hn;exports.Box3Helper=Uv;exports.BoxGeometry=_s;exports.BoxHelper=Dv;exports.BufferAttribute=At;exports.BufferGeometry=at;exports.Camera=Yc;exports.CameraHelper=Lv;exports.CanvasTexture=ev;exports.CatmullRomCurve3=gm;exports.ClampToEdgeWrapping=Si;exports.Clock=Um;exports.Color=_e;exports.ColorKeyframeTrack=md;exports.ColorManagement=gt;exports.CompressedArrayTexture=jy;exports.CompressedCubeTexture=Qy;exports.CompressedTexture=Kc;exports.Controls=Vv;exports.CubeCamera=Xh;exports.CubeTexture=so;exports.CubeUVReflectionMapping=hr;exports.Curve=Gi;exports.CustomBlending=Uf;exports.CylinderGeometry=co;exports.Data3DTexture=Hh;exports.DataTexture=Oi;exports.DataTextureLoader=pv;exports.DataUtils=By;exports.DecrementStencilOp=_y;exports.DecrementWrapStencilOp=vy;exports.DefaultLoadingManager=Cm;exports.DepthFormat=Qs;exports.DepthStencilFormat=ar;exports.DepthTexture=ao;exports.DirectionalLight=yd;exports.DirectionalLightHelper=Pv;exports.DoubleSide=Ji;exports.DynamicDrawUsage=Gr;exports.EdgesGeometry=Sm;exports.EqualDepth=dc;exports.EqualStencilFunc=by;exports.EquirectangularReflectionMapping=ir;exports.EquirectangularRefractionMapping=sr;exports.Euler=ui;exports.EventDispatcher=Ai;exports.ExtrudeGeometry=Qc;exports.FileLoader=ts;exports.Float32BufferAttribute=Ve;exports.FloatType=Gn;exports.Fog=om;exports.FrontSide=fs;exports.Frustum=ga;exports.GLSL3=sh;exports.GLSLNodeParser=Zw;exports.GreaterDepth=fc;exports.GreaterEqualDepth=pc;exports.GreaterEqualStencilFunc=Ey;exports.GreaterStencilFunc=Ay;exports.GridHelper=Iv;exports.Group=Hr;exports.HalfFloatType=Ln;exports.HemisphereLight=xd;exports.ImageBitmapLoader=_v;exports.IncrementStencilOp=xy;exports.IncrementWrapStencilOp=yy;exports.InstancedBufferAttribute=Us;exports.InstancedBufferGeometry=Lm;exports.InstancedInterleavedBuffer=Bm;exports.InstancedMesh=um;exports.InterleavedBuffer=_a;exports.InterleavedBufferAttribute=Ds;exports.Interpolant=Sa;exports.InterpolateDiscrete=ia;exports.InterpolateLinear=bc;exports.InvertStencilOp=My;exports.KeepStencilOp=$s;exports.KeyframeTrack=Hi;exports.LOD=cm;exports.Layers=$c;exports.LessDepth=hc;exports.LessEqualDepth=nr;exports.LessEqualStencilFunc=wy;exports.LessStencilFunc=Ty;exports.Line=Fs;exports.Line3=Cv;exports.LineBasicMaterial=Fn;exports.LineLoop=dm;exports.LineSegments=rs;exports.LinearFilter=Ut;exports.LinearMipmapLinearFilter=Jn;exports.LinearMipmapNearestFilter=js;exports.LinearSRGBColorSpace=li;exports.LinearToneMapping=Ah;exports.Loader=Xn;exports.LoaderUtils=lh;exports.LoadingManager=gd;exports.LoopOnce=qf;exports.LoopRepeat=$f;exports.MOUSE=G_;exports.Material=mn;exports.MathUtils=Gh;exports.Matrix3=Ke;exports.Matrix4=Fe;exports.MaxEquation=Ff;exports.Mesh=kt;exports.MeshBasicMaterial=ss;exports.MeshDepthMaterial=Yh;exports.MeshLambertMaterial=pd;exports.MeshNormalMaterial=dd;exports.MeshPhongMaterial=hd;exports.MeshPhysicalMaterial=ud;exports.MeshStandardMaterial=nl;exports.MirroredRepeatWrapping=ea;exports.NearestFilter=Qt;exports.NearestMipmapLinearFilter=Cs;exports.NearestMipmapNearestFilter=Ph;exports.NeutralToneMapping=Rh;exports.NeverDepth=lc;exports.NeverStencilFunc=Sy;exports.NoBlending=Fi;exports.NoColorSpace=Li;exports.NoToneMapping=Ti;exports.Node=Ye;exports.NodeBuilder=Ab;exports.NodeFrame=Nb;exports.NormalBlending=Ps;exports.NotEqualDepth=mc;exports.NotEqualStencilFunc=Ny;exports.NumberKeyframeTrack=aa;exports.Object3D=yt;exports.OctahedronGeometry=va;exports.OrthographicCamera=oo;exports.PCFSoftShadowMap$1=Df;exports.PMREMGenerator$1=rh;exports.PerspectiveCamera=hn;exports.Plane=cs;exports.PlaneGeometry=ro;exports.PointLight=_d;exports.Points=pm;exports.PointsMaterial=ya;exports.PositionalAudio=Mv;exports.PropertyBinding=St;exports.Quaternion=Qn;exports.QuaternionKeyframeTrack=Ta;exports.REVISION=Ks;exports.RGBADepthPacking=Jf;exports.RGBAFormat=Rn;exports.RGBA_ASTC_4x4_Format=Mc;exports.RGBA_ASTC_6x6_Format=Sc;exports.RGBA_BPTC_Format=Ko;exports.RGBA_ETC2_EAC_Format=vc;exports.RGBA_PVRTC_4BPPV1_Format=xc;exports.RGBA_S3TC_DXT1_Format=Yo;exports.RGBA_S3TC_DXT3_Format=Zo;exports.RGBA_S3TC_DXT5_Format=Jo;exports.RGBFormat=Oh;exports.RGB_BPTC_UNSIGNED_Format=Tc;exports.RGB_ETC1_Format=_c;exports.RGB_ETC2_Format=yc;exports.RGB_PVRTC_4BPPV1_Format=gc;exports.RGB_S3TC_DXT1_Format=$o;exports.RGFormat=na;exports.RawShaderMaterial=bm;exports.Ray=io;exports.Raycaster=Nv;exports.RedFormat=Hc;exports.ReinhardToneMapping=Nh;exports.RepeatWrapping=rr;exports.ReplaceStencilOp=gy;exports.RingGeometry=el;exports.SRGBColorSpace=kn;exports.Scene=Jh;exports.ShaderChunk=lt;exports.ShaderLib=Pi;exports.ShaderMaterial=ki;exports.ShadowMaterial=ld;exports.Shape=er;exports.ShapePath=Ov;exports.ShapeUtils=ji;exports.Skeleton=Jc;exports.SkinnedMesh=lm;exports.Source=Js;exports.Sphere=Dn;exports.SphereGeometry=Ma;exports.Spherical=Ev;exports.SpotLight=il;exports.Sprite=am;exports.SpriteMaterial=Zc;exports.THREE=gO;exports.TOUCH=H_;exports.Texture=Xt;exports.TextureLoader=fv;exports.TorusGeometry=tl;exports.Triangle=Zn;exports.TriangleFanDrawMode=fy;exports.TriangleStripDrawMode=py;exports.TrianglesDrawMode=dy;exports.Uint16BufferAttribute=Wh;exports.Uniform$1=wv;exports.UniformsLib=Se;exports.UniformsUtils=nm;exports.UnsignedByteType=es;exports.UnsignedInt101111Type=Fh;exports.UnsignedInt248Type=or;exports.UnsignedInt5999Type=Uh;exports.UnsignedIntType=Bi;exports.Vector2=J;exports.Vector3=E;exports.Vector4=st;exports.VectorKeyframeTrack=ca;exports.VideoTexture=Ky;exports.WebGLCubeRenderTarget=qh;exports.WebGLRenderTarget=zi;exports.WebGLRenderer=Yy;exports.WireframeGeometry=Tm;exports.ZeroStencilOp=my;exports.defaultShaderStages=qm;exports.normalView=di;