@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
@@ -1 +0,0 @@
1
- import{C as $,a as J,V as v,Q as ee,aC as S,a9 as se,bu as D,bv as te,ae as ne,r as k,R as ie,bw as re,ap as oe,bq as z,bx as ae,w as Y,j as ce,a5 as ue,by as le,bz as fe,k as he,bA as pe,av as de,am as xe,a2 as ye,bB as ge,bC as Te}from"./three.module-D396a9Mn.js";const j={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class H{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new Le(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new Oe(e)}),this.register(function(e){return new ve(e)}),this.register(function(e){return new ze(e)}),this.register(function(e){return new Be(e)}),this.register(function(e){return new Ce(e)}),this.register(function(e){return new Ue(e)}),this.register(function(e){return new Fe(e)}),this.register(function(e){return new De(e)}),this.register(function(e){return new Ge(e)}),this.register(function(e){return new Pe(e)}),this.register(function(e){return new ke(e)}),this.register(function(e){return new He(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,s,n,t){const i=new Se,r=[];for(let o=0,c=this.pluginCallbacks.length;o<c;o++)r.push(this.pluginCallbacks[o](i));i.setPlugins(r),i.setTextureUtils(this.textureUtils),i.writeAsync(e,s,t).catch(n)}parseAsync(e,s){const n=this;return new Promise(function(t,i){n.parse(e,t,i,s)})}}const g={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},G="KHR_mesh_quantization",R={};R[ue]=g.NEAREST;R[le]=g.NEAREST_MIPMAP_NEAREST;R[fe]=g.NEAREST_MIPMAP_LINEAR;R[he]=g.LINEAR;R[pe]=g.LINEAR_MIPMAP_NEAREST;R[de]=g.LINEAR_MIPMAP_LINEAR;R[xe]=g.CLAMP_TO_EDGE;R[ye]=g.REPEAT;R[ge]=g.MIRRORED_REPEAT;const K={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},we=new $,q=12,me=1179937895,Me=2,W=8,Ae=1313821514,Ee=5130562;function F(a,e){return a.length===e.length&&a.every(function(s,n){return s===e[n]})}function Ie(a){return new TextEncoder().encode(a).buffer}function Re(a){return F(a.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function be(a,e,s){const n={min:new Array(a.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(a.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let t=e;t<e+s;t++)for(let i=0;i<a.itemSize;i++){let r;a.itemSize>4?r=a.array[t*a.itemSize+i]:(i===0?r=a.getX(t):i===1?r=a.getY(t):i===2?r=a.getZ(t):i===3&&(r=a.getW(t)),a.normalized===!0&&(r=k.normalize(r,a.array))),n.min[i]=Math.min(n.min[i],r),n.max[i]=Math.max(n.max[i],r)}return n}function Z(a){return Math.ceil(a/4)*4}function P(a,e=0){const s=Z(a.byteLength);if(s!==a.byteLength){const n=new Uint8Array(s);if(n.set(new Uint8Array(a)),e!==0)for(let t=a.byteLength;t<s;t++)n[t]=e;return n.buffer}return a}function X(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Ne(a,e){if(typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas){let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),a.convertToBlob({type:e,quality:s})}else return new Promise(s=>a.toBlob(s,e))}class Se{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+se}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,s,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);const t=this,i=t.buffers,r=t.json;n=t.options;const o=t.extensionsUsed,c=t.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(o),u=Object.keys(c);if(h.length>0&&(r.extensionsUsed=h),u.length>0&&(r.extensionsRequired=u),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=l.size),n.binary===!0){const T=new FileReader;T.readAsArrayBuffer(l),T.onloadend=function(){const f=P(T.result),d=new DataView(new ArrayBuffer(W));d.setUint32(0,f.byteLength,!0),d.setUint32(4,Ee,!0);const x=P(Ie(JSON.stringify(r)),32),y=new DataView(new ArrayBuffer(W));y.setUint32(0,x.byteLength,!0),y.setUint32(4,Ae,!0);const M=new ArrayBuffer(q),b=new DataView(M);b.setUint32(0,me,!0),b.setUint32(4,Me,!0);const O=q+y.byteLength+x.byteLength+d.byteLength+f.byteLength;b.setUint32(8,O,!0);const p=new Blob([M,y,x,d,f],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(p),w.onloadend=function(){s(w.result)}}}else if(r.buffers&&r.buffers.length>0){const T=new FileReader;T.readAsDataURL(l),T.onloadend=function(){const f=T.result;r.buffers[0].uri=f,s(r)}}else s(r)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;const n=this.options,t=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(const r in i.gltfExtensions)s.extensions[r]=i.gltfExtensions[r],t[r]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(s.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,s=!1){if(this.uids.has(e)===!1){const t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(s)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new v;for(let t=0,i=e.count;t<i;t++)if(Math.abs(n.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);const n=e.clone(),t=new v;for(let i=0,r=n.count;i<r;i++)t.fromBufferAttribute(n,i),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),n.setXYZ(i,t.x,t.y,t.z);return s.attributesNormalized.set(e,n),n}applyTextureTransform(e,s){let n=!1;const t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),n=!0),s.rotation!==0&&(t.rotation=s.rotation,n=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,s){if(e===s)return e;function n(f){return f.colorSpace===ce?function(x){return x<.04045?x*.0773993808:Math.pow(x*.9478672986+.0521327014,2.4)}:function(x){return x}}e instanceof D&&(e=await this.decompressTextureAsync(e)),s instanceof D&&(s=await this.decompressTextureAsync(s));const t=e?e.image:null,i=s?s.image:null,r=Math.max(t?t.width:0,i?i.width:0),o=Math.max(t?t.height:0,i?i.height:0),c=X();c.width=r,c.height=o;const l=c.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,r,o);const h=l.getImageData(0,0,r,o);if(t){l.drawImage(t,0,0,r,o);const f=n(e),d=l.getImageData(0,0,r,o).data;for(let x=2;x<d.length;x+=4)h.data[x]=f(d[x]/256)*256}if(i){l.drawImage(i,0,0,r,o);const f=n(s),d=l.getImageData(0,0,r,o).data;for(let x=1;x<d.length;x+=4)h.data[x]=f(d[x]/256)*256}l.putImageData(h,0,0);const T=(e||s).clone();return T.source=new te(c),T.colorSpace=ne,T.channel=(e||s).channel,e&&s&&e.channel!==s.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),T}async decompressTextureAsync(e,s=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,s)}processBuffer(e){const s=this.json,n=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,s,n,t,i){const r=this.json;r.bufferViews||(r.bufferViews=[]);let o;switch(s){case g.BYTE:case g.UNSIGNED_BYTE:o=1;break;case g.SHORT:case g.UNSIGNED_SHORT:o=2;break;default:o=4}let c=e.itemSize*o;i===g.ARRAY_BUFFER&&(c=Math.ceil(c/4)*4);const l=Z(t*c),h=new DataView(new ArrayBuffer(l));let u=0;for(let d=n;d<n+t;d++){for(let x=0;x<e.itemSize;x++){let y;e.itemSize>4?y=e.array[d*e.itemSize+x]:(x===0?y=e.getX(d):x===1?y=e.getY(d):x===2?y=e.getZ(d):x===3&&(y=e.getW(d)),e.normalized===!0&&(y=k.normalize(y,e.array))),s===g.FLOAT?h.setFloat32(u,y,!0):s===g.INT?h.setInt32(u,y,!0):s===g.UNSIGNED_INT?h.setUint32(u,y,!0):s===g.SHORT?h.setInt16(u,y,!0):s===g.UNSIGNED_SHORT?h.setUint16(u,y,!0):s===g.BYTE?h.setInt8(u,y):s===g.UNSIGNED_BYTE&&h.setUint8(u,y),u+=o}u%c!==0&&(u+=c-u%c)}const T={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return i!==void 0&&(T.target=i),i===g.ARRAY_BUFFER&&(T.byteStride=c),this.byteOffset+=l,r.bufferViews.push(T),{id:r.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const s=this,n=s.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(t){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const r=P(i.result),o={buffer:s.processBuffer(r),byteOffset:s.byteOffset,byteLength:r.byteLength};s.byteOffset+=r.byteLength,t(n.bufferViews.push(o)-1)}})}processAccessor(e,s,n,t){const i=this.json,r={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let o;if(e.array.constructor===Float32Array)o=g.FLOAT;else if(e.array.constructor===Int32Array)o=g.INT;else if(e.array.constructor===Uint32Array)o=g.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=g.SHORT;else if(e.array.constructor===Uint16Array)o=g.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=g.BYTE;else if(e.array.constructor===Uint8Array)o=g.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0&&(n=0),(t===void 0||t===1/0)&&(t=e.count),t===0)return null;const c=be(e,n,t);let l;s!==void 0&&(l=e===s.index?g.ELEMENT_ARRAY_BUFFER:g.ARRAY_BUFFER);const h=this.processBufferView(e,o,n,t,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:o,count:t,max:c.max,min:c.min,type:r[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(u)-1}processImage(e,s,n,t="image/png"){if(e!==null){const i=this,r=i.cache,o=i.json,c=i.options,l=i.pending;r.images.has(e)||r.images.set(e,{});const h=r.images.get(e),u=t+":flipY/"+n.toString();if(h[u]!==void 0)return h[u];o.images||(o.images=[]);const T={mimeType:t},f=X();f.width=Math.min(e.width,c.maxTextureSize),f.height=Math.min(e.height,c.maxTextureSize);const d=f.getContext("2d",{willReadFrequently:!0});if(n===!0&&(d.translate(0,f.height),d.scale(1,-1)),e.data!==void 0){s!==ie&&console.error("GLTFExporter: Only RGBAFormat is supported.",s),(e.width>c.maxTextureSize||e.height>c.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const y=new Uint8ClampedArray(e.height*e.width*4);for(let M=0;M<y.length;M+=4)y[M+0]=e.data[M+0],y[M+1]=e.data[M+1],y[M+2]=e.data[M+2],y[M+3]=e.data[M+3];d.putImageData(new ImageData(y,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)d.drawImage(e,0,0,f.width,f.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");c.binary===!0?l.push(Ne(f,t).then(y=>i.processBufferViewImage(y)).then(y=>{T.bufferView=y})):T.uri=re.getDataURL(f,t);const x=o.images.push(T)-1;return h[u]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const s=this.json;s.samplers||(s.samplers=[]);const n={magFilter:R[e.magFilter],minFilter:R[e.minFilter],wrapS:R[e.wrapS],wrapT:R[e.wrapT]};return s.samplers.push(n)-1}async processTextureAsync(e){const n=this.options,t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]),e instanceof D&&(e=await this.decompressTextureAsync(e,n.maxTextureSize));let r=e.userData.mimeType;r==="image/webp"&&(r="image/png");const o={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(o.name=e.name),await this._invokeAllAsync(async function(l){l.writeTexture&&await l.writeTexture(e,o)});const c=i.textures.push(o)-1;return t.textures.set(e,c),c}async processMaterialAsync(e){const s=this.cache,n=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);const t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const i=e.color.toArray().concat([e.opacity]);if(F(i,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){const o=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),c={index:await this.processTextureAsync(o),texCoord:o.channel};this.applyTextureTransform(c,o),t.pbrMetallicRoughness.metallicRoughnessTexture=c}if(e.map){const o={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(o,e.map),t.pbrMetallicRoughness.baseColorTexture=o}if(e.emissive){const o=e.emissive;if(Math.max(o.r,o.g,o.b)>0&&(t.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),t.emissiveTexture=l}}if(e.normalMap){const o={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(o.scale=e.normalScale.x),this.applyTextureTransform(o,e.normalMap),t.normalTexture=o}if(e.aoMap){const o={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(o.strength=e.aoMapIntensity),this.applyTextureTransform(o,e.aoMap),t.occlusionTexture=o}e.transparent?t.alphaMode="BLEND":e.alphaTest>0&&(t.alphaMode="MASK",t.alphaCutoff=e.alphaTest),e.side===oe&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),await this._invokeAllAsync(async function(o){o.writeMaterialAsync&&await o.writeMaterialAsync(e,t)});const r=n.materials.push(t)-1;return s.materials.set(e,r),r}async processMeshAsync(e){const s=this.cache,n=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let p=0,w=e.material.length;p<w;p++)t.push(e.material[p].uuid);else t.push(e.material.uuid);const i=t.join(":");if(s.meshes.has(i))return s.meshes.get(i);const r=e.geometry;let o;e.isLineSegments?o=g.LINES:e.isLineLoop?o=g.LINE_LOOP:e.isLine?o=g.LINE_STRIP:e.isPoints?o=g.POINTS:o=e.material.wireframe?g.LINES:g.TRIANGLES;const c={},l={},h=[],u=[],T={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let d=null;for(let p in r.attributes){if(p.slice(0,5)==="morph")continue;const w=r.attributes[p];if(p=T[p]||p.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(p)||(p="_"+p),s.attributes.has(this.getUID(w))){l[p]=s.attributes.get(this.getUID(w));continue}d=null;const m=w.array;p==="JOINTS_0"&&!(m instanceof Uint16Array)&&!(m instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new S(new Uint16Array(m),w.itemSize,w.normalized)):(m instanceof Uint32Array||m instanceof Int32Array)&&!p.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${p}" converted to type FLOAT.`),d=H.Utils.toFloat32BufferAttribute(w));const I=this.processAccessor(d||w,r);I!==null&&(p.startsWith("_")||this.detectMeshQuantization(p,w),l[p]=I,s.attributes.set(this.getUID(w),I))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const p=[],w=[],A={};if(e.morphTargetDictionary!==void 0)for(const m in e.morphTargetDictionary)A[e.morphTargetDictionary[m]]=m;for(let m=0;m<e.morphTargetInfluences.length;++m){const I={};let V=!1;for(const _ in r.morphAttributes){if(_!=="position"&&_!=="normal"){V||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),V=!0);continue}const N=r.morphAttributes[_][m],B=_.toUpperCase(),C=r.attributes[_];if(s.attributes.has(this.getUID(N,!0))){I[B]=s.attributes.get(this.getUID(N,!0));continue}const U=N.clone();if(!r.morphTargetsRelative)for(let E=0,Q=N.count;E<Q;E++)for(let L=0;L<N.itemSize;L++)L===0&&U.setX(E,N.getX(E)-C.getX(E)),L===1&&U.setY(E,N.getY(E)-C.getY(E)),L===2&&U.setZ(E,N.getZ(E)-C.getZ(E)),L===3&&U.setW(E,N.getW(E)-C.getW(E));I[B]=this.processAccessor(U,r),s.attributes.set(this.getUID(C,!0),I[B])}u.push(I),p.push(e.morphTargetInfluences[m]),e.morphTargetDictionary!==void 0&&w.push(A[m])}c.weights=p,w.length>0&&(c.extras={},c.extras.targetNames=w)}const x=Array.isArray(e.material);if(x&&r.groups.length===0)return null;let y=!1;if(x&&r.index===null){const p=[];for(let w=0,A=r.attributes.position.count;w<A;w++)p[w]=w;r.setIndex(p),y=!0}const M=x?e.material:[e.material],b=x?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let p=0,w=b.length;p<w;p++){const A={mode:o,attributes:l};if(this.serializeUserData(r,A),u.length>0&&(A.targets=u),r.index!==null){let I=this.getUID(r.index);(b[p].start!==void 0||b[p].count!==void 0)&&(I+=":"+b[p].start+":"+b[p].count),s.attributes.has(I)?A.indices=s.attributes.get(I):(A.indices=this.processAccessor(r.index,r,b[p].start,b[p].count),s.attributes.set(I,A.indices)),A.indices===null&&delete A.indices}const m=await this.processMaterialAsync(M[b[p].materialIndex]);m!==null&&(A.material=m),h.push(A)}y===!0&&r.setIndex(null),c.primitives=h,n.meshes||(n.meshes=[]),await this._invokeAllAsync(function(p){p.writeMesh&&p.writeMesh(e,c)});const O=n.meshes.push(c)-1;return s.meshes.set(i,O),O}detectMeshQuantization(e,s){if(this.extensionsUsed[G])return;let n;switch(s.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}s.normalized&&(n+=" normalized");const t=e.split("_",1)[0];j[t]&&j[t].includes(n)&&(this.extensionsUsed[G]=!0,this.extensionsRequired[G]=!0)}processCamera(e){const s=this.json;s.cameras||(s.cameras=[]);const n=e.isOrthographicCamera,t={type:n?"orthographic":"perspective"};return n?t.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:t.perspective={aspectRatio:e.aspect,yfov:k.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(t.name=e.type),s.cameras.push(t)-1}processAnimation(e,s){const n=this.json,t=this.nodeMap;n.animations||(n.animations=[]),e=H.Utils.mergeMorphTargetTracks(e.clone(),s);const i=e.tracks,r=[],o=[];for(let l=0;l<i.length;++l){const h=i[l],u=z.parseTrackName(h.name);let T=z.findNode(s,u.nodeName);const f=K[u.propertyName];if(u.objectName==="bones"&&(T.isSkinnedMesh===!0?T=T.skeleton.getBoneByName(u.objectIndex):T=void 0),!T||!f){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',h.name);continue}const d=1;let x=h.values.length/h.times.length;f===K.morphTargetInfluences&&(x/=T.morphTargetInfluences.length);let y;h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(y="CUBICSPLINE",x/=3):h.getInterpolation()===ae?y="STEP":y="LINEAR",o.push({input:this.processAccessor(new S(h.times,d)),output:this.processAccessor(new S(h.values,x)),interpolation:y}),r.push({sampler:o.length-1,target:{node:t.get(T),path:f}})}const c={name:e.name||"clip_"+n.animations.length,samplers:o,channels:r};return this.serializeUserData(e,c),n.animations.push(c),n.animations.length-1}processSkin(e){const s=this.json,n=this.nodeMap,t=s.nodes[n.get(e)],i=e.skeleton;if(i===void 0)return null;const r=e.skeleton.bones[0];if(r===void 0)return null;const o=[],c=new Float32Array(i.bones.length*16),l=new J;for(let u=0;u<i.bones.length;++u)o.push(n.get(i.bones[u])),l.copy(i.boneInverses[u]),l.multiply(e.bindMatrix).toArray(c,u*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new S(c,16)),joints:o,skeleton:n.get(r)}),t.skin=s.skins.length-1}async processNodeAsync(e){const s=this.json,n=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);const i={};if(n.trs){const o=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();F(o,[0,0,0,1])||(i.rotation=o),F(c,[0,0,0])||(i.translation=c),F(l,[1,1,1])||(i.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),Re(e.matrix)===!1&&(i.matrix=e.matrix.elements);if(e.name!==""&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){const o=await this.processMeshAsync(e);o!==null&&(i.mesh=o)}else e.isCamera&&(i.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);const r=s.nodes.push(i)-1;if(t.set(e,r),e.children.length>0){const o=[];for(let c=0,l=e.children.length;c<l;c++){const h=e.children[c];if(h.visible||n.onlyVisible===!1){const u=await this.processNodeAsync(h);u!==null&&o.push(u)}}o.length>0&&(i.children=o)}return await this._invokeAllAsync(function(o){o.writeNode&&o.writeNode(e,i)}),r}async processSceneAsync(e){const s=this.json,n=this.options;s.scenes||(s.scenes=[],s.scene=0);const t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);const i=[];for(let r=0,o=e.children.length;r<o;r++){const c=e.children[r];if(c.visible||n.onlyVisible===!1){const l=await this.processNodeAsync(c);l!==null&&i.push(l)}}i.length>0&&(t.nodes=i),this.serializeUserData(e,t)}async processObjectsAsync(e){const s=new Y;s.name="AuxScene";for(let n=0;n<e.length;n++)s.children.push(e[n]);await this.processSceneAsync(s)}async processInputAsync(e){const s=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(t){t.beforeParse&&t.beforeParse(e)});const n=[];for(let t=0;t<e.length;t++)e[t]instanceof Y?await this.processSceneAsync(e[t]):n.push(e[t]);n.length>0&&await this.processObjectsAsync(n);for(let t=0;t<this.skins.length;++t)this.processSkin(this.skins[t]);for(let t=0;t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);await this._invokeAllAsync(function(t){t.afterParse&&t.afterParse(e)})}async _invokeAllAsync(e){for(let s=0,n=this.plugins.length;s<n;s++)await e(this.plugins[s])}}class Le{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const n=this.writer,t=n.json,i=n.extensionsUsed,r={};e.name&&(r.name=e.name),r.color=e.color.toArray(),r.intensity=e.intensity,e.isDirectionalLight?r.type="directional":e.isPointLight?(r.type="point",e.distance>0&&(r.range=e.distance)):e.isSpotLight&&(r.type="spot",e.distance>0&&(r.range=e.distance),r.spot={},r.spot.innerConeAngle=(1-e.penumbra)*e.angle,r.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},i[this.name]=!0);const o=t.extensions[this.name].lights;o.push(r),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}}class _e{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,s){if(!e.isMeshBasicMaterial)return;const t=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},t[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}}class Ce{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const n=this.writer,t=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const r={index:await n.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(r,e.clearcoatMap),i.clearcoatTexture=r}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const r={index:await n.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(r,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=r}if(e.clearcoatNormalMap){const r={index:await n.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(r.scale=e.clearcoatNormalScale.x),n.applyTextureTransform(r,e.clearcoatNormalMap),i.clearcoatNormalTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class Ue{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const t=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class Fe{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const n=this.writer,t=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const r={index:await n.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(r,e.iridescenceMap),i.iridescenceTexture=r}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const r={index:await n.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(r,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class Oe{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,t=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const r={index:await n.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(r,e.transmissionMap),i.transmissionTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class ve{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,t=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const r={index:await n.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(r,e.thicknessMap),i.thicknessTexture=r}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class ze{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const t=this.writer.extensionsUsed,i={};i.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class Be{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(we)&&!e.specularIntensityMap&&!e.specularColorMap)return;const n=this.writer,t=n.extensionsUsed,i={};if(e.specularIntensityMap){const r={index:await n.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(r,e.specularIntensityMap),i.specularTexture=r}if(e.specularColorMap){const r={index:await n.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(r,e.specularColorMap),i.specularColorTexture=r}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class De{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const n=this.writer,t=n.extensionsUsed,i={};if(e.sheenRoughnessMap){const r={index:await n.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(r,e.sheenRoughnessMap),i.sheenRoughnessTexture=r}if(e.sheenColorMap){const r={index:await n.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(r,e.sheenColorMap),i.sheenColorTexture=r}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class Ge{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const n=this.writer,t=n.extensionsUsed,i={};if(e.anisotropyMap){const r={index:await n.processTextureAsync(e.anisotropyMap)};n.applyTextureTransform(r,e.anisotropyMap),i.anisotropyTexture=r}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class Pe{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,s){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const t=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class ke{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,s){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const n=this.writer,t=n.extensionsUsed,i={};if(e.bumpMap){const r={index:await n.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};n.applyTextureTransform(r,e.bumpMap),i.bumpTexture=r}i.bumpFactor=e.bumpScale,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}}class He{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,s){if(!e.isInstancedMesh)return;const n=this.writer,t=e,i=new Float32Array(t.count*3),r=new Float32Array(t.count*4),o=new Float32Array(t.count*3),c=new J,l=new v,h=new ee,u=new v;for(let f=0;f<t.count;f++)t.getMatrixAt(f,c),c.decompose(l,h,u),l.toArray(i,f*3),h.toArray(r,f*4),u.toArray(o,f*3);const T={TRANSLATION:n.processAccessor(new S(i,3)),ROTATION:n.processAccessor(new S(r,4)),SCALE:n.processAccessor(new S(o,3))};t.instanceColor&&(T._COLOR_0=n.processAccessor(t.instanceColor)),s.extensions=s.extensions||{},s.extensions[this.name]={attributes:T},n.extensionsUsed[this.name]=!0,n.extensionsRequired[this.name]=!0}}H.Utils={insertKeyframe:function(a,e){const n=a.getValueSize(),t=new a.TimeBufferType(a.times.length+1),i=new a.ValueBufferType(a.values.length+n),r=a.createInterpolant(new a.ValueBufferType(n));let o;if(a.times.length===0){t[0]=e;for(let c=0;c<n;c++)i[c]=0;o=0}else if(e<a.times[0]){if(Math.abs(a.times[0]-e)<.001)return 0;t[0]=e,t.set(a.times,1),i.set(r.evaluate(e),0),i.set(a.values,n),o=0}else if(e>a.times[a.times.length-1]){if(Math.abs(a.times[a.times.length-1]-e)<.001)return a.times.length-1;t[t.length-1]=e,t.set(a.times,0),i.set(a.values,0),i.set(r.evaluate(e),a.values.length),o=t.length-1}else for(let c=0;c<a.times.length;c++){if(Math.abs(a.times[c]-e)<.001)return c;if(a.times[c]<e&&a.times[c+1]>e){t.set(a.times.slice(0,c+1),0),t[c+1]=e,t.set(a.times.slice(c+1),c+2),i.set(a.values.slice(0,(c+1)*n),0),i.set(r.evaluate(e),(c+1)*n),i.set(a.values.slice((c+1)*n),(c+2)*n),o=c+1;break}}return a.times=t,a.values=i,o},mergeMorphTargetTracks:function(a,e){const s=[],n={},t=a.tracks;for(let i=0;i<t.length;++i){let r=t[i];const o=z.parseTrackName(r.name),c=z.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(r);continue}if(r.createInterpolant!==r.InterpolantFactoryMethodDiscrete&&r.createInterpolant!==r.InterpolantFactoryMethodLinear){if(r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),r=r.clone(),r.setInterpolation(Te)}const l=c.morphTargetInfluences.length,h=c.morphTargetDictionary[o.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let u;if(n[c.uuid]===void 0){u=r.clone();const f=new u.ValueBufferType(l*u.times.length);for(let d=0;d<u.times.length;d++)f[d*l+h]=u.values[d];u.name=(o.nodeName||"")+".morphTargetInfluences",u.values=f,n[c.uuid]=u,s.push(u);continue}const T=r.createInterpolant(new r.ValueBufferType(1));u=n[c.uuid];for(let f=0;f<u.times.length;f++)u.values[f*l+h]=T.evaluate(u.times[f]);for(let f=0;f<r.times.length;f++){const d=this.insertKeyframe(u,r.times[f]);u.values[d*l+h]=r.values[f]}}return a.tracks=s,a},toFloat32BufferAttribute:function(a){const e=new S(new Float32Array(a.count*a.itemSize),a.itemSize,!1);if(!a.normalized&&!a.isInterleavedBufferAttribute)return e.array.set(a.array),e;for(let s=0,n=a.count;s<n;s++)for(let t=0;t<a.itemSize;t++)e.setComponent(s,t,a.getComponent(s,t));return e}};export{H as GLTFExporter};
@@ -1,2 +0,0 @@
1
- import{_ as U}from"./extends-CF3RwP-h.js";import{r as T}from"./index-nmcBqr7Y.js";import{a9 as Pe,A as Ne,b as re,c as oe,d as Me,V as y,a as x,Q as ce,S as we,ak as Ee,b2 as Q,al as j,bK as g,g as Ie,C as K,bG as ve,bH as Qe,D as _e,bt as ke,aU as Xe,O as De,e as Ye,cn as je,aC as _,co as Ze,av as Re,bz as We,bA as Ve,by as qe,k as Te,a5 as ze,a2 as ie,bB as $e,am as et,a_ as tt,aA as q,aZ as st,F as ge,ap as nt,z as v,bq as rt,aB as He,bS as ot,M as Je,b0 as it,bh as at,bP as At,b1 as Bt,aX as z,x as ct,r as lt,ar as Ct,b5 as ut,b6 as dt,bx as ht,bC as be,c1 as ft,as as ue,cf as de,aq as mt,cp as pt,u as Ft,s as Gt,bb as Mt,ba as Et}from"./three.module-D396a9Mn.js";import{a as he}from"./BufferGeometryUtils-Nz37EVXf.js";import{G as le}from"./events-156d8d12.esm-ErOhDXXB.js";const It=parseInt(Pe.replace(/\D+/g,""));function Le(C,t,e={}){const n=new y,s=new ce,r=new y,o=new x,a=new x,i=new x;e.preserveMatrix=e.preserveMatrix!==void 0?e.preserveMatrix:!0,e.preservePosition=e.preservePosition!==void 0?e.preservePosition:!0,e.preserveHipPosition=e.preserveHipPosition!==void 0?e.preserveHipPosition:!1,e.useTargetMatrix=e.useTargetMatrix!==void 0?e.useTargetMatrix:!1,e.hip=e.hip!==void 0?e.hip:"hip",e.names=e.names||{};const A=t.isObject3D?t.skeleton.bones:Z(t),B=C.isObject3D?C.skeleton.bones:Z(C);let c,l,u,d,f;if(C.isObject3D?C.skeleton.pose():(e.useTargetMatrix=!0,e.preserveMatrix=!1),e.preservePosition){f=[];for(let h=0;h<B.length;h++)f.push(B[h].position.clone())}if(e.preserveMatrix){C.updateMatrixWorld(),C.matrixWorld.identity();for(let h=0;h<C.children.length;++h)C.children[h].updateMatrixWorld(!0)}if(e.offsets){c=[];for(let h=0;h<B.length;++h)l=B[h],u=e.names[l.name]||l.name,e.offsets[u]&&(l.matrix.multiply(e.offsets[u]),l.matrix.decompose(l.position,l.quaternion,l.scale),l.updateMatrixWorld()),c.push(l.matrixWorld.clone())}for(let h=0;h<B.length;++h){if(l=B[h],u=e.names[l.name]||l.name,d=ye(u,A),i.copy(l.matrixWorld),d){if(d.updateMatrixWorld(),e.useTargetMatrix?a.copy(d.matrixWorld):(a.copy(C.matrixWorld).invert(),a.multiply(d.matrixWorld)),r.setFromMatrixScale(a),a.scale(r.set(1/r.x,1/r.y,1/r.z)),i.makeRotationFromQuaternion(s.setFromRotationMatrix(a)),C.isObject3D){const m=B.indexOf(l),p=c?c[m]:o.copy(C.skeleton.boneInverses[m]).invert();i.multiply(p)}i.copyPosition(a)}l.parent&&l.parent.isBone?(l.matrix.copy(l.parent.matrixWorld).invert(),l.matrix.multiply(i)):l.matrix.copy(i),e.preserveHipPosition&&u===e.hip&&l.matrix.setPosition(n.set(0,l.position.y,0)),l.matrix.decompose(l.position,l.quaternion,l.scale),l.updateMatrixWorld()}if(e.preservePosition)for(let h=0;h<B.length;++h)l=B[h],u=e.names[l.name]||l.name,u!==e.hip&&l.position.copy(f[h]);e.preserveMatrix&&C.updateMatrixWorld(!0)}function Dt(C,t,e,n={}){n.useFirstFramePosition=n.useFirstFramePosition!==void 0?n.useFirstFramePosition:!1,n.fps=n.fps!==void 0?n.fps:30,n.names=n.names||[],t.isObject3D||(t=Tt(t));const s=Math.round(e.duration*(n.fps/1e3)*1e3),r=1/n.fps,o=[],a=new Ne(t),i=Z(C.skeleton),A=[];let B,c,l,u,d;a.clipAction(e).play(),a.update(0),t.updateMatrixWorld();for(let f=0;f<s;++f){const h=f*r;Le(C,t,n);for(let m=0;m<i.length;++m)d=n.names[i[m].name]||i[m].name,l=ye(d,t.skeleton),l&&(c=i[m],u=A[m]=A[m]||{bone:c},n.hip===d&&(u.pos||(u.pos={times:new Float32Array(s),values:new Float32Array(s*3)}),n.useFirstFramePosition&&(f===0&&(B=c.position.clone()),c.position.sub(B)),u.pos.times[f]=h,c.position.toArray(u.pos.values,f*3)),u.quat||(u.quat={times:new Float32Array(s),values:new Float32Array(s*4)}),u.quat.times[f]=h,c.quaternion.toArray(u.quat.values,f*4));a.update(r),t.updateMatrixWorld()}for(let f=0;f<A.length;++f)u=A[f],u&&(u.pos&&o.push(new re(".bones["+u.bone.name+"].position",u.pos.times,u.pos.values)),o.push(new oe(".bones["+u.bone.name+"].quaternion",u.quat.times,u.quat.values)));return a.uncacheAction(e),new Me(e.name,-1,o)}function Rt(C){const t=new Map,e=new Map,n=C.clone();return Oe(C,n,function(s,r){t.set(r,s),e.set(s,r)}),n.traverse(function(s){if(!s.isSkinnedMesh)return;const r=s,o=t.get(s),a=o.skeleton.bones;r.skeleton=o.skeleton.clone(),r.bindMatrix.copy(o.bindMatrix),r.skeleton.bones=a.map(function(i){return e.get(i)}),r.bind(r.skeleton,r.bindMatrix)}),n}function ye(C,t){for(let e=0,n=Z(t);e<n.length;e++)if(C===n[e].name)return n[e]}function Z(C){return Array.isArray(C)?C:C.bones}function Tt(C){const t=new we(C.bones[0]);return t.skeleton=C,t}function Oe(C,t,e){e(C,t);for(let n=0;n<C.children.length;n++)Oe(C.children[n],t.children[n],e)}const gt={retarget:Le,retargetClip:Dt,clone:Rt};function W(C){if(typeof TextDecoder<"u")return new TextDecoder().decode(C);let t="";for(let e=0,n=C.length;e<n;e++)t+=String.fromCharCode(C[e]);try{return decodeURIComponent(escape(t))}catch{return t}}const S="srgb",J="srgb-linear",fe=3001,Ht=3e3;class Ce extends Ee{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new Ot(e)}),this.register(function(e){return new St(e)}),this.register(function(e){return new _t(e)}),this.register(function(e){return new kt(e)}),this.register(function(e){return new Xt(e)}),this.register(function(e){return new Kt(e)}),this.register(function(e){return new Ut(e)}),this.register(function(e){return new Pt(e)}),this.register(function(e){return new Nt(e)}),this.register(function(e){return new yt(e)}),this.register(function(e){return new wt(e)}),this.register(function(e){return new xt(e)}),this.register(function(e){return new Qt(e)}),this.register(function(e){return new vt(e)}),this.register(function(e){return new bt(e)}),this.register(function(e){return new Yt(e)}),this.register(function(e){return new jt(e)})}load(t,e,n,s){const r=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const A=Q.extractUrlBase(t);o=Q.resolveURL(A,this.path)}else o=Q.extractUrlBase(t);this.manager.itemStart(t);const a=function(A){s?s(A):console.error(A),r.manager.itemError(t),r.manager.itemEnd(t)},i=new j(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,function(A){try{r.parse(A,o,function(B){e(B),r.manager.itemEnd(t)},a)}catch(B){a(B)}},n,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,n,s){let r;const o={},a={};if(typeof t=="string")r=JSON.parse(t);else if(t instanceof ArrayBuffer)if(W(new Uint8Array(t.slice(0,4)))===Se){try{o[F.KHR_BINARY_GLTF]=new Zt(t)}catch(B){s&&s(B);return}r=JSON.parse(o[F.KHR_BINARY_GLTF].content)}else r=JSON.parse(W(new Uint8Array(t)));else r=t;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const i=new as(r,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});i.fileLoader.setRequestHeader(this.requestHeader);for(let A=0;A<this.pluginCallbacks.length;A++){const B=this.pluginCallbacks[A](i);B.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[B.name]=B,o[B.name]=!0}if(r.extensionsUsed)for(let A=0;A<r.extensionsUsed.length;++A){const B=r.extensionsUsed[A],c=r.extensionsRequired||[];switch(B){case F.KHR_MATERIALS_UNLIT:o[B]=new Lt;break;case F.KHR_DRACO_MESH_COMPRESSION:o[B]=new Wt(r,this.dracoLoader);break;case F.KHR_TEXTURE_TRANSFORM:o[B]=new Vt;break;case F.KHR_MESH_QUANTIZATION:o[B]=new qt;break;default:c.indexOf(B)>=0&&a[B]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+B+'".')}}i.setExtensions(o),i.setPlugins(a),i.parse(n,s)}parseAsync(t,e){const n=this;return new Promise(function(s,r){n.parse(t,e,s,r)})}}function Jt(){let C={};return{get:function(t){return C[t]},add:function(t,e){C[t]=e},remove:function(t){delete C[t]},removeAll:function(){C={}}}}const F={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class bt{constructor(t){this.parser=t,this.name=F.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(t){const e=this.parser,n="light:"+t;let s=e.cache.get(n);if(s)return s;const r=e.json,i=((r.extensions&&r.extensions[this.name]||{}).lights||[])[t];let A;const B=new K(16777215);i.color!==void 0&&B.setRGB(i.color[0],i.color[1],i.color[2],J);const c=i.range!==void 0?i.range:0;switch(i.type){case"directional":A=new _e(B),A.target.position.set(0,0,-1),A.add(A.target);break;case"point":A=new Qe(B),A.distance=c;break;case"spot":A=new ve(B),A.distance=c,i.spot=i.spot||{},i.spot.innerConeAngle=i.spot.innerConeAngle!==void 0?i.spot.innerConeAngle:0,i.spot.outerConeAngle=i.spot.outerConeAngle!==void 0?i.spot.outerConeAngle:Math.PI/4,A.angle=i.spot.outerConeAngle,A.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,A.target.position.set(0,0,-1),A.add(A.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return A.position.set(0,0,0),A.decay=2,H(A,i),i.intensity!==void 0&&(A.intensity=i.intensity),A.name=e.createUniqueName(i.name||"light_"+t),s=Promise.resolve(A),e.cache.add(n,s),s}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,n=this.parser,r=n.json.nodes[t],a=(r.extensions&&r.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(i){return n._getNodeRef(e.cache,a,i)})}}class Lt{constructor(){this.name=F.KHR_MATERIALS_UNLIT}getMaterialType(){return v}extendParams(t,e,n){const s=[];t.color=new K(1,1,1),t.opacity=1;const r=e.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const o=r.baseColorFactor;t.color.setRGB(o[0],o[1],o[2],J),t.opacity=o[3]}r.baseColorTexture!==void 0&&s.push(n.assignTexture(t,"map",r.baseColorTexture,S))}return Promise.all(s)}}class yt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const s=this.parser.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name].emissiveStrength;return r!==void 0&&(e.emissiveIntensity=r),Promise.resolve()}}class Ot{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];if(o.clearcoatFactor!==void 0&&(e.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&r.push(n.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&r.push(n.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(r.push(n.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Ie(a,a)}return Promise.all(r)}}class St{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_DISPERSION}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const s=this.parser.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return e.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class xt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.iridescenceFactor!==void 0&&(e.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&r.push(n.assignTexture(e,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(e.iridescenceIOR=o.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&r.push(n.assignTexture(e,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(r)}}class Kt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_SHEEN}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[];e.sheenColor=new K(0,0,0),e.sheenRoughness=0,e.sheen=1;const o=s.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],J)}return o.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&r.push(n.assignTexture(e,"sheenColorMap",o.sheenColorTexture,S)),o.sheenRoughnessTexture!==void 0&&r.push(n.assignTexture(e,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}}class Ut{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.transmissionFactor!==void 0&&(e.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&r.push(n.assignTexture(e,"transmissionMap",o.transmissionTexture)),Promise.all(r)}}class Pt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_VOLUME}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];e.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&r.push(n.assignTexture(e,"thicknessMap",o.thicknessTexture)),e.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return e.attenuationColor=new K().setRGB(a[0],a[1],a[2],J),Promise.all(r)}}class Nt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_IOR}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const s=this.parser.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return e.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class wt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_SPECULAR}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];e.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&r.push(n.assignTexture(e,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return e.specularColor=new K().setRGB(a[0],a[1],a[2],J),o.specularColorTexture!==void 0&&r.push(n.assignTexture(e,"specularColorMap",o.specularColorTexture,S)),Promise.all(r)}}class vt{constructor(t){this.parser=t,this.name=F.EXT_MATERIALS_BUMP}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return e.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&r.push(n.assignTexture(e,"bumpMap",o.bumpTexture)),Promise.all(r)}}class Qt{constructor(t){this.parser=t,this.name=F.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const n=this.parser.json.materials[t];return!n.extensions||!n.extensions[this.name]?null:g}extendMaterialParams(t,e){const n=this.parser,s=n.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],o=s.extensions[this.name];return o.anisotropyStrength!==void 0&&(e.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(e.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&r.push(n.assignTexture(e,"anisotropyMap",o.anisotropyTexture)),Promise.all(r)}}class _t{constructor(t){this.parser=t,this.name=F.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,n=e.json,s=n.textures[t];if(!s.extensions||!s.extensions[this.name])return null;const r=s.extensions[this.name],o=e.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,o)}}class kt{constructor(t){this.parser=t,this.name=F.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,n=this.parser,s=n.json,r=s.textures[t];if(!r.extensions||!r.extensions[e])return null;const o=r.extensions[e],a=s.images[o.source];let i=n.textureLoader;if(a.uri){const A=n.options.manager.getHandler(a.uri);A!==null&&(i=A)}return this.detectSupport().then(function(A){if(A)return n.loadTextureImage(t,o.source,i);if(s.extensionsRequired&&s.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class Xt{constructor(t){this.parser=t,this.name=F.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,n=this.parser,s=n.json,r=s.textures[t];if(!r.extensions||!r.extensions[e])return null;const o=r.extensions[e],a=s.images[o.source];let i=n.textureLoader;if(a.uri){const A=n.options.manager.getHandler(a.uri);A!==null&&(i=A)}return this.detectSupport().then(function(A){if(A)return n.loadTextureImage(t,o.source,i);if(s.extensionsRequired&&s.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class Yt{constructor(t){this.name=F.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,n=e.bufferViews[t];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const i=s.byteOffset||0,A=s.byteLength||0,B=s.count,c=s.byteStride,l=new Uint8Array(a,i,A);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(B,c,l,s.mode,s.filter).then(function(u){return u.buffer}):o.ready.then(function(){const u=new ArrayBuffer(B*c);return o.decodeGltfBuffer(new Uint8Array(u),B,c,l,s.mode,s.filter),u})})}else return null}}class jt{constructor(t){this.name=F.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,n=e.nodes[t];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=e.meshes[n.mesh];for(const A of s.primitives)if(A.mode!==D.TRIANGLES&&A.mode!==D.TRIANGLE_STRIP&&A.mode!==D.TRIANGLE_FAN&&A.mode!==void 0)return null;const o=n.extensions[this.name].attributes,a=[],i={};for(const A in o)a.push(this.parser.getDependency("accessor",o[A]).then(B=>(i[A]=B,i[A])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(A=>{const B=A.pop(),c=B.isGroup?B.children:[B],l=A[0].count,u=[];for(const d of c){const f=new x,h=new y,m=new ce,p=new y(1,1,1),M=new ke(d.geometry,d.material,l);for(let G=0;G<l;G++)i.TRANSLATION&&h.fromBufferAttribute(i.TRANSLATION,G),i.ROTATION&&m.fromBufferAttribute(i.ROTATION,G),i.SCALE&&p.fromBufferAttribute(i.SCALE,G),M.setMatrixAt(G,f.compose(h,m,p));for(const G in i)if(G==="_COLOR_0"){const E=i[G];M.instanceColor=new Xe(E.array,E.itemSize,E.normalized)}else G!=="TRANSLATION"&&G!=="ROTATION"&&G!=="SCALE"&&d.geometry.setAttribute(G,i[G]);De.prototype.copy.call(M,d),this.parser.assignFinalMaterial(M),u.push(M)}return B.isGroup?(B.clear(),B.add(...u),B):u[0]}))}}const Se="glTF",w=12,me={JSON:1313821514,BIN:5130562};class Zt{constructor(t){this.name=F.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,w);if(this.header={magic:W(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Se)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-w,s=new DataView(t,w);let r=0;for(;r<n;){const o=s.getUint32(r,!0);r+=4;const a=s.getUint32(r,!0);if(r+=4,a===me.JSON){const i=new Uint8Array(t,w+r,o);this.content=W(i)}else if(a===me.BIN){const i=w+r;this.body=t.slice(i,i+o)}r+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Wt{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=F.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const n=this.json,s=this.dracoLoader,r=t.extensions[this.name].bufferView,o=t.extensions[this.name].attributes,a={},i={},A={};for(const B in o){const c=ae[B]||B.toLowerCase();a[c]=o[B]}for(const B in t.attributes){const c=ae[B]||B.toLowerCase();if(o[B]!==void 0){const l=n.accessors[t.attributes[B]],u=P[l.componentType];A[c]=u.name,i[c]=l.normalized===!0}}return e.getDependency("bufferView",r).then(function(B){return new Promise(function(c,l){s.decodeDracoFile(B,function(u){for(const d in u.attributes){const f=u.attributes[d],h=i[d];h!==void 0&&(f.normalized=h)}c(u)},a,A,J,l)})})}}class Vt{constructor(){this.name=F.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class qt{constructor(){this.name=F.KHR_MESH_QUANTIZATION}}class xe extends pt{constructor(t,e,n,s){super(t,e,n,s)}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=t*s*3+s;for(let o=0;o!==s;o++)e[o]=n[r+o];return e}interpolate_(t,e,n,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,i=a*2,A=a*3,B=s-e,c=(n-e)/B,l=c*c,u=l*c,d=t*A,f=d-A,h=-2*u+3*l,m=u-l,p=1-h,M=m-l+c;for(let G=0;G!==a;G++){const E=o[f+G+a],I=o[f+G+i]*B,R=o[d+G+a],N=o[d+G]*B;r[G]=p*E+M*I+h*R+m*N}return r}}const zt=new ce;class $t extends xe{interpolate_(t,e,n,s){const r=super.interpolate_(t,e,n,s);return zt.fromArray(r).normalize().toArray(r),r}}const D={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},P={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},pe={9728:ze,9729:Te,9984:qe,9985:Ve,9986:We,9987:Re},Fe={33071:et,33648:$e,10497:ie},$={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ae={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...It>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},L={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},es={CUBICSPLINE:void 0,LINEAR:be,STEP:ht},ee={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ts(C){return C.DefaultMaterial===void 0&&(C.DefaultMaterial=new ge({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:mt})),C.DefaultMaterial}function O(C,t,e){for(const n in e.extensions)C[n]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=e.extensions[n])}function H(C,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(C.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ss(C,t,e){let n=!1,s=!1,r=!1;for(let A=0,B=t.length;A<B;A++){const c=t[A];if(c.POSITION!==void 0&&(n=!0),c.NORMAL!==void 0&&(s=!0),c.COLOR_0!==void 0&&(r=!0),n&&s&&r)break}if(!n&&!s&&!r)return Promise.resolve(C);const o=[],a=[],i=[];for(let A=0,B=t.length;A<B;A++){const c=t[A];if(n){const l=c.POSITION!==void 0?e.getDependency("accessor",c.POSITION):C.attributes.position;o.push(l)}if(s){const l=c.NORMAL!==void 0?e.getDependency("accessor",c.NORMAL):C.attributes.normal;a.push(l)}if(r){const l=c.COLOR_0!==void 0?e.getDependency("accessor",c.COLOR_0):C.attributes.color;i.push(l)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(i)]).then(function(A){const B=A[0],c=A[1],l=A[2];return n&&(C.morphAttributes.position=B),s&&(C.morphAttributes.normal=c),r&&(C.morphAttributes.color=l),C.morphTargetsRelative=!0,C})}function ns(C,t){if(C.updateMorphTargets(),t.weights!==void 0)for(let e=0,n=t.weights.length;e<n;e++)C.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(C.morphTargetInfluences.length===e.length){C.morphTargetDictionary={};for(let n=0,s=e.length;n<s;n++)C.morphTargetDictionary[e[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function rs(C){let t;const e=C.extensions&&C.extensions[F.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+te(e.attributes):t=C.indices+":"+te(C.attributes)+":"+C.mode,C.targets!==void 0)for(let n=0,s=C.targets.length;n<s;n++)t+=":"+te(C.targets[n]);return t}function te(C){let t="";const e=Object.keys(C).sort();for(let n=0,s=e.length;n<s;n++)t+=e[n]+":"+C[e[n]]+";";return t}function Ae(C){switch(C){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function os(C){return C.search(/\.jpe?g($|\?)/i)>0||C.search(/^data\:image\/jpeg/)===0?"image/jpeg":C.search(/\.webp($|\?)/i)>0||C.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const is=new x;class as{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new Jt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,s=!1,r=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||s&&r<98?this.textureLoader=new Ye(this.options.manager):this.textureLoader=new je(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new j(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:n,userData:{}};return O(r,a,s),H(a,s),Promise.all(n._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){for(const i of a.scenes)i.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=e.length;s<r;s++){const o=e[s].joints;for(let a=0,i=o.length;a<i;a++)t[o[a]].isBone=!0}for(let s=0,r=t.length;s<r;s++){const o=t[s];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,n){if(t.refs[e]<=1)return n;const s=n.clone(),r=(o,a)=>{const i=this.associations.get(o);i!=null&&this.associations.set(a,i);for(const[A,B]of o.children.entries())r(B,a.children[A])};return r(n,s),s.name+="_instance_"+t.uses[e]++,s}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let n=0;n<e.length;n++){const s=t(e[n]);if(s)return s}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const n=[];for(let s=0;s<e.length;s++){const r=t(e[s]);r&&n.push(r)}return n}getDependency(t,e){const n=t+":"+e;let s=this.cache.get(n);if(!s){switch(t){case"scene":s=this.loadScene(e);break;case"node":s=this._invokeOne(function(r){return r.loadNode&&r.loadNode(e)});break;case"mesh":s=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(e)});break;case"accessor":s=this.loadAccessor(e);break;case"bufferView":s=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(e)});break;case"buffer":s=this.loadBuffer(e);break;case"material":s=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(e)});break;case"texture":s=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(e)});break;case"skin":s=this.loadSkin(e);break;case"animation":s=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(e)});break;case"camera":s=this.loadCamera(e);break;default:if(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(t,e)}),!s)throw new Error("Unknown type: "+t);break}this.cache.add(n,s)}return s}getDependencies(t){let e=this.cache.get(t);if(!e){const n=this,s=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(s.map(function(r,o){return n.getDependency(t,o)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],n=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[F.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(r,o){n.load(Q.resolveURL(e.uri,s.path),r,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(n){const s=e.byteLength||0,r=e.byteOffset||0;return n.slice(r,r+s)})}loadAccessor(t){const e=this,n=this.json,s=this.json.accessors[t];if(s.bufferView===void 0&&s.sparse===void 0){const o=$[s.type],a=P[s.componentType],i=s.normalized===!0,A=new a(s.count*o);return Promise.resolve(new _(A,o,i))}const r=[];return s.bufferView!==void 0?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),s.sparse!==void 0&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(o){const a=o[0],i=$[s.type],A=P[s.componentType],B=A.BYTES_PER_ELEMENT,c=B*i,l=s.byteOffset||0,u=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,d=s.normalized===!0;let f,h;if(u&&u!==c){const m=Math.floor(l/u),p="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+m+":"+s.count;let M=e.cache.get(p);M||(f=new A(a,m*u,s.count*u/B),M=new Ze(f,u/B),e.cache.add(p,M)),h=new ft(M,i,l%u/B,d)}else a===null?f=new A(s.count*i):f=new A(a,l,s.count*i),h=new _(f,i,d);if(s.sparse!==void 0){const m=$.SCALAR,p=P[s.sparse.indices.componentType],M=s.sparse.indices.byteOffset||0,G=s.sparse.values.byteOffset||0,E=new p(o[1],M,s.sparse.count*m),I=new A(o[2],G,s.sparse.count*i);a!==null&&(h=new _(h.array.slice(),h.itemSize,h.normalized));for(let R=0,N=E.length;R<N;R++){const b=E[R];if(h.setX(b,I[R*i]),i>=2&&h.setY(b,I[R*i+1]),i>=3&&h.setZ(b,I[R*i+2]),i>=4&&h.setW(b,I[R*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return h})}loadTexture(t){const e=this.json,n=this.options,r=e.textures[t].source,o=e.images[r];let a=this.textureLoader;if(o.uri){const i=n.manager.getHandler(o.uri);i!==null&&(a=i)}return this.loadTextureImage(t,r,a)}loadTextureImage(t,e,n){const s=this,r=this.json,o=r.textures[t],a=r.images[e],i=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[i])return this.textureCache[i];const A=this.loadImageSource(e,n).then(function(B){B.flipY=!1,B.name=o.name||a.name||"",B.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(B.name=a.uri);const l=(r.samplers||{})[o.sampler]||{};return B.magFilter=pe[l.magFilter]||Te,B.minFilter=pe[l.minFilter]||Re,B.wrapS=Fe[l.wrapS]||ie,B.wrapT=Fe[l.wrapT]||ie,s.associations.set(B,{textures:t}),B}).catch(function(){return null});return this.textureCache[i]=A,A}loadImageSource(t,e){const n=this,s=this.json,r=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(c=>c.clone());const o=s.images[t],a=self.URL||self.webkitURL;let i=o.uri||"",A=!1;if(o.bufferView!==void 0)i=n.getDependency("bufferView",o.bufferView).then(function(c){A=!0;const l=new Blob([c],{type:o.mimeType});return i=a.createObjectURL(l),i});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const B=Promise.resolve(i).then(function(c){return new Promise(function(l,u){let d=l;e.isImageBitmapLoader===!0&&(d=function(f){const h=new ue(f);h.needsUpdate=!0,l(h)}),e.load(Q.resolveURL(c,r.path),d,void 0,u)})}).then(function(c){return A===!0&&a.revokeObjectURL(i),H(c,o),c.userData.mimeType=o.mimeType||os(o.uri),c}).catch(function(c){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),c});return this.sourceCache[t]=B,B}assignTexture(t,e,n,s){const r=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),r.extensions[F.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[F.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=r.associations.get(o);o=r.extensions[F.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,i)}}return s!==void 0&&(typeof s=="number"&&(s=s===fe?S:J),"colorSpace"in o?o.colorSpace=s:o.encoding=s===S?fe:Ht),t[e]=o,o})}assignFinalMaterial(t){const e=t.geometry;let n=t.material;const s=e.attributes.tangent===void 0,r=e.attributes.color!==void 0,o=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+n.uuid;let i=this.cache.get(a);i||(i=new tt,q.prototype.copy.call(i,n),i.color.copy(n.color),i.map=n.map,i.sizeAttenuation=!1,this.cache.add(a,i)),n=i}else if(t.isLine){const a="LineBasicMaterial:"+n.uuid;let i=this.cache.get(a);i||(i=new st,q.prototype.copy.call(i,n),i.color.copy(n.color),i.map=n.map,this.cache.add(a,i)),n=i}if(s||r||o){let a="ClonedMaterial:"+n.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=n.clone(),r&&(i.vertexColors=!0),o&&(i.flatShading=!0),s&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(n))),n=i}t.material=n}getMaterialType(){return ge}loadMaterial(t){const e=this,n=this.json,s=this.extensions,r=n.materials[t];let o;const a={},i=r.extensions||{},A=[];if(i[F.KHR_MATERIALS_UNLIT]){const c=s[F.KHR_MATERIALS_UNLIT];o=c.getMaterialType(),A.push(c.extendParams(a,r,e))}else{const c=r.pbrMetallicRoughness||{};if(a.color=new K(1,1,1),a.opacity=1,Array.isArray(c.baseColorFactor)){const l=c.baseColorFactor;a.color.setRGB(l[0],l[1],l[2],J),a.opacity=l[3]}c.baseColorTexture!==void 0&&A.push(e.assignTexture(a,"map",c.baseColorTexture,S)),a.metalness=c.metallicFactor!==void 0?c.metallicFactor:1,a.roughness=c.roughnessFactor!==void 0?c.roughnessFactor:1,c.metallicRoughnessTexture!==void 0&&(A.push(e.assignTexture(a,"metalnessMap",c.metallicRoughnessTexture)),A.push(e.assignTexture(a,"roughnessMap",c.metallicRoughnessTexture))),o=this._invokeOne(function(l){return l.getMaterialType&&l.getMaterialType(t)}),A.push(Promise.all(this._invokeAll(function(l){return l.extendMaterialParams&&l.extendMaterialParams(t,a)})))}r.doubleSided===!0&&(a.side=nt);const B=r.alphaMode||ee.OPAQUE;if(B===ee.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,B===ee.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==v&&(A.push(e.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Ie(1,1),r.normalTexture.scale!==void 0)){const c=r.normalTexture.scale;a.normalScale.set(c,c)}if(r.occlusionTexture!==void 0&&o!==v&&(A.push(e.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==v){const c=r.emissiveFactor;a.emissive=new K().setRGB(c[0],c[1],c[2],J)}return r.emissiveTexture!==void 0&&o!==v&&A.push(e.assignTexture(a,"emissiveMap",r.emissiveTexture,S)),Promise.all(A).then(function(){const c=new o(a);return r.name&&(c.name=r.name),H(c,r),e.associations.set(c,{materials:t}),r.extensions&&O(s,c,r),c})}createUniqueName(t){const e=rt.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,n=this.extensions,s=this.primitiveCache;function r(a){return n[F.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(i){return Ge(i,a,e)})}const o=[];for(let a=0,i=t.length;a<i;a++){const A=t[a],B=rs(A),c=s[B];if(c)o.push(c.promise);else{let l;A.extensions&&A.extensions[F.KHR_DRACO_MESH_COMPRESSION]?l=r(A):l=Ge(new He,A,e),s[B]={primitive:A,promise:l},o.push(l)}}return Promise.all(o)}loadMesh(t){const e=this,n=this.json,s=this.extensions,r=n.meshes[t],o=r.primitives,a=[];for(let i=0,A=o.length;i<A;i++){const B=o[i].material===void 0?ts(this.cache):this.getDependency("material",o[i].material);a.push(B)}return a.push(e.loadGeometries(o)),Promise.all(a).then(function(i){const A=i.slice(0,i.length-1),B=i[i.length-1],c=[];for(let u=0,d=B.length;u<d;u++){const f=B[u],h=o[u];let m;const p=A[u];if(h.mode===D.TRIANGLES||h.mode===D.TRIANGLE_STRIP||h.mode===D.TRIANGLE_FAN||h.mode===void 0)m=r.isSkinnedMesh===!0?new ot(f,p):new Je(f,p),m.isSkinnedMesh===!0&&m.normalizeSkinWeights(),h.mode===D.TRIANGLE_STRIP?m.geometry=he(m.geometry,Mt):h.mode===D.TRIANGLE_FAN&&(m.geometry=he(m.geometry,Et));else if(h.mode===D.LINES)m=new it(f,p);else if(h.mode===D.LINE_STRIP)m=new at(f,p);else if(h.mode===D.LINE_LOOP)m=new At(f,p);else if(h.mode===D.POINTS)m=new Bt(f,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);Object.keys(m.geometry.morphAttributes).length>0&&ns(m,r),m.name=e.createUniqueName(r.name||"mesh_"+t),H(m,r),h.extensions&&O(s,m,h),e.assignFinalMaterial(m),c.push(m)}for(let u=0,d=c.length;u<d;u++)e.associations.set(c[u],{meshes:t,primitives:u});if(c.length===1)return r.extensions&&O(s,c[0],r),c[0];const l=new z;r.extensions&&O(s,l,r),e.associations.set(l,{meshes:t});for(let u=0,d=c.length;u<d;u++)l.add(c[u]);return l})}loadCamera(t){let e;const n=this.json.cameras[t],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?e=new ct(lt.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(e=new Ct(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(e.name=this.createUniqueName(n.name)),H(e,n),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],n=[];for(let s=0,r=e.joints.length;s<r;s++)n.push(this._loadNodeShallow(e.joints[s]));return e.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",e.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const r=s.pop(),o=s,a=[],i=[];for(let A=0,B=o.length;A<B;A++){const c=o[A];if(c){a.push(c);const l=new x;r!==null&&l.fromArray(r.array,A*16),i.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[A])}return new ut(a,i)})}loadAnimation(t){const e=this.json,n=this,s=e.animations[t],r=s.name?s.name:"animation_"+t,o=[],a=[],i=[],A=[],B=[];for(let c=0,l=s.channels.length;c<l;c++){const u=s.channels[c],d=s.samplers[u.sampler],f=u.target,h=f.node,m=s.parameters!==void 0?s.parameters[d.input]:d.input,p=s.parameters!==void 0?s.parameters[d.output]:d.output;f.node!==void 0&&(o.push(this.getDependency("node",h)),a.push(this.getDependency("accessor",m)),i.push(this.getDependency("accessor",p)),A.push(d),B.push(f))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(i),Promise.all(A),Promise.all(B)]).then(function(c){const l=c[0],u=c[1],d=c[2],f=c[3],h=c[4],m=[];for(let p=0,M=l.length;p<M;p++){const G=l[p],E=u[p],I=d[p],R=f[p],N=h[p];if(G===void 0)continue;G.updateMatrix&&G.updateMatrix();const b=n._createAnimationTracks(G,E,I,R,N);if(b)for(let V=0;V<b.length;V++)m.push(b[V])}return new Me(r,void 0,m)})}createNodeMesh(t){const e=this.json,n=this,s=e.nodes[t];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(r){const o=n._getNodeRef(n.meshCache,s.mesh,r);return s.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let i=0,A=s.weights.length;i<A;i++)a.morphTargetInfluences[i]=s.weights[i]}),o})}loadNode(t){const e=this.json,n=this,s=e.nodes[t],r=n._loadNodeShallow(t),o=[],a=s.children||[];for(let A=0,B=a.length;A<B;A++)o.push(n.getDependency("node",a[A]));const i=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([r,Promise.all(o),i]).then(function(A){const B=A[0],c=A[1],l=A[2];l!==null&&B.traverse(function(u){u.isSkinnedMesh&&u.bind(l,is)});for(let u=0,d=c.length;u<d;u++)B.add(c[u]);return B})}_loadNodeShallow(t){const e=this.json,n=this.extensions,s=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const r=e.nodes[t],o=r.name?s.createUniqueName(r.name):"",a=[],i=s._invokeOne(function(A){return A.createNodeMesh&&A.createNodeMesh(t)});return i&&a.push(i),r.camera!==void 0&&a.push(s.getDependency("camera",r.camera).then(function(A){return s._getNodeRef(s.cameraCache,r.camera,A)})),s._invokeAll(function(A){return A.createNodeAttachment&&A.createNodeAttachment(t)}).forEach(function(A){a.push(A)}),this.nodeCache[t]=Promise.all(a).then(function(A){let B;if(r.isBone===!0?B=new dt:A.length>1?B=new z:A.length===1?B=A[0]:B=new De,B!==A[0])for(let c=0,l=A.length;c<l;c++)B.add(A[c]);if(r.name&&(B.userData.name=r.name,B.name=o),H(B,r),r.extensions&&O(n,B,r),r.matrix!==void 0){const c=new x;c.fromArray(r.matrix),B.applyMatrix4(c)}else r.translation!==void 0&&B.position.fromArray(r.translation),r.rotation!==void 0&&B.quaternion.fromArray(r.rotation),r.scale!==void 0&&B.scale.fromArray(r.scale);return s.associations.has(B)||s.associations.set(B,{}),s.associations.get(B).nodes=t,B}),this.nodeCache[t]}loadScene(t){const e=this.extensions,n=this.json.scenes[t],s=this,r=new z;n.name&&(r.name=s.createUniqueName(n.name)),H(r,n),n.extensions&&O(e,r,n);const o=n.nodes||[],a=[];for(let i=0,A=o.length;i<A;i++)a.push(s.getDependency("node",o[i]));return Promise.all(a).then(function(i){for(let B=0,c=i.length;B<c;B++)r.add(i[B]);const A=B=>{const c=new Map;for(const[l,u]of s.associations)(l instanceof q||l instanceof ue)&&c.set(l,u);return B.traverse(l=>{const u=s.associations.get(l);u!=null&&c.set(l,u)}),c};return s.associations=A(r),r})}_createAnimationTracks(t,e,n,s,r){const o=[],a=t.name?t.name:t.uuid,i=[];L[r.path]===L.weights?t.traverse(function(l){l.morphTargetInfluences&&i.push(l.name?l.name:l.uuid)}):i.push(a);let A;switch(L[r.path]){case L.weights:A=de;break;case L.rotation:A=oe;break;case L.position:case L.scale:A=re;break;default:switch(n.itemSize){case 1:A=de;break;case 2:case 3:default:A=re;break}break}const B=s.interpolation!==void 0?es[s.interpolation]:be,c=this._getArrayFromAccessor(n);for(let l=0,u=i.length;l<u;l++){const d=new A(i[l]+"."+L[r.path],e.array,c,B);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(d),o.push(d)}return o}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const n=Ae(e.constructor),s=new Float32Array(e.length);for(let r=0,o=e.length;r<o;r++)s[r]=e[r]*n;e=s}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(n){const s=this instanceof oe?$t:xe;return new s(this.times,this.values,this.getValueSize()/3,n)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function As(C,t,e){const n=t.attributes,s=new Ft;if(n.POSITION!==void 0){const a=e.json.accessors[n.POSITION],i=a.min,A=a.max;if(i!==void 0&&A!==void 0){if(s.set(new y(i[0],i[1],i[2]),new y(A[0],A[1],A[2])),a.normalized){const B=Ae(P[a.componentType]);s.min.multiplyScalar(B),s.max.multiplyScalar(B)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=t.targets;if(r!==void 0){const a=new y,i=new y;for(let A=0,B=r.length;A<B;A++){const c=r[A];if(c.POSITION!==void 0){const l=e.json.accessors[c.POSITION],u=l.min,d=l.max;if(u!==void 0&&d!==void 0){if(i.setX(Math.max(Math.abs(u[0]),Math.abs(d[0]))),i.setY(Math.max(Math.abs(u[1]),Math.abs(d[1]))),i.setZ(Math.max(Math.abs(u[2]),Math.abs(d[2]))),l.normalized){const f=Ae(P[l.componentType]);i.multiplyScalar(f)}a.max(i)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(a)}C.boundingBox=s;const o=new Gt;s.getCenter(o.center),o.radius=s.min.distanceTo(s.max)/2,C.boundingSphere=o}function Ge(C,t,e){const n=t.attributes,s=[];function r(o,a){return e.getDependency("accessor",o).then(function(i){C.setAttribute(a,i)})}for(const o in n){const a=ae[o]||o.toLowerCase();a in C.attributes||s.push(r(n[o],a))}if(t.indices!==void 0&&!C.index){const o=e.getDependency("accessor",t.indices).then(function(a){C.setIndex(a)});s.push(o)}return H(C,t),As(C,t,e),Promise.all(s).then(function(){return t.targets!==void 0?ss(C,t.targets,e):C})}const se=new WeakMap;class Bs extends Ee{constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,n,s){const r=new j(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(t,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(e).catch(s)},n,s)}decodeDracoFile(t,e,n,s){const r={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(t,r).then(e)}decodeGeometry(t,e){for(const i in e.attributeTypes){const A=e.attributeTypes[i];A.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=A.name)}const n=JSON.stringify(e);if(se.has(t)){const i=se.get(t);if(i.key===n)return i.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const r=this.workerNextTaskID++,o=t.byteLength,a=this._getWorker(r,o).then(i=>(s=i,new Promise((A,B)=>{s._callbacks[r]={resolve:A,reject:B},s.postMessage({type:"decode",id:r,taskConfig:e,buffer:t},[t])}))).then(i=>this._createGeometry(i.geometry));return a.catch(()=>!0).then(()=>{s&&r&&this._releaseTask(s,r)}),se.set(t,{key:n,promise:a}),a}_createGeometry(t){const e=new He;t.index&&e.setIndex(new _(t.index.array,1));for(let n=0;n<t.attributes.length;n++){const s=t.attributes[n],r=s.name,o=s.array,a=s.itemSize;e.setAttribute(r,new _(o,a))}return e}_loadLibrary(t,e){const n=new j(this.manager);return n.setPath(this.decoderPath),n.setResponseType(e),n.setWithCredentials(this.withCredentials),new Promise((s,r)=>{n.load(t,s,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then(n=>{const s=n[0];t||(this.decoderConfig.wasmBinary=n[1]);const r=cs.toString(),o=["/* draco decoder */",s,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
2
- `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(r){const o=r.data;switch(o.type){case"decode":s._callbacks[o.id].resolve(o);break;case"error":s._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,r){return s._taskLoad>r._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[t]=e,n._taskLoad+=e,n})}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this}}function cs(){let C,t;onmessage=function(o){const a=o.data;switch(a.type){case"init":C=a.decoderConfig,t=new Promise(function(B){C.onModuleLoaded=function(c){B({draco:c})},DracoDecoderModule(C)});break;case"decode":const i=a.buffer,A=a.taskConfig;t.then(B=>{const c=B.draco,l=new c.Decoder,u=new c.DecoderBuffer;u.Init(new Int8Array(i),i.byteLength);try{const d=e(c,l,u,A),f=d.attributes.map(h=>h.array.buffer);d.index&&f.push(d.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:d},f)}catch(d){console.error(d),self.postMessage({type:"error",id:a.id,error:d.message})}finally{c.destroy(u),c.destroy(l)}});break}};function e(o,a,i,A){const B=A.attributeIDs,c=A.attributeTypes;let l,u;const d=a.GetEncodedGeometryType(i);if(d===o.TRIANGULAR_MESH)l=new o.Mesh,u=a.DecodeBufferToMesh(i,l);else if(d===o.POINT_CLOUD)l=new o.PointCloud,u=a.DecodeBufferToPointCloud(i,l);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||l.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());const f={index:null,attributes:[]};for(const h in B){const m=self[c[h]];let p,M;if(A.useUniqueIDs)M=B[h],p=a.GetAttributeByUniqueId(l,M);else{if(M=a.GetAttributeId(l,o[B[h]]),M===-1)continue;p=a.GetAttribute(l,M)}f.attributes.push(s(o,a,l,h,m,p))}return d===o.TRIANGULAR_MESH&&(f.index=n(o,a,l)),o.destroy(l),f}function n(o,a,i){const B=i.num_faces()*3,c=B*4,l=o._malloc(c);a.GetTrianglesUInt32Array(i,c,l);const u=new Uint32Array(o.HEAPF32.buffer,l,B).slice();return o._free(l),{array:u,itemSize:1}}function s(o,a,i,A,B,c){const l=c.num_components(),d=i.num_points()*l,f=d*B.BYTES_PER_ELEMENT,h=r(o,B),m=o._malloc(f);a.GetAttributeDataArrayForAllPoints(i,c,h,f,m);const p=new B(o.HEAPF32.buffer,m,d).slice();return o._free(m),{name:A,array:p,itemSize:l}}function r(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case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CTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let s=C;WebAssembly.validate(e)&&(s=t);let r;const o=WebAssembly.instantiate(a(s),{}).then(c=>{r=c.instance,r.exports.__wasm_call_ctors()});function a(c){const l=new Uint8Array(c.length);for(let d=0;d<c.length;++d){const f=c.charCodeAt(d);l[d]=f>96?f-71:f>64?f-65:f>47?f+4:f>46?63:62}let u=0;for(let d=0;d<c.length;++d)l[u++]=l[d]<60?n[l[d]]:(l[d]-60)*64+l[++d];return l.buffer.slice(0,u)}function i(c,l,u,d,f,h){const m=r.exports.sbrk,p=u+3&-4,M=m(p*d),G=m(f.length),E=new Uint8Array(r.exports.memory.buffer);E.set(f,G);const I=c(M,u,d,G,f.length);if(I===0&&h&&h(M,p,d),l.set(E.subarray(M,M+u*d)),m(M-m(0)),I!==0)throw new Error(`Malformed buffer data: ${I}`)}const A={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},B={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return X={ready:o,supported:!0,decodeVertexBuffer(c,l,u,d,f){i(r.exports.meshopt_decodeVertexBuffer,c,l,u,d,r.exports[A[f]])},decodeIndexBuffer(c,l,u,d){i(r.exports.meshopt_decodeIndexBuffer,c,l,u,d)},decodeIndexSequence(c,l,u,d){i(r.exports.meshopt_decodeIndexSequence,c,l,u,d)},decodeGltfBuffer(c,l,u,d,f,h){i(r.exports[B[f]],c,l,u,d,r.exports[A[h]])}},X};function ls(C,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:e,inject:n,castShadow:s,receiveShadow:r}){let o={};for(const a of t)o[a]=C[a];return e&&(o.geometry&&e!=="materialsOnly"&&(o.geometry=o.geometry.clone()),o.material&&e!=="geometriesOnly"&&(o.material=o.material.clone())),n&&(typeof n=="function"?o={...o,children:n(C)}:T.isValidElement(n)?o={...o,children:n}:o={...o,...n}),C instanceof Je&&(s&&(o.castShadow=!0),r&&(o.receiveShadow=!0)),o}const Be=T.forwardRef(({isChild:C=!1,object:t,children:e,deep:n,castShadow:s,receiveShadow:r,inject:o,keys:a,...i},A)=>{const B={keys:a,deep:n,inject:o,castShadow:s,receiveShadow:r};if(t=T.useMemo(()=>{if(C===!1&&!Array.isArray(t)){let d=!1;if(t.traverse(f=>{f.isSkinnedMesh&&(d=!0)}),d)return gt.clone(t)}return t},[t,C]),Array.isArray(t))return T.createElement("group",U({},i,{ref:A}),t.map(d=>T.createElement(Be,U({key:d.uuid,object:d},B))),e);const{children:c,...l}=ls(t,B),u=t.type[0].toLowerCase()+t.type.slice(1);return T.createElement(u,U({},l,i,{ref:A}),t.children.map(d=>d.type==="Bone"?T.createElement("primitive",U({key:d.uuid,object:d},B)):T.createElement(Be,U({key:d.uuid,object:d},B,{isChild:!0}))),e,c)});let Y=null,Ke="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function Ue(C=!0,t=!0,e){return n=>{e&&e(n),C&&(Y||(Y=new Bs),Y.setDecoderPath(typeof C=="string"?C:Ke),n.setDRACOLoader(Y)),t&&n.setMeshoptDecoder(typeof ne=="function"?ne():ne)}}const k=(C,t,e,n)=>le(Ce,C,Ue(t,e,n));k.preload=(C,t,e,n)=>le.preload(Ce,C,Ue(t,e,n));k.clear=C=>le.clear(Ce,C);k.setDecoderPath=C=>{Ke=C};const Cs=T.forwardRef(({src:C,useDraco:t,useMeshOpt:e,extendLoader:n,...s},r)=>{const{scene:o}=k(C,t,e,n);return T.createElement(Be,U({ref:r},s,{object:o}))}),ps=Object.freeze(Object.defineProperty({__proto__:null,Gltf:Cs,useGLTF:k},Symbol.toStringTag,{value:"Module"}));export{Be as C,Cs as G,ps as a,W as d,k as u,It as v};
@@ -1,5 +0,0 @@
1
- import{J as P,K as b,Z as G,_ as L,X as z,k as u}from"./three.module-D396a9Mn.js";class J extends P{constructor(g){super(g),this.type=b}parse(g){const _=function(r,a){switch(r){case 1:throw new Error("THREE.HDRLoader: Read Error: "+(a||""));case 2:throw new Error("THREE.HDRLoader: Write Error: "+(a||""));case 3:throw new Error("THREE.HDRLoader: Bad File Format: "+(a||""));default:case 4:throw new Error("THREE.HDRLoader: Memory Error: "+(a||""))}},H=function(r,a,o){a=a||1024;let s=r.pos,i=-1,e=0,l="",t=String.fromCharCode.apply(null,new Uint16Array(r.subarray(s,s+128)));for(;0>(i=t.indexOf(`
2
- `))&&e<a&&s<r.byteLength;)l+=t,e+=t.length,s+=128,t+=String.fromCharCode.apply(null,new Uint16Array(r.subarray(s,s+128)));return-1<i?(r.pos+=e+i+1,l+t.slice(0,i)):!1},U=function(r){const a=/^#\?(\S+)/,o=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,n=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,i=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,e={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,t;for((r.pos>=r.byteLength||!(l=H(r)))&&_(1,"no header found"),(t=l.match(a))||_(3,"bad initial token"),e.valid|=1,e.programtype=t[1],e.string+=l+`
3
- `;l=H(r),l!==!1;){if(e.string+=l+`
4
- `,l.charAt(0)==="#"){e.comments+=l+`
5
- `;continue}if((t=l.match(o))&&(e.gamma=parseFloat(t[1])),(t=l.match(n))&&(e.exposure=parseFloat(t[1])),(t=l.match(s))&&(e.valid|=2,e.format=t[1]),(t=l.match(i))&&(e.valid|=4,e.height=parseInt(t[1],10),e.width=parseInt(t[2],10)),e.valid&2&&e.valid&4)break}return e.valid&2||_(3,"missing format specifier"),e.valid&4||_(3,"missing image size specifier"),e},V=function(r,a,o){const n=a;if(n<8||n>32767||r[0]!==2||r[1]!==2||r[2]&128)return new Uint8Array(r);n!==(r[2]<<8|r[3])&&_(3,"wrong scanline width");const s=new Uint8Array(4*a*o);s.length||_(4,"unable to allocate buffer space");let i=0,e=0;const l=4*n,t=new Uint8Array(4),d=new Uint8Array(l);let N=o;for(;N>0&&e<r.byteLength;){e+4>r.byteLength&&_(1),t[0]=r[e++],t[1]=r[e++],t[2]=r[e++],t[3]=r[e++],(t[0]!=2||t[1]!=2||(t[2]<<8|t[3])!=n)&&_(3,"bad rgbe scanline format");let R=0,c;for(;R<l&&e<r.byteLength;){c=r[e++];const h=c>128;if(h&&(c-=128),(c===0||R+c>l)&&_(3,"bad scanline data"),h){const m=r[e++];for(let f=0;f<c;f++)d[R++]=m}else d.set(r.subarray(e,e+c),R),R+=c,e+=c}const C=n;for(let h=0;h<C;h++){let m=0;s[i]=d[h+m],m+=n,s[i+1]=d[h+m],m+=n,s[i+2]=d[h+m],m+=n,s[i+3]=d[h+m],i+=4}N--}return s},v=function(r,a,o,n){const s=r[a+3],i=Math.pow(2,s-128)/255;o[n+0]=r[a+0]*i,o[n+1]=r[a+1]*i,o[n+2]=r[a+2]*i,o[n+3]=1},x=function(r,a,o,n){const s=r[a+3],i=Math.pow(2,s-128)/255;o[n+0]=L.toHalfFloat(Math.min(r[a+0]*i,65504)),o[n+1]=L.toHalfFloat(Math.min(r[a+1]*i,65504)),o[n+2]=L.toHalfFloat(Math.min(r[a+2]*i,65504)),o[n+3]=L.toHalfFloat(1)},w=new Uint8Array(g);w.pos=0;const E=U(w),T=E.width,k=E.height,y=V(w.subarray(w.pos),T,k);let I,B,p;switch(this.type){case G:p=y.length/4;const r=new Float32Array(p*4);for(let o=0;o<p;o++)v(y,o*4,r,o*4);I=r,B=G;break;case b:p=y.length/4;const a=new Uint16Array(p*4);for(let o=0;o<p;o++)x(y,o*4,a,o*4);I=a,B=b;break;default:throw new Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:T,height:k,data:I,header:E.string,gamma:E.gamma,exposure:E.exposure,type:B}}setDataType(g){return this.type=g,this}load(g,D,S,A){function F(_,M){switch(_.type){case G:case b:_.colorSpace=z,_.minFilter=u,_.magFilter=u,_.generateMipmaps=!1,_.flipY=!0;break}D&&D(_,M)}return super.load(g,F,S,A)}}export{J as HDRLoader};
@@ -1 +0,0 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as o}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{bc as H,bd as W,be as B,bf as M,a9 as v,a4 as P,bg as h,bh as F}from"./index-GIL7oGEO.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";function Q({assetPath:i,displayName:l}){const{sheetPath:n,frameName:t}=H(i),s=`/${n}`,[r,a]=o.useState(null),[x,p]=o.useState(t),[m,u]=o.useState("fit"),[b,I]=o.useState(null),j=o.useRef(null),[w,N]=o.useState({w:320,h:240}),f=x??t,g=f?r?.frames.find(c=>c.name===f)??null:null;o.useEffect(()=>{p(t),u("fit")},[t]),o.useEffect(()=>{if(!t){a(null);return}let c=!1;return fetch(`/${W(n)}`).then(d=>d.ok?d.text():null).then(d=>{c||!d||a(B(d))}).catch(()=>{c||a(null)}),()=>{c=!0}},[t,n]),o.useEffect(()=>{const c=j.current;if(!c)return;const d=new ResizeObserver(R=>{const S=R[0]?.contentRect;S&&N({w:Math.max(1,S.width-24),h:Math.max(1,S.height-24)})});return d.observe(c),()=>d.disconnect()},[]);const y=g?.sourceWidth??b?.w??0,$=g?.sourceHeight??b?.h??0,k=M(m,y,$,w.w,w.h),E=l??f??n.split("/").pop()??i;return e.jsxs("div",{"data-testid":"image-asset-document",style:{height:"100%",minHeight:240,display:"flex",flexDirection:"column",minWidth:0},children:[e.jsx(z,{title:E,srcWidth:y,srcHeight:$,scaleMode:m,scale:k,onScaleMode:u}),e.jsx(C,{stageRef:j,frameName:t,frame:g,sheet:r,sheetUrl:s,title:E,scale:k,onNatural:I}),r&&r.frames.length>1?e.jsx(O,{sheetUrl:s,frames:r.frames,activeName:f,onPick:p}):null]})}function z({title:i,srcWidth:l,srcHeight:n,scaleMode:t,scale:s,onScaleMode:r}){return e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:6,padding:"6px 8px"},children:[e.jsx(v,{tone:"dim",variant:"label",children:i}),l>0&&e.jsxs(v,{tone:"muted",variant:"code",children:[l," × ",n,t==="fit"?` · ${T(s)}`:""]}),e.jsx("span",{style:{flex:1}}),[1,4,8,"fit"].map(a=>e.jsx(P,{type:"button",size:"compact",shape:"segment","aria-pressed":t===a,variant:t===a?"primary":"secondary",onClick:()=>r(a),children:a==="fit"?"Fit":`${a}×`},String(a)))]})}function C({stageRef:i,frameName:l,frame:n,sheet:t,sheetUrl:s,title:r,scale:a,onNatural:x}){let p;return l&&!n?p=e.jsx(v,{tone:"muted",variant:"body",children:t?`No sprite named ${l}`:"Loading sprite…"}):n?p=e.jsx(F,{sheetUrl:s,frame:n,scale:a}):p=e.jsx("img",{src:s,alt:r,style:{imageRendering:"pixelated",display:"block",transform:`scale(${a})`,transformOrigin:"center center"},onLoad:m=>{const u=m.currentTarget;x({w:u.naturalWidth,h:u.naturalHeight})}}),e.jsx("div",{ref:i,className:"vgai-asset-transparency-well","data-testid":"sprite-stage",style:{flex:1,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center",overflow:"auto"},children:p})}function O({sheetUrl:i,frames:l,activeName:n,onPick:t}){return e.jsx("div",{"data-testid":"sprite-filmstrip",style:{display:"flex",gap:6,overflowX:"auto",padding:"8px 8px 10px",borderTop:`1px solid ${h[3]}`},children:l.map(s=>{const r=s.name===n;return e.jsxs("button",{type:"button",title:s.name,"aria-pressed":r,onClick:()=>t(s.name),style:{border:r?`1px solid ${h[1]}`:"1px solid transparent",background:"transparent",padding:2,cursor:"pointer",flex:"0 0 auto"},children:[e.jsx(F,{sheetUrl:i,frame:s,maxEdge:40}),e.jsx("div",{style:{fontSize:9,color:r?h[1]:h[3],maxWidth:56,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name})]},s.name)})})}function T(i){return i>=1?`${i}×`:`1/${Math.round(1/i)}×`}export{Q as ImageViewer};
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DSnapshotDocument as p}from"./EntityModelDocument-Ccvw66N9.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-GIL7oGEO.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./StageHost-BN-IoTef.js";import"./stage-invalidation-DBg3C3Ta.js";import"./live-gesture-lock-DJbrjOqf.js";import"./viewport-shading-boundary-B_-_gABg.js";import"./clip-planes-CnAI6DZn.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./OrbitControls-CM3bPray.js";import"./LineSegments2-CsOpKSiM.js";import"./three.quarks.esm-B1C61jGo.js";import"./scene-framing-Cat0GtyJ.js";import"./source-object3d-authoring-adapter-B-L6Ha6f.js";import"./three-projection-core-BmKMZ-nf.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./standard-viewport-dressing-CzjAe_0A.js";import"./viewport-surface-status-B3om4Kcf.js";function k({previewKey:i,object:o,displayName:r,fill:e=!1}){return t.jsx("div",{"data-testid":"inspector-object-preview",style:e?{position:"absolute",inset:0,overflow:"hidden"}:{width:"100%",height:220,minHeight:220,borderBottom:"1px solid var(--vgai-structural-divider)",overflow:"hidden",position:"relative"},children:t.jsx(p,{documentId:`inspector-preview:${i}`,source:o,displayName:r,active:!0,chromeless:!0})})}export{k as InspectorObjectPreview};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DgapqSPi.js","assets/index-BP6wv2A0.js","assets/index-CJbYy-CF.js","assets/index-CanA16PU.js","assets/index-Bge9JUr6.js","assets/index-gHZae-lw.js","assets/index-BncK9THk.js","assets/index-IEjydI9d.js","assets/index-DUqP1RMl.js"])))=>i.map(i=>d[i]);
2
- import{a as m}from"./jsx-runtime-DPjLkJKQ.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{ao as i,_ as b,jt as W,aX as X,b4 as Y}from"./index-GIL7oGEO.js";import{Q as Z,V as _,d as ee,m as F}from"./three.quarks.esm-B1C61jGo.js";import{a as te}from"./project-provenance-BoP3nrle.js";import{Object3DDocumentViewport as re}from"./StageHost-BN-IoTef.js";const oe={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"typescript",jsx:"typescript",mjs:"typescript",cjs:"typescript",json:"json",jsonc:"json",json5:"json"};function Ve(e){const r=e.split("/").pop()??e,t=r.lastIndexOf(".");return t<0?"text":oe[r.slice(t+1).toLowerCase()]??"text"}let I=null;function ne(){return I??=Promise.all([b(()=>import("./index-BP6wv2A0.js"),[]),b(()=>import("./index-DgapqSPi.js").then(e=>e.i),__vite__mapDeps([0,1])),b(()=>import("./index-CJbYy-CF.js").then(e=>e.w),__vite__mapDeps([2,1,0])),b(()=>import("./index-CanA16PU.js"),__vite__mapDeps([3,0,1])),b(()=>import("./index-Bge9JUr6.js"),__vite__mapDeps([4,1,0,2])),b(()=>import("./index-gHZae-lw.js"),__vite__mapDeps([5,6,2,1,0])),b(()=>import("./index-IEjydI9d.js"),__vite__mapDeps([7,6,2,1,0])),b(()=>import("./index-DUqP1RMl.js"),__vite__mapDeps([8,0,1,2]))]).then(([e,r,t,o,n,a,l,c])=>({state:e,view:r,language:t,search:o,commands:n,javascript:a,json:l,oneDark:c})),I}function C(e){return typeof e=="number"?`${e}px`:e}function L(e){return typeof e=="string"&&e.trim().endsWith("%")}function se(e,r){let t=0;for(;t<e.length&&t<r.length&&e[t]===r[t];)t++;let o=e.length,n=r.length;for(;o>t&&n>t&&e[o-1]===r[n-1];)o--,n--;return{from:t,oldEnd:o,newEnd:n}}const q=1800,J=`color-mix(in srgb, ${i.semantic.warning} 42%, transparent)`,V=`color-mix(in srgb, ${i.semantic.warning} 18%, transparent)`;function ie(e){class r extends e.view.WidgetType{constructor(a){super(),this.revision=a}eq(a){return this.revision===a.revision}toDOM(){const a=document.createElement("span");return a.className=`cm-source-deletion cm-source-change cm-source-change-${this.revision%2}`,a.setAttribute("aria-hidden","true"),a}}const t=e.state.StateEffect.define(),o=e.state.StateField.define({create:()=>e.view.Decoration.none,update(n,a){let l=n.map(a.changes);for(const c of a.effects){if(!c.is(t))continue;if(!c.value){l=e.view.Decoration.none;continue}const{from:u,to:s,revision:p}=c.value,h=u===s?e.view.Decoration.widget({widget:new r(p),side:-1}).range(u):e.view.Decoration.mark({class:`cm-source-change cm-source-change-${p%2}`}).range(u,s);l=e.view.Decoration.set([h])}return l},provide:n=>e.view.EditorView.decorations.from(n)});return{mark:t,field:o}}function ae(e,r,t){return e.view.EditorView.theme({"&":{color:i.content.primary,backgroundColor:"transparent",fontSize:`${r}px`,...L(t)?{height:C(t)}:{}},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:i.typography.mono,padding:"2px 0",caretColor:"transparent"},".cm-scroller":{fontFamily:i.typography.mono,lineHeight:"1.5",overflow:"auto",...t===void 0?{}:{maxHeight:C(t)}},".cm-gutters":{backgroundColor:"transparent",color:i.content.dim,border:"none",userSelect:"none"},".cm-lineNumbers .cm-gutterElement":{padding:"0 8px 0 4px",minWidth:"2ch"},".cm-content ::selection":{backgroundColor:i.selection.background},".cm-panels":{backgroundColor:i.surface.raised,color:i.content.primary,border:"none",fontFamily:i.typography.sans},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${i.boundary.default}`},".cm-textfield":{backgroundColor:i.surface.inset,color:i.content.primary,border:`1px solid ${i.boundary.default}`,borderRadius:i.shape.small},".cm-button":{backgroundColor:i.surface.raised,backgroundImage:"none",color:i.content.primary,border:`1px solid ${i.boundary.default}`,borderRadius:i.shape.small},".cm-searchMatch":{backgroundColor:i.accent.muted},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:i.accent.default,color:i.content.onAccent},".cm-source-change":{backgroundColor:J,borderRadius:"2px"},".cm-line:has(.cm-source-change)":{backgroundColor:V},".cm-source-change, .cm-line:has(.cm-source-change)":{animationDuration:`${q}ms`,animationTimingFunction:"ease-out",animationFillMode:"forwards"},".cm-source-deletion":{display:"inline-block",width:"0",position:"relative"},".cm-source-deletion::after":{content:'""',position:"absolute",left:"-2px",bottom:"0",width:"4px",height:"1em",backgroundColor:"inherit",borderRadius:"2px"},".cm-source-change-0":{animationName:"vgai-source-change-even"},".cm-source-change-1":{animationName:"vgai-source-change-odd"},".cm-line:has(.cm-source-change-0)":{animationName:"vgai-source-line-even"},".cm-line:has(.cm-source-change-1)":{animationName:"vgai-source-line-odd"},"@keyframes vgai-source-line-even":{"0%, 40%":{backgroundColor:V},"100%":{backgroundColor:"transparent"}},"@keyframes vgai-source-line-odd":{"0%, 40%":{backgroundColor:V},"100%":{backgroundColor:"transparent"}},"@keyframes vgai-source-change-even":{"0%, 40%":{backgroundColor:J},"100%":{backgroundColor:"transparent"}},"@keyframes vgai-source-change-odd":{"0%, 40%":{backgroundColor:J},"100%":{backgroundColor:"transparent"}},"@media (prefers-reduced-motion: reduce)":{".cm-source-change, .cm-line:has(.cm-source-change)":{animation:"none"}},".cm-matchingBracket, &.cm-focused .cm-matchingBracket":{backgroundColor:i.neutralOverlay.active,outline:`1px solid ${i.boundary.strong}`}},{dark:!0})}function ce(e,r,t,o){const n=r==="typescript"?[e.javascript.javascript({typescript:!0,jsx:!0})]:r==="json"?[e.json.json()]:[];return[e.view.lineNumbers(),e.view.highlightSpecialChars(),e.language.bracketMatching(),e.language.syntaxHighlighting(e.oneDark.oneDarkHighlightStyle),e.search.search({top:!0}),e.view.keymap.of([...e.commands.standardKeymap,...e.search.searchKeymap]),e.view.EditorView.lineWrapping,e.state.EditorState.readOnly.of(!0),e.view.EditorView.editable.of(!1),e.view.EditorView.contentAttributes.of({tabindex:"0"}),...n,ae(e,t,o)]}function le({value:e,language:r,fontSize:t=11,maxHeight:o,ariaLabel:n,followChanges:a=!1}){const l=d.useRef(null),c=d.useRef(null),u=d.useRef(null),s=d.useRef(null),p=d.useRef(0),h=d.useRef(e);h.current=e;const[f,N]=d.useState(null),[D,T]=d.useState(!1);d.useEffect(()=>{let g=!1;return ne().then(y=>{g||N(y)},()=>{g||T(!0)}),()=>{g=!0}},[]),d.useEffect(()=>{const g=l.current;if(!g||!f)return;const y=ie(f),v=new f.view.EditorView({parent:g,state:f.state.EditorState.create({doc:h.current,extensions:[ce(f,r,t,o),y.field]})});return c.current=v,u.current=y,()=>{s.current!==null&&clearTimeout(s.current),s.current=null,u.current=null,c.current=null,v.destroy()}},[f,r,t,o]),d.useEffect(()=>{const g=c.current;if(!g)return;const y=g.state.toText(e).toString(),v=g.state.doc.toString();if(v===y)return;const{from:j,oldEnd:K,newEnd:B}=se(v,y),M=g.state.changes({from:j,to:K,insert:y.slice(j,B)}),S=u.current,x=[];if(a&&f&&S){const E=g.coordsAtPos(j),O=g.scrollDOM.getBoundingClientRect(),z=E&&E.top>=O.top&&E.bottom<=O.bottom&&E.left>=O.left&&E.right<=O.right?g.scrollSnapshot().map(M):f.view.EditorView.scrollIntoView(j,{y:"nearest",x:"nearest"});z&&x.push(z),x.push(S.mark.of({from:j,to:B,revision:++p.current}))}else S&&x.push(S.mark.of(null));g.dispatch({changes:M,effects:x}),s.current!==null&&clearTimeout(s.current),s.current=null,a&&S&&(s.current=setTimeout(()=>{c.current===g&&g.dispatch({effects:S.mark.of(null)}),s.current=null},q))},[e,a,f]);const k=L(o)?{height:"100%",minHeight:0}:{};return f?m.jsx("div",{ref:l,role:"group","aria-label":n,style:{minWidth:0,...k}}):m.jsxs("div",{role:"group","aria-label":n,style:{minWidth:0,...k},children:[D&&m.jsx("div",{style:{color:i.semantic.warning,fontSize:10,marginBottom:4},children:"Syntax highlighting failed to load — showing plain text."}),m.jsx("pre",{style:{margin:0,fontFamily:i.typography.mono,fontSize:t,lineHeight:1.5,color:i.content.primary,whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"auto",...o===void 0?{}:{maxHeight:C(o)},...L(o)?{height:C(o)}:{}},children:e})]})}const ue={fontSize:11,color:i.content.muted,marginBottom:2};function pe({assetPath:e}){const[r,t]=d.useState(null),[o,n]=d.useState("json"),[a,l]=d.useState(!1),c=e.split("/").pop()??e;return d.useEffect(()=>{let u=!1;return t(null),l(!1),fetch(W(e)).then(s=>s.text()).then(s=>{try{const p=JSON.parse(s);u||(n("json"),t(JSON.stringify(p,null,2)))}catch{u||(n("text"),t(s))}}).catch(()=>{u||l(!0)}),()=>{u=!0}},[e]),m.jsxs("div",{style:{padding:8,display:"flex",flexDirection:"column",gap:8},children:[m.jsx("div",{style:{fontWeight:600,fontSize:12,color:i.content.primary,wordBreak:"break-all"},children:c}),m.jsx("div",{className:"vgai-content-frost",style:{border:`1px solid ${i.boundary.default}`,borderRadius:i.shape.small,padding:8,overflow:"hidden",maxHeight:500},children:a?m.jsx("span",{style:{color:i.semantic.danger,fontSize:11},children:"Failed to load file"}):r===null?m.jsx("span",{style:{color:i.content.muted,fontSize:11},children:"Loading..."}):m.jsx(le,{value:r,language:o,fontSize:10,maxHeight:484,ariaLabel:`Contents of ${c}`})}),m.jsx(X,{label:"Info",defaultOpen:!1,children:m.jsxs("div",{children:[m.jsx("div",{style:ue,children:"Path"}),m.jsx("div",{style:{fontSize:11,color:i.content.primary,wordBreak:"break-all"},children:e})]})})]})}function de(e){const r=[],t=new Set;return e.traverse(o=>{if(o.type!=="ParticleEmitter")return;const n=o.system;!n||typeof n.getRendererSettings!="function"||t.has(n)||(t.add(n),r.push(n))}),r}const $=new WeakMap;function R(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function G(e){return R(e)?e:null}function P(e,r){r(e);for(const t of e.children??[])P(t,r)}function me(e){if(!R(e))return!1;const r=G(e.object);if(!r)return!1;let t=!1;return P(r,o=>{o.type==="ParticleEmitter"&&R(o.ps)&&o.ps.version!==void 0&&(t=!0)}),t}function fe(e){const r=new Map,t=G(e.object);return t&&P(t,o=>{typeof o.uuid=="string"&&r.set(o.uuid,o)}),r}function ge(e){const r=new Z().parse(e.json),t=fe(e.json),o=de(r),n=new Map(o.map(c=>[c.emitter,c])),a=new Map;if(r.traverse(c=>{const u=n.get(c);if(!u)return;const s=t.get(c.uuid);if(!s?.ps)throw new Error(`Native Quarks emitter ${c.name||c.uuid} has no matching JSON node.`);a.set(c,{system:u,json:s})}),a.size===0)throw new Error("The Quarks document contains no loadable emitter.");const l={root:r,originalText:e.text,json:e.json,emitters:a,dirty:!1};return $.set(r,l),l}function U(e){const r=$.get(e);if(!r)throw new Error("Object3D is not a native three.quarks JSON document.");return r}function he(e){for(const r of e.emitters.values())r.system.dispose();$.delete(e.root)}function ye(e){const r=U(e);return r.dirty?`${JSON.stringify(r.json,null,2)}
3
- `:r.originalText}const be=new Set(["particles.duration","particles.looping","particles.prewarm","particles.worldSpace","particles.startLife","particles.startSpeed","particles.startRotation","particles.startSize","particles.startColor","particles.emissionOverTime","particles.emissionOverDistance"]);function we(){return[{path:"particles.duration",label:"Duration",type:"number",group:"Emission"},{path:"particles.looping",label:"Looping",type:"boolean",group:"Emission"},{path:"particles.prewarm",label:"Prewarm",type:"boolean",group:"Emission"},{path:"particles.emissionOverTime",label:"Rate over time",type:"json",group:"Emission"},{path:"particles.emissionOverDistance",label:"Rate over distance",type:"json",group:"Emission"},{path:"particles.startLife",label:"Lifetime",type:"json",group:"Start"},{path:"particles.startSpeed",label:"Speed",type:"json",group:"Start"},{path:"particles.startRotation",label:"Rotation",type:"json",group:"Start"},{path:"particles.startSize",label:"Size",type:"json",group:"Start"},{path:"particles.startColor",label:"Color",type:"json",group:"Start"},{path:"particles.worldSpace",label:"World space",type:"boolean",group:"Simulation"},{path:"particles.shape",label:"Shape",type:"string",readonly:!0,group:"Shape"},{path:"particles.behaviors",label:"Modules",type:"json",readonly:!0,group:"Behavior"},{path:"particles.renderMode",label:"Native render mode",type:"number",readonly:!0,group:"Renderer"}]}function w(e,r){if(!R(e)||typeof e.type!="string")throw new Error(`${r} must be a native quarks function JSON object with a type.`);return e}function Q(e,r){const{system:t}=e;switch(r){case"particles.duration":return t.duration;case"particles.looping":return t.looping;case"particles.prewarm":return t.prewarm;case"particles.worldSpace":return t.worldSpace;case"particles.startLife":return t.startLife.toJSON();case"particles.startSpeed":return t.startSpeed.toJSON();case"particles.startRotation":return t.startRotation.toJSON();case"particles.startSize":return t.startSize.toJSON();case"particles.startColor":return t.startColor.toJSON();case"particles.emissionOverTime":return t.emissionOverTime.toJSON();case"particles.emissionOverDistance":return t.emissionOverDistance.toJSON();case"particles.shape":return t.emitterShape.type;case"particles.behaviors":return t.behaviors.map(o=>o.type);case"particles.renderMode":return t.renderMode;default:return}}function A(e){return e.slice(10)}function H(e,r,t){const{system:o}=e;switch(r){case"particles.duration":{const n=Number(t);if(!Number.isFinite(n)||n<=0)throw new Error("Particle duration must be a positive finite number.");o.duration=n;break}case"particles.looping":o.looping=!!t;break;case"particles.prewarm":o.prewarm=!!t;break;case"particles.worldSpace":o.worldSpace=!!t;break;case"particles.startLife":o.startLife=_(w(t,"Lifetime"));break;case"particles.startSpeed":o.startSpeed=_(w(t,"Speed"));break;case"particles.startRotation":o.startRotation=F(w(t,"Rotation"));break;case"particles.startSize":o.startSize=F(w(t,"Size"));break;case"particles.startColor":o.startColor=ee(w(t,"Color"));break;case"particles.emissionOverTime":o.emissionOverTime=_(w(t,"Rate over time"));break;case"particles.emissionOverDistance":o.emissionOverDistance=_(w(t,"Rate over distance"));break;default:throw new Error(`Particle field ${r} is read-only.`)}e.json.ps[A(r)]=t,o.restart()}function Se(e,r,t,o){H(e,r,t),e.json.ps[A(r)]=o}function ve(e){return e===void 0?void 0:JSON.parse(JSON.stringify(e))}const je=({root:e,defaultAdapter:r,commit:t})=>{const o=U(e),n=new Set,a=()=>{for(const s of n)s()},l=s=>{const p=r.hierarchy.object3D?.(s);return p?o.emitters.get(p)??null:null},c={properties:s=>[...r.inspector?.properties(s)??[],...l(s)?we():[]],get:(s,p)=>{const h=l(s);return h&&p.startsWith("particles.")?Q(h,p):r.inspector?.get(s,p)},set:async(s,p,h)=>{const f=l(s);if(!f||!be.has(p)){await r.inspector?.set(s,p,h);return}const N=Q(f,p),D=A(p),T=ve(f.json.ps?.[D]),k=o.dirty;try{H(f,p,h),o.dirty=!0,a(),await t(`Edit ${f.system.emitter.name||"Particle Emitter"}`)}catch(g){throw Se(f,p,N,T),o.dirty=k,a(),g}}};return{adapter:{capabilities:{...r.capabilities,inspectorFields:!0,persist:!0},provenance:{source:"document",label:"three.quarks JSON",detail:"The hierarchy and emitter fields are the native three.quarks Object3D JSON document."},hierarchy:r.hierarchy,...r.selection?{selection:r.selection}:{},...r.transforms?{transforms:r.transforms}:{},inspector:c,subscribe:s=>{n.add(s);const p=r.subscribe?.(s)??(()=>{});return()=>{n.delete(s),p()}}},dispose:()=>n.clear()}};async function Ee(e,r){const t=await fetch(W(e),{cache:"no-store",...r?{signal:r}:{}});if(!t.ok)throw new Error(`Could not load ${e}: HTTP ${t.status}.`);const o=await t.text();let n;try{n=JSON.parse(o)}catch{return null}return me(n)?{text:o,json:n,projectPath:te(e)}:null}function ke({documentId:e,assetPath:r,displayName:t,active:o,source:n}){const[a,l]=d.useState(null),[c,u]=d.useState(null);d.useEffect(()=>{if(!o){l(null);return}let h=null;try{h=ge(n),l(h),u(null)}catch(f){u(f instanceof Error?f.message:String(f))}return()=>{h&&he(h)}},[o,n]);const s=d.useCallback(()=>{if(!a)throw new Error(`Particle asset ${r} is not loaded.`);return{root:a.root,dispose(){}}},[a,r]),p=d.useMemo(()=>({label:`Edit ${t}`,resources:[{path:n.projectPath,contentType:"application/json",serialize:({root:h})=>ye(h)}]}),[t,n.projectPath]);return c?m.jsx("div",{role:"alert",style:{padding:20,color:i.semantic.danger},children:c}):a?m.jsx(re,{documentId:e,sourcePath:r,displayName:t,build:s,active:o,assetType:"particles",persistence:p,authoring:je,dressing:{grid:!0}}):m.jsxs("div",{style:{padding:20,color:i.content.muted},children:["Loading ",t,"…"]})}function xe({documentId:e,assetPath:r,displayName:t,active:o,sections:n,status:a}){const[l,c]=d.useState({kind:"loading"});return d.useEffect(()=>{if(!o){c({kind:"loading"});return}const u=new AbortController;return c({kind:"loading"}),Ee(r,u.signal).then(s=>{u.signal.aborted||c(s?{kind:"quarks",source:s}:{kind:"generic"})},s=>{u.signal.aborted||c({kind:"error",message:s instanceof Error?s.message:String(s)})}),()=>u.abort()},[o,r]),l.kind==="quarks"?m.jsx(ke,{documentId:e,assetPath:r,displayName:t,active:o,source:l.source}):m.jsx(Y,{documentId:e,active:o,type:"json",title:t,sections:n,status:a,children:l.kind==="loading"?m.jsxs("div",{style:{padding:20,color:i.content.muted},children:["Inspecting ",t,"…"]}):l.kind==="error"?m.jsx("div",{role:"alert",style:{padding:20,color:i.semantic.danger},children:l.message}):m.jsx(pe,{assetPath:r})})}const Le=Object.freeze(Object.defineProperty({__proto__:null,JsonAssetDocument:xe},Symbol.toStringTag,{value:"Module"}));export{le as C,xe as J,Le as a,Ve as c};
@@ -1 +0,0 @@
1
- import{u as J,a as rt,aC as se,V as C,bi as tt,q as ie,g as Y,bj as Q,ao as he,ap as xe,a9 as re,p as we,aq as Vn}from"./three.module-D396a9Mn.js";const oe=0,Ae=1,ge=2,Bs=0,Ps=1,Rn=2,en=1.25,Dn=1,$=32,N=$/4,_n=65535,Ts=_n<<16,Yt=Math.pow(2,-24),Mn=Symbol("SKIP_GENERATION"),ce={strategy:oe,maxDepth:40,targetLeafSize:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0,range:null,[Mn]:!1};function V(s,t,n){return n.min.x=t[s],n.min.y=t[s+1],n.min.z=t[s+2],n.max.x=t[s+3],n.max.y=t[s+4],n.max.z=t[s+5],n}function dn(s){let t=-1,n=-1/0;for(let e=0;e<3;e++){const i=s[e+3]-s[e];i>n&&(n=i,t=e)}return t}function Nn(s,t){t.set(s)}function Fn(s,t,n){let e,i;for(let o=0;o<3;o++){const r=o+3;e=s[o],i=t[o],n[o]=e<i?e:i,e=s[r],i=t[r],n[r]=e>i?e:i}}function Ut(s,t,n){for(let e=0;e<3;e++){const i=t[s+2*e],o=t[s+2*e+1],r=i-o,l=i+o;r<n[e]&&(n[e]=r),l>n[e+3]&&(n[e+3]=l)}}function gt(s){const t=s[3]-s[0],n=s[4]-s[1],e=s[5]-s[2];return 2*(t*n+n*e+e*t)}function R(s,t){return t[s+15]===_n}function q(s,t){return t[s+6]}function k(s,t){return t[s+14]}function F(s){return s+N}function H(s,t){const n=t[s+6];return s+n*N}function vn(s,t){return t[s+7]}function bs(s){return s}function sn(s,t,n,e,i){let o=1/0,r=1/0,l=1/0,c=-1/0,p=-1/0,u=-1/0,f=1/0,a=1/0,y=1/0,w=-1/0,A=-1/0,g=-1/0;const B=s.offset||0;for(let d=(t-B)*6,h=(t+n-B)*6;d<h;d+=6){const m=s[d+0],x=s[d+1],S=m-x,P=m+x;S<o&&(o=S),P>c&&(c=P),m<f&&(f=m),m>w&&(w=m);const _=s[d+2],M=s[d+3],T=_-M,v=_+M;T<r&&(r=T),v>p&&(p=v),_<a&&(a=_),_>A&&(A=_);const b=s[d+4],I=s[d+5],z=b-I,U=b+I;z<l&&(l=z),U>u&&(u=U),b<y&&(y=b),b>g&&(g=b)}e[0]=o,e[1]=r,e[2]=l,e[3]=c,e[4]=p,e[5]=u,i[0]=f,i[1]=a,i[2]=y,i[3]=w,i[4]=A,i[5]=g}const j=32,Be=(s,t)=>s.candidate-t.candidate,et=new Array(j).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Et=new Float32Array(6);function Pe(s,t,n,e,i,o){let r=-1,l=0;if(o===oe)r=dn(t),r!==-1&&(l=(t[r]+t[r+3])/2);else if(o===Ae)r=dn(s),r!==-1&&(l=Te(n,e,i,r));else if(o===ge){const c=gt(s);let p=en*i;const u=n.offset||0,f=(e-u)*6,a=(e+i-u)*6;for(let y=0;y<3;y++){const w=t[y],B=(t[y+3]-w)/j;if(i<j/4){const d=[...et];d.length=i;let h=0;for(let x=f;x<a;x+=6,h++){const S=d[h];S.candidate=n[x+2*y],S.count=0;const{bounds:P,leftCacheBounds:_,rightCacheBounds:M}=S;for(let T=0;T<3;T++)M[T]=1/0,M[T+3]=-1/0,_[T]=1/0,_[T+3]=-1/0,P[T]=1/0,P[T+3]=-1/0;Ut(x,n,P)}d.sort(Be);let m=i;for(let x=0;x<m;x++){const S=d[x];for(;x+1<m&&d[x+1].candidate===S.candidate;)d.splice(x+1,1),m--}for(let x=f;x<a;x+=6){const S=n[x+2*y];for(let P=0;P<m;P++){const _=d[P];S>=_.candidate?Ut(x,n,_.rightCacheBounds):(Ut(x,n,_.leftCacheBounds),_.count++)}}for(let x=0;x<m;x++){const S=d[x],P=S.count,_=i-S.count,M=S.leftCacheBounds,T=S.rightCacheBounds;let v=0;P!==0&&(v=gt(M)/c);let b=0;_!==0&&(b=gt(T)/c);const I=Dn+en*(v*P+b*_);I<p&&(r=y,p=I,l=S.candidate)}}else{for(let m=0;m<j;m++){const x=et[m];x.count=0,x.candidate=w+B+m*B;const S=x.bounds;for(let P=0;P<3;P++)S[P]=1/0,S[P+3]=-1/0}for(let m=f;m<a;m+=6){let P=~~((n[m+2*y]-w)/B);P>=j&&(P=j-1);const _=et[P];_.count++,Ut(m,n,_.bounds)}const d=et[j-1];Nn(d.bounds,d.rightCacheBounds);for(let m=j-2;m>=0;m--){const x=et[m],S=et[m+1];Fn(x.bounds,S.rightCacheBounds,x.rightCacheBounds)}let h=0;for(let m=0;m<j-1;m++){const x=et[m],S=x.count,P=x.bounds,M=et[m+1].rightCacheBounds;S!==0&&(h===0?Nn(P,Et):Fn(P,Et,Et)),h+=S;let T=0,v=0;h!==0&&(T=gt(Et)/c);const b=i-h;b!==0&&(v=gt(M)/c);const I=Dn+en*(T*h+v*b);I<p&&(r=y,p=I,l=x.candidate)}}}}else console.warn(`BVH: Invalid build strategy value ${o} used.`);return{axis:r,pos:l}}function Te(s,t,n,e){let i=0;const o=s.offset;for(let r=t,l=t+n;r<l;r++)i+=s[(r-o)*6+e*2];return i/n}class rn{constructor(){this.boundingData=new Float32Array(6)}}function be(s,t,n,e,i,o){let r=e,l=e+i-1;const c=o.pos,p=o.axis*2,u=n.offset||0;for(;;){for(;r<=l&&n[(r-u)*6+p]<c;)r++;for(;r<=l&&n[(l-u)*6+p]>=c;)l--;if(r<l){for(let f=0;f<t;f++){let a=s[r*t+f];s[r*t+f]=s[l*t+f],s[l*t+f]=a}for(let f=0;f<6;f++){const a=r-u,y=l-u,w=n[a*6+f];n[a*6+f]=n[y*6+f],n[y*6+f]=w}r++,l--}else return r}}let le,Kt,mn,ae;const Se=Math.pow(2,32);function hn(s){return"count"in s?1:1+hn(s.left)+hn(s.right)}function _e(s,t,n){return le=new Float32Array(n),Kt=new Uint32Array(n),mn=new Uint16Array(n),ae=new Uint8Array(n),xn(s,t)}function xn(s,t){const n=s/4,e=s/2,i="count"in t,o=t.boundingData;for(let r=0;r<6;r++)le[n+r]=o[r];if(i)return t.buffer?(ae.set(new Uint8Array(t.buffer),s),s+t.buffer.byteLength):(Kt[n+6]=t.offset,mn[e+14]=t.count,mn[e+15]=_n,s+$);{const{left:r,right:l,splitAxis:c}=t,p=s+$;let u=xn(p,r);const f=s/$,y=u/$-f;if(y>Se)throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");return Kt[n+6]=y,Kt[n+7]=c,xn(u,l)}}function Me(s,t,n,e,i,o){const{maxDepth:r,verbose:l,targetLeafSize:c,_strictLeafSize:p=1/0,strategy:u,onProgress:f}=i,a=s.primitiveBuffer,y=s.primitiveBufferStride,w=new Float32Array(6);let A=!1;const g=new rn;return sn(t,n,e,g.boundingData,w),d(g,n,e,w),g;function B(h){f&&f((h-o.offset)/o.count)}function d(h,m,x,S=null,P=0){!A&&P>=r&&(A=!0,l&&console.warn(`BVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`));const _=x>p;if(x<=c&&!_||P>=r)return B(m+x),h.offset=m,h.count=x,h;const M=Pe(h.boundingData,S,t,m,x,u);let T=M.axis===-1?-1:be(a,y,t,m,x,M);if(M.axis===-1||T===m||T===m+x){if(!_)return B(m+x),h.offset=m,h.count=x,h;M.axis=Math.max(0,dn(h.boundingData)),T=m+Math.max(1,Math.floor(x/2))}h.splitAxis=M.axis;const v=new rn,b=m,I=T-m;h.left=v,sn(t,b,I,v.boundingData,w),d(v,b,I,w,P+1);const z=new rn,U=T,L=x-I;return h.right=z,sn(t,U,L,z.boundingData,w),d(z,U,L,w,P+1),h}}function ve(s,t){const n=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,e=s.getRootRanges(t.range),i=e[0],o=e[e.length-1],r={offset:i.offset,count:o.offset+o.count-i.offset},l=new Float32Array(6*r.count);l.offset=r.offset,s.computePrimitiveBounds(r.offset,r.count,l),s._roots=e.map(c=>{const p=Me(s,l,c.offset,c.count,t,r),u=hn(p),f=new n($*u);return _e(0,p,f),f})}class In{constructor(t){this._getNewPrimitive=t,this._primitives=[]}getPrimitive(){const t=this._primitives;return t.length===0?this._getNewPrimitive():t.pop()}releasePrimitive(t){this._primitives.push(t)}}class Ie{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const t=[];let n=null;this.setBuffer=e=>{n&&t.push(n),n=e,this.float32Array=new Float32Array(e),this.uint16Array=new Uint16Array(e),this.uint32Array=new Uint32Array(e)},this.clearBuffer=()=>{n=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,t.length!==0&&this.setBuffer(t.pop())}}}const E=new Ie;let it,At;const ut=[],Lt=new In(()=>new J);function ze(s,t,n,e,i,o){it=Lt.getPrimitive(),At=Lt.getPrimitive(),ut.push(it,At),E.setBuffer(s._roots[t]);const r=wn(0,s.geometry,n,e,i,o);E.clearBuffer(),Lt.releasePrimitive(it),Lt.releasePrimitive(At),ut.pop(),ut.pop();const l=ut.length;return l>0&&(At=ut[l-1],it=ut[l-2]),r}function wn(s,t,n,e,i=null,o=0,r=0){const{float32Array:l,uint16Array:c,uint32Array:p}=E;let u=s*2;if(R(u,c)){const a=q(s,p),y=k(u,c);return V(s,l,it),e(a,y,!1,r,o+s/N,it)}else{let T=function(b){const{uint16Array:I,uint32Array:z}=E;let U=b*2;for(;!R(U,I);)b=F(b),U=b*2;return q(b,z)},v=function(b){const{uint16Array:I,uint32Array:z}=E;let U=b*2;for(;!R(U,I);)b=H(b,z),U=b*2;return q(b,z)+k(U,I)};const a=F(s),y=H(s,p);let w=a,A=y,g,B,d,h;if(i&&(d=it,h=At,V(w,l,d),V(A,l,h),g=i(d),B=i(h),B<g)){w=y,A=a;const b=g;g=B,B=b,d=h}d||(d=it,V(w,l,d));const m=R(w*2,c),x=n(d,m,g,r+1,o+w/N);let S;if(x===Rn){const b=T(w),z=v(w)-b;S=e(b,z,!0,r+1,o+w/N,d)}else S=x&&wn(w,t,n,e,i,o,r+1);if(S)return!0;h=At,V(A,l,h);const P=R(A*2,c),_=n(h,P,B,r+1,o+A/N);let M;if(_===Rn){const b=T(A),z=v(A)-b;M=e(b,z,!0,r+1,o+A/N,h)}else M=_&&wn(A,t,n,e,i,o,r+1);return!!M}}const zt=new E.constructor,Wt=new E.constructor,st=new In(()=>new J),pt=new J,yt=new J,on=new J,cn=new J;let ln=!1;function Ce(s,t,n,e){if(ln)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");ln=!0;const i=s._roots,o=t._roots;let r,l=0,c=0;const p=new rt().copy(n).invert();for(let u=0,f=i.length;u<f;u++){zt.setBuffer(i[u]),c=0;const a=st.getPrimitive();V(0,zt.float32Array,a),a.applyMatrix4(p);for(let y=0,w=o.length;y<w&&(Wt.setBuffer(o[y]),r=K(0,0,n,p,e,l,c,0,0,a),Wt.clearBuffer(),c+=o[y].byteLength/$,!r);y++);if(st.releasePrimitive(a),zt.clearBuffer(),l+=i[u].byteLength/$,r)break}return ln=!1,r}function K(s,t,n,e,i,o=0,r=0,l=0,c=0,p=null,u=!1){let f,a;u?(f=Wt,a=zt):(f=zt,a=Wt);const y=f.float32Array,w=f.uint32Array,A=f.uint16Array,g=a.float32Array,B=a.uint32Array,d=a.uint16Array,h=s*2,m=t*2,x=R(h,A),S=R(m,d);let P=!1;if(S&&x)u?P=i(q(t,B),k(t*2,d),q(s,w),k(s*2,A),c,r+t/N,l,o+s/N):P=i(q(s,w),k(s*2,A),q(t,B),k(t*2,d),l,o+s/N,c,r+t/N);else if(S){const _=st.getPrimitive();V(t,g,_),_.applyMatrix4(n);const M=F(s),T=H(s,w);V(M,y,pt),V(T,y,yt);const v=_.intersectsBox(pt),b=_.intersectsBox(yt);P=v&&K(t,M,e,n,i,r,o,c,l+1,_,!u)||b&&K(t,T,e,n,i,r,o,c,l+1,_,!u),st.releasePrimitive(_)}else{const _=F(t),M=H(t,B);V(_,g,on),V(M,g,cn);const T=p.intersectsBox(on),v=p.intersectsBox(cn);if(T&&v)P=K(s,_,n,e,i,o,r,l,c+1,p,u)||K(s,M,n,e,i,o,r,l,c+1,p,u);else if(T)if(x)P=K(s,_,n,e,i,o,r,l,c+1,p,u);else{const b=st.getPrimitive();b.copy(on).applyMatrix4(n);const I=F(s),z=H(s,w);V(I,y,pt),V(z,y,yt);const U=b.intersectsBox(pt),L=b.intersectsBox(yt);P=U&&K(_,I,e,n,i,r,o,c,l+1,b,!u)||L&&K(_,z,e,n,i,r,o,c,l+1,b,!u),st.releasePrimitive(b)}else if(v)if(x)P=K(s,M,n,e,i,o,r,l,c+1,p,u);else{const b=st.getPrimitive();b.copy(cn).applyMatrix4(n);const I=F(s),z=H(s,w);V(I,y,pt),V(z,y,yt);const U=b.intersectsBox(pt),L=b.intersectsBox(yt);P=U&&K(M,I,e,n,i,r,o,c,l+1,b,!u)||L&&K(M,z,e,n,i,r,o,c,l+1,b,!u),st.releasePrimitive(b)}}return P}const an=new class{constructor(){let s=null,t=null,n=null,e=!1;this.root=null,this.buffer=null,this.uint32Array=null,this.uint16Array=null,this.setBVH=(o,r)=>{if(e)throw new Error("BVHTraversalHelper: cannot call setBVH during an active traversal.");this.root=r,this.buffer=s=o._roots[r],this.uint16Array=n=new Uint16Array(s),this.uint32Array=t=new Uint32Array(s)},this.reset=()=>{this.root=null,this.buffer=s=null,this.uint16Array=n=null,this.uint32Array=t=null},this.getRangeStart=o=>{let r=o*2;for(;!R(r,n);)o=F(o),r=o*2;return q(o,t)},this.getRangeEnd=o=>{let r=o*2;for(;!R(r,n);)o=H(o,t),r=o*2;return q(o,t)+k(r,n)};const i=(o,r,l)=>{const c=r*2,p=R(c,n);if(!o(l,p,r)&&!p){const f=F(r),a=H(r,t);i(o,f,l+1),i(o,a,l+1)}};this.traverseBuffer=o=>{if(e)throw new Error("BVHTraversalHelper: cannot start a traversal during an active traversal.");e=!0;try{i(o,0,0)}finally{e=!1}},this.traverse=o=>{this.traverseBuffer((r,l,c)=>{if(l){const p=c*2,u=t[c+6],f=n[p+14];return o(r,l,new Float32Array(s,c*4,6),u,f)}else{const p=vn(c,t);return o(r,l,new Float32Array(s,c*4,6),p)}})}}},Hn=new J,dt=new Float32Array(6);class Ue{constructor(){this._roots=null,this.primitiveBuffer=null,this.primitiveBufferStride=null}init(t){t={...ce,...t},"maxLeafSize"in t&&(console.warn('BVH: "maxLeafSize" option has been deprecated. Use "targetLeafSize", instead.'),t={...t,targetLeafSize:t.maxLeafSize}),ve(this,t)}getRootRanges(){throw new Error("BVH: getRootRanges() not implemented")}writePrimitiveBounds(){throw new Error("BVH: writePrimitiveBounds() not implemented")}writePrimitiveRangeBounds(t,n,e,i){let o=1/0,r=1/0,l=1/0,c=-1/0,p=-1/0,u=-1/0;for(let f=t,a=t+n;f<a;f++){this.writePrimitiveBounds(f,dt,0);const[y,w,A,g,B,d]=dt;y<o&&(o=y),g>c&&(c=g),w<r&&(r=w),B>p&&(p=B),A<l&&(l=A),d>u&&(u=d)}return e[i+0]=o,e[i+1]=r,e[i+2]=l,e[i+3]=c,e[i+4]=p,e[i+5]=u,e}computePrimitiveBounds(t,n,e){const i=e.offset||0;for(let o=t,r=t+n;o<r;o++){this.writePrimitiveBounds(o,dt,0);const[l,c,p,u,f,a]=dt,y=(l+u)/2,w=(c+f)/2,A=(p+a)/2,g=(u-l)/2,B=(f-c)/2,d=(a-p)/2,h=(o-i)*6;e[h+0]=y,e[h+1]=g+(Math.abs(y)+g)*Yt,e[h+2]=w,e[h+3]=B+(Math.abs(w)+B)*Yt,e[h+4]=A,e[h+5]=d+(Math.abs(A)+d)*Yt}return e}shiftPrimitiveOffsets(t){const n=this._indirectBuffer;if(n)for(let e=0,i=n.length;e<i;e++)n[e]+=t;else{const e=this._roots;for(let i=0;i<e.length;i++){const o=e[i],r=new Uint32Array(o),l=new Uint16Array(o),c=o.byteLength/$;for(let p=0;p<c;p++){const u=N*p,f=2*u;R(f,l)&&(r[u+6]+=t)}}}}traverse(t,n=0){an.setBVH(this,n),an.traverse(t),an.reset()}refit(){const t=this._roots;for(let n=0,e=t.length;n<e;n++){const i=t[n],o=new Uint32Array(i),r=new Uint16Array(i),l=new Float32Array(i),c=i.byteLength/$;for(let p=c-1;p>=0;p--){const u=p*N,f=u*2;if(R(f,r)){const y=q(u,o),w=k(f,r);this.writePrimitiveRangeBounds(y,w,dt,0),l.set(dt,u)}else{const y=F(u),w=H(u,o);for(let A=0;A<3;A++){const g=l[y+A],B=l[y+A+3],d=l[w+A],h=l[w+A+3];l[u+A]=g<d?g:d,l[u+A+3]=B>h?B:h}}}}}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(e=>{V(0,new Float32Array(e),Hn),t.union(Hn)}),t}shapecast(t){let{boundsTraverseOrder:n,intersectsBounds:e,intersectsRange:i,intersectsPrimitive:o,scratchPrimitive:r,iterate:l}=t;if(i&&o){const f=i;i=(a,y,w,A,g)=>f(a,y,w,A,g)?!0:l(a,y,this,o,w,A,r)}else i||(o?i=(f,a,y,w)=>l(f,a,this,o,y,w,r):i=(f,a,y)=>y);let c=!1,p=0;const u=this._roots;for(let f=0,a=u.length;f<a;f++){const y=u[f];if(c=ze(this,f,e,i,n,p),c)break;p+=y.byteLength/$}return c}bvhcast(t,n,e){let{intersectsRanges:i}=e;return Ce(this,t,n,i)}}function Ee(){return typeof SharedArrayBuffer<"u"}function zn(s){return s.index?s.index.count:s.attributes.position.count}function Qt(s){return zn(s)/3}function Le(s,t=ArrayBuffer){return s>65535?new Uint32Array(new t(4*s)):new Uint16Array(new t(2*s))}function Ve(s,t){if(!s.index){const n=s.attributes.position.count,e=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Le(n,e);s.setIndex(new se(i,1));for(let o=0;o<n;o++)i[o]=o}}function Re(s,t,n){const e=zn(s)/n,i=t||s.drawRange,o=i.start/n,r=(i.start+i.count)/n,l=Math.max(0,o),c=Math.min(e,r)-l;return{offset:Math.floor(l),count:Math.floor(c)}}function De(s,t){return s.groups.map(n=>({offset:n.start/t,count:n.count/t}))}function qn(s,t,n){const e=Re(s,t,n),i=De(s,n);if(!i.length)return[e];const o=[],r=e.offset,l=e.offset+e.count,c=zn(s)/n,p=[];for(const a of i){const{offset:y,count:w}=a,A=y,g=isFinite(w)?w:c-y,B=y+g;A<l&&B>r&&(p.push({pos:Math.max(r,A),isStart:!0}),p.push({pos:Math.min(l,B),isStart:!1}))}p.sort((a,y)=>a.pos!==y.pos?a.pos-y.pos:a.type==="end"?-1:1);let u=0,f=null;for(const a of p){const y=a.pos;u!==0&&y!==f&&o.push({offset:f,count:y-f}),u+=a.isStart?1:-1,f=y}return o}function Ne(s,t){const n=s[s.length-1],e=n.offset+n.count>2**16,i=s.reduce((p,u)=>p+u.count,0),o=e?4:2,r=t?new SharedArrayBuffer(i*o):new ArrayBuffer(i*o),l=e?new Uint32Array(r):new Uint16Array(r);let c=0;for(let p=0;p<s.length;p++){const{offset:u,count:f}=s[p];for(let a=0;a<f;a++)l[c+a]=u+a;c+=f}return l}class Fe extends Ue{get indirect(){return!!this._indirectBuffer}get primitiveStride(){return null}get primitiveBufferStride(){return this.indirect?1:this.primitiveStride}set primitiveBufferStride(t){}get primitiveBuffer(){return this.indirect?this._indirectBuffer:this.geometry.index.array}set primitiveBuffer(t){}constructor(t,n={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("BVH: Only BufferGeometries are supported.");if(n.useSharedArrayBuffer&&!Ee())throw new Error("BVH: SharedArrayBuffer is not available.");super(),this.geometry=t,this.resolvePrimitiveIndex=n.indirect?e=>this._indirectBuffer[e]:e=>e,this.primitiveBuffer=null,this.primitiveBufferStride=null,this._indirectBuffer=null,n={...ce,...n},n[Mn]||this.init(n)}init(t){const{geometry:n,primitiveStride:e}=this;if(t.indirect){const i=qn(n,t.range,e),o=Ne(i,t.useSharedArrayBuffer);this._indirectBuffer=o}else Ve(n,t);super.init(t),!n.boundingBox&&t.setBoundingBox&&(n.boundingBox=this.getBoundingBox(new J))}getRootRanges(t){return this.indirect?[{offset:0,count:this._indirectBuffer.length}]:qn(this.geometry,t,this.primitiveStride)}raycastObject3D(){throw new Error("BVH: raycastObject3D() not implemented")}}class nt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,n){let e=1/0,i=-1/0;for(let o=0,r=t.length;o<r;o++){const c=t[o][n];e=c<e?c:e,i=c>i?c:i}this.min=e,this.max=i}setFromPoints(t,n){let e=1/0,i=-1/0;for(let o=0,r=n.length;o<r;o++){const l=n[o],c=t.dot(l);e=c<e?c:e,i=c>i?c:i}this.min=e,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}}nt.prototype.setFromBox=(function(){const s=new C;return function(n,e){const i=e.min,o=e.max;let r=1/0,l=-1/0;for(let c=0;c<=1;c++)for(let p=0;p<=1;p++)for(let u=0;u<=1;u++){s.x=i.x*c+o.x*(1-c),s.y=i.y*p+o.y*(1-p),s.z=i.z*u+o.z*(1-u);const f=n.dot(s);r=Math.min(f,r),l=Math.max(f,l)}this.min=r,this.max=l}})();const He=(function(){const s=new C,t=new C,n=new C;return function(i,o,r){const l=i.start,c=s,p=o.start,u=t;n.subVectors(l,p),s.subVectors(i.end,i.start),t.subVectors(o.end,o.start);const f=n.dot(u),a=u.dot(c),y=u.dot(u),w=n.dot(c),g=c.dot(c)*y-a*a;let B,d;g!==0?B=(f*a-w*y)/g:B=0,d=(f+B*a)/y,r.x=B,r.y=d}})(),Cn=(function(){const s=new Y,t=new C,n=new C;return function(i,o,r,l){He(i,o,s);let c=s.x,p=s.y;if(c>=0&&c<=1&&p>=0&&p<=1){i.at(c,r),o.at(p,l);return}else if(c>=0&&c<=1){p<0?o.at(0,l):o.at(1,l),i.closestPointToPoint(l,!0,r);return}else if(p>=0&&p<=1){c<0?i.at(0,r):i.at(1,r),o.closestPointToPoint(r,!0,l);return}else{let u;c<0?u=i.start:u=i.end;let f;p<0?f=o.start:f=o.end;const a=t,y=n;if(i.closestPointToPoint(f,!0,t),o.closestPointToPoint(u,!0,n),a.distanceToSquared(f)<=y.distanceToSquared(u)){r.copy(a),l.copy(f);return}else{r.copy(u),l.copy(y);return}}}})(),qe=(function(){const s=new C,t=new C,n=new ie,e=new tt;return function(o,r){const{radius:l,center:c}=o,{a:p,b:u,c:f}=r;if(e.start=p,e.end=u,e.closestPointToPoint(c,!0,s).distanceTo(c)<=l||(e.start=p,e.end=f,e.closestPointToPoint(c,!0,s).distanceTo(c)<=l)||(e.start=u,e.end=f,e.closestPointToPoint(c,!0,s).distanceTo(c)<=l))return!0;const A=r.getPlane(n);if(Math.abs(A.distanceToPoint(c))<=l){const B=A.projectPoint(c,t);if(r.containsPoint(B))return!0}return!1}})(),$e=["x","y","z"],G=1e-15,$n=G*G;function Z(s){return Math.abs(s)<G}class W extends Q{constructor(...t){super(...t),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new C),this.satBounds=new Array(4).fill().map(()=>new nt),this.points=[this.a,this.b,this.c],this.plane=new ie,this.isDegenerateIntoSegment=!1,this.isDegenerateIntoPoint=!1,this.degenerateSegment=new tt,this.needsUpdate=!0}intersectsSphere(t){return qe(t,this)}update(){const t=this.a,n=this.b,e=this.c,i=this.points,o=this.satAxes,r=this.satBounds,l=o[0],c=r[0];this.getNormal(l),c.setFromPoints(l,i);const p=o[1],u=r[1];p.subVectors(t,n),u.setFromPoints(p,i);const f=o[2],a=r[2];f.subVectors(n,e),a.setFromPoints(f,i);const y=o[3],w=r[3];y.subVectors(e,t),w.setFromPoints(y,i);const A=p.length(),g=f.length(),B=y.length();this.isDegenerateIntoPoint=!1,this.isDegenerateIntoSegment=!1,A<G?g<G||B<G?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(t),this.degenerateSegment.end.copy(e)):g<G?B<G?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(n),this.degenerateSegment.end.copy(t)):B<G&&(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(e),this.degenerateSegment.end.copy(n)),this.plane.setFromNormalAndCoplanarPoint(l,t),this.needsUpdate=!1}}W.prototype.closestPointToSegment=(function(){const s=new C,t=new C,n=new tt;return function(i,o=null,r=null){const{start:l,end:c}=i,p=this.points;let u,f=1/0;for(let a=0;a<3;a++){const y=(a+1)%3;n.start.copy(p[a]),n.end.copy(p[y]),Cn(n,i,s,t),u=s.distanceToSquared(t),u<f&&(f=u,o&&o.copy(s),r&&r.copy(t))}return this.closestPointToPoint(l,s),u=l.distanceToSquared(s),u<f&&(f=u,o&&o.copy(s),r&&r.copy(l)),this.closestPointToPoint(c,s),u=c.distanceToSquared(s),u<f&&(f=u,o&&o.copy(s),r&&r.copy(c)),Math.sqrt(f)}})();W.prototype.intersectsTriangle=(function(){const s=new W,t=new nt,n=new nt,e=new C,i=new C,o=new C,r=new C,l=new tt,c=new tt,p=new C,u=new Y,f=new Y;function a(h,m,x,S){const P=e;!h.isDegenerateIntoPoint&&!h.isDegenerateIntoSegment?P.copy(h.plane.normal):P.copy(m.plane.normal);const _=h.satBounds,M=h.satAxes;for(let b=1;b<4;b++){const I=_[b],z=M[b];if(t.setFromPoints(z,m.points),I.isSeparated(t)||(r.copy(P).cross(z),t.setFromPoints(r,h.points),n.setFromPoints(r,m.points),t.isSeparated(n)))return!1}const T=m.satBounds,v=m.satAxes;for(let b=1;b<4;b++){const I=T[b],z=v[b];if(t.setFromPoints(z,h.points),I.isSeparated(t)||(r.crossVectors(P,z),t.setFromPoints(r,h.points),n.setFromPoints(r,m.points),t.isSeparated(n)))return!1}return x&&(S||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),x.start.set(0,0,0),x.end.set(0,0,0)),!0}function y(h,m,x,S,P,_,M,T,v,b,I){let z=M/(M-T);b.x=S+(P-S)*z,I.start.subVectors(m,h).multiplyScalar(z).add(h),z=M/(M-v),b.y=S+(_-S)*z,I.end.subVectors(x,h).multiplyScalar(z).add(h)}function w(h,m,x,S,P,_,M,T,v,b,I){if(P>0)y(h.c,h.a,h.b,S,m,x,v,M,T,b,I);else if(_>0)y(h.b,h.a,h.c,x,m,S,T,M,v,b,I);else if(T*v>0||M!=0)y(h.a,h.b,h.c,m,x,S,M,T,v,b,I);else if(T!=0)y(h.b,h.a,h.c,x,m,S,T,M,v,b,I);else if(v!=0)y(h.c,h.a,h.b,S,m,x,v,M,T,b,I);else return!0;return!1}function A(h,m,x,S){const P=m.degenerateSegment,_=h.plane.distanceToPoint(P.start),M=h.plane.distanceToPoint(P.end);return Z(_)?Z(M)?a(h,m,x,S):(x&&(x.start.copy(P.start),x.end.copy(P.start)),h.containsPoint(P.start)):Z(M)?(x&&(x.start.copy(P.end),x.end.copy(P.end)),h.containsPoint(P.end)):h.plane.intersectLine(P,e)!=null?(x&&(x.start.copy(e),x.end.copy(e)),h.containsPoint(e)):!1}function g(h,m,x){const S=m.a;return Z(h.plane.distanceToPoint(S))&&h.containsPoint(S)?(x&&(x.start.copy(S),x.end.copy(S)),!0):!1}function B(h,m,x){const S=h.degenerateSegment,P=m.a;return S.closestPointToPoint(P,!0,e),P.distanceToSquared(e)<$n?(x&&(x.start.copy(P),x.end.copy(P)),!0):!1}function d(h,m,x,S){if(h.isDegenerateIntoSegment)if(m.isDegenerateIntoSegment){const P=h.degenerateSegment,_=m.degenerateSegment,M=i,T=o;P.delta(M),_.delta(T);const v=e.subVectors(_.start,P.start),b=M.x*T.y-M.y*T.x;if(Z(b))return!1;const I=(v.x*T.y-v.y*T.x)/b,z=-(M.x*v.y-M.y*v.x)/b;if(I<0||I>1||z<0||z>1)return!1;const U=P.start.z+M.z*I,L=_.start.z+T.z*z;return Z(U-L)?(x&&(x.start.copy(P.start).addScaledVector(M,I),x.end.copy(P.start).addScaledVector(M,I)),!0):!1}else return m.isDegenerateIntoPoint?B(h,m,x):A(m,h,x,S);else{if(h.isDegenerateIntoPoint)return m.isDegenerateIntoPoint?m.a.distanceToSquared(h.a)<$n?(x&&(x.start.copy(h.a),x.end.copy(h.a)),!0):!1:m.isDegenerateIntoSegment?B(m,h,x):g(m,h,x);if(m.isDegenerateIntoPoint)return g(h,m,x);if(m.isDegenerateIntoSegment)return A(h,m,x,S)}}return function(m,x=null,S=!1){this.needsUpdate&&this.update(),m.isExtendedTriangle?m.needsUpdate&&m.update():(s.copy(m),s.update(),m=s);const P=d(this,m,x,S);if(P!==void 0)return P;const _=this.plane,M=m.plane;let T=M.distanceToPoint(this.a),v=M.distanceToPoint(this.b),b=M.distanceToPoint(this.c);Z(T)&&(T=0),Z(v)&&(v=0),Z(b)&&(b=0);const I=T*v,z=T*b;if(I>0&&z>0)return!1;let U=_.distanceToPoint(m.a),L=_.distanceToPoint(m.b),Ct=_.distanceToPoint(m.c);Z(U)&&(U=0),Z(L)&&(L=0),Z(Ct)&&(Ct=0);const Un=U*L,En=U*Ct;if(Un>0&&En>0)return!1;i.copy(_.normal),o.copy(M.normal);const jt=i.cross(o);let Gt=0,tn=Math.abs(jt.x);const Ln=Math.abs(jt.y);Ln>tn&&(tn=Ln,Gt=1),Math.abs(jt.z)>tn&&(Gt=2);const ft=$e[Gt],fe=this.a[ft],ue=this.b[ft],pe=this.c[ft],ye=m.a[ft],de=m.b[ft],me=m.c[ft];if(w(this,fe,ue,pe,I,z,T,v,b,u,l))return a(this,m,x,S);if(w(m,ye,de,me,Un,En,U,L,Ct,f,c))return a(this,m,x,S);if(u.y<u.x){const nn=u.y;u.y=u.x,u.x=nn,p.copy(l.start),l.start.copy(l.end),l.end.copy(p)}if(f.y<f.x){const nn=f.y;f.y=f.x,f.x=nn,p.copy(c.start),c.start.copy(c.end),c.end.copy(p)}return u.y<f.x||f.y<u.x?!1:(x&&(f.x>u.x?x.start.copy(c.start):x.start.copy(l.start),f.y<u.y?x.end.copy(c.end):x.end.copy(l.end)),!0)}})();W.prototype.distanceToPoint=(function(){const s=new C;return function(n){return this.closestPointToPoint(n,s),n.distanceTo(s)}})();W.prototype.distanceToTriangle=(function(){const s=new C,t=new C,n=["a","b","c"],e=new tt,i=new tt;return function(r,l=null,c=null){const p=l||c?e:null;if(this.intersectsTriangle(r,p,!0))return(l||c)&&(l&&p.getCenter(l),c&&p.getCenter(c)),0;let u=1/0;for(let f=0;f<3;f++){let a;const y=n[f],w=r[y];this.closestPointToPoint(w,s),a=w.distanceToSquared(s),a<u&&(u=a,l&&l.copy(s),c&&c.copy(w));const A=this[y];r.closestPointToPoint(A,s),a=A.distanceToSquared(s),a<u&&(u=a,l&&l.copy(A),c&&c.copy(s))}for(let f=0;f<3;f++){const a=n[f],y=n[(f+1)%3];e.set(this[a],this[y]);for(let w=0;w<3;w++){const A=n[w],g=n[(w+1)%3];i.set(r[A],r[g]),Cn(e,i,s,t);const B=s.distanceToSquared(t);B<u&&(u=B,l&&l.copy(s),c&&c.copy(t))}}return Math.sqrt(u)}})();class X{constructor(t,n,e){this.isOrientedBox=!0,this.min=new C,this.max=new C,this.matrix=new rt,this.invMatrix=new rt,this.points=new Array(8).fill().map(()=>new C),this.satAxes=new Array(3).fill().map(()=>new C),this.satBounds=new Array(3).fill().map(()=>new nt),this.alignedSatBounds=new Array(3).fill().map(()=>new nt),this.needsUpdate=!1,t&&this.min.copy(t),n&&this.max.copy(n),e&&this.matrix.copy(e)}set(t,n,e){this.min.copy(t),this.max.copy(n),this.matrix.copy(e),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}X.prototype.update=(function(){return function(){const t=this.matrix,n=this.min,e=this.max,i=this.points;for(let p=0;p<=1;p++)for(let u=0;u<=1;u++)for(let f=0;f<=1;f++){const a=1*p|2*u|4*f,y=i[a];y.x=p?e.x:n.x,y.y=u?e.y:n.y,y.z=f?e.z:n.z,y.applyMatrix4(t)}const o=this.satBounds,r=this.satAxes,l=i[0];for(let p=0;p<3;p++){const u=r[p],f=o[p],a=1<<p,y=i[a];u.subVectors(l,y),f.setFromPoints(u,i)}const c=this.alignedSatBounds;c[0].setFromPointsField(i,"x"),c[1].setFromPointsField(i,"y"),c[2].setFromPointsField(i,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}})();X.prototype.intersectsBox=(function(){const s=new nt;return function(n){this.needsUpdate&&this.update();const e=n.min,i=n.max,o=this.satBounds,r=this.satAxes,l=this.alignedSatBounds;if(s.min=e.x,s.max=i.x,l[0].isSeparated(s)||(s.min=e.y,s.max=i.y,l[1].isSeparated(s))||(s.min=e.z,s.max=i.z,l[2].isSeparated(s)))return!1;for(let c=0;c<3;c++){const p=r[c],u=o[c];if(s.setFromBox(p,n),u.isSeparated(s))return!1}return!0}})();X.prototype.intersectsTriangle=(function(){const s=new W,t=new Array(3),n=new nt,e=new nt,i=new C;return function(r){this.needsUpdate&&this.update(),r.isExtendedTriangle?r.needsUpdate&&r.update():(s.copy(r),s.update(),r=s);const l=this.satBounds,c=this.satAxes;t[0]=r.a,t[1]=r.b,t[2]=r.c;for(let a=0;a<3;a++){const y=l[a],w=c[a];if(n.setFromPoints(w,t),y.isSeparated(n))return!1}const p=r.satBounds,u=r.satAxes,f=this.points;for(let a=0;a<3;a++){const y=p[a],w=u[a];if(n.setFromPoints(w,f),y.isSeparated(n))return!1}for(let a=0;a<3;a++){const y=c[a];for(let w=0;w<4;w++){const A=u[w];if(i.crossVectors(y,A),n.setFromPoints(i,t),e.setFromPoints(i,f),n.isSeparated(e))return!1}}return!0}})();X.prototype.closestPointToPoint=(function(){return function(t,n){return this.needsUpdate&&this.update(),n.copy(t).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),n}})();X.prototype.distanceToPoint=(function(){const s=new C;return function(n){return this.closestPointToPoint(n,s),n.distanceTo(s)}})();X.prototype.distanceToBox=(function(){const s=["x","y","z"],t=new Array(12).fill().map(()=>new tt),n=new Array(12).fill().map(()=>new tt),e=new C,i=new C;return function(r,l=0,c=null,p=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(c||p)&&(r.getCenter(i),this.closestPointToPoint(i,e),r.closestPointToPoint(e,i),c&&c.copy(e),p&&p.copy(i)),0;const u=l*l,f=r.min,a=r.max,y=this.points;let w=1/0;for(let g=0;g<8;g++){const B=y[g];i.copy(B).clamp(f,a);const d=B.distanceToSquared(i);if(d<w&&(w=d,c&&c.copy(B),p&&p.copy(i),d<u))return Math.sqrt(d)}let A=0;for(let g=0;g<3;g++)for(let B=0;B<=1;B++)for(let d=0;d<=1;d++){const h=(g+1)%3,m=(g+2)%3,x=B<<h|d<<m,S=1<<g|B<<h|d<<m,P=y[x],_=y[S];t[A].set(P,_);const T=s[g],v=s[h],b=s[m],I=n[A],z=I.start,U=I.end;z[T]=f[T],z[v]=B?f[v]:a[v],z[b]=d?f[b]:a[v],U[T]=a[T],U[v]=B?f[v]:a[v],U[b]=d?f[b]:a[v],A++}for(let g=0;g<=1;g++)for(let B=0;B<=1;B++)for(let d=0;d<=1;d++){i.x=g?a.x:f.x,i.y=B?a.y:f.y,i.z=d?a.z:f.z,this.closestPointToPoint(i,e);const h=i.distanceToSquared(e);if(h<w&&(w=h,c&&c.copy(e),p&&p.copy(i),h<u))return Math.sqrt(h)}for(let g=0;g<12;g++){const B=t[g];for(let d=0;d<12;d++){const h=n[d];Cn(B,h,e,i);const m=e.distanceToSquared(i);if(m<w&&(w=m,c&&c.copy(e),p&&p.copy(i),m<u))return Math.sqrt(m)}}return Math.sqrt(w)}})();class ke extends In{constructor(){super(()=>new W)}}const O=new ke,Bt=new C,fn=new C;function Xe(s,t,n={},e=0,i=1/0){const o=e*e,r=i*i;let l=1/0,c=null;if(s.shapecast({boundsTraverseOrder:u=>(Bt.copy(t).clamp(u.min,u.max),Bt.distanceToSquared(t)),intersectsBounds:(u,f,a)=>a<l&&a<r,intersectsTriangle:(u,f)=>{u.closestPointToPoint(t,Bt);const a=t.distanceToSquared(Bt);return a<l&&(fn.copy(Bt),l=a,c=f),a<o}}),l===1/0)return null;const p=Math.sqrt(l);return n.point?n.point.copy(fn):n.point=fn.clone(),n.distance=p,n.faceIndex=c,n}const Vt=parseInt(re)>=169,Ze=parseInt(re)<=161,ct=new C,lt=new C,at=new C,Rt=new Y,Dt=new Y,Nt=new Y,kn=new C,Xn=new C,Zn=new C,Pt=new C;function Oe(s,t,n,e,i,o,r,l){let c;if(o===he?c=s.intersectTriangle(e,n,t,!0,i):c=s.intersectTriangle(t,n,e,o!==xe,i),c===null)return null;const p=s.origin.distanceTo(i);return p<r||p>l?null:{distance:p,point:i.clone()}}function On(s,t,n,e,i,o,r,l,c,p,u){ct.fromBufferAttribute(t,o),lt.fromBufferAttribute(t,r),at.fromBufferAttribute(t,l);const f=Oe(s,ct,lt,at,Pt,c,p,u);if(f){if(e){Rt.fromBufferAttribute(e,o),Dt.fromBufferAttribute(e,r),Nt.fromBufferAttribute(e,l),f.uv=new Y;const y=Q.getInterpolation(Pt,ct,lt,at,Rt,Dt,Nt,f.uv);Vt||(f.uv=y)}if(i){Rt.fromBufferAttribute(i,o),Dt.fromBufferAttribute(i,r),Nt.fromBufferAttribute(i,l),f.uv1=new Y;const y=Q.getInterpolation(Pt,ct,lt,at,Rt,Dt,Nt,f.uv1);Vt||(f.uv1=y),Ze&&(f.uv2=f.uv1)}if(n){kn.fromBufferAttribute(n,o),Xn.fromBufferAttribute(n,r),Zn.fromBufferAttribute(n,l),f.normal=new C;const y=Q.getInterpolation(Pt,ct,lt,at,kn,Xn,Zn,f.normal);f.normal.dot(s.direction)>0&&f.normal.multiplyScalar(-1),Vt||(f.normal=y)}const a={a:o,b:r,c:l,normal:new C,materialIndex:0};if(Q.getNormal(ct,lt,at,a.normal),f.face=a,f.faceIndex=o,Vt){const y=new C;Q.getBarycoord(Pt,ct,lt,at,y),f.barycoord=y}}return f}function Yn(s){return s&&s.isMaterial?s.side:s}function Jt(s,t,n,e,i,o,r){const l=e*3;let c=l+0,p=l+1,u=l+2;const{index:f,groups:a}=s;s.index&&(c=f.getX(c),p=f.getX(p),u=f.getX(u));const{position:y,normal:w,uv:A,uv1:g}=s.attributes;if(Array.isArray(t)){const B=e*3;for(let d=0,h=a.length;d<h;d++){const{start:m,count:x,materialIndex:S}=a[d];if(B>=m&&B<m+x){const P=Yn(t[S]),_=On(n,y,w,A,g,c,p,u,P,o,r);if(_)if(_.faceIndex=e,_.face.materialIndex=S,i)i.push(_);else return _}}}else{const B=Yn(t),d=On(n,y,w,A,g,c,p,u,B,o,r);if(d)if(d.faceIndex=e,d.face.materialIndex=0,i)i.push(d);else return d}return null}function D(s,t,n,e){const i=s.a,o=s.b,r=s.c;let l=t,c=t+1,p=t+2;n&&(l=n.getX(l),c=n.getX(c),p=n.getX(p)),i.x=e.getX(l),i.y=e.getY(l),i.z=e.getZ(l),o.x=e.getX(c),o.y=e.getY(c),o.z=e.getZ(c),r.x=e.getX(p),r.y=e.getY(p),r.z=e.getZ(p)}const Tt=new C,bt=new C,St=new C,Kn=new Y,Wn=new Y,Qn=new Y;function Ss(s,t,n,e){const i=t.getIndex().array,o=t.getAttribute("position"),r=t.getAttribute("uv"),l=i[n*3],c=i[n*3+1],p=i[n*3+2];Tt.fromBufferAttribute(o,l),bt.fromBufferAttribute(o,c),St.fromBufferAttribute(o,p);let u=0;const f=t.groups,a=n*3;for(let A=0,g=f.length;A<g;A++){const B=f[A],{start:d,count:h}=B;if(a>=d&&a<d+h){u=B.materialIndex;break}}const y=e&&e.barycoord?e.barycoord:new C;Q.getBarycoord(s,Tt,bt,St,y);let w=null;return r&&(Kn.fromBufferAttribute(r,l),Wn.fromBufferAttribute(r,c),Qn.fromBufferAttribute(r,p),e&&e.uv?w=e.uv:w=new Y,Q.getInterpolation(s,Tt,bt,St,Kn,Wn,Qn,w)),e?(e.face||(e.face={}),e.face.a=l,e.face.b=c,e.face.c=p,e.face.materialIndex=u,e.face.normal||(e.face.normal=new C),Q.getNormal(Tt,bt,St,e.face.normal),w&&(e.uv=w),e.barycoord=y,e):{face:{a:l,b:c,c:p,materialIndex:u,normal:Q.getNormal(Tt,bt,St,new C)},uv:w,barycoord:y}}function Ye(s,t,n,e,i,o,r,l){const{geometry:c,_indirectBuffer:p}=s;for(let u=e,f=e+i;u<f;u++)Jt(c,t,n,u,o,r,l)}function Ke(s,t,n,e,i,o,r){const{geometry:l,_indirectBuffer:c}=s;let p=1/0,u=null;for(let f=e,a=e+i;f<a;f++){let y;y=Jt(l,t,n,f,null,o,r),y&&y.distance<p&&(u=y,p=y.distance)}return u}function We(s,t,n,e,i,o,r){const{geometry:l}=n,{index:c}=l,p=l.attributes.position;for(let u=s,f=t+s;u<f;u++){let a;if(a=u,D(r,a*3,c,p),r.needsUpdate=!0,e(r,a,i,o))return!0}return!1}function Qe(s,t=null){t&&Array.isArray(t)&&(t=new Set(t));const n=s.geometry,e=n.index?n.index.array:null,i=n.attributes.position;let o,r,l,c,p=0;const u=s._roots;for(let a=0,y=u.length;a<y;a++)o=u[a],r=new Uint32Array(o),l=new Uint16Array(o),c=new Float32Array(o),f(0,p),p+=o.byteLength;function f(a,y,w=!1){const A=a*2;if(R(A,l)){const g=q(a,r),B=k(A,l);let d=1/0,h=1/0,m=1/0,x=-1/0,S=-1/0,P=-1/0;for(let _=3*g,M=3*(g+B);_<M;_++){let T=e[_];const v=i.getX(T),b=i.getY(T),I=i.getZ(T);v<d&&(d=v),v>x&&(x=v),b<h&&(h=b),b>S&&(S=b),I<m&&(m=I),I>P&&(P=I)}return c[a+0]!==d||c[a+1]!==h||c[a+2]!==m||c[a+3]!==x||c[a+4]!==S||c[a+5]!==P?(c[a+0]=d,c[a+1]=h,c[a+2]=m,c[a+3]=x,c[a+4]=S,c[a+5]=P,!0):!1}else{const g=F(a),B=H(a,r);let d=w,h=!1,m=!1;if(t){if(!d){const T=g/N+y/$,v=B/N+y/$;h=t.has(T),m=t.has(v),d=!h&&!m}}else h=!0,m=!0;const x=d||h,S=d||m;let P=!1;x&&(P=f(g,y,d));let _=!1;S&&(_=f(B,y,d));const M=P||_;if(M)for(let T=0;T<3;T++){const v=g+T,b=B+T,I=c[v],z=c[v+3],U=c[b],L=c[b+3];c[a+T]=I<U?I:U,c[a+T+3]=z>L?z:L}return M}}}function ot(s,t,n,e,i){let o,r,l,c,p,u;const f=1/n.direction.x,a=1/n.direction.y,y=1/n.direction.z,w=n.origin.x,A=n.origin.y,g=n.origin.z;let B=t[s],d=t[s+3],h=t[s+1],m=t[s+3+1],x=t[s+2],S=t[s+3+2];return f>=0?(o=(B-w)*f,r=(d-w)*f):(o=(d-w)*f,r=(B-w)*f),a>=0?(l=(h-A)*a,c=(m-A)*a):(l=(m-A)*a,c=(h-A)*a),o>c||l>r||((l>o||isNaN(o))&&(o=l),(c<r||isNaN(r))&&(r=c),y>=0?(p=(x-g)*y,u=(S-g)*y):(p=(S-g)*y,u=(x-g)*y),o>u||p>r)?!1:((p>o||o!==o)&&(o=p),(u<r||r!==r)&&(r=u),o<=i&&r>=e)}function Je(s,t,n,e,i,o,r,l){const{geometry:c,_indirectBuffer:p}=s;for(let u=e,f=e+i;u<f;u++){let a=p?p[u]:u;Jt(c,t,n,a,o,r,l)}}function je(s,t,n,e,i,o,r){const{geometry:l,_indirectBuffer:c}=s;let p=1/0,u=null;for(let f=e,a=e+i;f<a;f++){let y;y=Jt(l,t,n,c?c[f]:f,null,o,r),y&&y.distance<p&&(u=y,p=y.distance)}return u}function Ge(s,t,n,e,i,o,r){const{geometry:l}=n,{index:c}=l,p=l.attributes.position;for(let u=s,f=t+s;u<f;u++){let a;if(a=n.resolveTriangleIndex(u),D(r,a*3,c,p),r.needsUpdate=!0,e(r,a,i,o))return!0}return!1}function ts(s,t,n,e,i,o,r){E.setBuffer(s._roots[t]),An(0,s,n,e,i,o,r),E.clearBuffer()}function An(s,t,n,e,i,o,r){const{float32Array:l,uint16Array:c,uint32Array:p}=E,u=s*2;if(R(u,c)){const a=q(s,p),y=k(u,c);Ye(t,n,e,a,y,i,o,r)}else{const a=F(s);ot(a,l,e,o,r)&&An(a,t,n,e,i,o,r);const y=H(s,p);ot(y,l,e,o,r)&&An(y,t,n,e,i,o,r)}}const ns=["x","y","z"];function es(s,t,n,e,i,o){E.setBuffer(s._roots[t]);const r=gn(0,s,n,e,i,o);return E.clearBuffer(),r}function gn(s,t,n,e,i,o){const{float32Array:r,uint16Array:l,uint32Array:c}=E;let p=s*2;if(R(p,l)){const f=q(s,c),a=k(p,l);return Ke(t,n,e,f,a,i,o)}else{const f=vn(s,c),a=ns[f],w=e.direction[a]>=0;let A,g;w?(A=F(s),g=H(s,c)):(A=H(s,c),g=F(s));const d=ot(A,r,e,i,o)?gn(A,t,n,e,i,o):null;if(d){const x=d.point[a];if(w?x<=r[g+f]:x>=r[g+f+3])return d}const m=ot(g,r,e,i,o)?gn(g,t,n,e,i,o):null;return d&&m?d.distance<=m.distance?d:m:d||m||null}}const Ft=new J,mt=new W,ht=new W,_t=new rt,Jn=new X,Ht=new X;function ss(s,t,n,e){E.setBuffer(s._roots[t]);const i=Bn(0,s,n,e);return E.clearBuffer(),i}function Bn(s,t,n,e,i=null){const{float32Array:o,uint16Array:r,uint32Array:l}=E;let c=s*2;if(i===null&&(n.boundingBox||n.computeBoundingBox(),Jn.set(n.boundingBox.min,n.boundingBox.max,e),i=Jn),R(c,r)){const u=t.geometry,f=u.index,a=u.attributes.position,y=n.index,w=n.attributes.position,A=q(s,l),g=k(c,r);if(_t.copy(e).invert(),n.boundsTree)return V(s,o,Ht),Ht.matrix.copy(_t),Ht.needsUpdate=!0,n.boundsTree.shapecast({intersectsBounds:d=>Ht.intersectsBox(d),intersectsTriangle:d=>{d.a.applyMatrix4(e),d.b.applyMatrix4(e),d.c.applyMatrix4(e),d.needsUpdate=!0;for(let h=A*3,m=(g+A)*3;h<m;h+=3)if(D(ht,h,f,a),ht.needsUpdate=!0,d.intersectsTriangle(ht))return!0;return!1}});{const B=Qt(n);for(let d=A*3,h=(g+A)*3;d<h;d+=3){D(mt,d,f,a),mt.a.applyMatrix4(_t),mt.b.applyMatrix4(_t),mt.c.applyMatrix4(_t),mt.needsUpdate=!0;for(let m=0,x=B*3;m<x;m+=3)if(D(ht,m,y,w),ht.needsUpdate=!0,mt.intersectsTriangle(ht))return!0}}}else{const u=F(s),f=H(s,l);return V(u,o,Ft),!!(i.intersectsBox(Ft)&&Bn(u,t,n,e,i)||(V(f,o,Ft),i.intersectsBox(Ft)&&Bn(f,t,n,e,i)))}}const qt=new rt,un=new X,Mt=new X,is=new C,rs=new C,os=new C,cs=new C;function ls(s,t,n,e={},i={},o=0,r=1/0){t.boundingBox||t.computeBoundingBox(),un.set(t.boundingBox.min,t.boundingBox.max,n),un.needsUpdate=!0;const l=s.geometry,c=l.attributes.position,p=l.index,u=t.attributes.position,f=t.index,a=O.getPrimitive(),y=O.getPrimitive();let w=is,A=rs,g=null,B=null;i&&(g=os,B=cs);let d=1/0,h=null,m=null;return qt.copy(n).invert(),Mt.matrix.copy(qt),s.shapecast({boundsTraverseOrder:x=>un.distanceToBox(x),intersectsBounds:(x,S,P)=>P<d&&P<r?(S&&(Mt.min.copy(x.min),Mt.max.copy(x.max),Mt.needsUpdate=!0),!0):!1,intersectsRange:(x,S)=>{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:_=>Mt.distanceToBox(_),intersectsBounds:(_,M,T)=>T<d&&T<r,intersectsRange:(_,M)=>{for(let T=_,v=_+M;T<v;T++){D(y,3*T,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let b=x,I=x+S;b<I;b++){D(a,3*b,p,c),a.needsUpdate=!0;const z=a.distanceToTriangle(y,w,g);if(z<d&&(A.copy(w),B&&B.copy(g),d=z,h=b,m=T),z<o)return!0}}}});{const P=Qt(t);for(let _=0,M=P;_<M;_++){D(y,3*_,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let T=x,v=x+S;T<v;T++){D(a,3*T,p,c),a.needsUpdate=!0;const b=a.distanceToTriangle(y,w,g);if(b<d&&(A.copy(w),B&&B.copy(g),d=b,h=T,m=_),b<o)return!0}}}}}),O.releasePrimitive(a),O.releasePrimitive(y),d===1/0?null:(e.point?e.point.copy(A):e.point=A.clone(),e.distance=d,e.faceIndex=h,i&&(i.point?i.point.copy(B):i.point=B.clone(),i.point.applyMatrix4(qt),A.applyMatrix4(qt),i.distance=A.sub(i.point).length(),i.faceIndex=m),e)}function as(s,t=null){t&&Array.isArray(t)&&(t=new Set(t));const n=s.geometry,e=n.index?n.index.array:null,i=n.attributes.position;let o,r,l,c,p=0;const u=s._roots;for(let a=0,y=u.length;a<y;a++)o=u[a],r=new Uint32Array(o),l=new Uint16Array(o),c=new Float32Array(o),f(0,p),p+=o.byteLength;function f(a,y,w=!1){const A=a*2;if(R(A,l)){const g=q(a,r),B=k(A,l);let d=1/0,h=1/0,m=1/0,x=-1/0,S=-1/0,P=-1/0;for(let _=g,M=g+B;_<M;_++){const T=3*s.resolveTriangleIndex(_);for(let v=0;v<3;v++){let b=T+v;b=e?e[b]:b;const I=i.getX(b),z=i.getY(b),U=i.getZ(b);I<d&&(d=I),I>x&&(x=I),z<h&&(h=z),z>S&&(S=z),U<m&&(m=U),U>P&&(P=U)}}return c[a+0]!==d||c[a+1]!==h||c[a+2]!==m||c[a+3]!==x||c[a+4]!==S||c[a+5]!==P?(c[a+0]=d,c[a+1]=h,c[a+2]=m,c[a+3]=x,c[a+4]=S,c[a+5]=P,!0):!1}else{const g=F(a),B=H(a,r);let d=w,h=!1,m=!1;if(t){if(!d){const T=g/N+y/$,v=B/N+y/$;h=t.has(T),m=t.has(v),d=!h&&!m}}else h=!0,m=!0;const x=d||h,S=d||m;let P=!1;x&&(P=f(g,y,d));let _=!1;S&&(_=f(B,y,d));const M=P||_;if(M)for(let T=0;T<3;T++){const v=g+T,b=B+T,I=c[v],z=c[v+3],U=c[b],L=c[b+3];c[a+T]=I<U?I:U,c[a+T+3]=z>L?z:L}return M}}}function fs(s,t,n,e,i,o,r){E.setBuffer(s._roots[t]),Pn(0,s,n,e,i,o,r),E.clearBuffer()}function Pn(s,t,n,e,i,o,r){const{float32Array:l,uint16Array:c,uint32Array:p}=E,u=s*2;if(R(u,c)){const a=q(s,p),y=k(u,c);Je(t,n,e,a,y,i,o,r)}else{const a=F(s);ot(a,l,e,o,r)&&Pn(a,t,n,e,i,o,r);const y=H(s,p);ot(y,l,e,o,r)&&Pn(y,t,n,e,i,o,r)}}const us=["x","y","z"];function ps(s,t,n,e,i,o){E.setBuffer(s._roots[t]);const r=Tn(0,s,n,e,i,o);return E.clearBuffer(),r}function Tn(s,t,n,e,i,o){const{float32Array:r,uint16Array:l,uint32Array:c}=E;let p=s*2;if(R(p,l)){const f=q(s,c),a=k(p,l);return je(t,n,e,f,a,i,o)}else{const f=vn(s,c),a=us[f],w=e.direction[a]>=0;let A,g;w?(A=F(s),g=H(s,c)):(A=H(s,c),g=F(s));const d=ot(A,r,e,i,o)?Tn(A,t,n,e,i,o):null;if(d){const x=d.point[a];if(w?x<=r[g+f]:x>=r[g+f+3])return d}const m=ot(g,r,e,i,o)?Tn(g,t,n,e,i,o):null;return d&&m?d.distance<=m.distance?d:m:d||m||null}}const $t=new J,xt=new W,wt=new W,vt=new rt,jn=new X,kt=new X;function ys(s,t,n,e){E.setBuffer(s._roots[t]);const i=bn(0,s,n,e);return E.clearBuffer(),i}function bn(s,t,n,e,i=null){const{float32Array:o,uint16Array:r,uint32Array:l}=E;let c=s*2;if(i===null&&(n.boundingBox||n.computeBoundingBox(),jn.set(n.boundingBox.min,n.boundingBox.max,e),i=jn),R(c,r)){const u=t.geometry,f=u.index,a=u.attributes.position,y=n.index,w=n.attributes.position,A=q(s,l),g=k(c,r);if(vt.copy(e).invert(),n.boundsTree)return V(s,o,kt),kt.matrix.copy(vt),kt.needsUpdate=!0,n.boundsTree.shapecast({intersectsBounds:d=>kt.intersectsBox(d),intersectsTriangle:d=>{d.a.applyMatrix4(e),d.b.applyMatrix4(e),d.c.applyMatrix4(e),d.needsUpdate=!0;for(let h=A,m=g+A;h<m;h++)if(D(wt,3*t.resolveTriangleIndex(h),f,a),wt.needsUpdate=!0,d.intersectsTriangle(wt))return!0;return!1}});{const B=Qt(n);for(let d=A,h=g+A;d<h;d++){const m=t.resolveTriangleIndex(d);D(xt,3*m,f,a),xt.a.applyMatrix4(vt),xt.b.applyMatrix4(vt),xt.c.applyMatrix4(vt),xt.needsUpdate=!0;for(let x=0,S=B*3;x<S;x+=3)if(D(wt,x,y,w),wt.needsUpdate=!0,xt.intersectsTriangle(wt))return!0}}}else{const u=F(s),f=H(s,l);return V(u,o,$t),!!(i.intersectsBox($t)&&bn(u,t,n,e,i)||(V(f,o,$t),i.intersectsBox($t)&&bn(f,t,n,e,i)))}}const Xt=new rt,pn=new X,It=new X,ds=new C,ms=new C,hs=new C,xs=new C;function ws(s,t,n,e={},i={},o=0,r=1/0){t.boundingBox||t.computeBoundingBox(),pn.set(t.boundingBox.min,t.boundingBox.max,n),pn.needsUpdate=!0;const l=s.geometry,c=l.attributes.position,p=l.index,u=t.attributes.position,f=t.index,a=O.getPrimitive(),y=O.getPrimitive();let w=ds,A=ms,g=null,B=null;i&&(g=hs,B=xs);let d=1/0,h=null,m=null;return Xt.copy(n).invert(),It.matrix.copy(Xt),s.shapecast({boundsTraverseOrder:x=>pn.distanceToBox(x),intersectsBounds:(x,S,P)=>P<d&&P<r?(S&&(It.min.copy(x.min),It.max.copy(x.max),It.needsUpdate=!0),!0):!1,intersectsRange:(x,S)=>{if(t.boundsTree){const P=t.boundsTree;return P.shapecast({boundsTraverseOrder:_=>It.distanceToBox(_),intersectsBounds:(_,M,T)=>T<d&&T<r,intersectsRange:(_,M)=>{for(let T=_,v=_+M;T<v;T++){const b=P.resolveTriangleIndex(T);D(y,3*b,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let I=x,z=x+S;I<z;I++){const U=s.resolveTriangleIndex(I);D(a,3*U,p,c),a.needsUpdate=!0;const L=a.distanceToTriangle(y,w,g);if(L<d&&(A.copy(w),B&&B.copy(g),d=L,h=I,m=T),L<o)return!0}}}})}else{const P=Qt(t);for(let _=0,M=P;_<M;_++){D(y,3*_,f,u),y.a.applyMatrix4(n),y.b.applyMatrix4(n),y.c.applyMatrix4(n),y.needsUpdate=!0;for(let T=x,v=x+S;T<v;T++){const b=s.resolveTriangleIndex(T);D(a,3*b,p,c),a.needsUpdate=!0;const I=a.distanceToTriangle(y,w,g);if(I<d&&(A.copy(w),B&&B.copy(g),d=I,h=T,m=_),I<o)return!0}}}}}),O.releasePrimitive(a),O.releasePrimitive(y),d===1/0?null:(e.point?e.point.copy(A):e.point=A.clone(),e.distance=d,e.faceIndex=h,i&&(i.point?i.point.copy(B):i.point=B.clone(),i.point.applyMatrix4(Xt),A.applyMatrix4(Xt),i.distance=A.sub(i.point).length(),i.faceIndex=m),e)}function Gn(s,t,n){return s===null?null:(s.point.applyMatrix4(t.matrixWorld),s.distance=s.point.distanceTo(n.ray.origin),s.object=t,s)}const Zt=new X,Ot=new we,te=new C,ne=new rt,ee=new C,yn=["getX","getY","getZ"];class Sn extends Fe{static serialize(t,n={}){n={cloneBuffers:!0,...n};const e=t.geometry,i=t._roots,o=t._indirectBuffer,r=e.getIndex(),l={version:1,roots:null,index:null,indirectBuffer:null};return n.cloneBuffers?(l.roots=i.map(c=>c.slice()),l.index=r?r.array.slice():null,l.indirectBuffer=o?o.slice():null):(l.roots=i,l.index=r?r.array:null,l.indirectBuffer=o),l}static deserialize(t,n,e={}){e={setIndex:!0,indirect:!!t.indirectBuffer,...e};const{index:i,roots:o,indirectBuffer:r}=t;t.version||(console.warn("MeshBVH.deserialize: Serialization format has been changed and will be fixed up. It is recommended to regenerate any stored serialized data."),c(o));const l=new Sn(n,{...e,[Mn]:!0});if(l._roots=o,l._indirectBuffer=r||null,e.setIndex){const p=n.getIndex();if(p===null){const u=new se(t.index,1,!1);n.setIndex(u)}else p.array!==i&&(p.array.set(i),p.needsUpdate=!0)}return l;function c(p){for(let u=0;u<p.length;u++){const f=p[u],a=new Uint32Array(f),y=new Uint16Array(f);for(let w=0,A=f.byteLength/$;w<A;w++){const g=N*w,B=2*g;R(B,y)||(a[g+6]=a[g+6]/N-w)}}}}get primitiveStride(){return 3}get resolveTriangleIndex(){return this.resolvePrimitiveIndex}constructor(t,n={}){n.maxLeafTris&&(console.warn('MeshBVH: "maxLeafTris" option has been deprecated. Use "targetLeafSize", instead.'),n={...n,targetLeafSize:n.maxLeafTris}),super(t,n)}shiftTriangleOffsets(t){return super.shiftPrimitiveOffsets(t)}writePrimitiveBounds(t,n,e){const i=this.geometry,o=this._indirectBuffer,r=i.attributes.position,l=i.index?i.index.array:null,p=(o?o[t]:t)*3;let u=p+0,f=p+1,a=p+2;l&&(u=l[u],f=l[f],a=l[a]);for(let y=0;y<3;y++){const w=r[yn[y]](u),A=r[yn[y]](f),g=r[yn[y]](a);let B=w;A<B&&(B=A),g<B&&(B=g);let d=w;A>d&&(d=A),g>d&&(d=g),n[e+y]=B,n[e+y+3]=d}return n}computePrimitiveBounds(t,n,e){const i=this.geometry,o=this._indirectBuffer,r=i.attributes.position,l=i.index?i.index.array:null,c=r.normalized;if(t<0||n+t-e.offset>e.length/6)throw new Error("MeshBVH: compute triangle bounds range is invalid.");const p=r.array,u=r.offset||0;let f=3;r.isInterleavedBufferAttribute&&(f=r.data.stride);const a=["getX","getY","getZ"],y=e.offset;for(let w=t,A=t+n;w<A;w++){const B=(o?o[w]:w)*3,d=(w-y)*6;let h=B+0,m=B+1,x=B+2;l&&(h=l[h],m=l[m],x=l[x]),c||(h=h*f+u,m=m*f+u,x=x*f+u);for(let S=0;S<3;S++){let P,_,M;c?(P=r[a[S]](h),_=r[a[S]](m),M=r[a[S]](x)):(P=p[h+S],_=p[m+S],M=p[x+S]);let T=P;_<T&&(T=_),M<T&&(T=M);let v=P;_>v&&(v=_),M>v&&(v=M);const b=(v-T)/2,I=S*2;e[d+I+0]=T+b,e[d+I+1]=b+(Math.abs(T)+b)*Yt}}return e}raycastObject3D(t,n,e=[]){const{material:i}=t;if(i===void 0)return;ne.copy(t.matrixWorld).invert(),Ot.copy(n.ray).applyMatrix4(ne),ee.setFromMatrixScale(t.matrixWorld),te.copy(Ot.direction).multiply(ee);const o=te.length(),r=n.near/o,l=n.far/o;if(n.firstHitOnly===!0){let c=this.raycastFirst(Ot,i,r,l);c=Gn(c,t,n),c&&e.push(c)}else{const c=this.raycast(Ot,i,r,l);for(let p=0,u=c.length;p<u;p++){const f=Gn(c[p],t,n);f&&e.push(f)}}return e}refit(t=null){return(this.indirect?as:Qe)(this,t)}raycast(t,n=Vn,e=0,i=1/0){const o=this._roots,r=[],l=this.indirect?fs:ts;for(let c=0,p=o.length;c<p;c++)l(this,c,n,t,r,e,i);return r}raycastFirst(t,n=Vn,e=0,i=1/0){const o=this._roots;let r=null;const l=this.indirect?ps:es;for(let c=0,p=o.length;c<p;c++){const u=l(this,c,n,t,e,i);u!=null&&(r==null||u.distance<r.distance)&&(r=u)}return r}intersectsGeometry(t,n){let e=!1;const i=this._roots,o=this.indirect?ys:ss;for(let r=0,l=i.length;r<l&&(e=o(this,r,t,n),!e);r++);return e}shapecast(t){const n=O.getPrimitive(),e=super.shapecast({...t,intersectsPrimitive:t.intersectsTriangle,scratchPrimitive:n,iterate:this.indirect?Ge:We});return O.releasePrimitive(n),e}bvhcast(t,n,e){let{intersectsRanges:i,intersectsTriangles:o}=e;const r=O.getPrimitive(),l=this.geometry.index,c=this.geometry.attributes.position,p=this.indirect?w=>{const A=this.resolveTriangleIndex(w);D(r,A*3,l,c)}:w=>{D(r,w*3,l,c)},u=O.getPrimitive(),f=t.geometry.index,a=t.geometry.attributes.position,y=t.indirect?w=>{const A=t.resolveTriangleIndex(w);D(u,A*3,f,a)}:w=>{D(u,w*3,f,a)};if(o){if(!(t instanceof Sn))throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');const w=(A,g,B,d,h,m,x,S)=>{for(let P=B,_=B+d;P<_;P++){y(P),u.a.applyMatrix4(n),u.b.applyMatrix4(n),u.c.applyMatrix4(n),u.needsUpdate=!0;for(let M=A,T=A+g;M<T;M++)if(p(M),r.needsUpdate=!0,o(r,u,M,P,h,m,x,S))return!0}return!1};if(i){const A=i;i=function(g,B,d,h,m,x,S,P){return A(g,B,d,h,m,x,S,P)?!0:w(g,B,d,h,m,x,S,P)}}else i=w}return super.bvhcast(t,n,{intersectsRanges:i})}intersectsBox(t,n){return Zt.set(t.min,t.max,n),Zt.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Zt.intersectsBox(e),intersectsTriangle:e=>Zt.intersectsTriangle(e)})}intersectsSphere(t){return this.shapecast({intersectsBounds:n=>t.intersectsBox(n),intersectsTriangle:n=>n.intersectsSphere(t)})}closestPointToGeometry(t,n,e={},i={},o=0,r=1/0){return(this.indirect?ws:ls)(this,t,n,e,i,o,r)}closestPointToPoint(t,n={},e=0,i=1/0){return Xe(this,t,n,e,i)}}export{Ae as A,Ue as B,k as C,W as E,Fe as G,Ps as I,Ts as L,Sn as M,Bs as N,q as O,In as P,Mn as S,Dn as T,V as a,en as b,zn as c,$ as d,R as e,vn as f,Le as g,bs as h,Ee as i,oe as j,Rn as k,X as l,ge as m,Ne as n,Ss as o};
@@ -1 +0,0 @@
1
- import{a as p}from"./jsx-runtime-DPjLkJKQ.js";import{r as n}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{bi as w,bj as x,bk as E,bl as S,bm as a,ao as f}from"./index-GIL7oGEO.js";import{Object3DDocumentViewport as M}from"./StageHost-BN-IoTef.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./stage-invalidation-DBg3C3Ta.js";import"./live-gesture-lock-DJbrjOqf.js";import"./viewport-shading-boundary-B_-_gABg.js";import"./clip-planes-CnAI6DZn.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./OrbitControls-CM3bPray.js";import"./LineSegments2-CsOpKSiM.js";import"./three.quarks.esm-B1C61jGo.js";import"./scene-framing-Cat0GtyJ.js";import"./source-object3d-authoring-adapter-B-L6Ha6f.js";import"./three-projection-core-BmKMZ-nf.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./standard-viewport-dressing-CzjAe_0A.js";import"./viewport-surface-status-B3om4Kcf.js";function Y({documentId:b,assetPath:o,displayName:u,active:l}){const[g,m]=n.useState(null),[d,c]=n.useState(null);n.useEffect(()=>{if(!l){m(null);return}const i=new AbortController;let s=null;m(null),c(null);const e=w(o);return(e==="glb"||e==="gltf"||e==="spz"?x(o,i.signal):e?E({url:o,format:e}).then(S).then(r=>({root:r,sourceBytes:null})):Promise.reject(new Error(`No native Three.js model loader supports ${o}.`))).then(r=>{if(i.signal.aborted){a(r.root);return}s=r.root,m(r)},r=>{i.signal.aborted||c(r instanceof Error?r.message:String(r))}),()=>{i.abort(),s&&a(s)}},[l,o]);const t=g?.root??null,j=n.useCallback(()=>{if(!t)throw new Error(`Model asset ${o} is not loaded.`);return{root:t,animations:t.animations,dispose(){}}},[o,t]);return d?p.jsx("div",{role:"alert",style:{padding:20,color:f.semantic.danger},children:d}):t?p.jsx(M,{documentId:b,sourcePath:o,displayName:u,build:j,active:l,assetType:"model",modelSource:{kind:"project-file",path:o}}):p.jsxs("div",{style:{padding:20,color:f.content.muted},children:["Loading ",u,"…"]})}export{Y as ModelAssetDocument};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StageHost-BN-IoTef.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/stage-invalidation-DBg3C3Ta.js","assets/live-gesture-lock-DJbrjOqf.js","assets/viewport-shading-boundary-B_-_gABg.js","assets/clip-planes-CnAI6DZn.js","assets/three-CDSueJyJ.js","assets/viewport-pick-context-DkawXbEi.js","assets/OrbitControls-CM3bPray.js","assets/LineSegments2-CsOpKSiM.js","assets/three.quarks.esm-B1C61jGo.js","assets/scene-framing-Cat0GtyJ.js","assets/source-object3d-authoring-adapter-B-L6Ha6f.js","assets/three-projection-core-BmKMZ-nf.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/standard-viewport-dressing-CzjAe_0A.js","assets/viewport-surface-status-B3om4Kcf.js"])))=>i.map(i=>d[i]);
2
- import{_ as r,an as a}from"./index-GIL7oGEO.js";import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as o}from"./index-nmcBqr7Y.js";import{V as c,O as u}from"./viewport-surface-status-B3om4Kcf.js";const s=o.lazy(async()=>({default:(await r(()=>import("./StageHost-BN-IoTef.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]))).Object3DDocumentViewport}));function l(t){return i(t.documentId,t.chromeless),e.jsx(o.Suspense,{fallback:e.jsx(c,{testId:"object3d-document-loading",children:u}),children:e.jsx(s,{...t})})}function i(t,n=!1){o.useEffect(()=>{if(!n)return a(t)},[t,n])}export{l as O};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-4pXQoz5d.js","assets/three.module-D396a9Mn.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-D2fNXpHa.css"])))=>i.map(i=>d[i]);
2
- import{eV as te,ao as A,eW as re,bi as ne,eX as ie,bk as oe,bl as se,bm as Y,eY as ae,_ as le,eZ as ce,e_ as de,e$ as pe}from"./index-GIL7oGEO.js";import{a as E}from"./jsx-runtime-DPjLkJKQ.js";import{r as C}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{W as me,w as ue,x as fe,j as we,v as be,bF as he,D as ge,G as ve,aE as xe,S as ye,V as Ae,A as Ee}from"./three.module-D396a9Mn.js";import{OrbitControls as Ce}from"./OrbitControls-CM3bPray.js";import{s as Me,i as P}from"./editor-presentation-activity-C7SNSmTd.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const v={webglContext:0,animationFrame:0,resizeObserver:0,objectUrl:0},Z={...v};function _(r){v[r]++,Z[r]=Math.max(Z[r],v[r]);let s=!1;return()=>{s||(s=!0,v[r]=Math.max(0,v[r]-1))}}function Se(r){const s=r.animations[0];if(!s)return null;const m=new Ee(r),b=m.clipAction(s).play();return b.paused=!0,m.update(0),m}let je=0;function $e({assetPath:r,materialPath:s,displayName:m="Object3D preview",active:b=!0,sourceFactory:M,showSkeleton:D=!1,background:z,cameraDirection:S,showGrid:H=!0,useDefaultLighting:k=!0,exposure:L=1,setupPreview:T}){const W=C.useRef(null),[j,V]=C.useState(null),[$,R]=C.useState(!0);return C.useEffect(()=>{if(!b)return;const o=W.current;if(!o)return;const x=new AbortController,J=te({id:`preview-card:${++je}`,label:`${m} (preview card)`,contentClock:()=>0}),t=new me({antialias:!0,alpha:!0}),K=_("webglContext"),N=_("animationFrame"),Q=_("resizeObserver"),a=new ue,u=new fe(35,1,.01,1e3),f=new Ce(u,t.domElement),q=new xe;let G=null,w=null,y=null,c,l=null,h=null;const F=[];let d=0,p=!1;if(V(null),R(!0),t.outputColorSpace=we,t.toneMapping=be,t.toneMappingExposure=L,t.shadowMap.enabled=!0,t.setClearColor(z??2106410,1),t.setPixelRatio(Math.min(window.devicePixelRatio,2)),t.domElement.style.width="100%",t.domElement.style.height="100%",t.domElement.style.display="block",o.appendChild(t.domElement),f.enableDamping=!0,f.dampingFactor=.1,k){a.add(new he(16777215,3489874,1.8));const e=new ge(16777215,2.2);e.position.set(3,5,4),a.add(e)}if(H){const e=new ve(10,20,5333103,3423044);a.add(e),F.push(e)}const I=(e,n)=>{if(!h)return;const i=S?new Ae(...S):void 0,g=de(h,Math.max(e,1)/Math.max(n,1),i);u.copy(g,!1),f.target.copy(h.center),f.update()},U=async e=>{if(p)return;a.add(e);let n=!1;if(e.traverse(i=>{ae(i,"gaussianSplat")&&(n=!0)}),n){const{SparkRenderer:i}=await le(async()=>{const{SparkRenderer:g}=await import("./spark.module-4pXQoz5d.js");return{SparkRenderer:g}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));if(p)return;l=new i({renderer:t,enableLod:!1})}if(h=ce(e,"perspective"),I(o.clientWidth,o.clientHeight),G=Se(e),D){const i=new ye(e);i.name="__compact_preview_skeleton",a.add(i),F.push(i)}c=T?.({scene:a,camera:u,renderer:t,model:e}),c?.resize?.(Math.max(o.clientWidth,1),Math.max(o.clientHeight,1),t.getPixelRatio()),R(!1)};(async()=>{try{if(M){y=re(M),await U(y.root);return}if(!r)throw new Error("Compact Object3D preview has no source.");const e=ne(r);if(!e)throw new Error(`No native Three.js loader supports ${r}.`);const n=e==="glb"||e==="gltf"||e==="spz"?await ie(r,x.signal):await oe({url:r,format:e,...s?{materialUrl:s}:{}});if(w=se(n),x.signal.aborted||p){Y(w),w=null;return}await U(w)}catch(e){!x.signal.aborted&&!p&&(V(e instanceof Error?e.message:String(e)),R(!1))}})();const B=()=>{const e=Math.max(o.clientWidth,1),n=Math.max(o.clientHeight,1);t.setSize(e,n,!1),h&&!c?I(e,n):(u.aspect=e/n,u.updateProjectionMatrix()),c?.resize?.(e,n,t.getPixelRatio())},X=new ResizeObserver(B);X.observe(o),B();const O=()=>{if(d=0,p||!P())return;const e=Math.min(q.getDelta(),.1);f.update(),l&&a.add(l);try{c?.render?c.render(e):t.render(a,u)}finally{l?.removeFromParent()}d=requestAnimationFrame(O)},ee=Me(()=>{P()?!p&&d===0&&(q.getDelta(),O()):(cancelAnimationFrame(d),d=0)});return P()&&(d=requestAnimationFrame(O)),()=>{p=!0,ee(),J(),x.abort(new Error("Compact Object3D preview closed.")),cancelAnimationFrame(d),X.disconnect(),G?.stopAllAction(),c?.dispose(),f.dispose(),l&&(l.removeFromParent(),pe(l),l=null),t.dispose(),t.forceContextLoss();for(const e of F){const n=e;n.geometry?.dispose();const i=n.material;if(Array.isArray(i))for(const g of i)g.dispose();else i?.dispose()}y&&y.dispose(),w&&Y(w),o.contains(t.domElement)&&o.removeChild(t.domElement),Q(),N(),K()}},[b,r,z,S,L,s,T,H,D,M,k]),E.jsxs("div",{ref:W,"data-testid":"object3d-compact-preview",role:"region","aria-label":`Interactive 3D preview: ${m}`,"aria-busy":$,style:{width:"100%",height:"100%",minHeight:220,overflow:"hidden",position:"relative",background:A.surface.inset},children:[$&&!j?E.jsx("span",{style:{position:"absolute",padding:10,color:A.content.muted},children:"Loading…"}):null,b?null:E.jsx("span",{style:{position:"absolute",padding:10,color:A.content.muted},children:"Preview suspended while inactive."}),j?E.jsx("div",{role:"alert",style:{position:"absolute",padding:10,color:A.semantic.danger},children:j}):null]})}export{$e as Object3DPreview};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DPreview-DL8oi7Xs.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/OrbitControls-CM3bPray.js","assets/editor-presentation-activity-C7SNSmTd.js"])))=>i.map(i=>d[i]);
2
- import{cz as T,ce as L,cj as H,cA as R,dG as U,ao as i,a5 as b,f0 as w,aX as k,em as W,a4 as M,f1 as N,f2 as G,_ as J}from"./index-GIL7oGEO.js";import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{d as V}from"./asset-editor-persistence-BBaONOJt.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./three.module-D396a9Mn.js";const S=new Map,K=new Set;function C(){for(const e of K)e()}function X(e,o){const n=S.get(e);if(n?.status==="running")return n;const f={id:e,label:o,stage:"fetch",loaded:0,total:0,status:"running",controller:new AbortController};return S.set(e,f),C(),f}function g(e,o){const n=S.get(e);n&&(Object.assign(n,o),C())}const q=r.lazy(()=>J(()=>import("./Object3DPreview-DL8oi7Xs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(e=>({default:e.Object3DPreview}))),Q={width:"100%"};function Y(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function de({online:e,mode:o="full",showPreview:n=!1,onResolved:f}){const[m,z]=r.useState([]),[l,D]=r.useState(null),[O,y]=r.useState(!0),[A,B]=r.useState(null),[v,E]=r.useState(null),[I,h]=r.useState(!1),[_,x]=r.useState(!1),[j,P]=r.useState(!1),[c,p]=r.useState("idle");r.useEffect(()=>{if(o==="preview"){y(!1);return}let s=!1;return y(!0),B(null),T(e.source,e.id).then(a=>{s||(z(a),a.length>0&&D(a[0]))}).catch(a=>{s||(z([]),B(a instanceof L?H(a.code):a instanceof Error?a.message:"Asset delivery metadata is unavailable while offline."))}).finally(()=>{s||y(!1)}),()=>{s=!0}},[o,e.source,e.id]);const F=e.source==="local"&&(e.type==="model"||e.type==="animation"||e.type==="source");r.useEffect(()=>{if(o==="inspector"&&!n){h(!1);return}let s=!1;if(E(null),x(!1),P(!1),!F){h(!1);return}return h(!0),R(e.source,e.id).then(a=>{s||(E(a),x(!a))}).catch(()=>{s||x(!0)}).finally(()=>{s||h(!1)}),()=>{s=!0}},[o,e.id,e.source,n,F]);const $=r.useCallback(async()=>{if(!l)return;const s=`single:${e.source}:${e.id}`,a=X(s,e.name);g(s,{stage:"fetch",loaded:0,total:l.sizeBytes??0,status:"running"}),p("downloading");try{const d={source:e.source,id:e.id,name:e.name,url:l.url,format:l.format,jobId:s,signal:a.controller.signal};l.includes&&(d.includes=l.includes);const u=await V(d);u.ok&&u.path?(g(s,{stage:"commit",loaded:l.sizeBytes??1,total:l.sizeBytes??1,status:u.alreadyExists?"skipped":"imported",message:u.path}),p("done"),U(`${e.name} added to Content — drag it from there into the viewport to place it.`),f?.(`/${u.path}`)):(g(s,{status:"failed",message:u.error??"The import was rejected."}),p("error"))}catch(d){g(s,{status:a.controller.signal.aborted?"cancelled":"failed",message:d instanceof Error?d.message:String(d)}),p("error")}},[e,l,f]);return t.jsxs("div",{style:{padding:8,display:"flex",flexDirection:"column",gap:8},children:[o!=="preview"&&t.jsx("div",{style:{fontWeight:600,fontSize:12,color:i.content.primary,wordBreak:"break-all"},children:e.name}),(o!=="inspector"||n)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{width:"100%",height:"100%",minHeight:o==="inspector"?160:240,background:i.surface.shell,borderRadius:i.shape.small,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},children:I?t.jsxs("div",{style:{color:i.content.muted,fontSize:11},children:[t.jsx(b,{icon:w,spin:!0,style:{marginRight:5}}),"Loading Asset Editor preview…"]}):v?t.jsx(r.Suspense,{fallback:t.jsx("span",{style:{color:i.content.muted},children:"Loading preview…"}),children:t.jsx(q,{assetPath:v.path,materialPath:v.materialPath,displayName:e.name})}):t.jsx("img",{src:j?"/__editor/asset-library/local-placeholder.svg":e.thumbnailUrl,alt:j?`${e.name} preview unavailable`:e.name,onError:()=>P(!0),style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}),j&&t.jsx("div",{role:"status",style:{color:i.content.dim,fontSize:10},children:"The catalog preview could not be loaded; showing the typed fallback."}),_&&t.jsx("div",{style:{color:i.content.dim,fontSize:10},children:"Interactive preview is unavailable for this variant; showing its catalog thumbnail."})]}),o!=="preview"&&t.jsxs(t.Fragment,{children:[t.jsx(k,{label:"Info",children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:11,color:i.content.dim,marginBottom:2},children:"Source"}),t.jsx("div",{style:{fontSize:11,color:i.content.primary},children:e.source==="polyhaven"?"Poly Haven":e.source==="ambientcg"?"ambientCG":"Full Catalog"})]}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:11,color:i.content.dim,marginBottom:2},children:"Type"}),t.jsx("div",{style:{fontSize:11,color:i.content.primary},children:e.type})]}),e.tags.length>0&&t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:11,color:i.content.dim,marginBottom:2},children:"Tags"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:3},children:e.tags.slice(0,12).map(s=>t.jsx("span",{style:{fontSize:10,padding:"1px 5px",background:i.surface.raised,borderRadius:i.shape.small,color:i.content.muted},children:s},s))})]}),e.author&&t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:11,color:i.content.dim,marginBottom:2},children:"Author"}),t.jsx("div",{style:{fontSize:11,color:i.content.primary},children:e.author})]})]})}),t.jsx(k,{label:"Add to Project",children:t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:O?t.jsxs("div",{style:{fontSize:11,color:i.content.dim},children:[t.jsx(b,{icon:w,spin:!0,style:{marginRight:4}}),"Loading options..."]}):A?t.jsxs("div",{role:"alert",style:{fontSize:11,color:i.content.muted},children:["Delivery unavailable: ",A]}):m.length>0?t.jsxs(t.Fragment,{children:[t.jsx(W,{"aria-label":"Asset delivery",value:l?m.indexOf(l):0,onChange:s=>D(m[Number(s.target.value)]??null),style:Q,children:m.map((s,a)=>t.jsxs("option",{value:a,children:[s.label,s.sizeBytes?` (${Y(s.sizeBytes)})`:""]},a))}),t.jsxs(M,{type:"button",variant:c==="done"?"success":"primary",size:"comfortable",onClick:$,disabled:c==="downloading",style:{width:"100%"},children:[t.jsx(b,{icon:c==="done"?N:c==="downloading"?w:G,spin:c==="downloading",style:{fontSize:10}}),c==="done"?"Downloaded":c==="downloading"?"Downloading...":c==="error"?"Retry":"Add to Project"]})]}):t.jsx("div",{role:"status",style:{fontSize:11,color:i.content.dim},children:e.source==="local"?"No healthy SSD or cloud delivery is available for this asset.":"This provider has no compatible remote delivery for the selected asset."})})}),t.jsxs("div",{style:{fontSize:10,color:i.content.dim,padding:"4px 0"},children:["License: ",e.license??"CC0 (Public Domain)"]})]})]})}export{de as OnlineAssetDetail};
@@ -1,2 +0,0 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{l as z,a as L,b as F}from"./configurations-DTBMdaTL.js";import{a4 as w,a5 as b,fM as B,a9 as S,e6 as G,aa as P,ab as k,fN as V,fO as q,q as x,fP as A,a6 as m,fQ as R,fR as D,f8 as O}from"./index-GIL7oGEO.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{i as U,g as Y,d as H}from"./active-ingest-CT6jSGhr.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./capability-coverage-Czas4C18.js";import{u as K,v as I,b as T,w as Q,x as C,d as W,h as E,e as X,r as J,p as Z}from"./play-mode-BFU2PCkG.js";const $="play-control",_=4;function ee(t){return Math.min(_,Math.max(1,Math.floor(t)))-1}function te(t){return t+1}function M(t){return t===1?"1 instance":`${t} instances`}function se(){const t=l.useSyncExternalStore(K,I,I),[n,a]=l.useState(!1),i=l.useRef(null),r=te(t);return e.jsxs("div",{className:"vgai-playbar-popover-anchor",children:[e.jsxs(w,{ref:i,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?"vgai-player-count-menu":void 0,onClick:()=>a(o=>!o),title:`${M(r)} — choose how many runtimes Play mounts side by side`,children:[e.jsx(b,{icon:B,size:"md"}),e.jsx(S,{children:"Instances"}),e.jsx(S,{variant:"code",children:r}),e.jsx(G,{direction:"down"})]}),n&&e.jsx(P,{id:"vgai-player-count-menu",anchorRef:i,gap:4,onDismiss:()=>a(!1),children:Array.from({length:_},(o,c)=>c+1).map(o=>e.jsx(k,{role:"menuitemradio","aria-checked":o===r,onSelect:()=>{T(ee(o)),a(!1)},children:M(o)},o))})]})}function ae({regime:t}){if(!t)return null;const n="Play edits are temporary unless explicitly committed to source.";return e.jsx("span",{role:"img","aria-label":n,className:"vgai-play-edit-regime","data-testid":"play-edit-regime","data-regime":t,title:n,children:e.jsx(b,{icon:m.status.warning,size:"sm"})})}function f({label:t,icon:n,onClick:a,title:i=t,disabled:r=!1,pressed:o,variant:c="ghost",testId:s}){return e.jsx(O,{"aria-label":t,"aria-pressed":o,"data-testid":s,disabled:r,size:"comfortable",variant:c,onClick:d=>{d.currentTarget.blur(),a()},title:i,children:e.jsx(b,{icon:n,size:"md"})})}function ne({state:t,exporting:n=!1,restartReason:a=null,playEditRegime:i=null,onPlay:r,onPause:o,onStep:c,onRestart:s,onStop:d,instances:y=null,picker:j=null,options:v=null,placement:u="launcher"}){const p=t!=="stopped",h=t==="paused";return u==="runtime"&&!p?null:e.jsxs(A,{role:"toolbar","aria-label":"Game transport",className:"vgai-playbar",gap:2,align:"center",children:[u==="launcher"&&e.jsxs(e.Fragment,{children:[j,v,y!==null&&e.jsx(se,{}),e.jsx(f,{label:"Play",title:p?"Exit Play mode":"Play (run game)",icon:m.transport.play,pressed:p,testId:$,onClick:r})]}),u==="runtime"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{label:"Pause",title:h?"Resume":"Pause",icon:m.transport.pause,disabled:!p||n,pressed:h,onClick:o}),e.jsx(f,{label:"Step one frame",icon:m.transport.step,disabled:!h||n,onClick:c}),e.jsx(R,{}),e.jsx(f,{label:"Restart Game",icon:m.transport.restart,disabled:!p||n,variant:a?"primary":"ghost",testId:"restart-game",onClick:s,title:a??"Restart game (dispose and remount every root without reloading the editor)"}),e.jsx(f,{label:"Stop",icon:m.transport.stop,disabled:!p,onClick:d}),p&&e.jsxs(e.Fragment,{children:[e.jsx(R,{}),e.jsx(ae,{regime:i})]})]})]})}function ye({placement:t="launcher"}){const n=l.useSyncExternalStore(V,q),{session:a}=x();l.useSyncExternalStore(a.subscribe,a.version,a.version);const i=a.playState(),r=l.useSyncExternalStore(Q,C,C),[,o]=l.useState(0),c=re(),s=U()?Y():null;if(s)return e.jsxs(A,{role:"toolbar","aria-label":"Game transport",className:"vgai-playbar",gap:2,align:"center",children:[e.jsx(f,{label:t==="runtime"?s.playing?"Pause ingested game":"Resume ingested game":"Run ingested game",title:s.playing?"Pause ingested game":"Run ingested game",icon:s.playing?m.transport.pause:m.transport.play,pressed:s.playing,testId:$,onClick:()=>{s.playing?s.pause():s.play(),o(u=>u+1)}}),t==="runtime"&&H()&&e.jsx(f,{label:"Stop",title:"Stop the game and return to the scene",icon:m.transport.stop,onClick:()=>E()}),t==="runtime"&&s.canStep&&e.jsx(f,{label:"Step ingested game",title:"Advance the ingested game one frame",icon:m.transport.step,onClick:()=>{s.step(),o(u=>u+1)}})]});const d=c.configurations.find(u=>u.id===c.selectedId)??null,y=d?.kind==="compound"?d.instances??null:null,j=async()=>{if(d&&d.kind!==g){const u=await F(d.id).catch(p=>(x().notify({tone:"error",title:`Run "${d.id}"`,detail:p instanceof Error?p.message:String(p)}),null));if(!u)return;if(!u.ready){x().notify({tone:"error",title:`Run "${d.id}" is not ready`,detail:Object.entries(u.logs).map(([p,h])=>`${p}: ${h.slice(-3).join(" | ")||"no output"}`).join(`
2
- `)});return}y!==null&&T(Math.max(0,y-1)),c.refresh()}await X()},v=()=>{E(),d&&d.kind!==g&&L(d.id).then(()=>c.refresh())};return e.jsx(ne,{placement:t,exporting:n,state:i,restartReason:r,playEditRegime:a.playEditRegime(),instances:y,options:e.jsx(ie,{}),picker:c.configurations.length>1?e.jsx(oe,{run:c,disabled:i!=="stopped"}):null,onPlay:()=>{i!=="stopped"?v():j()},onPause:()=>{i==="paused"?J():Z()},onStep:()=>W(),onRestart:()=>void j(),onStop:()=>v()})}function ie(){const{settings:t}=x(),n=l.useSyncExternalStore(t.subscribe,()=>t.get("vgai.play.keepPanelsVisible")===!0),[a,i]=l.useState(!1),r=l.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsx(O,{ref:r,"aria-label":"Play options",title:"Play options","aria-expanded":a,"aria-haspopup":"menu",onClick:()=>i(!a),children:e.jsx(b,{icon:D})}),a&&e.jsx(P,{anchorRef:r,onDismiss:()=>i(!1),children:e.jsx(k,{role:"menuitemcheckbox","aria-checked":n,onSelect:()=>{t.set("vgai.play.keepPanelsVisible",!n),i(!1)},children:"Keep panels visible during Play"})})]})}const g="play",N="runSelection";function re(){const[t,n]=l.useState([]),[a,i]=l.useState(()=>x().projectLocalState.read(N)??g),r=l.useCallback(async()=>{const s=await z().catch(()=>[]);n(s)},[]);l.useEffect(()=>{r()},[r]);const o=l.useMemo(()=>[{id:g,kind:g,role:"run",describe:"Mount every root in the host",status:"stopped"},...t.filter(s=>s.role==="run")],[t]),c=l.useCallback(s=>{i(s),x().projectLocalState.write(N,s)},[]);return{configurations:o,selectedId:a,select:c,refresh:r}}function oe({run:t,disabled:n}){const a=l.useRef(null),[i,r]=l.useState(!1),o=t.configurations.find(s=>s.id===t.selectedId),c=o?.id===g?"Play":o?.id??"Play";return e.jsxs("div",{className:"vgai-playbar-popover-anchor",children:[e.jsxs(w,{ref:a,variant:"ghost",size:"compact","aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?"vgai-run-configuration-menu":void 0,"data-testid":"run-configuration-picker",disabled:n,onClick:()=>r(s=>!s),title:"Which configuration Play starts (the manifest's run-role configurations)",children:[e.jsx(S,{variant:"code",children:c}),e.jsx(b,{icon:D,size:"sm"})]}),i&&e.jsx(P,{id:"vgai-run-configuration-menu",anchorRef:a,align:"start",gap:4,onDismiss:()=>r(!1),children:t.configurations.map(s=>e.jsxs(k,{role:"menuitemradio","aria-checked":s.id===t.selectedId,"data-testid":`run-configuration-${s.id}`,title:s.describe??void 0,onSelect:()=>{t.select(s.id),r(!1)},children:[s.id===g?"Play":`${s.id} · ${s.kind}`,s.status==="running"?" ●":""]},s.id))})]})}export{ye as P};
@@ -1 +0,0 @@
1
- import{HDRLoader as r}from"./HDRLoader-THU88oVD.js";import"./three.module-D396a9Mn.js";class d extends r{constructor(e){console.warn("RGBELoader has been deprecated. Please use HDRLoader instead."),super(e)}}export{d as RGBELoader};