@volter/game-editor 0.5.65 → 0.5.66

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 (544) hide show
  1. package/BUNDLED_NOTICES +1962 -363
  2. package/catalog/entries/bake.json +0 -1
  3. package/catalog/entries/blender.json +2 -2
  4. package/catalog/entries/reflections.json +2 -4
  5. package/catalog/project-source/src/lib/bake/asset-seed.ts +1 -2
  6. package/catalog/project-source/src/lib/bake/clip-layering.ts +3 -4
  7. package/catalog/project-source/src/lib/bake/gltf-bake.ts +1 -1
  8. package/catalog/project-source/src/lib/bake/params.ts +3 -5
  9. package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +2 -3
  10. package/dist/.vite/manifest.json +2406 -2182
  11. package/dist/assets/{AssetBudgetPanel-J9--TZPU.js → AssetBudgetPanel-csYWK2H4.js} +8 -8
  12. package/dist/assets/{AudioViewer-CR7333fe.js → AudioViewer-BH_LUYs5.js} +1 -1
  13. package/dist/assets/{BVHLoader-6bQIXhMX.js → BVHLoader-Jkzh8hMf.js} +1 -1
  14. package/dist/assets/BufferGeometryUtils-CAbuTPOA.js +1 -0
  15. package/dist/assets/{CCDIKSolver-CD7vLpsK.js → CCDIKSolver-D4NvkJ8d.js} +1 -1
  16. package/dist/assets/{CSS3DRenderer-CL7ABLVK.js → CSS3DRenderer-CAS2WZZy.js} +1 -1
  17. package/dist/assets/CanvasSceneViewport-BlsRTk-X.js +1 -0
  18. package/dist/assets/ColladaLoader-DxYB89DA.js +3 -0
  19. package/dist/assets/{ColorInput-DQBNrW-K.js → ColorInput-CPQNsDf1.js} +1 -1
  20. package/dist/assets/{ConvexGeometry-CAzXlPVG.js → ConvexGeometry-Dinf-sev.js} +1 -1
  21. package/dist/assets/{ConvexHull-BINCESFp.js → ConvexHull-CrJ8FY-w.js} +1 -1
  22. package/dist/assets/{DecalGeometry-160KRdfg.js → DecalGeometry-owkbefLa.js} +1 -1
  23. package/dist/assets/EffectComposer-BHDH-NLz.js +1 -0
  24. package/dist/assets/EntityModelDocument-DuQivdvc.js +1 -0
  25. package/dist/assets/EnvironmentAssetDocument-CnTEMn3A.js +1 -0
  26. package/dist/assets/FBXLoader-BMUbIhtE.js +1 -0
  27. package/dist/assets/Fbo-DrK7CWlB.js +1 -0
  28. package/dist/assets/{FontLoader-CvGoVI5a.js → FontLoader-BR_K6Baw.js} +2 -2
  29. package/dist/assets/GLTFExporter-BZqAQJbw.js +1 -0
  30. package/dist/assets/{GameplaySessionTimeline-B52W3FVZ.js → GameplaySessionTimeline-Crqwv2fP.js} +1 -1
  31. package/dist/assets/Gltf-7cVbZUzT.js +2 -0
  32. package/dist/assets/ImageViewer-BkFie7Hm.js +1 -0
  33. package/dist/assets/InspectorObjectPreview-Dl3tyJBn.js +1 -0
  34. package/dist/assets/JsonAssetDocument-BUFzubHM.js +2 -0
  35. package/dist/assets/{LineSegments2-CsOpKSiM.js → LineSegments2-Cicm_Hu1.js} +2 -2
  36. package/dist/assets/LiveModuleDocument-C3OQxiba.js +1 -0
  37. package/dist/assets/LutAssetDocument-DVzd1RZ9.js +1 -0
  38. package/dist/assets/{MTLLoader-_Xzd4_0p.js → MTLLoader-Bg_grNiT.js} +2 -2
  39. package/dist/assets/{MarchingCubes-Bsp4wrzd.js → MarchingCubes-a78AL3HB.js} +1 -1
  40. package/dist/assets/MeshBVH-BCSLNEeP.js +1 -0
  41. package/dist/assets/ModelAssetDocument-pN84goRT.js +1 -0
  42. package/dist/assets/{NonThreeAuthoringBootstrap-C3woOMxX.js → NonThreeAuthoringBootstrap-BKNejRiW.js} +1 -1
  43. package/dist/assets/{OBJLoader-BhIC6Hwo.js → OBJLoader-BiwzVj5b.js} +2 -2
  44. package/dist/assets/Object3DDocumentToolbar-D5Bg5FEf.js +1 -0
  45. package/dist/assets/Object3DDocumentViewport-DFHqru3a.js +2 -0
  46. package/dist/assets/Object3DPreview-BTtZ-41z.js +2 -0
  47. package/dist/assets/OnlineAssetDetail-BAqozdAp.js +1 -0
  48. package/dist/assets/{OrbitControls-DLpayAaK.js → OrbitControls-CzKVCORl.js} +1 -1
  49. package/dist/assets/{OrbitControls-CM3bPray.js → OrbitControls-CzTRRI7x.js} +1 -1
  50. package/dist/assets/{OrthographicCamera-bQozawrh.js → OrthographicCamera-CSDDsvu7.js} +1 -1
  51. package/dist/assets/{PLYLoader-DYQqs5Ik.js → PLYLoader-QxrxxMpE.js} +2 -2
  52. package/dist/assets/{PerspectiveCamera-CQ2lh01o.js → PerspectiveCamera-DzD_NfVh.js} +1 -1
  53. package/dist/assets/PlayBar-qVJpgwJt.js +2 -0
  54. package/dist/assets/QuarksAssetDocument-B4vBlUsS.js +2 -0
  55. package/dist/assets/RGBELoader-WQ7xZofE.js +1 -0
  56. package/dist/assets/RectAreaLightUniformsLib-CwcuoVqt.js +1 -0
  57. package/dist/assets/{RenderPass-DPrn-Uky.js → RenderPass-C_CeQNdh.js} +1 -1
  58. package/dist/assets/{ResolutionPicker-C67vs1F3.js → ResolutionPicker-DpHVJxn5.js} +1 -1
  59. package/dist/assets/RootSelectionOverlay-BxvsunO4.js +1 -0
  60. package/dist/assets/{RoundedBox-BDGBg6QZ.js → RoundedBox-B_cZ0NFy.js} +1 -1
  61. package/dist/assets/{RoundedBoxGeometry-CyUuYPfW.js → RoundedBoxGeometry-Y4rcSIvX.js} +1 -1
  62. package/dist/assets/STLLoader-Bej_Nkpr.js +1 -0
  63. package/dist/assets/{SelectionBox-D_75KrNW.js → SelectionBox-Cn9vm7f9.js} +1 -1
  64. package/dist/assets/ShaderAssetDocument-Dx2x8CLr.js +12 -0
  65. package/dist/assets/{ShaderPass-QYRpPuFJ.js → ShaderPass-qtkA7CQ8.js} +1 -1
  66. package/dist/assets/{ShadowEditor-DkImwu1Y.js → ShadowEditor-BEIUkrHL.js} +1 -1
  67. package/dist/assets/SimplifyModifier-D2EesGr2.js +1 -0
  68. package/dist/assets/{SkeletonUtils-Cps8GOC6.js → SkeletonUtils-C8ayciDc.js} +1 -1
  69. package/dist/assets/{Sky-CQKCgYDs.js → Sky-BBpnAJZV.js} +1 -1
  70. package/dist/assets/SourceAssetViewer-BpMbbuy6.js +1 -0
  71. package/dist/assets/StageHost-lB8f---y.js +2 -0
  72. package/dist/assets/{StoryPreviewMount-DjyxRCXu.js → StoryPreviewMount-BIfxmkYh.js} +1 -1
  73. package/dist/assets/{TDSLoader-D_T8XJ81.js → TDSLoader-rHl5Uwc0.js} +1 -1
  74. package/dist/assets/{TextGeometry-DOWAEUV0.js → TextGeometry-BRHSufuM.js} +1 -1
  75. package/dist/assets/ThreeBoardDocument-BHV92Ia3.js +2 -0
  76. package/dist/assets/{ThreeIsolationSceneContent-C8C8whSF.js → ThreeIsolationSceneContent-BqtgDHBK.js} +1 -1
  77. package/dist/assets/{ToolObject3DPreview-BRoDWe4Q.js → ToolObject3DPreview-CcaPJTyH.js} +1 -1
  78. package/dist/assets/Toolbar-keHcSvDD.js +1 -0
  79. package/dist/assets/{TrackballControls-DfznuQTh.js → TrackballControls-Cce-6Ff5.js} +1 -1
  80. package/dist/assets/{TransientHint-BB1fwrvK.js → TransientHint-Dlslh3oX.js} +1 -1
  81. package/dist/assets/{UnrealBloomPass-CR-cS_K5.js → UnrealBloomPass-DiseEiFK.js} +2 -2
  82. package/dist/assets/{VideoViewer-C6kocgIU.js → VideoViewer-naGSXHd6.js} +1 -1
  83. package/dist/assets/ViewportShadingMenu-C7Hdhtca.js +1 -0
  84. package/dist/assets/{active-ingest-CT6jSGhr.js → active-ingest-DEgq9JiA.js} +3 -3
  85. package/dist/assets/{animation-clock-CnjZqfJp.js → animation-clock-lTIb6nk3.js} +1 -1
  86. package/dist/assets/animation-mixers.service-2O2rVwQf.js +1 -0
  87. package/dist/assets/asset-budget-asset.menu-9NhdHAC9.js +1 -0
  88. package/dist/assets/asset-budget.action-yg6-luUJ.js +1 -0
  89. package/dist/assets/asset-budget.document-B46_VFqa.js +1 -0
  90. package/dist/assets/asset-budget.menu-DuH07N-e.js +1 -0
  91. package/dist/assets/{asset-editor-persistence-BBaONOJt.js → asset-editor-persistence-BVtzjadu.js} +1 -1
  92. package/dist/assets/{asset-loaders-BOy5Ss8k.js → asset-loaders-BxG1LykH.js} +2 -2
  93. package/dist/assets/{assets-BuSoGjBX.js → assets-Do88ZdV_.js} +1 -1
  94. package/dist/assets/{audio-unlock.service-CfUgUQVy.js → audio-unlock.service-BJH0mWvX.js} +1 -1
  95. package/dist/assets/{audio.utility-C6K6jem8.js → audio.utility-Cp4aVYFU.js} +1 -1
  96. package/dist/assets/autoplay.service-FxpRy7Ev.js +1 -0
  97. package/dist/assets/{babylon-authoring-adapter-CL02gWDn.js → babylon-authoring-adapter-B_8iE8fK.js} +1 -1
  98. package/dist/assets/{binding-resolver-Dsh-6Vor.js → binding-resolver-BWwG10zJ.js} +2 -2
  99. package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
  100. package/dist/assets/{blender-node-editor.document-iIDkB9sI.js → blender-node-editor.document-DTgwy8KC.js} +1 -1
  101. package/dist/assets/blender-properties-tab-DWSJpkxq.js +3 -0
  102. package/dist/assets/blender-runtime-host-OGjPjTrG.js +4 -0
  103. package/dist/assets/{blender-runtime-skin-DyQ9B6CR.js → blender-runtime-skin-DymtXlpt.js} +37 -39
  104. package/dist/assets/blender-runtime.document-CzH2ohHR.js +8 -0
  105. package/dist/assets/{blender-timeline.document-77fx96N7.js → blender-timeline.document-BRy_QPHt.js} +1 -1
  106. package/dist/assets/{blender-uv-editor.document-fsT7B4gV.js → blender-uv-editor.document-D-AbUCqz.js} +1 -1
  107. package/dist/assets/{blender-version.status-o6dBm3n6.js → blender-version.status-B7flzX_7.js} +1 -1
  108. package/dist/assets/{blender-wali-engine-wTOcrOMC.js → blender-wali-engine-D3iKpzn9.js} +1 -1
  109. package/dist/assets/blender.command-BVHtgTQy.js +1 -0
  110. package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
  111. package/dist/assets/{blender.style-Dcem5f_T.js → blender.style-CxfbTFcE.js} +1 -1
  112. package/dist/assets/{board-guides-DziKSTss.js → board-guides-C3usUZZk.js} +1 -1
  113. package/dist/assets/body-marks-D8iaje6y.js +1 -0
  114. package/dist/assets/bridge.command-BF9u6r0A.js +3 -0
  115. package/dist/assets/browserAll-38aBu-cf.js +1 -0
  116. package/dist/assets/{build-profiles.document-kW8iw8Xj.js → build-profiles.document-DO7oNRuo.js} +2 -2
  117. package/dist/assets/{build-progress.status-BNRLytg2.js → build-progress.status-COeNVhYd.js} +1 -1
  118. package/dist/assets/{build-session-C_sg3CEn.js → build-session-IWIriS5P.js} +1 -1
  119. package/dist/assets/{build.action-lYjTLb7K.js → build.action-DlkFvZf6.js} +1 -1
  120. package/dist/assets/{build.command-DIGgUPU_.js → build.command-DPqQIYj_.js} +1 -1
  121. package/dist/assets/{build.header-CKajx5U3.js → build.header-CNLG-pV8.js} +1 -1
  122. package/dist/assets/{build.menu-BdU0QXny.js → build.menu-hUlH6loi.js} +1 -1
  123. package/dist/assets/{build.service-CbBAyeu3.js → build.service-C86Td3_9.js} +1 -1
  124. package/dist/assets/{camera-KEsKvOL7.js → camera-CKbyBXMe.js} +1 -1
  125. package/dist/assets/camera-authoring-Ci3KnE-W.js +1 -0
  126. package/dist/assets/{camera-runtime.inspector-B7unX4g1.js → camera-runtime.inspector-DdR3P2BF.js} +1 -1
  127. package/dist/assets/canvas-entry-runtime-E5YjSgre.js +2 -0
  128. package/dist/assets/canvas-preview-frames-CiAx7dpV.js +1 -0
  129. package/dist/assets/{capability-coverage-Czas4C18.js → capability-coverage-CfUeULDN.js} +5 -5
  130. package/dist/assets/city-EkhAOo5s.exr +0 -0
  131. package/dist/assets/{collaboration-presence-DLoZ7EA3.js → collaboration-presence-CSLFNT7m.js} +1 -1
  132. package/dist/assets/{collider-Bw0mXlsW.js → collider-DRSaLRM9.js} +1 -1
  133. package/dist/assets/{component-board.service-DCwcUssB.js → component-board.service-B7Sv8b7m.js} +2 -2
  134. package/dist/assets/component-board.service-B8UHw8dn.js +2 -0
  135. package/dist/assets/component-contracts.service-LFGekycZ.js +1 -0
  136. package/dist/assets/{component-verbs.command-7xzfjGMZ.js → component-verbs.command-D4SvFjfG.js} +1 -1
  137. package/dist/assets/component-verbs.service-TGvWxf2b.js +1 -0
  138. package/dist/assets/{config-CEZk921y.js → config-DB_RH-hO.js} +3 -3
  139. package/dist/assets/{configurations-DTBMdaTL.js → configurations-C2qgJNnW.js} +1 -1
  140. package/dist/assets/{connection.status-BifnQdOs.js → connection.status-CG7X2brL.js} +1 -1
  141. package/dist/assets/{console-bridge-CHcb-xk5.js → console-bridge-B5Ltae37.js} +1 -1
  142. package/dist/assets/{constraint-De8f1Uiq.js → constraint-C_Jj7dXy.js} +1 -1
  143. package/dist/assets/constraints.inspector-D6QZJS4b.js +1 -0
  144. package/dist/assets/courtyard-DqlebbpC.exr +0 -0
  145. package/dist/assets/coverage.service-Clo86874.js +3 -0
  146. package/dist/assets/{create-runtime-CVCc1BDx.js → create-runtime-lmA910XT.js} +1 -1
  147. package/dist/assets/{curve-7Q79VgU4.js → curve-6-TR6dNb.js} +1 -1
  148. package/dist/assets/{data-asset-4hjS642k.js → data-asset-BNbd309U.js} +1 -1
  149. package/dist/assets/{data-ref-CQI28C0D.js → data-ref-Dvmd7eb1.js} +1 -1
  150. package/dist/assets/{debug-bridge-CCohG-d-.js → debug-bridge-BUNhgyY6.js} +1 -1
  151. package/dist/assets/{debug-registry-Dgvitx8M.js → debug-registry-B3Cnne3x.js} +1 -1
  152. package/dist/assets/deferred-ingest-play-7V8OrW3e.js +2 -0
  153. package/dist/assets/design-time-layers-g9VS6amb.js +1 -0
  154. package/dist/assets/design-time-mount.service-HtMr_vBd.js +2 -0
  155. package/dist/assets/design-time-react-mount-Dx6fJ-Hg.js +1 -0
  156. package/dist/assets/{directional-shadow-fit-BVkOKAv2.js → directional-shadow-fit-Cjz_Eg2b.js} +1 -1
  157. package/dist/assets/{document-preview-three-Kbg2GCLm.js → document-preview-three-C3y0syYQ.js} +1 -1
  158. package/dist/assets/{dom-authoring-adapter-CY8C7f4T.js → dom-authoring-adapter-CEeFyatF.js} +1 -1
  159. package/dist/assets/{draco3d-BBUTcNkz.js → draco3d-FKy0apkb.js} +1 -1
  160. package/dist/assets/drei-asset-caches-jJoHXbTj.js +2 -0
  161. package/dist/assets/{edit-mode-audio.service-Bzetwd5B.js → edit-mode-audio.service-DZTnrW6t.js} +1 -1
  162. package/dist/assets/edit-mode-authoring-D_BiHCQj.js +1 -0
  163. package/dist/assets/{edit-mode-networking.service-YCX6RRb_.js → edit-mode-networking.service-BzMI2VxO.js} +1 -1
  164. package/dist/assets/editor-api-Bzmo0o8_.js +1 -0
  165. package/dist/assets/{entry-adjudication-Cq8Yeb74.js → entry-adjudication-BYy7TXOB.js} +1 -1
  166. package/dist/assets/{events-156d8d12.esm-ErOhDXXB.js → events-156d8d12.esm-C734MYnx.js} +7 -7
  167. package/dist/assets/{extend-B-eOccUm.js → extend-CLG0ymiX.js} +1 -1
  168. package/dist/assets/forest-P_CQY3b_.exr +0 -0
  169. package/dist/assets/fork-menu-De7HU6_H.js +1 -0
  170. package/dist/assets/{frame-debugger-store-D1Mf_5up.js → frame-debugger-store-BZgIOlU6.js} +1 -1
  171. package/dist/assets/{game-DHOZVb-7.js → game-D5EJoILQ.js} +1 -1
  172. package/dist/assets/{game-contract-seams-a5YXejOu.js → game-contract-seams-TCpIMmHP.js} +1 -1
  173. package/dist/assets/{game-css-scope-transform-Eng4wS8E.js → game-css-scope-transform-NbpajQr-.js} +1 -1
  174. package/dist/assets/game-document.service-6eRlrI-d.js +1 -0
  175. package/dist/assets/game-eval.command-hKnSMlX0.js +2 -0
  176. package/dist/assets/{game-input-seams-CIQdetRw.js → game-input-seams-BC6xhZy3.js} +1 -1
  177. package/dist/assets/{game-module-access-B2mFxv-i.js → game-module-access-ry3xb1Ix.js} +1 -1
  178. package/dist/assets/{gameplay-export-BoKXm51x.js → gameplay-export-DiLQuPpn.js} +1 -1
  179. package/dist/assets/gameplay-replay-Bsre-1K8.js +1 -0
  180. package/dist/assets/{gameplay-rng-trap-CTNhm-UW.js → gameplay-rng-trap-BhRx_CtU.js} +1 -1
  181. package/dist/assets/gameplay.command-BqiyGn-I.js +1 -0
  182. package/dist/assets/{generation-jobs-BQrXbGp_.js → generation-jobs-BYcpgeGk.js} +1 -1
  183. package/dist/assets/generation.service-O81IqA-6.js +1 -0
  184. package/dist/assets/{generations-DzUogZsM.js → generations-CsGQ3twi.js} +1 -1
  185. package/dist/assets/{generations.status-CgOUBCum.js → generations.status-C3YU0_ml.js} +1 -1
  186. package/dist/assets/godot.style-DxJaFWOP.js +1 -0
  187. package/dist/assets/godot.view-BFsHk8b2.js +1 -0
  188. package/dist/assets/{hosted-asset-materialization-CiIvWkGU.js → hosted-asset-materialization-Bk-plQF6.js} +2 -2
  189. package/dist/assets/{ibl-override-material-BlmCxFKq.js → ibl-override-material-BhbGwgS1.js} +1 -1
  190. package/dist/assets/{index-mjWQmGhM.js → index-0n9eSzwT.js} +1 -1
  191. package/dist/assets/index-B4bmKkgY.css +1 -0
  192. package/dist/assets/index-BLo2LE8C.js +3404 -0
  193. package/dist/assets/index-BWW4-DBH.js +1 -0
  194. package/dist/assets/index-CLcsjKUs.js +1 -0
  195. package/dist/assets/index-CU5YUq-x.js +134 -0
  196. package/dist/assets/{index-DUpHH6JR.js → index-Cb6o_Td_.js} +1 -1
  197. package/dist/assets/index-Ckxb31Yz.js +1500 -0
  198. package/dist/assets/index-CnpsJMao.js +1 -0
  199. package/dist/assets/index-Cr23XhNm.js +1 -0
  200. package/dist/assets/index-DO1rWQ_r.js +487 -0
  201. package/dist/assets/{index-BcCBqgM_.js → index-DUh02lTr.js} +1 -1
  202. package/dist/assets/index-DXEHfb0b.js +1 -0
  203. package/dist/assets/{index-V1R-e5Bd.js → index-wRCvCebM.js} +1 -1
  204. package/dist/assets/{inference-diagnostics-Dhmtfbq_.js → inference-diagnostics-YW0yJkKx.js} +1 -1
  205. package/dist/assets/{ingest-BbYMC2vQ.js → ingest-BlQnR7s3.js} +1 -1
  206. package/dist/assets/ingest-boot-viewport-uG9jQ1zm.js +1 -0
  207. package/dist/assets/ingest-siblings-DRQXSWax.js +1 -0
  208. package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js} +1 -1
  209. package/dist/assets/{ingest.service-BTDnQfM1.js → ingest.service-GeaWMaZX.js} +1 -1
  210. package/dist/assets/{input-manager-DH_hGW6d.js → input-manager-Cxx3RJgG.js} +1 -1
  211. package/dist/assets/{input-router-BNQvtIqw.js → input-router-FzxO5ld6.js} +1 -1
  212. package/dist/assets/{inspect-BZfi3mmo.js → inspect-BRgDdtVk.js} +1 -1
  213. package/dist/assets/instances.command-CFOMPSj3.js +1 -0
  214. package/dist/assets/{instruments-CKR02Y8I.js → instruments-IKn-vvNb.js} +1 -1
  215. package/dist/assets/interior-Bo_lba15.exr +0 -0
  216. package/dist/assets/{json-history-resource-BbxllWfV.js → json-history-resource-r-9q_hxP.js} +1 -1
  217. package/dist/assets/{light-D-_wsKTq.js → light-CFAor97k.js} +1 -1
  218. package/dist/assets/light-camera-factory-D1sgz3YB.js +1 -0
  219. package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
  220. package/dist/assets/{loader-CaF_I7Yt.js → loader-BbMsvIxP.js} +1 -1
  221. package/dist/assets/machine.document-CgmsOh-s.js +24 -0
  222. package/dist/assets/machines.finder-nxiCgQc2.js +1 -0
  223. package/dist/assets/matcap-texture-Dh65bX5V.js +1 -0
  224. package/dist/assets/{material-CpAdjDxn.js → material-D5kXEZWQ.js} +1 -1
  225. package/dist/assets/{material-factory-Bz6h__6g.js → material-factory-0Qb0VuZ5.js} +1 -1
  226. package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
  227. package/dist/assets/{mesh-B3WPtNKO.js → mesh-BKPgNTwh.js} +1 -1
  228. package/dist/assets/{mesh-shadow-CZnXrw_l.js → mesh-shadow-BDQP4mHs.js} +1 -1
  229. package/dist/assets/model-asset-sections.service-DWPLmkqa.js +1 -0
  230. package/dist/assets/model-inspection-Cxfg_Fei.js +1 -0
  231. package/dist/assets/model.layout-BpZE1W9V.js +1 -0
  232. package/dist/assets/{models.finder-G2jQgIRu.js → models.finder-DHW17ZEa.js} +1 -1
  233. package/dist/assets/module-mode-CRfHyIMS.js +2 -0
  234. package/dist/assets/mount-canvas-ingest-root-BZZ8M3Lu.js +2 -0
  235. package/dist/assets/mount-dom-ingest-root-D1GV6Jjt.js +2 -0
  236. package/dist/assets/{mount-game-6t9cKNo4.js → mount-game-F9e76auh.js} +1 -1
  237. package/dist/assets/mount-ingest-root-B5D-Lmmk.js +2 -0
  238. package/dist/assets/{mount-manifest-CGVxhmAw.js → mount-manifest-cYRhgHfo.js} +1 -1
  239. package/dist/assets/mount-three-ingest-root-BNnouaBn.js +1 -0
  240. package/dist/assets/{mounted-authoring-Dmg5xmhP.js → mounted-authoring-TIN5EnCb.js} +1 -1
  241. package/dist/assets/{mounted-story-viewport-source-DjP6RA9U.js → mounted-story-viewport-source-CAlEmE0_.js} +1 -1
  242. package/dist/assets/{native-debug-module-CWicoSGD.js → native-debug-module-j-MekcLS.js} +1 -1
  243. package/dist/assets/{navigation-CIiCx-SM.js → navigation-DmR1BDVo.js} +1 -1
  244. package/dist/assets/{navmesh.menu-CAKiH8PW.js → navmesh.menu-FhL1pGx1.js} +1 -1
  245. package/dist/assets/{navmesh.service-jgDWlgj1.js → navmesh.service-usyDeJlm.js} +1 -1
  246. package/dist/assets/{network.utility-CEu5nHf7.js → network.utility-BPh4hTmh.js} +1 -1
  247. package/dist/assets/night-CvV4Gybt.exr +0 -0
  248. package/dist/assets/{object3d-authoring-subject-CH5sI2oP.js → object3d-authoring-subject-CyE4rQ2A.js} +1 -1
  249. package/dist/assets/oid-transform-BOqL6YH6.js +2 -0
  250. package/dist/assets/{particles-Y626p22p.js → particles-C47L-dda.js} +1 -1
  251. package/dist/assets/particles-factory-CRqPLdS7.js +1 -0
  252. package/dist/assets/pixi-authoring-adapter-C5Ikqj5-.js +1 -0
  253. package/dist/assets/{pixi-live-write-target-DuWydlWb.js → pixi-live-write-target-OWBk79dp.js} +1 -1
  254. package/dist/assets/pixi-primitive-D5igywJ_.js +1 -0
  255. package/dist/assets/pixi-react-root-factory-9lZ0Yz-n.js +1 -0
  256. package/dist/assets/play-mode-DomOvQie.js +22 -0
  257. package/dist/assets/play.command-DoqjH-Pp.js +2 -0
  258. package/dist/assets/{playtest-BXIL1JEF.js → playtest-BnFenMBW.js} +1 -1
  259. package/dist/assets/{pose-guard-6Osb2cFu.js → pose-guard-Bb3gZOzk.js} +1 -1
  260. package/dist/assets/{product-DFhyARJj.js → product-CTDJoVo5.js} +1 -1
  261. package/dist/assets/{profiler.action-CaXJDp3t.js → profiler.action-C_OFGkDw.js} +1 -1
  262. package/dist/assets/{profiler.menu-BIMF6Bi4.js → profiler.menu-BJbnVoo4.js} +1 -1
  263. package/dist/assets/{profiler.utility-BExw9wBO.js → profiler.utility-qpfhuwRw.js} +1 -1
  264. package/dist/assets/project-authoring-session-BV-MM8Fl.js +2 -0
  265. package/dist/assets/{project-provenance-BoP3nrle.js → project-provenance-4ldz-EOG.js} +1 -1
  266. package/dist/assets/{properties-bone-constraints.inspector-ByT6p7S-.js → properties-bone-constraints.inspector-C-ByIdg1.js} +1 -1
  267. package/dist/assets/{properties-bone.inspector-z4qJwKO5.js → properties-bone.inspector-CXY0xCQB.js} +1 -1
  268. package/dist/assets/{properties-collection.inspector-D0_3ijWU.js → properties-collection.inspector-DIfkZAel.js} +1 -1
  269. package/dist/assets/{properties-constraints.inspector-CESzjuls.js → properties-constraints.inspector-BaunL5nT.js} +1 -1
  270. package/dist/assets/{properties-data.inspector-hG8Wgyzb.js → properties-data.inspector-DQD-jfO2.js} +1 -1
  271. package/dist/assets/{properties-material.inspector-CzY0JCQ6.js → properties-material.inspector-A0HZ4SX6.js} +1 -1
  272. package/dist/assets/{properties-modifiers.inspector-3dDhwf7g.js → properties-modifiers.inspector-GUnVhVwZ.js} +1 -1
  273. package/dist/assets/{properties-object.inspector-CiarfxkT.js → properties-object.inspector-Chsfa4Xa.js} +1 -1
  274. package/dist/assets/{properties-output.inspector-DKJxmKSD.js → properties-output.inspector-U7ZmD0Me.js} +1 -1
  275. package/dist/assets/{properties-particles.inspector-CCEdYWGm.js → properties-particles.inspector-umkW-OlI.js} +1 -1
  276. package/dist/assets/{properties-physics.inspector-B2c0KUyA.js → properties-physics.inspector-CLVBlWwL.js} +1 -1
  277. package/dist/assets/{properties-render.inspector-Bcm0HLRW.js → properties-render.inspector-D0u9taKy.js} +1 -1
  278. package/dist/assets/{properties-scene.inspector-PIM_eTb_.js → properties-scene.inspector-JwGCZQAx.js} +1 -1
  279. package/dist/assets/{properties-texture.inspector-CgFlnyr8.js → properties-texture.inspector-B1vC28pw.js} +1 -1
  280. package/dist/assets/{properties-view-layer.inspector-DGjF_Aqo.js → properties-view-layer.inspector-BuUKyBFp.js} +1 -1
  281. package/dist/assets/{properties-world.inspector-CrMvaRvB.js → properties-world.inspector-VXUj4dT4.js} +1 -1
  282. package/dist/assets/r3f-design-session-qJ2v5SrB.js +2 -0
  283. package/dist/assets/r3f-physics-binding-C8OqNRG2.js +1 -0
  284. package/dist/assets/{r3f-root-factory-z9llD1OU.js → r3f-root-factory-DjGnbU4n.js} +1 -1
  285. package/dist/assets/r3f-source-authoring-adapter-CG9heazM.js +12 -0
  286. package/dist/assets/{rapier-physics-bridge-CMoeVo3Y.js → rapier-physics-bridge-B-EK7KYV.js} +1 -1
  287. package/dist/assets/react-inspector.service-DWeXDHJq.js +1 -0
  288. package/dist/assets/{react-root-CEz5NTck.js → react-root-DGLRLr-F.js} +1 -1
  289. package/dist/assets/react-story-board-CSqHY0Cg.js +1 -0
  290. package/dist/assets/{react-three-fiber.esm-CycrbDlA.js → react-three-fiber.esm-BxIoqVh1.js} +1 -1
  291. package/dist/assets/{react-three-rapier.esm-CEfKpvxT.js → react-three-rapier.esm-BYzLhdSV.js} +1 -1
  292. package/dist/assets/react-world-authoring-adapter-BMT9kLWU.js +1 -0
  293. package/dist/assets/{realm-services-CobQsq_X.js → realm-services-D25JHoqD.js} +1 -1
  294. package/dist/assets/{reflection-probe-Don-M3Fj.js → reflection-probe-CqXWlicu.js} +1 -1
  295. package/dist/assets/{reflection-probe-capture.inspector-CmFUoJCx.js → reflection-probe-capture.inspector-B7Qa30vB.js} +1 -1
  296. package/dist/assets/regions-DWeEBnE2.js +1 -0
  297. package/dist/assets/{register-render-vitals-BiZk29b2.js → register-render-vitals-BO7x64kR.js} +1 -1
  298. package/dist/assets/{registry-02YZjMNp.js → registry-DlTluc4x.js} +1 -1
  299. package/dist/assets/{render-audio-control-vMRlePWb.js → render-audio-control-DCa_bOBI.js} +1 -1
  300. package/dist/assets/{render-batch-system-0vq7p0VC.js → render-batch-system-CzCp9YKM.js} +1 -1
  301. package/dist/assets/{render-control-Df3yTiyr.js → render-control-BNQr1eNO.js} +1 -1
  302. package/dist/assets/{render-env-D2IV2x5k.js → render-env-emvlfeTG.js} +1 -1
  303. package/dist/assets/{render-features-CPQ_e568.js → render-features-COF7MSQ9.js} +1 -1
  304. package/dist/assets/{render-settings-Bw4W9SYF.js → render-settings-C_kIMq8Y.js} +1 -1
  305. package/dist/assets/{resolve-three-SZE_WWUM.js → resolve-three-C-nx-QdA.js} +13 -13
  306. package/dist/assets/{root-seam-contract-Z0VWX3Bk.js → root-seam-contract-C7GOxf5x.js} +1 -1
  307. package/dist/assets/{run-ticks-settled-C4ksViyA.js → run-ticks-settled-B0cTtmhQ.js} +1 -1
  308. package/dist/assets/{scene-capture-CGYF-Viw.js → scene-capture-CLOc7GXc.js} +1 -1
  309. package/dist/assets/{scene-capture-BQKzU0NT.js → scene-capture-D10Nxkvp.js} +1 -1
  310. package/dist/assets/scene-document.service-B7kAVTko.js +2 -0
  311. package/dist/assets/{scene-framing-Cat0GtyJ.js → scene-framing-50N7SKuX.js} +1 -1
  312. package/dist/assets/{scene-index-B6BZOHMk.js → scene-index-Bce459yu.js} +1 -1
  313. package/dist/assets/{scene-query-C7_N-TpI.js → scene-query-IUZhw6pA.js} +1 -1
  314. package/dist/assets/{schema-kl9-2B_J.js → schema-Iy-mbzll.js} +1 -1
  315. package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
  316. package/dist/assets/{seeded-random-i3mtgBKZ.js → seeded-random-CN0scLZj.js} +1 -1
  317. package/dist/assets/{session-CZ5JPg-z.js → session-CsR0lApe.js} +24 -15
  318. package/dist/assets/{setup-audio-S8GQF91f.js → setup-audio-BJ18gvXZ.js} +1 -1
  319. package/dist/assets/setup-particles-B6H-GbAA.js +1 -0
  320. package/dist/assets/{setup-physics-BeZ7-LKD.js → setup-physics-GugbTT0J.js} +1 -1
  321. package/dist/assets/{setup-renderer-DVXaSGin.js → setup-renderer-wt_a-p8r.js} +20 -20
  322. package/dist/assets/shading.layout-CZZHKBer.js +1 -0
  323. package/dist/assets/{sim-clock-CLflx7kg.js → sim-clock-DEfbb_-P.js} +1 -1
  324. package/dist/assets/{soft-particle-depth-DGvfQDi1.js → soft-particle-depth-CKUS1j0Y.js} +1 -1
  325. package/dist/assets/source-object3d-authoring-adapter-CfHQLFAL.js +1 -0
  326. package/dist/assets/{source-persistence-backend-C-aR-B_Y.js → source-persistence-backend-_-JMEXxE.js} +1 -1
  327. package/dist/assets/{spark-renderer-lifecycle-ynWESJcv.js → spark-renderer-lifecycle-9mnMW3Z4.js} +1 -1
  328. package/dist/assets/{spark.module-4pXQoz5d.js → spark.module-CXth-y_a.js} +1 -1
  329. package/dist/assets/stage-keyboard-C0FdDLOQ.js +1 -0
  330. package/dist/assets/stage-overlay-set-CwhCzbOy.js +1 -0
  331. package/dist/assets/stage-presence-markers-DVMDKiB-.js +1 -0
  332. package/dist/assets/stage-transform-tools-B09Z7v0o.js +1 -0
  333. package/dist/assets/standard-viewport-dressing-GUUr6GuK.js +20 -0
  334. package/dist/assets/{state-watch.action-BOvQR2qt.js → state-watch.action-CgF8qoFC.js} +1 -1
  335. package/dist/assets/{state-watch.menu-CNLvDeeY.js → state-watch.menu-CIMncESW.js} +1 -1
  336. package/dist/assets/{state-watch.utility-Bg1tTTQU.js → state-watch.utility-zTHkUALC.js} +1 -1
  337. package/dist/assets/static-batch-advisor-DqfXWRUq.js +1 -0
  338. package/dist/assets/story-capture-COQgezzl.js +1 -0
  339. package/dist/assets/story-documents-DQ0KORmd.js +3 -0
  340. package/dist/assets/story-documents.service-DOSaqPqv.js +1 -0
  341. package/dist/assets/story-documents.service-Gb7oUkbg.js +1 -0
  342. package/dist/assets/{story-media-presence-BHzk2IV5.js → story-media-presence-nW3zJqKv.js} +1 -1
  343. package/dist/assets/story-pixi-preview-COPTEsHo.js +1 -0
  344. package/dist/assets/story-presentation-CxADj5oz.js +1 -0
  345. package/dist/assets/{story-three-preview-BHEDZzcl.js → story-three-preview-C9W__8Or.js} +2 -2
  346. package/dist/assets/{structural-ids-Dc-7rEwi.js → structural-ids-CblajJQK.js} +1 -1
  347. package/dist/assets/studio-CysTBGIb.exr +0 -0
  348. package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
  349. package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
  350. package/dist/assets/{surface-state-DaxyruCj.js → surface-state-BAUJu6GY.js} +1 -1
  351. package/dist/assets/{system-runner-DkOjxEBt.js → system-runner-D_DtVrer.js} +1 -1
  352. package/dist/assets/team-playtest.service--79O6xkx.js +1 -0
  353. package/dist/assets/{three-CDSueJyJ.js → three-DSsr_Lvp.js} +1 -1
  354. package/dist/assets/{three-authoring-adapter-CmSQ3Vui.js → three-authoring-adapter-Yqsank46.js} +1 -1
  355. package/dist/assets/three-authoring.service-BDos-bRt.js +2 -0
  356. package/dist/assets/{three-ingest-runtime-QzDYk6tU.js → three-ingest-runtime-DWijtqQ8.js} +1 -1
  357. package/dist/assets/{three-projection-core-BmKMZ-nf.js → three-projection-core-kubBTx0s.js} +1 -1
  358. package/dist/assets/three-story-model-BraQFA9h.js +1 -0
  359. package/dist/assets/three-viewport-presentation-BL7Uc2i6.js +1 -0
  360. package/dist/assets/{three.module-D396a9Mn.js → three.module-IFn-4i31.js} +1 -1
  361. package/dist/assets/three.quarks.esm-CRKGjKAH.js +1039 -0
  362. package/dist/assets/transform-mode-request-Cu7ewbtr.js +1 -0
  363. package/dist/assets/{transform-writer-BhBBTx33.js → transform-writer-DXxrI4t7.js} +1 -1
  364. package/dist/assets/transport.header-CeND8Vzh.js +1 -0
  365. package/dist/assets/{trigger-volume-BNK2XzPL.js → trigger-volume-BCVRS3NM.js} +1 -1
  366. package/dist/assets/{tuples-CIQ4Bn1U.js → tuples-DKDGrN1t.js} +1 -1
  367. package/dist/assets/ui-board-document-DD2CAEAo.js +2 -0
  368. package/dist/assets/unity.style-vCmLw4gI.js +1 -0
  369. package/dist/assets/unity.view-DIn2S6Do.js +1 -0
  370. package/dist/assets/unreal.style-BQn-HhOX.js +1 -0
  371. package/dist/assets/unreal.view-adNBETZK.js +1 -0
  372. package/dist/assets/user-data-CZqsJDk-.js +1 -0
  373. package/dist/assets/{utility-view-state-BHypxA33.js → utility-view-state-DYJY8V8O.js} +1 -1
  374. package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
  375. package/dist/assets/{vgai-shared-three-Bc5PvpLM.js → vgai-shared-three-D_RAEumG.js} +1 -1
  376. package/dist/assets/{viewport-root-presentation-CWsE56K6.js → viewport-root-presentation-C9M98VNM.js} +1 -1
  377. package/dist/assets/{viewport-shading-BuA88e_A.js → viewport-shading-BzcvgJhK.js} +1 -1
  378. package/dist/assets/viewport-shading-boundary-CBvvzS-p.js +84 -0
  379. package/dist/assets/{viewport-surface-status-B3om4Kcf.js → viewport-surface-status-BFmnWp7z.js} +1 -1
  380. package/dist/assets/voxel-surface-ROWYug7H.js +1 -0
  381. package/dist/assets/webgl-frame-capture-CRKX73E9.js +1 -0
  382. package/dist/assets/webworkerAll-CehoCtFb.js +1 -0
  383. package/dist/assets/{worker-UrMcrc5_.js → worker-B7zhIsFh.js} +2 -2
  384. package/dist/assets/world-documents-DErHq15h.js +1 -0
  385. package/dist/assets/world-root-stage-binding-BIymcQ4K.js +1 -0
  386. package/dist/assets/{world-state-BWG-IcOd.js → world-state-ZGDGY_Xl.js} +1 -1
  387. package/dist/assets/{writer-B-KovzkA.js → writer-BPbm4_my.js} +5 -5
  388. package/dist/assets/xstate-animation-binding-Cvd4JbEY.js +1 -0
  389. package/dist/assets/{xstate-animation-meta-Q3u9zh_m.js → xstate-animation-meta-B3OZR8Q2.js} +1 -1
  390. package/dist/vgai-shared-three.json +1 -1
  391. package/dist-node/cli.js +317 -73
  392. package/dist-node/create.js +59 -19
  393. package/package.json +16 -13
  394. package/src/index.ts +6 -0
  395. package/template/.agents/skills/vgai-3d-models/SKILL.md +3 -3
  396. package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +4 -9
  397. package/template/.claude/skills/vgai-3d-models/SKILL.md +3 -3
  398. package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +4 -9
  399. package/template/.github/skills/vgai-3d-models/SKILL.md +3 -3
  400. package/template/.github/skills/vgai-threejs-authoring/SKILL.md +4 -9
  401. package/template/AGENTS.md +1 -1
  402. package/template/check-idioms.ts +4 -5
  403. package/template/package.json +9 -9
  404. package/template/tsconfig.json +1 -0
  405. package/template/vgai.adapter.ts +1 -0
  406. package/template-dotfiles/gitignore +2 -0
  407. package/workbench/src/media/game-cover.css +1 -1
  408. package/catalog/project-source/src/lib/bake/mesh-slice.ts +0 -157
  409. package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +0 -1
  410. package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +0 -1
  411. package/dist/assets/ColladaLoader-aVOPIsCh.js +0 -3
  412. package/dist/assets/EXRLoader-Cdans_oJ.js +0 -1
  413. package/dist/assets/EffectComposer-DQxfsXBZ.js +0 -1
  414. package/dist/assets/EntityModelDocument-Ccvw66N9.js +0 -1
  415. package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +0 -1
  416. package/dist/assets/FBXLoader-B4MoUtAn.js +0 -1
  417. package/dist/assets/Fbo-Dz-Soul3.js +0 -1
  418. package/dist/assets/GLTFExporter-HgrCle4L.js +0 -1
  419. package/dist/assets/Gltf-UHVWKz65.js +0 -2
  420. package/dist/assets/HDRLoader-THU88oVD.js +0 -5
  421. package/dist/assets/ImageViewer-Tn7s_MnW.js +0 -1
  422. package/dist/assets/InspectorObjectPreview-CVejvLRg.js +0 -1
  423. package/dist/assets/JsonAssetDocument-C7VGcLhu.js +0 -3
  424. package/dist/assets/MeshBVH-BiDHDcu-.js +0 -1
  425. package/dist/assets/ModelAssetDocument-F5GACirk.js +0 -1
  426. package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +0 -2
  427. package/dist/assets/Object3DPreview-DL8oi7Xs.js +0 -2
  428. package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +0 -2
  429. package/dist/assets/PlayBar-BR-Vg3Jb.js +0 -2
  430. package/dist/assets/RGBELoader-BgBcQv8j.js +0 -1
  431. package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +0 -1
  432. package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +0 -1
  433. package/dist/assets/STLLoader-Dyv3lsxY.js +0 -1
  434. package/dist/assets/SimplifyModifier-C8ayvRzd.js +0 -1
  435. package/dist/assets/SourceAssetViewer-2SWQoUut.js +0 -12
  436. package/dist/assets/StageHost-BN-IoTef.js +0 -2
  437. package/dist/assets/ThreeBoardDocument-CVncZyIq.js +0 -2
  438. package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +0 -1
  439. package/dist/assets/asset-budget.action-DCzzcuTh.js +0 -1
  440. package/dist/assets/asset-budget.document-BWU8wnVW.js +0 -1
  441. package/dist/assets/asset-budget.menu-BGZpT_31.js +0 -1
  442. package/dist/assets/autoplay.service-BZBGNSvt.js +0 -1
  443. package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +0 -2
  444. package/dist/assets/blender-properties-tab-C5CyPydi.js +0 -3
  445. package/dist/assets/blender-runtime-host-BpBwGv7r.js +0 -4
  446. package/dist/assets/blender-runtime.document-lIYhhPtv.js +0 -8
  447. package/dist/assets/blender.command-BtJeWk-A.js +0 -1
  448. package/dist/assets/body-marks-h_xDxiDE.js +0 -1
  449. package/dist/assets/bridge.command-o5gDNEwa.js +0 -3
  450. package/dist/assets/browserAll-DeWblVez.js +0 -1
  451. package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +0 -2
  452. package/dist/assets/component-board.service-DidCyM4O.js +0 -2
  453. package/dist/assets/component-verbs.service-Bv9jId3q.js +0 -1
  454. package/dist/assets/constraints.inspector-B9U9Yj-u.js +0 -1
  455. package/dist/assets/coverage.service-VTX5Mcsx.js +0 -3
  456. package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +0 -2
  457. package/dist/assets/design-time-layers-wYgOTgni.js +0 -1
  458. package/dist/assets/design-time-mount.service-BzY21e1F.js +0 -2
  459. package/dist/assets/design-time-react-mount-DM9WLrF2.js +0 -1
  460. package/dist/assets/edit-mode-authoring-B47TfLqu.js +0 -1
  461. package/dist/assets/editor-api-BoJIcyZG.js +0 -1
  462. package/dist/assets/fflate.module-DPuTF8aG.js +0 -6
  463. package/dist/assets/fork-menu-BoVyw2Wu.js +0 -1
  464. package/dist/assets/game-document.service-DbRfx2V0.js +0 -1
  465. package/dist/assets/game-eval.command-D-7Dxbj_.js +0 -2
  466. package/dist/assets/gameplay-replay-e5umMlXv.js +0 -1
  467. package/dist/assets/gameplay.command-DxcVYX6F.js +0 -1
  468. package/dist/assets/generation.service-CDIgObuw.js +0 -1
  469. package/dist/assets/index-96FBF1Oj.js +0 -1
  470. package/dist/assets/index-BAWkB0dv.js +0 -1
  471. package/dist/assets/index-BDnS2b6S.js +0 -1
  472. package/dist/assets/index-BjTCPEQ7.js +0 -134
  473. package/dist/assets/index-CVCb_ImQ.js +0 -1
  474. package/dist/assets/index-CZd9o7Lu.js +0 -1
  475. package/dist/assets/index-D2fNXpHa.css +0 -1
  476. package/dist/assets/index-GIL7oGEO.js +0 -4894
  477. package/dist/assets/index-OrYXPk3Z.js +0 -487
  478. package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +0 -1
  479. package/dist/assets/ingest-siblings-Bop2kqVl.js +0 -1
  480. package/dist/assets/instances.command-D6UkZNO8.js +0 -1
  481. package/dist/assets/light-camera-factory-CWbbe9gI.js +0 -1
  482. package/dist/assets/live-behaviors-Bxq49Maz.js +0 -1
  483. package/dist/assets/matcap-texture-CVfalpWT.js +0 -1
  484. package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +0 -1
  485. package/dist/assets/model.layout-BJUEQYUI.js +0 -1
  486. package/dist/assets/module-mode-DVBLT9d-.js +0 -2
  487. package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +0 -2
  488. package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +0 -2
  489. package/dist/assets/mount-ingest-root-glv2SSWf.js +0 -2
  490. package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +0 -1
  491. package/dist/assets/particles-factory-DnLOHXT8.js +0 -1
  492. package/dist/assets/pasteboard-materialize-BqSS4QzV.js +0 -20
  493. package/dist/assets/pasteboard.action-DU3UHtJG.js +0 -2
  494. package/dist/assets/pixi-authoring-adapter-CjibysC3.js +0 -1
  495. package/dist/assets/pixi-primitive-DlWbUPN9.js +0 -1
  496. package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +0 -1
  497. package/dist/assets/play-mode-BFU2PCkG.js +0 -22
  498. package/dist/assets/play.command-BpqqLqkq.js +0 -2
  499. package/dist/assets/project-authoring-session-Bnt6icLr.js +0 -2
  500. package/dist/assets/r3f-design-session-D-4yyDO9.js +0 -2
  501. package/dist/assets/r3f-physics-binding-BBo8oma9.js +0 -1
  502. package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +0 -13
  503. package/dist/assets/react-inspector.service-B_neRnSK.js +0 -1
  504. package/dist/assets/react-story-board-BDDwiE2H.js +0 -1
  505. package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +0 -1
  506. package/dist/assets/runtime-inspection-l2iFQSsg.js +0 -1
  507. package/dist/assets/scene-document.service-qkDjUrlP.js +0 -2
  508. package/dist/assets/sculpt.layout-zJF55yCR.js +0 -1
  509. package/dist/assets/setup-particles-GCXlnkj_.js +0 -1
  510. package/dist/assets/shading.layout-DULYZV6M.js +0 -1
  511. package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +0 -1
  512. package/dist/assets/stage-invalidation-DBg3C3Ta.js +0 -1
  513. package/dist/assets/stage-keyboard-n-5kKH-m.js +0 -1
  514. package/dist/assets/stage-overlay-set-B9zp2sLB.js +0 -1
  515. package/dist/assets/stage-presence-markers-DiGI6A45.js +0 -1
  516. package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +0 -7
  517. package/dist/assets/static-batch-advisor-B13QEH7d.js +0 -1
  518. package/dist/assets/story-capture-_gC8dXV-.js +0 -1
  519. package/dist/assets/story-documents--TDLaPeL.js +0 -3
  520. package/dist/assets/story-documents.service-BiS_YbNQ.js +0 -1
  521. package/dist/assets/story-documents.service-CxOPYJ2j.js +0 -1
  522. package/dist/assets/story-pixi-preview-BUrOJZXS.js +0 -1
  523. package/dist/assets/story-presentation-j2AVN-mK.js +0 -1
  524. package/dist/assets/team-playtest.service-DqOinFVA.js +0 -1
  525. package/dist/assets/three-authoring.service-iuHLwtf1.js +0 -2
  526. package/dist/assets/three-viewport-presentation-QBQpSdMh.js +0 -1
  527. package/dist/assets/three.quarks.esm-B1C61jGo.js +0 -1039
  528. package/dist/assets/transport.header-B-6HQlU2.js +0 -1
  529. package/dist/assets/ui-board-document-Bwtt--xp.js +0 -2
  530. package/dist/assets/use-live-actor-state-DErbWQWF.js +0 -1
  531. package/dist/assets/user-data-BB2Of6Ht.js +0 -1
  532. package/dist/assets/uv-editing.layout-BEKHxmHw.js +0 -1
  533. package/dist/assets/viewport-shading-boundary-B_-_gABg.js +0 -82
  534. package/dist/assets/voxel-surface-DtcsSWRL.js +0 -1
  535. package/dist/assets/webgl-frame-capture-FlF9zQmW.js +0 -1
  536. package/dist/assets/webworkerAll-CM2o_dnz.js +0 -1
  537. package/dist/assets/world-documents-147tiFZe.js +0 -1
  538. package/dist/assets/world-root-stage-binding-vwTrtBz6.js +0 -1
  539. package/dist/assets/xstate-animation-binding-Brd0NST6.js +0 -1
  540. package/dist/assets/xstate-behavior.action-B8UluFBK.js +0 -1
  541. package/dist/assets/xstate-behavior.document-CKAsE45I.js +0 -1
  542. package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +0 -1
  543. package/dist/assets/xstate-behavior.menu-BXbPICIh.js +0 -1
  544. package/dist/assets/xstate-inspection-BsZv8LS9.js +0 -1
