@volter/game-editor 0.5.107 → 0.5.109

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 (300) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2165 -2165
  5. package/dist/assets/{AssetBudgetPanel-DL6LB2Ui.js → AssetBudgetPanel-CCkSD93r.js} +3 -3
  6. package/dist/assets/{AudioViewer-BbBbuui2.js → AudioViewer-DRAuh1Tf.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-G0EtNQ0Q.js → CanvasBoardDocument-eJIG9t3X.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-ENN8lVh6.js → CanvasSceneViewport-BGIV83u9.js} +1 -1
  9. package/dist/assets/{ColorInput-C1-KnTQ2.js → ColorInput-Di_iRap7.js} +1 -1
  10. package/dist/assets/{ColorPicker-BtuCybMi.js → ColorPicker-C79B61hb.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-B16qpKB_.js → EntityModelDocument-BPh9rEzM.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-Dp6MZHHQ.js → EnvironmentAssetDocument-BkIR9E5x.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-DNaUh1C0.js → GameplaySessionTimeline-DTvZ3GjC.js} +1 -1
  14. package/dist/assets/{ImageViewer-CiZdurPk.js → ImageViewer-BXNPoub2.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-DReh6Wj6.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-B-EsCn3R.js → JsonAssetDocument-DzcgeyAQ.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-CDhv_1S4.js → LiveModuleDocument-BUUBuUMh.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-DZt79_59.js → LutAssetDocument-B0I8Bx-N.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-DP2QIknz.js → ModelAssetDocument-CkTK1kar.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-CFrjNfc1.js → NonThreeAuthoringBootstrap-DAnz0kxg.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-C4tnEL8_.js → Object3DDocumentToolbar-CPuXNd-1.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-Bn7uHN-F.js +2 -0
  23. package/dist/assets/{Object3DPreview-k-9ykNa8.js → Object3DPreview-BuD-anwy.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-CyK4WP__.js → OnlineAssetDetail-DnikeT94.js} +1 -1
  25. package/dist/assets/{PlayBar-47uTBVOH.js → PlayBar-CYc9J-Qd.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-DntD016S.js → QuarksAssetDocument-BtUVssr5.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-DU0Pmb3m.js → ReactCanvasControls-C3JazO5f.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-CZAAA3ie.js → RootSelectionOverlay-DVKRGf1V.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-i4N51Vzt.js → ShaderAssetDocument-Cm93bxxc.js} +1 -1
  30. package/dist/assets/{ShadowEditor-DugoNJZj.js → ShadowEditor-DwPHRHuU.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-fRqiRILF.js → SourceAssetViewer-DXsirN9n.js} +1 -1
  32. package/dist/assets/{StageHost-C3YU5Ncp.js → StageHost-Dly3GvuI.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-D3aG0waZ.js → StoryPreviewMount-gtSXRf8l.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-DL16UmNJ.js → ThreeBoardDocument-COb8NNN6.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-BF-lpZT6.js → ThreeIsolationSceneContent-Div0OiTb.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-DEKqXBil.js → ToolObject3DPreview-BdiwjLou.js} +1 -1
  37. package/dist/assets/{Toolbar-DRSrMbas.js → Toolbar-DKzjaszH.js} +1 -1
  38. package/dist/assets/{TransientHint-Czo7kfrf.js → TransientHint-CTWR6LpT.js} +1 -1
  39. package/dist/assets/{VideoViewer-Dqf6by8l.js → VideoViewer-BWoW4IVz.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-Z-cTXIrK.js → ViewportShadingMenu-K3E7trcz.js} +1 -1
  41. package/dist/assets/{active-ingest-CWGve9s6.js → active-ingest-C1qTpJWx.js} +2 -2
  42. package/dist/assets/{animation-clock-Bsx2IGz7.js → animation-clock-C8yHgr9_.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-qLGPQdt8.js → animation-mixers.service-C_0sRw0F.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-CM1dzMoD.js → animation-timeline.utility-CD9oW3j1.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-CODRJV_V.js → asset-budget-asset.menu-DWFIOVgR.js} +1 -1
  46. package/dist/assets/{asset-budget.action-BoX0gf7s.js → asset-budget.action-B5pY1gXn.js} +1 -1
  47. package/dist/assets/{asset-budget.document-kXzOhq-v.js → asset-budget.document-o6VdSdic.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-DzSmHF3Z.js → asset-budget.menu-B8-fCUlk.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-CSOOj_Dj.js → asset-editor-persistence-CwS08IFG.js} +1 -1
  50. package/dist/assets/{asset-loaders-DHSNFY7y.js → asset-loaders-BgJ1cWuF.js} +1 -1
  51. package/dist/assets/{asset-preview-BuDDaHao.js → asset-preview-Brlu-Xoc.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-Dw3fJ0zS.js → audio-unlock.service-Biv0ZOCH.js} +1 -1
  53. package/dist/assets/{audio.utility-k24zphFB.js → audio.utility-C1eDZAD6.js} +1 -1
  54. package/dist/assets/autoplay.service-C0Gx-tw4.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-CJaZA39O.js → babylon-authoring-adapter-BrFLD_ik.js} +1 -1
  56. package/dist/assets/{binding-resolver-DB46VaoX.js → binding-resolver-D7rIcBbf.js} +2 -2
  57. package/dist/assets/{blender-emscripten-engine-DZk6Gn8_.js → blender-emscripten-engine-C_f-vtj2.js} +1 -1
  58. package/dist/assets/{blender-node-editor.document-BnVcIzCg.js → blender-node-editor.document-Dz2_kub9.js} +1 -1
  59. package/dist/assets/{blender-properties-tab-D-662Fpx.js → blender-properties-tab-GmNRB7ft.js} +1 -1
  60. package/dist/assets/blender-runtime-host-D3-AAxoI.js +7 -0
  61. package/dist/assets/{blender-runtime-skin-wPiapdSw.js → blender-runtime-skin-39i3Ay2u.js} +32 -32
  62. package/dist/assets/{blender-runtime.document-CIXU4ZzP.js → blender-runtime.document-DC8-QnY0.js} +1 -1
  63. package/dist/assets/{blender-screenshot.menu-CkhwST9Y.js → blender-screenshot.menu-Dw0eiKq1.js} +1 -1
  64. package/dist/assets/{blender-timeline.document-CX-M4uue.js → blender-timeline.document-Cug6pDX1.js} +1 -1
  65. package/dist/assets/{blender-uv-editor.document-BEHIxdkC.js → blender-uv-editor.document-CSreixhA.js} +1 -1
  66. package/dist/assets/{blender-version.status-CcGK55OS.js → blender-version.status-qP5NrHjl.js} +1 -1
  67. package/dist/assets/{blender-wali-engine-B1kj0Bor.js → blender-wali-engine-DdbLddKd.js} +1 -1
  68. package/dist/assets/{blender.command-2pywCQfL.js → blender.command-BrPdewPa.js} +1 -1
  69. package/dist/assets/{board-guides-Dz7Etaga.js → board-guides-BVn674bj.js} +1 -1
  70. package/dist/assets/{bridge.command-CmGZ84gX.js → bridge.command-bILj0Sr4.js} +3 -3
  71. package/dist/assets/{browserAll-BKHH2gsy.js → browserAll-CI9QtNtB.js} +1 -1
  72. package/dist/assets/{build-player.document-CjBKvIhy.js → build-player.document-BOtbz_7u.js} +1 -1
  73. package/dist/assets/{build-profiles.document-CqLtkpe4.js → build-profiles.document-Cz_2fIEA.js} +1 -1
  74. package/dist/assets/{build-progress.status-BAV1mKUJ.js → build-progress.status-BmlYkC--.js} +1 -1
  75. package/dist/assets/{build-session-BmRRDRBx.js → build-session-DVOSXPmX.js} +1 -1
  76. package/dist/assets/{build.action-B02A7rJ3.js → build.action-GgVNgcj-.js} +1 -1
  77. package/dist/assets/{build.command-CYnZ9-g_.js → build.command-Cql6BTK2.js} +1 -1
  78. package/dist/assets/{build.header-CJM5YOMx.js → build.header-Bi7h9Jxp.js} +1 -1
  79. package/dist/assets/{build.menu-VvKwyS0U.js → build.menu-DK0V575e.js} +1 -1
  80. package/dist/assets/{build.service-DnJS_FL-.js → build.service-pjxxD2mN.js} +1 -1
  81. package/dist/assets/{camera-DYhESeKI.js → camera-D38IYzVG.js} +1 -1
  82. package/dist/assets/{camera-runtime.inspector-m-Y4PdzQ.js → camera-runtime.inspector-BysePUWe.js} +1 -1
  83. package/dist/assets/{canvas-design-mount-C7MBoEMe.js → canvas-design-mount-DUFU4onq.js} +3 -3
  84. package/dist/assets/{canvas-entry-runtime-BeCLUBQm.js → canvas-entry-runtime-CVgvZ-8U.js} +2 -2
  85. package/dist/assets/{canvas-preview-frames-C-xI8RkA.js → canvas-preview-frames-C0mqVPgw.js} +1 -1
  86. package/dist/assets/{canvas-story-capture.service-6wW78c0j.js → canvas-story-capture.service-Al3qHPqY.js} +2 -2
  87. package/dist/assets/{capability-coverage-CA2qKK5U.js → capability-coverage-DAfqpXOj.js} +1 -1
  88. package/dist/assets/{collaboration-presence-m4TPHGIS.js → collaboration-presence-DltcWF-9.js} +1 -1
  89. package/dist/assets/{collider-DuN63Orf.js → collider-BvhH4BcM.js} +1 -1
  90. package/dist/assets/{component-board.service-B_-SFpst.js → component-board.service-BY_oFObh.js} +2 -2
  91. package/dist/assets/{component-board.service-7A1U7qFl.js → component-board.service-C5VH9NI2.js} +2 -2
  92. package/dist/assets/{component-board.service-BVr43mLy.js → component-board.service-C_kX0wd-.js} +2 -2
  93. package/dist/assets/{component-contracts.service-BTdKh0XR.js → component-contracts.service-DcOH4GIX.js} +1 -1
  94. package/dist/assets/{component-instance-root-ChvMDavA.js → component-instance-root-Djq3PDc8.js} +1 -1
  95. package/dist/assets/{component-verbs.command-QWHHeNCS.js → component-verbs.command-BhuTKNDk.js} +1 -1
  96. package/dist/assets/{component-verbs.service-CB7al_dA.js → component-verbs.service-cdOW641O.js} +1 -1
  97. package/dist/assets/{config-CHOSOOgB.js → config-DKCTY-Oj.js} +2 -2
  98. package/dist/assets/{configurations-BdNsbAoY.js → configurations-D4qdAYVT.js} +1 -1
  99. package/dist/assets/{connection.status-CMYe9teN.js → connection.status-DqvSXOqQ.js} +1 -1
  100. package/dist/assets/{constraints.inspector-Ci6rPyuQ.js → constraints.inspector-B8ybW9sy.js} +1 -1
  101. package/dist/assets/{content-bounds-BvxhGEDh.js → content-bounds-BLQTqJJp.js} +1 -1
  102. package/dist/assets/{contract-system-adapters-BKaXF3b2.js → contract-system-adapters-BQVWtVjc.js} +1 -1
  103. package/dist/assets/{coverage.service-wgUzxsjV.js → coverage.service-C4wjYYN6.js} +1 -1
  104. package/dist/assets/{create-runtime-CLaLvNFe.js → create-runtime-DpoPjpAR.js} +1 -1
  105. package/dist/assets/{curve-CV1cTSdc.js → curve-BSA7rg2A.js} +1 -1
  106. package/dist/assets/{data-asset-BsBTIark.js → data-asset-D3F8CXx0.js} +1 -1
  107. package/dist/assets/{data-ref-BXgUeEwn.js → data-ref-RaHFohbN.js} +1 -1
  108. package/dist/assets/{debug-bridge-CUQpEbw-.js → debug-bridge-CPq4pIaW.js} +1 -1
  109. package/dist/assets/{debug-registry-B5AW1iuS.js → debug-registry-SP12sh2J.js} +1 -1
  110. package/dist/assets/{deferred-ingest-play-BKkABBQR.js → deferred-ingest-play-CAjMiy72.js} +2 -2
  111. package/dist/assets/{design-time-canvas-mount-USq2R2k0.js → design-time-canvas-mount-6_9ogA7k.js} +2 -2
  112. package/dist/assets/{design-time-layers-kAGvB6eW.js → design-time-layers-C9-zyQgK.js} +1 -1
  113. package/dist/assets/{design-time-mount.service-1LDjD3zB.js → design-time-mount.service-BR1z-oZk.js} +2 -2
  114. package/dist/assets/{design-time-mount.service-CaA7Bjk2.js → design-time-mount.service-DyPkUjUq.js} +2 -2
  115. package/dist/assets/{design-time-react-mount-C_xbDCEB.js → design-time-react-mount-Cwnp6Wne.js} +1 -1
  116. package/dist/assets/{document-preview-three-DDni353i.js → document-preview-three-Aqn0tYup.js} +1 -1
  117. package/dist/assets/{dom-authoring-adapter-BUXYR70z.js → dom-authoring-adapter--Y-FLMYx.js} +1 -1
  118. package/dist/assets/{draco3d-pKu1PDMS.js → draco3d-DTAmCQ2c.js} +1 -1
  119. package/dist/assets/{edit-mode-audio.service-DbwLhxDU.js → edit-mode-audio.service-CTuPkuM7.js} +1 -1
  120. package/dist/assets/{edit-mode-authoring-O9u_3q5d.js → edit-mode-authoring-ySC_NtLV.js} +1 -1
  121. package/dist/assets/{edit-mode-networking.service-CqI7M3Er.js → edit-mode-networking.service-A9SV-x1Q.js} +1 -1
  122. package/dist/assets/{editor-api-cCKpypuR.js → editor-api-BOk57i1q.js} +1 -1
  123. package/dist/assets/{editor-layers-CX4V4tDr.js → editor-layers-D5KQrZV0.js} +1 -1
  124. package/dist/assets/{editor-shell-store-D0YYcLl-.js → editor-shell-store-HdyIJxw4.js} +1 -1
  125. package/dist/assets/{entity-object-CAHvjc6f.js → entity-object-Djm4wdCS.js} +1 -1
  126. package/dist/assets/{extend-C6pF1kBd.js → extend-F7x1JUVu.js} +1 -1
  127. package/dist/assets/{fork-menu-BimIWU2c.js → fork-menu-DLIIk-uS.js} +1 -1
  128. package/dist/assets/{frame-debugger-store-Cb1OUNMi.js → frame-debugger-store-aGt6VLrL.js} +1 -1
  129. package/dist/assets/{game-contract-seams-Dby9gdES.js → game-contract-seams-7rlt1BKU.js} +1 -1
  130. package/dist/assets/{game-css-scope-transform-BwvUSRo6.js → game-css-scope-transform-DvQFKPX7.js} +1 -1
  131. package/dist/assets/{game-document.service-FQzdqAMq.js → game-document.service-AkPID9br.js} +1 -1
  132. package/dist/assets/{game-eval.command-B_yzKma-.js → game-eval.command-CdDG2mHX.js} +1 -1
  133. package/dist/assets/{game-module-access-DONOTxuL.js → game-module-access-CraKpebU.js} +1 -1
  134. package/dist/assets/{game-network-DCUGpA0n.js → game-network-DKgC2niL.js} +3 -3
  135. package/dist/assets/{gameplay-export-snVD14ce.js → gameplay-export-CIjnOVcO.js} +1 -1
  136. package/dist/assets/{gameplay-replay-Drrem287.js → gameplay-replay-BfXOfg9i.js} +1 -1
  137. package/dist/assets/{gameplay.command-R46N9kEg.js → gameplay.command-DhzyrDhY.js} +1 -1
  138. package/dist/assets/{generation-jobs-DjobtCdn.js → generation-jobs-BzYqGgKC.js} +1 -1
  139. package/dist/assets/{generation.service-DjSwXiED.js → generation.service-CzvLruoQ.js} +1 -1
  140. package/dist/assets/{generations-DJJOo6CO.js → generations-CON0t5BL.js} +1 -1
  141. package/dist/assets/{generations.status-DNrErQRi.js → generations.status-A4Wk1BGl.js} +1 -1
  142. package/dist/assets/{hierarchy-marks-DLitjmuD.js → hierarchy-marks-BFDfKk_l.js} +1 -1
  143. package/dist/assets/{hosted-asset-materialization-WtbEv8Aj.js → hosted-asset-materialization-CazDXedD.js} +1 -1
  144. package/dist/assets/{index-Crpdd93h.js → index-B49gtmr1.js} +1 -1
  145. package/dist/assets/{index-CFvZ8Z_1.js → index-BYexaoQj.js} +1 -1
  146. package/dist/assets/{index-BeZUZKXF.js → index-C4AAzmyx.js} +1 -1
  147. package/dist/assets/{index-zz08pxQY.js → index-DCyeJ3GH.js} +1 -1
  148. package/dist/assets/{index-4xv7b2gI.js → index-DKYh_HhB.js} +1 -1
  149. package/dist/assets/{index-D0VSWxR5.js → index-DVWE-aEL.js} +1 -1
  150. package/dist/assets/{index-DEy-_wUr.js → index-DazSfhro.js} +1 -1
  151. package/dist/assets/{index-C9sLB9EM.js → index-Dq43v9LZ.js} +7 -7
  152. package/dist/assets/{index-CxUEh5Oz.js → index-DvMvwiUa.js} +2 -2
  153. package/dist/assets/{inference-diagnostics-8Kbjtmd2.js → inference-diagnostics-D4pNFk3L.js} +1 -1
  154. package/dist/assets/{ingest-boot-viewport-C9LY0itL.js → ingest-boot-viewport-CGT3WdlA.js} +1 -1
  155. package/dist/assets/{ingest-siblings-Djx3NLO0.js → ingest-siblings-Byfbaprq.js} +1 -1
  156. package/dist/assets/{ingest-source-persistence-CFdeLAJm.js → ingest-source-persistence-D_67jDgK.js} +1 -1
  157. package/dist/assets/{ingest.service-BWHuYHNx.js → ingest.service-BqMHjhHB.js} +1 -1
  158. package/dist/assets/{inspect-udqxOflp.js → inspect-BZteyS7S.js} +1 -1
  159. package/dist/assets/instances.command-B75ziBHv.js +1 -0
  160. package/dist/assets/{json-history-resource-u7pbKDr_.js → json-history-resource-CxaTEwYM.js} +1 -1
  161. package/dist/assets/{layered-pick-CgJXO8o0.js → layered-pick-yYf2eQv_.js} +1 -1
  162. package/dist/assets/{light-COcGbh0D.js → light-DdAlBuY-.js} +1 -1
  163. package/dist/assets/{live-project-verbs-CRvifq23.js → live-project-verbs-DSMSOJoO.js} +1 -1
  164. package/dist/assets/{machine.document-DcyMq-yi.js → machine.document-CSlU1rmZ.js} +1 -1
  165. package/dist/assets/{machines.finder-QykdwlzO.js → machines.finder-DYsgjJxU.js} +1 -1
  166. package/dist/assets/{material-BNkC87Fx.js → material-DgRsjaXK.js} +1 -1
  167. package/dist/assets/{material-factory-BNP-UU89.js → material-factory-CfNdF__M.js} +1 -1
  168. package/dist/assets/{mesh-BBXnoEXd.js → mesh-BKJuhrfc.js} +1 -1
  169. package/dist/assets/{model-asset-sections.service-C2fgcG8O.js → model-asset-sections.service-N927Dg3n.js} +1 -1
  170. package/dist/assets/{model-inspection-CrcvPDx6.js → model-inspection-DK0Qd2ET.js} +1 -1
  171. package/dist/assets/{model-thumbnail-0fkMgwbL.js → model-thumbnail-Bmz5T9-I.js} +1 -1
  172. package/dist/assets/{models.finder-Cxnz5T_8.js → models.finder-DM0hhoBq.js} +1 -1
  173. package/dist/assets/{module-mode-Dql9LJgl.js → module-mode-DM5lYCsl.js} +2 -2
  174. package/dist/assets/{mount-canvas-ingest-root-B1nwC3io.js → mount-canvas-ingest-root-CKofhgmJ.js} +2 -2
  175. package/dist/assets/{mount-dom-ingest-root-DX0bHWc3.js → mount-dom-ingest-root-D5AIV4xu.js} +2 -2
  176. package/dist/assets/{mount-ingest-root-DDR_fYRS.js → mount-ingest-root-D5AondhJ.js} +2 -2
  177. package/dist/assets/{mount-manifest-Dt_av1cH.js → mount-manifest-chiQDu6B.js} +1 -1
  178. package/dist/assets/{mount-three-ingest-root-DDtVmfar.js → mount-three-ingest-root-BYFK3msA.js} +1 -1
  179. package/dist/assets/{mounted-authoring-tRcZKWuP.js → mounted-authoring-CpmmmKqd.js} +1 -1
  180. package/dist/assets/{mounted-story-viewport-source-C6blQtzR.js → mounted-story-viewport-source-_ULndUPD.js} +1 -1
  181. package/dist/assets/{native-debug-module-B-HI82yf.js → native-debug-module-D-X0rEzE.js} +1 -1
  182. package/dist/assets/{navigation-oZ-yufxW.js → navigation-CEQEFe13.js} +1 -1
  183. package/dist/assets/{navmesh.menu-Bqi9HEZH.js → navmesh.menu-C_Vopd0f.js} +1 -1
  184. package/dist/assets/{navmesh.service-M5LaOPjL.js → navmesh.service-COafEjFc.js} +1 -1
  185. package/dist/assets/network-observer.service-DXsn74nl.js +1 -0
  186. package/dist/assets/{network.utility-SmUdqGA4.js → network.utility-DquS39cg.js} +1 -1
  187. package/dist/assets/{object3d-document-session-registry-BRDZXPkO.js → object3d-document-session-registry-CWt0_93b.js} +2 -2
  188. package/dist/assets/{oid-transform-B71pzyNj.js → oid-transform-Bcdzbjyg.js} +1 -1
  189. package/dist/assets/{particles-eB54yywv.js → particles-DCRLWGPb.js} +1 -1
  190. package/dist/assets/{pixi-authoring-adapter-sGRWxAxL.js → pixi-authoring-adapter-dJjXKY0a.js} +1 -1
  191. package/dist/assets/{pixi-live-write-target-DhcUjFuO.js → pixi-live-write-target-K4LQa0_b.js} +1 -1
  192. package/dist/assets/{play.command-bY7niN6x.js → play.command-BeNcehee.js} +2 -2
  193. package/dist/assets/{presentation-BUyG4UXv.js → presentation-Ap9bIhjT.js} +1 -1
  194. package/dist/assets/{product-DKvKAepd.js → product-DZtwByvN.js} +1 -1
  195. package/dist/assets/{profiler.action-Cn7n3iBl.js → profiler.action-DMV0OjZn.js} +1 -1
  196. package/dist/assets/{profiler.menu-wbNMgBn2.js → profiler.menu-DGzbxpZu.js} +1 -1
  197. package/dist/assets/{profiler.utility-Bs5y41pf.js → profiler.utility-KzW91Yru.js} +1 -1
  198. package/dist/assets/{project-authoring-session-CxAdIheS.js → project-authoring-session-AyxDTnnj.js} +2 -2
  199. package/dist/assets/{properties-bone-constraints.inspector-BWF-7PdJ.js → properties-bone-constraints.inspector-BnZxkfbc.js} +1 -1
  200. package/dist/assets/{properties-bone.inspector-zcr55x3_.js → properties-bone.inspector-CXEXWoZD.js} +1 -1
  201. package/dist/assets/{properties-collection.inspector-wd9XuuHV.js → properties-collection.inspector-CbUlkw56.js} +1 -1
  202. package/dist/assets/{properties-constraints.inspector-sAFTe290.js → properties-constraints.inspector-CDJ3R5yl.js} +1 -1
  203. package/dist/assets/{properties-data.inspector-DScjTLzP.js → properties-data.inspector-xjOE7mVN.js} +1 -1
  204. package/dist/assets/{properties-material.inspector-Bag-Yiqh.js → properties-material.inspector-ilx6E3hA.js} +1 -1
  205. package/dist/assets/{properties-modifiers.inspector-BOeMHi2s.js → properties-modifiers.inspector-DRLNZm5E.js} +1 -1
  206. package/dist/assets/{properties-object.inspector-CdhasvTa.js → properties-object.inspector-CTXK7Ihy.js} +1 -1
  207. package/dist/assets/{properties-output.inspector-BdbQfuYr.js → properties-output.inspector-tAtb5hhb.js} +1 -1
  208. package/dist/assets/{properties-particles.inspector-BXFCvFq4.js → properties-particles.inspector-BOFxcAJj.js} +1 -1
  209. package/dist/assets/{properties-physics.inspector-D-5rTX6I.js → properties-physics.inspector-CcQc4uol.js} +1 -1
  210. package/dist/assets/{properties-render.inspector-BfdG2JaI.js → properties-render.inspector-dJvGweiz.js} +1 -1
  211. package/dist/assets/{properties-scene.inspector-DlVr3Db7.js → properties-scene.inspector-ClUVVSad.js} +1 -1
  212. package/dist/assets/{properties-texture.inspector-C30sCBYr.js → properties-texture.inspector-DCWWAl6e.js} +1 -1
  213. package/dist/assets/{properties-view-layer.inspector-LMcTdGJQ.js → properties-view-layer.inspector-DjKwbK3x.js} +1 -1
  214. package/dist/assets/{properties-world.inspector-Cx3b1Ww2.js → properties-world.inspector-CRApg_f1.js} +1 -1
  215. package/dist/assets/{r3f-design-session-BmePiyL7.js → r3f-design-session-C5FVaJJX.js} +2 -2
  216. package/dist/assets/{r3f-physics-binding-CPbBFtdN.js → r3f-physics-binding-D0LfM118.js} +1 -1
  217. package/dist/assets/{r3f-source-authoring-adapter-B_OA4tzX.js → r3f-source-authoring-adapter-B-WFIzH2.js} +1 -1
  218. package/dist/assets/{react-canvas-navigation-BzuqMjyE.js → react-canvas-navigation-B1clrw4s.js} +1 -1
  219. package/dist/assets/{react-inspector.service-J7NuEg4y.js → react-inspector.service-vlkMJA77.js} +1 -1
  220. package/dist/assets/{react-story-board-Hep7vQMq.js → react-story-board-CvbtJuHM.js} +1 -1
  221. package/dist/assets/{react-three-rapier.esm-DZcFS490.js → react-three-rapier.esm-B5VWa55S.js} +1 -1
  222. package/dist/assets/{react-world-authoring-adapter-CLXIUqeX.js → react-world-authoring-adapter-mjbEX4K5.js} +1 -1
  223. package/dist/assets/{realm-services-DVTsOSC_.js → realm-services-HiflB4aM.js} +1 -1
  224. package/dist/assets/{reflection-probe-capture.inspector-D79gUCdh.js → reflection-probe-capture.inspector-B48oEWSh.js} +1 -1
  225. package/dist/assets/{registry-BEDTtJ3H.js → registry-BhydL1k4.js} +1 -1
  226. package/dist/assets/{relative-import-specifier-CXsqiB3W.js → relative-import-specifier-1tSJjBsK.js} +1 -1
  227. package/dist/assets/{render-env-_64zf67b.js → render-env-DnyNJ_9v.js} +1 -1
  228. package/dist/assets/{render-features-Bm1rR1tY.js → render-features-DZ0IOHga.js} +1 -1
  229. package/dist/assets/{render-settings-lV11lRf9.js → render-settings-BbIuxirq.js} +1 -1
  230. package/dist/assets/{resolve-three-BImLBLsD.js → resolve-three-BLAwNSsq.js} +3 -3
  231. package/dist/assets/{root-seam-contract-D2X3Do8N.js → root-seam-contract-DjNXdO5a.js} +1 -1
  232. package/dist/assets/{run-selection-DlOv503C.js → run-selection-uXaHrctz.js} +1 -1
  233. package/dist/assets/{scene-capture-CIKkZhww.js → scene-capture-BBNbVVu4.js} +1 -1
  234. package/dist/assets/{scene-document.service-Bj6dpzf0.js → scene-document.service-Mvxm8urE.js} +2 -2
  235. package/dist/assets/{scene-framing-BrJYBCoH.js → scene-framing-DWXsQpNZ.js} +1 -1
  236. package/dist/assets/{seeded-random-DPJl96Hb.js → seeded-random-BZep_0iq.js} +1 -1
  237. package/dist/assets/{session-D32o2Hbx.js → session-CNMGJAx3.js} +49 -0
  238. package/dist/assets/{setup-renderer-CRfBVAiw.js → setup-renderer-DL5Ls9GB.js} +1 -1
  239. package/dist/assets/{source-object3d-authoring-adapter-Dj7_f9nc.js → source-object3d-authoring-adapter-DG9hLsbb.js} +1 -1
  240. package/dist/assets/{source-persistence-backend-BmUhu0xU.js → source-persistence-backend-BUmAvFJp.js} +1 -1
  241. package/dist/assets/{stage-keyboard-W1ZngZk8.js → stage-keyboard-UiTip2rC.js} +1 -1
  242. package/dist/assets/{stage-overlay-set-BJKHmDHT.js → stage-overlay-set-DNMIOCAu.js} +1 -1
  243. package/dist/assets/{stage-presence-markers-CGD1dlBa.js → stage-presence-markers-CYD5_V81.js} +1 -1
  244. package/dist/assets/{stage-transform-tools-bIFel2cX.js → stage-transform-tools-_6Kfz5IX.js} +1 -1
  245. package/dist/assets/{standard-viewport-dressing-_D2iTR3i.js → standard-viewport-dressing-iuHji7nk.js} +1 -1
  246. package/dist/assets/{state-watch.action-hxOyMZS4.js → state-watch.action-nRSzCZjf.js} +1 -1
  247. package/dist/assets/{state-watch.menu-AVgdZ_Qu.js → state-watch.menu-CG6K4mlx.js} +1 -1
  248. package/dist/assets/{state-watch.utility-B3MqB7W7.js → state-watch.utility-D8ANrSxe.js} +1 -1
  249. package/dist/assets/{story-capture-C14SDe7T.js → story-capture-DROG9sui.js} +1 -1
  250. package/dist/assets/{story-documents-CenxeJ-J.js → story-documents-CAJYUoPB.js} +1 -1
  251. package/dist/assets/{story-documents.service-BTDrenEY.js → story-documents.service-B0E2g71o.js} +1 -1
  252. package/dist/assets/{story-documents.service-XaRaaMu-.js → story-documents.service-bDNITWJo.js} +1 -1
  253. package/dist/assets/{story-media-presence-mJ3goope.js → story-media-presence-BYPuOfSN.js} +1 -1
  254. package/dist/assets/{story-pixi-preview-B0g9yXAk.js → story-pixi-preview-CPFlEAWM.js} +1 -1
  255. package/dist/assets/{story-presentation-BcBNJUPe.js → story-presentation-CpFYqE9n.js} +1 -1
  256. package/dist/assets/{story-three-preview-CmvB3jdd.js → story-three-preview-BxBhUb3U.js} +2 -2
  257. package/dist/assets/{studio-environment-C47dHPXj.js → studio-environment-2i6Hxopi.js} +1 -1
  258. package/dist/assets/{surface-state-CyRN24e4.js → surface-state-97hynKeK.js} +1 -1
  259. package/dist/assets/{syntactic-prop-specs-NGHyogqr.js → syntactic-prop-specs-_zcLEJhw.js} +1 -1
  260. package/dist/assets/{team-playtest.service-aKoFRpst.js → team-playtest.service-Djd_UbdR.js} +1 -1
  261. package/dist/assets/{three-BaRHKsDi.js → three-Bp_CAhru.js} +1 -1
  262. package/dist/assets/{three-authoring-adapter-C4WsVXRS.js → three-authoring-adapter-DvTnYhC5.js} +1 -1
  263. package/dist/assets/three-authoring.service-mF26TX9C.js +2 -0
  264. package/dist/assets/{three-ingest-runtime-BH7EXhXx.js → three-ingest-runtime-CJSmvmlg.js} +1 -1
  265. package/dist/assets/{three-integration-FgtD05RY.js → three-integration-deAYWHkv.js} +2 -2
  266. package/dist/assets/three-integration.service-CBSfLW6O.js +1 -0
  267. package/dist/assets/{three-projection-core-BRALq343.js → three-projection-core-B9lnUe6D.js} +1 -1
  268. package/dist/assets/{three-state-C9SwlbSu.js → three-state-BEf5w8yJ.js} +1 -1
  269. package/dist/assets/{three-story-capture.service-D4-kuwit.js → three-story-capture.service-BU-RIqEa.js} +2 -2
  270. package/dist/assets/{three-story-model-CdvIQ2Bt.js → three-story-model-DDN1l0fJ.js} +1 -1
  271. package/dist/assets/{three-viewport-presentation-DQmfO04I.js → three-viewport-presentation-DzMpU_E6.js} +1 -1
  272. package/dist/assets/{transform-mode-request-DU9o7VDP.js → transform-mode-request-BkR5m16Z.js} +1 -1
  273. package/dist/assets/{transport-strip-C6eXVpIO.js → transport-strip-D09VuqIL.js} +1 -1
  274. package/dist/assets/transport.header-CmS98a4t.js +1 -0
  275. package/dist/assets/{tuples-DrVbauI2.js → tuples-U35Zvubu.js} +1 -1
  276. package/dist/assets/{ui-board-document-B9ieZzIV.js → ui-board-document-C6OKItpk.js} +2 -2
  277. package/dist/assets/{user-data-D6c7SEg7.js → user-data-tCwby2d8.js} +1 -1
  278. package/dist/assets/{utility-view-state-BsKgJE_6.js → utility-view-state-U2YWv3xH.js} +1 -1
  279. package/dist/assets/{viewport-door-0J8VF2A4.js → viewport-door-CPXPa0LO.js} +1 -1
  280. package/dist/assets/{viewport-root-presentation-BYIvHvUM.js → viewport-root-presentation-UhZX1kOz.js} +1 -1
  281. package/dist/assets/{viewport-surface-status-BJCh6HFT.js → viewport-surface-status-CQvh0JrT.js} +1 -1
  282. package/dist/assets/{webworkerAll-CgpbmtHI.js → webworkerAll-DdZ3wt2y.js} +1 -1
  283. package/dist/assets/worker-Csaq1NQe.js +2 -0
  284. package/dist/assets/{workspace-arrangement-D7KseNXw.js → workspace-arrangement-Deo0XMRO.js} +1 -1
  285. package/dist/assets/{world-documents-z7v6OpOM.js → world-documents-BOrGAkxV.js} +1 -1
  286. package/dist/assets/{world-root-stage-binding-Br1tT0fE.js → world-root-stage-binding-CysyV-uy.js} +1 -1
  287. package/dist/assets/{xstate-animation-binding-DbUvzokn.js → xstate-animation-binding-uqKuogTz.js} +1 -1
  288. package/dist/assets/{xstate-animation-meta-BMJnjoto.js → xstate-animation-meta-BGRItRtn.js} +1 -1
  289. package/dist-node/cli.js +16 -16
  290. package/package.json +16 -16
  291. package/dist/assets/InspectorObjectPreview-C6-dyTZ3.js +0 -1
  292. package/dist/assets/Object3DDocumentViewport-DLKT9W32.js +0 -2
  293. package/dist/assets/autoplay.service-79YCP4Ec.js +0 -1
  294. package/dist/assets/blender-runtime-host-B6meojSS.js +0 -7
  295. package/dist/assets/instances.command-BjR8TszA.js +0 -1
  296. package/dist/assets/network-observer.service-J5ZPvK31.js +0 -1
  297. package/dist/assets/three-authoring.service-CSLTvZiE.js +0 -2
  298. package/dist/assets/three-integration.service-TQ_GYTh1.js +0 -1
  299. package/dist/assets/transport.header-D1lyKPyL.js +0 -1
  300. package/dist/assets/worker-SN4hsbqi.js +0 -2
