@volter/game-editor 0.5.155 → 0.5.157

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 (294) 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 +2156 -2156
  5. package/dist/assets/{AssetBudgetPanel-B2Wb7-b1.js → AssetBudgetPanel-X38cPCO3.js} +3 -3
  6. package/dist/assets/{AudioViewer-gge--M-h.js → AudioViewer-xMM7RZH9.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-CyGiXrEJ.js → CanvasBoardDocument-DCyh4eaO.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-ChG9oRS8.js → CanvasSceneViewport-BA8eRjJY.js} +1 -1
  9. package/dist/assets/{ColorInput-Dzpqy-J3.js → ColorInput-y8NzQ5q8.js} +1 -1
  10. package/dist/assets/{ColorPicker-CqJPBHlh.js → ColorPicker-C3HI90eU.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-D7XDf6uB.js → EntityModelDocument-DrWN0e0N.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-BgO7Hl3g.js → EnvironmentAssetDocument-Bv8M7C1O.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-BBmwHCKA.js → GameplaySessionTimeline-mMVtRemn.js} +1 -1
  14. package/dist/assets/{ImageViewer-BjxoscVa.js → ImageViewer-D1mswm2G.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-DMNRuc0X.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-D81JuRAm.js → JsonAssetDocument-DxLYMceV.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-bgStMiU1.js → LiveModuleDocument-BOO4_ypf.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-cl9Jq0Zw.js → LutAssetDocument-jf9ogNqN.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-CYCLKpxJ.js → ModelAssetDocument-DbtKJsGQ.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-DhHjvD5d.js → NonThreeAuthoringBootstrap-ChEoVJQP.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-CQbARBIW.js → Object3DDocumentToolbar-Y-jpI3WD.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-BOi94JfA.js +2 -0
  23. package/dist/assets/{Object3DPreview-BOZYzjz_.js → Object3DPreview-7LnLFpmg.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-DdKHHjxg.js → OnlineAssetDetail-DVdZv1D1.js} +1 -1
  25. package/dist/assets/{PlayBar-CAarfEOh.js → PlayBar-B-GGRbBB.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-GTbawoy7.js → QuarksAssetDocument-2MqOJHlY.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-DIFkxeKv.js → ReactCanvasControls-COp1PvO1.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-Dv_w1D9s.js → RootSelectionOverlay-6M-HHI3M.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-OA-nshNN.js → ShaderAssetDocument-PrwCSYxk.js} +1 -1
  30. package/dist/assets/{ShadowEditor-Cp1QVCo9.js → ShadowEditor-EXaJ1Kud.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-CGGHBzgL.js → SourceAssetViewer-Bk_LGk7S.js} +1 -1
  32. package/dist/assets/{StageHost-BMgCrIPG.js → StageHost-CK78ezTC.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-CyF7FwI7.js → StoryPreviewMount-IbbNNzF4.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-DCJkLWU8.js → ThreeBoardDocument-DUakOh0j.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-CxsM-QHW.js → ThreeIsolationSceneContent-BjAyHzL2.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-lsAoRxtr.js → ToolObject3DPreview-CRb_pBHc.js} +1 -1
  37. package/dist/assets/{Toolbar-yvFlRv8R.js → Toolbar-Bb7KArdo.js} +1 -1
  38. package/dist/assets/{TransientHint-Bslncm_l.js → TransientHint-BlB2atrU.js} +1 -1
  39. package/dist/assets/{VideoViewer-Ba-e91kP.js → VideoViewer-D5fNjrcg.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-CgbuQ0e-.js → ViewportShadingMenu-D_-wHbzW.js} +1 -1
  41. package/dist/assets/{active-ingest-CJ2U5L1O.js → active-ingest-DJ8FmH5M.js} +2 -2
  42. package/dist/assets/{animation-clock-CVpGQSVj.js → animation-clock-CINkiVZd.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-CI0K1tfi.js → animation-mixers.service-BST_khGa.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-Wg6WxkxK.js → animation-timeline.utility-X54fMzvE.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-BbCBxjLY.js → asset-budget-asset.menu-CfJth8-V.js} +1 -1
  46. package/dist/assets/{asset-budget.action-CK8h0v1A.js → asset-budget.action-ByyoIoUI.js} +1 -1
  47. package/dist/assets/{asset-budget.document-CYVcDLvH.js → asset-budget.document-CO1NrMEa.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-BcTijQ2R.js → asset-budget.menu-Cb99KwLd.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-DWp0E8cc.js → asset-editor-persistence-BF2Eqt0F.js} +1 -1
  50. package/dist/assets/{asset-loaders-Bo91oPiL.js → asset-loaders-2LtXp4_y.js} +1 -1
  51. package/dist/assets/{asset-preview-BUpxsHNd.js → asset-preview-t-7PYPjJ.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-CyiXe5qk.js → audio-unlock.service-DwkIGA6J.js} +1 -1
  53. package/dist/assets/{audio.utility-BN4mANCx.js → audio.utility-Mn4GcZIb.js} +1 -1
  54. package/dist/assets/autoplay.service-D7c8d5PV.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-C-EAsfMr.js → babylon-authoring-adapter-BB5HErRG.js} +1 -1
  56. package/dist/assets/{binding-resolver-DoOAFM2m.js → binding-resolver-CXF3o1ZX.js} +2 -2
  57. package/dist/assets/{blender-node-editor.document-BzkGPs0i.js → blender-node-editor.document-djNJTSeo.js} +1 -1
  58. package/dist/assets/{blender-properties-tab-B1ggqOYB.js → blender-properties-tab-06D6TYA0.js} +1 -1
  59. package/dist/assets/{blender-runtime-host-MJZEPwHA.js → blender-runtime-host-Cqitl1ZO.js} +1 -1
  60. package/dist/assets/{blender-runtime-skin-hw-op7Nt.js → blender-runtime-skin-RX6nlrgy.js} +72 -58
  61. package/dist/assets/{blender-runtime.document-CvTyAou8.js → blender-runtime.document-pgD63Zep.js} +10 -10
  62. package/dist/assets/{blender-screenshot.menu-C4VXpXVa.js → blender-screenshot.menu-DZ44fIU0.js} +1 -1
  63. package/dist/assets/{blender-timeline.document-BRFDd7JZ.js → blender-timeline.document-D53mR9D6.js} +1 -1
  64. package/dist/assets/{blender-uv-editor.document-CM09ITWu.js → blender-uv-editor.document-Dux9ZXaj.js} +1 -1
  65. package/dist/assets/{blender-version.status-CPyc_-kA.js → blender-version.status-hK0_7tRC.js} +1 -1
  66. package/dist/assets/{blender.command-ktKz-2Zi.js → blender.command-BF9RHCP_.js} +1 -1
  67. package/dist/assets/{board-guides-CCiyx8cT.js → board-guides-BYnclES1.js} +1 -1
  68. package/dist/assets/{bridge.command-tP5j6w72.js → bridge.command-CS12Cp-B.js} +3 -3
  69. package/dist/assets/{browserAll-BSQVVrNG.js → browserAll-CGQ_uBbB.js} +1 -1
  70. package/dist/assets/{build-player.document-BwbBXtF5.js → build-player.document-RpeG8U_t.js} +1 -1
  71. package/dist/assets/{build-profiles.document-UiF_BsjE.js → build-profiles.document-DydU-eTF.js} +1 -1
  72. package/dist/assets/{build-progress.status-Bf5KpnxC.js → build-progress.status-arvTBGok.js} +1 -1
  73. package/dist/assets/{build-session-C4jVDt-u.js → build-session-D8B-93_A.js} +1 -1
  74. package/dist/assets/{build.action-DP2d1Uhj.js → build.action-CYKD0CrB.js} +1 -1
  75. package/dist/assets/{build.command-D5pyNcoj.js → build.command-BH-4yWaL.js} +1 -1
  76. package/dist/assets/{build.header-DupBIAOw.js → build.header-B5-bZp5Z.js} +1 -1
  77. package/dist/assets/{build.menu-DWrKtdoV.js → build.menu-CyOe8xXz.js} +1 -1
  78. package/dist/assets/{build.service-qnz73gSX.js → build.service-BuhAa1EB.js} +1 -1
  79. package/dist/assets/{camera-C74U5X7o.js → camera-KM5i-TaU.js} +1 -1
  80. package/dist/assets/{camera-runtime.inspector-B2l34Xhl.js → camera-runtime.inspector-DA-GqhBI.js} +1 -1
  81. package/dist/assets/{canvas-design-mount-D4M3E1AX.js → canvas-design-mount-PWQPVLiY.js} +3 -3
  82. package/dist/assets/{canvas-entry-runtime-CLOuJcgT.js → canvas-entry-runtime-nWfnVKYb.js} +2 -2
  83. package/dist/assets/{canvas-preview-frames-CSCcu2sG.js → canvas-preview-frames-BwWVTr-u.js} +1 -1
  84. package/dist/assets/{canvas-story-capture.service-onD_xSpQ.js → canvas-story-capture.service-B1o-VBky.js} +2 -2
  85. package/dist/assets/{capability-coverage-EnZ99FoT.js → capability-coverage-aT7nf05J.js} +1 -1
  86. package/dist/assets/{collaboration-presence-1_UMOAkw.js → collaboration-presence-h1Fxju0A.js} +1 -1
  87. package/dist/assets/{collider-C6R1tHfa.js → collider-BDLEjrr-.js} +1 -1
  88. package/dist/assets/{component-board.service-Ckl-5tA4.js → component-board.service-CetsHh4L.js} +2 -2
  89. package/dist/assets/{component-board.service-Cuf_SXeA.js → component-board.service-DAeFLAlB.js} +2 -2
  90. package/dist/assets/{component-board.service-BX_2bwX3.js → component-board.service-qH45JxuD.js} +2 -2
  91. package/dist/assets/{component-contracts.service-rI-rbvDG.js → component-contracts.service-nYhZ_ceu.js} +1 -1
  92. package/dist/assets/{component-instance-root-wO1p-rLr.js → component-instance-root-QYCCyhxU.js} +1 -1
  93. package/dist/assets/{component-verbs.command-O2bwqmK3.js → component-verbs.command-y1H2CFq-.js} +1 -1
  94. package/dist/assets/{component-verbs.service-BiiQMtJt.js → component-verbs.service-QvBBdzY3.js} +1 -1
  95. package/dist/assets/{config-dVnV1cxW.js → config-YwJJtCF0.js} +2 -2
  96. package/dist/assets/{configurations-8qaUqMH7.js → configurations-B52h5RGp.js} +1 -1
  97. package/dist/assets/{connection.status-vH9WCDDg.js → connection.status-DnEU1lk4.js} +1 -1
  98. package/dist/assets/{constraints.inspector-C7UjUxPR.js → constraints.inspector-DgbM_8l2.js} +1 -1
  99. package/dist/assets/{content-bounds-Dl5Y3LLv.js → content-bounds-BRS42hfD.js} +1 -1
  100. package/dist/assets/{contract-system-adapters-BDUpDoKd.js → contract-system-adapters-DIpeIRm_.js} +1 -1
  101. package/dist/assets/{coverage.service-IS7Oklo8.js → coverage.service-Cjy9MO9F.js} +1 -1
  102. package/dist/assets/{create-runtime-Bucz0XVU.js → create-runtime-ByZWXstA.js} +1 -1
  103. package/dist/assets/{curve-D0Q6TczG.js → curve-DaFJmPin.js} +1 -1
  104. package/dist/assets/{data-asset-B0a1y8M-.js → data-asset-DRCqFyxF.js} +1 -1
  105. package/dist/assets/{data-ref-dRt2Wi5L.js → data-ref-CkvCIusA.js} +1 -1
  106. package/dist/assets/{debug-bridge-EhDkhrLX.js → debug-bridge-C7NLsHKu.js} +1 -1
  107. package/dist/assets/{debug-registry-B2THKz1v.js → debug-registry-BzagDrhV.js} +1 -1
  108. package/dist/assets/{deferred-ingest-play-To3ZratW.js → deferred-ingest-play-DMp_yRhc.js} +2 -2
  109. package/dist/assets/{design-time-canvas-mount-BnSaRAbS.js → design-time-canvas-mount-kB1ZRIvt.js} +2 -2
  110. package/dist/assets/{design-time-layers-OMAIxOrv.js → design-time-layers-Dzu3jW_N.js} +1 -1
  111. package/dist/assets/{design-time-mount.service-RFkiqPIn.js → design-time-mount.service-CLEJHBLW.js} +2 -2
  112. package/dist/assets/{design-time-mount.service-Bgr_nCDs.js → design-time-mount.service-Dgswmfff.js} +2 -2
  113. package/dist/assets/{design-time-react-mount-BsSBoX7J.js → design-time-react-mount-B71UACVS.js} +1 -1
  114. package/dist/assets/{document-preview-three-Qni0oVBw.js → document-preview-three-DxAxdZRF.js} +1 -1
  115. package/dist/assets/{dom-authoring-adapter-DsUgOtQy.js → dom-authoring-adapter-CQiwffQ4.js} +1 -1
  116. package/dist/assets/{draco3d-DyZllcka.js → draco3d-CWfPSgkb.js} +1 -1
  117. package/dist/assets/{edit-mode-audio.service-CjXNAZEs.js → edit-mode-audio.service-CikRAHOi.js} +1 -1
  118. package/dist/assets/{edit-mode-authoring-BDgZD47j.js → edit-mode-authoring-DthrLbz-.js} +1 -1
  119. package/dist/assets/{edit-mode-networking.service-3dUr2g_0.js → edit-mode-networking.service-DBmK8YGU.js} +1 -1
  120. package/dist/assets/{editor-api-DTrNJMXL.js → editor-api-CqqOlRSi.js} +1 -1
  121. package/dist/assets/{editor-layers-DwaX5UFy.js → editor-layers-k0AjpomL.js} +1 -1
  122. package/dist/assets/{editor-shell-store-aKHbAoCV.js → editor-shell-store-B3c29A3l.js} +1 -1
  123. package/dist/assets/{entity-object-BLJ-I8XT.js → entity-object-BOLh6DVA.js} +1 -1
  124. package/dist/assets/{extend-6LrR7eSL.js → extend-CJ7vLkP1.js} +1 -1
  125. package/dist/assets/{fork-menu-V-FM6YuY.js → fork-menu-Bzl-5_GA.js} +1 -1
  126. package/dist/assets/{frame-debugger-store-DwDC0wAm.js → frame-debugger-store-NGsJt0AK.js} +1 -1
  127. package/dist/assets/{game-contract-seams-C22a4B79.js → game-contract-seams-CuBiefwV.js} +1 -1
  128. package/dist/assets/{game-css-scope-transform-Wv0ZdTsR.js → game-css-scope-transform-5yv5zl6t.js} +1 -1
  129. package/dist/assets/{game-document.service-BzvFIWCc.js → game-document.service-DtML_s2L.js} +1 -1
  130. package/dist/assets/{game-eval.command-DpQn_nY8.js → game-eval.command-Cghc-6r3.js} +1 -1
  131. package/dist/assets/{game-module-access-BI6oBa8Y.js → game-module-access-DPnqfsy_.js} +1 -1
  132. package/dist/assets/{game-network-Deo8lcPw.js → game-network-TjOj3K-Z.js} +3 -3
  133. package/dist/assets/{gameplay-export-BOLhxmII.js → gameplay-export-ebDdiP9T.js} +1 -1
  134. package/dist/assets/{gameplay-replay-Dkvmv6hf.js → gameplay-replay-B4BPQnTZ.js} +1 -1
  135. package/dist/assets/{gameplay.command-DCKqLv7C.js → gameplay.command-C__OjBjz.js} +1 -1
  136. package/dist/assets/{generation-jobs-6D562vMB.js → generation-jobs-C57_oOgx.js} +1 -1
  137. package/dist/assets/{generation.service-BFRoLb7y.js → generation.service-BJel-Oiy.js} +1 -1
  138. package/dist/assets/{generations-HwV1btKK.js → generations-DNfmqqzL.js} +1 -1
  139. package/dist/assets/{generations.status-BLiDcKsg.js → generations.status-nXpY7bFU.js} +1 -1
  140. package/dist/assets/{hierarchy-marks-DeG4E4Ke.js → hierarchy-marks-C2temlO0.js} +1 -1
  141. package/dist/assets/{hosted-asset-materialization-Bod7CEMF.js → hosted-asset-materialization-BtbO5pyX.js} +1 -1
  142. package/dist/assets/{index-CLUA6PYq.js → index-7J5pTwW2.js} +1 -1
  143. package/dist/assets/{index-KIR4Has5.js → index-B5GZkByz.js} +1 -1
  144. package/dist/assets/{index-CdLhNxor.js → index-B69_nH5F.js} +1 -1
  145. package/dist/assets/{index-ClgrFOcX.js → index-BfqJPhFO.js} +7 -7
  146. package/dist/assets/{index-DkYeh000.js → index-BiH6f3Mk.js} +1 -1
  147. package/dist/assets/{index-CHOT9sYh.js → index-CFS_B4hc.js} +2 -2
  148. package/dist/assets/{index-CyLPQ8pY.js → index-DYoPv2Wb.js} +1 -1
  149. package/dist/assets/{index-4hL3-0yz.js → index-my7iu018.js} +1 -1
  150. package/dist/assets/{index-jS3rfNkZ.js → index-zXacXllH.js} +1 -1
  151. package/dist/assets/{inference-diagnostics-BmZ5ggEK.js → inference-diagnostics-NvA3SRR7.js} +1 -1
  152. package/dist/assets/{ingest-boot-viewport-CipkFljr.js → ingest-boot-viewport-DHhBi66w.js} +1 -1
  153. package/dist/assets/{ingest-siblings-CEwYp-xg.js → ingest-siblings-CMWO3uRZ.js} +1 -1
  154. package/dist/assets/{ingest-source-persistence-CVU1rTj0.js → ingest-source-persistence-CrXFBT__.js} +1 -1
  155. package/dist/assets/{ingest.service-bNqvcqoK.js → ingest.service-BYEo4j1s.js} +1 -1
  156. package/dist/assets/{inspect-BunjdqX7.js → inspect-UxYR9Ls5.js} +1 -1
  157. package/dist/assets/instances.command-DDOJ3aWq.js +1 -0
  158. package/dist/assets/{json-history-resource-CDEoQe1R.js → json-history-resource-De8KJl61.js} +1 -1
  159. package/dist/assets/{layered-pick-guh6WlA7.js → layered-pick-Dito5b_J.js} +1 -1
  160. package/dist/assets/{light-BPZivpCK.js → light-BnSS9Nzc.js} +1 -1
  161. package/dist/assets/{live-project-verbs-Bqmxbr2o.js → live-project-verbs-CDRzC_D1.js} +1 -1
  162. package/dist/assets/{machine.document-CAFPFq5K.js → machine.document-CVG78EGi.js} +1 -1
  163. package/dist/assets/{machines.finder-CbUWReMp.js → machines.finder-vrUR_Pb_.js} +1 -1
  164. package/dist/assets/{material-huG6lNEK.js → material-7mmxSi8g.js} +1 -1
  165. package/dist/assets/{material-factory-BkyOzJ7B.js → material-factory-CXvJ2goL.js} +1 -1
  166. package/dist/assets/{mesh-CjCfRcFK.js → mesh-DpK09Vho.js} +1 -1
  167. package/dist/assets/{model-asset-sections.service-Dt4V2K2v.js → model-asset-sections.service-ByE7kOXW.js} +1 -1
  168. package/dist/assets/{model-inspection-BDA5jikL.js → model-inspection-PgxfYOnI.js} +1 -1
  169. package/dist/assets/{model-thumbnail-CF3qGQWb.js → model-thumbnail-Dnv7DCt7.js} +1 -1
  170. package/dist/assets/{models.finder-yh4YeGrA.js → models.finder-BaD41xeQ.js} +1 -1
  171. package/dist/assets/{module-mode-D8en13PD.js → module-mode-Bb9fFtEw.js} +2 -2
  172. package/dist/assets/{mount-canvas-ingest-root-JOkm2Ypj.js → mount-canvas-ingest-root-B0_ckx79.js} +2 -2
  173. package/dist/assets/{mount-dom-ingest-root-CVXFnJZb.js → mount-dom-ingest-root-BnZQSayp.js} +2 -2
  174. package/dist/assets/{mount-ingest-root-C3o0o28C.js → mount-ingest-root-DHVNQKHi.js} +2 -2
  175. package/dist/assets/{mount-manifest-d7WQ9MYp.js → mount-manifest-cYykTsXQ.js} +1 -1
  176. package/dist/assets/{mount-three-ingest-root-Dqd4XWP1.js → mount-three-ingest-root-CI-gjlh8.js} +1 -1
  177. package/dist/assets/{mounted-authoring-B697dYuN.js → mounted-authoring-B2dc__pv.js} +1 -1
  178. package/dist/assets/{mounted-story-viewport-source-BvNZ3QQn.js → mounted-story-viewport-source-Ceh05FK8.js} +1 -1
  179. package/dist/assets/{native-debug-module-iX2-V5kg.js → native-debug-module-L_Ofssyj.js} +1 -1
  180. package/dist/assets/{navigation-CIl9OY1F.js → navigation-CADCnkrx.js} +1 -1
  181. package/dist/assets/{navmesh.menu-DrMoj7Ag.js → navmesh.menu-3D6ZEGhB.js} +1 -1
  182. package/dist/assets/{navmesh.service-CTr1NVfz.js → navmesh.service-D_TdU1xw.js} +1 -1
  183. package/dist/assets/network-observer.service-D9nUCc15.js +1 -0
  184. package/dist/assets/{network.utility-Btexm5ao.js → network.utility-B3riF8KT.js} +1 -1
  185. package/dist/assets/{object3d-document-session-registry-CADiW-LP.js → object3d-document-session-registry-CLizyhis.js} +2 -2
  186. package/dist/assets/{oid-transform-Ca1oU_Ei.js → oid-transform-CinlfHYa.js} +1 -1
  187. package/dist/assets/{particles-D1oPwNJh.js → particles--V50tPi5.js} +1 -1
  188. package/dist/assets/{pixi-authoring-adapter-B1BBfTju.js → pixi-authoring-adapter-qbP0YW7g.js} +1 -1
  189. package/dist/assets/{pixi-live-write-target-BcUhtqmJ.js → pixi-live-write-target-coTAFFGW.js} +1 -1
  190. package/dist/assets/{play.command-ScnwcvJr.js → play.command-kc7rzTlg.js} +2 -2
  191. package/dist/assets/{presentation-DPfnCjNA.js → presentation-jBjhcEq1.js} +1 -1
  192. package/dist/assets/{product-D_9saRiZ.js → product-DgYRVeaY.js} +1 -1
  193. package/dist/assets/{profiler.action-PXTw93E5.js → profiler.action-Dj94ZJLY.js} +1 -1
  194. package/dist/assets/{profiler.menu-DPFV6QQD.js → profiler.menu-BHplCv7a.js} +1 -1
  195. package/dist/assets/{profiler.utility-eDooJGnI.js → profiler.utility-D32oIOGk.js} +1 -1
  196. package/dist/assets/{project-authoring-session-BmeutotA.js → project-authoring-session-Cd8SeWEJ.js} +2 -2
  197. package/dist/assets/{properties-bone-constraints.inspector-BW0V1WXQ.js → properties-bone-constraints.inspector-VPTHP6BI.js} +1 -1
  198. package/dist/assets/{properties-bone.inspector-DIvTZhY8.js → properties-bone.inspector-4GD1gzCp.js} +1 -1
  199. package/dist/assets/{properties-collection.inspector-Dbt5XMhs.js → properties-collection.inspector-CehoAair.js} +1 -1
  200. package/dist/assets/{properties-constraints.inspector-5SvB0GDC.js → properties-constraints.inspector-LgPoqURT.js} +1 -1
  201. package/dist/assets/{properties-data.inspector-C-SngIsI.js → properties-data.inspector-D3uEJD3t.js} +1 -1
  202. package/dist/assets/{properties-material.inspector-CYAWsvsX.js → properties-material.inspector-2n9K5IFo.js} +1 -1
  203. package/dist/assets/{properties-modifiers.inspector-XN6BL-Ll.js → properties-modifiers.inspector-B_RsuDyF.js} +1 -1
  204. package/dist/assets/{properties-object.inspector-CfryU0kN.js → properties-object.inspector-CBZA72yZ.js} +1 -1
  205. package/dist/assets/{properties-output.inspector-COfgmFUW.js → properties-output.inspector-DxDAmKI-.js} +1 -1
  206. package/dist/assets/{properties-particles.inspector-BCh0vFr6.js → properties-particles.inspector-pPS920CT.js} +1 -1
  207. package/dist/assets/{properties-physics.inspector-B6to1u6U.js → properties-physics.inspector-XUnPp5Q3.js} +1 -1
  208. package/dist/assets/{properties-render.inspector-C4hVfo7j.js → properties-render.inspector-DnC4sgP3.js} +1 -1
  209. package/dist/assets/{properties-scene.inspector-dKta4xn5.js → properties-scene.inspector-MZ-gCrYM.js} +1 -1
  210. package/dist/assets/{properties-texture.inspector-ZlNhW25m.js → properties-texture.inspector-B7QGBzm5.js} +1 -1
  211. package/dist/assets/{properties-view-layer.inspector-CIxHmkDR.js → properties-view-layer.inspector-rt2qT9SA.js} +1 -1
  212. package/dist/assets/{properties-world.inspector-Ce0q2dmK.js → properties-world.inspector-Vg7GD9HK.js} +1 -1
  213. package/dist/assets/{r3f-design-session-1riISktt.js → r3f-design-session-DfRwB6oN.js} +2 -2
  214. package/dist/assets/{r3f-physics-binding-DuG97FR9.js → r3f-physics-binding-EfYECbQc.js} +1 -1
  215. package/dist/assets/{r3f-source-authoring-adapter-B8qqrdwk.js → r3f-source-authoring-adapter-CVupdJt5.js} +1 -1
  216. package/dist/assets/{react-canvas-navigation-CxBm8iw8.js → react-canvas-navigation-DwiPTVdH.js} +1 -1
  217. package/dist/assets/{react-inspector.service-BcdePwno.js → react-inspector.service-DffkStxd.js} +1 -1
  218. package/dist/assets/{react-story-board-CMvkLAkF.js → react-story-board-CynnmKqO.js} +1 -1
  219. package/dist/assets/{react-three-rapier.esm-D5svf-ME.js → react-three-rapier.esm-DnUfnQnM.js} +1 -1
  220. package/dist/assets/{react-world-authoring-adapter-Dq8NqvWu.js → react-world-authoring-adapter-Cf1jv2dl.js} +1 -1
  221. package/dist/assets/{realm-services-CqjVBanw.js → realm-services-CxfLBQQ9.js} +1 -1
  222. package/dist/assets/{reflection-probe-capture.inspector-uEvyppEj.js → reflection-probe-capture.inspector-DfzDNtJF.js} +1 -1
  223. package/dist/assets/{registry-D7lFIA8c.js → registry-69pUwZEm.js} +1 -1
  224. package/dist/assets/{relative-import-specifier-CA9mSNXO.js → relative-import-specifier-J1WeZQaJ.js} +1 -1
  225. package/dist/assets/{render-env-BHasp-z3.js → render-env-CmR-momj.js} +1 -1
  226. package/dist/assets/{render-features-sSb1-c5x.js → render-features-D7pQr-dE.js} +1 -1
  227. package/dist/assets/{render-settings-CUbo4Sw5.js → render-settings-BUT8gPkc.js} +1 -1
  228. package/dist/assets/{resolve-three-TQ367RQD.js → resolve-three-Dhw2LtAp.js} +3 -3
  229. package/dist/assets/{root-seam-contract-CneTgNww.js → root-seam-contract-BFs0rvG9.js} +1 -1
  230. package/dist/assets/{run-selection-CNsOQTEG.js → run-selection-CEuu_sxz.js} +1 -1
  231. package/dist/assets/{scene-capture-KbdRgsD3.js → scene-capture-DgUSqWTB.js} +1 -1
  232. package/dist/assets/{scene-document.service-CmPSUocW.js → scene-document.service-BDDoO22G.js} +2 -2
  233. package/dist/assets/{scene-framing-B5JC4NeG.js → scene-framing-Dm-rCn3G.js} +1 -1
  234. package/dist/assets/{seeded-random-B6zqGkWP.js → seeded-random-C9256-Ag.js} +1 -1
  235. package/dist/assets/{setup-renderer-efjIBSGF.js → setup-renderer-CWvtkVDR.js} +1 -1
  236. package/dist/assets/{source-object3d-authoring-adapter-DeeboYub.js → source-object3d-authoring-adapter-ehtz9UK_.js} +1 -1
  237. package/dist/assets/{source-persistence-backend-Cwy93SmQ.js → source-persistence-backend-CbCbDOjd.js} +1 -1
  238. package/dist/assets/{stage-keyboard-GNCaTXLA.js → stage-keyboard-DiRyZTZd.js} +1 -1
  239. package/dist/assets/{stage-overlay-set-DV3SCzJb.js → stage-overlay-set-6pmCmKpX.js} +1 -1
  240. package/dist/assets/{stage-presence-markers-CBEU1Kzo.js → stage-presence-markers-mZPecAeK.js} +1 -1
  241. package/dist/assets/{stage-transform-tools-C9nNDW6n.js → stage-transform-tools-Qc0QjPrc.js} +1 -1
  242. package/dist/assets/{standard-viewport-dressing-BJkGwiNT.js → standard-viewport-dressing-BhTPIZTQ.js} +1 -1
  243. package/dist/assets/{state-watch.action-Doz_jrzS.js → state-watch.action-DJfW26od.js} +1 -1
  244. package/dist/assets/{state-watch.menu-Dj4DUUxN.js → state-watch.menu-B1GRE_HT.js} +1 -1
  245. package/dist/assets/{state-watch.utility-COPa8xpV.js → state-watch.utility-BQaTOFU-.js} +1 -1
  246. package/dist/assets/{story-capture-stRSY4PQ.js → story-capture-DZNUtuCH.js} +1 -1
  247. package/dist/assets/{story-documents-CYzWYY1o.js → story-documents-DArOiGNt.js} +1 -1
  248. package/dist/assets/{story-documents.service-DJBu4rve.js → story-documents.service-Bi89tZQ5.js} +1 -1
  249. package/dist/assets/{story-documents.service-C5r8KFEG.js → story-documents.service-DaPhxnzw.js} +1 -1
  250. package/dist/assets/{story-media-presence-D4AIsAtK.js → story-media-presence-CMJ7U-7_.js} +1 -1
  251. package/dist/assets/{story-pixi-preview-mPo3OFOd.js → story-pixi-preview-jmF1ab99.js} +1 -1
  252. package/dist/assets/{story-presentation-Dw4Vw65P.js → story-presentation-DNXF37vS.js} +1 -1
  253. package/dist/assets/{story-three-preview-CWM0Rj7x.js → story-three-preview-CH6Kk934.js} +2 -2
  254. package/dist/assets/{studio-environment-Bw9zMFE8.js → studio-environment-BNM-AjAn.js} +1 -1
  255. package/dist/assets/{surface-state-b_H4iOCJ.js → surface-state-BLuxJ4lb.js} +1 -1
  256. package/dist/assets/{syntactic-prop-specs-BCdwWi-T.js → syntactic-prop-specs-Coas9J4z.js} +1 -1
  257. package/dist/assets/{team-playtest.service-CnxdTghn.js → team-playtest.service-C3cEeDBv.js} +1 -1
  258. package/dist/assets/{three-DWy0sZom.js → three-BvhtsSAr.js} +1 -1
  259. package/dist/assets/{three-authoring-adapter-9LcUBPaU.js → three-authoring-adapter-K8a5THvW.js} +1 -1
  260. package/dist/assets/three-authoring.service-D-uSiCHc.js +2 -0
  261. package/dist/assets/{three-ingest-runtime-x9nLmUl-.js → three-ingest-runtime-QhrURliQ.js} +1 -1
  262. package/dist/assets/{three-integration-DB-xQHD5.js → three-integration-CaC8ivB7.js} +2 -2
  263. package/dist/assets/three-integration.service-BvTtbtlD.js +1 -0
  264. package/dist/assets/{three-projection-core-IUovHgg_.js → three-projection-core-C2Zj6hTy.js} +1 -1
  265. package/dist/assets/{three-state-_ImCbP87.js → three-state-cYB28OIz.js} +1 -1
  266. package/dist/assets/{three-story-capture.service-wKwfSnqA.js → three-story-capture.service-H2Z2O7Nz.js} +2 -2
  267. package/dist/assets/{three-story-model-BxWKcl9d.js → three-story-model-DVfgIOzi.js} +1 -1
  268. package/dist/assets/{three-viewport-presentation-Bg86EsDJ.js → three-viewport-presentation-DoViPvQB.js} +1 -1
  269. package/dist/assets/{transform-mode-request-BnV8FSnx.js → transform-mode-request-CflM_ccL.js} +1 -1
  270. package/dist/assets/{transport-strip-BZQnaxFN.js → transport-strip-DPoEy7PU.js} +1 -1
  271. package/dist/assets/transport.header-DdI58npA.js +1 -0
  272. package/dist/assets/{tuples-DR33sMq6.js → tuples-CA3u4T9B.js} +1 -1
  273. package/dist/assets/{ui-board-document-VJMvm6Ks.js → ui-board-document-CoKY7MDM.js} +2 -2
  274. package/dist/assets/{user-data-DL6HsBPf.js → user-data-CTT8ZvVB.js} +1 -1
  275. package/dist/assets/{utility-view-state-ghWXsYXq.js → utility-view-state-BaO3Fx_-.js} +1 -1
  276. package/dist/assets/{viewport-door-BV_lf5uK.js → viewport-door-BBtilr3V.js} +1 -1
  277. package/dist/assets/{viewport-root-presentation-CKqhX3mt.js → viewport-root-presentation-DmDBAZ8E.js} +1 -1
  278. package/dist/assets/{viewport-surface-status-D7M2L2lI.js → viewport-surface-status-BiDiAZ6z.js} +1 -1
  279. package/dist/assets/{webworkerAll-DDbFvxgB.js → webworkerAll-BCvjBZqG.js} +1 -1
  280. package/dist/assets/{workspace-arrangement-86_8Kk5K.js → workspace-arrangement-BXM0R-Uu.js} +1 -1
  281. package/dist/assets/{world-documents-DeNJUefV.js → world-documents-DGk_J8cp.js} +1 -1
  282. package/dist/assets/{world-root-stage-binding-VOrldLB4.js → world-root-stage-binding-KaIVpo80.js} +1 -1
  283. package/dist/assets/{xstate-animation-binding-747CfEeB.js → xstate-animation-binding-D_kxRsxS.js} +1 -1
  284. package/dist/assets/{xstate-animation-meta-DNMlMnr-.js → xstate-animation-meta-CX5oWqQv.js} +1 -1
  285. package/dist-node/cli.js +16 -16
  286. package/package.json +16 -16
  287. package/dist/assets/InspectorObjectPreview-C87CasN_.js +0 -1
  288. package/dist/assets/Object3DDocumentViewport-BpiyRQ5p.js +0 -2
  289. package/dist/assets/autoplay.service-CKBqjozr.js +0 -1
  290. package/dist/assets/instances.command-DzcXdKuG.js +0 -1
  291. package/dist/assets/network-observer.service-DyzpGKA7.js +0 -1
  292. package/dist/assets/three-authoring.service-DdTMF4A2.js +0 -2
  293. package/dist/assets/three-integration.service-DwToRGIc.js +0 -1
  294. package/dist/assets/transport.header-1SF4ZbEd.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/document-preview-three-Qni0oVBw.js","assets/content-bounds-Dl5Y3LLv.js","assets/hierarchy-marks-DeG4E4Ke.js","assets/workspace-arrangement-86_8Kk5K.js","assets/index-ClgrFOcX.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.core-3arARmh6.js","assets/editor-layers-DwaX5UFy.js","assets/renderer-ownership-BovSEcLv.js","assets/three.module-BLhyNg0e.js","assets/scene-framing-B5JC4NeG.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/standard-viewport-dressing-BJkGwiNT.js","assets/user-data-DL6HsBPf.js"])))=>i.map(i=>d[i]);