@@ -0,0 +1,1039 @@
1
+ import{O as si,aR as ht,aS as J,aJ as Ai,F as tt,h as je,ax as Ni,ay as ut,b4 as gi,M as xi,bQ as ze,y as Pi,bH as Ei,bR as Ui,b3 as Ci,aU as vi,bb as Bi,a_ as Ri,aZ as ki,bS as Fi,be as Ii,bT as Li,bU as Vi,j as Ji,p as Di,bp as Gi,bV as Xi,bW as qi,bC as Yi,bD as Hi,bB as Zi,bE as Wi,bA as Qi,bK as Ki,an as $i,u as ji,t as ts,v as es,bX as is,bY as ss,w as rs,x as hi,al as li,aB as ns,A as os,bo as as,aQ as hs,bg as ls,V as Xe}from"./three.module-IFn-4i31.js";const I=["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 ci=1234567;const Si=Math.PI/180,Mi=180/Math.PI;function cs(){const l=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(I[l&255]+I[l>>8&255]+I[l>>16&255]+I[l>>24&255]+"-"+I[t&255]+I[t>>8&255]+"-"+I[t>>16&15|64]+I[t>>24&255]+"-"+I[e&63|128]+I[e>>8&255]+"-"+I[e>>16&255]+I[e>>24&255]+I[i&255]+I[i>>8&255]+I[i>>16&255]+I[i>>24&255]).toLowerCase()}function rt(l,t,e){return Math.max(t,Math.min(e,l))}function _i(l,t){return(l%t+t)%t}function us(l,t,e,i,s){return i+(l-t)*(s-i)/(e-t)}function ds(l,t,e){return l!==t?(e-l)/(t-l):0}function wi(l,t,e){return(1-e)*l+e*t}function ms(l,t,e,i){return wi(l,t,1-Math.exp(-e*i))}function fs(l,t=1){return t-Math.abs(_i(l,t*2)-t)}function ps(l,t,e){return l<=t?0:l>=e?1:(l=(l-t)/(e-t),l*l*(3-2*l))}function ys(l,t,e){return l<=t?0:l>=e?1:(l=(l-t)/(e-t),l*l*l*(l*(l*6-15)+10))}function gs(l,t){return l+Math.floor(Math.random()*(t-l+1))}function xs(l,t){return l+Math.random()*(t-l)}function vs(l){return l*(.5-Math.random())}function Ss(l){l!==void 0&&(ci=l);let t=ci+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ms(l){return l*Si}function _s(l){return l*Mi}function ws(l){return(l&l-1)===0&&l!==0}function zs(l){return Math.pow(2,Math.ceil(Math.log(l)/Math.LN2))}function bs(l){return Math.pow(2,Math.floor(Math.log(l)/Math.LN2))}function Ts(l,t,e,i,s){const r=Math.cos,n=Math.sin,a=r(e/2),o=n(e/2),h=r((t+i)/2),c=n((t+i)/2),u=r((t-i)/2),f=n((t-i)/2),d=r((i-t)/2),m=n((i-t)/2);switch(s){case"XYX":l.set(a*c,o*u,o*f,a*h);break;case"YZY":l.set(o*f,a*c,o*u,a*h);break;case"ZXZ":l.set(o*u,o*f,a*c,a*h);break;case"XZX":l.set(a*c,o*m,o*d,a*h);break;case"YXY":l.set(o*d,a*c,o*m,a*h);break;case"ZYZ":l.set(o*m,o*d,a*c,a*h);break;default:console.warn("../math.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Os(l,t){switch(t.constructor){case Float32Array:return l;case Uint32Array:return l/4294967295;case Uint16Array:return l/65535;case Uint8Array:return l/255;case Int32Array:return Math.max(l/2147483647,-1);case Int16Array:return Math.max(l/32767,-1);case Int8Array:return Math.max(l/127,-1);default:throw new Error("Invalid component type.")}}function As(l,t){switch(t.constructor){case Float32Array:return l;case Uint32Array:return Math.round(l*4294967295);case Uint16Array:return Math.round(l*65535);case Uint8Array:return Math.round(l*255);case Int32Array:return Math.round(l*2147483647);case Int16Array:return Math.round(l*32767);case Int8Array:return Math.round(l*127);default:throw new Error("Invalid component type.")}}const Ot={DEG2RAD:Si,RAD2DEG:Mi,generateUUID:cs,clamp:rt,euclideanModulo:_i,mapLinear:us,inverseLerp:ds,lerp:wi,damp:ms,pingpong:fs,smoothstep:ps,smootherstep:ys,randInt:gs,randFloat:xs,randFloatSpread:vs,seededRandom:Ss,degToRad:Ms,radToDeg:_s,isPowerOfTwo:ws,ceilPowerOfTwo:zs,floorPowerOfTwo:bs,setQuaternionFromProperEuler:Ts,normalize:As,denormalize:Os};class A{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,n,a){let o=i[s+0],h=i[s+1],c=i[s+2],u=i[s+3];const f=r[n+0],d=r[n+1],m=r[n+2],p=r[n+3];if(a===0){t[e+0]=o,t[e+1]=h,t[e+2]=c,t[e+3]=u;return}if(a===1){t[e+0]=f,t[e+1]=d,t[e+2]=m,t[e+3]=p;return}if(u!==p||o!==f||h!==d||c!==m){let y=1-a;const x=o*f+h*d+c*m+u*p,z=x>=0?1:-1,b=1-x*x;if(b>Number.EPSILON){const S=Math.sqrt(b),g=Math.atan2(S,x*z);y=Math.sin(y*g)/S,a=Math.sin(a*g)/S}const w=a*z;if(o=o*y+f*w,h=h*y+d*w,c=c*y+m*w,u=u*y+p*w,y===1-a){const S=1/Math.sqrt(o*o+h*h+c*c+u*u);o*=S,h*=S,c*=S,u*=S}}t[e]=o,t[e+1]=h,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,r,n){const a=i[s],o=i[s+1],h=i[s+2],c=i[s+3],u=r[n],f=r[n+1],d=r[n+2],m=r[n+3];return t[e]=a*m+c*u+o*d-h*f,t[e+1]=o*m+c*f+h*u-a*d,t[e+2]=h*m+c*d+a*f-o*u,t[e+3]=c*m-a*u-o*f-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new A(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),c=a(s/2),u=a(r/2),f=o(i/2),d=o(s/2),m=o(r/2);switch(n){case"XYZ":this._x=f*c*u+h*d*m,this._y=h*d*u-f*c*m,this._z=h*c*m+f*d*u,this._w=h*c*u-f*d*m;break;case"YXZ":this._x=f*c*u+h*d*m,this._y=h*d*u-f*c*m,this._z=h*c*m-f*d*u,this._w=h*c*u+f*d*m;break;case"ZXY":this._x=f*c*u-h*d*m,this._y=h*d*u+f*c*m,this._z=h*c*m+f*d*u,this._w=h*c*u-f*d*m;break;case"ZYX":this._x=f*c*u-h*d*m,this._y=h*d*u+f*c*m,this._z=h*c*m-f*d*u,this._w=h*c*u+f*d*m;break;case"YZX":this._x=f*c*u+h*d*m,this._y=h*d*u+f*c*m,this._z=h*c*m-f*d*u,this._w=h*c*u-f*d*m;break;case"XZY":this._x=f*c*u-h*d*m,this._y=h*d*u-f*c*m,this._z=h*c*m+f*d*u,this._w=h*c*u+f*d*m;break;default:console.warn("../math.Quaternion: .setFromEuler() encountered an unknown order: "+n)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=e[8],n=e[1],a=e[5],o=e[9],h=e[2],c=e[6],u=e[10],f=i+a+u;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(c-o)*d,this._y=(r-h)*d,this._z=(n-s)*d}else if(i>a&&i>u){const d=2*Math.sqrt(1+i-a-u);this._w=(c-o)/d,this._x=.25*d,this._y=(s+n)/d,this._z=(r+h)/d}else if(a>u){const d=2*Math.sqrt(1+a-i-u);this._w=(r-h)/d,this._x=(s+n)/d,this._y=.25*d,this._z=(o+c)/d}else{const d=2*Math.sqrt(1+u-i-a);this._w=(n-s)/d,this._x=(r+h)/d,this._y=(o+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(rt(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,s=t._y,r=t._z,n=t._w,a=e._x,o=e._y,h=e._z,c=e._w;return this._x=i*c+n*a+s*h-r*o,this._y=s*c+n*o+r*a-i*h,this._z=r*c+n*h+i*o-s*a,this._w=n*c-i*a-s*o-r*h,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,n=this._w;let a=n*t._w+i*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=n,this._x=i,this._y=s,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const d=1-e;return this._w=d*n+e*this._w,this._x=d*i+e*this._x,this._y=d*s+e*this._y,this._z=d*r+e*this._z,this.normalize(),this}const h=Math.sqrt(o),c=Math.atan2(h,a),u=Math.sin((1-e)*c)/h,f=Math.sin(e*c)/h;return this._w=n*u+this._w*f,this._x=i*u+this._x*f,this._y=s*u+this._y*f,this._z=r*u+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class _{constructor(t=0,e=0,i=0){this.isVector3=!0,_.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new _(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ui.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ui.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*s-a*i),c=2*(a*e-r*s),u=2*(r*i-n*e);return this.x=e+o*h+n*u-a*c,this.y=i+o*c+a*h-r*u,this.z=s+o*u+r*c-n*h,this}transformDirection(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return qe.copy(this).projectOnVector(t),this.sub(qe)}reflect(t){return this.sub(qe.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(rt(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const qe=new _,ui=new A,ve=2e3,di=2001;class et{constructor(t,e,i,s,r,n,a,o,h,c,u,f,d,m,p,y){this.isMatrix4=!0,et.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,n,a,o,h,c,u,f,d,m,p,y)}extractPosition(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)}multiplyToArray(t,e,i){return console.error("THREE.Matrix4: .multiplyToArray() has been removed."),this}setRotationFromQuaternion(t){return this.makeRotationFromQuaternion(t)}set(t,e,i,s,r,n,a,o,h,c,u,f,d,m,p,y){const x=this.elements;return x[0]=t,x[4]=e,x[8]=i,x[12]=s,x[1]=r,x[5]=n,x[9]=a,x[13]=o,x[2]=h,x[6]=c,x[10]=u,x[14]=f,x[3]=d,x[7]=m,x[11]=p,x[15]=y,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 et().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,s=1/St.setFromMatrixColumn(t,0).length(),r=1/St.setFromMatrixColumn(t,1).length(),n=1/St.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*n,e[9]=i[9]*n,e[10]=i[10]*n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,s=t.y,r=t.z,n=Math.cos(i),a=Math.sin(i),o=Math.cos(s),h=Math.sin(s),c=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const f=n*c,d=n*u,m=a*c,p=a*u;e[0]=o*c,e[4]=-o*u,e[8]=h,e[1]=d+m*h,e[5]=f-p*h,e[9]=-a*o,e[2]=p-f*h,e[6]=m+d*h,e[10]=n*o}else if(t.order==="YXZ"){const f=o*c,d=o*u,m=h*c,p=h*u;e[0]=f+p*a,e[4]=m*a-d,e[8]=n*h,e[1]=n*u,e[5]=n*c,e[9]=-a,e[2]=d*a-m,e[6]=p+f*a,e[10]=n*o}else if(t.order==="ZXY"){const f=o*c,d=o*u,m=h*c,p=h*u;e[0]=f-p*a,e[4]=-n*u,e[8]=m+d*a,e[1]=d+m*a,e[5]=n*c,e[9]=p-f*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if(t.order==="ZYX"){const f=n*c,d=n*u,m=a*c,p=a*u;e[0]=o*c,e[4]=m*h-d,e[8]=f*h+p,e[1]=o*u,e[5]=p*h+f,e[9]=d*h-m,e[2]=-h,e[6]=a*o,e[10]=n*o}else if(t.order==="YZX"){const f=n*o,d=n*h,m=a*o,p=a*h;e[0]=o*c,e[4]=p-f*u,e[8]=m*u+d,e[1]=u,e[5]=n*c,e[9]=-a*c,e[2]=-h*c,e[6]=d*u+m,e[10]=f-p*u}else if(t.order==="XZY"){const f=n*o,d=n*h,m=a*o,p=a*h;e[0]=o*c,e[4]=-u,e[8]=h*c,e[1]=f*u+p,e[5]=n*c,e[9]=d*u-m,e[2]=m*u-d,e[6]=a*c,e[10]=p*u+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Ns,t,Ps)}lookAt(t,e,i){const s=this.elements;return D.subVectors(t,e),D.lengthSq()===0&&(D.z=1),D.normalize(),dt.crossVectors(i,D),dt.lengthSq()===0&&(Math.abs(i.z)===1?D.x+=1e-4:D.z+=1e-4,D.normalize(),dt.crossVectors(i,D)),dt.normalize(),Se.crossVectors(D,dt),s[0]=dt.x,s[4]=Se.x,s[8]=D.x,s[1]=dt.y,s[5]=Se.y,s[9]=D.y,s[2]=dt.z,s[6]=Se.z,s[10]=D.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,n=i[0],a=i[4],o=i[8],h=i[12],c=i[1],u=i[5],f=i[9],d=i[13],m=i[2],p=i[6],y=i[10],x=i[14],z=i[3],b=i[7],w=i[11],S=i[15],g=s[0],v=s[4],T=s[8],P=s[12],E=s[1],U=s[5],V=s[9],Y=s[13],H=s[2],Z=s[6],W=s[10],Q=s[14],K=s[3],$=s[7],X=s[11],q=s[15];return r[0]=n*g+a*E+o*H+h*K,r[4]=n*v+a*U+o*Z+h*$,r[8]=n*T+a*V+o*W+h*X,r[12]=n*P+a*Y+o*Q+h*q,r[1]=c*g+u*E+f*H+d*K,r[5]=c*v+u*U+f*Z+d*$,r[9]=c*T+u*V+f*W+d*X,r[13]=c*P+u*Y+f*Q+d*q,r[2]=m*g+p*E+y*H+x*K,r[6]=m*v+p*U+y*Z+x*$,r[10]=m*T+p*V+y*W+x*X,r[14]=m*P+p*Y+y*Q+x*q,r[3]=z*g+b*E+w*H+S*K,r[7]=z*v+b*U+w*Z+S*$,r[11]=z*T+b*V+w*W+S*X,r[15]=z*P+b*Y+w*Q+S*q,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],n=t[1],a=t[5],o=t[9],h=t[13],c=t[2],u=t[6],f=t[10],d=t[14],m=t[3],p=t[7],y=t[11],x=t[15];return m*(+r*o*u-s*h*u-r*a*f+i*h*f+s*a*d-i*o*d)+p*(+e*o*d-e*h*f+r*n*f-s*n*d+s*h*c-r*o*c)+y*(+e*h*u-e*a*d-r*n*u+i*n*d+r*a*c-i*h*c)+x*(-s*a*c-e*o*u+e*a*f+s*n*u-i*n*f+i*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],c=t[8],u=t[9],f=t[10],d=t[11],m=t[12],p=t[13],y=t[14],x=t[15],z=u*y*h-p*f*h+p*o*d-a*y*d-u*o*x+a*f*x,b=m*f*h-c*y*h-m*o*d+n*y*d+c*o*x-n*f*x,w=c*p*h-m*u*h+m*a*d-n*p*d-c*a*x+n*u*x,S=m*u*o-c*p*o-m*a*f+n*p*f+c*a*y-n*u*y,g=e*z+i*b+s*w+r*S;if(g===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const v=1/g;return t[0]=z*v,t[1]=(p*f*r-u*y*r-p*s*d+i*y*d+u*s*x-i*f*x)*v,t[2]=(a*y*r-p*o*r+p*s*h-i*y*h-a*s*x+i*o*x)*v,t[3]=(u*o*r-a*f*r-u*s*h+i*f*h+a*s*d-i*o*d)*v,t[4]=b*v,t[5]=(c*y*r-m*f*r+m*s*d-e*y*d-c*s*x+e*f*x)*v,t[6]=(m*o*r-n*y*r-m*s*h+e*y*h+n*s*x-e*o*x)*v,t[7]=(n*f*r-c*o*r+c*s*h-e*f*h-n*s*d+e*o*d)*v,t[8]=w*v,t[9]=(m*u*r-c*p*r-m*i*d+e*p*d+c*i*x-e*u*x)*v,t[10]=(n*p*r-m*a*r+m*i*h-e*p*h-n*i*x+e*a*x)*v,t[11]=(c*a*r-n*u*r-c*i*h+e*u*h+n*i*d-e*a*d)*v,t[12]=S*v,t[13]=(c*p*s-m*u*s+m*i*f-e*p*f-c*i*y+e*u*y)*v,t[14]=(m*a*s-n*p*s-m*i*o+e*p*o+n*i*y-e*a*y)*v,t[15]=(n*u*s-c*a*s+c*i*o-e*u*o-n*i*f+e*a*f)*v,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,c=r*a;return this.set(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,c*a+i,c*o-s*n,0,h*o-s*a,c*o+s*n,r*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,n){return this.set(1,i,r,0,t,1,n,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,n=e._y,a=e._z,o=e._w,h=r+r,c=n+n,u=a+a,f=r*h,d=r*c,m=r*u,p=n*c,y=n*u,x=a*u,z=o*h,b=o*c,w=o*u,S=i.x,g=i.y,v=i.z;return s[0]=(1-(p+x))*S,s[1]=(d+w)*S,s[2]=(m-b)*S,s[3]=0,s[4]=(d-w)*g,s[5]=(1-(f+x))*g,s[6]=(y+z)*g,s[7]=0,s[8]=(m+b)*v,s[9]=(y-z)*v,s[10]=(1-(f+p))*v,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=St.set(s[0],s[1],s[2]).length();const n=St.set(s[4],s[5],s[6]).length(),a=St.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],j.copy(this);const h=1/r,c=1/n,u=1/a;return j.elements[0]*=h,j.elements[1]*=h,j.elements[2]*=h,j.elements[4]*=c,j.elements[5]*=c,j.elements[6]*=c,j.elements[8]*=u,j.elements[9]*=u,j.elements[10]*=u,e.setFromRotationMatrix(j),i.x=r,i.y=n,i.z=a,this}makePerspective(t,e,i,s,r,n,a=ve){const o=this.elements,h=2*r/(e-t),c=2*r/(i-s),u=(e+t)/(e-t),f=(i+s)/(i-s);let d,m;if(a===ve)d=-(n+r)/(n-r),m=-2*n*r/(n-r);else if(a===di)d=-n/(n-r),m=-n*r/(n-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return o[0]=h,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=c,o[9]=f,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=m,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,s,r,n,a=ve){const o=this.elements,h=1/(e-t),c=1/(i-s),u=1/(n-r),f=(e+t)*h,d=(i+s)*c;let m,p;if(a===ve)m=(n+r)*u,p=-2*u;else if(a===di)m=r*u,p=-1*u;else throw new Error("../math.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return o[0]=2*h,o[4]=0,o[8]=0,o[12]=-f,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=p,o[14]=-m,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<16;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const St=new _,j=new et,Ns=new _(0,0,0),Ps=new _(1,1,1),dt=new _,Se=new _,D=new _,mi=new et,fi=new A;class Lt{constructor(t=0,e=0,i=0,s=Lt.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new Lt(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],n=s[4],a=s[8],o=s[1],h=s[5],c=s[9],u=s[2],f=s[6],d=s[10];switch(e){case"XYZ":this._y=Math.asin(rt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-n,r)):(this._x=Math.atan2(f,h),this._z=0);break;case"YXZ":this._x=Math.asin(-rt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(rt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-rt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-n,h));break;case"YZX":this._z=Math.asin(rt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-rt(n,-1,1)),Math.abs(n)<.9999999?(this._x=Math.atan2(f,h),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("../math.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return mi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(mi,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return fi.setFromEuler(this),this.setFromQuaternion(fi,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(t){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Lt.DEFAULT_ORDER="XYZ";class _t{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new _t(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(rt(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}rotateAround(t,e){const i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,n=this.y-t.y;return this.x=r*i-n*s+t.x,this.y=r*s+n*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}_t.isVector2=!0;class G{constructor(t=0,e=0,i=0,s=1){G.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new G(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=this.w,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r;const o=t.elements,h=o[0],c=o[4],u=o[8],f=o[1],d=o[5],m=o[9],p=o[2],y=o[6],x=o[10];if(Math.abs(c-f)<.01&&Math.abs(u-p)<.01&&Math.abs(m-y)<.01){if(Math.abs(c+f)<.1&&Math.abs(u+p)<.1&&Math.abs(m+y)<.1&&Math.abs(h+d+x-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(h+1)/2,w=(d+1)/2,S=(x+1)/2,g=(c+f)/4,v=(u+p)/4,T=(m+y)/4;return b>w&&b>S?b<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(b),s=g/i,r=v/i):w>S?w<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(w),i=g/s,r=T/s):S<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(S),i=v/r,s=T/r),this.set(i,s,r,e),this}let z=Math.sqrt((y-m)*(y-m)+(u-p)*(u-p)+(f-c)*(f-c));return Math.abs(z)<.001&&(z=1),this.x=(y-m)/z,this.y=(u-p)/z,this.z=(f-c)/z,this.w=Math.acos((h+d+x-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}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 nt{constructor(t,e,i,s,r,n,a,o,h){nt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,n,a,o,h)}set(t,e,i,s,r,n,a,o,h){const c=this.elements;return c[0]=t,c[1]=s,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=i,c[7]=n,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=this.elements,n=i[0],a=i[3],o=i[6],h=i[1],c=i[4],u=i[7],f=i[2],d=i[5],m=i[8],p=s[0],y=s[3],x=s[6],z=s[1],b=s[4],w=s[7],S=s[2],g=s[5],v=s[8];return r[0]=n*p+a*z+o*S,r[3]=n*y+a*b+o*g,r[6]=n*x+a*w+o*v,r[1]=h*p+c*z+u*S,r[4]=h*y+c*b+u*g,r[7]=h*x+c*w+u*v,r[2]=f*p+d*z+m*S,r[5]=f*y+d*b+m*g,r[8]=f*x+d*w+m*v,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],c=t[8];return e*n*c-e*a*h-i*r*c+i*a*o+s*r*h-s*n*o}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],c=t[8],u=c*n-a*h,f=a*o-c*r,d=h*r-n*o,m=e*u+i*f+s*d;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/m;return t[0]=u*p,t[1]=(s*h-c*i)*p,t[2]=(a*i-s*n)*p,t[3]=f*p,t[4]=(c*e-s*o)*p,t[5]=(s*r-a*e)*p,t[6]=d*p,t[7]=(i*o-h*e)*p,t[8]=(n*e-i*r)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,n,a){const o=Math.cos(r),h=Math.sin(r);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-s*h,s*o,-s*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Ye.makeScale(t,e)),this}rotate(t){return this.premultiply(Ye.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ye.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<9;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new nt().fromArray(this.elements)}}const Ye=new nt;var L;(function(l){l[l.Random=0]="Random",l[l.Loop=1]="Loop",l[l.PingPong=2]="PingPong",l[l.Burst=3]="Burst"})(L||(L={}));function At(l,t,e,i){let s;switch(L.Random===l?t=Math.random():L.Burst===l&&i.isBursting&&(t=i.burstParticleIndex/i.burstParticleCount),e>0?s=Math.floor(t/e)*e:s=t,l){case L.Loop:s=s%1;break;case L.PingPong:s=Math.abs(s%2-1);break}return s}class yt{constructor(t,e,i,s){this.p=[t,e,i,s]}genValue(t){const e=t*t,i=t*t*t,s=1-t,r=s*s,n=r*s;return this.p[0]*n+this.p[1]*r*t*3+this.p[2]*s*e*3+this.p[3]*i}derivativeCoefficients(t){const e=[];for(let i=t,s=i.length-1;s>0;s--){const r=[];for(let n=0;n<s;n++){const a=s*(i[n+1]-i[n]);r.push(a)}e.push(r),i=r}return e}getSlope(t){const e=this.derivativeCoefficients(this.p)[0],i=1-t,s=i*i,r=i*t*2,n=t*t;return s*e[0]+r*e[1]+n*e[2]}controlCurve(t,e){this.p[1]=t/3+this.p[0],this.p[2]=this.p[3]-e/3}hull(t){let e=this.p,i=[],s,r=0,n=0,a=0;const o=[];for(o[r++]=e[0],o[r++]=e[1],o[r++]=e[2],o[r++]=e[3];e.length>1;){for(i=[],n=0,a=e.length-1;n<a;n++)s=t*e[n]+(1-t)*e[n+1],o[r++]=s,i.push(s);e=i}return o}split(t){const e=this.hull(t);return{left:new yt(e[0],e[4],e[7],e[9]),right:new yt(e[9],e[8],e[6],e[3]),span:e}}clone(){return new yt(this.p[0],this.p[1],this.p[2],this.p[3])}toJSON(){return{p0:this.p[0],p1:this.p[1],p2:this.p[2],p3:this.p[3]}}static fromJSON(t){return new yt(t.p0,t.p1,t.p2,t.p3)}}const Vt=l=>({r:l.x,g:l.y,b:l.z,a:l.w}),Jt=l=>new G(l.r,l.g,l.b,l.a),Es=(l,t)=>{switch(t){case"Vector3":return new _(l.x,l.y,l.z);case"Vector4":return new G(l.x,l.y,l.z,l.w);case"Color":return new _(l.r,l.g,l.b);case"Number":return l;default:return l}},Us=(l,t)=>{switch(t){case"Vector3":return{x:l.x,y:l.y,z:l.z};case"Vector4":return{x:l.x,y:l.y,z:l.z,w:l.w};case"Color":return{r:l.x,g:l.y,b:l.z};case"Number":return l;default:return l}};class be{constructor(t,e){this.a=t,this.b=e,this.type="value"}startGen(t){}genColor(t,e){const i=Math.random();return e.copy(this.a).lerp(this.b,i)}toJSON(){return{type:"RandomColor",a:Vt(this.a),b:Vt(this.b)}}static fromJSON(t){return new be(Jt(t.a),Jt(t.b))}clone(){return new be(this.a.clone(),this.b.clone())}}class wt{constructor(t,e){this.a=t,this.b=e,this.indexCount=-1,this.type="value"}startGen(t){this.indexCount=t.length,t.push(Math.random())}genColor(t,e){return this.indexCount===-1&&this.startGen(t),e.copy(this.a).lerp(this.b,t[this.indexCount])}toJSON(){return{type:"ColorRange",a:Vt(this.a),b:Vt(this.b)}}static fromJSON(t){return new wt(Jt(t.a),Jt(t.b))}clone(){return new wt(this.a.clone(),this.b.clone())}}class ft{constructor(t,e){this.subType=e,this.type="function",this.keys=t}findKey(t){let e=0,i=0,s=this.keys.length-1;for(;i+1<s;)if(e=Math.floor((i+s)/2),t<this.getStartX(e))s=e-1;else if(t>this.getEndX(e))i=e+1;else return e;for(let r=i;r<=s;r++)if(t>=this.getStartX(r)&&t<=this.getEndX(r))return r;return-1}getStartX(t){return this.keys[t][1]}getEndX(t){return t+1<this.keys.length?this.keys[t+1][1]:1}genValue(t,e){const i=this.findKey(e);return this.subType==="Number"?i===-1?this.keys[0][0]:i+1>=this.keys.length?this.keys[this.keys.length-1][0]:(this.keys[i+1][0]-this.keys[i][0])*((e-this.getStartX(i))/(this.getEndX(i)-this.getStartX(i)))+this.keys[i][0]:i===-1?t.copy(this.keys[0][0]):i+1>=this.keys.length?t.copy(this.keys[this.keys.length-1][0]):t.copy(this.keys[i][0]).lerp(this.keys[i+1][0],(e-this.getStartX(i))/(this.getEndX(i)-this.getStartX(i)))}toJSON(){return this.keys[0][0].constructor.name,{type:"CLinearFunction",subType:this.subType,keys:this.keys.map(([t,e])=>({value:Us(t,this.subType),pos:e}))}}static fromJSON(t){return new ft(t.keys.map(e=>[Es(e.value,t.subType),e.pos]),t.subType)}clone(){return this.subType==="Number"?new ft(this.keys.map(([t,e])=>[t,e]),this.subType):new ft(this.keys.map(([t,e])=>[t.clone(),e]),this.subType)}}const Me=new _;class gt{constructor(t=[[new _(0,0,0),0],[new _(1,1,1),0]],e=[[1,0],[1,1]]){this.type="function",this.color=new ft(t,"Color"),this.alpha=new ft(e,"Number")}genColor(t,e,i){return this.color.genValue(Me,i),e.set(Me.x,Me.y,Me.z,this.alpha.genValue(1,i))}toJSON(){return{type:"Gradient",color:this.color.toJSON(),alpha:this.alpha.toJSON()}}static fromJSON(t){if(t.functions){const e=t.functions.map(i=>[wt.fromJSON(i.function).a,i.start]);return t.functions.length>0&&e.push([wt.fromJSON(t.functions[t.functions.length-1].function).b,1]),new gt(e.map(i=>[new _(i[0].x,i[0].y,i[0].z),i[1]]),e.map(i=>[i[0].w,i[1]]))}else{const e=new gt;return e.alpha=ft.fromJSON(t.alpha),e.color=ft.fromJSON(t.color),e}}clone(){const t=new gt;return t.alpha=this.alpha.clone(),t.color=this.color.clone(),t}startGen(t){}}const He=new G;class Te{constructor(t,e){this.indexCount=0,this.type="function",this.gradient1=t,this.gradient2=e}startGen(t){this.indexCount=t.length,t.push(Math.random())}genColor(t,e,i){return this.gradient1.genColor(t,e,i),this.gradient2.genColor(t,He,i),t&&t[this.indexCount]!==void 0?e.lerp(He,t[this.indexCount]):e.lerp(He,Math.random()),e}toJSON(){return{type:"RandomColorBetweenGradient",gradient1:this.gradient1.toJSON(),gradient2:this.gradient2.toJSON()}}static fromJSON(t){return new Te(gt.fromJSON(t.gradient1),gt.fromJSON(t.gradient2))}clone(){return new Te(this.gradient1.clone(),this.gradient2.clone())}}class zt{constructor(t){this.color=t,this.type="value"}startGen(t){}genColor(t,e){return e.copy(this.color)}toJSON(){return{type:"ConstantColor",color:Vt(this.color)}}static fromJSON(t){return new zt(Jt(t.color))}clone(){return new zt(this.color.clone())}}function ri(l){switch(l.type){case"ConstantColor":return zt.fromJSON(l);case"ColorRange":return wt.fromJSON(l);case"RandomColor":return be.fromJSON(l);case"Gradient":return gt.fromJSON(l);case"RandomColorBetweenGradient":return Te.fromJSON(l);default:return new zt(new G(1,1,1,1))}}class N{constructor(t){this.value=t,this.type="value"}startGen(t){}genValue(t){return this.value}toJSON(){return{type:"ConstantValue",value:this.value}}static fromJSON(t){return new N(t.value)}clone(){return new N(this.value)}}class xt{constructor(t,e){this.a=t,this.b=e,this.indexCount=-1,this.type="value"}startGen(t){this.indexCount=t.length,t.push(Math.random())}genValue(t){return this.indexCount===-1&&this.startGen(t),Ot.lerp(this.a,this.b,t[this.indexCount])}toJSON(){return{type:"IntervalValue",a:this.a,b:this.b}}static fromJSON(t){return new xt(t.a,t.b)}clone(){return new xt(this.a,this.b)}}class Cs{constructor(){this.functions=new Array}findFunction(t){let e=0,i=0,s=this.functions.length-1;for(;i+1<s;)if(e=Math.floor((i+s)/2),t<this.getStartX(e))s=e-1;else if(t>this.getEndX(e))i=e+1;else return e;for(let r=i;r<=s;r++)if(t>=this.functions[r][1]&&t<=this.getEndX(r))return r;return-1}getStartX(t){return this.functions[t][1]}setStartX(t,e){t>0&&(this.functions[t][1]=e)}getEndX(t){return t+1<this.functions.length?this.functions[t+1][1]:1}setEndX(t,e){t+1<this.functions.length&&(this.functions[t+1][1]=e)}insertFunction(t,e){const i=this.findFunction(t);this.functions.splice(i+1,0,[e,t])}removeFunction(t){return this.functions.splice(t,1)[0][0]}getFunction(t){return this.functions[t][0]}setFunction(t,e){this.functions[t][0]=e}get numOfFunctions(){return this.functions.length}}class Dt extends Cs{constructor(t=[[new yt(0,1/3,1/3*2,1),0]]){super(),this.type="function",this.functions=t}genValue(t,e=0){const i=this.findFunction(e);return i===-1?0:this.functions[i][0].genValue((e-this.getStartX(i))/(this.getEndX(i)-this.getStartX(i)))}toSVG(t,e){if(e<1)return"";let i=["M",0,this.functions[0][0].p[0]].join(" ");for(let s=1/e;s<=1;s+=1/e)i=[i,"L",s*t,this.genValue(void 0,s)].join(" ");return i}toJSON(){return{type:"PiecewiseBezier",functions:this.functions.map(([t,e])=>({function:t.toJSON(),start:e}))}}static fromJSON(t){return new Dt(t.functions.map(e=>[yt.fromJSON(e.function),e.start]))}clone(){return new Dt(this.functions.map(([t,e])=>[t.clone(),e]))}startGen(t){}}function O(l){switch(l.type){case"ConstantValue":return N.fromJSON(l);case"IntervalValue":return xt.fromJSON(l);case"PiecewiseBezier":return Dt.fromJSON(l);default:return new N(0)}}class Gt{constructor(){this.indexCount=0,this.type="rotation"}startGen(t){this.indexCount=t.length,t.push(new A);let e,i,s,r,n,a;do e=Math.random()*2-1,i=Math.random()*2-1,s=e*e+i*i;while(s>1);do r=Math.random()*2-1,n=Math.random()*2-1,a=r*r+n*n;while(a>1);const o=Math.sqrt((1-s)/a);t[this.indexCount].set(e,i,o*r,o*n)}genValue(t,e,i,s){return this.indexCount===-1&&this.startGen(t),e.copy(t[this.indexCount]),e}toJSON(){return{type:"RandomQuat"}}static fromJSON(t){return new Gt}clone(){return new Gt}}class Xt{constructor(t,e){this.axis=t,this.angle=e,this.type="rotation"}startGen(t){this.angle.startGen(t)}genValue(t,e,i,s){return e.setFromAxisAngle(this.axis,this.angle.genValue(t,s)*i)}toJSON(){return{type:"AxisAngle",axis:{x:this.axis.x,y:this.axis.y,z:this.axis.z},angle:this.angle.toJSON()}}static fromJSON(t){return new Xt(new _(t.axis.x,t.axis.y,t.axis.z),O(t.angle))}clone(){return new Xt(this.axis.clone(),this.angle.clone())}}class Oe{constructor(t,e,i,s){this.angleX=t,this.angleY=e,this.angleZ=i,this.type="rotation",this.eular=new Lt(0,0,0,s)}startGen(t){this.angleX.startGen(t),this.angleY.startGen(t),this.angleZ.startGen(t)}genValue(t,e,i,s){return this.eular.set(this.angleX.genValue(t,s)*i,this.angleY.genValue(t,s)*i,this.angleZ.genValue(t,s)*i),e.setFromEuler(this.eular)}toJSON(){return{type:"Euler",angleX:this.angleX.toJSON(),angleY:this.angleY.toJSON(),angleZ:this.angleZ.toJSON(),eulerOrder:this.eular.order}}static fromJSON(t){return new Oe(O(t.angleX),O(t.angleY),O(t.angleZ),t.eulerOrder)}clone(){return new Oe(this.angleX,this.angleY,this.angleZ,this.eular.order)}}function zi(l){switch(l.type){case"AxisAngle":return Xt.fromJSON(l);case"Euler":return Oe.fromJSON(l);case"RandomQuat":return Gt.fromJSON(l);default:return new Gt}}class vt{constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.type="vec3function"}startGen(t){this.x.startGen(t),this.y.startGen(t),this.z.startGen(t)}genValue(t,e,i){return e.set(this.x.genValue(t,i),this.y.genValue(t,i),this.z.genValue(t,i))}toJSON(){return{type:"Vector3Function",x:this.x.toJSON(),y:this.y.toJSON(),z:this.z.toJSON()}}static fromJSON(t){return new vt(O(t.x),O(t.y),O(t.z))}clone(){return new vt(this.x,this.y,this.z)}}function Bs(l){switch(l.type){case"Vector3Function":return vt.fromJSON(l);default:return new vt(new N(0),new N(0),new N(0))}}function Ae(l){switch(l.type){case"ConstantValue":case"IntervalValue":case"PiecewiseBezier":return O(l);case"AxisAngle":case"RandomQuat":case"Euler":return zi(l);case"Vector3Function":return Bs(l);default:return new N(0)}}class qt{constructor(t={}){this.type="cone",this.currentValue=0,this.radius=t.radius??10,this.arc=t.arc??2*Math.PI,this.thickness=t.thickness??1,this.angle=t.angle??Math.PI/6,this.mode=t.mode??L.Random,this.spread=t.spread??0,this.speed=t.speed??new N(1),this.memory=[]}update(t,e){L.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,t.emissionState.time/t.duration)*e)}initialize(t,e){const i=At(this.mode,this.currentValue,this.spread,e),s=Ot.lerp(1-this.thickness,1,Math.random()),r=i*this.arc,n=Math.sqrt(s),a=Math.sin(r),o=Math.cos(r);t.position.x=n*o,t.position.y=n*a,t.position.z=0;const h=this.angle*n;t.velocity.set(0,0,Math.cos(h)).addScaledVector(t.position,Math.sin(h)).multiplyScalar(t.startSpeed),t.position.multiplyScalar(this.radius)}toJSON(){return{type:"cone",radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new qt({radius:t.radius,arc:t.arc,thickness:t.thickness,angle:t.angle,mode:t.mode,speed:t.speed?O(t.speed):void 0,spread:t.spread})}clone(){return new qt({radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}}class Yt{constructor(t={}){this.type="circle",this.currentValue=0,this.radius=t.radius??10,this.arc=t.arc??2*Math.PI,this.thickness=t.thickness??1,this.mode=t.mode??L.Random,this.spread=t.spread??0,this.speed=t.speed??new N(1),this.memory=[]}update(t,e){this.currentValue+=this.speed.genValue(this.memory,t.emissionState.time/t.duration)*e}initialize(t,e){const i=At(this.mode,this.currentValue,this.spread,e),s=Ot.lerp(1-this.thickness,1,Math.random()),r=i*this.arc;t.position.x=Math.cos(r),t.position.y=Math.sin(r),t.position.z=0,t.velocity.copy(t.position).multiplyScalar(t.startSpeed),t.position.multiplyScalar(this.radius*s)}toJSON(){return{type:"circle",radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new Yt({radius:t.radius,arc:t.arc,thickness:t.thickness,mode:t.mode,speed:t.speed?O(t.speed):void 0,spread:t.spread})}clone(){return new Yt({radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}}function _e(l,t){return Math.floor(Math.random()*(t-l))+l}const ge=new _(0,1,0),xe=new _(0,0,0),Rs=new _(1,1,1),pi=new _(0,0,1);class Ht{constructor(t={}){this.type="donut",this.currentValue=0,this.radius=t.radius??10,this.arc=t.arc??2*Math.PI,this.thickness=t.thickness??1,this.donutRadius=t.donutRadius??this.radius*.2,this.mode=t.mode??L.Random,this.spread=t.spread??0,this.speed=t.speed??new N(1),this.memory=[],this._m1=new et}update(t,e){L.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,t.emissionState.time/t.duration)*e)}initialize(t,e){const i=At(this.mode,this.currentValue,this.spread,e),s=Math.random(),r=Ot.lerp(1-this.thickness,1,Math.random()),n=i*this.arc,a=s*Math.PI*2,o=Math.sin(n),h=Math.cos(n);t.position.x=this.radius*h,t.position.y=this.radius*o,t.position.z=0,t.velocity.z=this.donutRadius*r*Math.sin(a),t.velocity.x=this.donutRadius*r*Math.cos(a)*h,t.velocity.y=this.donutRadius*r*Math.cos(a)*o,t.position.add(t.velocity),t.velocity.normalize().multiplyScalar(t.startSpeed),t.rotation instanceof A&&(this._m1.lookAt(xe,t.velocity,ge),t.rotation.setFromRotationMatrix(this._m1))}toJSON(){return{type:"donut",radius:this.radius,arc:this.arc,thickness:this.thickness,donutRadius:this.donutRadius,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new Ht({radius:t.radius,arc:t.arc,thickness:t.thickness,donutRadius:t.donutRadius,mode:t.mode,speed:t.speed?O(t.speed):void 0,spread:t.spread})}clone(){return new Ht({radius:this.radius,arc:this.arc,thickness:this.thickness,donutRadius:this.donutRadius,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}}class Zt{constructor(){this.type="point",this._m1=new et}update(t,e){}initialize(t){const e=Math.random(),i=Math.random(),s=e*Math.PI*2,r=Math.acos(2*i-1),n=Math.cbrt(Math.random()),a=Math.sin(s),o=Math.cos(s),h=Math.sin(r),c=Math.cos(r);t.velocity.x=n*h*o,t.velocity.y=n*h*a,t.velocity.z=n*c,t.velocity.multiplyScalar(t.startSpeed),t.position.setScalar(0),t.rotation instanceof A&&(this._m1.lookAt(xe,t.position,ge),t.rotation.setFromRotationMatrix(this._m1))}toJSON(){return{type:"point"}}static fromJSON(t){return new Zt}clone(){return new Zt}}class bt{constructor(t={}){this.type="sphere",this.currentValue=0,this.radius=t.radius??10,this.arc=t.arc??2*Math.PI,this.thickness=t.thickness??1,this.mode=t.mode??L.Random,this.spread=t.spread??0,this.speed=t.speed??new N(1),this.memory=[],this._m1=new et}update(t,e){L.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,t.emissionState.time/t.duration)*e)}initialize(t,e){const i=At(this.mode,this.currentValue,this.spread,e),s=Math.random(),r=Ot.lerp(1-this.thickness,1,Math.random()),n=i*this.arc,a=Math.acos(2*s-1),o=Math.sin(n),h=Math.cos(n),c=Math.sin(a),u=Math.cos(a);t.position.x=c*h,t.position.y=c*o,t.position.z=u,t.velocity.copy(t.position).multiplyScalar(t.startSpeed),t.position.multiplyScalar(this.radius*r),t.rotation instanceof A&&(this._m1.lookAt(xe,t.position,ge),t.rotation.setFromRotationMatrix(this._m1))}toJSON(){return{type:"sphere",radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new bt({radius:t.radius,arc:t.arc,thickness:t.thickness,mode:t.mode,speed:t.speed?O(t.speed):void 0,spread:t.spread})}clone(){return new bt({radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}}class Wt{constructor(t={}){this.type="hemisphere",this.currentValue=0,this.radius=t.radius??10,this.arc=t.arc??2*Math.PI,this.thickness=t.thickness??1,this.mode=t.mode??L.Random,this.spread=t.spread??0,this.speed=t.speed??new N(1),this.memory=[],this._m1=new et}update(t,e){L.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,t.emissionState.time/t.duration)*e)}initialize(t,e){const i=At(this.mode,this.currentValue,this.spread,e),s=Math.random(),r=Ot.lerp(1-this.thickness,1,Math.random()),n=i*this.arc,a=Math.acos(s),o=Math.sin(n),h=Math.cos(n),c=Math.sin(a),u=Math.cos(a);t.position.x=c*h,t.position.y=c*o,t.position.z=u,t.velocity.copy(t.position).multiplyScalar(t.startSpeed),t.position.multiplyScalar(this.radius*r),t.rotation instanceof A&&(this._m1.lookAt(xe,t.position,ge),t.rotation.setFromRotationMatrix(this._m1))}toJSON(){return{type:"hemisphere",radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new Wt({radius:t.radius,arc:t.arc,thickness:t.thickness,mode:t.mode,speed:t.speed?O(t.speed):void 0,spread:t.spread})}clone(){return new Wt({radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}}class Qt{constructor(t={}){this.type="grid",this.width=t.width??1,this.height=t.height??1,this.column=t.column??10,this.row=t.row??10}initialize(t){const e=Math.floor(Math.random()*this.row),i=Math.floor(Math.random()*this.column);t.position.x=i*this.width/this.column-this.width/2,t.position.y=e*this.height/this.row-this.height/2,t.position.z=0,t.velocity.set(0,0,t.startSpeed)}toJSON(){return{type:"grid",width:this.width,height:this.height,column:this.column,row:this.row}}static fromJSON(t){return new Qt(t)}clone(){return new Qt({width:this.width,height:this.height,column:this.column,row:this.row})}update(t,e){}}class Kt{constructor(t={}){this.type="rectangle",this.currentValue=0,this.width=t.width??10,this.height=t.height??10,this.thickness=t.thickness??1,this.mode=t.mode??L.Random,this.spread=t.spread??0,this.speed=t.speed??new N(1),this.memory=[],this._m1=new et}update(t,e){this.currentValue+=this.speed.genValue(this.memory,t.emissionState.time/t.duration)*e}initialize(t,e){const i=At(this.mode,this.currentValue,this.spread,e),s=2*(this.width+this.height),r=i*s;let n,a;r<this.width?(n=r-this.width/2,a=-this.height/2):r<this.width+this.height?(n=this.width/2,a=r-this.width-this.height/2):r<2*this.width+this.height?(n=this.width/2-(r-this.width-this.height),a=this.height/2):(n=-this.width/2,a=this.height/2-(r-2*this.width-this.height));const o=Math.random(),h=1-this.thickness*o;t.position.x=n*h,t.position.y=a*h,t.position.z=0,t.velocity.x=n,t.velocity.y=a,t.velocity.z=0,t.velocity.normalize().multiplyScalar(t.startSpeed),t.rotation instanceof A&&(this._m1.lookAt(xe,t.velocity,ge),t.rotation.setFromRotationMatrix(this._m1))}toJSON(){return{type:"rectangle",width:this.width,height:this.height,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new Kt({width:t.width,height:t.height,thickness:t.thickness,mode:t.mode,speed:t.speed?O(t.speed):void 0,spread:t.spread})}clone(){return new Kt({width:this.width,height:this.height,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}}const ti={circle:{type:"circle",params:[["radius",["number"]],["arc",["radian"]],["thickness",["number"]],["mode",["emitterMode"]],["spread",["number"]],["speed",["valueFunc","value"]]],constructor:Yt,loadJSON:Yt.fromJSON},cone:{type:"cone",params:[["radius",["number"]],["arc",["radian"]],["thickness",["number"]],["angle",["radian"]],["mode",["emitterMode"]],["spread",["number"]],["speed",["valueFunc","value"]]],constructor:qt,loadJSON:qt.fromJSON},donut:{type:"donut",params:[["radius",["number"]],["arc",["radian"]],["thickness",["number"]],["donutRadius",["number"]],["mode",["emitterMode"]],["spread",["number"]],["speed",["valueFunc","value"]]],constructor:Ht,loadJSON:Ht.fromJSON},point:{type:"point",params:[],constructor:Zt,loadJSON:Zt.fromJSON},sphere:{type:"sphere",params:[["radius",["number"]],["arc",["radian"]],["thickness",["number"]],["angle",["radian"]],["mode",["emitterMode"]],["spread",["number"]],["speed",["valueFunc","value"]]],constructor:bt,loadJSON:bt.fromJSON},hemisphere:{type:"hemisphere",params:[["radius",["number"]],["arc",["radian"]],["thickness",["number"]],["angle",["radian"]],["mode",["emitterMode"]],["spread",["number"]],["speed",["valueFunc","value"]]],constructor:Wt,loadJSON:Wt.fromJSON},grid:{type:"grid",params:[["width",["number"]],["height",["number"]],["rows",["number"]],["column",["number"]]],constructor:Qt,loadJSON:Qt.fromJSON},rectangle:{type:"rectangle",params:[["width",["number"]],["height",["number"]],["thickness",["number"]],["mode",["emitterMode"]],["spread",["number"]],["speed",["valueFunc","value"]]],constructor:Kt,loadJSON:Kt.fromJSON}};function ks(l,t){return ti[l.type].loadJSON(l,t)}class $t{constructor(t){this.color=t,this.type="ColorOverLife"}initialize(t){this.color.startGen(t.memory)}update(t,e){this.color.genColor(t.memory,t.color,t.age/t.life),t.color.x*=t.startColor.x,t.color.y*=t.startColor.y,t.color.z*=t.startColor.z,t.color.w*=t.startColor.w}frameUpdate(t){}toJSON(){return{type:this.type,color:this.color.toJSON()}}static fromJSON(t){return new $t(ri(t.color))}clone(){return new $t(this.color.clone())}reset(){}}class jt{constructor(t){this.angularVelocity=t,this.type="RotationOverLife"}initialize(t){typeof t.rotation=="number"&&this.angularVelocity.startGen(t.memory)}update(t,e){typeof t.rotation=="number"&&(t.rotation+=e*this.angularVelocity.genValue(t.memory,t.age/t.life))}toJSON(){return{type:this.type,angularVelocity:this.angularVelocity.toJSON()}}static fromJSON(t){return new jt(O(t.angularVelocity))}frameUpdate(t){}clone(){return new jt(this.angularVelocity.clone())}reset(){}}class te{constructor(t){this.angularVelocity=t,this.type="Rotation3DOverLife",this.tempQuat=new A,this.tempQuat2=new A}initialize(t){t.rotation instanceof A&&(t.angularVelocity=new A,this.angularVelocity.startGen(t.memory))}update(t,e){t.rotation instanceof A&&(this.angularVelocity.genValue(t.memory,this.tempQuat,e,t.age/t.life),t.rotation.multiply(this.tempQuat))}toJSON(){return{type:this.type,angularVelocity:this.angularVelocity.toJSON()}}static fromJSON(t){return new te(zi(t.angularVelocity))}frameUpdate(t){}clone(){return new te(this.angularVelocity.clone())}reset(){}}class ee{initialize(t,e){this.ps=e,this.x.startGen(t.memory),this.y.startGen(t.memory),this.z.startGen(t.memory)}constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.type="ForceOverLife",this._temp=new _,this._tempScale=new _,this._tempQ=new A}update(t,e){this._temp.set(this.x.genValue(t.memory,t.age/t.life),this.y.genValue(t.memory,t.age/t.life),this.z.genValue(t.memory,t.age/t.life)),this.ps.worldSpace?t.velocity.addScaledVector(this._temp,e):(this._temp.multiply(this._tempScale).applyQuaternion(this._tempQ),t.velocity.addScaledVector(this._temp,e))}toJSON(){return{type:this.type,x:this.x.toJSON(),y:this.y.toJSON(),z:this.z.toJSON()}}static fromJSON(t){return new ee(O(t.x),O(t.y),O(t.z))}frameUpdate(t){if(this.ps&&!this.ps.worldSpace){const e=this._temp,i=this._tempQ,s=this._tempScale;this.ps.emitter.matrixWorld.decompose(e,i,s),i.invert(),s.set(1/s.x,1/s.y,1/s.z)}}clone(){return new ee(this.x.clone(),this.y.clone(),this.z.clone())}reset(){}}class ie{initialize(t){this.size.startGen(t.memory)}constructor(t){this.size=t,this.type="SizeOverLife"}update(t){this.size instanceof vt?this.size.genValue(t.memory,t.size,t.age/t.life).multiply(t.startSize):t.size.copy(t.startSize).multiplyScalar(this.size.genValue(t.memory,t.age/t.life))}toJSON(){return{type:this.type,size:this.size.toJSON()}}static fromJSON(t){return new ie(Ae(t.size))}frameUpdate(t){}clone(){return new ie(this.size.clone())}reset(){}}class se{initialize(t){this.speed.startGen(t.memory)}constructor(t){this.speed=t,this.type="SpeedOverLife"}update(t){t.speedModifier=this.speed.genValue(t.memory,t.age/t.life)}toJSON(){return{type:this.type,speed:this.speed.toJSON()}}static fromJSON(t){return new se(O(t.speed))}frameUpdate(t){}clone(){return new se(this.speed.clone())}reset(){}}class re{constructor(t){this.frame=t,this.type="FrameOverLife"}initialize(t){this.frame.startGen(t.memory)}update(t,e){this.frame instanceof Dt&&(t.uvTile=this.frame.genValue(t.memory,t.age/t.life))}frameUpdate(t){}toJSON(){return{type:this.type,frame:this.frame.toJSON()}}static fromJSON(t){return new re(O(t.frame))}clone(){return new re(this.frame.clone())}reset(){}}class ne{constructor(t,e=new _(0,1,0)){this.orbitSpeed=t,this.axis=e,this.type="OrbitOverLife",this.temp=new _,this.rotation=new A}initialize(t){this.orbitSpeed.startGen(t.memory)}update(t,e){this.temp.copy(t.position).projectOnVector(this.axis),this.rotation.setFromAxisAngle(this.axis,this.orbitSpeed.genValue(t.memory,t.age/t.life)*e),t.position.sub(this.temp),t.position.applyQuaternion(this.rotation),t.position.add(this.temp)}frameUpdate(t){}toJSON(){return{type:this.type,orbitSpeed:this.orbitSpeed.toJSON(),axis:[this.axis.x,this.axis.y,this.axis.z]}}static fromJSON(t){return new ne(O(t.orbitSpeed),t.axis?new _(t.axis[0],t.axis[1],t.axis[2]):void 0)}clone(){return new ne(this.orbitSpeed.clone())}reset(){}}class Ze{constructor(t){this.data=t,this.next=null,this.prev=null}hasPrev(){return this.prev!==null}hasNext(){return this.next!==null}}class Fs{constructor(){this.length=0,this.head=this.tail=null}isEmpty(){return this.head===null}clear(){this.length=0,this.head=this.tail=null}front(){return this.head===null?null:this.head.data}back(){return this.tail===null?null:this.tail.data}dequeue(){if(this.head){const t=this.head.data;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}}pop(){if(this.tail){const t=this.tail.data;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}}queue(t){const e=new Ze(t);this.tail||(this.tail=e),this.head&&(this.head.prev=e,e.next=this.head),this.head=e,this.length++}push(t){const e=new Ze(t);this.head||(this.head=e),this.tail&&(this.tail.next=e,e.prev=this.tail),this.tail=e,this.length++}insertBefore(t,e){const i=new Ze(e);i.next=t,i.prev=t.prev,i.prev!==null&&(i.prev.next=i),i.next.prev=i,t==this.head&&(this.head=i),this.length++}remove(t){if(this.head===null||this.tail===null)return;let e=this.head;for(t===this.head.data&&(this.head=this.head.next),t===this.tail.data&&(this.tail=this.tail.prev);e.next!==null&&e.data!==t;)e=e.next;e.data===t&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.length--)}*values(){let t=this.head;for(;t!==null;)yield t.data,t=t.next}}class Is{constructor(){this.startSpeed=0,this.startColor=new G,this.startSize=new _(1,1,1),this.position=new _,this.velocity=new _,this.age=0,this.life=1,this.size=new _(1,1,1),this.speedModifier=1,this.rotation=0,this.color=new G,this.uvTile=0,this.memory=[]}get died(){return this.age>=this.life}reset(){this.memory.length=0}}class Ls{constructor(t,e,i){this.position=t,this.size=e,this.color=i}}class ei{constructor(){this.startSpeed=0,this.startColor=new G,this.startSize=new _(1,1,1),this.position=new _,this.velocity=new _,this.age=0,this.life=1,this.size=new _(1,1,1),this.length=100,this.speedModifier=1,this.color=new G,this.previous=new Fs,this.uvTile=0,this.memory=[]}update(){for(this.age<=this.life?this.previous.push(new Ls(this.position.clone(),this.size.x,this.color.clone())):this.previous.length>0&&this.previous.dequeue();this.previous.length>this.length;)this.previous.dequeue()}get died(){return this.age>=this.life}reset(){this.memory.length=0,this.previous.clear()}}class oe{initialize(t){this.width.startGen(t.memory)}constructor(t){this.width=t,this.type="WidthOverLength"}update(t){if(t instanceof ei){const e=t.previous.values();for(let i=0;i<t.previous.length;i++){const s=e.next();s.value.size=this.width.genValue(t.memory,(t.previous.length-i)/t.length)}}}frameUpdate(t){}toJSON(){return{type:this.type,width:this.width.toJSON()}}static fromJSON(t){return new oe(O(t.width))}clone(){return new oe(this.width.clone())}reset(){}}class ae{constructor(t,e){this.direction=t,this.magnitude=e,this.type="ApplyForce",this.memory={data:[],dataCount:0},this.magnitudeValue=this.magnitude.genValue(this.memory)}initialize(t){}update(t,e){t.velocity.addScaledVector(this.direction,this.magnitudeValue*e)}frameUpdate(t){this.magnitudeValue=this.magnitude.genValue(this.memory)}toJSON(){return{type:this.type,direction:[this.direction.x,this.direction.y,this.direction.z],magnitude:this.magnitude.toJSON()}}static fromJSON(t){return new ae(new _(t.direction[0],t.direction[1],t.direction[2]),O(t.magnitude??t.force))}clone(){return new ae(this.direction.clone(),this.magnitude.clone())}reset(){}}class he{constructor(t,e){this.center=t,this.magnitude=e,this.type="GravityForce",this.temp=new _}initialize(t){}update(t,e){this.temp.copy(this.center).sub(t.position).normalize(),t.velocity.addScaledVector(this.temp,this.magnitude/t.position.distanceToSquared(this.center)*e)}frameUpdate(t){}toJSON(){return{type:this.type,center:[this.center.x,this.center.y,this.center.z],magnitude:this.magnitude}}static fromJSON(t){return new he(new _(t.center[0],t.center[1],t.center[2]),t.magnitude)}clone(){return new he(this.center.clone(),this.magnitude)}reset(){}}class le{constructor(t){this.angle=t,this.type="ChangeEmitDirection",this._temp=new _,this._q=new A,this.memory={data:[],dataCount:0}}initialize(t){const e=t.velocity.length();e!=0&&(t.velocity.normalize(),t.velocity.x===0&&t.velocity.y===0?this._temp.set(0,t.velocity.z,0):this._temp.set(-t.velocity.y,t.velocity.x,0),this.angle.startGen(this.memory),this._q.setFromAxisAngle(this._temp.normalize(),this.angle.genValue(this.memory)),this._temp.copy(t.velocity),t.velocity.applyQuaternion(this._q),this._q.setFromAxisAngle(this._temp,Math.random()*Math.PI*2),t.velocity.applyQuaternion(this._q),t.velocity.setLength(e))}update(t,e){}frameUpdate(t){}toJSON(){return{type:this.type,angle:this.angle.toJSON()}}static fromJSON(t){return new le(O(t.angle))}clone(){return new le(this.angle)}reset(){}}var Mt;(function(l){l[l.Death=0]="Death",l[l.Birth=1]="Birth",l[l.Frame=2]="Frame"})(Mt||(Mt={}));class Tt{constructor(t,e,i,s=Mt.Frame,r=1){this.particleSystem=t,this.useVelocityAsBasis=e,this.subParticleSystem=i,this.mode=s,this.emitProbability=r,this.type="EmitSubParticleSystem",this.q_=new A,this.v_=new _,this.v2_=new _,this.subEmissions=new Array,this.subParticleSystem&&this.subParticleSystem.system&&(this.subParticleSystem.system.onlyUsedByOther=!0)}initialize(t){}update(t,e){this.mode===Mt.Frame?this.emit(t,e):this.mode===Mt.Birth&&t.age===0?this.emit(t,e):this.mode===Mt.Death&&t.age+e>=t.life&&this.emit(t,e)}emit(t,e){if(!this.subParticleSystem||Math.random()>this.emitProbability)return;const i=new et;this.setMatrixFromParticle(i,t),this.subEmissions.push({burstParticleCount:0,burstParticleIndex:0,isBursting:!1,burstIndex:0,burstWaveIndex:0,time:0,waitEmiting:0,matrix:i,travelDistance:0,particle:t})}frameUpdate(t){if(this.subParticleSystem)for(let e=0;e<this.subEmissions.length;e++)if(this.subEmissions[e].time>=this.subParticleSystem.system.duration)this.subEmissions[e]=this.subEmissions[this.subEmissions.length-1],this.subEmissions.length=this.subEmissions.length-1,e--;else{const i=this.subEmissions[e];i.particle&&i.particle.age<i.particle.life?this.setMatrixFromParticle(i.matrix,i.particle):i.particle=void 0,this.subParticleSystem.system.emit(t,i,i.matrix)}}toJSON(){return{type:this.type,subParticleSystem:this.subParticleSystem?this.subParticleSystem.uuid:"",useVelocityAsBasis:this.useVelocityAsBasis,mode:this.mode,emitProbability:this.emitProbability}}static fromJSON(t,e){return new Tt(e,t.useVelocityAsBasis,t.subParticleSystem,t.mode,t.emitProbability)}clone(){return new Tt(this.particleSystem,this.useVelocityAsBasis,this.subParticleSystem,this.mode,this.emitProbability)}reset(){}setMatrixFromParticle(t,e){let i;if(e.rotation===void 0||this.useVelocityAsBasis)if(e.velocity.x===0&&e.velocity.y===0&&(e.velocity.z===1||e.velocity.z===0))t.set(1,0,0,e.position.x,0,1,0,e.position.y,0,0,1,e.position.z,0,0,0,1);else{this.v_.copy(pi).cross(e.velocity),this.v2_.copy(e.velocity).cross(this.v_);const s=this.v_.length(),r=this.v2_.length();t.set(this.v_.x/s,this.v2_.x/r,e.velocity.x,e.position.x,this.v_.y/s,this.v2_.y/r,e.velocity.y,e.position.y,this.v_.z/s,this.v2_.z/r,e.velocity.z,e.position.z,0,0,0,1)}else e.rotation instanceof A?i=e.rotation:(this.q_.setFromAxisAngle(pi,e.rotation),i=this.q_),t.compose(e.position,i,Rs);this.particleSystem.worldSpace||t.multiplyMatrices(this.particleSystem.emitter.matrixWorld,t)}}const Vs=.5*(Math.sqrt(3)-1),It=(3-Math.sqrt(3))/6,Js=1/3,it=1/6,Ds=(Math.sqrt(5)-1)/4,F=(5-Math.sqrt(5))/20,k=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),B=new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]);class bi{constructor(t=Math.random){const e=typeof t=="function"?t:Xs(t);this.p=Gs(e),this.perm=new Uint8Array(512),this.permMod12=new Uint8Array(512);for(let i=0;i<512;i++)this.perm[i]=this.p[i&255],this.permMod12[i]=this.perm[i]%12}noise2D(t,e){const i=this.permMod12,s=this.perm;let r=0,n=0,a=0;const o=(t+e)*Vs,h=Math.floor(t+o),c=Math.floor(e+o),u=(h+c)*It,f=h-u,d=c-u,m=t-f,p=e-d;let y,x;m>p?(y=1,x=0):(y=0,x=1);const z=m-y+It,b=p-x+It,w=m-1+2*It,S=p-1+2*It,g=h&255,v=c&255;let T=.5-m*m-p*p;if(T>=0){const U=i[g+s[v]]*3;T*=T,r=T*T*(k[U]*m+k[U+1]*p)}let P=.5-z*z-b*b;if(P>=0){const U=i[g+y+s[v+x]]*3;P*=P,n=P*P*(k[U]*z+k[U+1]*b)}let E=.5-w*w-S*S;if(E>=0){const U=i[g+1+s[v+1]]*3;E*=E,a=E*E*(k[U]*w+k[U+1]*S)}return 70*(r+n+a)}noise3D(t,e,i){const s=this.permMod12,r=this.perm;let n,a,o,h;const c=(t+e+i)*Js,u=Math.floor(t+c),f=Math.floor(e+c),d=Math.floor(i+c),m=(u+f+d)*it,p=u-m,y=f-m,x=d-m,z=t-p,b=e-y,w=i-x;let S,g,v,T,P,E;z>=b?b>=w?(S=1,g=0,v=0,T=1,P=1,E=0):z>=w?(S=1,g=0,v=0,T=1,P=0,E=1):(S=0,g=0,v=1,T=1,P=0,E=1):b<w?(S=0,g=0,v=1,T=0,P=1,E=1):z<w?(S=0,g=1,v=0,T=0,P=1,E=1):(S=0,g=1,v=0,T=1,P=1,E=0);const U=z-S+it,V=b-g+it,Y=w-v+it,H=z-T+2*it,Z=b-P+2*it,W=w-E+2*it,Q=z-1+3*it,K=b-1+3*it,$=w-1+3*it,X=u&255,q=f&255,pt=d&255;let lt=.6-z*z-b*b-w*w;if(lt<0)n=0;else{const R=s[X+r[q+r[pt]]]*3;lt*=lt,n=lt*lt*(k[R]*z+k[R+1]*b+k[R+2]*w)}let ct=.6-U*U-V*V-Y*Y;if(ct<0)a=0;else{const R=s[X+S+r[q+g+r[pt+v]]]*3;ct*=ct,a=ct*ct*(k[R]*U+k[R+1]*V+k[R+2]*Y)}let ot=.6-H*H-Z*Z-W*W;if(ot<0)o=0;else{const R=s[X+T+r[q+P+r[pt+E]]]*3;ot*=ot,o=ot*ot*(k[R]*H+k[R+1]*Z+k[R+2]*W)}let at=.6-Q*Q-K*K-$*$;if(at<0)h=0;else{const R=s[X+1+r[q+1+r[pt+1]]]*3;at*=at,h=at*at*(k[R]*Q+k[R+1]*K+k[R+2]*$)}return 32*(n+a+o+h)}noise4D(t,e,i,s){const r=this.perm;let n,a,o,h,c;const u=(t+e+i+s)*Ds,f=Math.floor(t+u),d=Math.floor(e+u),m=Math.floor(i+u),p=Math.floor(s+u),y=(f+d+m+p)*F,x=f-y,z=d-y,b=m-y,w=p-y,S=t-x,g=e-z,v=i-b,T=s-w;let P=0,E=0,U=0,V=0;S>g?P++:E++,S>v?P++:U++,S>T?P++:V++,g>v?E++:U++,g>T?E++:V++,v>T?U++:V++;const Y=P>=3?1:0,H=E>=3?1:0,Z=U>=3?1:0,W=V>=3?1:0,Q=P>=2?1:0,K=E>=2?1:0,$=U>=2?1:0,X=V>=2?1:0,q=P>=1?1:0,pt=E>=1?1:0,lt=U>=1?1:0,ct=V>=1?1:0,ot=S-Y+F,at=g-H+F,R=v-Z+F,Ee=T-W+F,Ue=S-Q+2*F,Ce=g-K+2*F,Be=v-$+2*F,Re=T-X+2*F,ke=S-q+3*F,Fe=g-pt+3*F,Ie=v-lt+3*F,Le=T-ct+3*F,Ve=S-1+4*F,Je=g-1+4*F,De=v-1+4*F,Ge=T-1+4*F,Nt=f&255,Pt=d&255,Et=m&255,Ut=p&255;let Ct=.6-S*S-g*g-v*v-T*T;if(Ct<0)n=0;else{const C=r[Nt+r[Pt+r[Et+r[Ut]]]]%32*4;Ct*=Ct,n=Ct*Ct*(B[C]*S+B[C+1]*g+B[C+2]*v+B[C+3]*T)}let Bt=.6-ot*ot-at*at-R*R-Ee*Ee;if(Bt<0)a=0;else{const C=r[Nt+Y+r[Pt+H+r[Et+Z+r[Ut+W]]]]%32*4;Bt*=Bt,a=Bt*Bt*(B[C]*ot+B[C+1]*at+B[C+2]*R+B[C+3]*Ee)}let Rt=.6-Ue*Ue-Ce*Ce-Be*Be-Re*Re;if(Rt<0)o=0;else{const C=r[Nt+Q+r[Pt+K+r[Et+$+r[Ut+X]]]]%32*4;Rt*=Rt,o=Rt*Rt*(B[C]*Ue+B[C+1]*Ce+B[C+2]*Be+B[C+3]*Re)}let kt=.6-ke*ke-Fe*Fe-Ie*Ie-Le*Le;if(kt<0)h=0;else{const C=r[Nt+q+r[Pt+pt+r[Et+lt+r[Ut+ct]]]]%32*4;kt*=kt,h=kt*kt*(B[C]*ke+B[C+1]*Fe+B[C+2]*Ie+B[C+3]*Le)}let Ft=.6-Ve*Ve-Je*Je-De*De-Ge*Ge;if(Ft<0)c=0;else{const C=r[Nt+1+r[Pt+1+r[Et+1+r[Ut+1]]]]%32*4;Ft*=Ft,c=Ft*Ft*(B[C]*Ve+B[C+1]*Je+B[C+2]*De+B[C+3]*Ge)}return 27*(n+a+o+h+c)}}function Gs(l){const t=new Uint8Array(256);for(let e=0;e<256;e++)t[e]=e;for(let e=0;e<255;e++){const i=e+~~(l()*(256-e)),s=t[e];t[e]=t[i],t[i]=s}return t}function Xs(l){let t=0,e=0,i=0,s=1;const r=qs();return t=r(" "),e=r(" "),i=r(" "),t-=r(l),t<0&&(t+=1),e-=r(l),e<0&&(e+=1),i-=r(l),i<0&&(i+=1),function(){const n=2091639*t+s*23283064365386963e-26;return t=e,e=i,i=n-(s=n|0)}}function qs(){let l=4022871197;return function(t){t=t.toString();for(let e=0;e<t.length;e++){l+=t.charCodeAt(e);let i=.02519603282416938*l;l=i>>>0,i-=l,i*=l,l=i>>>0,i-=l,l+=i*4294967296}return(l>>>0)*23283064365386963e-26}}class ce{constructor(t,e,i,s){this.scale=t,this.octaves=e,this.velocityMultiplier=i,this.timeScale=s,this.type="TurbulenceField",this.generator=new bi,this.timeOffset=new _,this.temp=new _,this.temp2=new _,this.timeOffset.x=Math.random()/this.scale.x*this.timeScale.x,this.timeOffset.y=Math.random()/this.scale.y*this.timeScale.y,this.timeOffset.z=Math.random()/this.scale.z*this.timeScale.z}initialize(t){}update(t,e){const i=t.position.x/this.scale.x,s=t.position.y/this.scale.y,r=t.position.z/this.scale.z;this.temp.set(0,0,0);let n=1;for(let a=0;a<this.octaves;a++)this.temp2.set(this.generator.noise4D(i*n,s*n,r*n,this.timeOffset.x*n)/n,this.generator.noise4D(i*n,s*n,r*n,this.timeOffset.y*n)/n,this.generator.noise4D(i*n,s*n,r*n,this.timeOffset.z*n)/n),this.temp.add(this.temp2),n*=2;this.temp.multiply(this.velocityMultiplier),t.velocity.addScaledVector(this.temp,e)}toJSON(){return{type:this.type,scale:[this.scale.x,this.scale.y,this.scale.z],octaves:this.octaves,velocityMultiplier:[this.velocityMultiplier.x,this.velocityMultiplier.y,this.velocityMultiplier.z],timeScale:[this.timeScale.x,this.timeScale.y,this.timeScale.z]}}frameUpdate(t){this.timeOffset.x+=t*this.timeScale.x,this.timeOffset.y+=t*this.timeScale.y,this.timeOffset.z+=t*this.timeScale.z}static fromJSON(t){return new ce(new _(t.scale[0],t.scale[1],t.scale[2]),t.octaves,new _(t.velocityMultiplier[0],t.velocityMultiplier[1],t.velocityMultiplier[2]),new _(t.timeScale[0],t.timeScale[1],t.timeScale[2]))}clone(){return new ce(this.scale.clone(),this.octaves,this.velocityMultiplier.clone(),this.timeScale.clone())}reset(){}}const st=[],We=new _,Qe=new A;class ue{constructor(t,e,i=new N(1),s=new N(0)){if(this.frequency=t,this.power=e,this.positionAmount=i,this.rotationAmount=s,this.type="Noise",this.duration=0,st.length===0)for(let r=0;r<100;r++)st.push(new bi)}initialize(t){t.lastPosNoise=new _,typeof t.rotation=="number"?t.lastRotNoise=0:t.lastRotNoise=new A,t.generatorIndex=[_e(0,100),_e(0,100),_e(0,100),_e(0,100)],this.positionAmount.startGen(t.memory),this.rotationAmount.startGen(t.memory),this.frequency.startGen(t.memory),this.power.startGen(t.memory)}update(t,e){let i=this.frequency.genValue(t.memory,t.age/t.life),s=this.power.genValue(t.memory,t.age/t.life),r=this.positionAmount.genValue(t.memory,t.age/t.life),n=this.rotationAmount.genValue(t.memory,t.age/t.life);r>0&&t.lastPosNoise!==void 0&&(t.position.sub(t.lastPosNoise),We.set(st[t.generatorIndex[0]].noise2D(0,t.age*i)*s*r,st[t.generatorIndex[1]].noise2D(0,t.age*i)*s*r,st[t.generatorIndex[2]].noise2D(0,t.age*i)*s*r),t.position.add(We),t.lastPosNoise.copy(We)),n>0&&t.lastRotNoise!==void 0&&(typeof t.rotation=="number"?(t.rotation-=t.lastRotNoise,t.rotation+=st[t.generatorIndex[3]].noise2D(0,t.age*i)*Math.PI*s*n):(t.lastRotNoise.invert(),t.rotation.multiply(t.lastRotNoise),Qe.set(st[t.generatorIndex[0]].noise2D(0,t.age*i)*s*n,st[t.generatorIndex[1]].noise2D(0,t.age*i)*s*n,st[t.generatorIndex[2]].noise2D(0,t.age*i)*s*n,st[t.generatorIndex[3]].noise2D(0,t.age*i)*s*n).normalize(),t.rotation.multiply(Qe),t.lastRotNoise.copy(Qe)))}toJSON(){return{type:this.type,frequency:this.frequency.toJSON(),power:this.power.toJSON(),positionAmount:this.positionAmount.toJSON(),rotationAmount:this.rotationAmount.toJSON()}}frameUpdate(t){this.duration+=t}static fromJSON(t){return new ue(O(t.frequency),O(t.power),O(t.positionAmount),O(t.rotationAmount))}clone(){return new ue(this.frequency.clone(),this.power.clone(),this.positionAmount.clone(),this.rotationAmount.clone())}reset(){}}class de{constructor(t,e){this.color=t,this.speedRange=e,this.type="ColorBySpeed"}initialize(t){this.color.startGen(t.memory)}update(t,e){const i=(t.startSpeed-this.speedRange.a)/(this.speedRange.b-this.speedRange.a);this.color.genColor(t.memory,t.color,i),t.color.x*=t.startColor.x,t.color.y*=t.startColor.y,t.color.z*=t.startColor.z,t.color.w*=t.startColor.w}frameUpdate(t){}toJSON(){return{type:this.type,color:this.color.toJSON(),speedRange:this.speedRange.toJSON()}}static fromJSON(t){return new de(ri(t.color),xt.fromJSON(t.speedRange))}clone(){return new de(this.color.clone(),this.speedRange.clone())}reset(){}}class me{initialize(t){this.size.startGen(t.memory)}constructor(t,e){this.size=t,this.speedRange=e,this.type="SizeBySpeed"}update(t){const e=(t.startSpeed-this.speedRange.a)/(this.speedRange.b-this.speedRange.a);this.size instanceof vt?this.size.genValue(t.memory,t.size,e).multiply(t.startSize):t.size.copy(t.startSize).multiplyScalar(this.size.genValue(t.memory,e))}toJSON(){return{type:this.type,size:this.size.toJSON(),speedRange:this.speedRange.toJSON()}}static fromJSON(t){return new me(Ae(t.size),xt.fromJSON(t.speedRange))}frameUpdate(t){}clone(){return new me(this.size.clone(),this.speedRange.clone())}reset(){}}class fe{constructor(t,e){this.angularVelocity=t,this.speedRange=e,this.type="RotationBySpeed",this.tempQuat=new A}initialize(t){typeof t.rotation=="number"&&this.angularVelocity.startGen(t.memory)}update(t,e){if(typeof t.rotation=="number"){const i=(t.startSpeed-this.speedRange.a)/(this.speedRange.b-this.speedRange.a);t.rotation+=e*this.angularVelocity.genValue(t.memory,i)}}toJSON(){return{type:this.type,angularVelocity:this.angularVelocity.toJSON(),speedRange:this.speedRange.toJSON()}}static fromJSON(t){return new fe(O(t.angularVelocity),xt.fromJSON(t.speedRange))}frameUpdate(t){}clone(){return new fe(this.angularVelocity.clone(),this.speedRange.clone())}reset(){}}class pe{initialize(t){this.speed.startGen(t.memory)}constructor(t,e){this.speed=t,this.dampen=e,this.type="LimitSpeedOverLife"}update(t,e){let i=t.velocity.length(),s=this.speed.genValue(t.memory,t.age/t.life);if(i>s){const r=(i-s)/i;t.velocity.multiplyScalar(1-r*this.dampen*e*20)}}toJSON(){return{type:this.type,speed:this.speed.toJSON(),dampen:this.dampen}}static fromJSON(t){return new pe(O(t.speed),t.dampen)}frameUpdate(t){}clone(){return new pe(this.speed.clone(),this.dampen)}reset(){}}const Ne={ApplyForce:{type:"ApplyForce",constructor:ae,params:[["direction",["vec3"]],["magnitude",["value"]]],loadJSON:ae.fromJSON},Noise:{type:"Noise",constructor:ue,params:[["frequency",["value"]],["power",["value"]],["positionAmount",["value"]],["rotationAmount",["value"]]],loadJSON:ue.fromJSON},TurbulenceField:{type:"TurbulenceField",constructor:ce,params:[["scale",["vec3"]],["octaves",["number"]],["velocityMultiplier",["vec3"]],["timeScale",["vec3"]]],loadJSON:ce.fromJSON},GravityForce:{type:"GravityForce",constructor:he,params:[["center",["vec3"]],["magnitude",["number"]]],loadJSON:he.fromJSON},ColorOverLife:{type:"ColorOverLife",constructor:$t,params:[["color",["colorFunc"]]],loadJSON:$t.fromJSON},RotationOverLife:{type:"RotationOverLife",constructor:jt,params:[["angularVelocity",["value","valueFunc"]]],loadJSON:jt.fromJSON},Rotation3DOverLife:{type:"Rotation3DOverLife",constructor:te,params:[["angularVelocity",["rotationFunc"]]],loadJSON:te.fromJSON},SizeOverLife:{type:"SizeOverLife",constructor:ie,params:[["size",["value","valueFunc","vec3Func"]]],loadJSON:ie.fromJSON},ColorBySpeed:{type:"ColorBySpeed",constructor:de,params:[["color",["colorFunc"]],["speedRange",["range"]]],loadJSON:de.fromJSON},RotationBySpeed:{type:"RotationBySpeed",constructor:fe,params:[["angularVelocity",["value","valueFunc"]],["speedRange",["range"]]],loadJSON:fe.fromJSON},SizeBySpeed:{type:"SizeBySpeed",constructor:me,params:[["size",["value","valueFunc","vec3Func"]],["speedRange",["range"]]],loadJSON:me.fromJSON},SpeedOverLife:{type:"SpeedOverLife",constructor:se,params:[["speed",["value","valueFunc"]]],loadJSON:se.fromJSON},FrameOverLife:{type:"FrameOverLife",constructor:re,params:[["frame",["value","valueFunc"]]],loadJSON:re.fromJSON},ForceOverLife:{type:"ForceOverLife",constructor:ee,params:[["x",["value","valueFunc"]],["y",["value","valueFunc"]],["z",["value","valueFunc"]]],loadJSON:ee.fromJSON},OrbitOverLife:{type:"OrbitOverLife",constructor:ne,params:[["orbitSpeed",["value","valueFunc"]],["axis",["vec3"]]],loadJSON:ne.fromJSON},WidthOverLength:{type:"WidthOverLength",constructor:oe,params:[["width",["value","valueFunc"]]],loadJSON:oe.fromJSON},ChangeEmitDirection:{type:"ChangeEmitDirection",constructor:le,params:[["angle",["value"]]],loadJSON:le.fromJSON},EmitSubParticleSystem:{type:"EmitSubParticleSystem",constructor:Tt,params:[["particleSystem",["self"]],["useVelocityAsBasis",["boolean"]],["subParticleSystem",["particleSystem"]],["mode",["number"]],["emitProbability",["number"]]],loadJSON:Tt.fromJSON},LimitSpeedOverLife:{type:"LimitSpeedOverLife",constructor:pe,params:[["speed",["value","valueFunc"]],["dampen",["number"]]],loadJSON:pe.fromJSON}};function Ys(l,t){return Ne[l.type]?Ne[l.type].loadJSON(l,t):null}const Hs=[];function Zs(l){if(!Hs.find(e=>e.id===l.id)){for(const e of l.emitterShapes)ti[e.type]||(ti[e.type]=e);for(const e of l.behaviors)Ne[e.type]||(Ne[e.type]=e)}}class ye{get geometry(){return this._geometry}set geometry(t){if(this._geometry=t,t===void 0||typeof t=="string")return;const e=new ls;this._triangleIndexToArea.length=0;let i=0;if(!t.getIndex())return;const s=t.getIndex().array,r=s.length/3;this._triangleIndexToArea.push(0);for(let n=0;n<r;n++)e.setFromAttributeAndIndices(t.getAttribute("position"),s[n*3],s[n*3+1],s[n*3+2]),i+=e.getArea(),this._triangleIndexToArea.push(i);t.userData.triangleIndexToArea=this._triangleIndexToArea}constructor(t){this.type="mesh_surface",this._triangleIndexToArea=[],this._tempA=new Xe,this._tempB=new Xe,this._tempC=new Xe,t&&(this.geometry=t)}initialize(t){const e=this._geometry;if(!e||e.getIndex()===null){t.position.set(0,0,0),t.velocity.set(0,0,1).multiplyScalar(t.startSpeed);return}const i=this._triangleIndexToArea.length-1;let s=0,r=i;const n=Math.random()*this._triangleIndexToArea[i];for(;s+1<r;){const d=Math.floor((s+r)/2);n<this._triangleIndexToArea[d]?r=d:s=d}let a=Math.random(),o=Math.random();a+o>1&&(a=1-a,o=1-o);const h=e.getIndex().array[s*3],c=e.getIndex().array[s*3+1],u=e.getIndex().array[s*3+2],f=e.getAttribute("position");this._tempA.fromBufferAttribute(f,h),this._tempB.fromBufferAttribute(f,c),this._tempC.fromBufferAttribute(f,u),this._tempB.sub(this._tempA),this._tempC.sub(this._tempA),this._tempA.addScaledVector(this._tempB,a).addScaledVector(this._tempC,o),t.position.copy(this._tempA),this._tempA.copy(this._tempB).cross(this._tempC).normalize(),t.velocity.copy(this._tempA).normalize().multiplyScalar(t.startSpeed)}toJSON(){return{type:"mesh_surface",mesh:this._geometry?this._geometry.uuid:""}}static fromJSON(t,e){return new ye(e.geometries[t.geometry])}clone(){return new ye(this._geometry)}update(t,e){}}const Ws={id:"three.quarks",emitterShapes:[{type:"mesh_surface",params:[["geometry",["geometry"]]],constructor:ye,loadJSON:ye.fromJSON}],behaviors:[]};var Qs=`
2
+ #ifdef SOFT_PARTICLES
3
+
4
+ /* #ifdef LOGDEPTH
5
+ float distSample = linearize_depth_log(sampleDepth, near, far);
6
+ #else
7
+ float distSample = ortho ? linearize_depth_ortho(sampleDepth, near, far) : linearize_depth(sampleDepth, near, far);
8
+ #endif */
9
+
10
+ vec2 p2 = projPosition.xy / projPosition.w;
11
+
12
+ p2 = 0.5 * p2 + 0.5;
13
+
14
+ float readDepth = texture2D(depthTexture, p2.xy).r;
15
+ float viewDepth = linearize_depth(readDepth);
16
+
17
+ float softParticlesFade = saturate(SOFT_INV_FADE_DISTANCE * ((viewDepth - SOFT_NEAR_FADE) - linearDepth));
18
+
19
+ gl_FragColor *= softParticlesFade;
20
+
21
+ //gl_FragColor = vec4(softParticlesFade , 0, 0, 1);
22
+ #endif
23
+ `,Ks=`
24
+ #ifdef SOFT_PARTICLES
25
+
26
+ uniform sampler2D depthTexture;
27
+ uniform vec4 projParams;
28
+ uniform vec2 softParams;
29
+
30
+ varying vec4 projPosition;
31
+ varying float linearDepth;
32
+
33
+ #define SOFT_NEAR_FADE softParams.x
34
+ #define SOFT_INV_FADE_DISTANCE softParams.y
35
+
36
+ #define zNear projParams.x
37
+ #define zFar projParams.y
38
+
39
+ float linearize_depth(float d)
40
+ {
41
+ return (zFar * zNear) / (zFar - d * (zFar - zNear));
42
+ }
43
+
44
+ #endif
45
+ `,$s=`
46
+ #ifdef SOFT_PARTICLES
47
+ varying vec4 projPosition;
48
+ varying float linearDepth;
49
+ #endif
50
+ `,js=`
51
+ #ifdef SOFT_PARTICLES
52
+ projPosition = gl_Position;
53
+ linearDepth = -mvPosition.z;
54
+ #endif
55
+ `,tr=`
56
+ #ifdef USE_MAP
57
+ vec4 texelColor = texture2D( map, vUv);
58
+ #ifdef TILE_BLEND
59
+ texelColor = mix( texelColor, texture2D( map, vUvNext ), vUvBlend );
60
+ #endif
61
+ diffuseColor *= texelColor;
62
+ #endif
63
+ `,er=`
64
+ #if defined( USE_UV ) || defined( USE_ANISOTROPY )
65
+
66
+ varying vec2 vUv;
67
+ #ifdef TILE_BLEND
68
+ varying vec2 vUvNext;
69
+ varying float vUvBlend;
70
+ #endif
71
+
72
+ #endif
73
+ #ifdef USE_MAP
74
+
75
+ uniform mat3 mapTransform;
76
+ varying vec2 vMapUv;
77
+ #ifdef TILE_BLEND
78
+ varying vec2 vMapUvNext;
79
+ #endif
80
+
81
+ #endif
82
+ #ifdef USE_ALPHAMAP
83
+
84
+ uniform mat3 alphaMapTransform;
85
+ varying vec2 vAlphaMapUv;
86
+
87
+ #endif
88
+ #ifdef USE_LIGHTMAP
89
+
90
+ uniform mat3 lightMapTransform;
91
+ varying vec2 vLightMapUv;
92
+
93
+ #endif
94
+ #ifdef USE_AOMAP
95
+
96
+ uniform mat3 aoMapTransform;
97
+ varying vec2 vAoMapUv;
98
+
99
+ #endif
100
+ #ifdef USE_BUMPMAP
101
+
102
+ uniform mat3 bumpMapTransform;
103
+ varying vec2 vBumpMapUv;
104
+
105
+ #endif
106
+ #ifdef USE_NORMALMAP
107
+
108
+ uniform mat3 normalMapTransform;
109
+ varying vec2 vNormalMapUv;
110
+
111
+ #endif
112
+ #ifdef USE_DISPLACEMENTMAP
113
+
114
+ uniform mat3 displacementMapTransform;
115
+ varying vec2 vDisplacementMapUv;
116
+
117
+ #endif
118
+ #ifdef USE_EMISSIVEMAP
119
+
120
+ uniform mat3 emissiveMapTransform;
121
+ varying vec2 vEmissiveMapUv;
122
+
123
+ #endif
124
+ #ifdef USE_METALNESSMAP
125
+
126
+ uniform mat3 metalnessMapTransform;
127
+ varying vec2 vMetalnessMapUv;
128
+
129
+ #endif
130
+ #ifdef USE_ROUGHNESSMAP
131
+
132
+ uniform mat3 roughnessMapTransform;
133
+ varying vec2 vRoughnessMapUv;
134
+
135
+ #endif
136
+ #ifdef USE_ANISOTROPYMAP
137
+
138
+ uniform mat3 anisotropyMapTransform;
139
+ varying vec2 vAnisotropyMapUv;
140
+
141
+ #endif
142
+ #ifdef USE_CLEARCOATMAP
143
+
144
+ uniform mat3 clearcoatMapTransform;
145
+ varying vec2 vClearcoatMapUv;
146
+
147
+ #endif
148
+ #ifdef USE_CLEARCOAT_NORMALMAP
149
+
150
+ uniform mat3 clearcoatNormalMapTransform;
151
+ varying vec2 vClearcoatNormalMapUv;
152
+
153
+ #endif
154
+ #ifdef USE_CLEARCOAT_ROUGHNESSMAP
155
+
156
+ uniform mat3 clearcoatRoughnessMapTransform;
157
+ varying vec2 vClearcoatRoughnessMapUv;
158
+
159
+ #endif
160
+ #ifdef USE_SHEEN_COLORMAP
161
+
162
+ uniform mat3 sheenColorMapTransform;
163
+ varying vec2 vSheenColorMapUv;
164
+
165
+ #endif
166
+ #ifdef USE_SHEEN_ROUGHNESSMAP
167
+
168
+ uniform mat3 sheenRoughnessMapTransform;
169
+ varying vec2 vSheenRoughnessMapUv;
170
+
171
+ #endif
172
+ #ifdef USE_IRIDESCENCEMAP
173
+
174
+ uniform mat3 iridescenceMapTransform;
175
+ varying vec2 vIridescenceMapUv;
176
+
177
+ #endif
178
+ #ifdef USE_IRIDESCENCE_THICKNESSMAP
179
+
180
+ uniform mat3 iridescenceThicknessMapTransform;
181
+ varying vec2 vIridescenceThicknessMapUv;
182
+
183
+ #endif
184
+ #ifdef USE_SPECULARMAP
185
+
186
+ uniform mat3 specularMapTransform;
187
+ varying vec2 vSpecularMapUv;
188
+
189
+ #endif
190
+ #ifdef USE_SPECULAR_COLORMAP
191
+
192
+ uniform mat3 specularColorMapTransform;
193
+ varying vec2 vSpecularColorMapUv;
194
+
195
+ #endif
196
+ #ifdef USE_SPECULAR_INTENSITYMAP
197
+
198
+ uniform mat3 specularIntensityMapTransform;
199
+ varying vec2 vSpecularIntensityMapUv;
200
+
201
+ #endif
202
+ #ifdef USE_TRANSMISSIONMAP
203
+
204
+ uniform mat3 transmissionMapTransform;
205
+ varying vec2 vTransmissionMapUv;
206
+
207
+ #endif
208
+ #ifdef USE_THICKNESSMAP
209
+
210
+ uniform mat3 thicknessMapTransform;
211
+ varying vec2 vThicknessMapUv;
212
+
213
+ #endif
214
+ `,ir=`
215
+ #ifdef UV_TILE
216
+ attribute float uvTile;
217
+ uniform vec2 tileCount;
218
+
219
+ mat3 makeTileTransform(float uvTile) {
220
+ float col = mod(uvTile, tileCount.x);
221
+ float row = (tileCount.y - floor(uvTile / tileCount.x) - 1.0);
222
+
223
+ return mat3(
224
+ 1.0 / tileCount.x, 0.0, 0.0,
225
+ 0.0, 1.0 / tileCount.y, 0.0,
226
+ col / tileCount.x, row / tileCount.y, 1.0);
227
+ }
228
+ #else
229
+ mat3 makeTileTransform(float uvTile) {
230
+ return mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
231
+ }
232
+ #endif
233
+
234
+ #if defined( USE_UV ) || defined( USE_ANISOTROPY )
235
+
236
+ varying vec2 vUv;
237
+ #ifdef TILE_BLEND
238
+ varying vec2 vUvNext;
239
+ varying float vUvBlend;
240
+ #endif
241
+
242
+ #endif
243
+ #ifdef USE_MAP
244
+
245
+ uniform mat3 mapTransform;
246
+ varying vec2 vMapUv;
247
+ #ifdef TILE_BLEND
248
+ varying vec2 vMapUvNext;
249
+ #endif
250
+
251
+ #endif
252
+ #ifdef USE_ALPHAMAP
253
+
254
+ uniform mat3 alphaMapTransform;
255
+ varying vec2 vAlphaMapUv;
256
+
257
+ #endif
258
+ #ifdef USE_LIGHTMAP
259
+
260
+ uniform mat3 lightMapTransform;
261
+ varying vec2 vLightMapUv;
262
+
263
+ #endif
264
+ #ifdef USE_AOMAP
265
+
266
+ uniform mat3 aoMapTransform;
267
+ varying vec2 vAoMapUv;
268
+
269
+ #endif
270
+ #ifdef USE_BUMPMAP
271
+
272
+ uniform mat3 bumpMapTransform;
273
+ varying vec2 vBumpMapUv;
274
+
275
+ #endif
276
+ #ifdef USE_NORMALMAP
277
+
278
+ uniform mat3 normalMapTransform;
279
+ varying vec2 vNormalMapUv;
280
+
281
+ #endif
282
+ #ifdef USE_DISPLACEMENTMAP
283
+
284
+ uniform mat3 displacementMapTransform;
285
+ varying vec2 vDisplacementMapUv;
286
+
287
+ #endif
288
+ #ifdef USE_EMISSIVEMAP
289
+
290
+ uniform mat3 emissiveMapTransform;
291
+ varying vec2 vEmissiveMapUv;
292
+
293
+ #endif
294
+ #ifdef USE_METALNESSMAP
295
+
296
+ uniform mat3 metalnessMapTransform;
297
+ varying vec2 vMetalnessMapUv;
298
+
299
+ #endif
300
+ #ifdef USE_ROUGHNESSMAP
301
+
302
+ uniform mat3 roughnessMapTransform;
303
+ varying vec2 vRoughnessMapUv;
304
+
305
+ #endif
306
+ #ifdef USE_ANISOTROPYMAP
307
+
308
+ uniform mat3 anisotropyMapTransform;
309
+ varying vec2 vAnisotropyMapUv;
310
+
311
+ #endif
312
+ #ifdef USE_CLEARCOATMAP
313
+
314
+ uniform mat3 clearcoatMapTransform;
315
+ varying vec2 vClearcoatMapUv;
316
+
317
+ #endif
318
+ #ifdef USE_CLEARCOAT_NORMALMAP
319
+
320
+ uniform mat3 clearcoatNormalMapTransform;
321
+ varying vec2 vClearcoatNormalMapUv;
322
+
323
+ #endif
324
+ #ifdef USE_CLEARCOAT_ROUGHNESSMAP
325
+
326
+ uniform mat3 clearcoatRoughnessMapTransform;
327
+ varying vec2 vClearcoatRoughnessMapUv;
328
+
329
+ #endif
330
+ #ifdef USE_SHEEN_COLORMAP
331
+
332
+ uniform mat3 sheenColorMapTransform;
333
+ varying vec2 vSheenColorMapUv;
334
+
335
+ #endif
336
+ #ifdef USE_SHEEN_ROUGHNESSMAP
337
+
338
+ uniform mat3 sheenRoughnessMapTransform;
339
+ varying vec2 vSheenRoughnessMapUv;
340
+
341
+ #endif
342
+ #ifdef USE_IRIDESCENCEMAP
343
+
344
+ uniform mat3 iridescenceMapTransform;
345
+ varying vec2 vIridescenceMapUv;
346
+
347
+ #endif
348
+ #ifdef USE_IRIDESCENCE_THICKNESSMAP
349
+
350
+ uniform mat3 iridescenceThicknessMapTransform;
351
+ varying vec2 vIridescenceThicknessMapUv;
352
+
353
+ #endif
354
+ #ifdef USE_SPECULARMAP
355
+
356
+ uniform mat3 specularMapTransform;
357
+ varying vec2 vSpecularMapUv;
358
+
359
+ #endif
360
+ #ifdef USE_SPECULAR_COLORMAP
361
+
362
+ uniform mat3 specularColorMapTransform;
363
+ varying vec2 vSpecularColorMapUv;
364
+
365
+ #endif
366
+ #ifdef USE_SPECULAR_INTENSITYMAP
367
+
368
+ uniform mat3 specularIntensityMapTransform;
369
+ varying vec2 vSpecularIntensityMapUv;
370
+
371
+ #endif
372
+ #ifdef USE_TRANSMISSIONMAP
373
+
374
+ uniform mat3 transmissionMapTransform;
375
+ varying vec2 vTransmissionMapUv;
376
+
377
+ #endif
378
+ #ifdef USE_THICKNESSMAP
379
+
380
+ uniform mat3 thicknessMapTransform;
381
+ varying vec2 vThicknessMapUv;
382
+
383
+ #endif
384
+ `,sr=`
385
+ #ifdef UV_TILE
386
+ mat3 tileTransform = makeTileTransform(floor(uvTile));
387
+ #ifdef TILE_BLEND
388
+ mat3 nextTileTransform = makeTileTransform(ceil(uvTile));
389
+ vUvBlend = fract(uvTile);
390
+ #endif
391
+ #else
392
+ mat3 tileTransform = makeTileTransform(0.0);
393
+ #endif
394
+
395
+ #if defined( USE_UV ) || defined( USE_ANISOTROPY )
396
+
397
+ vUv = (tileTransform *vec3( uv, 1 )).xy;
398
+ #if defined( TILE_BLEND ) && defined( UV_TILE )
399
+ vUvNext = (nextTileTransform *vec3( uv, 1 )).xy;
400
+ #endif
401
+
402
+ #endif
403
+ #ifdef USE_MAP
404
+
405
+ vMapUv = ( tileTransform * (mapTransform * vec3( MAP_UV, 1 ) )).xy;
406
+ #if defined( TILE_BLEND ) && defined( UV_TILE )
407
+ vMapUvNext = (nextTileTransform * (mapTransform * vec3( MAP_UV, 1 ))).xy;
408
+ #endif
409
+
410
+ #endif
411
+ #ifdef USE_ALPHAMAP
412
+
413
+ vAlphaMapUv = ( tileTransform * (alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) )).xy;
414
+
415
+ #endif
416
+ #ifdef USE_LIGHTMAP
417
+
418
+ vLightMapUv = ( tileTransform * (lightMapTransform * vec3( LIGHTMAP_UV, 1 ) )).xy;
419
+
420
+ #endif
421
+ #ifdef USE_AOMAP
422
+
423
+ vAoMapUv = ( tileTransform * (aoMapTransform * vec3( AOMAP_UV, 1 ) )).xy;
424
+
425
+ #endif
426
+ #ifdef USE_BUMPMAP
427
+
428
+ vBumpMapUv = ( tileTransform * (bumpMapTransform * vec3( BUMPMAP_UV, 1 ) )).xy;
429
+
430
+ #endif
431
+ #ifdef USE_NORMALMAP
432
+
433
+ vNormalMapUv = ( tileTransform * (normalMapTransform * vec3( NORMALMAP_UV, 1 ) )).xy;
434
+
435
+ #endif
436
+ #ifdef USE_DISPLACEMENTMAP
437
+
438
+ vDisplacementMapUv = ( tileTransform * (displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) )).xy;
439
+
440
+ #endif
441
+ #ifdef USE_EMISSIVEMAP
442
+
443
+ vEmissiveMapUv = ( tileTransform * (emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) )).xy;
444
+
445
+ #endif
446
+ #ifdef USE_METALNESSMAP
447
+
448
+ vMetalnessMapUv = ( tileTransform * (metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) )).xy;
449
+
450
+ #endif
451
+ #ifdef USE_ROUGHNESSMAP
452
+
453
+ vRoughnessMapUv = ( tileTransform * (roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) )).xy;
454
+
455
+ #endif
456
+ #ifdef USE_ANISOTROPYMAP
457
+
458
+ vAnisotropyMapUv = ( tileTransform * (anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) )).xy;
459
+
460
+ #endif
461
+ #ifdef USE_CLEARCOATMAP
462
+
463
+ vClearcoatMapUv = ( tileTransform * (clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) )).xy;
464
+
465
+ #endif
466
+ #ifdef USE_CLEARCOAT_NORMALMAP
467
+
468
+ vClearcoatNormalMapUv = ( tileTransform * (clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) )).xy;
469
+
470
+ #endif
471
+ #ifdef USE_CLEARCOAT_ROUGHNESSMAP
472
+
473
+ vClearcoatRoughnessMapUv = ( tileTransform * (clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) )).xy;
474
+
475
+ #endif
476
+ #ifdef USE_IRIDESCENCEMAP
477
+
478
+ vIridescenceMapUv = ( tileTransform * (iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) )).xy;
479
+
480
+ #endif
481
+ #ifdef USE_IRIDESCENCE_THICKNESSMAP
482
+
483
+ vIridescenceThicknessMapUv = ( tileTransform * (iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) )).xy;
484
+
485
+ #endif
486
+ #ifdef USE_SHEEN_COLORMAP
487
+
488
+ vSheenColorMapUv = ( tileTransform * (sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) )).xy;
489
+
490
+ #endif
491
+ #ifdef USE_SHEEN_ROUGHNESSMAP
492
+
493
+ vSheenRoughnessMapUv = ( tileTransform * (sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) )).xy;
494
+
495
+ #endif
496
+ #ifdef USE_SPECULARMAP
497
+
498
+ vSpecularMapUv = ( tileTransform * (specularMapTransform * vec3( SPECULARMAP_UV, 1 ) )).xy;
499
+
500
+ #endif
501
+ #ifdef USE_SPECULAR_COLORMAP
502
+
503
+ vSpecularColorMapUv = ( tileTransform * (specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) )).xy;
504
+
505
+ #endif
506
+ #ifdef USE_SPECULAR_INTENSITYMAP
507
+
508
+ vSpecularIntensityMapUv = ( tileTransform * (specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) )).xy;
509
+
510
+ #endif
511
+ #ifdef USE_TRANSMISSIONMAP
512
+
513
+ vTransmissionMapUv = ( tileTransform * transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) )).xy;
514
+
515
+ #endif
516
+ #ifdef USE_THICKNESSMAP
517
+
518
+ vThicknessMapUv = ( tileTransform * thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) )).xy;
519
+
520
+ #endif
521
+
522
+ `;const mt=hs;function rr(){mt.tile_pars_vertex=ir,mt.tile_vertex=sr,mt.tile_pars_fragment=er,mt.tile_fragment=tr,mt.soft_pars_vertex=$s,mt.soft_vertex=js,mt.soft_pars_fragment=Ks,mt.soft_fragment=Qs}class nr extends si{constructor(t){super(),this.type="ParticleEmitter",this.system=t}clone(){const t=this.system.clone();return t.emitter.copy(this,!0),t.emitter}dispose(){}extractFromCache(t){const e=[];for(const i in t){const s=t[i];delete s.metadata,e.push(s)}return e}toJSON(t,e={}){const i=this.children;this.children=this.children.filter(r=>r.type!=="ParticleSystemPreview");const s=super.toJSON(t);return this.children=i,this.system!==null&&(s.object.ps=this.system.toJSON(t,e)),s}}var M;(function(l){l[l.BillBoard=0]="BillBoard",l[l.StretchedBillBoard=1]="StretchedBillBoard",l[l.Mesh=2]="Mesh",l[l.Trail=3]="Trail",l[l.HorizontalBillBoard=4]="HorizontalBillBoard",l[l.VerticalBillBoard=5]="VerticalBillBoard"})(M||(M={}));class Ti extends xi{constructor(t){super(),this.type="VFXBatch",this.maxParticles=1e3,this.systems=new Set;const e=new ze;e.mask=t.layers.mask;const i=t.material.clone();i.defines={},Object.assign(i.defines,t.material.defines),this.settings={instancingGeometry:t.instancingGeometry,renderMode:t.renderMode,renderOrder:t.renderOrder,material:i,uTileCount:t.uTileCount,vTileCount:t.vTileCount,blendTiles:t.blendTiles,softParticles:t.softParticles,softNearFade:t.softNearFade,softFarFade:t.softFarFade,layers:e},this.frustumCulled=!1,this.renderOrder=this.settings.renderOrder}addSystem(t){this.systems.add(t)}removeSystem(t){this.systems.delete(t)}applyDepthTexture(t){const e=this.material.uniforms.depthTexture;e&&e.value!==t&&(e.value=t,this.material.needsUpdate=!0)}getVisibleSystems(){return Array.from(this.systems).filter(t=>t.emitter.visible)}}const or=new _(0,0,1),Ke=new A,ar=new _,hr=new _;new _;const yi=60,we=new rs(1,1,1,1);class Pe{set time(t){this.emissionState.time=t}get time(){return this.emissionState.time}get layers(){return this.rendererSettings.layers}get texture(){return this.rendererSettings.material.map}set texture(t){this.rendererSettings.material.map=t,this.neededToUpdateRender=!0}get material(){return this.rendererSettings.material}set material(t){this.rendererSettings.material=t,this.neededToUpdateRender=!0}get uTileCount(){return this.rendererSettings.uTileCount}set uTileCount(t){this.rendererSettings.uTileCount=t,this.neededToUpdateRender=!0}get vTileCount(){return this.rendererSettings.vTileCount}set vTileCount(t){this.rendererSettings.vTileCount=t,this.neededToUpdateRender=!0}get blendTiles(){return this.rendererSettings.blendTiles}set blendTiles(t){this.rendererSettings.blendTiles=t,this.neededToUpdateRender=!0}get softParticles(){return this.rendererSettings.softParticles}set softParticles(t){this.rendererSettings.softParticles=t,this.neededToUpdateRender=!0}get softNearFade(){return this.rendererSettings.softNearFade}set softNearFade(t){this.rendererSettings.softNearFade=t,this.neededToUpdateRender=!0}get softFarFade(){return this.rendererSettings.softFarFade}set softFarFade(t){this.rendererSettings.softFarFade=t,this.neededToUpdateRender=!0}get instancingGeometry(){return this.rendererSettings.instancingGeometry}set instancingGeometry(t){this.restart(),this.particles.length=0,this.rendererSettings.instancingGeometry=t,this.neededToUpdateRender=!0}get renderMode(){return this.rendererSettings.renderMode}set renderMode(t){if(this.rendererSettings.renderMode!==t){let e=!1;switch(this.rendererSettings.renderMode===M.Trail&&(e=!0),this.rendererSettings.renderMode===M.Mesh&&(this.startRotation=new N(0)),t){case M.Trail:this.rendererEmitterSettings={startLength:new N(30),followLocalOrigin:!1},e=!0;break;case M.Mesh:this.rendererEmitterSettings={geometry:we},this.startRotation=new Xt(new _(0,1,0),new N(0));break;case M.StretchedBillBoard:this.rendererEmitterSettings={speedFactor:0,lengthFactor:2},this.rendererSettings.instancingGeometry=we;break;case M.BillBoard:case M.VerticalBillBoard:case M.HorizontalBillBoard:this.rendererEmitterSettings={},this.rendererSettings.instancingGeometry=we;break}this.rendererSettings.renderMode=t,e&&(this.restart(),this.particles.length=0),this.neededToUpdateRender=!0}}get renderOrder(){return this.rendererSettings.renderOrder}set renderOrder(t){this.rendererSettings.renderOrder=t,this.neededToUpdateRender=!0}get blending(){return this.rendererSettings.material.blending}set blending(t){this.rendererSettings.material.blending=t,this.neededToUpdateRender=!0}constructor(t){if(this.temp=new _,this.travelDistance=0,this.normalMatrix=new nt,this.memory=[],this.listeners={},this.firstTimeUpdate=!0,this.autoDestroy=t.autoDestroy===void 0?!1:t.autoDestroy,this.duration=t.duration??1,this.looping=t.looping===void 0?!0:t.looping,this.prewarm=t.prewarm===void 0?!1:t.prewarm,this.startLife=t.startLife??new N(5),this.startSpeed=t.startSpeed??new N(0),this.startRotation=t.startRotation??new N(0),this.startSize=t.startSize??new N(1),this.startColor=t.startColor??new zt(new G(1,1,1,1)),this.emissionOverTime=t.emissionOverTime??new N(10),this.emissionOverDistance=t.emissionOverDistance??new N(0),this.emissionBursts=t.emissionBursts??[],this.onlyUsedByOther=t.onlyUsedByOther??!1,this.emitterShape=t.shape??new bt,this.behaviors=t.behaviors??new Array,this.worldSpace=t.worldSpace??!1,this.rendererEmitterSettings=t.rendererEmitterSettings??{},t.renderMode===M.StretchedBillBoard){const e=this.rendererEmitterSettings;t.speedFactor!==void 0&&(e.speedFactor=t.speedFactor),e.speedFactor=e.speedFactor??0,e.lengthFactor=e.lengthFactor??0}this.rendererSettings={instancingGeometry:t.instancingGeometry??we,renderMode:t.renderMode??M.BillBoard,renderOrder:t.renderOrder??0,material:t.material,uTileCount:t.uTileCount??1,vTileCount:t.vTileCount??1,blendTiles:t.blendTiles??!1,softParticles:t.softParticles??!1,softNearFade:t.softNearFade??0,softFarFade:t.softFarFade??0,layers:t.layers??new ze},this.neededToUpdateRender=!0,this.particles=new Array,this.startTileIndex=t.startTileIndex||new N(0),this.emitter=new nr(this),this.paused=!1,this.particleNum=0,this.emissionState={isBursting:!1,burstParticleIndex:0,burstParticleCount:0,burstIndex:0,burstWaveIndex:0,time:0,waitEmiting:0,travelDistance:0},this.emissionBursts.forEach(e=>e.count.startGen(this.memory)),this.emissionOverDistance.startGen(this.memory),this.emitEnded=!1,this.markForDestroy=!1,this.prewarmed=!1}pause(){this.paused=!0}play(){this.paused=!1}stop(){this.restart(),this.pause()}spawn(t,e,i){Ke.setFromRotationMatrix(i);const s=ar,r=Ke,n=hr;i.decompose(s,r,n);for(let a=0;a<t;a++){for(e.burstParticleIndex=a,this.particleNum++;this.particles.length<this.particleNum;)this.rendererSettings.renderMode===M.Trail?this.particles.push(new ei):this.particles.push(new Is);const o=this.particles[this.particleNum-1];if(o.reset(),o.speedModifier=1,this.startColor.startGen(o.memory),this.startColor.genColor(o.memory,o.startColor,this.emissionState.time),o.color.copy(o.startColor),this.startSpeed.startGen(o.memory),o.startSpeed=this.startSpeed.genValue(o.memory,e.time/this.duration),this.startLife.startGen(o.memory),o.life=this.startLife.genValue(o.memory,e.time/this.duration),o.age=0,this.startSize.startGen(o.memory),this.startSize.type==="vec3function")this.startSize.genValue(o.memory,o.startSize,e.time/this.duration);else{const h=this.startSize.genValue(o.memory,e.time/this.duration);o.startSize.set(h,h,h)}if(this.startTileIndex.startGen(o.memory),o.uvTile=this.startTileIndex.genValue(o.memory),o.size.copy(o.startSize),this.rendererSettings.renderMode===M.Mesh||this.rendererSettings.renderMode===M.BillBoard||this.rendererSettings.renderMode===M.VerticalBillBoard||this.rendererSettings.renderMode===M.HorizontalBillBoard||this.rendererSettings.renderMode===M.StretchedBillBoard){const h=o;this.startRotation.startGen(o.memory),this.rendererSettings.renderMode===M.Mesh?(h.rotation instanceof A||(h.rotation=new A),this.startRotation.type==="rotation"?this.startRotation.genValue(o.memory,h.rotation,1,e.time/this.duration):h.rotation.setFromAxisAngle(or,this.startRotation.genValue(h.memory,e.time/this.duration))):this.startRotation.type==="rotation"?h.rotation=0:h.rotation=this.startRotation.genValue(h.memory,e.time/this.duration)}else if(this.rendererSettings.renderMode===M.Trail){const h=o;this.rendererEmitterSettings.startLength.startGen(h.memory),h.length=this.rendererEmitterSettings.startLength.genValue(h.memory,e.time/this.duration)}if(this.emitterShape.initialize(o,e),this.rendererSettings.renderMode===M.Trail&&this.rendererEmitterSettings.followLocalOrigin){const h=o;h.localPosition=new _().copy(h.position)}this.worldSpace?(o.position.applyMatrix4(i),o.startSize.multiply(n).abs(),o.size.copy(o.startSize),o.velocity.multiply(n).applyMatrix3(this.normalMatrix),o.rotation&&o.rotation instanceof A&&o.rotation.multiplyQuaternions(Ke,o.rotation)):this.onlyUsedByOther&&(o.parentMatrix=i);for(let h=0;h<this.behaviors.length;h++)this.behaviors[h].initialize(o,this)}}endEmit(){this.emitEnded=!0,this.autoDestroy&&(this.markForDestroy=!0),this.fire({type:"emitEnd",particleSystem:this})}dispose(){this._renderer&&this._renderer.deleteSystem(this),this.emitter.dispose(),this.emitter.parent&&this.emitter.parent.remove(this.emitter),this.fire({type:"destroy",particleSystem:this})}restart(){this.memory.length=0,this.paused=!1,this.particleNum=0,this.emissionState.isBursting=!1,this.emissionState.burstIndex=0,this.emissionState.burstWaveIndex=0,this.emissionState.time=0,this.emissionState.waitEmiting=0,this.behaviors.forEach(t=>{t.reset()}),this.emitEnded=!1,this.markForDestroy=!1,this.prewarmed=!1,this.emissionBursts.forEach(t=>t.count.startGen(this.memory)),this.emissionOverDistance.startGen(this.memory)}update(t){if(this.paused)return;let e=this.emitter;for(;e.parent;)e=e.parent;if(e.type!=="Scene"){this.dispose();return}if(this.firstTimeUpdate&&(this.firstTimeUpdate=!1,this.emitter.updateWorldMatrix(!0,!1)),this.emitEnded&&this.particleNum===0){this.markForDestroy&&this.emitter.parent&&this.dispose();return}if(this.looping&&this.prewarm&&!this.prewarmed){this.prewarmed=!0;for(let i=0;i<this.duration*yi;i++)this.update(1/yi)}t>.1&&(t=.1),this.neededToUpdateRender&&(this._renderer&&this._renderer.updateSystem(this),this.neededToUpdateRender=!1),this.onlyUsedByOther||this.emit(t,this.emissionState,this.emitter.matrixWorld),this.emitterShape.update(this,t);for(let i=0;i<this.behaviors.length;i++){this.behaviors[i].frameUpdate(t);for(let s=0;s<this.particleNum;s++)this.particles[s].died||this.behaviors[i].update(this.particles[s],t)}for(let i=0;i<this.particleNum;i++)this.rendererEmitterSettings.followLocalOrigin&&this.particles[i].localPosition?(this.particles[i].position.copy(this.particles[i].localPosition),this.particles[i].parentMatrix?this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix):this.particles[i].position.applyMatrix4(this.emitter.matrixWorld)):this.particles[i].position.addScaledVector(this.particles[i].velocity,t*this.particles[i].speedModifier),this.particles[i].age+=t;if(this.rendererSettings.renderMode===M.Trail)for(let i=0;i<this.particleNum;i++)this.particles[i].update();for(let i=0;i<this.particleNum;i++){const s=this.particles[i];s.died&&(!(s instanceof ei)||s.previous.length===0)&&(this.particles[i]=this.particles[this.particleNum-1],this.particles[this.particleNum-1]=s,this.particleNum--,i--,this.fire({type:"particleDied",particleSystem:this,particle:s}))}}emit(t,e,i){e.time>this.duration&&(this.looping?(e.time-=this.duration,e.burstIndex=0,this.behaviors.forEach(r=>{r.reset()})):!this.emitEnded&&!this.onlyUsedByOther&&this.endEmit()),this.normalMatrix.getNormalMatrix(i);const s=Math.ceil(e.waitEmiting);for(this.spawn(s,e,i),e.waitEmiting-=s;e.burstIndex<this.emissionBursts.length&&this.emissionBursts[e.burstIndex].time<=e.time;){if(Math.random()<this.emissionBursts[e.burstIndex].probability){const r=this.emissionBursts[e.burstIndex].count.genValue(this.memory,this.time);e.isBursting=!0,e.burstParticleCount=r,this.spawn(r,e,i),e.isBursting=!1}e.burstIndex++}if(!this.emitEnded&&(e.waitEmiting+=t*this.emissionOverTime.genValue(this.memory,e.time/this.duration),e.previousWorldPos!=null)){this.temp.set(i.elements[12],i.elements[13],i.elements[14]),e.travelDistance+=e.previousWorldPos.distanceTo(this.temp);const r=this.emissionOverDistance.genValue(this.memory,e.time/this.duration);if(e.travelDistance*r>0){const n=Math.floor(e.travelDistance*r);e.travelDistance-=n/r,e.waitEmiting+=n}}e.previousWorldPos===void 0&&(e.previousWorldPos=new _),e.previousWorldPos.set(i.elements[12],i.elements[13],i.elements[14]),e.time+=t}toJSON(t,e={}){if((t===void 0||typeof t=="string")&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}}),t.materials[this.rendererSettings.material.uuid]=this.rendererSettings.material.toJSON(t),e.useUrlForImage&&this.texture?.source!==void 0){const n=this.texture.source;t.images[n.uuid]={uuid:n.uuid,url:this.texture.image.url}}let s;this.renderMode===M.Trail?s={startLength:this.rendererEmitterSettings.startLength.toJSON(),followLocalOrigin:this.rendererEmitterSettings.followLocalOrigin}:this.renderMode===M.Mesh?s={}:this.renderMode===M.StretchedBillBoard?s={speedFactor:this.rendererEmitterSettings.speedFactor,lengthFactor:this.rendererEmitterSettings.lengthFactor}:s={};const r=this.rendererSettings.instancingGeometry;return t.geometries&&!t.geometries[r.uuid]&&(t.geometries[r.uuid]=r.toJSON()),{version:"3.0",autoDestroy:this.autoDestroy,looping:this.looping,prewarm:this.prewarm,duration:this.duration,shape:this.emitterShape.toJSON(),startLife:this.startLife.toJSON(),startSpeed:this.startSpeed.toJSON(),startRotation:this.startRotation.toJSON(),startSize:this.startSize.toJSON(),startColor:this.startColor.toJSON(),emissionOverTime:this.emissionOverTime.toJSON(),emissionOverDistance:this.emissionOverDistance.toJSON(),emissionBursts:this.emissionBursts.map(n=>({time:n.time,count:n.count.toJSON(),probability:n.probability,interval:n.interval,cycle:n.cycle})),onlyUsedByOther:this.onlyUsedByOther,instancingGeometry:this.rendererSettings.instancingGeometry.uuid,renderOrder:this.renderOrder,renderMode:this.renderMode,rendererEmitterSettings:s,material:this.rendererSettings.material.uuid,layers:this.layers.mask,startTileIndex:this.startTileIndex.toJSON(),uTileCount:this.uTileCount,vTileCount:this.vTileCount,blendTiles:this.blendTiles,softParticles:this.rendererSettings.softParticles,softFarFade:this.rendererSettings.softFarFade,softNearFade:this.rendererSettings.softNearFade,behaviors:this.behaviors.map(n=>n.toJSON()),worldSpace:this.worldSpace}}static fromJSON(t,e,i){const s=ks(t.shape,e);let r;if(t.renderMode===M.Trail){const o=t.rendererEmitterSettings;r={startLength:o.startLength!=null?O(o.startLength):new N(30),followLocalOrigin:o.followLocalOrigin}}else t.renderMode===M.Mesh?r={}:t.renderMode===M.StretchedBillBoard?(r=t.rendererEmitterSettings,t.speedFactor!=null&&(r.speedFactor=t.speedFactor)):r={};const n=new ze;t.layers&&(n.mask=t.layers);const a=new Pe({autoDestroy:t.autoDestroy,looping:t.looping,prewarm:t.prewarm,duration:t.duration,shape:s,startLife:O(t.startLife),startSpeed:O(t.startSpeed),startRotation:Ae(t.startRotation),startSize:Ae(t.startSize),startColor:ri(t.startColor),emissionOverTime:O(t.emissionOverTime),emissionOverDistance:O(t.emissionOverDistance),emissionBursts:t.emissionBursts?.map(o=>({time:o.time,count:typeof o.count=="number"?new N(o.count):O(o.count),probability:o.probability??1,interval:o.interval??.1,cycle:o.cycle??1})),onlyUsedByOther:t.onlyUsedByOther,instancingGeometry:e.geometries[t.instancingGeometry],renderMode:t.renderMode,rendererEmitterSettings:r,renderOrder:t.renderOrder,layers:n,material:t.material?e.materials[t.material]:t.texture?new hi({map:e.textures[t.texture],transparent:t.transparent??!0,blending:t.blending,side:li}):new hi({color:16777215,transparent:!0,blending:gi,side:li}),startTileIndex:typeof t.startTileIndex=="number"?new N(t.startTileIndex):O(t.startTileIndex),uTileCount:t.uTileCount,vTileCount:t.vTileCount,blendTiles:t.blendTiles,softParticles:t.softParticles,softFarFade:t.softFarFade,softNearFade:t.softNearFade,behaviors:[],worldSpace:t.worldSpace});return a.behaviors=t.behaviors.map(o=>{const h=Ys(o,a);return h&&h.type==="EmitSubParticleSystem"&&(i[o.subParticleSystem]=h),h}).filter(o=>o!==null),a}addBehavior(t){this.behaviors.push(t)}getRendererSettings(){return this.rendererSettings}addEventListener(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)}removeAllEventListeners(t){this.listeners[t]&&(this.listeners[t]=[])}removeEventListener(t,e){if(this.listeners[t]){const i=this.listeners[t].indexOf(e);i!==-1&&this.listeners[t].splice(i,1)}}fire(t){this.listeners[t.type]&&this.listeners[t.type].forEach(e=>e(t))}clone(){const t=[];for(const r of this.emissionBursts){const n={};Object.assign(n,r),t.push(n)}const e=[];for(const r of this.behaviors)e.push(r.clone());let i;this.renderMode===M.Trail?i={startLength:this.rendererEmitterSettings.startLength.clone(),followLocalOrigin:this.rendererEmitterSettings.followLocalOrigin}:this.renderMode===M.StretchedBillBoard?i={lengthFactor:this.rendererEmitterSettings.lengthFactor,speedFactor:this.rendererEmitterSettings.speedFactor}:i={};const s=new ze;return s.mask=this.layers.mask,new Pe({autoDestroy:this.autoDestroy,looping:this.looping,duration:this.duration,shape:this.emitterShape.clone(),startLife:this.startLife.clone(),startSpeed:this.startSpeed.clone(),startRotation:this.startRotation.clone(),startSize:this.startSize.clone(),startColor:this.startColor.clone(),emissionOverTime:this.emissionOverTime.clone(),emissionOverDistance:this.emissionOverDistance.clone(),emissionBursts:t,onlyUsedByOther:this.onlyUsedByOther,instancingGeometry:this.rendererSettings.instancingGeometry,renderMode:this.renderMode,renderOrder:this.renderOrder,rendererEmitterSettings:i,material:this.rendererSettings.material,startTileIndex:this.startTileIndex,uTileCount:this.uTileCount,vTileCount:this.vTileCount,blendTiles:this.blendTiles,softParticles:this.softParticles,softFarFade:this.softFarFade,softNearFade:this.softNearFade,behaviors:e,worldSpace:this.worldSpace,layers:s})}}var $e=`
523
+
524
+ #include <common>
525
+ #include <color_pars_fragment>
526
+ #include <map_pars_fragment>
527
+ #include <logdepthbuf_pars_fragment>
528
+ #include <clipping_planes_pars_fragment>
529
+ #include <alphatest_pars_fragment>
530
+
531
+ #include <tile_pars_fragment>
532
+ #include <soft_pars_fragment>
533
+
534
+ void main() {
535
+
536
+ #include <clipping_planes_fragment>
537
+
538
+ vec3 outgoingLight = vec3( 0.0 );
539
+ vec4 diffuseColor = vColor;
540
+
541
+ #include <logdepthbuf_fragment>
542
+
543
+ #include <tile_fragment>
544
+ #include <alphatest_fragment>
545
+
546
+ outgoingLight = diffuseColor.rgb;
547
+
548
+ #ifdef USE_COLOR_AS_ALPHA
549
+ gl_FragColor = vec4( outgoingLight, diffuseColor.r );
550
+ #else
551
+ gl_FragColor = vec4( outgoingLight, diffuseColor.a );
552
+ #endif
553
+
554
+ #include <soft_fragment>
555
+ #include <tonemapping_fragment>
556
+ }
557
+ `,ni=`
558
+ #define STANDARD
559
+
560
+ #ifdef PHYSICAL
561
+ #define IOR
562
+ #define USE_SPECULAR
563
+ #endif
564
+
565
+ uniform vec3 diffuse;
566
+ uniform vec3 emissive;
567
+ uniform float roughness;
568
+ uniform float metalness;
569
+ uniform float opacity;
570
+
571
+ #ifdef IOR
572
+ uniform float ior;
573
+ #endif
574
+
575
+ #ifdef USE_SPECULAR
576
+ uniform float specularIntensity;
577
+ uniform vec3 specularColor;
578
+
579
+ #ifdef USE_SPECULAR_COLORMAP
580
+ uniform sampler2D specularColorMap;
581
+ #endif
582
+
583
+ #ifdef USE_SPECULAR_INTENSITYMAP
584
+ uniform sampler2D specularIntensityMap;
585
+ #endif
586
+ #endif
587
+
588
+ #ifdef USE_CLEARCOAT
589
+ uniform float clearcoat;
590
+ uniform float clearcoatRoughness;
591
+ #endif
592
+
593
+ #ifdef USE_DISPERSION
594
+ uniform float dispersion;
595
+ #endif
596
+
597
+ #ifdef USE_IRIDESCENCE
598
+ uniform float iridescence;
599
+ uniform float iridescenceIOR;
600
+ uniform float iridescenceThicknessMinimum;
601
+ uniform float iridescenceThicknessMaximum;
602
+ #endif
603
+
604
+ #ifdef USE_SHEEN
605
+ uniform vec3 sheenColor;
606
+ uniform float sheenRoughness;
607
+
608
+ #ifdef USE_SHEEN_COLORMAP
609
+ uniform sampler2D sheenColorMap;
610
+ #endif
611
+
612
+ #ifdef USE_SHEEN_ROUGHNESSMAP
613
+ uniform sampler2D sheenRoughnessMap;
614
+ #endif
615
+ #endif
616
+
617
+ #ifdef USE_ANISOTROPY
618
+ uniform vec2 anisotropyVector;
619
+
620
+ #ifdef USE_ANISOTROPYMAP
621
+ uniform sampler2D anisotropyMap;
622
+ #endif
623
+ #endif
624
+
625
+ varying vec3 vViewPosition;
626
+
627
+ #include <common>
628
+ #include <packing>
629
+ #include <dithering_pars_fragment>
630
+ #include <color_pars_fragment>
631
+ #include <uv_pars_fragment>
632
+ #include <map_pars_fragment>
633
+ #include <alphamap_pars_fragment>
634
+ #include <alphatest_pars_fragment>
635
+ #include <alphahash_pars_fragment>
636
+ #include <aomap_pars_fragment>
637
+ #include <lightmap_pars_fragment>
638
+ #include <emissivemap_pars_fragment>
639
+ #include <iridescence_fragment>
640
+ #include <cube_uv_reflection_fragment>
641
+ #include <envmap_common_pars_fragment>
642
+ #include <envmap_physical_pars_fragment>
643
+ #include <fog_pars_fragment>
644
+ #include <lights_pars_begin>
645
+ #include <normal_pars_fragment>
646
+ #include <lights_physical_pars_fragment>
647
+ #include <transmission_pars_fragment>
648
+ #include <shadowmap_pars_fragment>
649
+ #include <bumpmap_pars_fragment>
650
+ #include <normalmap_pars_fragment>
651
+ #include <clearcoat_pars_fragment>
652
+ #include <iridescence_pars_fragment>
653
+ #include <roughnessmap_pars_fragment>
654
+ #include <metalnessmap_pars_fragment>
655
+ #include <logdepthbuf_pars_fragment>
656
+ #include <clipping_planes_pars_fragment>
657
+
658
+ void main() {
659
+
660
+ vec4 diffuseColor = vec4( diffuse, opacity );
661
+ #include <clipping_planes_fragment>
662
+
663
+ ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
664
+ vec3 totalEmissiveRadiance = emissive;
665
+
666
+ #include <logdepthbuf_fragment>
667
+ #include <map_fragment>
668
+ #include <color_fragment>
669
+ #include <alphamap_fragment>
670
+ #include <alphatest_fragment>
671
+ #include <alphahash_fragment>
672
+ #include <roughnessmap_fragment>
673
+ #include <metalnessmap_fragment>
674
+ #include <normal_fragment_begin>
675
+ #include <normal_fragment_maps>
676
+ #include <clearcoat_normal_fragment_begin>
677
+ #include <clearcoat_normal_fragment_maps>
678
+ #include <emissivemap_fragment>
679
+
680
+ // accumulation
681
+ #include <lights_physical_fragment>
682
+ #include <lights_fragment_begin>
683
+ #include <lights_fragment_maps>
684
+ #include <lights_fragment_end>
685
+
686
+ // modulation
687
+ #include <aomap_fragment>
688
+
689
+ vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
690
+ vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
691
+
692
+ #include <transmission_fragment>
693
+
694
+ vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
695
+
696
+ #ifdef USE_SHEEN
697
+
698
+ // Sheen energy compensation approximation calculation can be found at the end of
699
+ // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing
700
+ float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
701
+
702
+ outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
703
+
704
+ #endif
705
+
706
+ #ifdef USE_CLEARCOAT
707
+
708
+ float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
709
+
710
+ vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
711
+
712
+ outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
713
+
714
+ #endif
715
+
716
+ #include <opaque_fragment>
717
+ #include <tonemapping_fragment>
718
+ #include <colorspace_fragment>
719
+ #include <fog_fragment>
720
+ #include <premultiplied_alpha_fragment>
721
+ #include <dithering_fragment>
722
+ }`,lr=`
723
+ #include <common>
724
+ #include <color_pars_vertex>
725
+ #include <logdepthbuf_pars_vertex>
726
+ #include <clipping_planes_pars_vertex>
727
+
728
+ #include <tile_pars_vertex>
729
+ #include <soft_pars_vertex>
730
+
731
+ attribute vec3 offset;
732
+ attribute float rotation;
733
+ attribute vec3 size;
734
+
735
+ void main() {
736
+
737
+ vec2 alignedPosition = position.xy * size.xy;
738
+
739
+ vec2 rotatedPosition;
740
+ rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
741
+ rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
742
+ #ifdef HORIZONTAL
743
+ vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );
744
+ mvPosition.x += rotatedPosition.x;
745
+ mvPosition.z -= rotatedPosition.y;
746
+ mvPosition = viewMatrix * mvPosition;
747
+ #elif defined(VERTICAL)
748
+ vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );
749
+ mvPosition.y += rotatedPosition.y;
750
+ mvPosition = viewMatrix * mvPosition;
751
+ mvPosition.x += rotatedPosition.x;
752
+ #else
753
+ vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );
754
+ mvPosition.xy += rotatedPosition;
755
+ #endif
756
+
757
+ vColor = color;
758
+
759
+ gl_Position = projectionMatrix * mvPosition;
760
+
761
+ #include <logdepthbuf_vertex>
762
+
763
+ #include <clipping_planes_vertex>
764
+
765
+ #include <tile_vertex>
766
+ #include <soft_vertex>
767
+ }
768
+ `,cr=`
769
+ #include <common>
770
+ #include <color_pars_vertex>
771
+ #include <logdepthbuf_pars_vertex>
772
+ #include <clipping_planes_pars_vertex>
773
+ #include <tile_pars_vertex>
774
+ #include <soft_pars_vertex>
775
+
776
+ attribute vec3 offset;
777
+ attribute vec4 rotation;
778
+ attribute vec3 size;
779
+ // attribute vec4 color;
780
+
781
+ void main() {
782
+
783
+ float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;
784
+ float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;
785
+ float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;
786
+ float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;
787
+ float sx = size.x, sy = size.y, sz = size.z;
788
+
789
+ mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column
790
+ ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column
791
+ ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column
792
+ offset.x, offset.y, offset.z, 1.0);
793
+
794
+ vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));
795
+
796
+ vColor = color;
797
+
798
+ gl_Position = projectionMatrix * mvPosition;
799
+
800
+ #include <logdepthbuf_vertex>
801
+ #include <clipping_planes_vertex>
802
+ #include <tile_vertex>
803
+ #include <soft_vertex>
804
+ }
805
+ `,oi=`
806
+ #define STANDARD
807
+ varying vec3 vViewPosition;
808
+ #ifdef USE_TRANSMISSION
809
+ varying vec3 vWorldPosition;
810
+ #endif
811
+ #include <common>
812
+
813
+ attribute vec3 offset;
814
+ attribute vec4 rotation;
815
+ attribute vec3 size;
816
+ #include <tile_pars_vertex>
817
+ #include <displacementmap_pars_vertex>
818
+ #include <color_pars_vertex>
819
+ #include <fog_pars_vertex>
820
+ #include <normal_pars_vertex>
821
+ #include <morphtarget_pars_vertex>
822
+ #include <skinning_pars_vertex>
823
+ #include <shadowmap_pars_vertex>
824
+ #include <logdepthbuf_pars_vertex>
825
+ #include <clipping_planes_pars_vertex>
826
+
827
+ void main() {
828
+
829
+ #include <tile_vertex>
830
+ float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;
831
+ float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;
832
+ float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;
833
+ float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;
834
+ float sx = size.x, sy = size.y, sz = size.z;
835
+
836
+ mat4 particleMatrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column
837
+ ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column
838
+ ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column
839
+ offset.x, offset.y, offset.z, 1.0);
840
+
841
+ #include <color_vertex>
842
+ #include <morphinstance_vertex>
843
+ #include <morphcolor_vertex>
844
+ #include <batching_vertex>
845
+
846
+ #include <beginnormal_vertex>
847
+ #include <morphnormal_vertex>
848
+ #include <skinbase_vertex>
849
+ #include <skinnormal_vertex>
850
+
851
+ // replace defaultnormal_vertex
852
+ vec3 transformedNormal = objectNormal;
853
+ mat3 m = mat3( particleMatrix );
854
+ transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
855
+ transformedNormal = m * transformedNormal;
856
+ transformedNormal = normalMatrix * transformedNormal;
857
+ #ifdef FLIP_SIDED
858
+ transformedNormal = - transformedNormal;
859
+ #endif
860
+ #ifdef USE_TANGENT
861
+ vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
862
+ #ifdef FLIP_SIDED
863
+ transformedTangent = - transformedTangent;
864
+ #endif
865
+ #endif
866
+
867
+ #include <normal_vertex>
868
+ #include <begin_vertex>
869
+ #include <morphtarget_vertex>
870
+ #include <skinning_vertex>
871
+ #include <displacementmap_vertex>
872
+
873
+ // replace include <project_vertex>
874
+ vec4 mvPosition = vec4( transformed, 1.0 );
875
+ mvPosition = modelViewMatrix * (particleMatrix * mvPosition);
876
+ gl_Position = projectionMatrix * mvPosition;
877
+
878
+ #include <logdepthbuf_vertex>
879
+ #include <clipping_planes_vertex>
880
+
881
+ vViewPosition = - mvPosition.xyz;
882
+
883
+ #include <worldpos_vertex>
884
+ #include <shadowmap_vertex>
885
+ #include <fog_vertex>
886
+ #ifdef USE_TRANSMISSION
887
+ vWorldPosition = worldPosition.xyz;
888
+ #endif
889
+ }
890
+ `,ur=`
891
+ #include <common>
892
+ #include <color_pars_vertex>
893
+ #include <logdepthbuf_pars_vertex>
894
+ #include <clipping_planes_pars_vertex>
895
+
896
+ #include <tile_pars_vertex>
897
+ #include <soft_pars_vertex>
898
+
899
+ attribute vec3 offset;
900
+ attribute float rotation;
901
+ attribute vec3 size;
902
+ attribute vec4 velocity;
903
+
904
+ uniform float speedFactor;
905
+
906
+ void main() {
907
+ float lengthFactor = velocity.w;
908
+ float avgSize = (size.x + size.y) * 0.5;
909
+ #ifdef USE_SKEW
910
+ vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );
911
+ vec3 viewVelocity = normalMatrix * velocity.xyz;
912
+
913
+ vec3 scaledPos = vec3(position.xy * size.xy, position.z);
914
+ float vlength = length(viewVelocity);
915
+ vec3 projVelocity = dot(scaledPos, viewVelocity) * viewVelocity / vlength;
916
+ mvPosition.xyz += scaledPos + projVelocity * (speedFactor / avgSize + lengthFactor / vlength);
917
+ #else
918
+ vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );
919
+ vec3 viewVelocity = normalMatrix * velocity.xyz;
920
+ float vlength = length(viewVelocity);
921
+ mvPosition.xyz += position.y * normalize(cross(mvPosition.xyz, viewVelocity)) * avgSize; // switch the cross to match unity implementation
922
+ mvPosition.xyz -= (position.x + 0.5) * viewVelocity * (1.0 + lengthFactor / vlength) * avgSize; // minus position.x to match unity implementation
923
+ #endif
924
+ vColor = color;
925
+ gl_Position = projectionMatrix * mvPosition;
926
+ #include <logdepthbuf_vertex>
927
+ #include <clipping_planes_vertex>
928
+ #include <tile_vertex>
929
+ #include <soft_vertex>
930
+ }
931
+ `;function ii(l){return l===0?"uv":`uv${l}`}class dr extends Pi{constructor(t){super(t)}onBeforeCompile(t,e){super.onBeforeCompile(t,e),t.vertexShader=oi,t.fragmentShader=ni}}class mr extends Ei{constructor(t){super(t)}onBeforeCompile(t,e){super.onBeforeCompile(t,e),t.vertexShader=oi,t.fragmentShader=ni}}class fr extends Ti{constructor(t){super(t),this.vector_=new _,this.vector2_=new _,this.vector3_=new _,this.quaternion_=new A,this.quaternion2_=new A,this.quaternion3_=new A,this.rotationMat_=new nt,this.rotationMat2_=new nt,this.maxParticles=1e3,this.setupBuffers(),this.rebuildMaterial()}buildExpandableBuffers(){this.offsetBuffer=new ht(new Float32Array(this.maxParticles*3),3),this.offsetBuffer.setUsage(J),this.geometry.setAttribute("offset",this.offsetBuffer),this.colorBuffer=new ht(new Float32Array(this.maxParticles*4),4),this.colorBuffer.setUsage(J),this.geometry.setAttribute("color",this.colorBuffer),this.settings.renderMode===M.Mesh?(this.rotationBuffer=new ht(new Float32Array(this.maxParticles*4),4),this.rotationBuffer.setUsage(J),this.geometry.setAttribute("rotation",this.rotationBuffer)):(this.settings.renderMode===M.BillBoard||this.settings.renderMode===M.HorizontalBillBoard||this.settings.renderMode===M.VerticalBillBoard||this.settings.renderMode===M.StretchedBillBoard)&&(this.rotationBuffer=new ht(new Float32Array(this.maxParticles),1),this.rotationBuffer.setUsage(J),this.geometry.setAttribute("rotation",this.rotationBuffer)),this.sizeBuffer=new ht(new Float32Array(this.maxParticles*3),3),this.sizeBuffer.setUsage(J),this.geometry.setAttribute("size",this.sizeBuffer),this.uvTileBuffer=new ht(new Float32Array(this.maxParticles),1),this.uvTileBuffer.setUsage(J),this.geometry.setAttribute("uvTile",this.uvTileBuffer),this.settings.renderMode===M.StretchedBillBoard&&(this.velocityBuffer=new ht(new Float32Array(this.maxParticles*4),4),this.velocityBuffer.setUsage(J),this.geometry.setAttribute("velocity",this.velocityBuffer))}setupBuffers(){this.geometry&&this.geometry.dispose(),this.geometry=new Ai,this.geometry.setIndex(this.settings.instancingGeometry.getIndex()),this.settings.instancingGeometry.hasAttribute("normal")&&this.geometry.setAttribute("normal",this.settings.instancingGeometry.getAttribute("normal")),this.geometry.setAttribute("position",this.settings.instancingGeometry.getAttribute("position")),this.settings.instancingGeometry.hasAttribute("uv")&&this.geometry.setAttribute("uv",this.settings.instancingGeometry.getAttribute("uv")),this.buildExpandableBuffers()}expandBuffers(t){for(;t>=this.maxParticles;)this.maxParticles*=2;this.setupBuffers()}rebuildMaterial(){this.layers.mask=this.settings.layers.mask;const t={},e={};this.settings.material.type!=="MeshStandardMaterial"&&this.settings.material.type!=="MeshPhysicalMaterial"&&(t.map=new tt(this.settings.material.map)),this.settings.material.alphaTest&&(e.USE_ALPHATEST="",t.alphaTest=new tt(this.settings.material.alphaTest)),e.USE_UV="";const i=this.settings.uTileCount,s=this.settings.vTileCount;(i>1||s>1)&&(e.UV_TILE="",t.tileCount=new tt(new _t(i,s))),this.settings.material.defines&&this.settings.material.defines.USE_COLOR_AS_ALPHA!==void 0&&(e.USE_COLOR_AS_ALPHA=""),this.settings.material.normalMap&&(e.USE_NORMALMAP="",e.NORMALMAP_UV=ii(this.settings.material.normalMap.channel),t.normalMapTransform=new tt(new nt().copy(this.settings.material.normalMap.matrix))),this.settings.material.map&&(e.USE_MAP="",this.settings.blendTiles&&(e.TILE_BLEND=""),e.MAP_UV=ii(this.settings.material.map.channel),t.mapTransform=new tt(new nt().copy(this.settings.material.map.matrix))),e.USE_COLOR_ALPHA="";let r;if(this.settings.softParticles){e.SOFT_PARTICLES="";const a=this.settings.softNearFade,o=1/(this.settings.softFarFade-this.settings.softNearFade);t.softParams=new tt(new _t(a,o)),t.depthTexture=new tt(null);const h=t.projParams=new tt(new G);r=(c,u,f)=>{h.value.set(f.near,f.far,0,0)}}let n=!1;if(this.settings.renderMode===M.BillBoard||this.settings.renderMode===M.VerticalBillBoard||this.settings.renderMode===M.HorizontalBillBoard||this.settings.renderMode===M.Mesh){let a,o;this.settings.renderMode===M.Mesh?this.settings.material.type==="MeshStandardMaterial"||this.settings.material.type==="MeshPhysicalMaterial"?(e.USE_COLOR="",a=oi,o=ni,n=!0):(a=cr,o=$e):(a=lr,o=$e),this.settings.renderMode===M.VerticalBillBoard?e.VERTICAL="":this.settings.renderMode===M.HorizontalBillBoard&&(e.HORIZONTAL="");let h=!1;this.settings.renderMode===M.Mesh&&(this.settings.material.type==="MeshStandardMaterial"?(this.material=new dr({}),this.material.copy(this.settings.material),this.material.uniforms=t,this.material.defines=e,h=!0):this.settings.material.type==="MeshPhysicalMaterial"&&(this.material=new mr({}),this.material.copy(this.settings.material),this.material.uniforms=t,this.material.defines=e,h=!0)),h||(this.material=new je({uniforms:t,defines:e,vertexShader:a,fragmentShader:o,transparent:this.settings.material.transparent,depthWrite:!this.settings.material.transparent,blending:this.settings.material.blending,blendDst:this.settings.material.blendDst,blendSrc:this.settings.material.blendSrc,blendEquation:this.settings.material.blendEquation,premultipliedAlpha:this.settings.material.premultipliedAlpha,side:this.settings.material.side,alphaTest:this.settings.material.alphaTest,depthTest:this.settings.material.depthTest,lights:n}))}else if(this.settings.renderMode===M.StretchedBillBoard)t.speedFactor=new tt(1),this.material=new je({uniforms:t,defines:e,vertexShader:ur,fragmentShader:$e,transparent:this.settings.material.transparent,depthWrite:!this.settings.material.transparent,blending:this.settings.material.blending,blendDst:this.settings.material.blendDst,blendSrc:this.settings.material.blendSrc,blendEquation:this.settings.material.blendEquation,premultipliedAlpha:this.settings.material.premultipliedAlpha,side:this.settings.material.side,alphaTest:this.settings.material.alphaTest,depthTest:this.settings.material.depthTest});else throw new Error("render mode unavailable");this.material&&r&&(this.material.onBeforeRender=r)}update(){let t=0,e=0;const i=this.getVisibleSystems();for(const s of i)e+=s.particleNum;e>this.maxParticles&&this.expandBuffers(e);for(const s of i){s.emitter.updateMatrixWorld&&(s.emitter.updateWorldMatrix(!0,!1),s.emitter.updateMatrixWorld(!0));const r=s.particles,n=s.particleNum,a=this.quaternion2_,o=this.vector2_,h=this.vector3_;s.emitter.matrixWorld.decompose(o,a,h),this.rotationMat_.setFromMatrix4(s.emitter.matrixWorld);for(let c=0;c<n;c++,t++){const u=r[c];if(this.settings.renderMode===M.Mesh){let d;if(s.worldSpace)d=u.rotation;else{let m;u.parentMatrix?m=this.quaternion3_.setFromRotationMatrix(u.parentMatrix):m=a,d=this.quaternion_,d.copy(m).multiply(u.rotation)}this.rotationBuffer.setXYZW(t,d.x,d.y,d.z,d.w)}else(this.settings.renderMode===M.StretchedBillBoard||this.settings.renderMode===M.VerticalBillBoard||this.settings.renderMode===M.HorizontalBillBoard||this.settings.renderMode===M.BillBoard)&&this.rotationBuffer.setX(t,u.rotation);let f;if(s.worldSpace?f=u.position:(f=this.vector_,u.parentMatrix?f.copy(u.position).applyMatrix4(u.parentMatrix):f.copy(u.position).applyMatrix4(s.emitter.matrixWorld)),this.offsetBuffer.setXYZ(t,f.x,f.y,f.z),this.colorBuffer.setXYZW(t,u.color.x,u.color.y,u.color.z,u.color.w),s.worldSpace?this.sizeBuffer.setXYZ(t,u.size.x,u.size.y,u.size.z):u.parentMatrix?this.sizeBuffer.setXYZ(t,u.size.x,u.size.y,u.size.z):this.sizeBuffer.setXYZ(t,u.size.x*Math.abs(h.x),u.size.y*Math.abs(h.y),u.size.z*Math.abs(h.z)),this.uvTileBuffer.setX(t,u.uvTile),this.settings.renderMode===M.StretchedBillBoard&&this.velocityBuffer){let d=s.rendererEmitterSettings.speedFactor;d===0&&(d=.001);const m=s.rendererEmitterSettings.lengthFactor;let p;s.worldSpace?p=u.velocity:(p=this.vector_,u.parentMatrix?(this.rotationMat2_.setFromMatrix4(u.parentMatrix),p.copy(u.velocity).applyMatrix3(this.rotationMat2_)):p.copy(u.velocity).applyMatrix3(this.rotationMat_)),this.velocityBuffer.setXYZW(t,p.x*d,p.y*d,p.z*d,m)}}}this.geometry.instanceCount=t,t>0&&(this.offsetBuffer.clearUpdateRanges(),this.offsetBuffer.addUpdateRange(0,t*3),this.offsetBuffer.needsUpdate=!0,this.sizeBuffer.clearUpdateRanges(),this.sizeBuffer.addUpdateRange(0,t*3),this.sizeBuffer.needsUpdate=!0,this.colorBuffer.clearUpdateRanges(),this.colorBuffer.addUpdateRange(0,t*4),this.colorBuffer.needsUpdate=!0,this.uvTileBuffer.clearUpdateRanges(),this.uvTileBuffer.addUpdateRange(0,t),this.uvTileBuffer.needsUpdate=!0,this.settings.renderMode===M.StretchedBillBoard&&this.velocityBuffer&&(this.velocityBuffer.clearUpdateRanges(),this.velocityBuffer.addUpdateRange(0,t*4),this.velocityBuffer.needsUpdate=!0),this.settings.renderMode===M.Mesh?(this.rotationBuffer.clearUpdateRanges(),this.rotationBuffer.addUpdateRange(0,t*4),this.rotationBuffer.needsUpdate=!0):(this.settings.renderMode===M.StretchedBillBoard||this.settings.renderMode===M.HorizontalBillBoard||this.settings.renderMode===M.VerticalBillBoard||this.settings.renderMode===M.BillBoard)&&(this.rotationBuffer.clearUpdateRanges(),this.rotationBuffer.addUpdateRange(0,t),this.rotationBuffer.needsUpdate=!0))}dispose(){this.geometry.dispose()}}var pr=`
932
+
933
+ #include <common>
934
+ #include <tile_pars_fragment>
935
+ #include <map_pars_fragment>
936
+ #include <fog_pars_fragment>
937
+ #include <logdepthbuf_pars_fragment>
938
+ #include <clipping_planes_pars_fragment>
939
+
940
+ uniform sampler2D alphaMap;
941
+ uniform float useAlphaMap;
942
+ uniform float visibility;
943
+ uniform float alphaTest;
944
+
945
+ varying vec4 vColor;
946
+
947
+ void main() {
948
+ #include <clipping_planes_fragment>
949
+ #include <logdepthbuf_fragment>
950
+
951
+ vec4 diffuseColor = vColor;
952
+
953
+ #ifdef USE_MAP
954
+ #include <tile_fragment>
955
+ #ifndef USE_COLOR_AS_ALPHA
956
+ #endif
957
+ #endif
958
+ if( useAlphaMap == 1. ) diffuseColor.a *= texture2D( alphaMap, vUv).a;
959
+ if( diffuseColor.a < alphaTest ) discard;
960
+ gl_FragColor = diffuseColor;
961
+
962
+ #include <fog_fragment>
963
+ #include <tonemapping_fragment>
964
+ }`,yr=`
965
+ #include <common>
966
+ #include <tile_pars_vertex>
967
+ #include <color_pars_vertex>
968
+ #include <clipping_planes_pars_vertex>
969
+ #include <logdepthbuf_pars_vertex>
970
+ #include <fog_pars_vertex>
971
+
972
+ attribute vec3 previous;
973
+ attribute vec3 next;
974
+ attribute float side;
975
+ attribute float width;
976
+
977
+ uniform vec2 resolution;
978
+ uniform float lineWidth;
979
+ uniform float sizeAttenuation;
980
+
981
+ vec2 fix(vec4 i, float aspect) {
982
+ vec2 res = i.xy / i.w;
983
+ res.x *= aspect;
984
+ return res;
985
+ }
986
+
987
+ void main() {
988
+
989
+ #include <tile_vertex>
990
+
991
+ float aspect = resolution.x / resolution.y;
992
+
993
+ vColor = color;
994
+
995
+ mat4 m = projectionMatrix * modelViewMatrix;
996
+ vec4 finalPosition = m * vec4( position, 1.0 );
997
+ vec4 prevPos = m * vec4( previous, 1.0 );
998
+ vec4 nextPos = m * vec4( next, 1.0 );
999
+
1000
+ vec2 currentP = fix( finalPosition, aspect );
1001
+ vec2 prevP = fix( prevPos, aspect );
1002
+ vec2 nextP = fix( nextPos, aspect );
1003
+
1004
+ float w = lineWidth * width;
1005
+
1006
+ vec2 dir;
1007
+ if( nextP == currentP ) dir = normalize( currentP - prevP );
1008
+ else if( prevP == currentP ) dir = normalize( nextP - currentP );
1009
+ else {
1010
+ vec2 dir1 = normalize( currentP - prevP );
1011
+ vec2 dir2 = normalize( nextP - currentP );
1012
+ dir = normalize( dir1 + dir2 );
1013
+
1014
+ vec2 perp = vec2( -dir1.y, dir1.x );
1015
+ vec2 miter = vec2( -dir.y, dir.x );
1016
+ //w = clamp( w / dot( miter, perp ), 0., 4., * lineWidth * width );
1017
+
1018
+ }
1019
+
1020
+ //vec2 normal = ( cross( vec3( dir, 0. ) vec3( 0., 0., 1. ) ) ).xy;
1021
+ vec4 normal = vec4( -dir.y, dir.x, 0., 1. );
1022
+ normal.xy *= .5 * w;
1023
+ normal *= projectionMatrix;
1024
+ if( sizeAttenuation == 0. ) {
1025
+ normal.xy *= finalPosition.w;
1026
+ normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;
1027
+ }
1028
+
1029
+ finalPosition.xy += normal.xy * side;
1030
+
1031
+ gl_Position = finalPosition;
1032
+
1033
+ #include <logdepthbuf_vertex>
1034
+ #include <clipping_planes_vertex>
1035
+
1036
+ vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
1037
+
1038
+ #include <fog_vertex>
1039
+ }`;class gr extends Ti{constructor(t){super(t),this.vector_=new _,this.vector2_=new _,this.vector3_=new _,this.quaternion_=new A,this.maxParticles=1e4,this.setupBuffers(),this.rebuildMaterial()}setupBuffers(){this.geometry&&this.geometry.dispose(),this.geometry=new Ni,this.indexBuffer=new ut(new Uint32Array(this.maxParticles*6),1),this.indexBuffer.setUsage(J),this.geometry.setIndex(this.indexBuffer),this.positionBuffer=new ut(new Float32Array(this.maxParticles*6),3),this.positionBuffer.setUsage(J),this.geometry.setAttribute("position",this.positionBuffer),this.previousBuffer=new ut(new Float32Array(this.maxParticles*6),3),this.previousBuffer.setUsage(J),this.geometry.setAttribute("previous",this.previousBuffer),this.nextBuffer=new ut(new Float32Array(this.maxParticles*6),3),this.nextBuffer.setUsage(J),this.geometry.setAttribute("next",this.nextBuffer),this.widthBuffer=new ut(new Float32Array(this.maxParticles*2),1),this.widthBuffer.setUsage(J),this.geometry.setAttribute("width",this.widthBuffer),this.sideBuffer=new ut(new Float32Array(this.maxParticles*2),1),this.sideBuffer.setUsage(J),this.geometry.setAttribute("side",this.sideBuffer),this.uvBuffer=new ut(new Float32Array(this.maxParticles*4),2),this.uvBuffer.setUsage(J),this.geometry.setAttribute("uv",this.uvBuffer),this.colorBuffer=new ut(new Float32Array(this.maxParticles*8),4),this.colorBuffer.setUsage(J),this.geometry.setAttribute("color",this.colorBuffer)}expandBuffers(t){for(;t>=this.maxParticles;)this.maxParticles*=2;this.setupBuffers()}rebuildMaterial(){this.layers.mask=this.settings.layers.mask;const t={lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},resolution:{value:new _t(1,1)},sizeAttenuation:{value:1},visibility:{value:1},alphaTest:{value:0}},e={};if(e.USE_UV="",e.USE_COLOR_ALPHA="",this.settings.material.map&&(e.USE_MAP="",e.MAP_UV=ii(this.settings.material.map.channel),t.map=new tt(this.settings.material.map),t.mapTransform=new tt(new nt().copy(this.settings.material.map.matrix))),this.settings.material.defines&&this.settings.material.defines.USE_COLOR_AS_ALPHA!==void 0&&(e.USE_COLOR_AS_ALPHA=""),this.settings.renderMode===M.Trail)this.material=new je({uniforms:t,defines:e,vertexShader:yr,fragmentShader:pr,transparent:this.settings.material.transparent,depthWrite:!this.settings.material.transparent,side:this.settings.material.side,blending:this.settings.material.blending||gi,blendDst:this.settings.material.blendDst,blendSrc:this.settings.material.blendSrc,blendEquation:this.settings.material.blendEquation,premultipliedAlpha:this.settings.material.premultipliedAlpha});else throw new Error("render mode unavailable")}update(){let t=0,e=0,i=0;const s=this.getVisibleSystems();for(const r of s)for(let n=0;n<r.particleNum;n++)i+=r.particles[n].previous.length*2;i>this.maxParticles&&this.expandBuffers(i);for(const r of s){r.emitter.updateMatrixWorld&&(r.emitter.updateWorldMatrix(!0,!1),r.emitter.updateMatrixWorld(!0));const n=this.quaternion_,a=this.vector2_,o=this.vector3_;r.emitter.matrixWorld.decompose(a,n,o);const h=r.particles,c=r.particleNum,u=this.settings.uTileCount,f=this.settings.vTileCount,d=1/u,m=1/f;for(let p=0;p<c;p++){const y=h[p],x=y.uvTile%f,z=Math.floor(y.uvTile/f+.001),b=y.previous.values();let w=b.next(),S=w.value,g=S;w.done||(w=b.next());let v;w.value!==void 0?v=w.value:v=g;for(let T=0;T<y.previous.length;T++,t+=2){if(this.positionBuffer.setXYZ(t,g.position.x,g.position.y,g.position.z),this.positionBuffer.setXYZ(t+1,g.position.x,g.position.y,g.position.z),r.worldSpace?(this.positionBuffer.setXYZ(t,g.position.x,g.position.y,g.position.z),this.positionBuffer.setXYZ(t+1,g.position.x,g.position.y,g.position.z)):(y.parentMatrix?this.vector_.copy(g.position).applyMatrix4(y.parentMatrix):this.vector_.copy(g.position).applyMatrix4(r.emitter.matrixWorld),this.positionBuffer.setXYZ(t,this.vector_.x,this.vector_.y,this.vector_.z),this.positionBuffer.setXYZ(t+1,this.vector_.x,this.vector_.y,this.vector_.z)),r.worldSpace?(this.previousBuffer.setXYZ(t,S.position.x,S.position.y,S.position.z),this.previousBuffer.setXYZ(t+1,S.position.x,S.position.y,S.position.z)):(y.parentMatrix?this.vector_.copy(S.position).applyMatrix4(y.parentMatrix):this.vector_.copy(S.position).applyMatrix4(r.emitter.matrixWorld),this.previousBuffer.setXYZ(t,this.vector_.x,this.vector_.y,this.vector_.z),this.previousBuffer.setXYZ(t+1,this.vector_.x,this.vector_.y,this.vector_.z)),r.worldSpace?(this.nextBuffer.setXYZ(t,v.position.x,v.position.y,v.position.z),this.nextBuffer.setXYZ(t+1,v.position.x,v.position.y,v.position.z)):(y.parentMatrix?this.vector_.copy(v.position).applyMatrix4(y.parentMatrix):this.vector_.copy(v.position).applyMatrix4(r.emitter.matrixWorld),this.nextBuffer.setXYZ(t,this.vector_.x,this.vector_.y,this.vector_.z),this.nextBuffer.setXYZ(t+1,this.vector_.x,this.vector_.y,this.vector_.z)),this.sideBuffer.setX(t,1),this.sideBuffer.setX(t+1,-1),r.worldSpace)this.widthBuffer.setX(t,g.size),this.widthBuffer.setX(t+1,g.size);else if(y.parentMatrix)this.widthBuffer.setX(t,g.size),this.widthBuffer.setX(t+1,g.size);else{const P=(Math.abs(o.x)+Math.abs(o.y)+Math.abs(o.z))/3;this.widthBuffer.setX(t,g.size*P),this.widthBuffer.setX(t+1,g.size*P)}this.uvBuffer.setXY(t,(T/y.previous.length+x)*d,(f-z-1)*m),this.uvBuffer.setXY(t+1,(T/y.previous.length+x)*d,(f-z)*m),this.colorBuffer.setXYZW(t,g.color.x,g.color.y,g.color.z,g.color.w),this.colorBuffer.setXYZW(t+1,g.color.x,g.color.y,g.color.z,g.color.w),T+1<y.previous.length&&(this.indexBuffer.setX(e*3,t),this.indexBuffer.setX(e*3+1,t+1),this.indexBuffer.setX(e*3+2,t+2),e++,this.indexBuffer.setX(e*3,t+2),this.indexBuffer.setX(e*3+1,t+1),this.indexBuffer.setX(e*3+2,t+3),e++),S=g,g=v,w.done||(w=b.next(),w.value!==void 0&&(v=w.value))}}}this.positionBuffer.clearUpdateRanges(),this.positionBuffer.addUpdateRange(0,t*3),this.positionBuffer.needsUpdate=!0,this.previousBuffer.clearUpdateRanges(),this.previousBuffer.addUpdateRange(0,t*3),this.previousBuffer.needsUpdate=!0,this.nextBuffer.clearUpdateRanges(),this.nextBuffer.addUpdateRange(0,t*3),this.nextBuffer.needsUpdate=!0,this.sideBuffer.clearUpdateRanges(),this.sideBuffer.addUpdateRange(0,t),this.sideBuffer.needsUpdate=!0,this.widthBuffer.clearUpdateRanges(),this.widthBuffer.addUpdateRange(0,t),this.widthBuffer.needsUpdate=!0,this.uvBuffer.clearUpdateRanges(),this.uvBuffer.addUpdateRange(0,t*2),this.uvBuffer.needsUpdate=!0,this.colorBuffer.clearUpdateRanges(),this.colorBuffer.addUpdateRange(0,t*4),this.colorBuffer.needsUpdate=!0,this.indexBuffer.clearUpdateRanges(),this.indexBuffer.addUpdateRange(0,e*3),this.indexBuffer.needsUpdate=!0,this.geometry.setDrawRange(0,e*3)}dispose(){this.geometry.dispose()}}class Oi extends si{constructor(){super(),this.batches=[],this.systemToBatchIndex=new Map,this.type="BatchedRenderer",this.depthTexture=null}static equals(t,e){return t.material.side===e.material.side&&t.material.blending===e.material.blending&&t.material.blendSrc===e.material.blendSrc&&t.material.blendDst===e.material.blendDst&&t.material.blendEquation===e.material.blendEquation&&t.material.premultipliedAlpha===e.material.premultipliedAlpha&&t.material.transparent===e.material.transparent&&t.material.depthTest===e.material.depthTest&&t.material.type===e.material.type&&t.material.alphaTest===e.material.alphaTest&&t.material.map===e.material.map&&t.renderMode===e.renderMode&&t.blendTiles===e.blendTiles&&t.softParticles===e.softParticles&&t.softFarFade===e.softFarFade&&t.softNearFade===e.softNearFade&&t.uTileCount===e.uTileCount&&t.vTileCount===e.vTileCount&&t.instancingGeometry===e.instancingGeometry&&t.renderOrder===e.renderOrder&&t.layers.mask===e.layers.mask}addSystem(t){t._renderer=this;const e=t.getRendererSettings();for(let s=0;s<this.batches.length;s++)if(Oi.equals(this.batches[s].settings,e)){this.batches[s].addSystem(t),this.systemToBatchIndex.set(t,s);return}let i;switch(e.renderMode){case M.Trail:i=new gr(e);break;case M.Mesh:case M.BillBoard:case M.VerticalBillBoard:case M.HorizontalBillBoard:case M.StretchedBillBoard:i=new fr(e);break}this.depthTexture&&i.applyDepthTexture(this.depthTexture),i.addSystem(t),this.batches.push(i),this.systemToBatchIndex.set(t,this.batches.length-1),this.add(i)}deleteSystem(t){const e=this.systemToBatchIndex.get(t);e!=null&&(this.batches[e].removeSystem(t),this.systemToBatchIndex.delete(t))}setDepthTexture(t){this.depthTexture=t;for(const e of this.batches)e.applyDepthTexture(t)}updateSystem(t){this.deleteSystem(t),this.addSystem(t)}update(t){this.systemToBatchIndex.forEach((e,i)=>{i.update(t)});for(let e=0;e<this.batches.length;e++)this.batches[e].update()}}class ai extends vi{constructor(){super(),this.type="QuarksPrefab",this.animationData=[],this.isPlaying=!1,this.currentTime=-1e-5,this.timeScale=1,this.duration=0,this._mixers=new Map,this._tempAnimationJSON=[],this._clock=new ns(!0)}registerBatchedRenderer(t){this._batchedRenderer=t}getOrCreateMixer(t){if(!this._mixers.has(t)){const e=new os(t);this._mixers.set(t,e)}return this._mixers.get(t)}addThreeAnimation(t,e,i=0,s=e.duration,r=!1){const n=this.getOrCreateMixer(t),a=n.clipAction(e);r||(a.setLoop(as,1),a.clampWhenFinished=!0);const o={startTime:i,duration:s,type:"three",loop:r,target:t,clip:e,mixer:n,action:a};return this.animationData.push(o),this.updateDuration(),o}addParticleSystemAnimation(t,e=0,i=0,s=!1){i<=0&&(i=t.system.duration);const r={startTime:e,duration:i,type:"ps",loop:s,target:t};return this.animationData.push(r),this.pause(),this.updateDuration(),r}removeAnimation(t){this.animationData.splice(t,1),this.updateDuration()}play(){this.isPlaying||(this.isPlaying=!0)}pause(){this.isPlaying&&(this.isPlaying=!1,this.animationData.forEach(t=>{t.target&&(t.type==="ps"&&!t.target.system.paused?t.target.system.pause():t.type==="three"&&t.action&&t.action.isRunning()&&(t.action.paused=!0))}))}stop(){this.pause(),this.currentTime=-1e-5,this.animationData.forEach(t=>{t.type==="ps"&&t.target?t.target.system.stop():t.type==="three"&&t.mixer&&t.action&&t.action.reset()})}update(t){if(!this.isPlaying)return;const e=t!==void 0?t:this._clock.getDelta();this.currentTime+=e*this.timeScale,this.currentTime>this.duration&&this.stop();const i=new Set;this.animationData.forEach(s=>{const{startTime:r,duration:n,type:a,loop:o,target:h,action:c,mixer:u}=s,f=r+n,d=this.currentTime>=r,m=this.currentTime>f,p=Math.abs(this.currentTime-r)<e;a==="three"&&c&&u?d&&!m?(p?(c.reset(),c.play()):c.paused&&(c.paused=!1,c.play()),this.currentTime-r,i.add(u)):m&&(c.paused=!0):a==="ps"&&h&&(d&&!m?p&&s.target.system.restart():m&&s.target.system.endEmit())}),i.forEach(s=>{s.update(e)})}setTime(t){const e=this.currentTime;this.currentTime=t,this.animationData.forEach(i=>{const{startTime:s,duration:r,type:n,target:a,action:o,mixer:h}=i;if(n==="three"&&o&&h){if(o.reset(),t>=s&&t<s+r){const c=t-s;o.time=c,o.play(),h.update(0),o.paused=!this.isPlaying}}else n==="ps"&&a&&(t>=s&&t<s+r?(e<s||e>=s+r)&&a.system.restart():a.system.endEmit())})}getDuration(){return this.duration}updateDuration(){let t=0;this.animationData.forEach(e=>{const i=e.startTime+e.duration;i>t&&(t=i)}),this.duration=t}resolveReferences(t){this._tempAnimationJSON.forEach(e=>{let i;if(t.traverse(s=>{s.uuid===e.targetUUID&&(i=s)}),i)if(e.type==="three"&&e.clipUUID){let s;i.animations&&(s=i.animations.find(r=>r.uuid===e.clipUUID)),s&&this.addThreeAnimation(i,s,e.startTime,e.duration,e.loop)}else e.type==="ps"&&this.addParticleSystemAnimation(i,e.startTime,e.duration,e.loop)}),this.updateDuration(),this._tempAnimationJSON=[]}toJSON(){const t=super.toJSON();return t.object.animationData=this.animationData.map(e=>({startTime:e.startTime,duration:e.duration,type:e.type,targetUUID:e.target.uuid,clipUUID:e.clip?.uuid,loop:e.loop})),t}static fromJSON(t){const e=new ai;return t.animationData&&(e._tempAnimationJSON=t.animationData),e}}class vr extends Ui{constructor(t){super(t)}linkReference(t){const e={};t.traverse(function(i){e[i.uuid]=i}),t.traverse(function(i){if(i.type==="ParticleEmitter"){const s=i.system;s.emitterShape;for(let r=0;r<s.behaviors.length;r++)s.behaviors[r]instanceof Tt&&(s.behaviors[r].subParticleSystem=e[s.behaviors[r].subParticleSystem])}})}parse(t,e){const i=super.parse(t,e);return this.linkReference(i),i}parseObject(t,e,i,s,r){let n;function a(m){return e[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",m),e[m]}function o(m){if(m!==void 0){if(Array.isArray(m)){const p=[];for(let y=0,x=m.length;y<x;y++){const z=m[y];i[z]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",z),p.push(i[z])}return p}return i[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",m),i[m]}}function h(m){return s[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",m),s[m]}let c,u;const f={textures:s,geometries:e,materials:i},d={};switch(t.type){case"QuarksPrefab":n=ai.fromJSON(t);break;case"ParticleEmitter":n=Pe.fromJSON(t.ps,f,d).emitter;break;case"Scene":n=new ts,t.background!==void 0&&(Number.isInteger(t.background)?n.background=new es(t.background):n.background=h(t.background)),t.environment!==void 0&&(n.environment=h(t.environment)),t.fog!==void 0&&(t.fog.type==="Fog"?n.fog=new is(t.fog.color,t.fog.near,t.fog.far):t.fog.type==="FogExp2"&&(n.fog=new ss(t.fog.color,t.fog.density)),t.fog.name!==""&&(n.fog.name=t.fog.name)),t.backgroundBlurriness!==void 0&&(n.backgroundBlurriness=t.backgroundBlurriness),t.backgroundIntensity!==void 0&&(n.backgroundIntensity=t.backgroundIntensity),t.backgroundRotation!==void 0&&n.backgroundRotation.fromArray(t.backgroundRotation),t.environmentIntensity!==void 0&&(n.environmentIntensity=t.environmentIntensity),t.environmentRotation!==void 0&&n.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":n=new ji(t.fov,t.aspect,t.near,t.far),t.focus!==void 0&&(n.focus=t.focus),t.zoom!==void 0&&(n.zoom=t.zoom),t.filmGauge!==void 0&&(n.filmGauge=t.filmGauge),t.filmOffset!==void 0&&(n.filmOffset=t.filmOffset),t.view!==void 0&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new $i(t.left,t.right,t.top,t.bottom,t.near,t.far),t.zoom!==void 0&&(n.zoom=t.zoom),t.view!==void 0&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new Ki(t.color,t.intensity);break;case"DirectionalLight":n=new Qi(t.color,t.intensity);break;case"PointLight":n=new Wi(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new Zi(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new Hi(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new Yi(t.color,t.groundColor,t.intensity);break;case"LightProbe":n=new qi().fromJSON(t);break;case"SkinnedMesh":c=a(t.geometry),u=o(t.material),n=new Xi(c,u),t.bindMode!==void 0&&(n.bindMode=t.bindMode),t.bindMatrix!==void 0&&n.bindMatrix.fromArray(t.bindMatrix),t.skeleton!==void 0&&(n.skeleton=t.skeleton);break;case"Mesh":c=a(t.geometry),u=o(t.material),n=new xi(c,u);break;case"InstancedMesh":{c=a(t.geometry),u=o(t.material);const m=t.count,p=t.instanceMatrix,y=t.instanceColor;n=new Gi(c,u,m),n.instanceMatrix=new ht(new Float32Array(p.array),16),y!==void 0&&(n.instanceColor=new ht(new Float32Array(y.array),y.itemSize));break}case"BatchedMesh":c=a(t.geometry),u=o(t.material),n=new Vi(t.maxGeometryCount,t.maxVertexCount,t.maxIndexCount,u),n.geometry=c,n.perObjectFrustumCulled=t.perObjectFrustumCulled,n.sortObjects=t.sortObjects,n._drawRanges=t.drawRanges,n._reservedRanges=t.reservedRanges,n._visibility=t.visibility,n._active=t.active,n._bounds=t.bounds.map(m=>{const p=new Ji;p.min.fromArray(m.boxMin),p.max.fromArray(m.boxMax);const y=new Di;return y.radius=m.sphereRadius,y.center.fromArray(m.sphereCenter),{boxInitialized:m.boxInitialized,box:p,sphereInitialized:m.sphereInitialized,sphere:y}}),n._maxGeometryCount=t.maxGeometryCount,n._maxVertexCount=t.maxVertexCount,n._maxIndexCount=t.maxIndexCount,n._geometryInitialized=t.geometryInitialized,n._geometryCount=t.geometryCount,n._matricesTexture=h(t.matricesTexture.uuid);break;case"LOD":n=new Li;break;case"Line":n=new Ii(a(t.geometry),o(t.material));break;case"LineLoop":n=new Fi(a(t.geometry),o(t.material));break;case"LineSegments":n=new ki(a(t.geometry),o(t.material));break;case"PointCloud":case"Points":n=new Ri(a(t.geometry),o(t.material));break;case"Sprite":n=new Bi(o(t.material));break;case"Group":n=new vi;break;case"Bone":n=new Ci;break;default:n=new si}if(n.uuid=t.uuid,t.name!==void 0&&(n.name=t.name),t.matrix!==void 0?(n.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&(n.matrix.decompose(n.position,n.quaternion,n.scale),isNaN(n.quaternion.x)&&n.quaternion.set(0,0,0,1))):(t.position!==void 0&&n.position.fromArray(t.position),t.rotation!==void 0&&n.rotation.fromArray(t.rotation),t.quaternion!==void 0&&n.quaternion.fromArray(t.quaternion),t.scale!==void 0&&n.scale.fromArray(t.scale)),t.up!==void 0&&n.up.fromArray(t.up),t.castShadow!==void 0&&(n.castShadow=t.castShadow),t.receiveShadow!==void 0&&(n.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(n.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(n.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(n.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&n.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(n.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(n.visible=t.visible),t.frustumCulled!==void 0&&(n.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(n.renderOrder=t.renderOrder),t.userData!==void 0&&(n.userData=t.userData),t.layers!==void 0&&(n.layers.mask=t.layers),t.children!==void 0){const m=t.children;for(let p=0;p<m.length;p++)n.add(this.parseObject(m[p],e,i,s,r))}if(t.animations!==void 0){const m=t.animations;for(let p=0;p<m.length;p++){const y=m[p];n.animations.push(r[y])}}if(t.type==="LOD"){t.autoUpdate!==void 0&&(n.autoUpdate=t.autoUpdate);const m=t.levels;for(let p=0;p<m.length;p++){const y=m[p],x=n.getObjectByProperty("uuid",y.object);x!==void 0&&n.addLevel(x,y.distance)}}else t.type==="QuarksPrefab"&&n.resolveReferences(n);return n}}rr();Zs(Ws);console.log("%c Particle system powered by three.quarks. https://quarks.art/","font-size: 14px; font-weight: bold;");export{ae as A,Oi as B,Yt as C,Ht as D,re as F,Qt as G,Wt as H,pe as L,ue as N,ne as O,Pe as P,vr as Q,M as R,bt as S,ce as T,O as V,oe as W,Kt as a,qt as b,Zt as c,ri as d,he as e,_ as f,le as g,ee as h,jt as i,se as j,ie as k,$t as l,Ae as m};