@@ -1 +1 @@
1
- import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-CX4V4tDr.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kJ as Je,bM as Ze,bP as et,a6 as Q,h1 as tt,hF as rt,j_ as nt,kK as ot,Z as j,K as st,ci as at,kL as Se,cx as it,kM as ct,kN as lt,kO as ut,kP as Ce,kQ as xe,aD as x,cU as dt,kR as mt,cq as pt,cv as ft,kS as Pe,kT as Ee,kU as je,kV as ht,al as gt,kW as bt,kX as ke,dI as vt,kY as wt,kZ as yt,j3 as St,iV as Ct,iW as xt,gM as Pt,gN as Et,j1 as jt,g4 as kt,g5 as Tt,g6 as At,g7 as Rt}from"./index-C9sLB9EM.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-BRDZXPkO.js";import{R as Ot}from"./RootSelectionOverlay-CZAAA3ie.js";import{e as Lt,S as Ft}from"./surface-state-CyRN24e4.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-lV11lRf9.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-CRfBVAiw.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-CxAdIheS.js";import"./three-integration-FgtD05RY.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-C-xI8RkA.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-DQmfO04I.js";import{a as Z}from"./entity-object-CAHvjc6f.js";import{w as vr}from"./editor-shell-store-D0YYcLl-.js";import{p as wr}from"./viewport-root-presentation-BYIvHvUM.js";import{d as yr}from"./asset-editor-persistence-CSOOj_Dj.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-CGD1dlBa.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-D7KseNXw.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-CgJXO8o0.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-Hep7vQMq.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-udqxOflp.js";import"./inference-diagnostics-8Kbjtmd2.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-Bm1rR1tY.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-O9u_3q5d.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-D6c7SEg7.js";import"./model-thumbnail-0fkMgwbL.js";import"./studio-environment-C47dHPXj.js";import"./three-state-C9SwlbSu.js";import"./hierarchy-marks-DLitjmuD.js";import"./component-instance-root-ChvMDavA.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-0J8VF2A4.js";import"./content-bounds-BvxhGEDh.js";import"./asset-preview-BuDDaHao.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-CxUEh5Oz.js";import"./standard-viewport-dressing-_D2iTR3i.js";import"./clip-planes-CnAI6DZn.js";import"./three-BaRHKsDi.js";import"./model-inspection-CrcvPDx6.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-BrJYBCoH.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-tRcZKWuP.js";import"./collaboration-presence-m4TPHGIS.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
1
+ import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-D5KQrZV0.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kJ as Je,bM as Ze,bP as et,a6 as Q,h1 as tt,hF as rt,j_ as nt,kK as ot,Z as j,K as st,ci as at,kL as Se,cx as it,kM as ct,kN as lt,kO as ut,kP as Ce,kQ as xe,aD as x,cU as dt,kR as mt,cq as pt,cv as ft,kS as Pe,kT as Ee,kU as je,kV as ht,al as gt,kW as bt,kX as ke,dI as vt,kY as wt,kZ as yt,j3 as St,iV as Ct,iW as xt,gM as Pt,gN as Et,j1 as jt,g4 as kt,g5 as Tt,g6 as At,g7 as Rt}from"./index-Dq43v9LZ.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-CWt0_93b.js";import{R as Ot}from"./RootSelectionOverlay-DVKRGf1V.js";import{e as Lt,S as Ft}from"./surface-state-97hynKeK.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-BbIuxirq.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-DL5Ls9GB.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-AyxDTnnj.js";import"./three-integration-deAYWHkv.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-C0mqVPgw.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-DzMpU_E6.js";import{a as Z}from"./entity-object-Djm4wdCS.js";import{w as vr}from"./editor-shell-store-HdyIJxw4.js";import{p as wr}from"./viewport-root-presentation-UhZX1kOz.js";import{d as yr}from"./asset-editor-persistence-CwS08IFG.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-CYD5_V81.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-Deo0XMRO.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-yYf2eQv_.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-CvbtJuHM.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-BZteyS7S.js";import"./inference-diagnostics-D4pNFk3L.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-DZ0IOHga.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-ySC_NtLV.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-tCwby2d8.js";import"./model-thumbnail-Bmz5T9-I.js";import"./studio-environment-2i6Hxopi.js";import"./three-state-BEf5w8yJ.js";import"./hierarchy-marks-BFDfKk_l.js";import"./component-instance-root-Djq3PDc8.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-CPXPa0LO.js";import"./content-bounds-BLQTqJJp.js";import"./asset-preview-Brlu-Xoc.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-DvMvwiUa.js";import"./standard-viewport-dressing-iuHji7nk.js";import"./clip-planes-CnAI6DZn.js";import"./three-Bp_CAhru.js";import"./model-inspection-DK0Qd2ET.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-DWXsQpNZ.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-CpmmmKqd.js";import"./collaboration-presence-DltcWF-9.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
@@ -1 +1 @@
1
- import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-BMJnjoto.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-C9sLB9EM.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
1
+ import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-BGRItRtn.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-Dq43v9LZ.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
@@ -1 +1 @@
1
- import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-C9sLB9EM.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
1
+ import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-Dq43v9LZ.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
package/dist-node/cli.js CHANGED
@@ -2317,7 +2317,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
2317
2317
  var package_default = {
2318
2318
  name: "@volter/game-editor",
2319
2319
  author: "Volter AI, Inc.",
2320
- version: "0.5.107",
2320
+ version: "0.5.109",
2321
2321
  publishConfig: {
2322
2322
  access: "public"
2323
2323
  },
@@ -2366,22 +2366,22 @@ var package_default = {
2366
2366
  }
2367
2367
  },