2
- import{hg as O,hh as dt,au as Q,aw as Kt,bi as zt,fV as It,bj as Vt,fW as St,av as tt,hi as Ht,al as g,eM as Zt,dT as Xt,hj as Wt,f5 as Ut,fg as X,dK as Yt,as as Mt,hk as qt,fn as Jt,gF as mt,eO as Qt,b9 as te,at as W,cC as Et,_ as A,hl as ee,hm as ne,Z as oe,hn as Z,ho as re,dv as se}from"./index-ClgrFOcX.js";import{a as m}from"./jsx-runtime-DPjLkJKQ.js";import{a as ie}from"./three-contract-Dkt6PmWY.js";import{a as ae}from"./object3d-document-session-registry-CADiW-LP.js";import{O as ce}from"./Object3DDocumentViewport-BpiyRQ5p.js";import{S as ue}from"./standard-viewport-dressing-BJkGwiNT.js";import{t as le}from"./viewport-surface-status-D7M2L2lI.js";import{r as w}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{withStoryMountTurn as vt,lastStoryMountPhaseTiming as de}from"./story-three-preview-CWM0Rj7x.js";import{m as me}from"./three-story-model-BxWKcl9d.js";import{c as pe}from"./content-bounds-Dl5Y3LLv.js";import{EDITOR_LAYER as he}from"./editor-layers-DwaX5UFy.js";import{setUserData as fe}from"./user-data-CODoGZqA.js";import{bh as R,co as Dt,K as xe,cx as ge,db as ye,cp as be,aI as we,N as Se,a$ as Me,c0 as Ee,b_ as ve,el as De,I as _e,fo as P,ex as Oe,cj as Pe}from"./three.core-3arARmh6.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./environment-Dg-YaLsA.js";import"./three.module-BLhyNg0e.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-DL6HsBPf.js";import"./workspace-arrangement-86_8Kk5K.js";import"./asset-preview-BUpxsHNd.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-DeG4E4Ke.js";import"./studio-environment-Bw9zMFE8.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./bitmap-label-Ct4k6ehY.js";import"./crash-null-boundary-v3a0uEgw.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./index-DzuOGwVB.js";import"./story-mount-turn-DFRTj5hi.js";import"./object-marks-BnvSuCTt.js";const L={neighbourGapFactor:.45,minGap:.5,districtGapFactor:.6,minDistrictGap:3},$=.7,Te={min:[0,0,0],max:[0,0,0]};function et(t){return[...t.min,...t.max].some(r=>!Number.isFinite(r))?Te:{min:[Math.min(t.min[0],t.max[0]),Math.min(t.min[1],t.max[1]),Math.min(t.min[2],t.max[2])],max:[Math.max(t.min[0],t.max[0]),Math.max(t.min[1],t.max[1]),Math.max(t.min[2],t.max[2])]}}function nt(t){return[t.max[0]-t.min[0],t.max[1]-t.min[1],t.max[2]-t.min[2]]}function pt(t){const e=nt(et(t));return e[0]*e[2]}function ke(t){return-et(t).min[1]}function _t(t){const e=Math.max(t[0],t[2]),r=Math.max(.15,.1*e);return[Math.max(t[0]+2*r,$),Math.max(t[2]+2*r,$)]}function Ot(t){return Math.max(t[0],t[1])}function Be(t){return t.map(e=>({item:e,bounds:et(e.bounds)})).sort((e,r)=>{const n=pt(e.bounds)-pt(r.bounds);return n!==0?n:e.item.id<r.item.id?-1:1})}function Re(t){const e=Math.max($,...t.map(({bounds:r})=>Ot(_t(nt(r)))));return Math.max(10,2.2*e)}function je(t,e,r){const n=Re(t),s=[];let o={slots:[],xEdge:0,depth:0,previousSpan:null};const i=()=>{o.slots.length>0&&s.push({slots:o.slots,xEdge:o.xEdge,depth:o.depth}),o={slots:[],xEdge:0,depth:0,previousSpan:null}};for(const{item:a,bounds:u}of t){const c=nt(u),l=_t(c),d=Ot(l),p=o.previousSpan===null?0:Math.max(r,e*Math.max(o.previousSpan,d));o.slots.length>0&&o.xEdge+p+l[0]>n&&i();const y=o.previousSpan===null?0:p,b=o.xEdge+y+l[0]/2;o.xEdge=b+l[0]/2,o.depth=Math.max(o.depth,l[1]),o.previousSpan=d,o.slots.push({item:a,bounds:u,size:c,footprint:l,centreX:b})}return i(),s}function ht(t,e,r,n,s){const o=je(e,n,s),i=[];let a=r,u=null,c=0;for(const l of o){u!==null&&(a+=Math.max(s,n*Math.max(u,l.depth)));const d=a+l.depth/2;a=d+l.depth/2,u=l.depth,c=Math.max(c,l.xEdge);for(const p of l.slots)i.push({id:p.item.id,groupKey:t,translation:[p.centreX-(p.bounds.min[0]+p.bounds.max[0])/2,ke(p.bounds),d-(p.bounds.min[2]+p.bounds.max[2])/2],anchor:[p.centreX,0,d],size:p.size,footprint:p.footprint})}return{placements:i,xEdge:c,depth:a-r}}function Ce(t){return Math.min(3,Math.max(.6,.08*t))}function Ne(t,e={}){const r=e.neighbourGapFactor??L.neighbourGapFactor,n=e.minGap??L.minGap,s=e.districtGapFactor??L.districtGapFactor,o=e.minDistrictGap??L.minDistrictGap,i=new Map;for(const d of t){const p=i.get(d.groupKey);p?p.push(d):i.set(d.groupKey,[d])}const a=[];let u=0,c=null;for(const d of i.keys()){const p=Be(i.get(d)??[]),y=ht(d,p,0,r,n),b=Ce(Math.max(y.depth,$)),x=y.depth+2*b;c!==null&&(u+=Math.max(o,s*Math.max(c,x)));const h=u;u=h+x,c=x;const{placements:v,xEdge:V}=ht(d,p,h+b,r,n),_={minX:-b,maxX:V+b,minZ:h,maxZ:h+x};a.push({groupKey:d,items:v,extent:_,anchor:[(_.minX+_.maxX)/2,0,_.minZ]})}const l=a.length===0?{minX:0,maxX:0,minZ:0,maxZ:0}:{minX:Math.min(...a.map(d=>d.extent.minX)),maxX:Math.max(...a.map(d=>d.extent.maxX)),minZ:Math.min(...a.map(d=>d.extent.minZ)),maxZ:Math.max(...a.map(d=>d.extent.maxZ))};return{districts:a,extent:l}}const Pt={min:[0,0,0],max:[0,0,0]},Ae=.35,ft=20;function ot(t){return[...t.min,...t.max].every(e=>Number.isFinite(e))}function z(t){return ot(t)?{min:[Math.min(t.min[0],t.max[0]),Math.min(t.min[1],t.max[1]),Math.min(t.min[2],t.max[2])],max:[Math.max(t.min[0],t.max[0]),Math.max(t.min[1],t.max[1]),Math.max(t.min[2],t.max[2])]}:Pt}function Tt(t){const e=z(t);return[e.max[0]-e.min[0],e.max[1]-e.min[1],e.max[2]-e.min[2]]}function K(t){const e=t.map(z).filter(o=>ot(o));if(e.length===0)return Pt;const r=e[0],n=[r.min[0],r.min[1],r.min[2]],s=[r.max[0],r.max[1],r.max[2]];for(let o=1;o<e.length;o++){const i=e[o];n[0]=Math.min(n[0],i.min[0]),n[1]=Math.min(n[1],i.min[1]),n[2]=Math.min(n[2],i.min[2]),s[0]=Math.max(s[0],i.max[0]),s[1]=Math.max(s[1],i.max[1]),s[2]=Math.max(s[2],i.max[2])}return{min:n,max:s}}function U(t,e){const r=z(t);return{min:[r.min[0]+e[0],r.min[1]+e[1],r.min[2]+e[2]],max:[r.max[0]+e[0],r.max[1]+e[1],r.max[2]+e[2]]}}function Le(t){return"min"in t?{bounds:t}:{bounds:t.bounds,...t.overlay===!0?{overlay:!0}:{},...t.enclosure===!0?{enclosure:!0}:{}}}function Ge(t,e={}){if(e.overlay)return"volume";if(e.enclosure)return"environment-scale";const n=[...Tt(t)].sort((a,u)=>u-a),s=n[0]??0,o=n[1]??0;return(n[2]??0)<Ae&&o>=ft&&s>=ft?"unbounded-plane":null}function Fe(t){const e=t.map(Le).map(a=>({bounds:z(a.bounds),overlay:a.overlay===!0,enclosure:a.enclosure===!0})).filter(a=>ot(a.bounds)),r=e.map(a=>a.bounds),n=K(r);if(e.length<2)return{full:n,presence:n,helpers:[]};const s=e.map(a=>Ge(a.bounds,{overlay:a.overlay,enclosure:a.enclosure})),o=e.filter((a,u)=>s[u]===null).map(a=>a.bounds);if(o.length===0)return{full:n,presence:n,helpers:[]};const i=[];for(let a=0;a<e.length;a++){const u=s[a]??null;u!==null&&i.push({kind:u,bounds:e[a].bounds,size:Tt(e[a].bounds)})}return{full:n,presence:K(o),helpers:i}}function $e(t){const e=t.map(u=>({exhibit:u,presence:Fe(u.nodes)})),r=e.map(({exhibit:u,presence:c})=>({id:u.id,groupKey:u.groupKey,bounds:c.presence})),n=Ne(r),s=new Map;for(const u of n.districts)for(const c of u.items)s.set(c.id,c);const o=[],i=[],a=[];for(const{exhibit:u,presence:c}of e){const l=s.get(u.id);l&&(o.push({id:u.id,groupKey:u.groupKey,full:c.full,presence:c.presence,helpers:c.helpers,placement:l}),i.push(U(c.presence,l.translation)),a.push(U(c.full,l.translation)))}return{layout:n,exhibits:o,frame:K(i),fullFrame:K(a)}}const kt="volterBoardStoryId",Bt="volterBoardComponentKey",I="volter:board:no-story";function Ke(t){return{stories:t.length,modules:new Set(t.map(e=>e.modulePath)).size}}const Y="Ungrouped",xt="No story yet",ze=.9;function Ie(t){return t instanceof Error?t.message:String(t)}async function Ve(t,e,r){const n=Date.now();let s=null,o=null;try{s=await r(e),me(s.root)||(s.dispose(),s=null,o="The story mounted no three content.")}catch(a){o=Ie(a)}const i=de();return Ht({id:t.id,ms:Date.now()-n,runtimeMs:i?.runtimeMs??0,loadMs:i?.loadMs??0,fiberMs:i?.fiberMs??0,settleMs:i?.settleMs??0,ok:s!==null}),{identity:t,mounted:s,reason:o}}function Rt(t){t.traverse(e=>{e.layers.enable(he),fe(e,"editorHelper",!0)})}const He={color:3291977,roughness:.92,metalness:.04,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:2},gt=.06,Ze=0,yt=0,Xe=11124182,We=9413565;function Ue(t){const e=t.extent.maxX-t.extent.minX,r=t.extent.maxZ-t.extent.minZ,n=new Dt(new xe(e,gt,r),new ge(He));return n.name=`volter:board-pad:${t.groupKey||Y}`,n.position.set((t.extent.minX+t.extent.maxX)/2,Ze-gt/2,(t.extent.minZ+t.extent.maxZ)/2),n.receiveShadow=!0,Rt(n),n}function Ye(t,e){const r=t/2,n=e/2,s=[[-r,-n],[r,-n],[r,n],[-r,n]],o=[];for(let u=0;u<s.length;u++){const c=s[u],l=s[(u+1)%s.length];o.push(c[0],0,c[1],l[0],0,l[1])}const i=new Se;i.setAttribute("position",new Me(o,3));const a=new Ee(i,new ve({color:Xe,dashSize:.09,gapSize:.06}));return a.computeLineDistances(),a}function qe(t){const e=new R;e.name=`volter:board-ghost:${t.name}`,e.userData[Bt]=t.key;const[r,n]=t.placement.footprint,s=new Dt(new ye(r,n),new be({color:We,transparent:!0,opacity:.1,depthWrite:!1,side:we}));s.rotation.x=-Math.PI/2,s.position.y=yt;const o=Ye(r,n);return o.position.y=yt,e.add(s,o),e.position.set(t.placement.anchor[0],0,t.placement.anchor[2]),e}function Je(t,e,r){if(!r.componentName)return!0;const n=St(t,r.componentName,e);return!n||n.modulePath===e&&n.name===r.name}function Qe(t){return jt(t).length}function jt(t){const e=[],r=new Map,n=tt();for(const s of t)if(s.ok)for(const o of s.stories){const i=Q({modulePath:s.modulePath,regions:n});if(i.medium!=="three"){i.via==="undeclared"&&Kt(s.modulePath,i.reason);continue}if(!Je(t,s.modulePath,o))continue;const a=zt({modulePath:s.modulePath,...o.title===void 0?{}:{title:o.title}}),u=It(a),c=`${u}/${a.leaf}`;r.set(c,(r.get(c)??0)+1),e.push({identity:{id:`${s.modulePath}#${o.name}`,storyName:o.name,modulePath:s.modulePath,groupKey:u,groupLeaf:a.leaf,groupPath:Vt(a)},storyLabel:o.label,Component:o.Component})}return e.map(({identity:s,storyLabel:o,Component:i})=>({identity:{...s,label:(r.get(`${s.groupKey}/${s.groupLeaf}`)??0)>1?`${s.groupLeaf} · ${o}`:s.groupLeaf},Component:i}))}function tn(t,e){const r=new Set,n=[];for(const s of e){if(s.surface!=="three"||s.contentKind==="image")continue;const o=`${s.path}#${s.name}`;r.has(o)||(r.add(o),!St(t,s.name,s.path)&&n.push(s))}return n}function en(t,e,r){const n=new R;return n.name=`volter:board-exhibit:${t.label}`,n.position.set(...e.translation),n.add(r.root),n.userData[kt]=t.id,n}function q(t){return vt(async()=>{t.dispose()})}async function Ct(t,e=[],r){return vt(n=>an(t,e,r,n))}async function nn(t,e,r){const n=[];for(const{identity:s,Component:o}of t){if(e?.aborted)break;n.push(await Ve(s,o,r))}return n}function on(t){return{min:t.min.toArray(),max:t.max.toArray()}}function rn(t){const e=new Map,r=new Map,n=[],s=[];for(const o of t){if(!o.mounted){s.push({id:o.identity.id,modulePath:o.identity.modulePath,storyName:o.identity.storyName,reason:o.reason??"The story produced no Object3D."});continue}const i=pe(o.mounted.root).map(a=>({bounds:on(a.box),overlay:a.overlay,enclosure:a.enclosure}));e.set(o.identity.id,o.mounted),r.set(o.identity.id,o.identity),n.push({id:o.identity.id,groupKey:o.identity.groupKey,nodes:i})}return{mounts:e,identities:r,measures:n,skipped:s}}function sn(t){const e=ze/2;return{id:`${t.path}#${t.name}`,groupKey:I,nodes:[{min:[-e,0,-e],max:[e,0,e]}]}}async function an(t,e,r,n){const s=Date.now(),o=jt(t);O("candidate-collect",Date.now()-s),dt({candidateCount:o.length});const i=Date.now(),a=await nn(o,r,n);O("story-mounts",Date.now()-i);const u=Date.now(),{mounts:c,identities:l,measures:d,skipped:p}=rn(a);O("bounds",Date.now()-u);const y=Date.now(),b=tn(t,e),x=new Map(b.map(f=>[`${f.path}#${f.name}`,f])),h=$e([...d,...b.map(sn)]),v=h.layout,V=new Map(h.exhibits.map(f=>[f.id,f]));O("layout",Date.now()-y);const _=Date.now(),T=new R;T.name="volter:three-board";const k=new R;k.name="volter:board-chrome",Rt(k),T.add(k);const j=[],rt=[],st=[],it=[k];for(const f of v.districts){const M=f.groupKey===I,D=new R;D.name=`volter:board-district:${M?xt:f.groupKey||Y}`,T.add(D),k.add(Ue(f));for(const S of f.items){if(M){const N=x.get(S.id);if(!N)continue;const ut={key:S.id,name:N.name,path:N.path,line:N.line,placement:S},lt=qe(ut);D.add(lt),it.push(lt),st.push(ut);continue}const C=c.get(S.id),H=l.get(S.id),E=V.get(S.id);!C||!H||!E||(D.add(en(H,S,C)),j.push({...H,placement:S,fullSize:[E.full.max[0]-E.full.min[0],E.full.max[1]-E.full.min[1],E.full.max[2]-E.full.min[2]],helpers:E.helpers}))}rt.push({groupKey:f.groupKey,label:M?xt:f.groupKey||Y,placement:f})}const $t=j.flatMap(f=>f.helpers.map(M=>({exhibitId:f.id,exhibitLabel:f.label,kind:M.kind,size:M.size})));let at=!1;const ct={root:T,exhibits:j,districts:rt,ghostSlots:st,skipped:p,frameBounds:h.frame,openingFrameBounds:h.exhibits[0]?U(h.exhibits[0].presence,h.exhibits[0].placement.translation):h.frame,helperVolumes:$t,dispose(){if(!at){at=!0;for(const f of it)f.traverse(M=>{const D=M;D.geometry?.dispose();const S=D.material;if(Array.isArray(S))for(const C of S)C.dispose();else S?.dispose()}),f.removeFromParent();for(const f of c.values())try{f.dispose()}catch(M){console.error("[three-board] a story mount failed to dispose.",M)}c.clear(),T.clear()}}};if(O("assemble",Date.now()-_),dt({exhibitCount:j.length,skippedCount:p.length}),r?.aborted)throw ct.dispose(),new Error("The 3D board build was superseded by a newer one.");return ct}function cn(t){return Nt(t,kt)}function un(t){return Nt(t,Bt)}function Nt(t,e){let r=t;for(;r;){const n=r.userData[e];if(typeof n=="string")return n;r=r.parent}return null}const At="3D";let F=null,Lt=0;const J=new Set;function bt(){Lt++;for(const t of J)t()}function ln(t){return J.add(t),()=>{J.delete(t)}}function dn(){return Lt}function Gt(t){return Number.isFinite(t)?t>=10?`${Math.round(t)} m`:t>=1?`${t.toFixed(1)} m`:`${t.toFixed(2)} m`:"—"}function mn(t,e,r){const n=Ft(e,r);return n?qt(Jt,t,{modulePath:n.modulePath,storyName:n.storyName,title:n.label}):null}function pn(t,e,r){const n=Mn(t,e);if(!n)return null;const s={definitionLocation:()=>({file:n.path,line:n.line})};return r?mt(s,n.key,"definition",r):mt(s,n.key,"definition")}function hn(t){const e=tt(),r=t.filter(o=>o.ok&&Q({modulePath:o.modulePath,regions:e}).medium==="three"),n=w.useRef([]),s=n.current;return(s.length!==r.length||s.some((o,i)=>o!==r[i]))&&(n.current=r),n.current}function fn({documentId:t,active:e,store:r}){const n=w.useSyncExternalStore(Mt,W),s=hn(n),[o,i]=w.useState({status:"idle"});e&&ee(t);const[a,u]=w.useState(e);w.useEffect(()=>{e&&u(!0)},[e]),w.useEffect(()=>{if(!a)return;const p=new AbortController;let y=null;i({status:"building"}),ne(t,{modulesAlreadyLoaded:s.length>0});const b=Date.now();return Et().then(x=>{const h=Date.now()-b;return O("component-index",h,{busyMs:0,waitMs:h}),x.ok||oe.warn(`Component index unavailable, so this board shows no ghost slots: ${x.reason}`,"three-board"),Ct(s,x.ok?x.entries:[],p.signal)}).then(x=>{if(p.signal.aborted){Z(t),q(x);return}y=x,F=x,bt(),re(),i({status:"ready",scene:x})},x=>{if(p.signal.aborted){Z(t);return}i({status:"error",message:x instanceof Error?x.message:String(x)})}),()=>{p.abort(),y?(F===y&&(F=null),q(y),bt()):Z(t)}},[s,a,t]);const c=o.status==="ready"?o.scene:null,l=w.useCallback(()=>{if(!c)throw new Error("The 3D board is still building.");return{root:c.root,dispose(){}}},[c]),d=w.useCallback(p=>{if(mn(r,c,p)!==null)return;const y=pn(c,p);y&&y.then(se)},[c,r]);return m.jsx("div",{style:{position:"relative",flex:1,minHeight:0,pointerEvents:"auto"},children:c?m.jsxs(m.Fragment,{children:[m.jsx(ce,{documentId:t,sourcePath:"Generated from this project’s stories",displayName:At,build:l,active:e,onOpenNode:d,cameraDirection:ue,frameBounds:c.frameBounds,openingFrameBounds:c.openingFrameBounds,dressing:{grid:!0}}),m.jsx(gn,{documentId:t,scene:c,active:e}),m.jsx(xn,{scene:c})]}):m.jsxs("div",{"data-testid":"three-board-status",style:{padding:16,fontSize:12,color:g.content.muted},children:[o.status==="error"&&o.message,o.status==="building"&&le(Qe(s)),o.status==="idle"&&"Open this tab to lay out every story at true scale."]})})}function xn({scene:t}){const[e,r]=w.useState(!1),n=Ke(t.skipped),s=t.districts.filter(o=>o.groupKey!==I).length;return m.jsxs("div",{"data-testid":"three-board-status",style:{position:"absolute",left:8,bottom:8,maxWidth:420,padding:"4px 8px",borderRadius:g.shape.small,background:g.surface.raised,border:`1px solid ${g.boundary.default}`,fontSize:10,color:g.content.muted,pointerEvents:"auto"},children:[t.exhibits.length," exhibit",t.exhibits.length===1?"":"s"," · ",s," ","district",s===1?"":"s",t.helperVolumes.length>0&&m.jsxs(m.Fragment,{children:[" · ",t.helperVolumes.length," helper volume",t.helperVolumes.length===1?"":"s"," at true scale, outside the default frame"]}),t.ghostSlots.length>0&&m.jsxs(m.Fragment,{children:[" · ",t.ghostSlots.length," component",t.ghostSlots.length===1?"":"s"," without stories"]}),t.skipped.length>0&&m.jsxs(m.Fragment,{children:[" · ",m.jsxs("span",{role:"button",tabIndex:0,"aria-expanded":e,onClick:()=>r(o=>!o),onKeyDown:o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),r(i=>!i))},style:{cursor:"pointer",color:g.accent.default},children:[n.stories," ",n.stories===1?"story":"stories"," in ",n.modules," ",n.modules===1?"module":"modules"," not on this board"]})]}),e&&m.jsx("div",{style:{marginTop:4,maxHeight:160,overflow:"auto"},children:t.skipped.map(o=>m.jsxs("div",{style:{padding:"1px 0"},children:[m.jsxs("code",{style:{color:g.content.dim},children:[o.modulePath,"#",o.storyName]})," ","— ",o.reason]},o.id))})]})}function gn({documentId:t,scene:e,active:r}){const n=w.useRef(null),[s,o]=w.useState([]);return w.useEffect(()=>{if(!r)return;let i=0,a=!1;const u=yn(e),c=()=>{if(a)return;i=requestAnimationFrame(c);const l=n.current,d=ae(t);!l||!d||l.clientWidth===0||l.clientHeight===0||o(bn(u,d.camera(),l.clientWidth,l.clientHeight))};return i=requestAnimationFrame(c),()=>{a=!0,cancelAnimationFrame(i)}},[r,t,e]),m.jsx("div",{ref:n,"data-testid":"three-board-labels",style:{position:"absolute",inset:-12,pointerEvents:"none",overflow:"hidden"},children:s.map(i=>m.jsxs("div",{style:{position:"absolute",left:i.x,top:i.y,transform:"translate(-50%, -100%)",whiteSpace:"nowrap",padding:i.district?"2px 7px":"1px 5px",borderRadius:g.shape.small,background:g.surface.raised,border:`1px ${i.ghost?"dashed":"solid"} ${i.district&&!i.ghost?g.accent.default:g.boundary.default}`,color:i.district&&!i.ghost?g.content.primary:g.content.muted,fontSize:i.district?12:10,fontWeight:i.district?600:400,opacity:i.ghost?.9:1},children:[i.text,m.jsx("span",{style:{marginLeft:6,color:g.content.dim,fontWeight:400},children:i.detail})]},i.key))})}const B=new P;function wt(t){return[t.anchor[0],0,t.anchor[2]-t.footprint[1]/2]}function yn(t){return[...t.districts.map(e=>{const r=e.groupKey===I,n=e.placement.items.length;return{key:`district:${e.groupKey}`,text:e.label,detail:r?`${n} component${n===1?"":"s"}`:`${n} exhibit${n===1?"":"s"}`,district:!0,ghost:r,point:e.placement.anchor}}),...t.exhibits.map(e=>({key:`exhibit:${e.id}`,text:e.label,detail:Gt(e.placement.size[1]),district:!1,ghost:!1,point:wt(e.placement)})),...t.ghostSlots.map(e=>({key:`ghost:${e.key}`,text:e.name,detail:"No story yet",district:!1,ghost:!0,point:wt(e.placement)}))]}function bn(t,e,r,n){e.updateMatrixWorld();const s=[];for(const o of t)B.set(o.point[0],o.point[1],o.point[2]).project(e),!(B.z>1)&&s.push({key:o.key,text:o.text,detail:o.detail,district:o.district,ghost:o.ghost,x:(B.x*.5+.5)*r,y:(-B.y*.5+.5)*n,depth:B.z});return Sn(s).sort((o,i)=>i.depth-o.depth)}function wn(t){const e=t.district?12:10,r=(t.text.length+t.detail.length)*e*.62+24,n=e+8;return[t.x-r/2,t.y-n,t.x+r/2,t.y]}function Sn(t){const e=[...t].sort((n,s)=>(s.district?1:0)-(n.district?1:0)||n.depth-s.depth),r=[];for(const n of e){const s=wn(n);r.some(i=>s[0]<i.rect[2]&&s[2]>i.rect[0]&&s[1]<i.rect[3]&&s[3]>i.rect[1])||r.push({label:n,rect:s})}return r.map(n=>n.label)}function Ft(t,e){if(!t)return null;const r=cn(e);return r?t.exhibits.find(n=>n.id===r)??null:null}function Mn(t,e){if(!t)return null;const r=un(e);return r?t.ghostSlots.find(n=>n.key===r)??null:null}function En({adapter:t,nodeId:e}){w.useSyncExternalStore(ln,dn);const n=[...e?[e]:[],...t.selection?.get()??[]].reduce((s,o)=>s??Ft(F,ie(t.hierarchy,o)),null);return m.jsx("div",{"data-testid":"inspector-exhibit",style:{pointerEvents:"auto",padding:8,borderBottom:`1px solid ${g.boundary.default}`},children:n?m.jsxs("div",{style:{display:"grid",gap:3,fontSize:11},children:[m.jsx("div",{style:{color:g.content.primary,fontWeight:600},children:n.label}),m.jsx(G,{label:"Story",value:n.storyName}),m.jsx(G,{label:"Group",value:n.groupPath}),m.jsx(G,{label:"Module",value:n.modulePath}),m.jsx(G,{label:"Size",value:n.placement.size.map(s=>Gt(s)).join(" × ")})]}):m.jsx("div",{style:{fontSize:11,color:g.content.dim},children:"Pick an exhibit to read its story."})})}function G({label:t,value:e}){return m.jsxs("div",{style:{display:"flex",gap:6},children:[m.jsx("span",{style:{width:52,flexShrink:0,color:g.content.muted},children:t}),m.jsx("code",{style:{color:g.content.primary,overflow:"hidden",textOverflow:"ellipsis"},title:e,children:e})]})}const vn=Qt();function Dn(){vn.ensure(t=>{t(Zt({match:()=>Ut()?.descriptor.id===X,id:"exhibit",title:"Exhibit",icon:Wt,order:Xt,Section:En}))})}const _n={revision:()=>JSON.stringify(W().map(t=>t.modulePath)),subscribe:Mt,capture:async t=>{await te();const e=tt(),r=W().filter(o=>o.ok&&Q({modulePath:o.modulePath,regions:e}).medium==="three"),n=await Et(),s=await Ct(r,n.ok?n.entries:[]);try{const{captureAuthoredThreeScenePreview:o}=await A(async()=>{const{captureAuthoredThreeScenePreview:h}=await import("./document-preview-three-Qni0oVBw.js");return{captureAuthoredThreeScenePreview:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),{createStandardEnvironment:i}=await A(async()=>{const{createStandardEnvironment:h}=await import("./environment-Dg-YaLsA.js");return{createStandardEnvironment:h}},__vite__mapDeps([19,17,14,20,21,22])),{applyStandardViewportDressing:a}=await A(async()=>{const{applyStandardViewportDressing:h}=await import("./standard-viewport-dressing-BJkGwiNT.js").then(v=>v.d);return{applyStandardViewportDressing:h}},__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,19,17,20,21,22,24])),{isEditorOwnedObject:u}=await A(async()=>{const{isEditorOwnedObject:h}=await import("./editor-layers-DwaX5UFy.js");return{isEditorOwnedObject:h}},__vite__mapDeps([15,3,4,5,6,7,8,9,10,11,12,13]));s.root.traverse(h=>{u(h)&&(h.visible=!1)});const c=new De;c.add(s.root);const l=new _e(new P(...s.frameBounds.min),new P(...s.frameBounds.max)),d=l.isEmpty()?new P:l.getCenter(new P),y=(l.isEmpty()?1:Math.max(.01,l.getBoundingSphere(new Oe).radius))/Math.sin(Pe.degToRad(42/2))*1.15,b=d.clone().addScaledVector(new P(1,.75,1).normalize(),y),x={...t,camera:{position:b,target:d,fov:42}};return o(s.root,c,x,h=>{const v=a(c,{environment:i(h),background:!1});return()=>v.dispose()})}finally{await q(s)}}};function ho(t){return Dn(),Yt({id:X,title:At,kind:"content-browser",workspaceRole:"workspace-reference",Content:e=>m.jsx(fn,{...e,store:t}),readOnly:!0,preview:_n,presentation:()=>({kind:"workspace",id:X})},{category:"canvas"})}export{En as BoardExhibitSection,X as THREE_COMPONENTS_DOCUMENT_ID,Dn as ensureThreeBoardContributionsRegistered,ho as installThreeBoardDocument,mn as openExhibitStoryDocument,pn as openGhostComponentSource};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/document-preview-three-DxAxdZRF.js","assets/content-bounds-BRS42hfD.js","assets/hierarchy-marks-C2temlO0.js","assets/workspace-arrangement-BXM0R-Uu.js","assets/index-BfqJPhFO.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.core-3arARmh6.js","assets/editor-layers-k0AjpomL.js","assets/renderer-ownership-BovSEcLv.js","assets/three.module-BLhyNg0e.js","assets/scene-framing-Dm-rCn3G.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/standard-viewport-dressing-BhTPIZTQ.js","assets/user-data-CTT8ZvVB.js"])))=>i.map(i=>d[i]);
2
+ import{hg as O,hh as dt,au as Q,aw as Kt,bi as zt,fV as It,bj as Vt,fW as St,av as tt,hi as Ht,al as g,eM as Zt,dT as Xt,hj as Wt,f5 as Ut,fg as X,dK as Yt,as as Mt,hk as qt,fn as Jt,gF as mt,eO as Qt,b9 as te,at as W,cC as Et,_ as A,hl as ee,hm as ne,Z as oe,hn as Z,ho as re,dv as se}from"./index-BfqJPhFO.js";import{a as m}from"./jsx-runtime-DPjLkJKQ.js";import{a as ie}from"./three-contract-Dkt6PmWY.js";import{a as ae}from"./object3d-document-session-registry-CLizyhis.js";import{O as ce}from"./Object3DDocumentViewport-BOi94JfA.js";import{S as ue}from"./standard-viewport-dressing-BhTPIZTQ.js";import{t as le}from"./viewport-surface-status-BiDiAZ6z.js";import{r as w}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{withStoryMountTurn as vt,lastStoryMountPhaseTiming as de}from"./story-three-preview-CH6Kk934.js";import{m as me}from"./three-story-model-DVfgIOzi.js";import{c as pe}from"./content-bounds-BRS42hfD.js";import{EDITOR_LAYER as he}from"./editor-layers-k0AjpomL.js";import{setUserData as fe}from"./user-data-CODoGZqA.js";import{bh as R,co as Dt,K as xe,cx as ge,db as ye,cp as be,aI as we,N as Se,a$ as Me,c0 as Ee,b_ as ve,el as De,I as _e,fo as P,ex as Oe,cj as Pe}from"./three.core-3arARmh6.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./environment-Dg-YaLsA.js";import"./three.module-BLhyNg0e.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-CTT8ZvVB.js";import"./workspace-arrangement-BXM0R-Uu.js";import"./asset-preview-t-7PYPjJ.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-C2temlO0.js";import"./studio-environment-BNM-AjAn.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./bitmap-label-Ct4k6ehY.js";import"./crash-null-boundary-v3a0uEgw.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./index-DzuOGwVB.js";import"./story-mount-turn-DFRTj5hi.js";import"./object-marks-BnvSuCTt.js";const L={neighbourGapFactor:.45,minGap:.5,districtGapFactor:.6,minDistrictGap:3},$=.7,Te={min:[0,0,0],max:[0,0,0]};function et(t){return[...t.min,...t.max].some(r=>!Number.isFinite(r))?Te:{min:[Math.min(t.min[0],t.max[0]),Math.min(t.min[1],t.max[1]),Math.min(t.min[2],t.max[2])],max:[Math.max(t.min[0],t.max[0]),Math.max(t.min[1],t.max[1]),Math.max(t.min[2],t.max[2])]}}function nt(t){return[t.max[0]-t.min[0],t.max[1]-t.min[1],t.max[2]-t.min[2]]}function pt(t){const e=nt(et(t));return e[0]*e[2]}function ke(t){return-et(t).min[1]}function _t(t){const e=Math.max(t[0],t[2]),r=Math.max(.15,.1*e);return[Math.max(t[0]+2*r,$),Math.max(t[2]+2*r,$)]}function Ot(t){return Math.max(t[0],t[1])}function Be(t){return t.map(e=>({item:e,bounds:et(e.bounds)})).sort((e,r)=>{const n=pt(e.bounds)-pt(r.bounds);return n!==0?n:e.item.id<r.item.id?-1:1})}function Re(t){const e=Math.max($,...t.map(({bounds:r})=>Ot(_t(nt(r)))));return Math.max(10,2.2*e)}function je(t,e,r){const n=Re(t),s=[];let o={slots:[],xEdge:0,depth:0,previousSpan:null};const i=()=>{o.slots.length>0&&s.push({slots:o.slots,xEdge:o.xEdge,depth:o.depth}),o={slots:[],xEdge:0,depth:0,previousSpan:null}};for(const{item:a,bounds:u}of t){const c=nt(u),l=_t(c),d=Ot(l),p=o.previousSpan===null?0:Math.max(r,e*Math.max(o.previousSpan,d));o.slots.length>0&&o.xEdge+p+l[0]>n&&i();const y=o.previousSpan===null?0:p,b=o.xEdge+y+l[0]/2;o.xEdge=b+l[0]/2,o.depth=Math.max(o.depth,l[1]),o.previousSpan=d,o.slots.push({item:a,bounds:u,size:c,footprint:l,centreX:b})}return i(),s}function ht(t,e,r,n,s){const o=je(e,n,s),i=[];let a=r,u=null,c=0;for(const l of o){u!==null&&(a+=Math.max(s,n*Math.max(u,l.depth)));const d=a+l.depth/2;a=d+l.depth/2,u=l.depth,c=Math.max(c,l.xEdge);for(const p of l.slots)i.push({id:p.item.id,groupKey:t,translation:[p.centreX-(p.bounds.min[0]+p.bounds.max[0])/2,ke(p.bounds),d-(p.bounds.min[2]+p.bounds.max[2])/2],anchor:[p.centreX,0,d],size:p.size,footprint:p.footprint})}return{placements:i,xEdge:c,depth:a-r}}function Ce(t){return Math.min(3,Math.max(.6,.08*t))}function Ne(t,e={}){const r=e.neighbourGapFactor??L.neighbourGapFactor,n=e.minGap??L.minGap,s=e.districtGapFactor??L.districtGapFactor,o=e.minDistrictGap??L.minDistrictGap,i=new Map;for(const d of t){const p=i.get(d.groupKey);p?p.push(d):i.set(d.groupKey,[d])}const a=[];let u=0,c=null;for(const d of i.keys()){const p=Be(i.get(d)??[]),y=ht(d,p,0,r,n),b=Ce(Math.max(y.depth,$)),x=y.depth+2*b;c!==null&&(u+=Math.max(o,s*Math.max(c,x)));const h=u;u=h+x,c=x;const{placements:v,xEdge:V}=ht(d,p,h+b,r,n),_={minX:-b,maxX:V+b,minZ:h,maxZ:h+x};a.push({groupKey:d,items:v,extent:_,anchor:[(_.minX+_.maxX)/2,0,_.minZ]})}const l=a.length===0?{minX:0,maxX:0,minZ:0,maxZ:0}:{minX:Math.min(...a.map(d=>d.extent.minX)),maxX:Math.max(...a.map(d=>d.extent.maxX)),minZ:Math.min(...a.map(d=>d.extent.minZ)),maxZ:Math.max(...a.map(d=>d.extent.maxZ))};return{districts:a,extent:l}}const Pt={min:[0,0,0],max:[0,0,0]},Ae=.35,ft=20;function ot(t){return[...t.min,...t.max].every(e=>Number.isFinite(e))}function z(t){return ot(t)?{min:[Math.min(t.min[0],t.max[0]),Math.min(t.min[1],t.max[1]),Math.min(t.min[2],t.max[2])],max:[Math.max(t.min[0],t.max[0]),Math.max(t.min[1],t.max[1]),Math.max(t.min[2],t.max[2])]}:Pt}function Tt(t){const e=z(t);return[e.max[0]-e.min[0],e.max[1]-e.min[1],e.max[2]-e.min[2]]}function K(t){const e=t.map(z).filter(o=>ot(o));if(e.length===0)return Pt;const r=e[0],n=[r.min[0],r.min[1],r.min[2]],s=[r.max[0],r.max[1],r.max[2]];for(let o=1;o<e.length;o++){const i=e[o];n[0]=Math.min(n[0],i.min[0]),n[1]=Math.min(n[1],i.min[1]),n[2]=Math.min(n[2],i.min[2]),s[0]=Math.max(s[0],i.max[0]),s[1]=Math.max(s[1],i.max[1]),s[2]=Math.max(s[2],i.max[2])}return{min:n,max:s}}function U(t,e){const r=z(t);return{min:[r.min[0]+e[0],r.min[1]+e[1],r.min[2]+e[2]],max:[r.max[0]+e[0],r.max[1]+e[1],r.max[2]+e[2]]}}function Le(t){return"min"in t?{bounds:t}:{bounds:t.bounds,...t.overlay===!0?{overlay:!0}:{},...t.enclosure===!0?{enclosure:!0}:{}}}function Ge(t,e={}){if(e.overlay)return"volume";if(e.enclosure)return"environment-scale";const n=[...Tt(t)].sort((a,u)=>u-a),s=n[0]??0,o=n[1]??0;return(n[2]??0)<Ae&&o>=ft&&s>=ft?"unbounded-plane":null}function Fe(t){const e=t.map(Le).map(a=>({bounds:z(a.bounds),overlay:a.overlay===!0,enclosure:a.enclosure===!0})).filter(a=>ot(a.bounds)),r=e.map(a=>a.bounds),n=K(r);if(e.length<2)return{full:n,presence:n,helpers:[]};const s=e.map(a=>Ge(a.bounds,{overlay:a.overlay,enclosure:a.enclosure})),o=e.filter((a,u)=>s[u]===null).map(a=>a.bounds);if(o.length===0)return{full:n,presence:n,helpers:[]};const i=[];for(let a=0;a<e.length;a++){const u=s[a]??null;u!==null&&i.push({kind:u,bounds:e[a].bounds,size:Tt(e[a].bounds)})}return{full:n,presence:K(o),helpers:i}}function $e(t){const e=t.map(u=>({exhibit:u,presence:Fe(u.nodes)})),r=e.map(({exhibit:u,presence:c})=>({id:u.id,groupKey:u.groupKey,bounds:c.presence})),n=Ne(r),s=new Map;for(const u of n.districts)for(const c of u.items)s.set(c.id,c);const o=[],i=[],a=[];for(const{exhibit:u,presence:c}of e){const l=s.get(u.id);l&&(o.push({id:u.id,groupKey:u.groupKey,full:c.full,presence:c.presence,helpers:c.helpers,placement:l}),i.push(U(c.presence,l.translation)),a.push(U(c.full,l.translation)))}return{layout:n,exhibits:o,frame:K(i),fullFrame:K(a)}}const kt="volterBoardStoryId",Bt="volterBoardComponentKey",I="volter:board:no-story";function Ke(t){return{stories:t.length,modules:new Set(t.map(e=>e.modulePath)).size}}const Y="Ungrouped",xt="No story yet",ze=.9;function Ie(t){return t instanceof Error?t.message:String(t)}async function Ve(t,e,r){const n=Date.now();let s=null,o=null;try{s=await r(e),me(s.root)||(s.dispose(),s=null,o="The story mounted no three content.")}catch(a){o=Ie(a)}const i=de();return Ht({id:t.id,ms:Date.now()-n,runtimeMs:i?.runtimeMs??0,loadMs:i?.loadMs??0,fiberMs:i?.fiberMs??0,settleMs:i?.settleMs??0,ok:s!==null}),{identity:t,mounted:s,reason:o}}function Rt(t){t.traverse(e=>{e.layers.enable(he),fe(e,"editorHelper",!0)})}const He={color:3291977,roughness:.92,metalness:.04,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:2},gt=.06,Ze=0,yt=0,Xe=11124182,We=9413565;function Ue(t){const e=t.extent.maxX-t.extent.minX,r=t.extent.maxZ-t.extent.minZ,n=new Dt(new xe(e,gt,r),new ge(He));return n.name=`volter:board-pad:${t.groupKey||Y}`,n.position.set((t.extent.minX+t.extent.maxX)/2,Ze-gt/2,(t.extent.minZ+t.extent.maxZ)/2),n.receiveShadow=!0,Rt(n),n}function Ye(t,e){const r=t/2,n=e/2,s=[[-r,-n],[r,-n],[r,n],[-r,n]],o=[];for(let u=0;u<s.length;u++){const c=s[u],l=s[(u+1)%s.length];o.push(c[0],0,c[1],l[0],0,l[1])}const i=new Se;i.setAttribute("position",new Me(o,3));const a=new Ee(i,new ve({color:Xe,dashSize:.09,gapSize:.06}));return a.computeLineDistances(),a}function qe(t){const e=new R;e.name=`volter:board-ghost:${t.name}`,e.userData[Bt]=t.key;const[r,n]=t.placement.footprint,s=new Dt(new ye(r,n),new be({color:We,transparent:!0,opacity:.1,depthWrite:!1,side:we}));s.rotation.x=-Math.PI/2,s.position.y=yt;const o=Ye(r,n);return o.position.y=yt,e.add(s,o),e.position.set(t.placement.anchor[0],0,t.placement.anchor[2]),e}function Je(t,e,r){if(!r.componentName)return!0;const n=St(t,r.componentName,e);return!n||n.modulePath===e&&n.name===r.name}function Qe(t){return jt(t).length}function jt(t){const e=[],r=new Map,n=tt();for(const s of t)if(s.ok)for(const o of s.stories){const i=Q({modulePath:s.modulePath,regions:n});if(i.medium!=="three"){i.via==="undeclared"&&Kt(s.modulePath,i.reason);continue}if(!Je(t,s.modulePath,o))continue;const a=zt({modulePath:s.modulePath,...o.title===void 0?{}:{title:o.title}}),u=It(a),c=`${u}/${a.leaf}`;r.set(c,(r.get(c)??0)+1),e.push({identity:{id:`${s.modulePath}#${o.name}`,storyName:o.name,modulePath:s.modulePath,groupKey:u,groupLeaf:a.leaf,groupPath:Vt(a)},storyLabel:o.label,Component:o.Component})}return e.map(({identity:s,storyLabel:o,Component:i})=>({identity:{...s,label:(r.get(`${s.groupKey}/${s.groupLeaf}`)??0)>1?`${s.groupLeaf} · ${o}`:s.groupLeaf},Component:i}))}function tn(t,e){const r=new Set,n=[];for(const s of e){if(s.surface!=="three"||s.contentKind==="image")continue;const o=`${s.path}#${s.name}`;r.has(o)||(r.add(o),!St(t,s.name,s.path)&&n.push(s))}return n}function en(t,e,r){const n=new R;return n.name=`volter:board-exhibit:${t.label}`,n.position.set(...e.translation),n.add(r.root),n.userData[kt]=t.id,n}function q(t){return vt(async()=>{t.dispose()})}async function Ct(t,e=[],r){return vt(n=>an(t,e,r,n))}async function nn(t,e,r){const n=[];for(const{identity:s,Component:o}of t){if(e?.aborted)break;n.push(await Ve(s,o,r))}return n}function on(t){return{min:t.min.toArray(),max:t.max.toArray()}}function rn(t){const e=new Map,r=new Map,n=[],s=[];for(const o of t){if(!o.mounted){s.push({id:o.identity.id,modulePath:o.identity.modulePath,storyName:o.identity.storyName,reason:o.reason??"The story produced no Object3D."});continue}const i=pe(o.mounted.root).map(a=>({bounds:on(a.box),overlay:a.overlay,enclosure:a.enclosure}));e.set(o.identity.id,o.mounted),r.set(o.identity.id,o.identity),n.push({id:o.identity.id,groupKey:o.identity.groupKey,nodes:i})}return{mounts:e,identities:r,measures:n,skipped:s}}function sn(t){const e=ze/2;return{id:`${t.path}#${t.name}`,groupKey:I,nodes:[{min:[-e,0,-e],max:[e,0,e]}]}}async function an(t,e,r,n){const s=Date.now(),o=jt(t);O("candidate-collect",Date.now()-s),dt({candidateCount:o.length});const i=Date.now(),a=await nn(o,r,n);O("story-mounts",Date.now()-i);const u=Date.now(),{mounts:c,identities:l,measures:d,skipped:p}=rn(a);O("bounds",Date.now()-u);const y=Date.now(),b=tn(t,e),x=new Map(b.map(f=>[`${f.path}#${f.name}`,f])),h=$e([...d,...b.map(sn)]),v=h.layout,V=new Map(h.exhibits.map(f=>[f.id,f]));O("layout",Date.now()-y);const _=Date.now(),T=new R;T.name="volter:three-board";const k=new R;k.name="volter:board-chrome",Rt(k),T.add(k);const j=[],rt=[],st=[],it=[k];for(const f of v.districts){const M=f.groupKey===I,D=new R;D.name=`volter:board-district:${M?xt:f.groupKey||Y}`,T.add(D),k.add(Ue(f));for(const S of f.items){if(M){const N=x.get(S.id);if(!N)continue;const ut={key:S.id,name:N.name,path:N.path,line:N.line,placement:S},lt=qe(ut);D.add(lt),it.push(lt),st.push(ut);continue}const C=c.get(S.id),H=l.get(S.id),E=V.get(S.id);!C||!H||!E||(D.add(en(H,S,C)),j.push({...H,placement:S,fullSize:[E.full.max[0]-E.full.min[0],E.full.max[1]-E.full.min[1],E.full.max[2]-E.full.min[2]],helpers:E.helpers}))}rt.push({groupKey:f.groupKey,label:M?xt:f.groupKey||Y,placement:f})}const $t=j.flatMap(f=>f.helpers.map(M=>({exhibitId:f.id,exhibitLabel:f.label,kind:M.kind,size:M.size})));let at=!1;const ct={root:T,exhibits:j,districts:rt,ghostSlots:st,skipped:p,frameBounds:h.frame,openingFrameBounds:h.exhibits[0]?U(h.exhibits[0].presence,h.exhibits[0].placement.translation):h.frame,helperVolumes:$t,dispose(){if(!at){at=!0;for(const f of it)f.traverse(M=>{const D=M;D.geometry?.dispose();const S=D.material;if(Array.isArray(S))for(const C of S)C.dispose();else S?.dispose()}),f.removeFromParent();for(const f of c.values())try{f.dispose()}catch(M){console.error("[three-board] a story mount failed to dispose.",M)}c.clear(),T.clear()}}};if(O("assemble",Date.now()-_),dt({exhibitCount:j.length,skippedCount:p.length}),r?.aborted)throw ct.dispose(),new Error("The 3D board build was superseded by a newer one.");return ct}function cn(t){return Nt(t,kt)}function un(t){return Nt(t,Bt)}function Nt(t,e){let r=t;for(;r;){const n=r.userData[e];if(typeof n=="string")return n;r=r.parent}return null}const At="3D";let F=null,Lt=0;const J=new Set;function bt(){Lt++;for(const t of J)t()}function ln(t){return J.add(t),()=>{J.delete(t)}}function dn(){return Lt}function Gt(t){return Number.isFinite(t)?t>=10?`${Math.round(t)} m`:t>=1?`${t.toFixed(1)} m`:`${t.toFixed(2)} m`:"—"}function mn(t,e,r){const n=Ft(e,r);return n?qt(Jt,t,{modulePath:n.modulePath,storyName:n.storyName,title:n.label}):null}function pn(t,e,r){const n=Mn(t,e);if(!n)return null;const s={definitionLocation:()=>({file:n.path,line:n.line})};return r?mt(s,n.key,"definition",r):mt(s,n.key,"definition")}function hn(t){const e=tt(),r=t.filter(o=>o.ok&&Q({modulePath:o.modulePath,regions:e}).medium==="three"),n=w.useRef([]),s=n.current;return(s.length!==r.length||s.some((o,i)=>o!==r[i]))&&(n.current=r),n.current}function fn({documentId:t,active:e,store:r}){const n=w.useSyncExternalStore(Mt,W),s=hn(n),[o,i]=w.useState({status:"idle"});e&&ee(t);const[a,u]=w.useState(e);w.useEffect(()=>{e&&u(!0)},[e]),w.useEffect(()=>{if(!a)return;const p=new AbortController;let y=null;i({status:"building"}),ne(t,{modulesAlreadyLoaded:s.length>0});const b=Date.now();return Et().then(x=>{const h=Date.now()-b;return O("component-index",h,{busyMs:0,waitMs:h}),x.ok||oe.warn(`Component index unavailable, so this board shows no ghost slots: ${x.reason}`,"three-board"),Ct(s,x.ok?x.entries:[],p.signal)}).then(x=>{if(p.signal.aborted){Z(t),q(x);return}y=x,F=x,bt(),re(),i({status:"ready",scene:x})},x=>{if(p.signal.aborted){Z(t);return}i({status:"error",message:x instanceof Error?x.message:String(x)})}),()=>{p.abort(),y?(F===y&&(F=null),q(y),bt()):Z(t)}},[s,a,t]);const c=o.status==="ready"?o.scene:null,l=w.useCallback(()=>{if(!c)throw new Error("The 3D board is still building.");return{root:c.root,dispose(){}}},[c]),d=w.useCallback(p=>{if(mn(r,c,p)!==null)return;const y=pn(c,p);y&&y.then(se)},[c,r]);return m.jsx("div",{style:{position:"relative",flex:1,minHeight:0,pointerEvents:"auto"},children:c?m.jsxs(m.Fragment,{children:[m.jsx(ce,{documentId:t,sourcePath:"Generated from this project’s stories",displayName:At,build:l,active:e,onOpenNode:d,cameraDirection:ue,frameBounds:c.frameBounds,openingFrameBounds:c.openingFrameBounds,dressing:{grid:!0}}),m.jsx(gn,{documentId:t,scene:c,active:e}),m.jsx(xn,{scene:c})]}):m.jsxs("div",{"data-testid":"three-board-status",style:{padding:16,fontSize:12,color:g.content.muted},children:[o.status==="error"&&o.message,o.status==="building"&&le(Qe(s)),o.status==="idle"&&"Open this tab to lay out every story at true scale."]})})}function xn({scene:t}){const[e,r]=w.useState(!1),n=Ke(t.skipped),s=t.districts.filter(o=>o.groupKey!==I).length;return m.jsxs("div",{"data-testid":"three-board-status",style:{position:"absolute",left:8,bottom:8,maxWidth:420,padding:"4px 8px",borderRadius:g.shape.small,background:g.surface.raised,border:`1px solid ${g.boundary.default}`,fontSize:10,color:g.content.muted,pointerEvents:"auto"},children:[t.exhibits.length," exhibit",t.exhibits.length===1?"":"s"," · ",s," ","district",s===1?"":"s",t.helperVolumes.length>0&&m.jsxs(m.Fragment,{children:[" · ",t.helperVolumes.length," helper volume",t.helperVolumes.length===1?"":"s"," at true scale, outside the default frame"]}),t.ghostSlots.length>0&&m.jsxs(m.Fragment,{children:[" · ",t.ghostSlots.length," component",t.ghostSlots.length===1?"":"s"," without stories"]}),t.skipped.length>0&&m.jsxs(m.Fragment,{children:[" · ",m.jsxs("span",{role:"button",tabIndex:0,"aria-expanded":e,onClick:()=>r(o=>!o),onKeyDown:o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),r(i=>!i))},style:{cursor:"pointer",color:g.accent.default},children:[n.stories," ",n.stories===1?"story":"stories"," in ",n.modules," ",n.modules===1?"module":"modules"," not on this board"]})]}),e&&m.jsx("div",{style:{marginTop:4,maxHeight:160,overflow:"auto"},children:t.skipped.map(o=>m.jsxs("div",{style:{padding:"1px 0"},children:[m.jsxs("code",{style:{color:g.content.dim},children:[o.modulePath,"#",o.storyName]})," ","— ",o.reason]},o.id))})]})}function gn({documentId:t,scene:e,active:r}){const n=w.useRef(null),[s,o]=w.useState([]);return w.useEffect(()=>{if(!r)return;let i=0,a=!1;const u=yn(e),c=()=>{if(a)return;i=requestAnimationFrame(c);const l=n.current,d=ae(t);!l||!d||l.clientWidth===0||l.clientHeight===0||o(bn(u,d.camera(),l.clientWidth,l.clientHeight))};return i=requestAnimationFrame(c),()=>{a=!0,cancelAnimationFrame(i)}},[r,t,e]),m.jsx("div",{ref:n,"data-testid":"three-board-labels",style:{position:"absolute",inset:-12,pointerEvents:"none",overflow:"hidden"},children:s.map(i=>m.jsxs("div",{style:{position:"absolute",left:i.x,top:i.y,transform:"translate(-50%, -100%)",whiteSpace:"nowrap",padding:i.district?"2px 7px":"1px 5px",borderRadius:g.shape.small,background:g.surface.raised,border:`1px ${i.ghost?"dashed":"solid"} ${i.district&&!i.ghost?g.accent.default:g.boundary.default}`,color:i.district&&!i.ghost?g.content.primary:g.content.muted,fontSize:i.district?12:10,fontWeight:i.district?600:400,opacity:i.ghost?.9:1},children:[i.text,m.jsx("span",{style:{marginLeft:6,color:g.content.dim,fontWeight:400},children:i.detail})]},i.key))})}const B=new P;function wt(t){return[t.anchor[0],0,t.anchor[2]-t.footprint[1]/2]}function yn(t){return[...t.districts.map(e=>{const r=e.groupKey===I,n=e.placement.items.length;return{key:`district:${e.groupKey}`,text:e.label,detail:r?`${n} component${n===1?"":"s"}`:`${n} exhibit${n===1?"":"s"}`,district:!0,ghost:r,point:e.placement.anchor}}),...t.exhibits.map(e=>({key:`exhibit:${e.id}`,text:e.label,detail:Gt(e.placement.size[1]),district:!1,ghost:!1,point:wt(e.placement)})),...t.ghostSlots.map(e=>({key:`ghost:${e.key}`,text:e.name,detail:"No story yet",district:!1,ghost:!0,point:wt(e.placement)}))]}function bn(t,e,r,n){e.updateMatrixWorld();const s=[];for(const o of t)B.set(o.point[0],o.point[1],o.point[2]).project(e),!(B.z>1)&&s.push({key:o.key,text:o.text,detail:o.detail,district:o.district,ghost:o.ghost,x:(B.x*.5+.5)*r,y:(-B.y*.5+.5)*n,depth:B.z});return Sn(s).sort((o,i)=>i.depth-o.depth)}function wn(t){const e=t.district?12:10,r=(t.text.length+t.detail.length)*e*.62+24,n=e+8;return[t.x-r/2,t.y-n,t.x+r/2,t.y]}function Sn(t){const e=[...t].sort((n,s)=>(s.district?1:0)-(n.district?1:0)||n.depth-s.depth),r=[];for(const n of e){const s=wn(n);r.some(i=>s[0]<i.rect[2]&&s[2]>i.rect[0]&&s[1]<i.rect[3]&&s[3]>i.rect[1])||r.push({label:n,rect:s})}return r.map(n=>n.label)}function Ft(t,e){if(!t)return null;const r=cn(e);return r?t.exhibits.find(n=>n.id===r)??null:null}function Mn(t,e){if(!t)return null;const r=un(e);return r?t.ghostSlots.find(n=>n.key===r)??null:null}function En({adapter:t,nodeId:e}){w.useSyncExternalStore(ln,dn);const n=[...e?[e]:[],...t.selection?.get()??[]].reduce((s,o)=>s??Ft(F,ie(t.hierarchy,o)),null);return m.jsx("div",{"data-testid":"inspector-exhibit",style:{pointerEvents:"auto",padding:8,borderBottom:`1px solid ${g.boundary.default}`},children:n?m.jsxs("div",{style:{display:"grid",gap:3,fontSize:11},children:[m.jsx("div",{style:{color:g.content.primary,fontWeight:600},children:n.label}),m.jsx(G,{label:"Story",value:n.storyName}),m.jsx(G,{label:"Group",value:n.groupPath}),m.jsx(G,{label:"Module",value:n.modulePath}),m.jsx(G,{label:"Size",value:n.placement.size.map(s=>Gt(s)).join(" × ")})]}):m.jsx("div",{style:{fontSize:11,color:g.content.dim},children:"Pick an exhibit to read its story."})})}function G({label:t,value:e}){return m.jsxs("div",{style:{display:"flex",gap:6},children:[m.jsx("span",{style:{width:52,flexShrink:0,color:g.content.muted},children:t}),m.jsx("code",{style:{color:g.content.primary,overflow:"hidden",textOverflow:"ellipsis"},title:e,children:e})]})}const vn=Qt();function Dn(){vn.ensure(t=>{t(Zt({match:()=>Ut()?.descriptor.id===X,id:"exhibit",title:"Exhibit",icon:Wt,order:Xt,Section:En}))})}const _n={revision:()=>JSON.stringify(W().map(t=>t.modulePath)),subscribe:Mt,capture:async t=>{await te();const e=tt(),r=W().filter(o=>o.ok&&Q({modulePath:o.modulePath,regions:e}).medium==="three"),n=await Et(),s=await Ct(r,n.ok?n.entries:[]);try{const{captureAuthoredThreeScenePreview:o}=await A(async()=>{const{captureAuthoredThreeScenePreview:h}=await import("./document-preview-three-DxAxdZRF.js");return{captureAuthoredThreeScenePreview:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),{createStandardEnvironment:i}=await A(async()=>{const{createStandardEnvironment:h}=await import("./environment-Dg-YaLsA.js");return{createStandardEnvironment:h}},__vite__mapDeps([19,17,14,20,21,22])),{applyStandardViewportDressing:a}=await A(async()=>{const{applyStandardViewportDressing:h}=await import("./standard-viewport-dressing-BhTPIZTQ.js").then(v=>v.d);return{applyStandardViewportDressing:h}},__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,19,17,20,21,22,24])),{isEditorOwnedObject:u}=await A(async()=>{const{isEditorOwnedObject:h}=await import("./editor-layers-k0AjpomL.js");return{isEditorOwnedObject:h}},__vite__mapDeps([15,3,4,5,6,7,8,9,10,11,12,13]));s.root.traverse(h=>{u(h)&&(h.visible=!1)});const c=new De;c.add(s.root);const l=new _e(new P(...s.frameBounds.min),new P(...s.frameBounds.max)),d=l.isEmpty()?new P:l.getCenter(new P),y=(l.isEmpty()?1:Math.max(.01,l.getBoundingSphere(new Oe).radius))/Math.sin(Pe.degToRad(42/2))*1.15,b=d.clone().addScaledVector(new P(1,.75,1).normalize(),y),x={...t,camera:{position:b,target:d,fov:42}};return o(s.root,c,x,h=>{const v=a(c,{environment:i(h),background:!1});return()=>v.dispose()})}finally{await q(s)}}};function ho(t){return Dn(),Yt({id:X,title:At,kind:"content-browser",workspaceRole:"workspace-reference",Content:e=>m.jsx(fn,{...e,store:t}),readOnly:!0,preview:_n,presentation:()=>({kind:"workspace",id:X})},{category:"canvas"})}export{En as BoardExhibitSection,X as THREE_COMPONENTS_DOCUMENT_ID,Dn as ensureThreeBoardContributionsRegistered,ho as installThreeBoardDocument,mn as openExhibitStoryDocument,pn as openGhostComponentSource};
@@ -1 +1 @@
1
- import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{al as p,fU as g,aC as b}from"./index-ClgrFOcX.js";import{r as m}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{captureAuthoredThreeScenePreview as E}from"./document-preview-three-Qni0oVBw.js";import{m as v}from"./mounted-story-viewport-source-BvNZ3QQn.js";import{mountStoryObject3D as w,disposeStoryObject3D as x}from"./story-three-preview-CWM0Rj7x.js";import{O as C}from"./Object3DDocumentViewport-BpiyRQ5p.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./content-bounds-Dl5Y3LLv.js";import"./hierarchy-marks-DeG4E4Ke.js";import"./workspace-arrangement-86_8Kk5K.js";import"./three.core-3arARmh6.js";import"./editor-layers-DwaX5UFy.js";import"./renderer-ownership-BovSEcLv.js";import"./three.module-BLhyNg0e.js";import"./scene-framing-B5JC4NeG.js";import"./asset-preview-BUpxsHNd.js";import"./studio-environment-Bw9zMFE8.js";import"./user-data-DL6HsBPf.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"./crash-null-boundary-v3a0uEgw.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./index-DzuOGwVB.js";import"./story-mount-turn-DFRTj5hi.js";import"./viewport-surface-status-D7M2L2lI.js";async function N(e,n,t){const s=(await import(e))[t??"default"];if(typeof s!="function")throw new Error(`${n} does not export ${t===void 0?"a default component":`\`${t}\``}, which is what the adapter's scene table names. The table and the module disagree.`);return s}function at({active:e,documentId:n,state:t}){const[o,c]=m.useState(null),[s,d]=m.useState(null),a=m.useRef(null),[f,j]=m.useState(e);m.useEffect(()=>{e&&j(!0)},[e]);const u=t?.path,h=t?.exportName;return m.useEffect(()=>{if(!f||!u)return;let l=!1;return d(null),c(null),y(u,h).then(r=>w(r,{})).then(r=>{if(l){x(r);return}const S=v(r);a.current=S,c(S)}).catch(r=>{l||d(r instanceof Error?r.message:String(r))}),()=>{l=!0,a.current?.dispose(),a.current=null,c(null)}},[f,u,h]),t?s?i.jsxs("div",{role:"alert","data-testid":"scene-document-error",style:{padding:12,fontSize:12,color:p.semantic.danger,maxWidth:640},children:[i.jsxs("div",{style:{fontWeight:600,marginBottom:4},children:[t.path,t.exportName?` — ${t.exportName}`:""]}),i.jsx("div",{style:{color:p.content.muted,whiteSpace:"pre-wrap"},children:s})]}):o?i.jsx(C,{documentId:n,sourcePath:t.path,build:o.build,displayName:t.label,active:e}):i.jsx("div",{"data-testid":"scene-document-loading",style:{padding:12,fontSize:12,color:p.content.muted,fontStyle:"italic"},children:"mounting…"}):i.jsx("div",{style:{padding:12,fontSize:12,color:p.content.muted},children:"This scene document is no longer declared by the project's adapter."})}async function y(e,n){const t=b();if(!t)throw new Error("No project is open, so its scene modules cannot be loaded.");const o=`${g(t.rootPath,e)}?t=${Date.now()}`;return N(o,e,n)}async function ut(e,n){const t=await y(e.path,e.exportName),o=await w(t,{});try{return E(o.root,o.scene,n)}finally{await x(o)}}export{at as ThreeIsolationSceneContent,ut as captureThreeIsolationScenePreview};
1
+ import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{al as p,fU as g,aC as b}from"./index-BfqJPhFO.js";import{r as m}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{captureAuthoredThreeScenePreview as E}from"./document-preview-three-DxAxdZRF.js";import{m as v}from"./mounted-story-viewport-source-Ceh05FK8.js";import{mountStoryObject3D as w,disposeStoryObject3D as x}from"./story-three-preview-CH6Kk934.js";import{O as C}from"./Object3DDocumentViewport-BOi94JfA.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./content-bounds-BRS42hfD.js";import"./hierarchy-marks-C2temlO0.js";import"./workspace-arrangement-BXM0R-Uu.js";import"./three.core-3arARmh6.js";import"./editor-layers-k0AjpomL.js";import"./renderer-ownership-BovSEcLv.js";import"./three.module-BLhyNg0e.js";import"./scene-framing-Dm-rCn3G.js";import"./asset-preview-t-7PYPjJ.js";import"./studio-environment-BNM-AjAn.js";import"./user-data-CTT8ZvVB.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"./crash-null-boundary-v3a0uEgw.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./index-DzuOGwVB.js";import"./story-mount-turn-DFRTj5hi.js";import"./viewport-surface-status-BiDiAZ6z.js";async function N(e,n,t){const s=(await import(e))[t??"default"];if(typeof s!="function")throw new Error(`${n} does not export ${t===void 0?"a default component":`\`${t}\``}, which is what the adapter's scene table names. The table and the module disagree.`);return s}function at({active:e,documentId:n,state:t}){const[o,c]=m.useState(null),[s,d]=m.useState(null),a=m.useRef(null),[f,j]=m.useState(e);m.useEffect(()=>{e&&j(!0)},[e]);const u=t?.path,h=t?.exportName;return m.useEffect(()=>{if(!f||!u)return;let l=!1;return d(null),c(null),y(u,h).then(r=>w(r,{})).then(r=>{if(l){x(r);return}const S=v(r);a.current=S,c(S)}).catch(r=>{l||d(r instanceof Error?r.message:String(r))}),()=>{l=!0,a.current?.dispose(),a.current=null,c(null)}},[f,u,h]),t?s?i.jsxs("div",{role:"alert","data-testid":"scene-document-error",style:{padding:12,fontSize:12,color:p.semantic.danger,maxWidth:640},children:[i.jsxs("div",{style:{fontWeight:600,marginBottom:4},children:[t.path,t.exportName?` — ${t.exportName}`:""]}),i.jsx("div",{style:{color:p.content.muted,whiteSpace:"pre-wrap"},children:s})]}):o?i.jsx(C,{documentId:n,sourcePath:t.path,build:o.build,displayName:t.label,active:e}):i.jsx("div",{"data-testid":"scene-document-loading",style:{padding:12,fontSize:12,color:p.content.muted,fontStyle:"italic"},children:"mounting…"}):i.jsx("div",{style:{padding:12,fontSize:12,color:p.content.muted},children:"This scene document is no longer declared by the project's adapter."})}async function y(e,n){const t=b();if(!t)throw new Error("No project is open, so its scene modules cannot be loaded.");const o=`${g(t.rootPath,e)}?t=${Date.now()}`;return N(o,e,n)}async function ut(e,n){const t=await y(e.path,e.exportName),o=await w(t,{});try{return E(o.root,o.scene,n)}finally{await x(o)}}export{at as ThreeIsolationSceneContent,ut as captureThreeIsolationScenePreview};
@@ -1 +1 @@
1
- import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DPreview as d}from"./Object3DPreview-BOZYzjz_.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ClgrFOcX.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"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./OrbitControls-B13MKuwC.js";import"./asset-preview-BUpxsHNd.js";import"./editor-layers-DwaX5UFy.js";import"./workspace-arrangement-86_8Kk5K.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-DeG4E4Ke.js";import"./studio-environment-Bw9zMFE8.js";import"./user-data-DL6HsBPf.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"./editor-presentation-activity-CqJH4G9t.js";import"./model-thumbnail-CF3qGQWb.js";function Q({build:r,displayName:m="Object3D preview",height:p=360,background:e,showSkeleton:s=!1,cameraDirection:n,showGrid:c,useDefaultLighting:u,exposure:a,setupPreview:t,active:j=!0}){const i=t!==void 0;return o.jsx("div",{style:{width:"100%",height:p,minHeight:240},children:o.jsx(d,{sourceFactory:r,displayName:m,active:j,showSkeleton:s,background:e,cameraDirection:n,showGrid:c??!i,useDefaultLighting:u??!i,exposure:a,setupPreview:t})})}export{Q as ToolObject3DPreview};
1
+ import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DPreview as d}from"./Object3DPreview-7LnLFpmg.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-BfqJPhFO.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"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./OrbitControls-B13MKuwC.js";import"./asset-preview-t-7PYPjJ.js";import"./editor-layers-k0AjpomL.js";import"./workspace-arrangement-BXM0R-Uu.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-C2temlO0.js";import"./studio-environment-BNM-AjAn.js";import"./user-data-CTT8ZvVB.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"./editor-presentation-activity-CqJH4G9t.js";import"./model-thumbnail-Dnv7DCt7.js";function Q({build:r,displayName:m="Object3D preview",height:p=360,background:e,showSkeleton:s=!1,cameraDirection:n,showGrid:c,useDefaultLighting:u,exposure:a,setupPreview:t,active:j=!0}){const i=t!==void 0;return o.jsx("div",{style:{width:"100%",height:p,minHeight:240},children:o.jsx(d,{sourceFactory:r,displayName:m,active:j,showSkeleton:s,background:e,cameraDirection:n,showGrid:c??!i,useDefaultLighting:u??!i,exposure:a,setupPreview:t})})}export{Q as ToolObject3DPreview};
@@ -1 +1 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{U as N,d7 as O,d8 as k,d9 as P,a8 as h,bw as u,aM as f,a7 as d,da as v,db as R,dc as B,dd as G,a6 as w,bz as z,bP as M,de as A,aL as l,aN as m,df as b,aS as y,dg as C,bv as F,dh as L,by as V,bA as $,bB as U,bD as H,di as K,dj as _,dk as X,dl as Y}from"./index-ClgrFOcX.js";import{r as c}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{r as T}from"./transform-mode-request-BnV8FSnx.js";function D({active:a,onArm:t,faIcon:r,action:s,label:i}){return e.jsx(u,{text:i,hotkey:v(s),children:e.jsx(f,{"aria-label":i,"aria-pressed":a,shape:"segment",size:"comfortable",onClick:t,children:e.jsx(d,{icon:r,size:"md"})})})}function I({store:a,dimensions:t="3d",size:r="comfortable",variant:s="ghost",showValues:i=!1}){const[o,S]=c.useState(!1),j=c.useRef(null);return c.useEffect(()=>{if(!o)return;const n=p=>{j.current&&!j.current.contains(p.target)&&S(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[o]),e.jsxs("div",{ref:j,className:"volter-viewport-popover-anchor",children:[e.jsxs(R,{children:[t==="2d"&&e.jsx(u,{text:"Smart Snap",children:e.jsx(f,{"aria-label":"Toggle smart snap","aria-pressed":a.smartSnap.enabled,variant:s,size:r,onClick:()=>a.setSmartSnap({enabled:!a.smartSnap.enabled}),children:e.jsx(d,{icon:B,size:"md"})})}),e.jsx(u,{text:t==="2d"?"Grid Snap":"Toggle Snap",hotkey:v("viewport.toggleSnap"),children:e.jsx(f,{"aria-label":"Toggle snap","aria-pressed":a.snapEnabled,variant:s,size:r,onClick:()=>a.toggleSnap(),children:e.jsx(d,{icon:G,size:"md"})})}),i?[["translate",h.tool.move,`${a.snapValues.translate}`],["rotate",h.tool.rotate,`${a.snapValues.rotate}°`],["scale",h.tool.scale,`${a.snapValues.scale}`]].map(([n,p,g])=>e.jsx(u,{text:"Snap Settings",children:e.jsxs(w,{"aria-label":`${n} snap step`,"aria-haspopup":"dialog","aria-expanded":o,variant:s,size:r,"data-snap-step":n,onClick:()=>S(!o),children:[e.jsx(d,{icon:p,size:"xs"}),g]})},n)):e.jsx(u,{text:"Snap Settings",children:e.jsx(f,{"aria-label":"Snap settings","aria-haspopup":"dialog","aria-expanded":o,variant:s,size:r,onClick:()=>S(!o),children:e.jsx(d,{icon:z,size:"xs"})})})]}),o&&e.jsx(M,{className:"volter-snap-popover",children:e.jsxs(A,{gap:2,children:[t==="2d"?e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Grid Step (px)"}),e.jsx(m,{type:"number","aria-label":"Grid step",value:a.snap2D.step,step:1,min:1,onChange:n=>a.setSnap2D({step:Number(n.target.value)||8})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Grid Offset (px)"}),e.jsxs(b,{gap:1,children:[e.jsx(m,{type:"number","aria-label":"Grid offset x",value:a.snap2D.offsetX,step:1,onChange:n=>a.setSnap2D({offsetX:Number(n.target.value)||0})}),e.jsx(m,{type:"number","aria-label":"Grid offset y",value:a.snap2D.offsetY,step:1,onChange:n=>a.setSnap2D({offsetY:Number(n.target.value)||0})})]}),e.jsx(l,{variant:"caption",tone:"muted",children:"Primary Line Every (steps)"}),e.jsx(m,{type:"number","aria-label":"Primary line every",value:a.snap2D.primaryEvery,step:1,min:1,onChange:n=>a.setSnap2D({primaryEvery:Number(n.target.value)||8})})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Translate"}),e.jsx(m,{type:"number",value:a.snapValues.translate,step:.25,min:.01,onChange:n=>a.setSnapValues({translate:Number(n.target.value)||1})})]}),t==="2d"?e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Rotation Offset (deg)"}),e.jsx(m,{type:"number","aria-label":"Rotation offset",value:a.snap2D.rotationOffset,step:1,onChange:n=>a.setSnap2D({rotationOffset:Number(n.target.value)||0})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Rotation Step (deg)"}),e.jsx(m,{type:"number","aria-label":"Rotation step",value:a.snap2D.rotationStep,step:1,min:1,onChange:n=>a.setSnap2D({rotationStep:Number(n.target.value)||15})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Scale Step"}),e.jsx(m,{type:"number","aria-label":"Scale step",value:a.snap2D.scaleStep,step:.05,min:.01,onChange:n=>a.setSnap2D({scaleStep:Number(n.target.value)||.1})})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Rotate (deg)"}),e.jsx(m,{type:"number",value:a.snapValues.rotate,step:5,min:1,onChange:n=>a.setSnapValues({rotate:Number(n.target.value)||15})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Scale"}),e.jsx(m,{type:"number",value:a.snapValues.scale,step:.05,min:.01,onChange:n=>a.setSnapValues({scale:Number(n.target.value)||.25})})]}),t==="2d"&&e.jsxs(e.Fragment,{children:[[["Use Rotation Snap",a.rotationSnap,()=>a.setRotationSnap(!a.rotationSnap)],["Use Scale Snap",a.scaleSnap,()=>a.setScaleSnap(!a.scaleSnap)],["Snap Relative",a.snap2D.relative,()=>a.setSnap2D({relative:!a.snap2D.relative})],["Use Pixel Snap",a.snap2D.pixel,()=>a.setSnap2D({pixel:!a.snap2D.pixel})]].map(([n,p,g])=>e.jsxs(b,{gap:2,align:"center",role:"menuitemcheckbox","aria-checked":p,onClick:g,children:[e.jsx(y,{checked:p,readOnly:!0}),e.jsx(l,{children:n})]},n)),e.jsx(l,{variant:"caption",tone:"muted",children:"Smart Snapping"}),[["parent","Snap to Parent"],["others","Snap to Other Nodes"],["sides","Snap to Node Sides"],["center","Snap to Node Center"],["guides","Snap to Guides"]].map(([n,p])=>e.jsxs(b,{gap:2,align:"center",role:"menuitemcheckbox","aria-checked":a.smartSnap[n],onClick:()=>a.setSmartSnap({[n]:!a.smartSnap[n]}),children:[e.jsx(y,{checked:a.smartSnap[n],readOnly:!0}),e.jsx(l,{children:p})]},n))]}),t==="3d"&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{gap:2,align:"center",onClick:()=>a.toggleSnapToSurface(),children:[e.jsx(y,{checked:a.snapToSurface,readOnly:!0}),e.jsx(l,{children:"Snap to Surface"})]}),e.jsxs(l,{variant:"caption",tone:"dim",children:["Hold ",e.jsx(C,{children:"Ctrl"})," while dragging to snap once ·"," ",e.jsx(C,{children:v("viewport.toggleSnap")})," toggles"]}),e.jsxs(l,{variant:"caption",tone:"dim",children:["Hold ",e.jsx(C,{children:v("viewport.vertexSnapHold")})," during translate for vertex snap"]})]})]})})]})}const q={"active-element":"Active Element","median-point":"Median Point","individual-origins":"Individual Origins"};function W({store:a}){const t=["active-element","median-point","individual-origins"],r=`Pivot: ${q[a.pivotMode]}`;return e.jsx(u,{text:r,hotkey:v("viewport.cyclePivot"),children:e.jsx(f,{"aria-label":r,"aria-pressed":a.pivotMode!=="active-element",variant:"secondary",onClick:()=>{const s=t.indexOf(a.pivotMode);a.setPivotMode(t[(s+1)%t.length])},children:e.jsx(d,{icon:K,size:"md"})})})}const J={auto:"Auto",pivot:"Pivot",center:"Center"};function Q({store:a}){const t=["auto","pivot","center"],r=`Anchor: ${J[a.gizmoAnchor]}`;return e.jsx(u,{text:r,children:e.jsx(f,{"aria-label":r,"aria-pressed":a.gizmoAnchor!=="auto",variant:"secondary",onClick:()=>{const s=t.indexOf(a.gizmoAnchor);a.setGizmoAnchor(t[(s+1)%t.length])},children:e.jsx(d,{icon:a.gizmoAnchor==="center"?_:X,size:"md"})})})}function Z({store:a}){const[t,r]=c.useState(!1),s=c.useRef(null);return c.useEffect(()=>{if(!t)return;const i=o=>{s.current?.contains(o.target)||r(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t]),e.jsxs("div",{ref:s,className:"volter-viewport-popover-anchor",children:[e.jsx(u,{text:"Transform options",children:e.jsx(f,{"aria-label":"Transform options","aria-haspopup":"dialog","aria-expanded":t,variant:"secondary",onClick:()=>r(i=>!i),children:e.jsx(d,{icon:Y,size:"md"})})}),t?e.jsx(M,{style:{minWidth:240},children:e.jsxs(A,{gap:3,children:[e.jsxs(w,{size:"compact",variant:"ghost",onClick:()=>{a.snapSelectionToFloor(),r(!1)},children:["Snap Selection to Floor ",e.jsx(C,{children:v("viewport.snapToFloor")})]}),e.jsxs(b,{gap:2,align:"center",onClick:()=>a.togglePreserveChildrenTransform(),style:{cursor:"pointer"},children:[e.jsx(y,{checked:a.preserveChildrenTransform,readOnly:!0}),e.jsx(l,{children:"Preserve Children Transform"})]}),e.jsx(l,{variant:"caption",tone:"dim",children:"Keep source-writable children fixed in world space while their parent moves."})]})}):null]})}function ee({store:a}){const[t,r]=c.useState(!1),s=c.useRef(null),i=a.transformSpace==="world"?"Global":"Local";return e.jsxs("div",{className:"volter-viewport-popover-anchor",children:[e.jsx(u,{text:`Transform orientation: ${i}`,children:e.jsxs(w,{ref:s,type:"button",size:"compact",variant:"secondary","aria-label":`Transform orientation: ${i}`,"aria-haspopup":"menu","aria-expanded":t,onClick:()=>r(o=>!o),className:"volter-transform-orientation-trigger",children:[e.jsx(d,{icon:a.transformSpace==="world"?L:V,size:"sm"}),e.jsx("span",{children:i}),e.jsx(d,{icon:z,size:"xs"})]})}),t&&e.jsx($,{anchorRef:s,align:"start",clamp:!0,"aria-label":"Transform orientation",onDismiss:()=>r(!1),children:["world","local"].map(o=>e.jsxs(U,{role:"menuitemradio","aria-checked":a.transformSpace===o,onSelect:()=>{a.setTransformSpace(o),r(!1)},children:[e.jsx("span",{className:"volter-menu-check",children:a.transformSpace===o&&e.jsx(d,{icon:H,size:"xs"})}),o==="world"?"Global":"Local"]},o))})]})}function ie({store:a}={}){const t=N(),r=a??t;c.useSyncExternalStore(r.subscribe,r.getShellSnapshot??r.getSnapshot),c.useSyncExternalStore(O,k,k);const[s,i]=c.useState(null),o=s?.closest(".volter-stage-bar")!=null;return e.jsxs(F,{compact:!0,label:"Transform controls","data-testid":"transform-header-controls",className:"volter-transform-header-controls",children:[e.jsx("span",{ref:i,hidden:!0}),e.jsx(ee,{store:r}),e.jsxs(R,{children:[e.jsx(W,{store:r}),e.jsx(Q,{store:r})]}),e.jsx(I,{store:r,size:"default",variant:"secondary",showValues:o}),e.jsx(Z,{store:r})]})}const ae=()=>()=>{},E=()=>null;function le({dimensions:a="3d",door:t,store:r,otherToolActive:s=!1,onToolArmed:i,viewTools:o,trailingTools:S}={}){const j=N(),n=r??j;c.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),c.useSyncExternalStore(O,k,k);const p=c.useSyncExternalStore(t?.subscribe??ae,t?.armed??E,t?.armed??E),g=[{mode:"translate",faIcon:h.tool.move,action:"transform.translate",label:"Move"},{mode:"rotate",faIcon:h.tool.rotate,action:"transform.rotate",label:"Rotate"},{mode:"scale",faIcon:h.tool.scale,action:"transform.scale",label:"Scale"}];return e.jsxs(P,{label:"Transform tools","data-testid":a==="2d"?"canvas-2d-toolstrip":"threejs-toolstrip",className:"volter-viewport-toolbar volter-viewport-toolbar-left",children:[t?null:e.jsx(D,{faIcon:h.tool.select,action:"transform.select",label:"Select",active:!s&&(n.transformMode==="select"||a==="2d"&&n.transformMode==="combined"),onArm:()=>{i?.(),T(n,"select")}}),g.map(x=>e.jsx(D,{faIcon:x.faIcon,action:x.action,label:x.label,active:!s&&(t?p===x.mode:n.transformMode===x.mode),onArm:()=>{i?.(),t?t.begin(x.mode):T(n,x.mode)}},x.mode)),t||a==="2d"?null:e.jsx(D,{faIcon:h.tool.transform,action:"transform.combined",label:"Transform (all handles)",active:n.transformMode==="combined",onArm:()=>T(n,"combined")}),o,a==="2d"?e.jsx(I,{store:n,dimensions:"2d"}):null,S]})}export{ie as T,le as a};
1
+ import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{U as N,d7 as O,d8 as k,d9 as P,a8 as h,bw as u,aM as f,a7 as d,da as v,db as R,dc as B,dd as G,a6 as w,bz as z,bP as M,de as A,aL as l,aN as m,df as b,aS as y,dg as C,bv as F,dh as L,by as V,bA as $,bB as U,bD as H,di as K,dj as _,dk as X,dl as Y}from"./index-BfqJPhFO.js";import{r as c}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{r as T}from"./transform-mode-request-CflM_ccL.js";function D({active:a,onArm:t,faIcon:r,action:s,label:i}){return e.jsx(u,{text:i,hotkey:v(s),children:e.jsx(f,{"aria-label":i,"aria-pressed":a,shape:"segment",size:"comfortable",onClick:t,children:e.jsx(d,{icon:r,size:"md"})})})}function I({store:a,dimensions:t="3d",size:r="comfortable",variant:s="ghost",showValues:i=!1}){const[o,S]=c.useState(!1),j=c.useRef(null);return c.useEffect(()=>{if(!o)return;const n=p=>{j.current&&!j.current.contains(p.target)&&S(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[o]),e.jsxs("div",{ref:j,className:"volter-viewport-popover-anchor",children:[e.jsxs(R,{children:[t==="2d"&&e.jsx(u,{text:"Smart Snap",children:e.jsx(f,{"aria-label":"Toggle smart snap","aria-pressed":a.smartSnap.enabled,variant:s,size:r,onClick:()=>a.setSmartSnap({enabled:!a.smartSnap.enabled}),children:e.jsx(d,{icon:B,size:"md"})})}),e.jsx(u,{text:t==="2d"?"Grid Snap":"Toggle Snap",hotkey:v("viewport.toggleSnap"),children:e.jsx(f,{"aria-label":"Toggle snap","aria-pressed":a.snapEnabled,variant:s,size:r,onClick:()=>a.toggleSnap(),children:e.jsx(d,{icon:G,size:"md"})})}),i?[["translate",h.tool.move,`${a.snapValues.translate}`],["rotate",h.tool.rotate,`${a.snapValues.rotate}°`],["scale",h.tool.scale,`${a.snapValues.scale}`]].map(([n,p,g])=>e.jsx(u,{text:"Snap Settings",children:e.jsxs(w,{"aria-label":`${n} snap step`,"aria-haspopup":"dialog","aria-expanded":o,variant:s,size:r,"data-snap-step":n,onClick:()=>S(!o),children:[e.jsx(d,{icon:p,size:"xs"}),g]})},n)):e.jsx(u,{text:"Snap Settings",children:e.jsx(f,{"aria-label":"Snap settings","aria-haspopup":"dialog","aria-expanded":o,variant:s,size:r,onClick:()=>S(!o),children:e.jsx(d,{icon:z,size:"xs"})})})]}),o&&e.jsx(M,{className:"volter-snap-popover",children:e.jsxs(A,{gap:2,children:[t==="2d"?e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Grid Step (px)"}),e.jsx(m,{type:"number","aria-label":"Grid step",value:a.snap2D.step,step:1,min:1,onChange:n=>a.setSnap2D({step:Number(n.target.value)||8})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Grid Offset (px)"}),e.jsxs(b,{gap:1,children:[e.jsx(m,{type:"number","aria-label":"Grid offset x",value:a.snap2D.offsetX,step:1,onChange:n=>a.setSnap2D({offsetX:Number(n.target.value)||0})}),e.jsx(m,{type:"number","aria-label":"Grid offset y",value:a.snap2D.offsetY,step:1,onChange:n=>a.setSnap2D({offsetY:Number(n.target.value)||0})})]}),e.jsx(l,{variant:"caption",tone:"muted",children:"Primary Line Every (steps)"}),e.jsx(m,{type:"number","aria-label":"Primary line every",value:a.snap2D.primaryEvery,step:1,min:1,onChange:n=>a.setSnap2D({primaryEvery:Number(n.target.value)||8})})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Translate"}),e.jsx(m,{type:"number",value:a.snapValues.translate,step:.25,min:.01,onChange:n=>a.setSnapValues({translate:Number(n.target.value)||1})})]}),t==="2d"?e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Rotation Offset (deg)"}),e.jsx(m,{type:"number","aria-label":"Rotation offset",value:a.snap2D.rotationOffset,step:1,onChange:n=>a.setSnap2D({rotationOffset:Number(n.target.value)||0})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Rotation Step (deg)"}),e.jsx(m,{type:"number","aria-label":"Rotation step",value:a.snap2D.rotationStep,step:1,min:1,onChange:n=>a.setSnap2D({rotationStep:Number(n.target.value)||15})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Scale Step"}),e.jsx(m,{type:"number","aria-label":"Scale step",value:a.snap2D.scaleStep,step:.05,min:.01,onChange:n=>a.setSnap2D({scaleStep:Number(n.target.value)||.1})})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"caption",tone:"muted",children:"Rotate (deg)"}),e.jsx(m,{type:"number",value:a.snapValues.rotate,step:5,min:1,onChange:n=>a.setSnapValues({rotate:Number(n.target.value)||15})}),e.jsx(l,{variant:"caption",tone:"muted",children:"Scale"}),e.jsx(m,{type:"number",value:a.snapValues.scale,step:.05,min:.01,onChange:n=>a.setSnapValues({scale:Number(n.target.value)||.25})})]}),t==="2d"&&e.jsxs(e.Fragment,{children:[[["Use Rotation Snap",a.rotationSnap,()=>a.setRotationSnap(!a.rotationSnap)],["Use Scale Snap",a.scaleSnap,()=>a.setScaleSnap(!a.scaleSnap)],["Snap Relative",a.snap2D.relative,()=>a.setSnap2D({relative:!a.snap2D.relative})],["Use Pixel Snap",a.snap2D.pixel,()=>a.setSnap2D({pixel:!a.snap2D.pixel})]].map(([n,p,g])=>e.jsxs(b,{gap:2,align:"center",role:"menuitemcheckbox","aria-checked":p,onClick:g,children:[e.jsx(y,{checked:p,readOnly:!0}),e.jsx(l,{children:n})]},n)),e.jsx(l,{variant:"caption",tone:"muted",children:"Smart Snapping"}),[["parent","Snap to Parent"],["others","Snap to Other Nodes"],["sides","Snap to Node Sides"],["center","Snap to Node Center"],["guides","Snap to Guides"]].map(([n,p])=>e.jsxs(b,{gap:2,align:"center",role:"menuitemcheckbox","aria-checked":a.smartSnap[n],onClick:()=>a.setSmartSnap({[n]:!a.smartSnap[n]}),children:[e.jsx(y,{checked:a.smartSnap[n],readOnly:!0}),e.jsx(l,{children:p})]},n))]}),t==="3d"&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{gap:2,align:"center",onClick:()=>a.toggleSnapToSurface(),children:[e.jsx(y,{checked:a.snapToSurface,readOnly:!0}),e.jsx(l,{children:"Snap to Surface"})]}),e.jsxs(l,{variant:"caption",tone:"dim",children:["Hold ",e.jsx(C,{children:"Ctrl"})," while dragging to snap once ·"," ",e.jsx(C,{children:v("viewport.toggleSnap")})," toggles"]}),e.jsxs(l,{variant:"caption",tone:"dim",children:["Hold ",e.jsx(C,{children:v("viewport.vertexSnapHold")})," during translate for vertex snap"]})]})]})})]})}const q={"active-element":"Active Element","median-point":"Median Point","individual-origins":"Individual Origins"};function W({store:a}){const t=["active-element","median-point","individual-origins"],r=`Pivot: ${q[a.pivotMode]}`;return e.jsx(u,{text:r,hotkey:v("viewport.cyclePivot"),children:e.jsx(f,{"aria-label":r,"aria-pressed":a.pivotMode!=="active-element",variant:"secondary",onClick:()=>{const s=t.indexOf(a.pivotMode);a.setPivotMode(t[(s+1)%t.length])},children:e.jsx(d,{icon:K,size:"md"})})})}const J={auto:"Auto",pivot:"Pivot",center:"Center"};function Q({store:a}){const t=["auto","pivot","center"],r=`Anchor: ${J[a.gizmoAnchor]}`;return e.jsx(u,{text:r,children:e.jsx(f,{"aria-label":r,"aria-pressed":a.gizmoAnchor!=="auto",variant:"secondary",onClick:()=>{const s=t.indexOf(a.gizmoAnchor);a.setGizmoAnchor(t[(s+1)%t.length])},children:e.jsx(d,{icon:a.gizmoAnchor==="center"?_:X,size:"md"})})})}function Z({store:a}){const[t,r]=c.useState(!1),s=c.useRef(null);return c.useEffect(()=>{if(!t)return;const i=o=>{s.current?.contains(o.target)||r(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t]),e.jsxs("div",{ref:s,className:"volter-viewport-popover-anchor",children:[e.jsx(u,{text:"Transform options",children:e.jsx(f,{"aria-label":"Transform options","aria-haspopup":"dialog","aria-expanded":t,variant:"secondary",onClick:()=>r(i=>!i),children:e.jsx(d,{icon:Y,size:"md"})})}),t?e.jsx(M,{style:{minWidth:240},children:e.jsxs(A,{gap:3,children:[e.jsxs(w,{size:"compact",variant:"ghost",onClick:()=>{a.snapSelectionToFloor(),r(!1)},children:["Snap Selection to Floor ",e.jsx(C,{children:v("viewport.snapToFloor")})]}),e.jsxs(b,{gap:2,align:"center",onClick:()=>a.togglePreserveChildrenTransform(),style:{cursor:"pointer"},children:[e.jsx(y,{checked:a.preserveChildrenTransform,readOnly:!0}),e.jsx(l,{children:"Preserve Children Transform"})]}),e.jsx(l,{variant:"caption",tone:"dim",children:"Keep source-writable children fixed in world space while their parent moves."})]})}):null]})}function ee({store:a}){const[t,r]=c.useState(!1),s=c.useRef(null),i=a.transformSpace==="world"?"Global":"Local";return e.jsxs("div",{className:"volter-viewport-popover-anchor",children:[e.jsx(u,{text:`Transform orientation: ${i}`,children:e.jsxs(w,{ref:s,type:"button",size:"compact",variant:"secondary","aria-label":`Transform orientation: ${i}`,"aria-haspopup":"menu","aria-expanded":t,onClick:()=>r(o=>!o),className:"volter-transform-orientation-trigger",children:[e.jsx(d,{icon:a.transformSpace==="world"?L:V,size:"sm"}),e.jsx("span",{children:i}),e.jsx(d,{icon:z,size:"xs"})]})}),t&&e.jsx($,{anchorRef:s,align:"start",clamp:!0,"aria-label":"Transform orientation",onDismiss:()=>r(!1),children:["world","local"].map(o=>e.jsxs(U,{role:"menuitemradio","aria-checked":a.transformSpace===o,onSelect:()=>{a.setTransformSpace(o),r(!1)},children:[e.jsx("span",{className:"volter-menu-check",children:a.transformSpace===o&&e.jsx(d,{icon:H,size:"xs"})}),o==="world"?"Global":"Local"]},o))})]})}function ie({store:a}={}){const t=N(),r=a??t;c.useSyncExternalStore(r.subscribe,r.getShellSnapshot??r.getSnapshot),c.useSyncExternalStore(O,k,k);const[s,i]=c.useState(null),o=s?.closest(".volter-stage-bar")!=null;return e.jsxs(F,{compact:!0,label:"Transform controls","data-testid":"transform-header-controls",className:"volter-transform-header-controls",children:[e.jsx("span",{ref:i,hidden:!0}),e.jsx(ee,{store:r}),e.jsxs(R,{children:[e.jsx(W,{store:r}),e.jsx(Q,{store:r})]}),e.jsx(I,{store:r,size:"default",variant:"secondary",showValues:o}),e.jsx(Z,{store:r})]})}const ae=()=>()=>{},E=()=>null;function le({dimensions:a="3d",door:t,store:r,otherToolActive:s=!1,onToolArmed:i,viewTools:o,trailingTools:S}={}){const j=N(),n=r??j;c.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),c.useSyncExternalStore(O,k,k);const p=c.useSyncExternalStore(t?.subscribe??ae,t?.armed??E,t?.armed??E),g=[{mode:"translate",faIcon:h.tool.move,action:"transform.translate",label:"Move"},{mode:"rotate",faIcon:h.tool.rotate,action:"transform.rotate",label:"Rotate"},{mode:"scale",faIcon:h.tool.scale,action:"transform.scale",label:"Scale"}];return e.jsxs(P,{label:"Transform tools","data-testid":a==="2d"?"canvas-2d-toolstrip":"threejs-toolstrip",className:"volter-viewport-toolbar volter-viewport-toolbar-left",children:[t?null:e.jsx(D,{faIcon:h.tool.select,action:"transform.select",label:"Select",active:!s&&(n.transformMode==="select"||a==="2d"&&n.transformMode==="combined"),onArm:()=>{i?.(),T(n,"select")}}),g.map(x=>e.jsx(D,{faIcon:x.faIcon,action:x.action,label:x.label,active:!s&&(t?p===x.mode:n.transformMode===x.mode),onArm:()=>{i?.(),t?t.begin(x.mode):T(n,x.mode)}},x.mode)),t||a==="2d"?null:e.jsx(D,{faIcon:h.tool.transform,action:"transform.combined",label:"Transform (all handles)",active:n.transformMode==="combined",onArm:()=>T(n,"combined")}),o,a==="2d"?e.jsx(I,{store:n,dimensions:"2d"}):null,S]})}export{ie as T,le as a};
@@ -1 +1 @@
1
- import{a}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{dm as i,dn as n,dp as o,al as t,dq as r}from"./index-ClgrFOcX.js";function u(){const e=s.useSyncExternalStore(i,n,n);return e?a.jsx("div",{role:"status","aria-live":"polite","data-testid":"transient-hint",style:{position:"absolute",left:"50%",bottom:r[6],transform:"translateX(-50%)",maxWidth:"min(440px, 80%)",padding:`${r[3]}px ${r[5]}px`,borderRadius:t.shape.medium,border:`1px solid ${t.boundary.strong}`,background:t.surface.overlay,color:t.content.primary,fontSize:"var(--volter-font-base)",lineHeight:1.4,textAlign:"center",pointerEvents:"none",zIndex:o.toast},children:e.message},e.id):null}export{u as T};
1
+ import{a}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{dm as i,dn as n,dp as o,al as t,dq as r}from"./index-BfqJPhFO.js";function u(){const e=s.useSyncExternalStore(i,n,n);return e?a.jsx("div",{role:"status","aria-live":"polite","data-testid":"transient-hint",style:{position:"absolute",left:"50%",bottom:r[6],transform:"translateX(-50%)",maxWidth:"min(440px, 80%)",padding:`${r[3]}px ${r[5]}px`,borderRadius:t.shape.medium,border:`1px solid ${t.boundary.strong}`,background:t.surface.overlay,color:t.content.primary,fontSize:"var(--volter-font-base)",lineHeight:1.4,textAlign:"center",pointerEvents:"none",zIndex:o.toast},children:e.message},e.id):null}export{u as T};
@@ -1 +1 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{aL as c,aZ as x}from"./index-ClgrFOcX.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function H({assetPath:s}){const[p,a]=r.useState(!1),[d,m]=r.useState(null),i=s;r.useEffect(()=>{a(!1)},[i]);const n=s.split("/").pop()??s,l=r.useCallback(e=>{if(e){if(e.error){a(!0);return}e.videoWidth<=0||m(o=>o&&o.w===e.videoWidth&&o.h===e.videoHeight?o:{w:e.videoWidth,h:e.videoHeight})}},[]);return t.jsxs("div",{"data-testid":"video-asset-document",style:{height:"100%",minHeight:240,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px"},children:[t.jsx(c,{tone:"dim",variant:"label",children:n}),d&&t.jsxs(c,{tone:"muted",variant:"code",children:[d.w," × ",d.h]})]}),t.jsx("div",{className:"volter-asset-transparency-well",style:{flex:1,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center",padding:12},children:p?t.jsxs("div",{style:{color:x[2],fontSize:12,textAlign:"center"},children:[n," could not be played from ",i,". The file may be missing, or its codec may not be one this browser decodes."]}):t.jsx("video",{src:i,controls:!0,playsInline:!0,preload:"metadata",ref:l,onError:()=>a(!0),onLoadedMetadata:e=>l(e.currentTarget),style:{maxWidth:"100%",maxHeight:"100%",display:"block"}},i)})]})}export{H as VideoViewer};
1
+ import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{aL as c,aZ as x}from"./index-BfqJPhFO.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function H({assetPath:s}){const[p,a]=r.useState(!1),[d,m]=r.useState(null),i=s;r.useEffect(()=>{a(!1)},[i]);const n=s.split("/").pop()??s,l=r.useCallback(e=>{if(e){if(e.error){a(!0);return}e.videoWidth<=0||m(o=>o&&o.w===e.videoWidth&&o.h===e.videoHeight?o:{w:e.videoWidth,h:e.videoHeight})}},[]);return t.jsxs("div",{"data-testid":"video-asset-document",style:{height:"100%",minHeight:240,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px"},children:[t.jsx(c,{tone:"dim",variant:"label",children:n}),d&&t.jsxs(c,{tone:"muted",variant:"code",children:[d.w," × ",d.h]})]}),t.jsx("div",{className:"volter-asset-transparency-well",style:{flex:1,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center",padding:12},children:p?t.jsxs("div",{style:{color:x[2],fontSize:12,textAlign:"center"},children:[n," could not be played from ",i,". The file may be missing, or its codec may not be one this browser decodes."]}):t.jsx("video",{src:i,controls:!0,playsInline:!0,preload:"metadata",ref:l,onError:()=>a(!0),onLoadedMetadata:e=>l(e.currentTarget),style:{maxWidth:"100%",maxHeight:"100%",display:"block"}},i)})]})}export{H as VideoViewer};
@@ -1 +1 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{fz as C,bB as b,a7 as c,bD as g,bC as w,a6 as y,bz as j,db as S,bw as f,aM as v,fA as M,fB as z,bA as N,al as V}from"./index-ClgrFOcX.js";import{r as x}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";function T(){return e.jsxs("svg",{viewBox:"0 0 16 16",className:"volter-viewport-overlays-glyph","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{d:"M5.24 4.51 A5.3 5.3 0 1 1 11.89 11.16 A5.85 5.85 0 0 0 5.24 4.51 Z",fill:"currentColor"}),e.jsx("circle",{cx:"6.1",cy:"10.3",r:"4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"})]})}function D({label:r="Overlays",choices:p,master:l,glyph:t,word:h}){const[s,o]=x.useState(!1),i=x.useRef(null),m=p.some(n=>n.enabled),d=l?.enabled??m,u=t??e.jsx(c,{icon:d?M:z,size:"md"});x.useEffect(()=>{if(!s)return;const n=k=>{i.current&&!i.current.contains(k.target)&&o(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[s]);const a=s?e.jsxs(C,{className:"volter-helpers-menu",onDismiss:()=>o(!1),children:[l?e.jsxs(e.Fragment,{children:[e.jsxs(b,{role:"menuitemcheckbox","aria-checked":l.enabled,onSelect:l.onToggle,children:[e.jsx("span",{className:"volter-menu-check",children:l.enabled&&e.jsx(c,{icon:g,size:"xs"})}),"Show ",r]}),e.jsx(w,{})]}):null,p.map(n=>e.jsxs(b,{role:"menuitemcheckbox","aria-checked":n.enabled,disabled:n.disabled,onSelect:n.onToggle,children:[e.jsx("span",{className:"volter-menu-check",children:n.enabled&&e.jsx(c,{icon:g,size:"xs"})}),n.label]},n.id))]}):null;return h!==void 0?e.jsxs("div",{ref:i,className:"volter-viewport-popover-anchor",children:[e.jsxs(y,{variant:"ghost",size:"comfortable","aria-label":`Choose ${r.toLowerCase()}`,"aria-expanded":s,onClick:()=>o(!s),children:[h,e.jsx(c,{icon:j,size:"xs"})]}),a]}):e.jsxs("div",{ref:i,className:"volter-viewport-popover-anchor",children:[l?e.jsxs(S,{children:[e.jsx(f,{text:`${r}: ${d?"On":"Off"}`,children:e.jsx(v,{"aria-label":`Toggle ${r.toLowerCase()}`,"aria-pressed":d,size:"comfortable",onClick:l.onToggle,children:u})}),e.jsx(v,{"aria-label":`Choose ${r.toLowerCase()}`,"aria-expanded":s,size:"comfortable",onClick:()=>o(!s),children:e.jsx(c,{icon:j,size:"xs"})})]}):e.jsx(f,{text:`${r}: ${d?"On":"Off"}`,children:e.jsx(v,{"aria-label":`Choose ${r.toLowerCase()}`,"aria-expanded":s,"aria-pressed":d,size:"comfortable",onClick:()=>o(!s),children:u})}),a]})}const O=[{mode:"solid",label:"Material",description:"Authored materials and lighting"},{mode:"clay",label:"Solid",description:"Neutral flat-shaded geometry"},{mode:"unlit",label:"Unlit",description:"Base color without scene lighting"},{mode:"wireframe",label:"Wireframe",description:"Renderable triangle edges"},{mode:"matcap",label:"Matcap",description:"Neutral clay sphere — form without color"},{mode:"normals",label:"Normals",description:"Surface-normal direction colors"},{mode:"overdraw",label:"Overdraw",description:"Additive overlap visualization"}],$={preview:"Material Preview",rendered:"Rendered",uv:"UV","vertex-colors":"Vertex Colors"},I=[{mode:"wireframe",glyph:"wireframe",label:"Wireframe"},{mode:"clay",glyph:"sphere",label:"Solid"},{mode:"solid",glyph:"preview",label:"Material"}];function G(r){return[{mode:"wireframe",glyph:"wireframe",label:"Wireframe"},{mode:"solid",glyph:"sphere",label:"Solid"},...r.has("preview")?[{mode:"preview",glyph:"preview",label:"Material Preview"}]:[],...r.has("rendered")?[{mode:"rendered",glyph:"rendered",label:"Rendered"}]:[]]}function E({glyph:r}){return e.jsxs("svg",{viewBox:"0 0 16 16",className:"volter-viewport-shading-glyph","aria-hidden":"true",focusable:"false",children:[r==="sphere"||r==="rendered"?e.jsx("circle",{cx:"8",cy:"8",r:"7.3",fill:"currentColor"}):e.jsx("circle",{cx:"8",cy:"8",r:"7.3",fill:"none",stroke:"currentColor",strokeWidth:"1.05"}),r==="wireframe"?e.jsxs("g",{stroke:"currentColor",strokeWidth:"1.05",children:[e.jsx("line",{x1:"1.7",y1:"5.4",x2:"14.3",y2:"5.4"}),e.jsx("line",{x1:"1.7",y1:"10.6",x2:"14.3",y2:"10.6"}),e.jsx("line",{x1:"5.4",y1:"1.7",x2:"5.4",y2:"14.3"})]}):null,r==="rendered"?e.jsx("circle",{cx:"5.6",cy:"5.6",r:"2.3",fill:"var(--volter-surface-overlay, #ffffff)",fillOpacity:"0.7"}):null,r==="preview"?e.jsx("path",{d:"M7.73 1.23 L7.73 10.43 L1.22 8.04 A6.78 6.78 0 0 1 7.73 1.23 Z",fill:"currentColor"}):null]})}function A({mode:r,onChange:p,choices:l,disabled:t=!1,segments:h,children:s}){const[o,i]=x.useState(!1),m=x.useRef(null),d=l.find(a=>a.mode===r)??l[0];if(!d)return null;const u=o&&!t?e.jsxs(N,{id:"volter-viewport-shading-menu",anchorRef:m,"aria-label":"Viewport shading modes",onDismiss:()=>i(!1),style:{minWidth:230},children:[l.map(a=>e.jsxs(b,{role:"menuitemradio","aria-checked":a.mode===r,onSelect:()=>{p(a.mode),i(!1)},style:{display:"grid",gridTemplateColumns:"14px 1fr",gap:7},children:[e.jsx("span",{style:{opacity:a.mode===r?1:0},children:e.jsx(c,{icon:g,size:"xs"})}),e.jsxs("span",{children:[e.jsx("span",{style:{display:"block"},children:a.label}),e.jsx("span",{style:{display:"block",color:V.content.dim,fontSize:10},children:a.description})]})]},a.mode)),s?e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx("div",{className:"volter-viewport-shading-options",children:s})]}):null]}):null;return h?e.jsxs("div",{className:"volter-viewport-popover-anchor",children:[e.jsxs("span",{className:"volter-viewport-shading-segments",role:"group","aria-label":"Viewport shading",children:[h.map(a=>e.jsx(f,{text:`Viewport shading: ${a.label}`,children:e.jsx(v,{size:"compact",shape:"segment",variant:"secondary","aria-pressed":a.mode===r,"aria-label":`Viewport shading: ${a.label}`,disabled:t,onClick:()=>p(a.mode),children:e.jsx(E,{glyph:a.glyph})})},a.mode)),e.jsx(f,{text:"Shading options",children:e.jsx(v,{ref:m,size:"compact",shape:"segment",variant:"secondary","aria-label":"Shading options","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?"volter-viewport-shading-menu":void 0,disabled:t,onClick:()=>i(a=>!a),children:e.jsx(c,{icon:j,size:"xs"})})})]}),u]}):e.jsxs("div",{style:{position:"relative"},children:[e.jsx(f,{text:`Viewport shading: ${d.label}`,children:e.jsxs(y,{ref:m,type:"button",size:"compact",variant:"secondary","aria-label":`Viewport shading: ${d.label}`,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?"volter-viewport-shading-menu":void 0,disabled:t,onClick:()=>i(a=>!a),style:{display:"inline-flex",alignItems:"center",gap:5,minWidth:66},children:[e.jsx("span",{children:d.label}),e.jsx(c,{icon:j,size:"xs"})]})}),u]})}function F({mode:r,onChange:p,disabled:l=!1,words:t}){const h=x.useMemo(()=>{const s=O.map(i=>({...i,label:t?.[i.mode]??i.label}));if(s.some(i=>i.mode===r))return s;const o=t?.[r]??$[r]??r;return[...s,{mode:r,label:o,description:"The mode this view is drawn in"}]},[t,r]);return e.jsx(A,{mode:r,onChange:p,choices:h,disabled:l})}export{A as V,I as a,D as b,T as c,F as d,G as p,O as v};
1
+ import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{fz as C,bB as b,a7 as c,bD as g,bC as w,a6 as y,bz as j,db as S,bw as f,aM as v,fA as M,fB as z,bA as N,al as V}from"./index-BfqJPhFO.js";import{r as x}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";function T(){return e.jsxs("svg",{viewBox:"0 0 16 16",className:"volter-viewport-overlays-glyph","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{d:"M5.24 4.51 A5.3 5.3 0 1 1 11.89 11.16 A5.85 5.85 0 0 0 5.24 4.51 Z",fill:"currentColor"}),e.jsx("circle",{cx:"6.1",cy:"10.3",r:"4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"})]})}function D({label:r="Overlays",choices:p,master:l,glyph:t,word:h}){const[s,o]=x.useState(!1),i=x.useRef(null),m=p.some(n=>n.enabled),d=l?.enabled??m,u=t??e.jsx(c,{icon:d?M:z,size:"md"});x.useEffect(()=>{if(!s)return;const n=k=>{i.current&&!i.current.contains(k.target)&&o(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[s]);const a=s?e.jsxs(C,{className:"volter-helpers-menu",onDismiss:()=>o(!1),children:[l?e.jsxs(e.Fragment,{children:[e.jsxs(b,{role:"menuitemcheckbox","aria-checked":l.enabled,onSelect:l.onToggle,children:[e.jsx("span",{className:"volter-menu-check",children:l.enabled&&e.jsx(c,{icon:g,size:"xs"})}),"Show ",r]}),e.jsx(w,{})]}):null,p.map(n=>e.jsxs(b,{role:"menuitemcheckbox","aria-checked":n.enabled,disabled:n.disabled,onSelect:n.onToggle,children:[e.jsx("span",{className:"volter-menu-check",children:n.enabled&&e.jsx(c,{icon:g,size:"xs"})}),n.label]},n.id))]}):null;return h!==void 0?e.jsxs("div",{ref:i,className:"volter-viewport-popover-anchor",children:[e.jsxs(y,{variant:"ghost",size:"comfortable","aria-label":`Choose ${r.toLowerCase()}`,"aria-expanded":s,onClick:()=>o(!s),children:[h,e.jsx(c,{icon:j,size:"xs"})]}),a]}):e.jsxs("div",{ref:i,className:"volter-viewport-popover-anchor",children:[l?e.jsxs(S,{children:[e.jsx(f,{text:`${r}: ${d?"On":"Off"}`,children:e.jsx(v,{"aria-label":`Toggle ${r.toLowerCase()}`,"aria-pressed":d,size:"comfortable",onClick:l.onToggle,children:u})}),e.jsx(v,{"aria-label":`Choose ${r.toLowerCase()}`,"aria-expanded":s,size:"comfortable",onClick:()=>o(!s),children:e.jsx(c,{icon:j,size:"xs"})})]}):e.jsx(f,{text:`${r}: ${d?"On":"Off"}`,children:e.jsx(v,{"aria-label":`Choose ${r.toLowerCase()}`,"aria-expanded":s,"aria-pressed":d,size:"comfortable",onClick:()=>o(!s),children:u})}),a]})}const O=[{mode:"solid",label:"Material",description:"Authored materials and lighting"},{mode:"clay",label:"Solid",description:"Neutral flat-shaded geometry"},{mode:"unlit",label:"Unlit",description:"Base color without scene lighting"},{mode:"wireframe",label:"Wireframe",description:"Renderable triangle edges"},{mode:"matcap",label:"Matcap",description:"Neutral clay sphere — form without color"},{mode:"normals",label:"Normals",description:"Surface-normal direction colors"},{mode:"overdraw",label:"Overdraw",description:"Additive overlap visualization"}],$={preview:"Material Preview",rendered:"Rendered",uv:"UV","vertex-colors":"Vertex Colors"},I=[{mode:"wireframe",glyph:"wireframe",label:"Wireframe"},{mode:"clay",glyph:"sphere",label:"Solid"},{mode:"solid",glyph:"preview",label:"Material"}];function G(r){return[{mode:"wireframe",glyph:"wireframe",label:"Wireframe"},{mode:"solid",glyph:"sphere",label:"Solid"},...r.has("preview")?[{mode:"preview",glyph:"preview",label:"Material Preview"}]:[],...r.has("rendered")?[{mode:"rendered",glyph:"rendered",label:"Rendered"}]:[]]}function E({glyph:r}){return e.jsxs("svg",{viewBox:"0 0 16 16",className:"volter-viewport-shading-glyph","aria-hidden":"true",focusable:"false",children:[r==="sphere"||r==="rendered"?e.jsx("circle",{cx:"8",cy:"8",r:"7.3",fill:"currentColor"}):e.jsx("circle",{cx:"8",cy:"8",r:"7.3",fill:"none",stroke:"currentColor",strokeWidth:"1.05"}),r==="wireframe"?e.jsxs("g",{stroke:"currentColor",strokeWidth:"1.05",children:[e.jsx("line",{x1:"1.7",y1:"5.4",x2:"14.3",y2:"5.4"}),e.jsx("line",{x1:"1.7",y1:"10.6",x2:"14.3",y2:"10.6"}),e.jsx("line",{x1:"5.4",y1:"1.7",x2:"5.4",y2:"14.3"})]}):null,r==="rendered"?e.jsx("circle",{cx:"5.6",cy:"5.6",r:"2.3",fill:"var(--volter-surface-overlay, #ffffff)",fillOpacity:"0.7"}):null,r==="preview"?e.jsx("path",{d:"M7.73 1.23 L7.73 10.43 L1.22 8.04 A6.78 6.78 0 0 1 7.73 1.23 Z",fill:"currentColor"}):null]})}function A({mode:r,onChange:p,choices:l,disabled:t=!1,segments:h,children:s}){const[o,i]=x.useState(!1),m=x.useRef(null),d=l.find(a=>a.mode===r)??l[0];if(!d)return null;const u=o&&!t?e.jsxs(N,{id:"volter-viewport-shading-menu",anchorRef:m,"aria-label":"Viewport shading modes",onDismiss:()=>i(!1),style:{minWidth:230},children:[l.map(a=>e.jsxs(b,{role:"menuitemradio","aria-checked":a.mode===r,onSelect:()=>{p(a.mode),i(!1)},style:{display:"grid",gridTemplateColumns:"14px 1fr",gap:7},children:[e.jsx("span",{style:{opacity:a.mode===r?1:0},children:e.jsx(c,{icon:g,size:"xs"})}),e.jsxs("span",{children:[e.jsx("span",{style:{display:"block"},children:a.label}),e.jsx("span",{style:{display:"block",color:V.content.dim,fontSize:10},children:a.description})]})]},a.mode)),s?e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx("div",{className:"volter-viewport-shading-options",children:s})]}):null]}):null;return h?e.jsxs("div",{className:"volter-viewport-popover-anchor",children:[e.jsxs("span",{className:"volter-viewport-shading-segments",role:"group","aria-label":"Viewport shading",children:[h.map(a=>e.jsx(f,{text:`Viewport shading: ${a.label}`,children:e.jsx(v,{size:"compact",shape:"segment",variant:"secondary","aria-pressed":a.mode===r,"aria-label":`Viewport shading: ${a.label}`,disabled:t,onClick:()=>p(a.mode),children:e.jsx(E,{glyph:a.glyph})})},a.mode)),e.jsx(f,{text:"Shading options",children:e.jsx(v,{ref:m,size:"compact",shape:"segment",variant:"secondary","aria-label":"Shading options","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?"volter-viewport-shading-menu":void 0,disabled:t,onClick:()=>i(a=>!a),children:e.jsx(c,{icon:j,size:"xs"})})})]}),u]}):e.jsxs("div",{style:{position:"relative"},children:[e.jsx(f,{text:`Viewport shading: ${d.label}`,children:e.jsxs(y,{ref:m,type:"button",size:"compact",variant:"secondary","aria-label":`Viewport shading: ${d.label}`,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?"volter-viewport-shading-menu":void 0,disabled:t,onClick:()=>i(a=>!a),style:{display:"inline-flex",alignItems:"center",gap:5,minWidth:66},children:[e.jsx("span",{children:d.label}),e.jsx(c,{icon:j,size:"xs"})]})}),u]})}function F({mode:r,onChange:p,disabled:l=!1,words:t}){const h=x.useMemo(()=>{const s=O.map(i=>({...i,label:t?.[i.mode]??i.label}));if(s.some(i=>i.mode===r))return s;const o=t?.[r]??$[r]??r;return[...s,{mode:r,label:o,description:"The mode this view is drawn in"}]},[t,r]);return e.jsx(A,{mode:r,onChange:p,choices:h,disabled:l})}export{A as V,I as a,D as b,T as c,F as d,G as p,O as v};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/game-css-scope-transform-Wv0ZdTsR.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-ClgrFOcX.js","assets/index-nmcBqr7Y.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"])))=>i.map(i=>d[i]);
2
- import{_ as se,lR as Fe,lS as He,lT as De,Z as P,lU as je,jg as ze,Q as Ne,ab as pe,jM as Be,b$ as W,c0 as O,c1 as q,c3 as We}from"./index-ClgrFOcX.js";import{GAME_SCENES_SHAPE as Oe}from"./game-contract-seams-C22a4B79.js";import{g as qe,c as Ue,d as Ve,e as Ke,S as Ye}from"./capability-coverage-EnZ99FoT.js";import{i as Qe,b as Je,l as Ze}from"./ingest-source-persistence-CVU1rTj0.js";import{p as Xe}from"./contract-system-adapters-BDUpDoKd.js";const rn="contain: layout; visibility: visible;";function ae(e){return typeof e=="boolean"?e:e?.capture??!1}const ie="volterScopedCss";let le=null;function et(){return le??=Promise.all([se(()=>import("./game-css-scope-transform-Wv0ZdTsR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),se(()=>import("./index-ClgrFOcX.js").then(e=>e.u2),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10]))]).then(([{scopeGameCss:e},{GAME_CSS_SCOPE_SELECTOR:t}])=>n=>e({css:n,scopeSelector:t,styleSheetPath:"/"})),le}function tt(e){let t=null;const n=()=>et().then(i=>{t=i}),o=i=>{const g=i.textContent??"";if(g.length===0||i.dataset[ie]===g)return;if(!t){const y=g;i.textContent="",n().then(()=>{i.isConnected&&(i.textContent??"")===""&&(i.textContent=y,o(i))});return}let h;try{h=t(g)}catch{i.textContent="";return}i.dataset[ie]=h,i.textContent=h},a=i=>{if(i instanceof HTMLStyleElement)return i;const g=i.parentElement;return g instanceof HTMLStyleElement?g:null},u=new MutationObserver(i=>{const g=new Set;for(const h of i)if(h.type==="childList")for(const y of h.addedNodes){const w=a(y);if(w)g.add(w);else if(y instanceof Element)for(const d of y.querySelectorAll("style"))g.add(d)}else if(h.type==="characterData"){const y=a(h.target);y&&g.add(y)}for(const h of g)h.isConnected&&o(h)});u.observe(e,{childList:!0,subtree:!0,characterData:!0});for(const i of e.querySelectorAll("style"))o(i);return u}class nt{surfaceElement=null;injectedStyles=null;get surface(){return this.surfaceElement}set surface(t){this.injectedStyles?.disconnect(),this.injectedStyles=null,this.surfaceElement=t,t&&(this.injectedStyles=tt(t))}pageTitle="";executingClassicScript=null;headElement=null;resizeBus=new EventTarget;resizeListeners=new Map;addResizeListener(t,n){let o=this.resizeListeners.get(t);o||(o=new Set,this.resizeListeners.set(t,o)),o.add(ae(n)),this.resizeBus.addEventListener("resize",t,n)}removeResizeListener(t,n){const o=this.resizeListeners.get(t);o&&(o.delete(ae(n)),o.size===0&&this.resizeListeners.delete(t)),this.resizeBus.removeEventListener("resize",t,n)}get gameResizesItself(){return this.resizeListeners.size>0}reset(){this.headElement?.remove(),this.headElement=null,this.pageTitle="",this.executingClassicScript=null,this.surface=null,this.resizeListeners.clear(),this.resizeBus=new EventTarget}dispatchResize(){this.resizeBus.dispatchEvent(new Event("resize"))}viewport(){const t=this.surface;return t?{width:t.clientWidth,height:t.clientHeight}:null}get title(){return this.pageTitle}set title(t){this.pageTitle=String(t)}get currentScript(){return this.executingClassicScript}withCurrentScript(t,n){const o=this.executingClassicScript,a=document.createElement("script");a.src=t,this.executingClassicScript=a;try{return n()}finally{this.executingClassicScript=o}}head(){const t=this.surface;if(!t)return null;if(!this.headElement||this.headElement.parentElement!==t){const n=document.createElement("div");n.dataset.volterGameHead="",n.hidden=!0,t.prepend(n),this.headElement=n}return this.headElement}}function rt(e){const t=`(__volterHost.__volterGameRealm?__volterHost.__volterGameRealm(${JSON.stringify("")}):null)`;return ot.replace("__VOLTER_REALM__",t)}const ot=`const __volterHost=({}).constructor.constructor('return globalThis')(),__volterR=__VOLTER_REALM__,__volterGlobal=((__volterR&&__volterR.globalThis)||__volterHost.__volterGameWindow||__volterHost),globalThis=__volterGlobal,__volterSched=((__volterR&&__volterR.timers)||__volterHost.__volterGameTimers||__volterHost),__volterBind=function(n){var f=__volterSched[n];return typeof f==='function'?f.bind(__volterSched):f;},console=((__volterR&&__volterR.console)||__volterHost.__volterGameConsole||__volterHost.console),window=((__volterR&&__volterR.window)||__volterHost.__volterGameWindow||__volterGlobal.window),document=((__volterR&&__volterR.document)||__volterHost.__volterGameDocument||__volterGlobal.document),__volterWindowBind=function(n){var f=window&&window[n];return typeof f==='function'?f.bind(window):f;},localStorage=(window&&window.localStorage),sessionStorage=(window&&window.sessionStorage),location=(window&&window.location),addEventListener=__volterWindowBind('addEventListener'),removeEventListener=__volterWindowBind('removeEventListener'),dispatchEvent=__volterWindowBind('dispatchEvent'),fetch=function(){var f=__volterHost.__volterProjectFetch;return f?f.apply(null,arguments):__volterHost.fetch.apply(__volterHost,arguments)},setTimeout=__volterBind('setTimeout'),clearTimeout=__volterBind('clearTimeout'),setInterval=__volterBind('setInterval'),clearInterval=__volterBind('clearInterval'),requestAnimationFrame=__volterBind('requestAnimationFrame'),cancelAnimationFrame=__volterBind('cancelAnimationFrame');
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/game-css-scope-transform-5yv5zl6t.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-BfqJPhFO.js","assets/index-nmcBqr7Y.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"])))=>i.map(i=>d[i]);
2
+ import{_ as se,lR as Fe,lS as He,lT as De,Z as P,lU as je,jg as ze,Q as Ne,ab as pe,jM as Be,b$ as W,c0 as O,c1 as q,c3 as We}from"./index-BfqJPhFO.js";import{GAME_SCENES_SHAPE as Oe}from"./game-contract-seams-CuBiefwV.js";import{g as qe,c as Ue,d as Ve,e as Ke,S as Ye}from"./capability-coverage-aT7nf05J.js";import{i as Qe,b as Je,l as Ze}from"./ingest-source-persistence-CrXFBT__.js";import{p as Xe}from"./contract-system-adapters-DIpeIRm_.js";const rn="contain: layout; visibility: visible;";function ae(e){return typeof e=="boolean"?e:e?.capture??!1}const ie="volterScopedCss";let le=null;function et(){return le??=Promise.all([se(()=>import("./game-css-scope-transform-5yv5zl6t.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),se(()=>import("./index-BfqJPhFO.js").then(e=>e.u2),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10]))]).then(([{scopeGameCss:e},{GAME_CSS_SCOPE_SELECTOR:t}])=>n=>e({css:n,scopeSelector:t,styleSheetPath:"/"})),le}function tt(e){let t=null;const n=()=>et().then(i=>{t=i}),o=i=>{const g=i.textContent??"";if(g.length===0||i.dataset[ie]===g)return;if(!t){const y=g;i.textContent="",n().then(()=>{i.isConnected&&(i.textContent??"")===""&&(i.textContent=y,o(i))});return}let h;try{h=t(g)}catch{i.textContent="";return}i.dataset[ie]=h,i.textContent=h},a=i=>{if(i instanceof HTMLStyleElement)return i;const g=i.parentElement;return g instanceof HTMLStyleElement?g:null},u=new MutationObserver(i=>{const g=new Set;for(const h of i)if(h.type==="childList")for(const y of h.addedNodes){const w=a(y);if(w)g.add(w);else if(y instanceof Element)for(const d of y.querySelectorAll("style"))g.add(d)}else if(h.type==="characterData"){const y=a(h.target);y&&g.add(y)}for(const h of g)h.isConnected&&o(h)});u.observe(e,{childList:!0,subtree:!0,characterData:!0});for(const i of e.querySelectorAll("style"))o(i);return u}class nt{surfaceElement=null;injectedStyles=null;get surface(){return this.surfaceElement}set surface(t){this.injectedStyles?.disconnect(),this.injectedStyles=null,this.surfaceElement=t,t&&(this.injectedStyles=tt(t))}pageTitle="";executingClassicScript=null;headElement=null;resizeBus=new EventTarget;resizeListeners=new Map;addResizeListener(t,n){let o=this.resizeListeners.get(t);o||(o=new Set,this.resizeListeners.set(t,o)),o.add(ae(n)),this.resizeBus.addEventListener("resize",t,n)}removeResizeListener(t,n){const o=this.resizeListeners.get(t);o&&(o.delete(ae(n)),o.size===0&&this.resizeListeners.delete(t)),this.resizeBus.removeEventListener("resize",t,n)}get gameResizesItself(){return this.resizeListeners.size>0}reset(){this.headElement?.remove(),this.headElement=null,this.pageTitle="",this.executingClassicScript=null,this.surface=null,this.resizeListeners.clear(),this.resizeBus=new EventTarget}dispatchResize(){this.resizeBus.dispatchEvent(new Event("resize"))}viewport(){const t=this.surface;return t?{width:t.clientWidth,height:t.clientHeight}:null}get title(){return this.pageTitle}set title(t){this.pageTitle=String(t)}get currentScript(){return this.executingClassicScript}withCurrentScript(t,n){const o=this.executingClassicScript,a=document.createElement("script");a.src=t,this.executingClassicScript=a;try{return n()}finally{this.executingClassicScript=o}}head(){const t=this.surface;if(!t)return null;if(!this.headElement||this.headElement.parentElement!==t){const n=document.createElement("div");n.dataset.volterGameHead="",n.hidden=!0,t.prepend(n),this.headElement=n}return this.headElement}}function rt(e){const t=`(__volterHost.__volterGameRealm?__volterHost.__volterGameRealm(${JSON.stringify("")}):null)`;return ot.replace("__VOLTER_REALM__",t)}const ot=`const __volterHost=({}).constructor.constructor('return globalThis')(),__volterR=__VOLTER_REALM__,__volterGlobal=((__volterR&&__volterR.globalThis)||__volterHost.__volterGameWindow||__volterHost),globalThis=__volterGlobal,__volterSched=((__volterR&&__volterR.timers)||__volterHost.__volterGameTimers||__volterHost),__volterBind=function(n){var f=__volterSched[n];return typeof f==='function'?f.bind(__volterSched):f;},console=((__volterR&&__volterR.console)||__volterHost.__volterGameConsole||__volterHost.console),window=((__volterR&&__volterR.window)||__volterHost.__volterGameWindow||__volterGlobal.window),document=((__volterR&&__volterR.document)||__volterHost.__volterGameDocument||__volterGlobal.document),__volterWindowBind=function(n){var f=window&&window[n];return typeof f==='function'?f.bind(window):f;},localStorage=(window&&window.localStorage),sessionStorage=(window&&window.sessionStorage),location=(window&&window.location),addEventListener=__volterWindowBind('addEventListener'),removeEventListener=__volterWindowBind('removeEventListener'),dispatchEvent=__volterWindowBind('dispatchEvent'),fetch=function(){var f=__volterHost.__volterProjectFetch;return f?f.apply(null,arguments):__volterHost.fetch.apply(__volterHost,arguments)},setTimeout=__volterBind('setTimeout'),clearTimeout=__volterBind('clearTimeout'),setInterval=__volterBind('setInterval'),clearInterval=__volterBind('clearInterval'),requestAnimationFrame=__volterBind('requestAnimationFrame'),cancelAnimationFrame=__volterBind('cancelAnimationFrame');
3
3
  `,on=rt(),st=new Set(["href","protocol","host","hostname","port","pathname","search"]),at=new Set(["assign","replace","reload"]),it=new Set(["play","project","hub","scene","ingest","create-from","checkout_id"]);function lt(e){return it.has(e)||e.startsWith("volter")}function _e(e){const t=e.startsWith("?")?e.slice(1):e;if(!t)return"";const n=new URLSearchParams;for(const[a,u]of new URLSearchParams(t))lt(a)||n.append(a,u);const o=n.toString();return o.length>0?`?${o}`:""}function ct(e){try{const t=new URL(e);return t.search=_e(t.search),t.href}catch{return e}}function ut(e,t,n){const o=Object.create(null);return new Proxy(o,{get(a,u){if(typeof u=="string"&&at.has(u))return(...g)=>{u==="reload"&&n?.reloadGame?.()||t(`location.${u}(${g.map(h=>String(h)).join(", ")})`)};if(u==="search")return _e(String(Reflect.get(e,"search")??""));if(u==="href")return ct(String(Reflect.get(e,"href")??""));const i=Reflect.get(e,u);return typeof i=="function"?i.bind(e):i},set(a,u,i){return typeof u=="string"&&st.has(u)?(t(`location.${u} = ${String(i)}`),!0):Reflect.set(e,u,i)},has(a,u){return Reflect.has(e,u)}})}function dt(e){return`Ingested game attempted to navigate the editor away (${e}) — refused. A game running in-realm shares the editor's document, so leaving it would take the whole session with it; game code sees a scoped \`location\` facade whose reads pass through and whose navigating writes do not (packages/editor-game/src/host/game-location-guard.ts).`}function ft(e){let t=0,n=0;const o=Object.create(Object.getPrototypeOf(e)),a=w=>(t+=1,e.getItem(String(w))),u=(w,d)=>{n+=1,e.setItem(String(w),String(d))},i=w=>{n+=1,e.removeItem(String(w))},g=()=>{n+=1,e.clear()},h=w=>(t+=1,e.key(Number(w)));return{storage:new Proxy(o,{get(w,d){return d==="length"?(t+=1,e.length):d==="getItem"?a:d==="setItem"?u:d==="removeItem"?i:d==="clear"?g:d==="key"?h:d===Symbol.toStringTag?"Storage":typeof d=="string"?a(d)??void 0:Reflect.get(o,d,o)},set(w,d,p){return typeof d!="string"?Reflect.set(o,d,p,o):(u(d,String(p)),!0)},deleteProperty(w,d){return typeof d!="string"?Reflect.deleteProperty(o,d):(i(d),!0)},defineProperty(w,d,p){return typeof d!="string"||!("value"in p)?!1:(u(d,String(p.value)),!0)},has(w,d){return typeof d!="string"?Reflect.has(o,d):d in o?!0:a(d)!==null},ownKeys(){const w=[];for(let d=0;d<e.length;d+=1){const p=e.key(d);p!==null&&w.push(p)}return w},getOwnPropertyDescriptor(w,d){if(typeof d!="string")return;const p=e.getItem(d);return p===null?void 0:{configurable:!0,enumerable:!0,value:p,writable:!0}}}),stats:()=>({reads:t,writes:n})}}function mt(e){return!e||e.loop!=="gated"&&e.loop!=="self-driven"?null:{verdict:e.loop,evidence:e.evidence}}function gt(e){let t="open",n=0,o=0,a=0,u=0,i=0,g=0,h=0,y=0,w=!1;const d=[],p=new Set,T=new Set,I=new Set,S=new Map,A=()=>(t==="held"?h:e.now())-y,c=m=>{a++,t==="held"&&u++;try{m.run()}catch(_){e.setTimeout(()=>{throw _},0)}},f=()=>{const m=d.splice(0,d.length);S.clear();for(const _ of m)c(_)},s=m=>{d.push(m)},r=m=>()=>{if(t==="held"){s(m);return}c(m)},l=()=>{t!=="held"&&(h=e.now(),t="held")},v=()=>{t==="held"&&(y+=e.now()-h)};return{schedulers:{setTimeout(m,_,...E){if(o++,w)return-1;const R={run:()=>m(...E)};let L=-1;const C=r(R);return L=e.setTimeout(()=>{p.delete(L),C()},_),p.add(L),R.timerId=L,L},clearTimeout(m){e.clearTimeout(m),p.delete(m);const _=d.findIndex(E=>E.timerId===m);_!==-1&&d.splice(_,1)},setInterval(m,_,...E){if(o++,w)return-1;let R=-1;const L=()=>{const C={run:()=>m(...E)};if(t==="held"){const re=S.get(R);if(re){const oe=d.indexOf(re);oe!==-1&&d.splice(oe,1)}S.set(R,C),s(C);return}c(C)};return R=e.setInterval(L,_),T.add(R),R},clearInterval(m){e.clearInterval(m),T.delete(m);const _=S.get(m);if(_){S.delete(m);const E=d.indexOf(_);E!==-1&&d.splice(E,1)}},requestAnimationFrame(m){if(o++,w)return-1;const _={run:()=>m(A())};let E=-1;const R=r(_);return E=e.requestAnimationFrame(()=>{I.delete(E),R()}),I.add(E),_.frameId=E,E},cancelAnimationFrame(m){e.cancelAnimationFrame(m),I.delete(m);const _=d.findIndex(E=>E.frameId===m);_!==-1&&d.splice(_,1)}},hold:l,release(){w||(v(),t="open",f())},step(m=1){if(!w){for(v(),n=m>0?m:1,t="step";n>0&&d.length>0;)n--,f();t="held",h=e.now()}},stats(){return{mode:t,pending:d.length,requests:o,fired:a,firedWhileHeld:u,activeTimeouts:p.size,activeIntervals:T.size,activeAnimationFrames:I.size,input:i,inputBlocked:g}},recordInput(m){i++,m&&g++},dispose(){if(w)return{timeouts:0,intervals:0,animationFrames:0,parkedCallbacks:0};w=!0;const m={timeouts:p.size,intervals:T.size,animationFrames:I.size,parkedCallbacks:d.length};for(const _ of p)e.clearTimeout(_);for(const _ of T)e.clearInterval(_);for(const _ of I)e.cancelAnimationFrame(_);return p.clear(),T.clear(),I.clear(),d.length=0,S.clear(),n=0,t="held",h=e.now(),m}}}async function sn(e){const t=e.windowMs??1500,n=Math.max(1,Math.min(e.sampleMs??50,t)),o=e.sleep??(T=>new Promise(I=>setTimeout(I,T))),a=e.gate;if(!a)return{loop:"self-driven",reason:"no same-realm loop gate is installed, so nothing here controls this game’s scheduling",evidence:{pendingWhileHeld:0,firedWhileHeld:0,progressBefore:0,progressAfter:0,windowMs:t}};const u=a.stats(),i=e.progress();let g=u,h=i,y=u.pending,w=u.mode==="held";for(let T=0;T<t;T+=n)if(await o(Math.min(n,t-T)),g=a.stats(),h=e.progress(),y=Math.max(y,g.pending),g.mode!=="held"){w=!1;break}const d=g.firedWhileHeld-u.firedWhileHeld,p={pendingWhileHeld:y,firedWhileHeld:d,progressBefore:i,progressAfter:h,windowMs:t};return!w||g.mode!=="held"?{loop:"unmeasured",reason:"the gate was not held for the whole probe window — something else released it, so control was not measured",evidence:p}:d>0?{loop:"self-driven",reason:`${d} gated callback(s) ran while the gate was held — the gate leaked, so it cannot claim control`,evidence:p}:h>i?{loop:"self-driven",reason:`the game kept rendering while its scheduling was withheld (frame ${i} → ${h} in ${t}ms) — something outside this gate drives its loop`,evidence:p}:y===0?{loop:"unmeasured",reason:"nothing was due while the gate was held, so it withheld nothing and the probe learned nothing about this loop — note a hidden or backgrounded tab schedules no frames at all, which is a fact about the TAB, never about the game",evidence:p}:{loop:"gated",reason:`verified: ${y} scheduled callback(s) withheld, none ran, and no frame advanced in ${t}ms of held time`,evidence:p}}let U=null;function ht(){return U}const z=new Set(["keydown","keyup","keypress","mousedown","mouseup","mousemove","click","dblclick","contextmenu","wheel","pointerdown","pointerup","pointermove","pointercancel","touchstart","touchmove","touchend","touchcancel"]);function Se(e){const t=new Set,n=new WeakSet,o=((a,u)=>{const i=vt(a,u),g=yt(a,u);if(e()){for(const y of i)t.add(y);for(const y of g)t.delete(y);return!1}if(n.has(u))return!1;let h=!1;for(const y of g)t.delete(y)&&(h=!0);return h&&n.add(u),!h});return o.outstandingReleases=()=>{const a=[];for(const u of t){const i=u.indexOf(":"),g=u.slice(0,i),h=u.slice(i+1);g==="key"?a.push(new KeyboardEvent("keyup",{code:h,key:wt(h),bubbles:!0})):g==="mouse"?a.push(new MouseEvent("mouseup",{button:Number(h),bubbles:!0})):g==="pointer"&&typeof PointerEvent=="function"&&a.push(new PointerEvent("pointerup",{pointerId:Number(h),bubbles:!0}))}return a},o}function wt(e){const t=/^Key([A-Z])$/.exec(e);if(t)return t[1].toLowerCase();const n=/^Digit(\d)$/.exec(e);return n?n[1]:e==="Space"?" ":e}function be(e){const t=e.changedTouches;return t?Array.from(t,n=>`touch:${n.identifier}`):["touch"]}function vt(e,t){switch(e){case"keydown":return[`key:${t.code}`];case"mousedown":return[`mouse:${t.button}`];case"pointerdown":return[`pointer:${t.pointerId}`];case"touchstart":return be(t);default:return[]}}function yt(e,t){switch(e){case"keyup":return[`key:${t.code}`];case"mouseup":return[`mouse:${t.button}`];case"pointerup":case"pointercancel":return[`pointer:${t.pointerId}`];case"touchend":case"touchcancel":return be(t);default:return[]}}const Ee=new Set(["setTimeout","clearTimeout","setInterval","clearInterval","requestAnimationFrame","cancelAnimationFrame"]);function Re(e,t){return typeof e!="function"||Object.hasOwn(e,"prototype")?e:e.bind(t)}const k="",F=new Map,V=new Map,H=new Map,ce=new WeakMap;function K(e){let t=H.get(e);return t||(t=new nt,H.set(e,t)),t}function an(e,t=k){const n=K(t);return n.surface=e,n}function ln(e=k){H.get(e)?.reset()}function cn(e=k){return K(e)}function un(){const e=[];for(const[t,n]of H)n.surface&&e.push({surface:n.surface,gate:Te(t)});return e}function Te(e){return()=>Fe()&&(V.get(e)??(()=>!0))()}function pt(e,t){const n=Te(e);return()=>t.alive&&n()}const M=[];function _t(){return M[M.length-1]??null}De(_t);function $(e,t){M.push(e);try{return t()}finally{M.pop()}}function St(e,t){return{setTimeout(n,o,...a){return t.setTimeout((...u)=>$(e,()=>n(...u)),o,...a)},clearTimeout:n=>t.clearTimeout(n),setInterval(n,o,...a){return t.setInterval((...u)=>$(e,()=>n(...u)),o,...a)},clearInterval:n=>t.clearInterval(n),requestAnimationFrame(n){return t.requestAnimationFrame(o=>$(e,()=>n(o)))},cancelAnimationFrame:n=>t.cancelAnimationFrame(n)}}function bt(e){const t=new Map;return new Proxy(console,{get(n,o){const a=Reflect.get(n,o,n);if(typeof a!="function")return a;let u=t.get(o);return u||(u=(...i)=>$(e,()=>a.apply(n,i)),t.set(o,u)),u}})}function ue(e){let t=!1,n=null;return()=>{if(t)return n;t=!0;try{n=ft(window[e])}catch{n=null}return n}}let Ie=null;function Et(e){Ie=e}let Pe=null;function Rt(e){const t={alive:!0},n=new Map,o=pt(e,t),a=gt({setTimeout:(S,A)=>window.setTimeout(S,A),clearTimeout:S=>window.clearTimeout(S),setInterval:(S,A)=>window.setInterval(S,A),clearInterval:S=>window.clearInterval(S),requestAnimationFrame:S=>window.requestAnimationFrame(S),cancelAnimationFrame:S=>window.cancelAnimationFrame(S),now:()=>performance.now()}),u=new WeakSet,i=(S,A)=>{u.has(S)||(u.add(S),a.recordInput?.(A))};e===k&&(Pe=a);const g=K(e),h=St(e,a.schedulers),y=ue("localStorage"),w=ue("sessionStorage");let d,p;const T=me(de(window,()=>!0,{page:g,role:"window"}),o,{execute:S=>$(e,S),realmId:e,recordInput:i,role:"window",schedulers:h,self:()=>d,document:()=>p,localStorage:y,sessionStorage:w,isolateExpandos:!0});d=T.proxy;const I=me(de(document,()=>!0,{page:g,role:"document"}),o,{execute:S=>$(e,S),realmId:e,recordInput:i,role:"document",self:()=>d});return p=I.proxy,{moduleUrls:n,live:t,loop:a,document:I,localStorage:y,sessionStorage:w,window:T,public:{recordModuleUrl(S){t.alive&&n.set(new URL(S).pathname,S)},console:bt(e),document:p,globalThis:d,timers:h,window:d}}}function Y(e=k){let t=F.get(e);return t||(t=Rt(e),F.set(e,t)),t.public}function Tt(e){return[...F.get(e)?.moduleUrls.values()??[]]}function dn(e){const t=F.get(e);if(!t)return null;const n={reads:0,writes:0};return{globals:t.window.expandoCount(),mountId:e,loop:t.loop.stats(),listeners:{document:t.document.count(),window:t.window.count()},storage:{local:t.localStorage()?.stats()??n,session:t.sessionStorage()?.stats()??n}}}function It(e=k){V.delete(e),H.get(e)?.reset(),e!==k&&H.delete(e);const n=F.get(e);if(!n)return{mountId:e,listeners:0,timers:{timeouts:0,intervals:0,animationFrames:0,parkedCallbacks:0}};F.delete(e),n.moduleUrls.clear(),n.live.alive=!1;const o=n.document.dispose()+n.window.dispose(),a=n.loop.dispose?.()??{timeouts:0,intervals:0,animationFrames:0,parkedCallbacks:0};return e===k&&Ce(),{mountId:e,listeners:o,timers:a}}function fn(e,t=k){V.set(t,e)}function de(e,t,n){const o=new Map,a=Se(t),u=()=>n?.page.surface??null,i=()=>n?.role==="window"&&n.page.surface?n.page:null,g=(c,f,s)=>{const r=i();if(r&&c==="resize"&&f!==null){r.addResizeListener(f,s);return}if((c==="load"||c==="DOMContentLoaded"||c==="pageshow")&&f!==null&&document.readyState==="complete"){window.setTimeout(()=>{const l=new Event(c);typeof f=="function"?f.call(p,l):f.handleEvent(l)},0);return}if(z.has(c)&&f!==null){let l=o.get(c);l||(l=new Map,o.set(c,l));const v=f;let b=l.get(v);b||(b=function(m){if(!a(c,m))return typeof v=="function"?v.call(this,m):v.handleEvent(m)},l.set(v,b)),e.addEventListener(c,b,s);return}e.addEventListener(c,f,s)},h=(c,f,s)=>{const r=i();if(r&&c==="resize"&&f!==null){r.removeResizeListener(f,s);return}if(z.has(c)&&f!==null){const l=o.get(c),v=l?.get(f);if(v){l?.delete(f),e.removeEventListener(c,v,s);return}}e.removeEventListener(c,f,s)},y=new WeakMap,w=c=>{if(typeof c!="string"||!c.startsWith("on"))return null;const f=c.slice(2);return z.has(f)?f:null},d=c=>{console.error(dt(c))};let p;const T=()=>{const c=Reflect.get(e,"location",e);if(!c||!n)return null;const f=ce.get(n.page);if(f?.source===c)return{value:f.view};const s=ut(c,d,{reloadGame:()=>{const r=Ie;return r?(r(),!0):!1}});return ce.set(n.page,{source:c,view:s}),{value:s}},I=c=>{const f=i();if(!f)return null;if(c==="window"||c==="self"||c==="top"||c==="parent")return{value:p};if(c!=="innerWidth"&&c!=="outerWidth"&&c!=="innerHeight"&&c!=="outerHeight")return null;const s=f.viewport();return s?c==="innerWidth"||c==="outerWidth"?{value:s.width}:c==="innerHeight"||c==="outerHeight"?{value:s.height}:null:null},S=c=>{if(!n)return null;if(c==="location")return T();if(n.role==="document"){const f=u();if(f&&(c==="body"||c==="documentElement"))return{value:f};if(f&&c==="head")return{value:n.page.head()};if(f&&c==="title")return{value:n.page.title};if(f&&c==="currentScript")return{value:n.page.currentScript};if(f&&c==="activeElement"){const s=Reflect.get(e,"activeElement",e);return{value:s&&f.contains(s)?s:f}}}return I(c)},A=c=>{if(n?.role!=="document"||typeof c!="string")return;const f=u();if(!f)return;const s=e;if(c==="querySelector")return r=>r.trim().toLowerCase()==="head"?n.page.head():f.matches(r)?f:f.querySelector(r);if(c==="querySelectorAll")return f.querySelectorAll.bind(f);if(c==="getElementById")return r=>{const l=s.getElementById(r);return l&&f.contains(l)?l:null};if(c==="getElementsByClassName")return f.getElementsByClassName.bind(f);if(c==="getElementsByTagName")return r=>{if(r.toLowerCase()!=="head")return f.getElementsByTagName(r);const l=n.page.head();return l?Object.assign([l],{item:v=>v===0?l:null,namedItem:v=>l.id===v?l:null}):[]};if(c==="elementFromPoint"||c==="elementsFromPoint")return(r,l)=>{const v=f.getBoundingClientRect(),m=s[c].bind(s)(r+v.left,l+v.top);return Array.isArray(m)?m.filter(_=>f.contains(_)):m&&f.contains(m)?m:null}};return p=new Proxy(e,{get(c,f){if(f==="addEventListener")return g;if(f==="removeEventListener")return h;const s=S(f);if(s)return s.value;const r=A(f);if(r)return r;if(typeof f=="string"&&Ee.has(f)){const v=U;if(v)return v.schedulers[f]}const l=Reflect.get(c,f,c);return typeof l!="function"?l:y.get(l)??Re(l,c)},set(c,f,s){if(f==="location"&&n)return d(`${n.role}.location = ${String(s)}`),!0;if(n?.role==="document"&&f==="title"&&n.page.surface)return n.page.title=String(s),!0;if(w(f)!==null&&typeof s=="function"){const l=s,v=function(b){if(t())return l.call(this,b)};return y.set(v,l),Reflect.set(c,f,v,c)}if(f==="onload"&&typeof s=="function"&&document.readyState==="complete"){const l=s;return window.setTimeout(()=>l.call(p,new Event("load")),0),!0}return Reflect.set(c,f,s,c)}}),p}function fe(e){return typeof e=="boolean"?e:e?.capture??!1}function me(e,t,n){const o=n.execute??(s=>s()),a=[],u=Se(t);let i=!1,g=!1;const h=s=>{if(g)return;g=!0;const r=n.realmId?`"${n.realmId}"`:"the default realm";console.warn(`volter: a stopped game tried to register ${s} on its ${n.role} after its realm (${r}) was reclaimed; refused. Later refusals in this generation are silent.`)},y=new Map,w=new Map,d=new WeakMap;let p;const T=s=>n.role==="window"&&n.self&&(s===e||typeof window<"u"&&s===window)?n.self():n.document&&(s===n.document()||typeof document<"u"&&s===document)?n.document():s,I=s=>{const r=d.get(s);if(r)return r;const l=new Proxy(s,{get(v,b){if(b==="currentTarget")return p;if(b==="target"||b==="srcElement"){const _=Reflect.get(v,b,v);return _===v.currentTarget?p:T(_)}if(b==="view")return T(Reflect.get(v,b,v));if(b==="composedPath")return()=>v.composedPath().map(T);const m=Reflect.get(v,b,v);return typeof m=="function"?m.bind(v):m}});return d.set(s,l),l},S=s=>{const r=a.indexOf(s);r!==-1&&a.splice(r,1),e.removeEventListener(s.type,s.actual,s.capture),s.abort?.signal.removeEventListener("abort",s.abort.handler)},A=(s,r,l)=>{if(r===null)return;if(i){h(`a "${s}" listener`);return}const v=fe(l),b=l&&typeof l!="boolean"?l.signal:void 0;if(b?.aborted||a.some(R=>R.type===s&&R.original===r&&R.capture===v))return;let m;const _=function(R){if(l&&typeof l!="boolean"&&l.once){const C=a.indexOf(m);C!==-1&&a.splice(C,1),m.abort?.signal.removeEventListener("abort",m.abort.handler)}if(z.has(s)){const C=u(s,R);if(n.recordInput?.(R,C),C)return}const L=I(R);return o(()=>typeof r=="function"?r.call(p,L):r.handleEvent(L))},E=()=>S(m);m={type:s,original:r,actual:_,capture:v,...b?{abort:{signal:b,handler:E}}:{}},a.push(m),e.addEventListener(s,_,l),b?.addEventListener("abort",E,{once:!0}),(s==="load"||s==="DOMContentLoaded"||s==="pageshow")&&document.readyState==="complete"&&window.setTimeout(()=>{!i&&a.includes(m)&&_.call(e,new Event(s))},0)},c=(s,r,l)=>{if(r===null)return;const v=fe(l),b=a.find(m=>m.type===s&&m.original===r&&m.capture===v);b?S(b):e.removeEventListener(s,r,l)},f=s=>typeof s=="string"&&s.startsWith("on")&&s.length>2?s.slice(2):null;return p=new Proxy(e,{get(s,r){if(r==="addEventListener")return A;if(r==="removeEventListener")return c;const l=w.get(r);if(l)return l.original;if(n.self&&(n.role==="window"&&(r==="window"||r==="self"||r==="frames"||r==="top"||r==="parent")||n.role==="document"&&r==="defaultView"))return n.self();if(n.role==="window"&&r==="document"&&n.document)return n.document();if(n.role==="window"&&r==="globalThis"&&n.self)return n.self();if(n.role==="window"&&r==="localStorage"&&n.localStorage)return n.localStorage()?.storage;if(n.role==="window"&&r==="sessionStorage"&&n.sessionStorage)return n.sessionStorage()?.storage;if(typeof r=="string"&&Ee.has(r)&&n.schedulers)return n.schedulers[r];const v=y.get(r);if(v)return v.get?v.get.call(p):v.value;const b=Reflect.get(s,r,s);return typeof b!="function"?b:Re(b,s)},set(s,r,l){if(r==="location")return Reflect.set(s,r,l,s);if(n.role==="window"&&(r==="document"||r==="globalThis"||r==="localStorage"||r==="sessionStorage"))return!0;const v=f(r);if(v){if(i)return h(`an "${String(r)}" handler`),!0;const b=w.get(r);if(b&&(e.removeEventListener(b.type,b.actual),w.delete(r)),typeof l!="function")return!0;const m=l,_=(v==="load"||v==="DOMContentLoaded"||v==="pageshow")&&document.readyState==="complete",E=function(R){if(z.has(v)){const C=u(v,R);if(n.recordInput?.(R,C),C)return}const L=o(()=>m.call(p,I(R)));return L===!1&&R.preventDefault(),L};return w.set(r,{type:v,original:m,actual:E}),e.addEventListener(v,E),_&&window.setTimeout(()=>{!i&&w.get(r)?.actual===E&&E.call(e,new Event(v))},0),!0}return n.isolateExpandos?(y.set(r,{configurable:!0,enumerable:!0,value:l,writable:!0}),!0):Reflect.set(s,r,l,s)},defineProperty(s,r,l){return n.isolateExpandos?Reflect.getOwnPropertyDescriptor(s,r)?.configurable===!1?!1:(y.set(r,{...l,configurable:!0,enumerable:l.enumerable??!0}),!0):Reflect.defineProperty(s,r,l)},deleteProperty(s,r){return y.delete(r)?!0:n.isolateExpandos?Reflect.getOwnPropertyDescriptor(s,r)?.configurable!==!1:Reflect.deleteProperty(s,r)},has(s,r){return y.has(r)||Reflect.has(s,r)},ownKeys(s){const r=new Set(Reflect.ownKeys(s));for(const l of y.keys())typeof l!="number"&&r.add(l);return[...r]},getOwnPropertyDescriptor(s,r){const l=Reflect.getOwnPropertyDescriptor(s,r);return l?.configurable===!1?l:y.get(r)??l}}),{proxy:p,count:()=>a.length+w.size,expandoCount:()=>y.size,dispose(){for(const r of u.outstandingReleases()){for(const l of[...a])l.type===r.type&&l.actual.call(p,r);for(const l of w.values())l.type===r.type&&l.actual.call(p,r)}i=!0;const s=a.length+w.size;for(const r of[...a])S(r);for(const r of w.values())e.removeEventListener(r.type,r.actual);return w.clear(),y.clear(),s}}}let B=!1;function Ce(){if(!B)return;const e=globalThis,t=Y();U=Pe,e.__volterGameTimers=t.timers,e.__volterGameWindow=t.window,e.__volterGameDocument=t.document,e.__volterGameConsole=t.console}function mn(){if(B||typeof window>"u"||typeof document>"u")return;B=!0;const e=globalThis;He(),e.__volterGameModuleUrls=Tt,e.__volterGameRealm=t=>(M.push(t),queueMicrotask(()=>{const n=M.lastIndexOf(t);n>=0&&M.splice(n,1)}),Y(t)),Ce()}function Q(e,t){const n=It(e),o=n.timers.timeouts+n.timers.intervals+n.timers.animationFrames+n.timers.parkedCallbacks;if(n.listeners===0&&o===0)return;const a=[];n.listeners>0&&a.push(`${n.listeners} window/document listener${n.listeners===1?"":"s"}`),o>0&&a.push(`${o} timer/frame callback${o===1?"":"s"}`),P.logStructured("warn",`${t} stopped without releasing ${a.join(" and ")}; the editor reclaimed them.`,"environment",void 0,{instanceId:e,instanceName:t})}function Le(e=typeof window>"u"?null:window){const t=e?.volterGame;return!t||t.contractVersion!==1?null:t}const Pt=Object.entries(Oe).filter(([,e])=>!e.optional).map(([e])=>e);function Ae(e){const t=e?.scenes;if(t==null)return{scenes:null,malformed:null};if(typeof t!="object")return{scenes:null,malformed:`declared as ${typeof t}; expected an object with list(), current() and goTo()`};const n=Pt.filter(o=>typeof t[o]!="function");return n.length>0?{scenes:null,malformed:`declared a scenes surface missing required member(s): ${n.join(", ")}`}:{scenes:t,malformed:null}}function Ct(e){const t=e?.ready;if(t==null)return{ready:null,malformed:null};if(typeof t=="function"){const n=t;return{ready:()=>Promise.resolve(n()),malformed:null}}if(typeof t.then=="function"){const n=t;return{ready:()=>Promise.resolve(n),malformed:null}}return{ready:null,malformed:`declared \`ready\` as ${typeof t}; expected a promise or a function returning one`}}function Lt(e){const t=e?.world;return t==null?{world:null,malformed:null}:typeof t!="object"||t.isScene!==!0?{world:null,malformed:`declared \`world\` as ${typeof t}; expected the game's own THREE.Scene`}:{world:t,malformed:null}}function At(e){const t=e?.presentation;if(t==null)return{canvas:null,malformed:null};const n=t;return typeof n!="object"||n.tagName!=="CANVAS"||typeof n.getContext!="function"?{canvas:null,malformed:`declared \`presentation\` as ${typeof t=="object"?String(n.tagName??"object"):typeof t}; expected the game's own <canvas> element`}:{canvas:t,malformed:null}}const gn=Object.freeze(Object.defineProperty({__proto__:null,readGameContract:Le,readGamePresentation:At,readGameReady:Ct,readGameScenes:Ae,readGameWorld:Lt},Symbol.toStringTag,{value:"Module"}));function kt(e){if(!Array.isArray(e))throw new Error("scenes.list() did not return an array");const t=new Set;for(const n of e){if(typeof n!="object"||n===null||typeof n.id!="string"||n.id.trim().length===0||typeof n.label!="string"||n.label.trim().length===0)throw new Error("scenes.list() returned an invalid { id, label } scene");if(t.has(n.id))throw new Error(`scenes.list() returned duplicate id "${n.id}"`);t.add(n.id)}return e}function xt(e){return typeof e?.goToScene=="function"}function hn(e,t={}){const{scenes:n,malformed:o}=Ae(e);if(o!==null&&P.warn(`Ignored the game contract's \`scenes\` surface: ${o}`,"ingest"),!n)return null;let a=!1;const u=()=>{try{return kt(n.list())}catch(g){return a||(a=!0,P.warn(`Ignored invalid game-contract scenes: ${g instanceof Error?g.message:String(g)}`,"ingest")),[]}},i=g=>{const h=u().map(w=>w.id);return h.includes(g)?(t.onSwitchAccepted?.(g),{ok:!0,settled:(async()=>{try{return await n.goTo(g),{requested:g,current:n.current()}}catch(w){return{requested:g,current:n.current(),error:w instanceof Error?w.message:String(w)}}})()}):{ok:!1,error:`scenes.goTo: "${g}" is not one of this game's scenes (${h.length>0?h.join(", "):"it lists none"}).`,known:h}};return{title:"Scenes",storiesFor:g=>u().map(({id:h,label:y})=>({id:h,label:y})),active:g=>n.current(),goToScene:i,apply:(g,h)=>{if(h===null){P.warn("This game’s scenes cannot be cleared: it is always in one of its own scenes. Pick the scene to switch to instead.","ingest");return}const y=i(h);if(!y.ok){P.warn(`${y.error} — ignoring.`,"ingest");return}y.settled.then(w=>{w.error!==void 0&&P.error(`scenes.goTo("${h}") failed: ${w.error}`,"ingest")})}}}function Gt(){const e=G();if(!e)return null;const n=(()=>{switch(e.kind){case"canvas":return e.session.adapter;case"dom":return e.session.adapter;case"three":return e.session.mount?.authoring}})()?.stories;return xt(n)?n:null}let J=!1;function ge(){return J}function wn(){J=!0}function vn(){J=!1}let D=null,x=null;function yn(e){D=e,e||Z()}function pn(){D=null,Z()}function Z(){const e=x;x=null,e&&(clearTimeout(e.timer),e.settle(null))}function ke(){const e=D?.renderer.domElement;return typeof e=="object"&&e!==null?e:null}function _n(){const e=x;if(!(!e||!D))try{const t=D.renderer;if(typeof t.getRenderTarget=="function"&&t.getRenderTarget()!==null)return;const n=ke();if(!n||n.width===0||n.height===0)return;const o=e.image??n.ownerDocument.createElement("canvas");o.width=n.width,o.height=n.height;const a=o.getContext("2d");if(!a||(a.drawImage(n,0,0),e.image=o,e.delivering))return;e.delivering=!0,setTimeout(()=>{x===e&&(x=null,clearTimeout(e.timer),e.settle(e.image))},0)}catch{}}function Mt(e=2e3){return D?(Z(),new Promise(t=>{const n=setTimeout(()=>{x?.timer===n&&(x=null),t(null)},e);x={settle:t,timer:n,image:null,delivering:!1}})):Promise.resolve(null)}const $t={play:e=>(e.play(),"driven"),resume:e=>(e.resume(),"driven"),stop:(e,t)=>t?.stopEndsRun?"declined":(e.pause(),"driven"),pause:e=>(e.pause(),"driven"),step:e=>e.canStep?(e.step(),"driven"):{ok:!1,error:"this ingested game cannot be stepped — no serve-time loop gate measured control over its frames, so a single-frame step would be a button that lies (see ingest/same-realm-loop-gate.ts)"}};function Ft(e,t,n){if(!je(t))return null;const o=$t[t](e,n);return o==="declined"?null:o!=="driven"?o:{ok:!0,data:{ingest:!0,playing:e.playing}}}function Ht(){return Y().window}function X(){return typeof window>"u"?null:Le(Ht())}let ee=!1;function Dt(){return ee}function N(e){ee=e}function jt(){N(!1);const e=window;delete e.__volterMountCold,delete e.__volterIngestPlayed}function he(e,t,n){const o=(a,u)=>ze({seam:`contract.lifecycle.${t}`,subject:"game",epoch:qe(e),stage:"effect",outcome:a,source:"consumer",detail:u});try{n(),o("pass",`the mounted ingest lifecycle consumed lifecycle.${t}`)}catch(a){throw o("fail",`lifecycle.${t} failed: ${a instanceof Error?a.message:String(a)}`),a}}function Sn(e={}){const t=X(),n=t?.lifecycle,o=()=>{if(t&&n?.start){he(t,"start",()=>n.start?.());return}window.dispatchEvent(new CustomEvent("volter:ingest-play"))},a=typeof n?.pause=="function",u=typeof n?.resume=="function";return t&&a!==u?{start:o,pauseGap:a?"the game contract declares lifecycle.pause without lifecycle.resume":"the game contract declares lifecycle.resume without lifecycle.pause"}:t&&a&&u?{start:o,setPaused:i=>he(t,i?"pause":"resume",()=>{i?n?.pause?.():n?.resume?.()})}:e.setPaused?{start:o,setPaused:e.setPaused,...e.step?{step:e.step}:{},...e.canStep?{canStep:e.canStep}:{}}:{start:o,pauseGap:e.pauseGap??"the game declares no lifecycle.pause/resume pair and its mounted adapter exposes no setPaused capability"}}function bn(){const e=G();return e?e.session.lifecycle.pauseGap??null:null}function we(e){const t=G();if(t)for(const n of t.siblings)try{n.setPaused?.(e)}catch(o){P.error(`Composite sibling setPaused(${e}) failed: ${o}`,"ingest")}}function zt(){return X()}function xe(){const e=G()?.session.lifecycle;if(!e?.setPaused)return null;const t=()=>{e.setPaused?.(!0),we(!0),N(!1)},n=()=>{e.setPaused?.(!1),we(!1),N(!0)};return{get playing(){return ee},play(){Ne();const o=window;if(o.__volterIngestPlayed)return n();o.__volterIngestPlayed=!0,e.start(),n()},pause:t,resume:n,canStep:!!e.step&&(e.canStep?.()??!0),step(){e.canStep?.()!==!1&&(e.step?.(),N(!1))}}}function En(e){const t=xe();return t?(t.pause(),!0):!1}const Nt=Ue(e=>{e.level==="warn"?P.warn(e.message,"ingest"):P.log(e.message,"ingest")});let Bt=0,Ge="";function Rn(e){Ge=`${e}#${++Bt}`}function Tn(e){const t=mt(e.realmLoopVerdict?.()),n=e.realmLoopVerdict?.()?.reason??null;return t!==null||n!==null?{loop:t,reason:n}:e.realmLoopVerdict?{loop:null,reason:null}:{loop:null,reason:Wt}}function In(){return{loop:null,reason:"⏸ calls the host runtime's own play pause on this route, but no probe has measured whether that reaches this game's frames — an unmodified React game that schedules its own timers is not held by the host loop"}}const Wt="this mount installs no loop gate, so no verdict will ever be measured here — nothing in the editor holds this game's frames";function Ot(e,t,n){const o=Xe(t?.systems,n),a=new Map(o.empty.map(i=>[i.slot,i.evidence])),u=new Map(o.malformed.map(i=>[i.slot,i.reason]));return Ye.map(i=>{if(e[i]!=null)return{slot:i,state:"bound",proof:Be({slot:i,adapter:e[i],subject:"game"})};const g=a.get(i);if(g!==void 0)return{slot:i,state:"empty",evidence:g};const h=u.get(i);return h!==void 0?{slot:i,state:"malformed",evidence:h}:{slot:i,state:"unanswered"}})}function qt(){const e=Je();switch(e.state){case"absent":return null;case"loading":return{state:"loading"};case"ready":return{state:"ready",dataFile:e.writer.dataFile};default:return{state:"failed",reason:e.reason}}}function te(){const e=G(),t=e?.coverage;if(!e||!t)return null;const n=Qe(),o=t.loop(),a=zt();return Ve({worldId:e.worldId,reach:t.reach,surface:e.kind,reachMechanism:t.reachMechanism,loop:o.loop,loopReason:o.reason,contract:Ke(a),systemAdapters:Ot(pe(),a,e.kind),ownership:n?{writable:n.writable,reason:n.reason??null,recorder:n.recorder??null}:null,dataWriter:qt(),projectVerbs:[],writeReach:t.writeReach?.()??null})}function Pn(e){const t=G();if(!t)return;t.coverage=e;const n=te();n&&Nt.report(Ge,n)}function Cn(e,t){if(!t)return;const n=`Ingest "${e}" loop: ${t.loop} — ${t.reason}`;t.loop==="gated"?P.log(n,"ingest"):P.warn(n,"adapter")}const Ut=["hierarchy","selection","transforms","inspector","assetSubject","structure","persistence","pickable","rects","boxEdit","text","colorSample","stories","truth","assetDrop"];function Vt(e){return Ut.filter(t=>e[t]!==void 0)}function Ln(e){return{coverage:()=>te(),prepareCoverage:()=>Ze(),authoringProviders:()=>Vt(e),engineSystems:()=>Object.keys(pe())}}function An(e,t){Object.defineProperties(e,{loop:{enumerable:!0,get:()=>t.realmLoopVerdict?.()?.loop??null},loopReason:{enumerable:!0,get:()=>t.realmLoopVerdict?.()?.reason??null}}),e.realmLoopStats=()=>ht()?.stats()??null}function kn(e,t){const n=e,o=typeof n.querySelectorAll=="function"?n.querySelectorAll("*").length:t.nodeCount(),a=Object.keys(e).some(u=>u.startsWith("__reactContainer"));return{elementCount:o,hierarchyNodeCount:t.nodeCount(),reactRootPresent:a}}function xn(e,t){window[e]=t}function ne(e){delete window[e]}function Me(){Et(null);const e=G();if(e){Jt(null),jt();try{X()?.lifecycle?.dispose?.()}catch(t){P.error(`The game's own lifecycle.dispose threw at teardown: ${t}`,"ingest")}for(let t=e.siblings.length-1;t>=0;t--)try{e.siblings[t].dispose()}catch(n){P.error(`Composite sibling dispose failed: ${n}`,"ingest")}switch(e.kind){case"three":Kt(e.session);return;case"canvas":Yt(e.session);return;case"dom":Qt(e.session);return}}}function Kt(e){if(e.mount?.authoring&&e.mount.authoring.dispose?.(),W(null),O(null),q(),e.resizeObserver?.disconnect(),e.inputGateUnsubscribe?.(),e.mount)try{e.store.exitPlayScene()}catch{}e.store.shell.setPlayState("stopped");try{e.mount?.game.dispose()}catch{}Q("","The ingested game"),ne("__volterIngest"),P.log("Ingest root unmounted","ingest")}function Yt(e){e.adapter&&e.adapter.dispose(),W(null),O(null),q(),e.store.shell.setPlayState("stopped");try{e.dispose()}catch{}Q("","The ingested canvas game"),ne("__volterIngest2D"),P.log("canvas ingest root unmounted","ingest")}function Qt(e){e.adapter.dispose(),W(null),O(null),q(),e.store.shell.setPlayState("stopped");try{e.stop()}catch{}Q("","The ingested DOM game"),ne("__volterIngestReact"),P.log("DOM ingest root unmounted","ingest")}function Gn(){G()?.kind==="three"&&Me()}let j=null;function G(){return j}function Jt(e){j=e}function $e(){return j?.kind??null}function ve(){return $e()!==null}function Mn(e){j&&(j.siblings=[...e])}let ye=Promise.resolve();function $n(e){const t=ye.then(e);return ye=t.then(()=>{},()=>{}),t}We({id:"ingest",priority:1,mounted:ve,playing:()=>Dt()||ge(),stop:Me,instanceContainer:()=>null,frameCanvas:ke,snapshotFrame:()=>Mt(),command:e=>{const t=ve()?xe():null;return t?Ft(t,e.type,{stopEndsRun:ge()}):null},scenes:Gt,surface:$e,coverage:te,authoringRefusal:()=>j?.kind==="dom"?"This is an ingested native-React game: its components render directly as a DOM layer under the host React — there is no scene graph or renderer to introspect, and authoring is deliberately off for react ingests (the editor never writes JSX back into an unmodified game). The game is hosted, sized, and disposed; play it in the Game tab.":null});export{Q as $,un as A,an as B,Ct as C,X as D,ln as E,At as F,rn as G,Ht as H,sn as I,pn as J,ht as K,Lt as L,Rn as M,N,Cn as O,Tn as P,An as Q,dn as R,Gt as S,hn as T,Wt as U,yn as V,_n as W,on as X,cn as Y,et as Z,ie as _,G as a,mn as a0,_t as a1,gn as a2,wn as b,Me as c,ge as d,vn as e,bn as f,xe as g,En as h,ve as i,Sn as j,Jt as k,fn as l,In as m,kn as n,Ln as o,xn as p,mt as q,Pn as r,$n as s,te as t,Dt as u,jt as v,Mn as w,$e as x,Gn as y,zt as z};
@@ -1 +1 @@
1
- import{dY as p}from"./index-ClgrFOcX.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 u=1e-9,d=1e5;function f(m,e,t){const r=t.end-t.start,i=t.loop&&r>u,o=[];let s=m,a=e,c=!1,l=0;for(;;){const h=t.end-s;if(!i||a<=h+u){const n=Math.min(s+a,t.end);o.push({from:s,to:n,direction:"forward"}),s=n;break}if(o.push({from:s,to:t.end,direction:"forward"}),a-=h,s=t.start,c=!0,l++,l>d){const n=t.start+a%r;o.push({from:s,to:n,direction:"forward"}),s=n;break}}return{pos:s,intervals:o,looped:c}}function g(m,e,t){const r=t.end-t.start,i=t.loop&&r>u,o=[];let s=m,a=e,c=!1,l=0;for(;;){const h=s-t.start;if(!i||a<=h+u){const n=Math.max(s-a,t.start);o.push({from:s,to:n,direction:"reverse"}),s=n;break}if(o.push({from:s,to:t.start,direction:"reverse"}),a-=h,s=t.end,c=!0,l++,l>d){const n=t.end-a%r;o.push({from:s,to:n,direction:"reverse"}),s=n;break}}return{pos:s,intervals:o,looped:c}}function _(m,e){return m<e.start?e.start:m>e.end?e.end:m}class D{_previousTime;_currentTime;_range;_timeScale;_playDirection="forward";_lastCrossingDirection="forward";_playbackState="stopped";_evaluators=[];_registrationCounter=0;constructor(e={}){const t=e.start??0,r=e.end??Math.max(t,1);if(r<t)throw new Error(`[AnimationClock] range end (${r}) must be >= start (${t})`);const i=e.timeScale??1;if(!Number.isFinite(i)||i<0)throw new Error(`[AnimationClock] timeScale must be a finite number >= 0, got ${i}`);this._range={start:t,end:r,loop:e.loop??!1},this._timeScale=i,this._previousTime=t,this._currentTime=t}get time(){return this._currentTime}get previousTime(){return this._previousTime}get direction(){return this._playbackState==="playing"?this._playDirection:"paused"}get playbackState(){return this._playbackState}get timeScale(){return this._timeScale}set timeScale(e){if(!Number.isFinite(e)||e<0)throw new Error(`[AnimationClock] timeScale must be a finite number >= 0, got ${e}`);this._timeScale=e}get range(){return this._range}setRange(e){const t=e.start??this._range.start,r=e.end??this._range.end,i=e.loop??this._range.loop;if(r<t)throw new Error(`[AnimationClock] range end (${r}) must be >= start (${t})`);this._range={start:t,end:r,loop:i};const o=_(this._currentTime,this._range);o!==this._currentTime&&this.seek(o)}play(e){e&&(this._playDirection=e),this._playbackState="playing"}pause(){this._playbackState="paused"}stop(){this._playbackState="stopped"}seek(e){const t=_(e,this._range);if(t===this._currentTime)return this.emit(this._currentTime,this._currentTime,[{from:t,to:t,direction:this._lastCrossingDirection}],!1,this._lastCrossingDirection);const r=t>this._currentTime?"forward":"reverse",i=this._currentTime;return this._previousTime=i,this._currentTime=t,this._lastCrossingDirection=r,this.emit(i,t,[{from:i,to:t,direction:r}],!1,r)}seekFrame(e,t){if(!Number.isFinite(t)||t<=0)throw new Error(`[AnimationClock] seekFrame fps must be a finite number > 0, got ${t}`);return this.seek(this._range.start+e/t)}advance(e){if(this._playbackState!=="playing")return null;if(!Number.isFinite(e))throw new Error(`[AnimationClock] advance(dt) requires a finite dt, got ${e}`);const t=Math.abs(e)*this._timeScale,r=this._currentTime;if(t===0)return this.emit(r,r,[],!1,this._playDirection);const i=this._playDirection==="forward"?f(r,t,this._range):g(r,t,this._range);return this._previousTime=r,this._currentTime=i.pos,this._lastCrossingDirection=this._playDirection,this.emit(r,i.pos,i.intervals,i.looped,this._playDirection)}subscribe(e,t){if(!p.includes(e))throw new Error(`[AnimationClock] unknown phase "${e}". Valid: ${p.join(", ")}`);const r={phase:e,order:this._registrationCounter++,fn:t};return this._evaluators.push(r),{dispose:()=>{const i=this._evaluators.indexOf(r);i!==-1&&this._evaluators.splice(i,1)}}}emit(e,t,r,i,o){const s={previousTime:e,currentTime:t,direction:o,timeScale:this._timeScale,looped:i,intervals:r};if(this._evaluators.length>0){const a=[...this._evaluators].sort((c,l)=>{const h=p.indexOf(c.phase),n=p.indexOf(l.phase);return h!==n?h-n:c.order-l.order});for(const c of a)try{c.fn(s)}catch(l){console.error(`[AnimationClock] evaluator in phase "${c.phase}" threw:`,l)}}return s}}export{D as AnimationClock};
1
+ import{dY as p}from"./index-BfqJPhFO.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 u=1e-9,d=1e5;function f(m,e,t){const r=t.end-t.start,i=t.loop&&r>u,o=[];let s=m,a=e,c=!1,l=0;for(;;){const h=t.end-s;if(!i||a<=h+u){const n=Math.min(s+a,t.end);o.push({from:s,to:n,direction:"forward"}),s=n;break}if(o.push({from:s,to:t.end,direction:"forward"}),a-=h,s=t.start,c=!0,l++,l>d){const n=t.start+a%r;o.push({from:s,to:n,direction:"forward"}),s=n;break}}return{pos:s,intervals:o,looped:c}}function g(m,e,t){const r=t.end-t.start,i=t.loop&&r>u,o=[];let s=m,a=e,c=!1,l=0;for(;;){const h=s-t.start;if(!i||a<=h+u){const n=Math.max(s-a,t.start);o.push({from:s,to:n,direction:"reverse"}),s=n;break}if(o.push({from:s,to:t.start,direction:"reverse"}),a-=h,s=t.end,c=!0,l++,l>d){const n=t.end-a%r;o.push({from:s,to:n,direction:"reverse"}),s=n;break}}return{pos:s,intervals:o,looped:c}}function _(m,e){return m<e.start?e.start:m>e.end?e.end:m}class D{_previousTime;_currentTime;_range;_timeScale;_playDirection="forward";_lastCrossingDirection="forward";_playbackState="stopped";_evaluators=[];_registrationCounter=0;constructor(e={}){const t=e.start??0,r=e.end??Math.max(t,1);if(r<t)throw new Error(`[AnimationClock] range end (${r}) must be >= start (${t})`);const i=e.timeScale??1;if(!Number.isFinite(i)||i<0)throw new Error(`[AnimationClock] timeScale must be a finite number >= 0, got ${i}`);this._range={start:t,end:r,loop:e.loop??!1},this._timeScale=i,this._previousTime=t,this._currentTime=t}get time(){return this._currentTime}get previousTime(){return this._previousTime}get direction(){return this._playbackState==="playing"?this._playDirection:"paused"}get playbackState(){return this._playbackState}get timeScale(){return this._timeScale}set timeScale(e){if(!Number.isFinite(e)||e<0)throw new Error(`[AnimationClock] timeScale must be a finite number >= 0, got ${e}`);this._timeScale=e}get range(){return this._range}setRange(e){const t=e.start??this._range.start,r=e.end??this._range.end,i=e.loop??this._range.loop;if(r<t)throw new Error(`[AnimationClock] range end (${r}) must be >= start (${t})`);this._range={start:t,end:r,loop:i};const o=_(this._currentTime,this._range);o!==this._currentTime&&this.seek(o)}play(e){e&&(this._playDirection=e),this._playbackState="playing"}pause(){this._playbackState="paused"}stop(){this._playbackState="stopped"}seek(e){const t=_(e,this._range);if(t===this._currentTime)return this.emit(this._currentTime,this._currentTime,[{from:t,to:t,direction:this._lastCrossingDirection}],!1,this._lastCrossingDirection);const r=t>this._currentTime?"forward":"reverse",i=this._currentTime;return this._previousTime=i,this._currentTime=t,this._lastCrossingDirection=r,this.emit(i,t,[{from:i,to:t,direction:r}],!1,r)}seekFrame(e,t){if(!Number.isFinite(t)||t<=0)throw new Error(`[AnimationClock] seekFrame fps must be a finite number > 0, got ${t}`);return this.seek(this._range.start+e/t)}advance(e){if(this._playbackState!=="playing")return null;if(!Number.isFinite(e))throw new Error(`[AnimationClock] advance(dt) requires a finite dt, got ${e}`);const t=Math.abs(e)*this._timeScale,r=this._currentTime;if(t===0)return this.emit(r,r,[],!1,this._playDirection);const i=this._playDirection==="forward"?f(r,t,this._range):g(r,t,this._range);return this._previousTime=r,this._currentTime=i.pos,this._lastCrossingDirection=this._playDirection,this.emit(r,i.pos,i.intervals,i.looped,this._playDirection)}subscribe(e,t){if(!p.includes(e))throw new Error(`[AnimationClock] unknown phase "${e}". Valid: ${p.join(", ")}`);const r={phase:e,order:this._registrationCounter++,fn:t};return this._evaluators.push(r),{dispose:()=>{const i=this._evaluators.indexOf(r);i!==-1&&this._evaluators.splice(i,1)}}}emit(e,t,r,i,o){const s={previousTime:e,currentTime:t,direction:o,timeScale:this._timeScale,looped:i,intervals:r};if(this._evaluators.length>0){const a=[...this._evaluators].sort((c,l)=>{const h=p.indexOf(c.phase),n=p.indexOf(l.phase);return h!==n?h-n:c.order-l.order});for(const c of a)try{c.fn(s)}catch(l){console.error(`[AnimationClock] evaluator in phase "${c.phase}" threw:`,l)}}return s}}export{D as AnimationClock};
@@ -1 +1 @@
1
- import{r}from"./index-ClgrFOcX.js";import{l as t}from"./live-mixers-B-bwLZ7c.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 u="workspace.service";function v(){return r().session.reportFacet(()=>({liveMixers:t().map(i=>({site:i.key,clips:[...i.clips.keys()],animates:[...i.roots].map(o=>o.name||"(unnamed)")}))}))}export{u as point,v as start};
1
+ import{r}from"./index-BfqJPhFO.js";import{l as t}from"./live-mixers-B-bwLZ7c.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 u="workspace.service";function v(){return r().session.reportFacet(()=>({liveMixers:t().map(i=>({site:i.key,clips:[...i.clips.keys()],animates:[...i.roots].map(o=>o.name||"(unnamed)")}))}))}export{u as point,v as start};
@@ -1 +1 @@
1
- import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r as c,aL as p}from"./index-ClgrFOcX.js";import{T as m}from"./transport-strip-BZQnaxFN.js";import{r as a}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const E="workspace.utility",T="Animation";function j(){const{documents:o,transport:n}=c(),e=a.useSyncExternalStore(o.subscribe,o.activeId,o.activeId),t=a.useSyncExternalStore(n.subscribe,a.useCallback(()=>e?n.for(e):null,[e,n])),r=a.useSyncExternalStore(a.useCallback(i=>t?t.subscribe(i):()=>{},[t]),a.useCallback(()=>t?.snapshot()??null,[t]));return!t||!r||r.activeSubject===null?s.jsx(p,{as:"p",variant:"caption","data-testid":"animation-timeline-empty","data-document":e??"","data-transport":t?"yes":"no",style:{padding:"var(--volter-space-2) var(--volter-space-3)"},children:t?"Nothing in the active document plays an animation.":"The active document has no stage to animate."}):s.jsx(m,{transport:t})}export{j as default,E as point,T as title};
1
+ import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r as c,aL as p}from"./index-BfqJPhFO.js";import{T as m}from"./transport-strip-DPoEy7PU.js";import{r as a}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const E="workspace.utility",T="Animation";function j(){const{documents:o,transport:n}=c(),e=a.useSyncExternalStore(o.subscribe,o.activeId,o.activeId),t=a.useSyncExternalStore(n.subscribe,a.useCallback(()=>e?n.for(e):null,[e,n])),r=a.useSyncExternalStore(a.useCallback(i=>t?t.subscribe(i):()=>{},[t]),a.useCallback(()=>t?.snapshot()??null,[t]));return!t||!r||r.activeSubject===null?s.jsx(p,{as:"p",variant:"caption","data-testid":"animation-timeline-empty","data-document":e??"","data-transport":t?"yes":"no",style:{padding:"var(--volter-space-2) var(--volter-space-3)"},children:t?"Nothing in the active document plays an animation.":"The active document has no stage to animate."}):s.jsx(m,{transport:t})}export{j as default,E as point,T as title};
@@ -1 +1 @@
1
- import{o}from"./AssetBudgetPanel-B2Wb7-b1.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ClgrFOcX.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"./asset-loaders-Bo91oPiL.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const D="workspace.menu",I={menu:"asset",items:[{id:"open-budget",label:"Open in Asset Budget",testId:"asset-context-open-budget",execute:({assetPath:t})=>{t!==void 0&&o(t)}}]};export{I as menu,D as point};
1
+ import{o}from"./AssetBudgetPanel-X38cPCO3.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-BfqJPhFO.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"./asset-loaders-2LtXp4_y.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const D="workspace.menu",I={menu:"asset",items:[{id:"open-budget",label:"Open in Asset Budget",testId:"asset-context-open-budget",execute:({assetPath:t})=>{t!==void 0&&o(t)}}]};export{I as menu,D as point};
@@ -1 +1 @@
1
- import{o as t}from"./AssetBudgetPanel-B2Wb7-b1.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ClgrFOcX.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"./asset-loaders-Bo91oPiL.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const D="workspace.action",O=[{id:"asset-budget",label:"Open Asset Budget",execute:()=>{t()}}];export{O as actions,D as point};
1
+ import{o as t}from"./AssetBudgetPanel-X38cPCO3.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-BfqJPhFO.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"./asset-loaders-2LtXp4_y.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const D="workspace.action",O=[{id:"asset-budget",label:"Open Asset Budget",execute:()=>{t()}}];export{O as actions,D as point};
@@ -1 +1 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{A as o}from"./AssetBudgetPanel-B2Wb7-b1.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ClgrFOcX.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"./asset-loaders-Bo91oPiL.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const P="workspace.document",R="Asset Budget";function _(r){return t.jsx(o,{})}export{_ as default,P as point,R as title};
1
+ import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{A as o}from"./AssetBudgetPanel-X38cPCO3.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-BfqJPhFO.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"./asset-loaders-2LtXp4_y.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const P="workspace.document",R="Asset Budget";function _(r){return t.jsx(o,{})}export{_ as default,P as point,R as title};
@@ -1 +1 @@
1
- import{o as t}from"./AssetBudgetPanel-B2Wb7-b1.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ClgrFOcX.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"./asset-loaders-Bo91oPiL.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const D="workspace.menu",I={menu:"window",items:[{id:"asset-budget",label:"Asset Budget",testId:"menu-asset-budget",execute:()=>{t()}}]};export{I as menu,D as point};
1
+ import{o as t}from"./AssetBudgetPanel-X38cPCO3.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-BfqJPhFO.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"./asset-loaders-2LtXp4_y.js";import"./SkeletonUtils-YH9iLOY_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./asset-parse-error-BHMwBRU3.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const D="workspace.menu",I={menu:"window",items:[{id:"asset-budget",label:"Asset Budget",testId:"menu-asset-budget",execute:()=>{t()}}]};export{I as menu,D as point};
@@ -1 +1 @@
1
- import{a$ as v,b0 as l,b1 as h,b2 as b,b3 as m,b4 as g}from"./index-ClgrFOcX.js";const p=new WeakMap;function w(e){typeof window>"u"||(window.dispatchEvent(new CustomEvent("editor:assets-changed",{detail:{paths:[u(e)]}})),window.dispatchEvent(new CustomEvent("editor:asset-mutation",{detail:{type:"change",paths:[u(e)]}})))}function k(e,a){const s=u(a);let n=p.get(e);n||(n=new Map,p.set(e,n));const t=n.get(s);if(t)return t;const d=e.registry.registerProject("project-file",`.volter/history/imported-assets/${s}`,s.split("/").pop()),o={revision:0,driver:void 0},r=async()=>{const i=await b(s),c=new TextEncoder().encode(i);return{revision:o.revision,contentType:"application/vnd.volter.asset-history-token",bytes:c,sha256:await m(c)}};return o.driver={descriptor:d,capture:r,preflight:async i=>{const c=await r();return c.sha256===i.sha256?{ok:!0}:{ok:!1,reason:"content-conflict",actualRevision:o.revision,actualSha256:c.sha256}},restore:async i=>{const c=new TextDecoder().decode(e.snapshots.read(i).bytes);await l(s,c),o.revision++,w(s)},estimateBytes:i=>i.byteLength},e.registerDriver(o.driver),n.set(s,o),o}function f(e){return new TextEncoder().encode(e)}async function A(e,a){if(e.length===0)return;const s=h();if(!s)return;const n=e.map(t=>({entry:t,resource:k(s,t.assetPath)}));try{await s.recordAppliedTransaction({label:a,detail:e.map(t=>u(t.assetPath)).join(", "),resources:n.map(({resource:t})=>t.driver.descriptor.key),scope:"project"},n.map(({entry:t,resource:d})=>({resource:d.driver.descriptor.key,beforeBytes:f(t.beforeToken),afterBytes:f(t.afterToken),contentType:"application/vnd.volter.asset-history-token"})))}catch(t){const d=await Promise.allSettled(e.map(r=>l(r.assetPath,r.beforeToken)));for(const r of e)w(r.assetPath);const o=d.find(r=>r.status==="rejected");throw o?.status==="rejected"?new Error(`Project history could not record undo/redo and rollback failed: ${o.reason instanceof Error?o.reason.message:String(o.reason)}`):new Error(`Assets were rolled back because project history could not record undo/redo: ${t instanceof Error?t.message:String(t)}`)}}async function E(e,a=`Import ${e.name}`){const s=await v(e);return s.ok&&s.history&&await A([s.history],a),s}function u(e){const a=e.split(/[?#]/,1)[0].replace(/^\/+/,"");if(!a)throw new Error("Project asset path cannot be empty.");return a}function P(e,a){const s=h(),n=u(e);let t=!1;const d=()=>{t||(t=!0,queueMicrotask(()=>{t=!1,a()}))},o=s?g(s).subscribeAll(i=>{i===n&&d()}):()=>{},r=i=>{const c=i.detail?.paths;(!c||c.some(y=>u(y)===n))&&d()};return typeof window<"u"&&window.addEventListener("editor:assets-changed",r),()=>{o(),typeof window<"u"&&window.removeEventListener("editor:assets-changed",r)}}export{E as d,P as s};
1
+ import{a$ as v,b0 as l,b1 as h,b2 as b,b3 as m,b4 as g}from"./index-BfqJPhFO.js";const p=new WeakMap;function w(e){typeof window>"u"||(window.dispatchEvent(new CustomEvent("editor:assets-changed",{detail:{paths:[u(e)]}})),window.dispatchEvent(new CustomEvent("editor:asset-mutation",{detail:{type:"change",paths:[u(e)]}})))}function k(e,a){const s=u(a);let n=p.get(e);n||(n=new Map,p.set(e,n));const t=n.get(s);if(t)return t;const d=e.registry.registerProject("project-file",`.volter/history/imported-assets/${s}`,s.split("/").pop()),o={revision:0,driver:void 0},r=async()=>{const i=await b(s),c=new TextEncoder().encode(i);return{revision:o.revision,contentType:"application/vnd.volter.asset-history-token",bytes:c,sha256:await m(c)}};return o.driver={descriptor:d,capture:r,preflight:async i=>{const c=await r();return c.sha256===i.sha256?{ok:!0}:{ok:!1,reason:"content-conflict",actualRevision:o.revision,actualSha256:c.sha256}},restore:async i=>{const c=new TextDecoder().decode(e.snapshots.read(i).bytes);await l(s,c),o.revision++,w(s)},estimateBytes:i=>i.byteLength},e.registerDriver(o.driver),n.set(s,o),o}function f(e){return new TextEncoder().encode(e)}async function A(e,a){if(e.length===0)return;const s=h();if(!s)return;const n=e.map(t=>({entry:t,resource:k(s,t.assetPath)}));try{await s.recordAppliedTransaction({label:a,detail:e.map(t=>u(t.assetPath)).join(", "),resources:n.map(({resource:t})=>t.driver.descriptor.key),scope:"project"},n.map(({entry:t,resource:d})=>({resource:d.driver.descriptor.key,beforeBytes:f(t.beforeToken),afterBytes:f(t.afterToken),contentType:"application/vnd.volter.asset-history-token"})))}catch(t){const d=await Promise.allSettled(e.map(r=>l(r.assetPath,r.beforeToken)));for(const r of e)w(r.assetPath);const o=d.find(r=>r.status==="rejected");throw o?.status==="rejected"?new Error(`Project history could not record undo/redo and rollback failed: ${o.reason instanceof Error?o.reason.message:String(o.reason)}`):new Error(`Assets were rolled back because project history could not record undo/redo: ${t instanceof Error?t.message:String(t)}`)}}async function E(e,a=`Import ${e.name}`){const s=await v(e);return s.ok&&s.history&&await A([s.history],a),s}function u(e){const a=e.split(/[?#]/,1)[0].replace(/^\/+/,"");if(!a)throw new Error("Project asset path cannot be empty.");return a}function P(e,a){const s=h(),n=u(e);let t=!1;const d=()=>{t||(t=!0,queueMicrotask(()=>{t=!1,a()}))},o=s?g(s).subscribeAll(i=>{i===n&&d()}):()=>{},r=i=>{const c=i.detail?.paths;(!c||c.some(y=>u(y)===n))&&d()};return typeof window<"u"&&window.addEventListener("editor:assets-changed",r),()=>{o(),typeof window<"u"&&window.removeEventListener("editor:assets-changed",r)}}export{E as d,P as s};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-Byplgb8G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js"])))=>i.map(i=>d[i]);
2
- import{_ as y}from"./index-ClgrFOcX.js";import{clone as g}from"./SkeletonUtils-YH9iLOY_.js";import{AssetParseError as d}from"./asset-parse-error-BHMwBRU3.js";import{setUserData as p}from"./user-data-CODoGZqA.js";import{gltfLoader as _,resolveUrl as x,textureLoader as S}from"./loader-BTUKnX5Q.js";import{co as h,fo as u,K as b}from"./three.core-3arARmh6.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"./three.module-BLhyNg0e.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const m=new Map,l=new Map,c=new Map;function N(e){const n=m.get(e);if(n)return n;const t=S.load(e);return m.set(e,t),t}function R(e){let n=l.get(e);return n||(n=new Promise((t,a)=>{_.load(e,o=>t({scene:o.scene,animations:o.animations}),void 0,o=>a(o))}),l.set(e,n)),n.then(t=>{const a=g(t.scene);return a.traverse(o=>{o instanceof h&&(o.material=Array.isArray(o.material)?o.material.map(s=>s.clone()):o.material.clone(),p(o,"__sharedGeometry",!0))}),{scene:a,animations:t.animations}})}async function V(e,n){let t=c.get(e);!t&&n&&(t=Promise.resolve(n),c.set(e,t)),t||(t=fetch(x(e)).then(async a=>{if(!a.ok)throw new Error(`Failed to load Gaussian splat: ${e} (${a.status} ${a.statusText})`);return new Uint8Array(await a.arrayBuffer())}),c.set(e,t));try{const[{SplatMesh:a},o]=await Promise.all([y(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3])),t]),s=new a({fileBytes:o,fileName:e,raycastable:!0});await s.initialized,p(s,"gaussianSplat",{src:e,numSplats:s.numSplats});const r=s.getBoundingBox();if(!r.isEmpty()){const f=r.getSize(new u).multiplyScalar(1.5),w=r.getCenter(new u),i=new h(new b(f.x,f.y,f.z));i.name="__volter_splat_bounds",i.position.copy(w),i.visible=!1,i.raycast=()=>{},p(i,"engineInternal",!0),s.add(i)}return s}catch(a){throw c.delete(e),a}}function K(e,n,t){const a=e.getObjectByName(n);if(!a)throw new d([{code:"custom",path:["mesh","node"],message:`glTF "${t}" has no node named "${n}" (getObjectByName found nothing)`}],t);const o=r=>r.isSkinnedMesh;let s=o(a);if(s||a.traverse(r=>{o(r)&&(s=!0)}),s)throw new d([{code:"custom",path:["mesh","node"],message:`glTF "${t}" node "${n}" is (or contains) a SkinnedMesh — a skinned mesh cannot be lifted out of its armature (atomic-subtree rule). Reference the whole file instead of a \`node\`, or bake/export a non-skinned sub-asset.`}],t);return a}function q(){m.clear(),l.clear(),c.clear()}function H(e){m.delete(e),l.delete(e)}function J(){return{textures:m.size,gltf:l.size,splat:c.size}}export{J as assetCacheSizes,q as clearAssetCaches,H as invalidateCachedAsset,R as loadGLTF,V as loadSplat,N as loadTexture,K as resolveGltfNode};
2
+ import{_ as y}from"./index-BfqJPhFO.js";import{clone as g}from"./SkeletonUtils-YH9iLOY_.js";import{AssetParseError as d}from"./asset-parse-error-BHMwBRU3.js";import{setUserData as p}from"./user-data-CODoGZqA.js";import{gltfLoader as _,resolveUrl as x,textureLoader as S}from"./loader-BTUKnX5Q.js";import{co as h,fo as u,K as b}from"./three.core-3arARmh6.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"./three.module-BLhyNg0e.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";const m=new Map,l=new Map,c=new Map;function N(e){const n=m.get(e);if(n)return n;const t=S.load(e);return m.set(e,t),t}function R(e){let n=l.get(e);return n||(n=new Promise((t,a)=>{_.load(e,o=>t({scene:o.scene,animations:o.animations}),void 0,o=>a(o))}),l.set(e,n)),n.then(t=>{const a=g(t.scene);return a.traverse(o=>{o instanceof h&&(o.material=Array.isArray(o.material)?o.material.map(s=>s.clone()):o.material.clone(),p(o,"__sharedGeometry",!0))}),{scene:a,animations:t.animations}})}async function V(e,n){let t=c.get(e);!t&&n&&(t=Promise.resolve(n),c.set(e,t)),t||(t=fetch(x(e)).then(async a=>{if(!a.ok)throw new Error(`Failed to load Gaussian splat: ${e} (${a.status} ${a.statusText})`);return new Uint8Array(await a.arrayBuffer())}),c.set(e,t));try{const[{SplatMesh:a},o]=await Promise.all([y(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3])),t]),s=new a({fileBytes:o,fileName:e,raycastable:!0});await s.initialized,p(s,"gaussianSplat",{src:e,numSplats:s.numSplats});const r=s.getBoundingBox();if(!r.isEmpty()){const f=r.getSize(new u).multiplyScalar(1.5),w=r.getCenter(new u),i=new h(new b(f.x,f.y,f.z));i.name="__volter_splat_bounds",i.position.copy(w),i.visible=!1,i.raycast=()=>{},p(i,"engineInternal",!0),s.add(i)}return s}catch(a){throw c.delete(e),a}}function K(e,n,t){const a=e.getObjectByName(n);if(!a)throw new d([{code:"custom",path:["mesh","node"],message:`glTF "${t}" has no node named "${n}" (getObjectByName found nothing)`}],t);const o=r=>r.isSkinnedMesh;let s=o(a);if(s||a.traverse(r=>{o(r)&&(s=!0)}),s)throw new d([{code:"custom",path:["mesh","node"],message:`glTF "${t}" node "${n}" is (or contains) a SkinnedMesh — a skinned mesh cannot be lifted out of its armature (atomic-subtree rule). Reference the whole file instead of a \`node\`, or bake/export a non-skinned sub-asset.`}],t);return a}function q(){m.clear(),l.clear(),c.clear()}function H(e){m.delete(e),l.delete(e)}function J(){return{textures:m.size,gltf:l.size,splat:c.size}}export{J as assetCacheSizes,q as clearAssetCaches,H as invalidateCachedAsset,R as loadGLTF,V as loadSplat,N as loadTexture,K as resolveGltfNode};