2368
2368
  dependencies: {
2369
- "@volter/editor-core": "0.5.107",
2370
- "@volter/editor-game": "0.5.107",
2371
- "@volter/editor-react": "0.5.107",
2372
- "@volter/editor-threejs": "0.5.107",
2373
- "@volter/editor-xstate": "0.5.107",
2374
- "@volter/editor-blender": "0.1.47",
2375
- "@volter/dawproject": "0.5.107",
2376
- "@volter/editor-dawproject": "0.5.107",
2377
- "@volter/blender-engine": "0.1.45",
2378
- "@volter/editor-project": "0.5.107",
2379
- "@volter/editor-sdk": "0.5.107",
2380
- "@volter/editor-live": "0.5.107",
2381
- "@volter/game-live": "0.5.107",
2369
+ "@volter/editor-core": "0.5.109",
2370
+ "@volter/editor-game": "0.5.109",
2371
+ "@volter/editor-react": "0.5.109",
2372
+ "@volter/editor-threejs": "0.5.109",
2373
+ "@volter/editor-xstate": "0.5.109",
2374
+ "@volter/editor-blender": "0.1.49",
2375
+ "@volter/dawproject": "0.5.109",
2376
+ "@volter/editor-dawproject": "0.5.109",
2377
+ "@volter/blender-engine": "0.1.47",
2378
+ "@volter/editor-project": "0.5.109",
2379
+ "@volter/editor-sdk": "0.5.109",
2380
+ "@volter/editor-live": "0.5.109",
2381
+ "@volter/game-live": "0.5.109",
2382
2382
  "@modelcontextprotocol/sdk": "1.30.0",
2383
- "@volter/game-runtime": "0.5.107",
2384
- "@volter/threejs-runtime": "0.5.107",
2383
+ "@volter/game-runtime": "0.5.109",
2384
+ "@volter/threejs-runtime": "0.5.109",
2385
2385
  undici: "7.29.1",
2386
2386
  typescript: "5.9.3",
2387
2387
  "@colyseus/schema": "^4.0.14",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/game-editor",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.107",
4
+ "version": "0.5.109",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -50,22 +50,22 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@volter/editor-core": "0.5.107",
54
- "@volter/editor-game": "0.5.107",
55
- "@volter/editor-react": "0.5.107",
56
- "@volter/editor-threejs": "0.5.107",
57
- "@volter/editor-xstate": "0.5.107",
58
- "@volter/editor-blender": "0.1.47",
59
- "@volter/dawproject": "0.5.107",
60
- "@volter/editor-dawproject": "0.5.107",
61
- "@volter/blender-engine": "0.1.45",
62
- "@volter/editor-project": "0.5.107",
63
- "@volter/editor-sdk": "0.5.107",
64
- "@volter/editor-live": "0.5.107",
65
- "@volter/game-live": "0.5.107",
53
+ "@volter/editor-core": "0.5.109",
54
+ "@volter/editor-game": "0.5.109",
55
+ "@volter/editor-react": "0.5.109",
56
+ "@volter/editor-threejs": "0.5.109",
57
+ "@volter/editor-xstate": "0.5.109",
58
+ "@volter/editor-blender": "0.1.49",
59
+ "@volter/dawproject": "0.5.109",
60
+ "@volter/editor-dawproject": "0.5.109",
61
+ "@volter/blender-engine": "0.1.47",
62
+ "@volter/editor-project": "0.5.109",
63
+ "@volter/editor-sdk": "0.5.109",
64
+ "@volter/editor-live": "0.5.109",
65
+ "@volter/game-live": "0.5.109",
66
66
  "@modelcontextprotocol/sdk": "1.30.0",
67
- "@volter/game-runtime": "0.5.107",
68
- "@volter/threejs-runtime": "0.5.107",
67
+ "@volter/game-runtime": "0.5.109",
68
+ "@volter/threejs-runtime": "0.5.109",
69
69
  "undici": "7.29.1",
70
70
  "typescript": "5.9.3",
71
71
  "@colyseus/schema": "^4.0.14",
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DSnapshotDocument as m}from"./EntityModelDocument-B16qpKB_.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./editor-shell-store-D0YYcLl-.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-CX4V4tDr.js";import"./workspace-arrangement-D7KseNXw.js";import"./index-C9sLB9EM.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./user-data-D6c7SEg7.js";import"./entity-object-CAHvjc6f.js";import"./three-contract-Dkt6PmWY.js";import"./live-mixers-B-bwLZ7c.js";import"./asset-preview-BuDDaHao.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-DLitjmuD.js";import"./studio-environment-C47dHPXj.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./bitmap-label-Ct4k6ehY.js";import"./StageHost-C3YU5Ncp.js";import"./three-state-C9SwlbSu.js";import"./standard-viewport-dressing-_D2iTR3i.js";import"./content-bounds-BvxhGEDh.js";import"./preview-renderer-BrYNFV1p.js";import"./live-gesture-lock-DJbrjOqf.js";import"./three-integration-FgtD05RY.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-CgJXO8o0.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-0fkMgwbL.js";import"./object3d-document-session-registry-BRDZXPkO.js";import"./component-instance-root-ChvMDavA.js";import"./viewport-door-0J8VF2A4.js";import"./model-inspection-CrcvPDx6.js";import"./three-viewport-presentation-DQmfO04I.js";import"./clip-planes-CnAI6DZn.js";import"./three-BaRHKsDi.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-BrJYBCoH.js";import"./source-object3d-authoring-adapter-Dj7_f9nc.js";import"./three-projection-core-BRALq343.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-C6eXVpIO.js";import"./viewport-surface-status-BJCh6HFT.js";function ut({previewKey:o,object:r,displayName:i,fill:p=!1}){return t.jsx("div",{"data-testid":"inspector-object-preview",style:p?{position:"absolute",inset:0,overflow:"hidden"}:{width:"100%",height:220,minHeight:220,borderBottom:"1px solid var(--volter-structural-divider)",overflow:"hidden",position:"relative"},children:t.jsx(m,{documentId:`inspector-preview:${o}`,source:r,displayName:i,active:!0,chromeless:!0})})}export{ut as InspectorObjectPreview};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StageHost-C3YU5Ncp.js","assets/index-C9sLB9EM.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-CPiRKiDC.css","assets/three-state-C9SwlbSu.js","assets/editor-shell-store-D0YYcLl-.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-CX4V4tDr.js","assets/workspace-arrangement-D7KseNXw.js","assets/user-data-D6c7SEg7.js","assets/entity-object-CAHvjc6f.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-_D2iTR3i.js","assets/content-bounds-BvxhGEDh.js","assets/hierarchy-marks-DLitjmuD.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/preview-renderer-BrYNFV1p.js","assets/renderer-ownership-BovSEcLv.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/three-integration-FgtD05RY.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-CgJXO8o0.js","assets/root-stacking-BEd9ZvxC.js","assets/model-thumbnail-0fkMgwbL.js","assets/studio-environment-C47dHPXj.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/object3d-document-session-registry-BRDZXPkO.js","assets/component-instance-root-ChvMDavA.js","assets/viewport-door-0J8VF2A4.js","assets/asset-preview-BuDDaHao.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-CrcvPDx6.js","assets/three-viewport-presentation-DQmfO04I.js","assets/clip-planes-CnAI6DZn.js","assets/three-BaRHKsDi.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-BrJYBCoH.js","assets/source-object3d-authoring-adapter-Dj7_f9nc.js","assets/three-projection-core-BRALq343.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/transport-strip-C6eXVpIO.js","assets/viewport-surface-status-BJCh6HFT.js"])))=>i.map(i=>d[i]);
2
- import{ak as r,_ as a}from"./index-C9sLB9EM.js";import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as n}from"./index-nmcBqr7Y.js";import{V as c,O as u}from"./viewport-surface-status-BJCh6HFT.js";const s=n.lazy(async()=>({default:(await a(()=>import("./StageHost-C3YU5Ncp.js").then(e=>e.S),__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,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]))).Object3DDocumentViewport}));function l(t){return i(t.documentId,t.chromeless),o.jsx(n.Suspense,{fallback:o.jsx(c,{testId:"object3d-document-loading",children:u}),children:o.jsx(s,{...t})})}function i(t,e=!1){n.useEffect(()=>{if(!e)return r(t)},[t,e])}export{l as O};
@@ -1 +0,0 @@
1
- import{T as i,r as m}from"./index-C9sLB9EM.js";import{e as p}from"./game-network-DCUGpA0n.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-B-HI82yf.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B5AW1iuS.js";import"./contract-system-adapters-BKaXF3b2.js";import"./game-contract-seams-Dby9gdES.js";import"./seeded-random-DPJl96Hb.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CRvifq23.js";import"./capability-coverage-CA2qKK5U.js";import"./edit-mode-authoring-O9u_3q5d.js";import"./json-history-resource-u7pbKDr_.js";import"./binding-resolver-DB46VaoX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DVTsOSC_.js";import"./canvas-entry-runtime-BeCLUBQm.js";import"./three-ingest-runtime-BH7EXhXx.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CWGve9s6.js";import"./ingest-source-persistence-CFdeLAJm.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-BYIvHvUM.js";import"./mounted-authoring-tRcZKWuP.js";import"./entity-object-CAHvjc6f.js";import"./user-data-D6c7SEg7.js";import"./workspace-arrangement-D7KseNXw.js";import"./three-contract-Dkt6PmWY.js";import"./three-BaRHKsDi.js";import"./editor-layers-CX4V4tDr.js";import"./component-instance-root-ChvMDavA.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C4WsVXRS.js";import"./source-persistence-backend-BmUhu0xU.js";import"./three-projection-core-BRALq343.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-CPbBFtdN.js";import"./deferred-ingest-play-BKkABBQR.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CLXIUqeX.js";import"./board-guides-Dz7Etaga.js";import"./relative-import-specifier-CXsqiB3W.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-udqxOflp.js";import"./inference-diagnostics-8Kbjtmd2.js";import"./writer-tw6EcuVO.js";import"./three-state-C9SwlbSu.js";import"./editor-shell-store-D0YYcLl-.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-0J8VF2A4.js";import"./game-surface-defaults-D8S4cRxi.js";const Ut="workspace.service";function e(o){p().catch(t=>{m().console.error(`${o}: ${t instanceof Error?t.message:String(t)}`,"play")})}function bt(){let o,t=!1;const r=i(()=>{t||new URLSearchParams(window.location.search).get("play")==="1"&&(t=!0,o=window.setTimeout(()=>e("Could not enter requested Play mode"),0))});return()=>{o!==void 0&&window.clearTimeout(o),r()}}export{Ut as point,bt as start};
@@ -1,7 +0,0 @@
1
- import{r as k,li as wt}from"./index-C9sLB9EM.js";import{a as gt}from"./preview-renderer-BrYNFV1p.js";import{v as mt}from"./output-pass-HurwNl0G.js";import{_ as yt,fx as Oe,bi as De,aC as bt,d7 as Mt,ej as vt,cP as ge,el as xt,cm as kt,cl as Pe,fo as ie,ex as Et,d5 as St,d9 as Bt,cJ as Ct,e as Ve}from"./three.core-3arARmh6.js";import{f as At}from"./clip-planes-CnAI6DZn.js";import{a as jt}from"./content-bounds-BvxhGEDh.js";const Ue=4096;class It{#r;#s;#i=[];#n=new Map;#E=0;#d=null;#a=null;#h=!1;#b=!1;#M=t=>{!this.#b&&this.#n.size===0||(t.preventDefault(),t.returnValue="")};#f=new Map;#g=new Map;#p=null;#m=0;#v=0;#x=0;#l=null;#k=null;#c=null;constructor(t){this.#s=t,this.#r=new Worker(new URL("/assets/worker-SN4hsbqi.js",import.meta.url),{type:"module",name:"blender"}),globalThis.addEventListener?.("beforeunload",this.#M),this.#r.onmessage=n=>void this.#S(n.data),this.#r.onerror=n=>{const r=n.error,a=n.filename?` at ${n.filename}:${n.lineno}:${n.colno}`:"",o=r?.stack??r?.message??n.message,s=this.#i.length>0?`
2
- Blender's last output:
3
- ${this.#i.join(`
4
- `)}`:"",l=this.#c===null?null:Math.round(this.#c/1048576),c=l!==null&&l>=Ue-16?`Blender ran out of memory: its heap reached ${l} MB of the in-tab engine's ${Ue} MB, and this scene needs more. `:"",d=new Error(`${c}Blender worker failed: ${o||"the worker script did not load"}${a}${s}`);console.error(d.message);for(const i of[...this.#n.keys()])this.#w(i);for(const i of this.#n.values())i.reject(d);this.#n.clear()}}#o=null;#u=null;get project(){return this.#o}get document(){return this.#u}start(t,n){return this.#o!==null&&this.#o!==t?Promise.reject(new Error(`The Blender session is bound to ${this.#o}, not ${t}`)):n!==void 0&&this.#u!==null&&this.#u!==n?Promise.reject(new Error(`Blender resource conflict: the session holds ${this.#u}; cannot open ${n}`)):(this.#o=t,this.#u??=n??"models/model.blend",this.#d??=this.#e({op:"start",project:t,...n===void 0?{}:{document:n}}),this.#d)}#t(){return this.#o===null?Promise.reject(new Error("The Blender session has not been started with a project (blender-start)")):this.start(this.#o)}async execute(t,n=!0,r="Blender Python"){return await this.#t(),await this.#e({op:"execute",code:t,history:n,label:r})}async historyGesture(t){await this.#t(),await this.#e({op:t})}async historyStep(t,n){return await this.#t(),(await this.#e({op:"history-step",token:t,direction:n})).moved}async sceneInfo(){return await this.#t(),await this.#e({op:"scene-info"})}async objectInfo(t){return await this.#t(),await this.#e({op:"object-info",name:t})}async rna(t,n){return await this.#t(),await this.#e({op:"rna",path:t,...n===void 0?{}:{names:n}})}async rnaContext(t,n){return await this.#t(),await this.#e({op:"rna-context",...t===void 0?{}:{object:t},...n===void 0?{}:{collection:n}})}async rnaSet(t,n,r,a,o=!0){return await this.#t(),await this.#e({op:"rna-set",history:o,path:t,property:n,value:r,...a===void 0?{}:{index:a}})}async viewShading(t){await this.#t(),await this.#e({op:"view-shading",shading:t})}async outliner(t){return await this.#t(),await this.#e({op:"outliner",...t===void 0?{}:{selected:t}})}async nodeTree(t){return await this.#t(),await this.#e({op:"node-tree",...t?.path===void 0?{}:{path:t.path},...t?.material===void 0?{}:{material:t.material}})}async uvLayout(t){return await this.#t(),await this.#e({op:"uv-layout",...t?.object===void 0?{}:{object:t.object},...t?.uvLayer===void 0?{}:{uvLayer:t.uvLayer}})}async rig(t){return await this.#t(),await this.#e({op:"rig",...t?.object===void 0?{}:{object:t.object}})}async actionClip(t){return await this.#t(),await this.#e({op:"action-clip",...t?.object===void 0?{}:{object:t.object},...t?.bake===void 0?{}:{bake:t.bake}})}async outlinerSet(t,n,r){return await this.#t(),await this.#e({op:"outliner-set",path:t,column:n,value:r})}async present(){await this.#t(),await this.#e({op:"present"})}async screenshotView(t){return await this.#t(),await this.#e({op:"screenshot-view",maxSize:t})}async readFile(t){return await this.#t(),await this.#e({op:"read-file",path:t})}async writeFile(t,n){await this.#t(),await this.#e({op:"write-file",path:t,bytes:n})}async listFiles(t){return await this.#t(),await this.#e({op:"list-files",path:t})}get presented(){return this.#k}stop(){return this.#h?Promise.resolve():this.#a?this.#a:(this.#a=(async()=>{(this.#d?await this.#d.then(()=>!0,()=>!1):!1)&&await this.#e({op:"flush-document"},!0),this.terminate()})().catch(t=>{throw this.#a=null,t}),this.#a)}terminate(){if(this.#h)return;this.#h=!0,globalThis.removeEventListener?.("beforeunload",this.#M);const t=this.#y("terminating worker");try{this.#r.terminate()}finally{t()}const n=new Error("The Blender session was terminated");for(const r of[...this.#n.keys()])this.#w(r);for(const r of this.#n.values())r.reject(n);this.#n.clear()}metrics(t=performance.now()){let n=null,r=this.#m,a=this.#v,o=this.#x;for(const s of this.#f.values()){const l=t-s;(n===null||l>n)&&(n=l),l>r&&(r=l),l>=5e3&&(a+=1),l>=3e4&&(o+=1)}return{inFlightMs:n===null?null:Math.round(n),lastCallMs:this.#p===null?null:Math.round(this.#p),maxCallMs:this.#p===null&&n===null?null:Math.round(r),callsOver5s:a,callsOver30s:o,lastCallWindow:this.#l,wasmMemoryMB:this.#c===null?null:Math.round(this.#c/1048576)}}#w(t){this.#g.get(t)?.(),this.#g.delete(t);const n=this.#f.get(t);if(n===void 0)return;this.#f.delete(t);const r=performance.now()-n;this.#p=r,r>this.#m&&(this.#m=r),r>=5e3&&(this.#v+=1),r>=3e4&&(this.#x+=1),this.#l!==null&&this.#l.start===n&&(this.#l={start:n,end:n+r})}#e(t,n=!1){if(this.#h||this.#a&&!n)return Promise.reject(new Error("The Blender session is stopping or terminated"));const r=++this.#E;return new Promise((a,o)=>{this.#n.set(r,{resolve:a,reject:o});const s=performance.now();this.#f.set(r,s),this.#l={start:s,end:null},this.#g.set(r,this.#y(`waiting for worker ${t.op}`));try{this.#r.postMessage({...t,id:r})}catch(l){this.#n.delete(r),this.#w(r),o(l instanceof Error?l:new Error(String(l)))}})}#y(t){try{const n=this.#s.work?.(t);return()=>{try{n?.()}catch{}}}catch{return()=>{}}}async#S(t){if("op"in t){if(t.op==="document-dirty"){this.#b=t.dirty;return}if(t.op==="history"){this.#s.history?.(t.entries);return}if(t.op==="log"){this.#i.push(t.text),this.#i.length>12&&this.#i.shift(),this.#s.log?.(t.level,t.text);return}if(t.op==="memory"){this.#c=t.bytes;return}const r=t.frame;typeof r?.session=="string"&&typeof r.revision=="number"&&(this.#k={session:r.session,revision:r.revision});const a=this.#y("presenting worker frame");try{const o=await this.#s.present(t.frame,t.description,t.capture);this.#r.postMessage({op:"present-result",id:t.id,...o?.capture===void 0?{}:{capture:o.capture},...o!=null&&"held"in o?{held:o.held}:{}})}catch(o){this.#r.postMessage({op:"present-result",id:t.id,error:o instanceof Error?o.message:String(o)})}finally{a()}return}const n=this.#n.get(t.id);n&&(this.#n.delete(t.id),this.#w(t.id),"error"in t?n.reject(new Error(t.error)):n.resolve(t.result))}}const Tt="/assets/agx-base-srgb-BjWZJgrZ.lut",_t="/assets/agx-look-medium-high-contrast-D5F_ob1L.lut",Lt="/assets/agx-look-punchy-dxsnycNs.lut",$t="/assets/filmic-srgb-Ct35FIH6.lut",T=new Float64Array(12),We=[0,0,0],N=new Float64Array(3),q=new Float64Array(3),_=new Int8Array([1,0,0,1,1,0,0,1,2,1,0,0,1,0,1,0,2,1,0,0,1,1,0,1,2,0,1,0,0,1,0,1,1,2,1,0,0,1,0,0,1,1,1,2,0,0,1,0,1,1,0,1,0,2]);function Ft(e,t,n){return e>t?t>n?0:e>n?1:2:n>t?3:n>e?4:5}function Ze(e,t,n,r,a){const o=t*t,s=Math.min(1,Math.max(0,n))*(t-1),l=Math.min(1,Math.max(0,r))*(t-1),c=Math.min(1,Math.max(0,a))*(t-1),d=Math.min(Math.floor(s),t-2),i=Math.min(Math.floor(l),t-2),h=Math.min(Math.floor(c),t-2),b=s-d,M=l-i,B=c-h,w=(u,p,C,A)=>{const y=(d+p+(i+C)*t+(h+A)*o)*3;T[u]=e[y]/65535,T[u+1]=e[y+1]/65535,T[u+2]=e[y+2]/65535};w(0,0,0,0),w(9,1,1,1),N[0]=b,N[1]=M,N[2]=B;const g=Ft(b,M,B)*9;w(3,_[g],_[g+1],_[g+2]),w(6,_[g+3],_[g+4],_[g+5]);const E=N[_[g+6]],f=N[_[g+7]],m=N[_[g+8]];for(let u=0;u<3;u++){const p=T[u];We[u]=p+E*(T[3+u]-p)+f*(T[6+u]-T[3+u])+m*(T[9+u]-T[6+u])}return We}function H(e){const t=e&32768?-1:1,n=e>>10&31,r=e&1023;return n===0?t*2**-24*r:n===31?r?Number.NaN:t*Number.POSITIVE_INFINITY:t*2**(n-15)*(1+r/1024)}function Ae(e,t,n,r){const a=new Uint8ClampedArray(t*4);for(let o=0;o<t;o++){const s=o*4,l=H(e[s+3]),c=l===0?n:n/l;q[0]=H(e[s])*c,q[1]=H(e[s+1])*c,q[2]=H(e[s+2])*c;const d=r(q);a[s]=Math.round(d[0]*255),a[s+1]=Math.round(d[1]*255),a[s+2]=Math.round(d[2]*255),a[s+3]=Math.round(Math.min(1,Math.max(0,l))*255)}return a}function Rt(e){return new URL(Object.assign({"./agx-base-srgb.lut":Tt,"./agx-look-medium-high-contrast.lut":_t,"./agx-look-punchy.lut":Lt,"./filmic-srgb.lut":$t})[`./${e.replace(/\.lut$/,"")}.lut`],import.meta.url)}const Nt=57,$=-12.47393,Ke=12.5260688117,Ot=[[.4123908,.3575843,.1804808],[.212639,.7151687,.0721923],[.0193308,.1191948,.9505322]],Dt=[[1.5250528,-.3159135,-.1226583],[-.5091526,1.3333274,.1382844],[.0957153,.0508974,.7879558]];function Ge(e,t,n){const r=t[0],a=t[1],o=t[2];n[0]=e[0][0]*r+e[0][1]*a+e[0][2]*o,n[1]=e[1][0]*r+e[1][1]*a+e[1][2]*o,n[2]=e[2][0]*r+e[2][1]*a+e[2][2]*o}const X=new Float64Array(3),ze=new Float64Array(3),Z=[0,0,0];function le(e){const t=Math.min(1,Math.max(0,e));return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function Ye(e,t,n,r){return Ze(e,Nt,t,n,r)}function Pt(e,t){Ge(Ot,t,ze),Ge(Dt,ze,X);const n=Ke-$,r=Ye(e,(Math.log2(Math.max(X[0],1e-10))-$)/n,(Math.log2(Math.max(X[1],1e-10))-$)/n,(Math.log2(Math.max(X[2],1e-10))-$)/n);return Z[0]=le(Math.max(0,r[0])**2.4),Z[1]=le(Math.max(0,r[1])**2.4),Z[2]=le(Math.max(0,r[2])**2.4),Z}const Vt={"AgX - Medium High Contrast":"agx-look-medium-high-contrast.lut","AgX - Punchy":"agx-look-punchy.lut"};function Ut(e,t){const n=Ke-$;return Ye(e,(Math.log2(Math.max(t[0],1e-10))-$)/n,(Math.log2(Math.max(t[1],1e-10))-$)/n,(Math.log2(Math.max(t[2],1e-10))-$)/n)}function Wt(e,t,n,r={}){const a=r.exposure??1,o=r.composedLook===!0?Ut:Pt;return Ae(t,n,a,s=>o(e,s))}const Je=33,me=Je**3*3,ye=4096,ce=-12.473931188,ue=25;function de(e,t){const n=Math.min(1,Math.max(0,t))*(ye-1),r=Math.min(Math.floor(n),ye-2),a=n-r;return((1-a)*e[me+r]+a*e[me+r+1])/65535}const K=[0,0,0];function Gt(e,t){const n=Ze(e,Je,(Math.log2(Math.max(t[0],1e-10))-ce)/ue,(Math.log2(Math.max(t[1],1e-10))-ce)/ue,(Math.log2(Math.max(t[2],1e-10))-ce)/ue);return K[0]=de(e,n[0]/.66),K[1]=de(e,n[1]/.66),K[2]=de(e,n[2]/.66),K}function zt(e,t,n,r){if(e.length!==me+ye)throw new Error("Invalid Blender Filmic display table");return Ae(t,n,r,a=>Gt(e,a))}const W=2.4,F=.055,Qe=F/(W-1),qt=1/(W/(1+F)*((Qe+F)/(1+F))**(W-1)),Ht=((Qe+F)/(1+F))**W;function he(e){return e>0?e<Ht?e*qt:(1+F)*e**(1/W)-F:0}const Y=[0,0,0];function Xt(e){return Y[0]=he(e[0]),Y[1]=he(e[1]),Y[2]=he(e[2]),Y}function Zt(e,t,n){return Ae(e,t,n,Xt)}function et(e,t,n,r){if(!Number.isFinite(n.width)||!Number.isFinite(n.height)||n.width<1||n.height<1)throw new Error("Scene capture requires finite positive dimensions");const a=Math.min(2048,Math.round(n.width)),o=Math.min(2048,Math.round(n.height)),s=r?1:2,l=a*s,c=o*s,d=gt(),i=d.renderer,h={target:i.getRenderTarget(),toneMapping:i.toneMapping,exposure:i.toneMappingExposure,colorSpace:i.outputColorSpace,shadows:i.shadowMap.enabled,shadowType:i.shadowMap.type,clearColor:i.getClearColor(new yt),clearAlpha:i.getClearAlpha(),background:e.background};let b,M,B=!1;try{b=new Oe(l,c,{type:De}),n.effect&&(b.depthTexture=new bt(l,c)),i.shadowMap.enabled=!0,i.shadowMap.type=Mt,i.outputColorSpace=vt,i.toneMapping=n.toneMapping??ge,i.toneMappingExposure=n.exposure??1,i.setClearColor(0,n.transparent?0:1),n.transparent&&(e.background=null),i.setRenderTarget(b),i.clear(),i.render(e,t);const w=n.effect?.render(i,b,e,t)??b;if(w.texture.type!==De||w.width!==l||w.height!==c)throw new Error("Scene capture effect must return a same-size half-float target");if(r){const y=new Uint16Array(l*c*4);return i.readRenderTargetPixels(w,0,0,l,c,y),B=!0,{pixels:y,width:a,height:o}}M=new Oe(l,c),mt(n.transparent===!0).render(i,M,w,0,!1);const g=new Uint8Array(l*c*4);i.readRenderTargetPixels(M,0,0,l,c,g);const E=document.createElement("canvas");E.width=l,E.height=c;const f=E.getContext("2d");if(!f)throw new Error("Scene capture could not create an image canvas");const m=f.createImageData(l,c),u=l*4;for(let y=0;y<c;y++)m.data.set(g.subarray((c-1-y)*u,(c-y)*u),y*u);f.putImageData(m,0,0);const p=document.createElement("canvas");p.width=a,p.height=o;const C=p.getContext("2d");if(!C)throw new Error("Scene capture could not create an output canvas");C.drawImage(E,0,0,a,o);const A=p.toDataURL("image/png");return B=!0,A}finally{e.background=h.background,i.setRenderTarget(h.target),i.toneMapping=h.toneMapping,i.toneMappingExposure=h.exposure,i.outputColorSpace=h.colorSpace,i.shadowMap.enabled=h.shadows,i.shadowMap.type=h.shadowType,i.setClearColor(h.clearColor,h.clearAlpha),M?.dispose(),b?.dispose(),d.release({discard:!B})}}function Kt(e,t,n){return et(e,t,n,!0)}function Yt(e,t,n){return et(e,t,n,!1)}const Jt=e=>typeof e=="object"&&e!==null&&typeof e.subscribeFrames=="function"&&typeof e.objectForBlenderName=="function"&&typeof e.blenderObjectName=="function"&&typeof e.blenderSelection=="function"&&typeof e.setStageMode=="function";function je(){const e=k().documents.context(st());return Jt(e)?e:null}function Qt(){return je()?.blenderSelection()??{selected:[],active:null}}const en={tree:null,byId:new Map,parentOf:new Map,error:null,loading:!1};let be=en,tt=0;const Me=new Set;let P=null,re=null,Ie="",V=null;function tn(e){const t=new Map,n=new Map,r=(a,o)=>{t.set(a.id,a),n.set(a.id,o);for(const s of a.children)r(s,a.id)};for(const a of e?.rows??[])r(a,null);return{byId:t,parentOf:n}}function Q(e){be={...be,...e},tt+=1;for(const t of[...Me])t()}function Cn(e){return Me.add(e),()=>{Me.delete(e)}}function An(){return tt}function jn(){return be}function Te(e){V!==e&&(V=e,setTimeout(()=>{V===e&&(V=null,nt(e===""?[]:e.split("\0")))},0))}let fe=0,ve=Promise.resolve();function nt(e){const t=nn(e);return ve=t,t}async function nn(e){const t=e.join("\0"),n=++fe;re=t,Ie=t,Q({loading:!0});try{const r=await pn(e);if(n!==fe)return;je()?.setStageMode(r?.mode??null),Q({tree:r,...tn(r),loading:!1,error:null})}catch(r){if(n!==fe)return;Q({loading:!1,error:rt(r)})}}function rn(){re=null,Te(Ie);for(const e of[...xe])e()}const xe=new Set;function In(e){return _e(),xe.add(e),()=>{xe.delete(e)}}let J=!1,pe=null;function _e(){const e=je();if(P!==null&&pe===e)return;P!==null&&(P(),P=null,pe=null);const t=e;if(t!==null){P=t.subscribeFrames(rn),pe=t;return}J||(J=!0,k().documents.waitForContext(st()).then(()=>{J=!1,_e()}).catch(()=>{J=!1}))}function Tn(e){if(!I())return;_e();const t=[...e].sort().join("\0");re!==t&&Te(t)}async function on(e){if(!I())return;V=null;let t=nt([...e].sort());for(;;){if(await t,ve===t)return;t=ve}}async function _n(e,t,n){try{return await lt(e,t,n),re=null,Te(Ie),!0}catch(r){return Q({error:rt(r)}),!1}}function rt(e){return e instanceof Error?e.message:String(e)}const an={transform:{cx:0,cy:0,zoom:1},looked:null,refusal:null,size:{w:0,h:0},framedAt:0,drawn:[]};let ke=an,Le=0;const ne=new Set;let ot=0;function we(){return ke}function Ln(){return Le}function $n(e){return ne.add(e),()=>{ne.delete(e)}}function U(e){ke={...ke,...e},Le+=1;for(const t of[...ne])t()}function sn(){ot+=1,Le+=1;for(const e of[...ne])e()}function Fn(){return ot}function O(e){U({refusal:e})}const qe=new Map;function ln(e){let t=qe.get(e);return t||(t=fetch(Rt(e)).then(async n=>{if(!n.ok)throw new Error(`Blender display table ${e}: ${n.status} ${n.statusText}`);return new Uint16Array(await n.arrayBuffer())}),qe.set(e,t)),t}function cn(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return new Uint16Array(n.buffer,n.byteOffset,n.byteLength>>1)}async function at(e,t){const n=t.look??"None",r=t.toneMapping==="filmic",a=t.toneMapping==="none";if(!a&&t.toneMapping!=="agx"&&!r)throw new Error("Blender's Khronos PBR Neutral view transform has no scene-linear implementation in the browser, so it cannot resolve a composited or scene-referred frame (implemented: Standard, AgX, Filmic)");const o=a?null:r?"filmic-srgb.lut":n==="None"?"agx-base-srgb.lut":Vt[n];if(o===void 0)throw new Error(`Blender display transform has no table for look ${n}`);const s=o?await ln(o):null,l=t.linearInput,c=l?{pixels:cn(l.base64),width:l.width,height:l.height}:e;if(!c)throw new Error("Blender display transform requires a linear capture");const{pixels:d,width:i,height:h}=c,b=a?Zt(d,i*h,t.exposure):r?zt(s,d,i*h,t.exposure):Wt(s,d,i*h,{exposure:t.exposure,composedLook:n!=="None"}),M=document.createElement("canvas");M.width=i,M.height=h;const B=M.getContext("2d");if(!B)throw new Error("Blender display transform could not create its image canvas");const w=B.createImageData(i,h),g=i*4;for(let m=0;m<h;m++){const u=(h-1-m)*g;w.data.set(b.subarray(u,u+g),m*g)}B.putImageData(w,0,0);const E=M.toDataURL("image/png"),f={base64:E.slice(E.indexOf(",")+1),mimeType:"image/png"};if(t.linear===!0){const m=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);let u="";for(let p=0;p<m.length;p+=32768)u+=String.fromCharCode(...m.subarray(p,p+32768));f.linearBase64=btoa(u),f.linearWidth=i,f.linearHeight=h}return f}async function un(e,t,n,r,a=()=>{}){const o={none:ge,agx:Ve,neutral:Ct,filmic:ge};await n.prepare(t),a();const s={effect:n.effect,width:r.width,height:r.height,transparent:r.transparent===!0,toneMapping:o[r.toneMapping]??Ve,exposure:r.exposure},l=r.toneMapping==="agx"||r.toneMapping==="filmic"||r.linear===!0?await at(Kt(e,t,s),r):null;if(a(),l)return l;const c=Yt(e,t,s);if(!c)throw new Error("Blender render could not capture its image");return{base64:c.slice(c.indexOf(",")+1),mimeType:"image/png"}}const dn="document:blender:runtime";let j=null,He=0;function Rn(e){const t=++He;return j=e,D(),()=>{He===t&&(j=null,D())}}function Ee(){const e=x?.document,t=k().documents.activeId(),n=t?.startsWith("document:model:")?t.slice(15):j?.blend;return!n||!e||n===e?null:`Blender is editing ${e}; ${n} is not open. Return to ${e} before editing.`}function L(){return j?.documentId??dn}function st(){return L()}async function Nn(e,t){const n=k();if(!n.session.open())throw new Error("Opening a model requires an open project session.");const r=n.projectLocalState.projectRootPath();if(r===null)throw new Error("Opening a model requires a project path.");if(j!==e||n.documents.activeId()!==e.documentId)return!1;const a=v(),o=a.start(r,e.blend);return t(),await o,j!==e?!1:(await a.present(),j===e)}function I(){return x?.project!=null&&Ee()===null}let it=0;const Se=new Set;function On(){return it}function Dn(e){return Se.add(e),()=>{Se.delete(e)}}function D(){it+=1;for(const e of[...Se])e()}async function Pn(e,t){return I()?v().rna(e,t):null}async function Vn(e,t){return I()?v().rnaContext(e,t):null}async function hn(e,t,n,r,a=!0){if(!I())return null;const o=await v().rnaSet(e,t,n,r,a);return D(),o}async function Un(e){I()&&await v().viewShading(e)}async function fn(e,t=!0,n="Blender Python"){const r=await v().execute(e,t,n);D();const a=/^Error executing code:/.exec(r);return{text:r,executed:a===null,result:a===null?r.replace(/^Code executed successfully: ?/,""):"",error:a===null?null:r.replace(/^Error executing code: ?/,"")}}function Wn(){v().historyGesture("history-begin").catch(e=>k().console.error(`Could not begin Blender undo gesture: ${String(e)}`,"blender-history"))}async function Gn(){await v().historyGesture("history-end")}async function pn(e){return I()?v().outliner(e):null}async function zn(e){return I()?v().nodeTree(e):null}async function qn(e){return I()?v().uvLayout(e):null}async function Hn(e){return I()?v().rig(e):null}async function Xn(e){return I()?v().actionClip(e):null}async function lt(e,t,n){if(!I())return null;const r=await v().outlinerSet(e,t,n);return D(),r}const wn={view:"blender-node-view",title:"Node Editor",verbs:[["state",void 0],["look",void 0],["view-all","Node Editor: Frame All"],["zoom",void 0],["pan",void 0],["move",void 0],["link",void 0],["set-value",void 0],["use-nodes",void 0],["collapse-panel",void 0]].map(([e,t])=>({id:e,...t?{title:t}:{},run:n=>ct({...n,action:e})}))};function ct(e){const t=typeof e.action=="string"?e.action:"state";switch(t){case"state":break;case"look":U({looked:typeof e.node=="string"?e.node:null,refusal:null});break;case"view-all":sn(),U({refusal:null});break;case"zoom":{const n=typeof e.zoom=="number"?e.zoom:1;U({transform:{...we().transform,zoom:n},refusal:null});break}case"pan":{const n=we().transform;U({transform:{...n,cx:typeof e.cx=="number"?e.cx:n.cx,cy:typeof e.cy=="number"?e.cy:n.cy},refusal:null});break}case"move":O(`Moving "${String(e.node??"a node")}" writes Node.location — editing parity is not the program.`);break;case"link":O("Dragging between sockets would make a link — editing parity is not the program.");break;case"set-value":O(`Changing "${String(e.socket??"a socket")}" writes the socket's default_value — editing parity is not the program.`);break;case"use-nodes":O("Use Nodes writes Material.use_nodes — editing parity is not the program.");break;case"collapse-panel":O(`Collapsing "${String(e.panel??"a panel")}" writes the panel's is_collapsed — editing parity is not the program.`);break;default:O(`blender-node-view: no action "${t}" — state, look, view-all, zoom, pan, and the refusals move, link, set-value, use-nodes, collapse-panel.`)}return we()}let x=null;const ee=new Set;function ut(){ee.size&&k().history.invalidate([...ee]),ee.clear()}let Be=null,Xe=!1;function te(e){try{const t=k().session.beginWork(`Blender: ${e}`);return()=>{try{t()}catch{}}}catch{return()=>{}}}function Ce(){const e=te("invalidating history and releasing runtime");try{ut(),Be?.abort(),Be=null,x?.terminate(),x=null,dt=null}finally{e()}}function gn(){Xe||(Xe=!0,k().session.onBeforeClose(async()=>{await x?.stop(),Ce()}),k().session.onEnded(Ce))}let dt=null;const mn=e=>typeof e=="object"&&e!==null&&typeof e.applyFrame=="function"&&typeof e.snapshot=="function"&&typeof e.captureSnapshot=="function"&&typeof e.recordPresentation=="function"&&typeof e.recordPhotograph=="function";async function yn(){const{documents:e}=k(),t=Date.now()+15e3;let n=L();for(;;){n=L();const r=await e.waitForContext(n,Math.max(0,Math.min(250,t-Date.now())));if(mn(r))return r;if(Date.now()>=t)break}throw new Error(`The Blender Model document is not open, or the open one is not a Model this engine can present to (it must answer applyFrame, captureSnapshot, recordPresentation and recordPhotograph): nothing published a presentable view as ${n} within 15 s (bound model: ${j?.documentId??"none"}). Open the Model document first (\`volter blender-mcp\` opens it before its first call).`)}function v(){const e=Ee();if(e)throw new Error(e);if(x!==null)return x;gn();const t=new AbortController;Be=t;let n=!1;x=new It({work:te,history:a=>{const o=x;if(!o)throw new Error("Blender history arrived before its runtime");for(const s of a){if("reset"in s){ut();continue}if(!s.resource)throw new Error("A Blender edit has no document resource");ee.add(s.resource);const l=async c=>{if(x!==o)throw new Error("This Blender history belongs to a closed worker");const d=await o.historyStep(s.id,c);return D(),await on(Qt().selected),d};k().history.record({id:s.id,label:s.label,resources:[s.resource],document:L(),undo:()=>l("undo"),redo:()=>l("redo")})}},present:async(a,o,s)=>{const l=Ee();if(l)throw new Error(l);if(j===null){if(s?.render)throw new Error("Rendering a Blender frame needs the Model document open; nothing is presenting.");return{}}const c=L(),d=te("waiting for Model presenter");let i;try{i=await yn()}finally{d()}if(t.signal.throwIfAborted(),L()!==c)throw new Error("Blender document changed before its frame could be presented");const h=te("applying frame to Model"),b=(()=>{try{return i.applyFrame(a)}finally{h()}})(),M=typeof b=="object"&&b!==null&&"held"in b,B=M?b.held:null,w=A=>({...A===void 0?{}:{capture:A},...M?{held:B}:{}});if(i.recordPresentation(o),!s||(dt=s,!s.render))return w(void 0);const g=i.snapshot(),E=()=>{if(t.signal.throwIfAborted(),L()!==c||i.snapshot()!==g)throw new Error("Blender capture document or source revision changed before completion")};if(s.render.linearInput){const A=await at(null,s.render);return E(),w(A)}const{render:f,position:m,target:u,up:p}=s;if(!m||!u||!p)throw new Error("A Blender render capture must carry the scene camera position, target and up");if(n)throw new Error("A Blender render capture is already in progress");const C=i.captureSnapshot();n=!0,t.signal.addEventListener("abort",C.dispose,{once:!0});try{E();const A=new xt;A.add(C.root),A.updateMatrixWorld(!0);const y=C.root.matrixWorld,oe=new kt().copy(y).invert(),ht=new Pe().setFromMatrix4(y),ft=new Pe().setFromMatrix4(oe),ae=new ie(m[0],m[1],m[2]).applyMatrix4(y),$e=new ie(u[0],u[1],u[2]).applyMatrix4(y),Fe=new ie(p[0],p[1],p[2]).applyMatrix3(ht),se=Math.min(2048,Math.round(f.width))/Math.min(2048,Math.round(f.height)),Re=jt(C.root).getBoundingSphere(new Et),G=At(ae.distanceTo(Re.center),Re.radius);let R;if(f.orthographic){const z=f.fov/2;R=new St(-z*se,z*se,z,-z,G.near,G.far)}else R=new Bt(f.fov,se,G.near,G.far);R.up.copy(Fe),R.position.copy(ae),R.lookAt($e),R.updateMatrixWorld(!0);const Ne={position:ae.clone().applyMatrix4(oe).toArray(),target:$e.clone().applyMatrix4(oe).toArray(),up:Fe.clone().applyMatrix3(ft).toArray()};i.recordPhotograph({sent:{position:m,target:u,up:p},photographed:Ne,render:{width:f.width,height:f.height,fov:f.fov,orthographic:f.orthographic}});const pt=await un(A,R,C,f,E);return w({...pt,camera:Ne})}finally{n=!1,t.signal.removeEventListener("abort",C.dispose),C.dispose()}},log:(a,o)=>console[a](`[blender] ${o}`)});const r=x;return k().session.reportWorkerCallMeter("Blender",()=>r.metrics()),x}const bn="models/model.blend",S=(e,t)=>{const n=e[t];if(typeof n!="string")throw new Error(`${String(e.type)} requires a string "${t}"`);return n};async function Mn(e){const t=k().projectLocalState.projectRootPath();if(t===null)return{};let n;try{n=await e.execute(`import bpy
5
- print(bpy.data.filepath)
6
- `,!1)}catch{return{}}if(/^Error executing code:/m.test(n))return{};const r=n.replace(/^Code executed successfully:/,"").split(`
7
- `).map(o=>o.trim()).filter(o=>o.startsWith("/")).pop()??"";if(r==="")return{};const a=t.endsWith("/")?t:`${t}/`;return r.startsWith(a)?{document:r.slice(a.length)}:{}}async function Zn(e){const t=k();if(e.type==="blender-status")return{ok:!0,data:{started:x?.project!=null,document:t.documents.context(L())!==void 0}};if(!t.session.open())return{ok:!1,error:`${e.type} needs an open project session; this editor page has none.`};try{const n=e.type==="blender-start"?S(e,"project"):null;let r=typeof e.document=="string"?e.document:void 0;if((e.type==="blender-stop"||e.type==="blender-start"&&e.fresh===!0)&&(await x?.stop(),Ce(),e.type==="blender-stop"))return{ok:!0,data:{stopped:!0}};if(e.type==="blender-start"&&!t.documents.context(L())){const o=await t.project.documentTable(),s=o.entries.filter(i=>i.kind==="model"),l=r!==void 0?s.find(i=>i.source?.path===r):s.find(i=>i.id===(j?.entryId??o.default))??(s.length===1?s[0]:void 0);if(!l)return{ok:!1,error:r!==void 0?`No declared Model document names ${r}.`:`Choose a Model document before starting Blender. Available: ${s.map(i=>i.id).join(", ")||"(none)"}.`};const c=l.id;if(r=l.source?.path,!await t.workspace.open({kind:"document",id:c}))return{ok:!1,error:`blender-start could not open the Blender Model document ${c}: nothing in this editor opens that document (the Model document ships with @volter/editor-blender).`}}const a=v();switch(e.type){case"blender-start":{const o=r!==void 0?r:j?.blend??bn;return{ok:!0,data:{...await a.start(n,o)}}}case"blender-execute":return{ok:!0,data:{result:(await fn(S(e,"code"))).text}};case"blender-scene-info":return{ok:!0,data:{result:await a.sceneInfo()}};case"blender-object-info":return{ok:!0,data:{result:await a.objectInfo(S(e,"name"))}};case"blender-rna":{const o=typeof e.names=="number"?e.names:void 0;return{ok:!0,data:{result:await a.rna(S(e,"path"),o)}}}case"blender-rna-context":{const o=typeof e.object=="string"?e.object:void 0,s=typeof e.collection=="string"?e.collection:void 0;return{ok:!0,data:{result:await a.rnaContext(o,s)}}}case"blender-rna-set":{const o=typeof e.index=="number"?e.index:void 0;return{ok:!0,data:{result:await hn(S(e,"path"),S(e,"property"),e.value,o)}}}case"blender-outliner":{const o=Array.isArray(e.selected)?e.selected.filter(s=>typeof s=="string"):void 0;return{ok:!0,data:{result:await a.outliner(o)}}}case"blender-node-tree":return{ok:!0,data:{result:await a.nodeTree({...typeof e.path=="string"?{path:e.path}:{},...typeof e.material=="string"?{material:e.material}:{}})}};case"blender-uv-layout":return{ok:!0,data:{result:await a.uvLayout({...typeof e.object=="string"?{object:e.object}:{},...typeof e.uvLayer=="string"?{uvLayer:e.uvLayer}:{}})}};case"blender-rig":return{ok:!0,data:{result:await a.rig({...typeof e.object=="string"?{object:e.object}:{}})}};case"blender-action-clip":return{ok:!0,data:{result:await a.actionClip({...typeof e.object=="string"?{object:e.object}:{},...typeof e.bake=="boolean"?{bake:e.bake}:{}})}};case"blender-node-view":{const o=typeof e.action=="string"?e.action:"state";return{ok:!0,data:{result:wn.verbs.some(l=>l.id===o)?wt("blender-node-view",o,e):ct(e)}}}case"blender-outliner-set":return{ok:!0,data:{result:await lt(S(e,"path"),S(e,"column"),e.value!==!1)}};case"blender-screenshot-view":{const o=typeof e.maxSize=="number"?e.maxSize:1e3,s={kind:"document",id:j?.entryId??"blender:runtime"};return{ok:!0,data:{...await a.screenshotView(o),document:s}}}case"blender-read-file":{const o=await a.readFile(S(e,"path")),s=S(e,"transferId"),l=await fetch(`/__editor/blender-file?id=${encodeURIComponent(s)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([o])});return l.ok?{ok:!0,data:{bytes:o.length}}:{ok:!1,error:`Transfer ${s} was refused: ${l.status}`}}case"blender-write-file":{const o=atob(S(e,"base64")),s=Uint8Array.from(o,l=>l.charCodeAt(0));return await a.writeFile(S(e,"path"),s),{ok:!0,data:{written:s.length}}}case"blender-list-files":{const o=await a.listFiles(S(e,"path")),s=a.presented;return{ok:!0,data:{entries:o,...s?{session:s.session,revision:s.revision}:{},...await Mn(a)}}}}return{ok:!1,error:`Unknown Blender command ${e.type}`}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}export{Wn as A,_n as B,Tn as C,fn as D,je as E,Rn as F,Nn as G,Un as H,wn as N,$n as a,On as b,U as c,we as d,zn as e,Fn as f,Xn as g,Zn as h,Hn as i,qn as j,jn as k,st as l,I as m,Ln as n,D as o,Vn as p,Pn as q,O as r,Dn as s,hn as t,In as u,Cn as v,on as w,Qt as x,An as y,Gn as z};
@@ -1 +0,0 @@
1
- import{ah as m}from"./index-C9sLB9EM.js";import{b as p,a as e,c as n,s}from"./game-network-DCUGpA0n.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-B-HI82yf.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B5AW1iuS.js";import"./contract-system-adapters-BKaXF3b2.js";import"./game-contract-seams-Dby9gdES.js";import"./seeded-random-DPJl96Hb.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CRvifq23.js";import"./capability-coverage-CA2qKK5U.js";import"./edit-mode-authoring-O9u_3q5d.js";import"./json-history-resource-u7pbKDr_.js";import"./binding-resolver-DB46VaoX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DVTsOSC_.js";import"./canvas-entry-runtime-BeCLUBQm.js";import"./three-ingest-runtime-BH7EXhXx.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CWGve9s6.js";import"./ingest-source-persistence-CFdeLAJm.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-BYIvHvUM.js";import"./mounted-authoring-tRcZKWuP.js";import"./entity-object-CAHvjc6f.js";import"./user-data-D6c7SEg7.js";import"./workspace-arrangement-D7KseNXw.js";import"./three-contract-Dkt6PmWY.js";import"./three-BaRHKsDi.js";import"./editor-layers-CX4V4tDr.js";import"./component-instance-root-ChvMDavA.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C4WsVXRS.js";import"./source-persistence-backend-BmUhu0xU.js";import"./three-projection-core-BRALq343.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-CPbBFtdN.js";import"./deferred-ingest-play-BKkABBQR.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CLXIUqeX.js";import"./board-guides-Dz7Etaga.js";import"./relative-import-specifier-CXsqiB3W.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-udqxOflp.js";import"./inference-diagnostics-8Kbjtmd2.js";import"./writer-tw6EcuVO.js";import"./three-state-C9SwlbSu.js";import"./editor-shell-store-D0YYcLl-.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-0J8VF2A4.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),Bt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{Bt as commands,zt as point};
@@ -1 +0,0 @@
1
- import{i as t}from"./game-network-DCUGpA0n.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-C9sLB9EM.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-B-HI82yf.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B5AW1iuS.js";import"./contract-system-adapters-BKaXF3b2.js";import"./game-contract-seams-Dby9gdES.js";import"./seeded-random-DPJl96Hb.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CRvifq23.js";import"./capability-coverage-CA2qKK5U.js";import"./edit-mode-authoring-O9u_3q5d.js";import"./json-history-resource-u7pbKDr_.js";import"./binding-resolver-DB46VaoX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DVTsOSC_.js";import"./canvas-entry-runtime-BeCLUBQm.js";import"./three-ingest-runtime-BH7EXhXx.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CWGve9s6.js";import"./ingest-source-persistence-CFdeLAJm.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-BYIvHvUM.js";import"./mounted-authoring-tRcZKWuP.js";import"./entity-object-CAHvjc6f.js";import"./user-data-D6c7SEg7.js";import"./workspace-arrangement-D7KseNXw.js";import"./three-contract-Dkt6PmWY.js";import"./three-BaRHKsDi.js";import"./editor-layers-CX4V4tDr.js";import"./component-instance-root-ChvMDavA.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C4WsVXRS.js";import"./source-persistence-backend-BmUhu0xU.js";import"./three-projection-core-BRALq343.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-CPbBFtdN.js";import"./deferred-ingest-play-BKkABBQR.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CLXIUqeX.js";import"./board-guides-Dz7Etaga.js";import"./relative-import-specifier-CXsqiB3W.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-udqxOflp.js";import"./inference-diagnostics-8Kbjtmd2.js";import"./writer-tw6EcuVO.js";import"./three-state-C9SwlbSu.js";import"./editor-shell-store-D0YYcLl-.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-0J8VF2A4.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.service";function At(){t()}export{zt as point,At as start};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-BmePiyL7.js","assets/index-C9sLB9EM.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-CPiRKiDC.css","assets/edit-mode-authoring-O9u_3q5d.js","assets/game-network-DCUGpA0n.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/native-debug-module-B-HI82yf.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-B5AW1iuS.js","assets/contract-system-adapters-BKaXF3b2.js","assets/game-contract-seams-Dby9gdES.js","assets/seeded-random-DPJl96Hb.js","assets/game-audio-BeCyd0Ha.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/index-bQE2NA0D.js","assets/live-project-verbs-CRvifq23.js","assets/capability-coverage-CA2qKK5U.js","assets/json-history-resource-u7pbKDr_.js","assets/binding-resolver-DB46VaoX.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-DVTsOSC_.js","assets/canvas-entry-runtime-BeCLUBQm.js","assets/three-ingest-runtime-BH7EXhXx.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/active-ingest-CWGve9s6.js","assets/ingest-source-persistence-CFdeLAJm.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-BYIvHvUM.js","assets/mounted-authoring-tRcZKWuP.js","assets/entity-object-CAHvjc6f.js","assets/user-data-D6c7SEg7.js","assets/workspace-arrangement-D7KseNXw.js","assets/three-contract-Dkt6PmWY.js","assets/three-BaRHKsDi.js","assets/editor-layers-CX4V4tDr.js","assets/component-instance-root-ChvMDavA.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-C4WsVXRS.js","assets/source-persistence-backend-BmUhu0xU.js","assets/three-projection-core-BRALq343.js","assets/body-marks-C1LxJtQb.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/r3f-physics-binding-CPbBFtdN.js","assets/deferred-ingest-play-BKkABBQR.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-CLXIUqeX.js","assets/board-guides-Dz7Etaga.js","assets/relative-import-specifier-CXsqiB3W.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-udqxOflp.js","assets/inference-diagnostics-8Kbjtmd2.js","assets/writer-tw6EcuVO.js","assets/three-state-C9SwlbSu.js","assets/editor-shell-store-D0YYcLl-.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-0J8VF2A4.js","assets/game-surface-defaults-D8S4cRxi.js","assets/scene-framing-BrJYBCoH.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-CLaLvNFe.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-CRfBVAiw.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-lV11lRf9.js","assets/render-features-Bm1rR1tY.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/performance-profiler-CMbwGBuk.js","assets/live-gesture-lock-DJbrjOqf.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,aF as n}from"./index-C9sLB9EM.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import{q as c}from"./edit-mode-authoring-O9u_3q5d.js";import{a as u}from"./json-history-resource-u7pbKDr_.js";import{o as h}from"./three-authoring-adapter-C4WsVXRS.js";import{t as i}from"./editor-shell-store-D0YYcLl-.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./component-instance-root-ChvMDavA.js";import"./user-data-D6c7SEg7.js";import"./workspace-arrangement-D7KseNXw.js";import"./source-persistence-backend-BmUhu0xU.js";import"./ingest-source-persistence-CFdeLAJm.js";import"./three-projection-core-BRALq343.js";import"./editor-layers-CX4V4tDr.js";import"./three-BaRHKsDi.js";import"./entity-object-CAHvjc6f.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three.core-3arARmh6.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-CPbBFtdN.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./Pass-D1MRT672.js";const U="workspace.service";function X(){const r=s(()=>import("./r3f-design-session-BmePiyL7.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,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]));r.catch(()=>{});const m=n("three",(t,o)=>h(i(t),()=>i(t).scene,o,u(o))),e=a({kind:"three",owner:"@volter/editor-game/three/three-authoring",async mountWorldRootSession(t){const o=t,{mountR3FDesignSession:p}=await r;return p(o.store,o.composite,o.renderer)}});return c(),()=>{e(),m()}}export{U as point,X as start};
@@ -1 +0,0 @@
1
- import{e as r}from"./three-integration-FgtD05RY.js";import"./index-C9sLB9EM.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./renderer-ownership-BovSEcLv.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./layered-pick-CgJXO8o0.js";import"./root-stacking-BEd9ZvxC.js";import"./user-data-D6c7SEg7.js";import"./workspace-arrangement-D7KseNXw.js";import"./model-thumbnail-0fkMgwbL.js";import"./studio-environment-C47dHPXj.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-BRDZXPkO.js";import"./three-state-C9SwlbSu.js";import"./editor-shell-store-D0YYcLl-.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./editor-layers-CX4V4tDr.js";import"./entity-object-CAHvjc6f.js";import"./three-contract-Dkt6PmWY.js";import"./hierarchy-marks-DLitjmuD.js";import"./component-instance-root-ChvMDavA.js";import"./viewport-door-0J8VF2A4.js";import"./content-bounds-BvxhGEDh.js";import"./asset-preview-BuDDaHao.js";import"./bitmap-label-Ct4k6ehY.js";const Q="workspace.service";function R(){return r()}export{Q as point,R as start};
@@ -1 +0,0 @@
1
- import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as t}from"./index-C9sLB9EM.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-47uTBVOH.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./configurations-BdNsbAoY.js";import"./run-selection-DlOv503C.js";import"./game-network-DCUGpA0n.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-B-HI82yf.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B5AW1iuS.js";import"./contract-system-adapters-BKaXF3b2.js";import"./game-contract-seams-Dby9gdES.js";import"./seeded-random-DPJl96Hb.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CRvifq23.js";import"./capability-coverage-CA2qKK5U.js";import"./edit-mode-authoring-O9u_3q5d.js";import"./json-history-resource-u7pbKDr_.js";import"./binding-resolver-DB46VaoX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DVTsOSC_.js";import"./canvas-entry-runtime-BeCLUBQm.js";import"./three-ingest-runtime-BH7EXhXx.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CWGve9s6.js";import"./ingest-source-persistence-CFdeLAJm.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-BYIvHvUM.js";import"./mounted-authoring-tRcZKWuP.js";import"./entity-object-CAHvjc6f.js";import"./user-data-D6c7SEg7.js";import"./workspace-arrangement-D7KseNXw.js";import"./three-contract-Dkt6PmWY.js";import"./three-BaRHKsDi.js";import"./editor-layers-CX4V4tDr.js";import"./component-instance-root-ChvMDavA.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C4WsVXRS.js";import"./source-persistence-backend-BmUhu0xU.js";import"./three-projection-core-BRALq343.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-CPbBFtdN.js";import"./deferred-ingest-play-BKkABBQR.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CLXIUqeX.js";import"./board-guides-Dz7Etaga.js";import"./relative-import-specifier-CXsqiB3W.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-udqxOflp.js";import"./inference-diagnostics-8Kbjtmd2.js";import"./writer-tw6EcuVO.js";import"./three-state-C9SwlbSu.js";import"./editor-shell-store-D0YYcLl-.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-0J8VF2A4.js";import"./game-surface-defaults-D8S4cRxi.js";const Dr="workspace.header",Fr=0;function Gr(){const{project:r}=t();return m.useSyncExternalStore(r.subscribe,r.mounts,r.mounts)?o.jsx(p,{}):null}export{Gr as default,Fr as order,Dr as point};
@@ -1,2 +0,0 @@
1
- const h="/work/.volter-session",me=`${h}/session.py`,be=[`${h}/in`,`${h}/reply`],F="/__editor/blender-wasm";function ge(e){return e.startsWith("@@VOLTER-ERROR")?"error":e.startsWith("@@VOLTER-WARN")?"warn":"log"}function H(e){return new URL(`${F}/${e}`,import.meta.url).href}async function z(){const e=await fetch(H("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${F}/status answered ${e.status}`]}}async function V(e){const t=await z();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:r}=await import("./blender-wali-engine-B1kj0Bor.js");return r(e,t)}const{startEmscriptenBlenderEngine:n}=await import("./blender-emscripten-engine-DZk6Gn8_.js");return n(e,t)}function K(e){return e<200?1:e<5e3?5:25}const G=e=>new Promise(t=>setTimeout(t,e)),L=new TextDecoder;function $e(e,t,n){let r=0,s=0;const o=new Set;async function i(l){for(const d of o)l.has(`${d}.done`)||(await e.unlink(`${h}/reply/${d}.json`),await e.unlink(`${h}/reply/${d}.done`),o.delete(d))}async function c(){let l;try{l=await e.readdir(`${h}/ask`)}catch{return}const d=new Set(l.filter(f=>f.endsWith(".done")));await i(d);for(const f of d){const u=f.slice(0,-5);if(Number(u)<=s)continue;s=Number(u);const p=JSON.parse(L.decode(await e.readFile(`${h}/ask/${u}.json`)));let y;try{y=await t.ask(p)}catch(b){y={error:b instanceof Error?b.message:String(b)}}await Promise.all([e.writeFile(`${h}/reply/${u}.json`,JSON.stringify(y??null)),e.writeFile(`${h}/reply/${u}.done`,"1")]),o.add(u)}}async function a(l){const d=String(++r);await Promise.all([e.writeFile(`${h}/in/${d}.json`,JSON.stringify(l)),e.writeFile(`${h}/in/${d}.done`,"1")]);const f=performance.now();for(;;){if(await c(),await e.stat(`${h}/out/${d}.done`)){const y=JSON.parse(L.decode(await e.readFile(`${h}/out/${d}.json`)));if(await e.unlink(`${h}/in/${d}.json`),await e.unlink(`${h}/in/${d}.done`),y.error)throw new Error(y.error);return y.result}const u=n?.();if(u)throw new Error(`Blender is gone, so this call will never be answered: ${u}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const p=K(performance.now()-f);await(e.changed?e.changed(p):G(p))}}return{request:a}}const X=256*1024,Q=4*1024*1024,Y=(1<<20)-1,Z=(()=>{const e=new Uint32Array(256);let t=2654435769;for(let n=0;n<256;n+=1)t^=t<<13,t^=t>>>17,t^=t<<5,e[n]=t>>>0;return e})();function q(e){const t=[];let n=0;for(;n<e.length;){const r=Math.min(e.length,n+Q);let s=r,o=0;for(let i=n+Math.min(X,r-n);i<r;i+=1)if(o=(o<<1)+Z[e[i]]>>>0,(o&Y)===0){s=i+1;break}t.push(s),n=s}return t}async function ee(e){const t=[];let n=0;for(const r of q(e)){const s=new Uint8Array(await crypto.subtle.digest("SHA-256",e.slice(n,r)));t.push({hash:Array.from(s,o=>o.toString(16).padStart(2,"0")).join(""),start:n,end:r}),n=r}return t}const O=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",te={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function ne(e,t,n){const r=te[n.dtype];if(!r)throw new Error(`Blender frame column ${t}: unknown dtype ${n.dtype}`);const{offset:s,length:o}=n;if(s<0||o<0||s+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${s}..${s+o} lie outside the ${e.byteLength}-byte export arena`);const i=e.subarray(s,s+o).slice(),c=r(i),a=n.count*n.stride;if(c.length!==a)throw new Error(`Blender frame column ${t}: ${c.length} values, ${a} declared (${n.count} x ${n.stride})`);return c}function A(e,t){const n=(r,s)=>{if(O(r)){const o=ne(e,s,r);return s==="co"?Float64Array.from(o):o}if(Array.isArray(r))return r.map(o=>n(o,s));if(typeof r=="object"&&r!==null){const o={};for(const[i,c]of Object.entries(r))o[i]=n(c,i);return o}return r};return n(t,"")}async function T(e,t){const n=async(r,s)=>{if(O(r)){const{offset:o,length:i,dtype:c}=r;if(o<0||i<0||o+i>e.byteLength)throw new Error(`Blender frame column ${s}: bytes ${o}..${o+i} lie outside the ${e.byteLength}-byte export arena`);const a=e.subarray(o,o+i).slice(),l=await crypto.subtle.digest("SHA-256",a),d=[...new Uint8Array(l)].map(f=>f.toString(16).padStart(2,"0")).join("");return{dtype:c,length:i,sha256:d}}if(Array.isArray(r))return Promise.all(r.map(o=>n(o,s)));if(typeof r=="object"&&r!==null){const o={};for(const[i,c]of Object.entries(r))o[i]=await n(c,i);return o}return r};return n(t,"")}const E=e=>self.postMessage(e),R=(e,t)=>E({op:"log",level:e,text:t});let $=null,v=null,re=0;const B=new Map;function oe(e,t,n){const r=++re,s=[],o=e;for(const i of[o?.meshes??{},o?.images??{}])for(const c of Object.values(i))for(const a of Object.values(c))ArrayBuffer.isView(a)&&a.buffer instanceof ArrayBuffer&&!s.includes(a.buffer)&&s.push(a.buffer);return new Promise((i,c)=>{B.set(r,{resolve:i,reject:c}),self.postMessage({op:"present",id:r,frame:e,description:t,...n?{capture:n}:{}},s)})}let w=null,k=null,N=!1,_=Promise.resolve();function se(e){const t=_.then(e);return _=t.catch(()=>{}),t}let g=null;async function ie(e,t){const n=new Map,r=async(s,o)=>{if(O(s)){n.set(s.offset,{typed:A(e,{[o]:s})[o],description:await T(e,s)});return}if(Array.isArray(s))for(const i of s)await r(i,o);else if(typeof s=="object"&&s!==null)for(const[i,c]of Object.entries(s))await r(c,i)};return await r(t,""),n}function ae(e,t){const n=r=>{const s=(o,i)=>{if(O(o)){const a=e.columns.get(o.offset);if(!a)throw new Error(`Blender frame column ${i.join(".")}: not in the held frame`);return a[r]}if(Array.isArray(o))return o.map(a=>s(a,i));if(typeof o!="object"||o===null)return o;if(o.deferred===!0){const[a,l]=i.slice(-2),d=(a==="meshes"?e.meshes:e.images).get(l);if(!d)throw new Error(`Blender frame ${a} ${l}: deferred and never pulled`);return d[r]}const c={};for(const[a,l]of Object.entries(o))c[a]=s(l,[...i,a]);return c};return s(t,[])};return{typed:n("typed"),description:n("description")}}function C(e){N=e,E({op:"document-dirty",dirty:e})}async function U(){if(!w||k===null)return;const e=k;let t;try{t=await w.request({op:"save-document"})}catch(s){throw new Error(`The Blender document ${e} could not be saved: ${j(s)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let n;try{n=await w.files.readFile(t.path)}catch(s){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${j(s)}`)}m.delete(t.path);let r=0;try{const s=await ee(n),o=`path=${encodeURIComponent(e)}`,i=JSON.stringify({chunks:s.map(({hash:c,start:a,end:l})=>[c,l-a])});for(let c=0;;c+=1){const a=await fetch(`/__editor/blender-document?${o}`,{method:"POST",headers:{"content-type":"application/json"},body:i}),l=await a.json().catch(()=>null);if(!a.ok)throw new Error(`HTTP ${a.status} ${l?.error??""}`);if(l?.ok)break;if(c===2||!Array.isArray(l?.missing))throw new Error(`the server still lacks ${l?.missing?.length??"?"} chunks`);const d=new Set(l.missing);for(const f of s){if(!d.delete(f.hash))continue;const u=await fetch(`/__editor/blender-document-chunk?${o}&hash=${f.hash}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([n.subarray(f.start,f.end)])});if(!u.ok)throw new Error(`HTTP ${u.status} ${await u.text().catch(()=>"")}`);r+=f.end-f.start}}}catch(s){throw new Error(`The Blender document ${e} was not written to the project: ${j(s)}`)}C(!1),R("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:n.length,sent:r})}`)}async function ce(e,t){const n={engine:null},r=await V({project:e,log:R,ask:async({frame:o,hold:i,mesh:c,image:a,piece:l,present:d,capture:f,saveDue:u})=>{if(!n.engine)throw new Error("The Blender session presented before it started");u&&k!==null&&C(!0);const p=await n.engine.readArena();if(i!==void 0)return g={columns:await ie(p,i),meshes:new Map,images:new Map},{};if(c!==void 0||a!==void 0){if(!g)throw new Error(`The Blender session sent ${c??a} before its frame`);const P={typed:A(p,l),description:await T(p,l)};return c!==void 0?g.meshes.set(c,P):g.images.set(a,P),{}}let y,b;if(d){if(!g)throw new Error("The Blender session presented a frame it never sent");({typed:y,description:b}=ae(g,o)),g=null}else y=A(p,o),b=await T(p,o);const S=await oe(y,b,f);return{...typeof S.capture=="object"&&S.capture!==null?S.capture:{},..."held"in S?{held:S.held}:{}}}});n.engine=r,w=r,t&&await D(r.files,e);const s=await r.request({op:"start",project:e,...t?{document:t}:{}});return t&&(k=t),$={start:async()=>s,execute:async o=>{const i=await r.request({op:"execute",code:o});return i.error?`Error executing code: ${i.error}`:`Code executed successfully: ${i.result}`},sceneInfo:async()=>JSON.stringify(await r.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await r.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await r.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...s,engine:"blender-wasm",skew:r.skew,bootMs:Math.round(r.bootMs),releasedPayloadMB:r.releasedPayloadBytes===null?null:Math.round(r.releasedPayloadBytes/1048576)}}async function le(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function de(e,t){if($)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!fe(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const n=await le();if(!n.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${n.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return v=e,ce(e,t)}function fe(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n!==""&&n!=="."&&n!=="..")}const I=new Set;function x(e){I.has(e)||(I.add(e),R("error",e))}async function ue(e){const t=i=>(x(`The project's files are not readable from Python: ${i}`),null);let n;try{n=await fetch("/__editor/blender-project-index")}catch(i){return t(String(i))}if(!n.ok)return t(`/__editor/blender-project-index answered ${n.status}`);let r;try{if(r=await n.json(),typeof r?.root!="string"||!Array.isArray(r.files))return t("invalid project index")}catch(i){return t(String(i))}const{root:s,files:o}=r;return s!==e&&x(`The editor serving this tab has ${s} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const m=new Map;async function he(e,t){const n=await e.stat(t);return n?`${n.size}:${n.mtimeMs}`:""}async function D(e,t){const n=await ue(t);if(!n)return;const r=new Set(n.map(s=>`${t}/${s.path}`));for(const s of[...m.keys()])if(!r.has(s)){try{await e.unlink(s)}catch{}m.delete(s)}for(const s of n){const o=`${t}/${s.path}`,i=`${s.size}:${s.mtime}`;if(m.get(o)?.host===i||!m.has(o)&&await e.stat(o)!==null)continue;const c=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(s.path)}`);if(!c.ok){x(`${s.path}: HTTP ${c.status}`);continue}const a=o.slice(0,o.lastIndexOf("/"));a&&await e.mkdirTree(a),await e.writeFile(o,new Uint8Array(await c.arrayBuffer())),m.set(o,{host:i,engine:await he(e,o)})}}async function we(e,t){const n=[],r=async s=>{let o;try{o=await e.readdir(s)}catch{return}for(const i of o){if(i==="."||i==="..")continue;const c=`${s.replace(/\/$/,"")}/${i}`,a=await e.stat(c);if(a){if((a.mode&61440)===16384){await r(c);continue}m.get(c)?.engine!==`${a.size}:${a.mtimeMs}`&&n.push({path:c,size:a.size,mtime:a.mtimeMs})}}};return await r(t),n}async function J(e){switch(e.op){case"start":return de(e.project,e.document);case"present-result":{const r=B.get(e.id);B.delete(e.id),r&&(e.error?r.reject(new Error(e.error)):r.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!$||!v||!w)throw new Error("The Blender session has not started");const t=w.files,n=w.request.bind(w);switch(e.op){case"flush-document":return N?(await U(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return n({op:e.op});case"history-step":return n({op:"history-step",token:e.token,direction:e.direction});case"execute":await D(t,v);{const r=await n({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return r.error?`Error executing code: ${r.error}`:`Code executed successfully: ${r.result}`}case"present":return n({op:"present"});case"scene-info":return $.sceneInfo();case"object-info":return $.objectInfo(e.name);case"rna":return n({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return n({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"view-shading":return n({op:"view-shading",shading:e.shading});case"rna-set":return n({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return n({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return n({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return n({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return n({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return n({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return n({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await $.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const r=e.path.slice(0,e.path.lastIndexOf("/"));r&&await t.mkdirTree(r),await t.writeFile(e.path,e.bytes),m.delete(e.path);return}case"list-files":return we(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function j(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function W(){if(!w)return;const e=w.memoryBytes();e!==null&&E({op:"memory",bytes:e})}self.addEventListener("error",W);self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){J(t);return}se(()=>ye(t))};async function ye(e){try{const t=await J(e);N&&await U(),await M(),E({id:e.id,result:t})}catch(t){let n=j(t);try{await M()}catch(r){n+=`
2
- Unable to deliver Blender history: ${j(r)}`}E({id:e.id,error:n})}W()}async function M(){if(!w||!$)return;const e=await w.request({op:"history-events"});e.length&&E({op:"history",entries:e})}export{F as A,be as P,h as S,H as a,me as b,ge as c,$e as o,G as s};