@volter/game-editor 0.5.74 → 0.5.75

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 (292) 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 +2134 -2134
  5. package/dist/assets/{AssetBudgetPanel-CsScls8k.js → AssetBudgetPanel-CE18ck0x.js} +3 -3
  6. package/dist/assets/{AudioViewer-C0KaLINZ.js → AudioViewer-CcL-aNBd.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-BH0U2FK3.js → CanvasBoardDocument-uwU0bfJA.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-VALiHtss.js → CanvasSceneViewport-DgzPJJkc.js} +1 -1
  9. package/dist/assets/{ColorInput-BSiPDtkN.js → ColorInput-DwLu76ZD.js} +1 -1
  10. package/dist/assets/{EntityModelDocument-DBZeMkXS.js → EntityModelDocument-DrpizTG_.js} +1 -1
  11. package/dist/assets/{EnvironmentAssetDocument-D3gH_Q1o.js → EnvironmentAssetDocument-BkDbRyDk.js} +1 -1
  12. package/dist/assets/{GameplaySessionTimeline-BZENnCEM.js → GameplaySessionTimeline-lxx-w1ya.js} +1 -1
  13. package/dist/assets/{ImageViewer-Z077ZBuk.js → ImageViewer-280O0PlP.js} +1 -1
  14. package/dist/assets/InspectorObjectPreview-BCGUkGwH.js +1 -0
  15. package/dist/assets/{JsonAssetDocument-DjtYdDni.js → JsonAssetDocument-Fen8_TJ3.js} +1 -1
  16. package/dist/assets/{LiveModuleDocument-BQmh8NEJ.js → LiveModuleDocument-DcAvzW88.js} +1 -1
  17. package/dist/assets/{LutAssetDocument-B3e7mHdw.js → LutAssetDocument-BLlhFO6d.js} +1 -1
  18. package/dist/assets/{ModelAssetDocument-BVIUx7AO.js → ModelAssetDocument-Bz24yrEK.js} +1 -1
  19. package/dist/assets/{NonThreeAuthoringBootstrap-DAjTxCUk.js → NonThreeAuthoringBootstrap-Co881phq.js} +1 -1
  20. package/dist/assets/{Object3DDocumentToolbar-CMFUQpit.js → Object3DDocumentToolbar-xXXySp6z.js} +1 -1
  21. package/dist/assets/Object3DDocumentViewport-ChZBISII.js +2 -0
  22. package/dist/assets/{Object3DPreview-BeQ3dNgr.js → Object3DPreview-DNx1_6NB.js} +1 -1
  23. package/dist/assets/{OnlineAssetDetail-DouLFaxd.js → OnlineAssetDetail-BO_qsMXe.js} +1 -1
  24. package/dist/assets/{PlayBar-DlSAPez7.js → PlayBar-CGjjGuF8.js} +1 -1
  25. package/dist/assets/{QuarksAssetDocument-Ci_5RdOh.js → QuarksAssetDocument-DzGTZwpm.js} +1 -1
  26. package/dist/assets/{ReactCanvasControls-pLDTjk7f.js → ReactCanvasControls-Bmd55pBo.js} +1 -1
  27. package/dist/assets/{RootSelectionOverlay-C2jDNhWx.js → RootSelectionOverlay-BwwoR4b9.js} +1 -1
  28. package/dist/assets/{ShaderAssetDocument-D6DXBZAt.js → ShaderAssetDocument-CNe1tl7L.js} +1 -1
  29. package/dist/assets/{ShadowEditor-BUdib-46.js → ShadowEditor-D0QiV1M7.js} +1 -1
  30. package/dist/assets/{SourceAssetViewer-FrL5IQpU.js → SourceAssetViewer-CPiZgKck.js} +1 -1
  31. package/dist/assets/{StageHost-DiXV3rVP.js → StageHost-Dbo3tKK3.js} +2 -2
  32. package/dist/assets/{StoryPreviewMount-uYhyt63h.js → StoryPreviewMount-BHsmVp-C.js} +1 -1
  33. package/dist/assets/{ThreeBoardDocument-BvnPu_Kt.js → ThreeBoardDocument-D7c4KS7l.js} +2 -2
  34. package/dist/assets/{ThreeIsolationSceneContent-C53huaHh.js → ThreeIsolationSceneContent-Cg0KkL73.js} +1 -1
  35. package/dist/assets/{ToolObject3DPreview-wGS0d8hq.js → ToolObject3DPreview-_N8jhg02.js} +1 -1
  36. package/dist/assets/{Toolbar-wCXICaZA.js → Toolbar-DDYWRWnH.js} +1 -1
  37. package/dist/assets/{TransientHint-BRrfIPg5.js → TransientHint-BLksXwdR.js} +1 -1
  38. package/dist/assets/{VideoViewer-CtoaUhoP.js → VideoViewer-BYLY0WdG.js} +1 -1
  39. package/dist/assets/{ViewportShadingMenu-DPFcOOlk.js → ViewportShadingMenu-DX7Xsut9.js} +1 -1
  40. package/dist/assets/{active-ingest-DCi6B_Mk.js → active-ingest-CEa53vF0.js} +2 -2
  41. package/dist/assets/{animation-clock-DnR5BQwQ.js → animation-clock-Bmz7JDnw.js} +1 -1
  42. package/dist/assets/{animation-mixers.service-Bjfda5Bu.js → animation-mixers.service-DomnndP0.js} +1 -1
  43. package/dist/assets/{animation-timeline.utility-9mLK9gMs.js → animation-timeline.utility-BqoUox48.js} +1 -1
  44. package/dist/assets/{asset-budget-asset.menu-cZSz-LwL.js → asset-budget-asset.menu-CETgSkxJ.js} +1 -1
  45. package/dist/assets/{asset-budget.action-CGVMjOi0.js → asset-budget.action-DwzCiMG2.js} +1 -1
  46. package/dist/assets/{asset-budget.document-D9L-2haO.js → asset-budget.document-CUuV3lCl.js} +1 -1
  47. package/dist/assets/{asset-budget.menu-CUpLs9iu.js → asset-budget.menu-Cc6MA-wa.js} +1 -1
  48. package/dist/assets/{asset-editor-persistence-BVmO7_Y0.js → asset-editor-persistence-BT0v4tAq.js} +1 -1
  49. package/dist/assets/{asset-loaders-PVkGGJJI.js → asset-loaders-5kIo3uwb.js} +1 -1
  50. package/dist/assets/{asset-preview-D9R6R903.js → asset-preview-DrnuNAvs.js} +1 -1
  51. package/dist/assets/{audio-unlock.service-D-GbYty7.js → audio-unlock.service-JqPgkpU5.js} +1 -1
  52. package/dist/assets/{audio.utility-E-qzBR6D.js → audio.utility-CG29gFjH.js} +1 -1
  53. package/dist/assets/autoplay.service-CsXisBg-.js +1 -0
  54. package/dist/assets/{babylon-authoring-adapter-C3VOiksD.js → babylon-authoring-adapter-ClTj2MC3.js} +1 -1
  55. package/dist/assets/{binding-resolver-CqJs8FS9.js → binding-resolver-CTLBEZNC.js} +2 -2
  56. package/dist/assets/{blender-node-editor.document-CPNUVCnn.js → blender-node-editor.document-Cf9QRXXV.js} +1 -1
  57. package/dist/assets/{blender-properties-tab-CiHoYK6t.js → blender-properties-tab-DkDEWTru.js} +1 -1
  58. package/dist/assets/{blender-runtime-host-CoT0G0_R.js → blender-runtime-host-BrSuddiJ.js} +1 -1
  59. package/dist/assets/{blender-runtime-skin-CGNNV3xn.js → blender-runtime-skin-BugpRcn0.js} +1 -1
  60. package/dist/assets/{blender-runtime.document-CJEk-94B.js → blender-runtime.document-DLWi2-0I.js} +1 -1
  61. package/dist/assets/{blender-timeline.document-DP_MuhM4.js → blender-timeline.document-DjN0BpnX.js} +1 -1
  62. package/dist/assets/{blender-uv-editor.document-Cggq1dTC.js → blender-uv-editor.document-D6WYt2QC.js} +1 -1
  63. package/dist/assets/{blender-version.status-C_G5uv7j.js → blender-version.status-CJF052X7.js} +1 -1
  64. package/dist/assets/{blender.command-CzTbMFTm.js → blender.command-BKo8PfAE.js} +1 -1
  65. package/dist/assets/{board-guides-CFM0Dzzw.js → board-guides-DvGa-v8v.js} +1 -1
  66. package/dist/assets/{bridge.command-DWZKDU4z.js → bridge.command-BhkhHZGM.js} +3 -3
  67. package/dist/assets/{browserAll-Bt1yuPoY.js → browserAll-CPJT6e1H.js} +1 -1
  68. package/dist/assets/{build-player.document-CSLA4B-I.js → build-player.document-DmpwrRTe.js} +1 -1
  69. package/dist/assets/{build-profiles.document-vZR8N8Zc.js → build-profiles.document-DJcpRRoj.js} +1 -1
  70. package/dist/assets/{build-progress.status-mGqJ9OWi.js → build-progress.status-BOGJAonH.js} +1 -1
  71. package/dist/assets/{build-session-BEJL-4uT.js → build-session-DcZvicW6.js} +1 -1
  72. package/dist/assets/{build.action-Co8P_po0.js → build.action-CKNJFKFa.js} +1 -1
  73. package/dist/assets/{build.command-Cqtmjck3.js → build.command--0UXYA7h.js} +1 -1
  74. package/dist/assets/{build.header-PNcqwkk1.js → build.header-BUUIrt6i.js} +1 -1
  75. package/dist/assets/{build.menu-BNxEplbC.js → build.menu-CamwcePv.js} +1 -1
  76. package/dist/assets/{build.service-CkuUEkU3.js → build.service-otobfdtq.js} +1 -1
  77. package/dist/assets/{camera-KZ9xGSi8.js → camera-CNDzfNdN.js} +1 -1
  78. package/dist/assets/{camera-runtime.inspector-_IdxJC2q.js → camera-runtime.inspector-C3kGIZal.js} +1 -1
  79. package/dist/assets/{canvas-design-mount-BQJAuFty.js → canvas-design-mount-Dcz3UbWk.js} +3 -3
  80. package/dist/assets/{canvas-entry-runtime-C4V45HMi.js → canvas-entry-runtime-CB0dWiqf.js} +2 -2
  81. package/dist/assets/{canvas-preview-frames-BwQjAyYt.js → canvas-preview-frames-C_AwHp0A.js} +1 -1
  82. package/dist/assets/{canvas-story-capture.service-Dj4pAbC9.js → canvas-story-capture.service-wxtp-uMy.js} +2 -2
  83. package/dist/assets/{capability-coverage-4xMPa566.js → capability-coverage-BW0jhUWf.js} +1 -1
  84. package/dist/assets/{collaboration-presence-CiEcKLpo.js → collaboration-presence-CGBoCEYM.js} +1 -1
  85. package/dist/assets/{collider-DVAc7Hmk.js → collider-D3AE4y5o.js} +1 -1
  86. package/dist/assets/{component-board.service-DLoxCk73.js → component-board.service-BsaSzxqY.js} +2 -2
  87. package/dist/assets/{component-board.service-DK6MwEZa.js → component-board.service-aRqXx_hL.js} +2 -2
  88. package/dist/assets/{component-board.service-CJDzogke.js → component-board.service-e3DqXFbP.js} +2 -2
  89. package/dist/assets/{component-contracts.service-BOe_0crY.js → component-contracts.service-uvgs1KbX.js} +1 -1
  90. package/dist/assets/{component-instance-root-CgmR0Q36.js → component-instance-root-CuhMBeTq.js} +1 -1
  91. package/dist/assets/{component-verbs.command-BOAaWue3.js → component-verbs.command-CTjRTrvO.js} +1 -1
  92. package/dist/assets/{component-verbs.service-DAwiNhNc.js → component-verbs.service-DrMc8AK6.js} +1 -1
  93. package/dist/assets/{config-B64a1eb5.js → config-CDinmkBz.js} +2 -2
  94. package/dist/assets/{configurations-BQSxxjbY.js → configurations-B45jigJP.js} +1 -1
  95. package/dist/assets/{connection.status-C4CA3tnt.js → connection.status-WWrI2jAY.js} +1 -1
  96. package/dist/assets/{constraints.inspector-CWxVm4K9.js → constraints.inspector-bup7b7MV.js} +1 -1
  97. package/dist/assets/{content-bounds-DUlT_Bs_.js → content-bounds-MIXkclKI.js} +1 -1
  98. package/dist/assets/{contract-system-adapters-CEuzOynM.js → contract-system-adapters-Cgl3IHIO.js} +1 -1
  99. package/dist/assets/{coverage.service-HqZrm5L7.js → coverage.service-v4iKehOw.js} +1 -1
  100. package/dist/assets/{create-runtime-Cr_aiT6l.js → create-runtime-CO8JmCX7.js} +1 -1
  101. package/dist/assets/{curve-KeLD-yBc.js → curve-D17Op6q4.js} +1 -1
  102. package/dist/assets/{data-asset-CACLoAiF.js → data-asset-DDdEHQgH.js} +1 -1
  103. package/dist/assets/{data-ref-DHnlpkfW.js → data-ref-CUYCUCMM.js} +1 -1
  104. package/dist/assets/{debug-bridge-DAVwvCKX.js → debug-bridge-Bcgo-vKv.js} +1 -1
  105. package/dist/assets/{debug-registry-B6pk-yrQ.js → debug-registry-DWXKHjIJ.js} +1 -1
  106. package/dist/assets/{deferred-ingest-play-GNKwMor5.js → deferred-ingest-play-Ck7KAYWK.js} +2 -2
  107. package/dist/assets/{design-time-canvas-mount-BDyTbqGy.js → design-time-canvas-mount-MsbDbVsh.js} +2 -2
  108. package/dist/assets/{design-time-layers-DWdxyEke.js → design-time-layers-Be9HqnEr.js} +1 -1
  109. package/dist/assets/{design-time-mount.service-DH5WMBig.js → design-time-mount.service-C-jPEtUV.js} +2 -2
  110. package/dist/assets/{design-time-mount.service-CwYVzkTW.js → design-time-mount.service-CYWk8whR.js} +2 -2
  111. package/dist/assets/{design-time-react-mount-D_Njd_-Z.js → design-time-react-mount-DC_O5p5I.js} +1 -1
  112. package/dist/assets/{document-preview-three-l_JD_wOQ.js → document-preview-three-BojNfjbb.js} +1 -1
  113. package/dist/assets/{dom-authoring-adapter-NjpTX82H.js → dom-authoring-adapter-_VzZnXUh.js} +1 -1
  114. package/dist/assets/{draco3d-uD30kmRz.js → draco3d-BC6NIjGw.js} +1 -1
  115. package/dist/assets/{edit-mode-audio.service-Bc1dJyur.js → edit-mode-audio.service-A9fphO_d.js} +1 -1
  116. package/dist/assets/{edit-mode-authoring-D4gF7ToY.js → edit-mode-authoring-DbOPyppg.js} +1 -1
  117. package/dist/assets/{edit-mode-networking.service-CSJCwcxW.js → edit-mode-networking.service-D1-i4xGa.js} +1 -1
  118. package/dist/assets/{editor-api-oWEXcLGi.js → editor-api-DGGJOWUU.js} +1 -1
  119. package/dist/assets/{editor-layers-BGId-Uru.js → editor-layers-C-4kqPi7.js} +1 -1
  120. package/dist/assets/{editor-shell-store-DhM6KcjO.js → editor-shell-store-BqJU8Lu8.js} +1 -1
  121. package/dist/assets/{entity-object-B77fPnTJ.js → entity-object-S9jvlW_s.js} +1 -1
  122. package/dist/assets/{extend-12Z0hbsT.js → extend-Cz3c0C9r.js} +1 -1
  123. package/dist/assets/{fork-menu-BKv-e4vf.js → fork-menu-BU6hKn6d.js} +1 -1
  124. package/dist/assets/{frame-debugger-store-QZzA9Bp6.js → frame-debugger-store-B7Jbgb39.js} +1 -1
  125. package/dist/assets/{game-contract-seams-Bk8NMwX4.js → game-contract-seams-6S6C0ztA.js} +1 -1
  126. package/dist/assets/{game-css-scope-transform-Qi5A4od1.js → game-css-scope-transform-BOzH2ruv.js} +1 -1
  127. package/dist/assets/{game-document.service-DwyngEP1.js → game-document.service-mNiqtEZ5.js} +1 -1
  128. package/dist/assets/{game-eval.command-D3GcSNpZ.js → game-eval.command-GZ5edKXO.js} +1 -1
  129. package/dist/assets/{game-module-access-DcIMKmZ-.js → game-module-access-CpqKQme4.js} +1 -1
  130. package/dist/assets/{game-network-BRvp9Eya.js → game-network-1JI7uhYb.js} +3 -3
  131. package/dist/assets/{gameplay-export-DjEgXlLD.js → gameplay-export-Bxd_nkX7.js} +1 -1
  132. package/dist/assets/{gameplay-replay-DIU5Uql2.js → gameplay-replay-DP8qTwre.js} +1 -1
  133. package/dist/assets/{gameplay.command-Ckhbu_et.js → gameplay.command-t7Wb_wt1.js} +1 -1
  134. package/dist/assets/{generation-jobs-BDAepEao.js → generation-jobs-BDqluDvk.js} +1 -1
  135. package/dist/assets/{generation.service-BZIxaVg0.js → generation.service-C5VhRZs7.js} +1 -1
  136. package/dist/assets/{generations-fYwLNwQr.js → generations-Oeo95nlK.js} +1 -1
  137. package/dist/assets/{generations.status-DpWkrjr7.js → generations.status-BBfdbcRX.js} +1 -1
  138. package/dist/assets/{hierarchy-marks-BCrDKK5y.js → hierarchy-marks-DolK8jzJ.js} +1 -1
  139. package/dist/assets/{hosted-asset-materialization-D_yDzOYA.js → hosted-asset-materialization-B8i0ftt_.js} +1 -1
  140. package/dist/assets/{index-GlGBb8bs.js → index-BhRaFrvZ.js} +1 -1
  141. package/dist/assets/{index-Bwl4ql-8.js → index-BiOfwZ_V.js} +1 -1
  142. package/dist/assets/{index-TYz8swQz.js → index-BlaTbgwf.js} +1 -1
  143. package/dist/assets/{index-DjHJiUGa.js → index-CBmGldaZ.js} +1 -1
  144. package/dist/assets/{index-D7q9yQaD.js → index-CjZtvEN7.js} +1 -1
  145. package/dist/assets/{index-B0ciEDFT.js → index-DDurbNnD.js} +2 -2
  146. package/dist/assets/{index-Bn8WGRJh.js → index-DMsonpRx.js} +7 -7
  147. package/dist/assets/{index-CLC0lyS8.js → index-DRJx_jIw.js} +1 -1
  148. package/dist/assets/{index-CaD5TSVW.js → index-DmMBT64l.js} +1 -1
  149. package/dist/assets/{inference-diagnostics-BPtSODNJ.js → inference-diagnostics-CUavJjuI.js} +1 -1
  150. package/dist/assets/{ingest-boot-viewport-CYTzGsEC.js → ingest-boot-viewport-I9xll7ou.js} +1 -1
  151. package/dist/assets/{ingest-siblings-0jNvfYjJ.js → ingest-siblings-D3iJi2A3.js} +1 -1
  152. package/dist/assets/{ingest-source-persistence-C-gTDfvH.js → ingest-source-persistence-B0NaYeRY.js} +1 -1
  153. package/dist/assets/{ingest.service-PL_jFRLE.js → ingest.service-BfpZUDne.js} +1 -1
  154. package/dist/assets/{inspect-C1HaQduW.js → inspect-D4blh5_a.js} +1 -1
  155. package/dist/assets/instances.command-BSFguDo-.js +1 -0
  156. package/dist/assets/{json-history-resource-DiN_PLbn.js → json-history-resource-BF-O43PD.js} +1 -1
  157. package/dist/assets/{layered-pick-Bkf0E_UR.js → layered-pick-Ch1BjtVF.js} +1 -1
  158. package/dist/assets/{light-nmEsK8JV.js → light-BISMkAGI.js} +1 -1
  159. package/dist/assets/{live-project-verbs-H6S9jMp9.js → live-project-verbs-DWfBuVx7.js} +1 -1
  160. package/dist/assets/{machine.document-DbzwF7ct.js → machine.document-BVuE_ug9.js} +1 -1
  161. package/dist/assets/{machines.finder-CLK23edR.js → machines.finder-XiuiCI4a.js} +1 -1
  162. package/dist/assets/{material-BX0tqR9K.js → material-BWQT3b7E.js} +1 -1
  163. package/dist/assets/{material-factory-KdJxeWsR.js → material-factory-CtwX6ST-.js} +1 -1
  164. package/dist/assets/{mesh-Dtrk7lEY.js → mesh-DqW2WH9I.js} +1 -1
  165. package/dist/assets/{model-asset-sections.service-B6kG8uli.js → model-asset-sections.service-CQJHkahR.js} +1 -1
  166. package/dist/assets/{model-inspection-Cus72-UK.js → model-inspection-3opJce7d.js} +1 -1
  167. package/dist/assets/{model-thumbnail-Dm3TXja5.js → model-thumbnail-DOixylZe.js} +1 -1
  168. package/dist/assets/{models.finder-BoFyTirM.js → models.finder-CxsWV9l2.js} +1 -1
  169. package/dist/assets/{module-mode-Dm9xepU7.js → module-mode-DSM_f5Yj.js} +2 -2
  170. package/dist/assets/{mount-canvas-ingest-root-Erg3xO7k.js → mount-canvas-ingest-root-T_0LysL3.js} +2 -2
  171. package/dist/assets/{mount-dom-ingest-root-CBfy8dZF.js → mount-dom-ingest-root-BiUuiBav.js} +2 -2
  172. package/dist/assets/{mount-ingest-root-COum-c-U.js → mount-ingest-root-YqfeOphI.js} +2 -2
  173. package/dist/assets/{mount-manifest-DvUJ-fD8.js → mount-manifest-2gQEO6hq.js} +1 -1
  174. package/dist/assets/{mount-three-ingest-root-C1auHtuC.js → mount-three-ingest-root-C9DspkVR.js} +1 -1
  175. package/dist/assets/{mounted-authoring-Cjmi_MYm.js → mounted-authoring-D8pHcD_a.js} +1 -1
  176. package/dist/assets/{mounted-story-viewport-source-pTjqNWJx.js → mounted-story-viewport-source-8HwyvYy_.js} +1 -1
  177. package/dist/assets/{native-debug-module-C_1Fna30.js → native-debug-module-BAc7TBPq.js} +1 -1
  178. package/dist/assets/{navigation-Um6Fjogv.js → navigation-eQVmzrez.js} +1 -1
  179. package/dist/assets/{navmesh.menu-Bx1y_DLx.js → navmesh.menu-Dox4LQK_.js} +1 -1
  180. package/dist/assets/{navmesh.service-B1EYycZ8.js → navmesh.service-DmjvxUHo.js} +1 -1
  181. package/dist/assets/network-observer.service-DRvBwR_w.js +1 -0
  182. package/dist/assets/{network.utility-DHcZnsaE.js → network.utility-CP9zYWoP.js} +1 -1
  183. package/dist/assets/{object3d-document-session-registry-DsJV3XhY.js → object3d-document-session-registry-DLF9rgwj.js} +2 -2
  184. package/dist/assets/{oid-transform-DEzhk73d.js → oid-transform-DAnbWV6K.js} +1 -1
  185. package/dist/assets/{particles-BnGOaZUs.js → particles-OkjoBjQp.js} +1 -1
  186. package/dist/assets/{pixi-authoring-adapter-qsxp_Kpv.js → pixi-authoring-adapter-DMl8lJFO.js} +1 -1
  187. package/dist/assets/{pixi-live-write-target-Br2X6vrk.js → pixi-live-write-target-BHVRq1GT.js} +1 -1
  188. package/dist/assets/{play.command-Cak08ygG.js → play.command-B7RVwcUr.js} +2 -2
  189. package/dist/assets/{presentation-Dr2MWsec.js → presentation-D4z-Nsdr.js} +1 -1
  190. package/dist/assets/{product-DunxREWh.js → product-CfXoCObK.js} +1 -1
  191. package/dist/assets/{profiler.action-BIaSMoN-.js → profiler.action-CNgUtOxQ.js} +1 -1
  192. package/dist/assets/{profiler.menu-CHe06CnG.js → profiler.menu-jrOIDPTc.js} +1 -1
  193. package/dist/assets/{profiler.utility-CSNVq8T0.js → profiler.utility-Cggg6w6h.js} +1 -1
  194. package/dist/assets/{project-authoring-session-Ck0Fj3Y4.js → project-authoring-session-Nq3PmtK1.js} +2 -2
  195. package/dist/assets/{properties-bone-constraints.inspector-kiKXCgM2.js → properties-bone-constraints.inspector-D8BkuaXW.js} +1 -1
  196. package/dist/assets/{properties-bone.inspector-DRJ4OpS_.js → properties-bone.inspector-DTTNuOd1.js} +1 -1
  197. package/dist/assets/{properties-collection.inspector-quSRs0rk.js → properties-collection.inspector-NOoFLq1f.js} +1 -1
  198. package/dist/assets/{properties-constraints.inspector-Cv0-5ePa.js → properties-constraints.inspector-DYIiaZNb.js} +1 -1
  199. package/dist/assets/{properties-data.inspector-CKX81zhT.js → properties-data.inspector-TMysZKfR.js} +1 -1
  200. package/dist/assets/{properties-material.inspector-BRSPtk7G.js → properties-material.inspector-Dtqbi5V4.js} +1 -1
  201. package/dist/assets/{properties-modifiers.inspector-oiF88g6g.js → properties-modifiers.inspector-S-GctzLY.js} +1 -1
  202. package/dist/assets/{properties-object.inspector-DemtGtHR.js → properties-object.inspector-CQ3XCQuN.js} +1 -1
  203. package/dist/assets/{properties-output.inspector-qXRflac7.js → properties-output.inspector-Dn2MZbl3.js} +1 -1
  204. package/dist/assets/{properties-particles.inspector-DMTFYXtX.js → properties-particles.inspector-CSA-4Kfj.js} +1 -1
  205. package/dist/assets/{properties-physics.inspector-Cbnh5FYf.js → properties-physics.inspector-D4vzWubU.js} +1 -1
  206. package/dist/assets/{properties-render.inspector-Cf4fmFmw.js → properties-render.inspector-Copw_ptH.js} +1 -1
  207. package/dist/assets/{properties-scene.inspector-Dlhwx1Jk.js → properties-scene.inspector-oanShDZ2.js} +1 -1
  208. package/dist/assets/{properties-texture.inspector-CFPpgdvS.js → properties-texture.inspector-B7GcTM9I.js} +1 -1
  209. package/dist/assets/{properties-view-layer.inspector-D-3cHcyN.js → properties-view-layer.inspector-BeeSv6ln.js} +1 -1
  210. package/dist/assets/{properties-world.inspector-CGV5u2vS.js → properties-world.inspector-DymYbQG6.js} +1 -1
  211. package/dist/assets/{r3f-design-session-BITr59zE.js → r3f-design-session-CrRJO5C4.js} +2 -2
  212. package/dist/assets/{r3f-physics-binding-BATEkxoi.js → r3f-physics-binding-DrjAxMEm.js} +1 -1
  213. package/dist/assets/{r3f-source-authoring-adapter-eyquaeRl.js → r3f-source-authoring-adapter-DbvQNrK7.js} +1 -1
  214. package/dist/assets/{react-canvas-navigation-DjaqyL9B.js → react-canvas-navigation-C5hLe1sH.js} +1 -1
  215. package/dist/assets/{react-inspector.service-Bpta2-vk.js → react-inspector.service-o6-PRw8z.js} +1 -1
  216. package/dist/assets/{react-story-board-C_L09deC.js → react-story-board-COo6rUfn.js} +1 -1
  217. package/dist/assets/{react-three-rapier.esm-qv3CPTWM.js → react-three-rapier.esm-Q83AB366.js} +1 -1
  218. package/dist/assets/{react-world-authoring-adapter-BUU8rhRd.js → react-world-authoring-adapter-CI1sk6F6.js} +1 -1
  219. package/dist/assets/{realm-services-ugwrIrZB.js → realm-services-CoCivh2s.js} +1 -1
  220. package/dist/assets/{reflection-probe-capture.inspector-B5kTVv5X.js → reflection-probe-capture.inspector-DfCsQR94.js} +1 -1
  221. package/dist/assets/{registry-DLJHmJyM.js → registry-BXZTLQHf.js} +1 -1
  222. package/dist/assets/{relative-import-specifier-CbIyU_9J.js → relative-import-specifier-C6rJbXKw.js} +1 -1
  223. package/dist/assets/{render-env-D0fWD_Cg.js → render-env-C7ytOPzW.js} +1 -1
  224. package/dist/assets/{render-features-C1XRxw0r.js → render-features-1RxcHk6L.js} +1 -1
  225. package/dist/assets/{render-settings-TEF5i9i9.js → render-settings-Bi_X7ET1.js} +1 -1
  226. package/dist/assets/{resolve-three-BB2QWODF.js → resolve-three-fQS0EhsO.js} +3 -3
  227. package/dist/assets/{root-seam-contract-AH-4qn4f.js → root-seam-contract-T0Os3lMG.js} +1 -1
  228. package/dist/assets/{run-selection-D1vl12vH.js → run-selection-BQzUtW8L.js} +1 -1
  229. package/dist/assets/{scene-capture-C29siFao.js → scene-capture-BYhV7vRB.js} +1 -1
  230. package/dist/assets/{scene-document.service-BWVnNGp-.js → scene-document.service-BA4Ivx3I.js} +2 -2
  231. package/dist/assets/{scene-framing-C7Dmipw4.js → scene-framing-DmIN3HFq.js} +1 -1
  232. package/dist/assets/{seeded-random-BMbOsD5m.js → seeded-random-MSFUDgJ4.js} +1 -1
  233. package/dist/assets/{setup-renderer-CCCYtTqV.js → setup-renderer-kDlv1zGC.js} +1 -1
  234. package/dist/assets/{source-object3d-authoring-adapter-Cbbs0YjZ.js → source-object3d-authoring-adapter-CX-1jWDi.js} +1 -1
  235. package/dist/assets/{source-persistence-backend-B2YaNBbK.js → source-persistence-backend-cM6_hFF1.js} +1 -1
  236. package/dist/assets/{stage-keyboard-DKyfSZqk.js → stage-keyboard-q5MkxENL.js} +1 -1
  237. package/dist/assets/{stage-overlay-set-BuEpVdEB.js → stage-overlay-set-Ctlg0HA-.js} +1 -1
  238. package/dist/assets/{stage-presence-markers-BW_-0aHa.js → stage-presence-markers-CeUZ108k.js} +1 -1
  239. package/dist/assets/{stage-transform-tools-CUIBDpNf.js → stage-transform-tools-Do0dhEK4.js} +1 -1
  240. package/dist/assets/{standard-viewport-dressing-oljtBXBW.js → standard-viewport-dressing-DaUVwoH4.js} +1 -1
  241. package/dist/assets/{state-watch.action-CPr8pgP6.js → state-watch.action-DnO9j_lB.js} +1 -1
  242. package/dist/assets/{state-watch.menu-B6E9vQpQ.js → state-watch.menu-DBm7nAtn.js} +1 -1
  243. package/dist/assets/{state-watch.utility-ClzOeKvw.js → state-watch.utility-CtsdHhcg.js} +1 -1
  244. package/dist/assets/{story-capture-CKMQHZc4.js → story-capture-BTklfaD3.js} +1 -1
  245. package/dist/assets/{story-documents-QD7pHb4e.js → story-documents-BDGEJZ0g.js} +1 -1
  246. package/dist/assets/{story-documents.service-3jggyYD4.js → story-documents.service-0i_8h_3B.js} +1 -1
  247. package/dist/assets/{story-documents.service-0heuocG2.js → story-documents.service-IuCs9FoR.js} +1 -1
  248. package/dist/assets/{story-media-presence-BSzcVOx8.js → story-media-presence-BBD2w0nO.js} +1 -1
  249. package/dist/assets/{story-pixi-preview-Bwbu5lsq.js → story-pixi-preview-V3jj9e_j.js} +1 -1
  250. package/dist/assets/{story-presentation-C3wR7htg.js → story-presentation-5ksxI-cK.js} +1 -1
  251. package/dist/assets/{story-three-preview-BiiW5BTL.js → story-three-preview-DLneHHqJ.js} +2 -2
  252. package/dist/assets/{studio-environment-7oYW17Ie.js → studio-environment-DzXPzh3M.js} +1 -1
  253. package/dist/assets/{surface-state-_ZZJugmc.js → surface-state-IkyRZBV7.js} +1 -1
  254. package/dist/assets/{syntactic-prop-specs-AHbdK98K.js → syntactic-prop-specs-Bko1JHCr.js} +1 -1
  255. package/dist/assets/{team-playtest.service-BfGMrLe2.js → team-playtest.service-CTiYMUn7.js} +1 -1
  256. package/dist/assets/{three-BiLYjlR0.js → three-CKv5ucoa.js} +1 -1
  257. package/dist/assets/{three-authoring-adapter-DlqC-T90.js → three-authoring-adapter-C7fn0FHE.js} +1 -1
  258. package/dist/assets/three-authoring.service-cV0zOT1n.js +2 -0
  259. package/dist/assets/{three-ingest-runtime-BsCSoTG8.js → three-ingest-runtime-Cw0ElzJG.js} +1 -1
  260. package/dist/assets/{three-integration-DxXySCHZ.js → three-integration-Qc9a7zSz.js} +2 -2
  261. package/dist/assets/three-integration.service-DvBW98ZW.js +1 -0
  262. package/dist/assets/{three-projection-core-C0R8NXF5.js → three-projection-core-D26OWHpV.js} +1 -1
  263. package/dist/assets/{three-state-28vYMAez.js → three-state-TqrpCspu.js} +1 -1
  264. package/dist/assets/{three-story-capture.service-VJ7oB7Ak.js → three-story-capture.service-CMxC0Cuu.js} +2 -2
  265. package/dist/assets/{three-story-model-yxM6xIDL.js → three-story-model-DJPp75up.js} +1 -1
  266. package/dist/assets/{three-viewport-presentation-PqEhvDqp.js → three-viewport-presentation-D3qj3E-Q.js} +1 -1
  267. package/dist/assets/{transform-mode-request-gml8dpK4.js → transform-mode-request-CLLg1QQA.js} +1 -1
  268. package/dist/assets/{transport-strip-DgeWfqo0.js → transport-strip-Cdx4Ln5g.js} +1 -1
  269. package/dist/assets/transport.header-D4XVOwJA.js +1 -0
  270. package/dist/assets/{tuples-BbhqWWKC.js → tuples-CZHjGrdQ.js} +1 -1
  271. package/dist/assets/{ui-board-document-DcZ0WHEL.js → ui-board-document-B_g7xkDJ.js} +2 -2
  272. package/dist/assets/{user-data-DX18I5LS.js → user-data-BsgiyhZb.js} +1 -1
  273. package/dist/assets/{utility-view-state-CV4sNyaf.js → utility-view-state-Aza1mypE.js} +1 -1
  274. package/dist/assets/{viewport-door-C_XkG4b1.js → viewport-door-D7E51csI.js} +1 -1
  275. package/dist/assets/{viewport-root-presentation-h3E0Xsra.js → viewport-root-presentation-DtrhPv-6.js} +1 -1
  276. package/dist/assets/{viewport-surface-status-OxaV9weN.js → viewport-surface-status-Cieefesr.js} +1 -1
  277. package/dist/assets/{webworkerAll-DtOnnkrI.js → webworkerAll-DJ5jfNlk.js} +1 -1
  278. package/dist/assets/{workspace-arrangement-Dg7zIkwR.js → workspace-arrangement-CHzaISez.js} +1 -1
  279. package/dist/assets/{world-documents-DAcA8wNx.js → world-documents-PDNNMgyx.js} +1 -1
  280. package/dist/assets/{world-root-stage-binding-CHamVnwM.js → world-root-stage-binding-C9ukgtlZ.js} +1 -1
  281. package/dist/assets/{xstate-animation-binding-DQkf6q6S.js → xstate-animation-binding-W5-Rb-KL.js} +1 -1
  282. package/dist/assets/{xstate-animation-meta-DFSFf8d4.js → xstate-animation-meta-C5PJ3icJ.js} +1 -1
  283. package/dist-node/cli.js +19 -17
  284. package/package.json +16 -16
  285. package/dist/assets/InspectorObjectPreview-uhttAefh.js +0 -1
  286. package/dist/assets/Object3DDocumentViewport-9yg2UH4I.js +0 -2
  287. package/dist/assets/autoplay.service-DFqlxmS0.js +0 -1
  288. package/dist/assets/instances.command-CNhLn9a9.js +0 -1
  289. package/dist/assets/network-observer.service-CnOV9u6I.js +0 -1
  290. package/dist/assets/three-authoring.service-DZWsZPqx.js +0 -2
  291. package/dist/assets/three-integration.service-BgzJ-hPW.js +0 -1
  292. package/dist/assets/transport.header-eMf7tt0a.js +0 -1
@@ -1 +1 @@
1
- import{gm as z,O as p,aa as I,gn as P,go as N,aA as H,gp as C,bt as f,b3 as F,gq as g,gr as _,gs as W,gt as $,aw as x,gu as O,gv as B,gw as M,gx as A,bs as D,gy as T}from"./index-Bn8WGRJh.js";const q={transform:!1,inspectorFields:!1,persist:!1};class G{capabilities=q;provenance={source:"boundary",label:"read-only",detail:"Declared world without a live editing surface in this viewport — disclosed, not simulated; rows are read-only."};world;reason;store;pickable;constructor(e,r,n,s){this.store=e,this.world=r,this.reason=n??null,s&&(this.pickable={pick:s})}get disclosure(){return this.reason}get label(){return this.world.entryOrScenePath?.split("/").pop()??this.world.id}get node(){return{id:this.world.id,label:this.label,secondaryLabel:this.reason?"Unavailable":"Read-only",role:"boundary",kind:this.world.kind,parentId:null,childIds:[]}}hierarchy={roots:()=>[this.node],node:e=>e===this.world.id?this.node:null};selection={get:()=>[...this.store.selectedEntityIds],set:e=>this.store.selectMultiple(e)};inspector={properties:e=>{if(e!==this.world.id)return[];const r=[{path:"kind",label:"Kind",type:"string",readonly:!0}];return this.world.adapter!==void 0&&r.push({path:"adapter",label:"Adapter",type:"string",readonly:!0}),this.world.entryOrScenePath!==void 0&&r.push({path:"path",label:"Entry / Scene",type:"string",readonly:!0}),r.push({path:"zOrder",label:"Z Order",type:"number",readonly:!0},{path:"pausable",label:"Pausable",type:"boolean",readonly:!0}),this.reason&&r.push({path:"reason",label:"Reason",type:"string",readonly:!0}),r},get:(e,r)=>{if(e===this.world.id)switch(r){case"kind":return this.world.kind;case"adapter":return this.world.adapter;case"path":return this.world.entryOrScenePath;case"zOrder":return this.world.zOrder;case"pausable":return this.world.pausable;case"reason":return this.reason??void 0;default:return}},set:(e,r,n)=>{}}}const u=new WeakMap,V=new Set;function R(){for(const t of V)t()}function J(t){const e=(u.get(t)?.generation??0)+1;return u.set(t,{generation:e,settled:!1}),R(),()=>{const r=u.get(t);!r||r.generation!==e||r.settled||(u.set(t,{generation:e,settled:!0}),R())}}const L="(invalid manifest)";let v=!1,b=!1,w=!1,l=null;function h(){if(b||w||!v||!l)return;b=!0;const t=l;queueMicrotask(()=>{if(b=!1,l!==t){h();return}v=!1,w=!0,Promise.resolve().then(t).catch(e=>{p.error(`Edit-mode rebuild failed: ${e instanceof Error?e.message:String(e)}`,"authoring")}).finally(()=>{w=!1,h()})})}function re(t){return l=t,h(),()=>{l===t&&(l=null)}}function ne(){v=!0,h()}const K=new Set(["three","canvas","dom"]);function d(t){return typeof t=="string"?t:void 0}function U(t){const e=t.world;if(!e||typeof e!="object")return;const r=d(e.entry);if(r)return{entry:r,export:d(e.export)}}function Z(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="object"){const e=t;if(typeof e.module=="string")return`module:${e.module}`;const r=e.ingest;if(r&&typeof r=="object")return"ingest"}}}function Q(t){if(!t||typeof t!="object")return null;const e=t.roots;return e===void 0||!Array.isArray(e)?null:{roots:e.map((n,s)=>{const i=n&&typeof n=="object"?n:{},a=i.zOrder,o=i.pausable;return{id:d(i.id)??`(world ${s})`,surface:(typeof i.adapter=="string"?d(i.adapter):void 0)??d(i.adapter&&typeof i.adapter=="object"?i.adapter.surface:void 0)??"(missing adapter surface)",adapter:Z(i.adapter),scene:d(i.scene),entry:d(i.entry),zOrder:typeof a=="number"?a:void 0,pausable:typeof o=="boolean"?o:void 0,dev:i.dev===!0,world:U(i)}})}}function X(t){return K.has(t.surface)?!t.scene&&!t.entry?`World "${t.id}" declares neither \`scene\` nor \`entry\` — nothing to mount.`:null:`Unknown world surface "${t.surface}" — expected one of: three, canvas, react.`}function c(t,e){const r=t.roots;if(Array.isArray(r))return r.find(n=>!!n&&typeof n=="object"&&n.id===e)}function E(t,e){return c(t,e)}class Y{raw;synthesizedValue;store;fileHistory;unsubscribeHistory;constructor(e,r,n){this.raw=e,this.synthesizedValue=r,this.store=n;const s=n.projectHistory;this.fileHistory=s?F(s,g(),"project-manifest"):null,this.unsubscribeHistory=this.fileHistory?this.fileHistory.subscribeAll(i=>{i==="volter.project.json"&&g().readBytes(i).then(a=>JSON.parse(new TextDecoder().decode(a))).then(a=>{for(const o of Object.keys(this.raw))delete this.raw[o];Object.assign(this.raw,a),this.store.notifyIngestEdit()}).catch(()=>{})}):null}getGameName(){const e=this.raw.name;return typeof e=="string"?e:""}get synthesized(){return this.synthesizedValue}setGameName(e){this.raw.name=e,this.persist("Rename Game")}getRootContentSource(e){const r=c(this.raw,e);if(!r)return;const n=r.scene;if(typeof n=="string")return`Scene · ${n}`;const s=r.entry;return typeof s=="string"?`Entry · ${s}`:"Adapter-owned runtime content"}getRootZOrder(e){const r=c(this.raw,e)?.zOrder;return typeof r=="number"?r:0}setRootZOrder(e,r){const n=E(this.raw,e);n&&(n.zOrder=r,this.persist("Change World Order"))}getRootPausable(e){const r=c(this.raw,e)?.pausable;return typeof r=="boolean"?r:!0}setRootPausable(e,r){const n=E(this.raw,e);n&&(n.pausable=r,this.persist("Change World Pausing"))}async materialize(){const e=await this.write("Create Game Manifest");return e&&(this.synthesizedValue=!1),e}dispose(){this.unsubscribeHistory?.()}persist(e){this.synthesized||this.write(e)}async write(e){const r=JSON.stringify(this.raw,null,2);try{if(this.fileHistory)return await this.fileHistory.write("volter.project.json",r,{label:e,kind:"manifest",contentType:"application/json"}),this.store.notifyIngestEdit(),!0;const n=async()=>{const s=await fetch("/__editor/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"volter.project.json",content:r,..._()})});W(s,"Write volter.project.json failed"),s.ok||await $(s,{label:"Write volter.project.json",attempted:{"volter.project.json":r},reapply:n})};return await n(),this.store.notifyIngestEdit(),!0}catch(n){return this.fileHistory&&g().readBytes("volter.project.json").then(s=>JSON.parse(new TextDecoder().decode(s))).then(s=>{for(const i of Object.keys(this.raw))delete this.raw[i];Object.assign(this.raw,s),this.store.notifyIngestEdit()}).catch(()=>{}),p.error(`Failed to write volter.project.json: ${n}`,"project"),!1}}}let m=null;function ee(t,e,r){const n=I(e).map(o=>{const y=o.zOrder??0,j=P(o.surface);if(j)return{worldId:o.id,kind:o.surface,adapter:j(t,o.id),zOrder:y};const S=X(o),k={id:o.id,kind:o.surface,adapter:o.adapter,entryOrScenePath:o.scene??o.entry,zOrder:y,pausable:o.pausable??!0};return{worldId:o.id,kind:o.surface,adapter:new G(t,k,S??void 0),zOrder:y}}),s=r&&n.length>=1?new Y(r.raw,r.synthesized,t):void 0;m=s??null;const i=N(x()?.config),a=new H(n,s,i);if(n.length>=1){if(O()&&!B())return p.warn("Edit-mode authoring not installed: a foreign session (ingest/play) owns the authoring override.","authoring"),a;C(a),f(a),t.notifyIngestEdit()}else if(!O()){const o=D(t,"No world yet","Declare a root in volter.project.json");M(o),f(o),t.notifyIngestEdit()}return a}function se(t){t&&A()===t&&f(null);const e=T();e&&A()===e&&f(null),M(null),m?.dispose(),m=null}async function ie(t){const e=J(t);let r,n;try{const s=await z(),i=s!==null&&Q(s);if(i)r=i,n={raw:s,synthesized:!1};else throw new Error("manifest has no `roots` array (zero roots is fine; a missing field is not)")}catch(s){const i=s instanceof Error?s.message:String(s);p.error(`Failed to load volter.project.json: ${i}`,"project"),r={roots:[{id:"manifest",surface:L,adapter:i}]}}try{return ee(t,r,n)}finally{e()}}export{G as B,L as I,re as b,se as e,ie as i,Q as p,ne as q};
1
+ import{gm as z,O as p,aa as I,gn as P,go as N,aA as H,gp as C,bt as f,b3 as F,gq as g,gr as _,gs as W,gt as $,aw as x,gu as O,gv as B,gw as M,gx as A,bs as D,gy as T}from"./index-DMsonpRx.js";const q={transform:!1,inspectorFields:!1,persist:!1};class G{capabilities=q;provenance={source:"boundary",label:"read-only",detail:"Declared world without a live editing surface in this viewport — disclosed, not simulated; rows are read-only."};world;reason;store;pickable;constructor(e,r,n,s){this.store=e,this.world=r,this.reason=n??null,s&&(this.pickable={pick:s})}get disclosure(){return this.reason}get label(){return this.world.entryOrScenePath?.split("/").pop()??this.world.id}get node(){return{id:this.world.id,label:this.label,secondaryLabel:this.reason?"Unavailable":"Read-only",role:"boundary",kind:this.world.kind,parentId:null,childIds:[]}}hierarchy={roots:()=>[this.node],node:e=>e===this.world.id?this.node:null};selection={get:()=>[...this.store.selectedEntityIds],set:e=>this.store.selectMultiple(e)};inspector={properties:e=>{if(e!==this.world.id)return[];const r=[{path:"kind",label:"Kind",type:"string",readonly:!0}];return this.world.adapter!==void 0&&r.push({path:"adapter",label:"Adapter",type:"string",readonly:!0}),this.world.entryOrScenePath!==void 0&&r.push({path:"path",label:"Entry / Scene",type:"string",readonly:!0}),r.push({path:"zOrder",label:"Z Order",type:"number",readonly:!0},{path:"pausable",label:"Pausable",type:"boolean",readonly:!0}),this.reason&&r.push({path:"reason",label:"Reason",type:"string",readonly:!0}),r},get:(e,r)=>{if(e===this.world.id)switch(r){case"kind":return this.world.kind;case"adapter":return this.world.adapter;case"path":return this.world.entryOrScenePath;case"zOrder":return this.world.zOrder;case"pausable":return this.world.pausable;case"reason":return this.reason??void 0;default:return}},set:(e,r,n)=>{}}}const u=new WeakMap,V=new Set;function R(){for(const t of V)t()}function J(t){const e=(u.get(t)?.generation??0)+1;return u.set(t,{generation:e,settled:!1}),R(),()=>{const r=u.get(t);!r||r.generation!==e||r.settled||(u.set(t,{generation:e,settled:!0}),R())}}const L="(invalid manifest)";let v=!1,b=!1,w=!1,l=null;function h(){if(b||w||!v||!l)return;b=!0;const t=l;queueMicrotask(()=>{if(b=!1,l!==t){h();return}v=!1,w=!0,Promise.resolve().then(t).catch(e=>{p.error(`Edit-mode rebuild failed: ${e instanceof Error?e.message:String(e)}`,"authoring")}).finally(()=>{w=!1,h()})})}function re(t){return l=t,h(),()=>{l===t&&(l=null)}}function ne(){v=!0,h()}const K=new Set(["three","canvas","dom"]);function d(t){return typeof t=="string"?t:void 0}function U(t){const e=t.world;if(!e||typeof e!="object")return;const r=d(e.entry);if(r)return{entry:r,export:d(e.export)}}function Z(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="object"){const e=t;if(typeof e.module=="string")return`module:${e.module}`;const r=e.ingest;if(r&&typeof r=="object")return"ingest"}}}function Q(t){if(!t||typeof t!="object")return null;const e=t.roots;return e===void 0||!Array.isArray(e)?null:{roots:e.map((n,s)=>{const i=n&&typeof n=="object"?n:{},a=i.zOrder,o=i.pausable;return{id:d(i.id)??`(world ${s})`,surface:(typeof i.adapter=="string"?d(i.adapter):void 0)??d(i.adapter&&typeof i.adapter=="object"?i.adapter.surface:void 0)??"(missing adapter surface)",adapter:Z(i.adapter),scene:d(i.scene),entry:d(i.entry),zOrder:typeof a=="number"?a:void 0,pausable:typeof o=="boolean"?o:void 0,dev:i.dev===!0,world:U(i)}})}}function X(t){return K.has(t.surface)?!t.scene&&!t.entry?`World "${t.id}" declares neither \`scene\` nor \`entry\` — nothing to mount.`:null:`Unknown world surface "${t.surface}" — expected one of: three, canvas, react.`}function c(t,e){const r=t.roots;if(Array.isArray(r))return r.find(n=>!!n&&typeof n=="object"&&n.id===e)}function E(t,e){return c(t,e)}class Y{raw;synthesizedValue;store;fileHistory;unsubscribeHistory;constructor(e,r,n){this.raw=e,this.synthesizedValue=r,this.store=n;const s=n.projectHistory;this.fileHistory=s?F(s,g(),"project-manifest"):null,this.unsubscribeHistory=this.fileHistory?this.fileHistory.subscribeAll(i=>{i==="volter.project.json"&&g().readBytes(i).then(a=>JSON.parse(new TextDecoder().decode(a))).then(a=>{for(const o of Object.keys(this.raw))delete this.raw[o];Object.assign(this.raw,a),this.store.notifyIngestEdit()}).catch(()=>{})}):null}getGameName(){const e=this.raw.name;return typeof e=="string"?e:""}get synthesized(){return this.synthesizedValue}setGameName(e){this.raw.name=e,this.persist("Rename Game")}getRootContentSource(e){const r=c(this.raw,e);if(!r)return;const n=r.scene;if(typeof n=="string")return`Scene · ${n}`;const s=r.entry;return typeof s=="string"?`Entry · ${s}`:"Adapter-owned runtime content"}getRootZOrder(e){const r=c(this.raw,e)?.zOrder;return typeof r=="number"?r:0}setRootZOrder(e,r){const n=E(this.raw,e);n&&(n.zOrder=r,this.persist("Change World Order"))}getRootPausable(e){const r=c(this.raw,e)?.pausable;return typeof r=="boolean"?r:!0}setRootPausable(e,r){const n=E(this.raw,e);n&&(n.pausable=r,this.persist("Change World Pausing"))}async materialize(){const e=await this.write("Create Game Manifest");return e&&(this.synthesizedValue=!1),e}dispose(){this.unsubscribeHistory?.()}persist(e){this.synthesized||this.write(e)}async write(e){const r=JSON.stringify(this.raw,null,2);try{if(this.fileHistory)return await this.fileHistory.write("volter.project.json",r,{label:e,kind:"manifest",contentType:"application/json"}),this.store.notifyIngestEdit(),!0;const n=async()=>{const s=await fetch("/__editor/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"volter.project.json",content:r,..._()})});W(s,"Write volter.project.json failed"),s.ok||await $(s,{label:"Write volter.project.json",attempted:{"volter.project.json":r},reapply:n})};return await n(),this.store.notifyIngestEdit(),!0}catch(n){return this.fileHistory&&g().readBytes("volter.project.json").then(s=>JSON.parse(new TextDecoder().decode(s))).then(s=>{for(const i of Object.keys(this.raw))delete this.raw[i];Object.assign(this.raw,s),this.store.notifyIngestEdit()}).catch(()=>{}),p.error(`Failed to write volter.project.json: ${n}`,"project"),!1}}}let m=null;function ee(t,e,r){const n=I(e).map(o=>{const y=o.zOrder??0,j=P(o.surface);if(j)return{worldId:o.id,kind:o.surface,adapter:j(t,o.id),zOrder:y};const S=X(o),k={id:o.id,kind:o.surface,adapter:o.adapter,entryOrScenePath:o.scene??o.entry,zOrder:y,pausable:o.pausable??!0};return{worldId:o.id,kind:o.surface,adapter:new G(t,k,S??void 0),zOrder:y}}),s=r&&n.length>=1?new Y(r.raw,r.synthesized,t):void 0;m=s??null;const i=N(x()?.config),a=new H(n,s,i);if(n.length>=1){if(O()&&!B())return p.warn("Edit-mode authoring not installed: a foreign session (ingest/play) owns the authoring override.","authoring"),a;C(a),f(a),t.notifyIngestEdit()}else if(!O()){const o=D(t,"No world yet","Declare a root in volter.project.json");M(o),f(o),t.notifyIngestEdit()}return a}function se(t){t&&A()===t&&f(null);const e=T();e&&A()===e&&f(null),M(null),m?.dispose(),m=null}async function ie(t){const e=J(t);let r,n;try{const s=await z(),i=s!==null&&Q(s);if(i)r=i,n={raw:s,synthesized:!1};else throw new Error("manifest has no `roots` array (zero roots is fine; a missing field is not)")}catch(s){const i=s instanceof Error?s.message:String(s);p.error(`Failed to load volter.project.json: ${i}`,"project"),r={roots:[{id:"manifest",surface:L,adapter:i}]}}try{return ee(t,r,n)}finally{e()}}export{G as B,L as I,re as b,se as e,ie as i,Q as p,ne as q};
@@ -1 +1 @@
1
- import{eu as n,aw as i,ev as s}from"./index-Bn8WGRJh.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";function c(){const t=(i()?.config.configurations??[]).find(o=>o.kind==="process"&&typeof o.port=="number");return t?{endpoint:`ws://${globalThis.location?.hostname||"localhost"}:${t.port}`}:null}const a=[],p={entities:0,msgsInPerSec:0,msgsOutPerSec:0};function l(t){return{peers:()=>a,networkId:()=>null,authority:()=>"local",editable:()=>!0,getConnectionState:()=>"disconnected",getRoomInfo:()=>null,getReplicationStats:()=>p,subscribe:()=>()=>{},getServerConfig:()=>t}}function r(){const t=c();return t?(n(l(t)),()=>n(null)):()=>{}}const E="workspace.service";function k(){let t=r();const e=s(()=>{t(),t=r()});return()=>{e(),t()}}export{E as point,k as start};
1
+ import{eu as n,aw as i,ev as s}from"./index-DMsonpRx.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";function c(){const t=(i()?.config.configurations??[]).find(o=>o.kind==="process"&&typeof o.port=="number");return t?{endpoint:`ws://${globalThis.location?.hostname||"localhost"}:${t.port}`}:null}const a=[],p={entities:0,msgsInPerSec:0,msgsOutPerSec:0};function l(t){return{peers:()=>a,networkId:()=>null,authority:()=>"local",editable:()=>!0,getConnectionState:()=>"disconnected",getRoomInfo:()=>null,getReplicationStats:()=>p,subscribe:()=>()=>{},getServerConfig:()=>t}}function r(){const t=c();return t?(n(l(t)),()=>n(null)):()=>{}}const E="workspace.service";function k(){let t=r();const e=s(()=>{t(),t=r()});return()=>{e(),t()}}export{E as point,k as start};
@@ -1 +1 @@
1
- import{Q as e,Y as r,bB as i,bC as a,bD as p,bE as m}from"./index-Bn8WGRJh.js";import{bF as Ot,bG as Ht,bH as Ut,bI as qt,bJ as Bt,bK as Jt,bL as Mt,b1 as Qt,bM as Vt,bN as Yt,bO as _t,bP as Kt,bQ as Nt,a_ as Xt,bR as Zt,bS as zt,bT as te,bU as ee,bV as re,bW as oe,bX as se,bY as ie,bZ as ae,b_ as pe,b$ as me,c0 as ne,c1 as ce,c2 as le,c3 as de,c4 as be,c5 as ge,c6 as ue,c7 as Ee,c8 as Se,c9 as ye,ca as Pe,cb as je,cc as ve,cd as fe,ce as he,cf as Ae,cg as ke,ch as we,ci as Ce,cj as Re,ck as Fe,cl as Te,cm as xe,cn as Le,co as De,cp as Ge,a$ as We,cq as $e,cr as Ie,cs as Oe,ct as He,cu as Ue,cv as qe,cw as Be}from"./index-Bn8WGRJh.js";import{o as Me,q as Qe,t as Ve}from"./game-network-BRvp9Eya.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-C_1Fna30.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B6pk-yrQ.js";import"./contract-system-adapters-CEuzOynM.js";import"./game-contract-seams-Bk8NMwX4.js";import"./seeded-random-BMbOsD5m.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-H6S9jMp9.js";import"./capability-coverage-4xMPa566.js";import"./edit-mode-authoring-D4gF7ToY.js";import"./json-history-resource-DiN_PLbn.js";import"./binding-resolver-CqJs8FS9.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-ugwrIrZB.js";import"./canvas-entry-runtime-C4V45HMi.js";import"./three-ingest-runtime-BsCSoTG8.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-DCi6B_Mk.js";import"./ingest-source-persistence-C-gTDfvH.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-h3E0Xsra.js";import"./mounted-authoring-Cjmi_MYm.js";import"./entity-object-B77fPnTJ.js";import"./user-data-DX18I5LS.js";import"./workspace-arrangement-Dg7zIkwR.js";import"./three-contract-Dkt6PmWY.js";import"./three-BiLYjlR0.js";import"./editor-layers-BGId-Uru.js";import"./component-instance-root-CgmR0Q36.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DlqC-T90.js";import"./source-persistence-backend-B2YaNBbK.js";import"./three-projection-core-C0R8NXF5.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BATEkxoi.js";import"./deferred-ingest-play-GNKwMor5.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BUU8rhRd.js";import"./board-guides-CFM0Dzzw.js";import"./relative-import-specifier-CbIyU_9J.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C1HaQduW.js";import"./inference-diagnostics-BPtSODNJ.js";import"./writer-tw6EcuVO.js";import"./three-state-28vYMAez.js";import"./editor-shell-store-DhM6KcjO.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-C_XkG4b1.js";import"./game-surface-defaults-D8S4cRxi.js";async function Dt(){try{const t=await fetch(`${e}/examples`);return(await r(t,`GET ${e}/examples failed`)).examples}catch{return[]}}function Gt(t){return t.startsWith("/")?t:`${e}/learn-thumbnail?file=${encodeURIComponent(t)}`}async function Wt(){const t=await fetch(`${e}/templates`);return(await r(t,`GET ${e}/templates failed`)).templates}export{Ot as AssetDeliveryError,m as abortGameplayRecordingSink,Ht as adaptProjectFolder,Ut as appendGameplayRecordingAsset,a as appendGameplayRecordingChunk,qt as appendGameplayRecordingDomEvents,Bt as archiveEditorWorktree,Jt as assetDeliveryIssueMessage,i as beginGameplayRecordingSink,Mt as browseFolder,Qt as captureProjectAssetHistory,Vt as connectEvents,Yt as connectTabPresence,_t as createEditorWorktree,Kt as createProject,Nt as delegateEditorTask,Xt as downloadOnlineAsset,Me as endLogSession,p as finishGameplayRecordingSink,Qe as flushLogEntries,Zt as getAssetLibraryCategories,zt as getCurrentServerProject,te as getDownloadUrl,ee as getDownloadedAssetPath,re as getEditorCompatibility,oe as getEditorRepositoryPresence,se as getEditorSessionWorktreeIdentity,ie as getLauncherSettings,ae as getOnlineAssetFiles,pe as getOnlineAssetPreview,me as getServerValidationLog,ne as inspectProjectFolder,Gt as learnThumbnailUrl,ce as listAssets,le as listDelegateHarnesses,de as listEditorWorktrees,Dt as listExamples,be as listProjectComponents,ge as listProjectSourceFiles,ue as listRecentProjects,Wt as listTemplates,Ee as loadDownloadedAssets,Se as loadEditorState,ye as onAssetDownloaded,Pe as openEditorWorktree,je as openProjectOnServer,ve as pollEditorLeaseIdentity,fe as probeCurrentServerProject,he as probeProjectFile,Ae as projectFileExists,ke as readProjectSourceText,we as readProjectTextFile,Ce as removeRecentProject,Re as reportCommandListener,Fe as reportCommandReceived,Te as reportCommandResult,xe as reportEditorState,Le as reportPlayBootPhase,De as reportTabRoute,Ge as requireEditorCompatibility,We as restoreProjectAssetHistory,$e as revealInFinder,Ie as saveEditorState,Oe as saveFile,He as saveThumbnail,Ue as searchOnlineAssets,Ve as startLogSession,qe as stopEditorWorktreeSession,Be as updateLauncherSettings};
1
+ import{Q as e,Y as r,bB as i,bC as a,bD as p,bE as m}from"./index-DMsonpRx.js";import{bF as Ot,bG as Ht,bH as Ut,bI as qt,bJ as Bt,bK as Jt,bL as Mt,b1 as Qt,bM as Vt,bN as Yt,bO as _t,bP as Kt,bQ as Nt,a_ as Xt,bR as Zt,bS as zt,bT as te,bU as ee,bV as re,bW as oe,bX as se,bY as ie,bZ as ae,b_ as pe,b$ as me,c0 as ne,c1 as ce,c2 as le,c3 as de,c4 as be,c5 as ge,c6 as ue,c7 as Ee,c8 as Se,c9 as ye,ca as Pe,cb as je,cc as ve,cd as fe,ce as he,cf as Ae,cg as ke,ch as we,ci as Ce,cj as Re,ck as Fe,cl as Te,cm as xe,cn as Le,co as De,cp as Ge,a$ as We,cq as $e,cr as Ie,cs as Oe,ct as He,cu as Ue,cv as qe,cw as Be}from"./index-DMsonpRx.js";import{o as Me,q as Qe,t as Ve}from"./game-network-1JI7uhYb.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BAc7TBPq.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DWXKHjIJ.js";import"./contract-system-adapters-Cgl3IHIO.js";import"./game-contract-seams-6S6C0ztA.js";import"./seeded-random-MSFUDgJ4.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-DWfBuVx7.js";import"./capability-coverage-BW0jhUWf.js";import"./edit-mode-authoring-DbOPyppg.js";import"./json-history-resource-BF-O43PD.js";import"./binding-resolver-CTLBEZNC.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CoCivh2s.js";import"./canvas-entry-runtime-CB0dWiqf.js";import"./three-ingest-runtime-Cw0ElzJG.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CEa53vF0.js";import"./ingest-source-persistence-B0NaYeRY.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DtrhPv-6.js";import"./mounted-authoring-D8pHcD_a.js";import"./entity-object-S9jvlW_s.js";import"./user-data-BsgiyhZb.js";import"./workspace-arrangement-CHzaISez.js";import"./three-contract-Dkt6PmWY.js";import"./three-CKv5ucoa.js";import"./editor-layers-C-4kqPi7.js";import"./component-instance-root-CuhMBeTq.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C7fn0FHE.js";import"./source-persistence-backend-cM6_hFF1.js";import"./three-projection-core-D26OWHpV.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DrjAxMEm.js";import"./deferred-ingest-play-Ck7KAYWK.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CI1sk6F6.js";import"./board-guides-DvGa-v8v.js";import"./relative-import-specifier-C6rJbXKw.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-D4blh5_a.js";import"./inference-diagnostics-CUavJjuI.js";import"./writer-tw6EcuVO.js";import"./three-state-TqrpCspu.js";import"./editor-shell-store-BqJU8Lu8.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-D7E51csI.js";import"./game-surface-defaults-D8S4cRxi.js";async function Dt(){try{const t=await fetch(`${e}/examples`);return(await r(t,`GET ${e}/examples failed`)).examples}catch{return[]}}function Gt(t){return t.startsWith("/")?t:`${e}/learn-thumbnail?file=${encodeURIComponent(t)}`}async function Wt(){const t=await fetch(`${e}/templates`);return(await r(t,`GET ${e}/templates failed`)).templates}export{Ot as AssetDeliveryError,m as abortGameplayRecordingSink,Ht as adaptProjectFolder,Ut as appendGameplayRecordingAsset,a as appendGameplayRecordingChunk,qt as appendGameplayRecordingDomEvents,Bt as archiveEditorWorktree,Jt as assetDeliveryIssueMessage,i as beginGameplayRecordingSink,Mt as browseFolder,Qt as captureProjectAssetHistory,Vt as connectEvents,Yt as connectTabPresence,_t as createEditorWorktree,Kt as createProject,Nt as delegateEditorTask,Xt as downloadOnlineAsset,Me as endLogSession,p as finishGameplayRecordingSink,Qe as flushLogEntries,Zt as getAssetLibraryCategories,zt as getCurrentServerProject,te as getDownloadUrl,ee as getDownloadedAssetPath,re as getEditorCompatibility,oe as getEditorRepositoryPresence,se as getEditorSessionWorktreeIdentity,ie as getLauncherSettings,ae as getOnlineAssetFiles,pe as getOnlineAssetPreview,me as getServerValidationLog,ne as inspectProjectFolder,Gt as learnThumbnailUrl,ce as listAssets,le as listDelegateHarnesses,de as listEditorWorktrees,Dt as listExamples,be as listProjectComponents,ge as listProjectSourceFiles,ue as listRecentProjects,Wt as listTemplates,Ee as loadDownloadedAssets,Se as loadEditorState,ye as onAssetDownloaded,Pe as openEditorWorktree,je as openProjectOnServer,ve as pollEditorLeaseIdentity,fe as probeCurrentServerProject,he as probeProjectFile,Ae as projectFileExists,ke as readProjectSourceText,we as readProjectTextFile,Ce as removeRecentProject,Re as reportCommandListener,Fe as reportCommandReceived,Te as reportCommandResult,xe as reportEditorState,Le as reportPlayBootPhase,De as reportTabRoute,Ge as requireEditorCompatibility,We as restoreProjectAssetHistory,$e as revealInFinder,Ie as saveEditorState,Oe as saveFile,He as saveThumbnail,Ue as searchOnlineAssets,Ve as startLogSession,qe as stopEditorWorktreeSession,Be as updateLauncherSettings};
@@ -1 +1 @@
1
- import{g as e}from"./workspace-arrangement-Dg7zIkwR.js";import"./index-Bn8WGRJh.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 i=31,d=30;function n(r){return(r.layers.mask&1<<i)!==0||!!e(r,"editorHelper")||!!e(r,"engineInternal")}function f(r){let t=r;for(;t;){if(n(t))return!0;t=t.parent}return!1}export{i as EDITOR_LAYER,d as EDITOR_SELECTION_LAYER,n as isEditorOwnedObject,f as isInEditorOwnedSubtree};
1
+ import{g as e}from"./workspace-arrangement-CHzaISez.js";import"./index-DMsonpRx.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 i=31,d=30;function n(r){return(r.layers.mask&1<<i)!==0||!!e(r,"editorHelper")||!!e(r,"engineInternal")}function f(r){let t=r;for(;t;){if(n(t))return!0;t=t.parent}return!1}export{i as EDITOR_LAYER,d as EDITOR_SELECTION_LAYER,n as isEditorOwnedObject,f as isInEditorOwnedSubtree};
@@ -1 +1 @@
1
- import{v as x}from"./output-pass-HurwNl0G.js";import{isEditorOwnedObject as L}from"./editor-layers-BGId-Uru.js";import{g as y,s as E}from"./user-data-DX18I5LS.js";import{i as P,e as F}from"./entity-object-B77fPnTJ.js";import"./index-Bn8WGRJh.js";import{fo as R,fx as C,bi as V,d9 as k}from"./three.core-3arARmh6.js";function O(r,e=P){if(r.isLOD)return r;const s=[...r.children];for(;s.length>0;){const t=s.pop();if(!e(t)){if(t.isLOD)return t;s.push(...t.children)}}return null}const H=1e20,N=2e20;function D(r,e){const s=r.fog;if(!s){e();return}const t=s.isFog?s:null,i=s.isFogExp2?s:null,o=t?.near,a=t?.far,n=i?.density;t&&(t.near=H,t.far=N),i&&(i.density=0);try{e()}finally{t&&o!==void 0&&a!==void 0&&(t.near=o,t.far=a),i&&n!==void 0&&(i.density=n)}}const U=256;class d{constructor(e){this.shell=e}_scene=null;_adoptionStack=[];_objectMap=new Map;_renderer=null;_camera=null;_batchedRenderer=null;_lastThumbnailTime=0;_lastEditorStateSaveTime=0;_orbitTarget=null;_gizmoEpoch=0;_objectMapParentChangedAt=new Map;_objectMapFullChangeEpoch=0;_objectMapMembershipChangedAt=new Map;_objectMapMembershipFullChangeEpoch=0;_objectMapMembershipHistoryFloor=0;_showStats=!1;_shadingMode="solid";_statePersistence=null;_vertexSnapActive=!1;_composerVersion=0;bindScene(e,s,t,i){const o=this._adoptionStack[0];o?o.scene=e:this._scene=e,this._renderer=s??null,this._batchedRenderer=t??null,i&&(this._camera=i)}setOrbitTarget(e){this._orbitTarget=e}setViewportCamera(e){this._camera=e}attachStatePersistence(e){if(this._statePersistence!==e){if(this._statePersistence)throw new Error("EditorStore is already attached to a state persistence.");this._statePersistence=e}}get sceneCameraLookup(){return this._sceneCameraLookup}_sceneCameraLookup=null;focusOnScene(e){this._sceneCameraLookup=e??null,this.shell.focusOnScene()}get cameraPose(){if(!this._camera)return null;const e=this._camera.fov;return{position:this._camera.position.clone(),target:this._orbitTarget?this._orbitTarget.clone():new R,fov:typeof e=="number"?e:0}}get objectMap(){return this._objectMap}get scene(){return this._scene}get composerVersion(){return this._composerVersion}get gizmoEpoch(){return this._gizmoEpoch}ingestObjectMapChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapFullChangeEpoch)return null;const s=new Set;for(const[t,i]of this._objectMapParentChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedParentIds:s}}ingestObjectMapMembershipChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapMembershipFullChangeEpoch||e<this._objectMapMembershipHistoryFloor)return null;const s=new Set;for(const[t,i]of this._objectMapMembershipChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedIds:s}}isSkeletonVisible(e){return!!y(this._objectMap.get(e),"skeletonVisible")}setSkeletonVisible(e,s){const t=this._objectMap.get(e);t&&(E(t,"skeletonVisible",s),t.traverse(i=>{y(i,"editorHelperType")==="skeletons"&&(E(i,"skeletonEnabled",s),i.visible=s||this.shell.helperVisibility.skeletons)}),this.shell.notifyChange())}get showStats(){return this._showStats}get shadingMode(){return this._shadingMode}notifyIngestObjectMapEdit(e){if(this._gizmoEpoch++,e===void 0||e.rootsChanged)this._objectMapFullChangeEpoch=this._gizmoEpoch,this._objectMapParentChangedAt.clear();else for(const t of e.changedParentIds)this._objectMapParentChangedAt.set(t,this._gizmoEpoch);if(e?.addedIds===void 0||e.removedIds===void 0)this._objectMapMembershipFullChangeEpoch=this._gizmoEpoch,this._objectMapMembershipChangedAt.clear();else{for(const i of e.addedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);for(const i of e.removedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);const t=Math.max(0,this._gizmoEpoch-U);if(t>this._objectMapMembershipHistoryFloor){this._objectMapMembershipHistoryFloor=t;for(const[i,o]of this._objectMapMembershipChangedAt)o<=t&&this._objectMapMembershipChangedAt.delete(i)}}const s=e===void 0||e.rootsChanged||[...e.addedIds??[],...e.removedIds??[]].some(t=>this.shell.selectedEntityIds.has(t));this.shell.notifyChange("content",s?"shell":"object-map",!1)}_ecsSyncTransform=null;setEcsSyncTransform(e){this._ecsSyncTransform=e}enterPlayScene(e,s,t){this._adoptionStack.push({scene:this._scene,objectMap:this._objectMap,extras:this._captureAdoptionExtras(),selection:new Set(this.shell.selectedEntityIds),imageConfig:this._adoptedImageConfig}),this._scene=e,this._applyAdoptedImageConfig(s);const i=t?new Map(t):(()=>{const o=new Map,a=n=>{if(L(n))return;const l=F(n);l!==void 0&&o.set(l,n);for(const p of n.children)a(p)};for(const n of e.children)a(n);return o})();this._objectMap=i,this.shell.applySelectionBeforePresentation([...this.shell.selectedEntityIds].filter(o=>i.has(o))),this._lodForcedLevels.clear(),this._composerVersion++,this.shell.notifyChange()}get hasAdoptedScene(){return this._adoptionStack.length>0}exitPlayScene(){const e=this._adoptionStack.pop();e&&(this._scene=e.scene,this._objectMap=e.objectMap,this._applyAdoptedImageConfig(e.imageConfig),this._restoreAdoptionExtras(e.extras),this.shell.applySelectionBeforePresentation([...e.selection]),this._composerVersion++,this.shell.notifyChange())}releaseAdoptedScene(e){if(this._scene===e){this.exitPlayScene();return}const s=this._adoptionStack.findIndex(t=>t.scene===e);s!==-1&&this._adoptionStack.splice(s,1)}_adoptedImageConfig;get adoptedImageConfig(){return this._adoptedImageConfig}_applyAdoptedImageConfig(e){e!==this._adoptedImageConfig&&(this._adoptedImageConfig=e,this._composerVersion++)}get isAdoptedSceneActive(){return this._adoptionStack.length>0}get vertexSnapActive(){return this._vertexSnapActive}setVertexSnapActive(e){this._vertexSnapActive=e,this.shell.notifyChange()}static THUMBNAIL_INTERVAL_MS=6e4;static THUMBNAIL_SIZE=256;_renderViewportImage(e,s){if(!this._renderer||!this._scene||!this._camera)return null;const t=typeof e=="number"?e:e.width,i=typeof e=="number"?e:e.height;if(!Number.isFinite(t)||t<1||!Number.isFinite(i)||i<1)return null;const o=t*2,a=i*2,n=this._renderer,l=new C(o,a,{type:V}),p=new C(o,a),T=n.getRenderTarget(),w=n.getPixelRatio(),h=this._camera,I=h.layers.mask,c=h instanceof k?h:null,u=c?.aspect;s?h.layers.enableAll():(h.layers.disableAll(),h.layers.enable(0));try{c&&(c.aspect=t/i,c.updateProjectionMatrix()),n.setPixelRatio(1),n.setRenderTarget(l),D(this._scene,()=>n.render(this._scene,h)),x().render(n,p,l,0,!1)}finally{n.setRenderTarget(T),n.setPixelRatio(w),h.layers.mask=I,c&&u!==void 0&&(c.aspect=u,c.updateProjectionMatrix())}const _=o*4,b=new Uint8Array(_*a);n.readRenderTargetPixels(p,0,0,o,a,b),p.dispose(),l.dispose();const g=document.createElement("canvas");g.width=o,g.height=a;const M=g.getContext("2d"),S=M.createImageData(o,a);for(let m=0;m<a;m++){const v=(a-1-m)*_,j=m*_;S.data.set(b.subarray(v,v+_),j)}M.putImageData(S,0,0);const f=document.createElement("canvas");return f.width=t,f.height=i,f.getContext("2d").drawImage(g,0,0,t,i),f.toDataURL("image/png")}_captureThumbnail(){const e=Date.now();if(e-this._lastThumbnailTime<d.THUMBNAIL_INTERVAL_MS)return;this._lastThumbnailTime=e;const s=this._renderViewportImage(d.THUMBNAIL_SIZE,!1);s&&this._statePersistence?.saveThumbnail?.(s)}captureViewportImage(e=d.THUMBNAIL_SIZE){return this._renderViewportImage(e,!0)}viewportCanvas(){return this._renderer?.domElement??null}static EDITOR_STATE_INTERVAL_MS=6e4;_saveEditorStateIfDue(){if(!this._statePersistence)return;const e=Date.now();if(e-this._lastEditorStateSaveTime<d.EDITOR_STATE_INTERVAL_MS)return;this._lastEditorStateSaveTime=e;const s={transformMode:this.shell.transformMode,transformSpace:this.shell.transformSpace,snapEnabled:this.shell.snapEnabled,snapValues:this.shell.snapValues,preserveChildrenTransform:this.shell.preserveChildrenTransform,pivotMode:this.shell.pivotMode,gizmoAnchor:this.shell.gizmoAnchor,showHelpers:this.shell.showHelpers,helperVisibility:{...this.shell.helperVisibility},showStats:this._showStats,shadingMode:this._shadingMode};if(Object.assign(s,this._editorStateExtras()),this._camera){const t=this._camera;s.camera={position:t.position.toArray(),target:this._orbitTarget?this._orbitTarget.toArray():[0,0,0]}}this._statePersistence.save(s)}_lodForcedLevels=new Map;get lodForcedLevels(){return this._lodForcedLevels}getLodForcedLevel(e){return this._lodForcedLevels.get(e)??null}setLodForcedLevel(e,s){if(s===null){this._lodForcedLevels.delete(e);const t=this._objectMap.get(e),i=new Set(this._objectMap.values()),o=t?O(t,a=>i.has(a)):null;o&&(o.autoUpdate=!0)}else this._lodForcedLevels.set(e,s);this.shell.notifyChange()}toggleStats(){this._showStats=!this._showStats,this.shell.notifyChange()}setShadingMode(e){this._shadingMode=e,this.shell.notifyChange()}_captureAdoptionExtras(){}_restoreAdoptionExtras(e){}_editorStateExtras(){return{}}}const A=new WeakMap;function q(r){let e=A.get(r);return e||(e=new d(r),A.set(r,e)),e}export{O as f,q as t,D as w};
1
+ import{v as x}from"./output-pass-HurwNl0G.js";import{isEditorOwnedObject as L}from"./editor-layers-C-4kqPi7.js";import{g as y,s as E}from"./user-data-BsgiyhZb.js";import{i as P,e as F}from"./entity-object-S9jvlW_s.js";import"./index-DMsonpRx.js";import{fo as R,fx as C,bi as V,d9 as k}from"./three.core-3arARmh6.js";function O(r,e=P){if(r.isLOD)return r;const s=[...r.children];for(;s.length>0;){const t=s.pop();if(!e(t)){if(t.isLOD)return t;s.push(...t.children)}}return null}const H=1e20,N=2e20;function D(r,e){const s=r.fog;if(!s){e();return}const t=s.isFog?s:null,i=s.isFogExp2?s:null,o=t?.near,a=t?.far,n=i?.density;t&&(t.near=H,t.far=N),i&&(i.density=0);try{e()}finally{t&&o!==void 0&&a!==void 0&&(t.near=o,t.far=a),i&&n!==void 0&&(i.density=n)}}const U=256;class d{constructor(e){this.shell=e}_scene=null;_adoptionStack=[];_objectMap=new Map;_renderer=null;_camera=null;_batchedRenderer=null;_lastThumbnailTime=0;_lastEditorStateSaveTime=0;_orbitTarget=null;_gizmoEpoch=0;_objectMapParentChangedAt=new Map;_objectMapFullChangeEpoch=0;_objectMapMembershipChangedAt=new Map;_objectMapMembershipFullChangeEpoch=0;_objectMapMembershipHistoryFloor=0;_showStats=!1;_shadingMode="solid";_statePersistence=null;_vertexSnapActive=!1;_composerVersion=0;bindScene(e,s,t,i){const o=this._adoptionStack[0];o?o.scene=e:this._scene=e,this._renderer=s??null,this._batchedRenderer=t??null,i&&(this._camera=i)}setOrbitTarget(e){this._orbitTarget=e}setViewportCamera(e){this._camera=e}attachStatePersistence(e){if(this._statePersistence!==e){if(this._statePersistence)throw new Error("EditorStore is already attached to a state persistence.");this._statePersistence=e}}get sceneCameraLookup(){return this._sceneCameraLookup}_sceneCameraLookup=null;focusOnScene(e){this._sceneCameraLookup=e??null,this.shell.focusOnScene()}get cameraPose(){if(!this._camera)return null;const e=this._camera.fov;return{position:this._camera.position.clone(),target:this._orbitTarget?this._orbitTarget.clone():new R,fov:typeof e=="number"?e:0}}get objectMap(){return this._objectMap}get scene(){return this._scene}get composerVersion(){return this._composerVersion}get gizmoEpoch(){return this._gizmoEpoch}ingestObjectMapChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapFullChangeEpoch)return null;const s=new Set;for(const[t,i]of this._objectMapParentChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedParentIds:s}}ingestObjectMapMembershipChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapMembershipFullChangeEpoch||e<this._objectMapMembershipHistoryFloor)return null;const s=new Set;for(const[t,i]of this._objectMapMembershipChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedIds:s}}isSkeletonVisible(e){return!!y(this._objectMap.get(e),"skeletonVisible")}setSkeletonVisible(e,s){const t=this._objectMap.get(e);t&&(E(t,"skeletonVisible",s),t.traverse(i=>{y(i,"editorHelperType")==="skeletons"&&(E(i,"skeletonEnabled",s),i.visible=s||this.shell.helperVisibility.skeletons)}),this.shell.notifyChange())}get showStats(){return this._showStats}get shadingMode(){return this._shadingMode}notifyIngestObjectMapEdit(e){if(this._gizmoEpoch++,e===void 0||e.rootsChanged)this._objectMapFullChangeEpoch=this._gizmoEpoch,this._objectMapParentChangedAt.clear();else for(const t of e.changedParentIds)this._objectMapParentChangedAt.set(t,this._gizmoEpoch);if(e?.addedIds===void 0||e.removedIds===void 0)this._objectMapMembershipFullChangeEpoch=this._gizmoEpoch,this._objectMapMembershipChangedAt.clear();else{for(const i of e.addedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);for(const i of e.removedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);const t=Math.max(0,this._gizmoEpoch-U);if(t>this._objectMapMembershipHistoryFloor){this._objectMapMembershipHistoryFloor=t;for(const[i,o]of this._objectMapMembershipChangedAt)o<=t&&this._objectMapMembershipChangedAt.delete(i)}}const s=e===void 0||e.rootsChanged||[...e.addedIds??[],...e.removedIds??[]].some(t=>this.shell.selectedEntityIds.has(t));this.shell.notifyChange("content",s?"shell":"object-map",!1)}_ecsSyncTransform=null;setEcsSyncTransform(e){this._ecsSyncTransform=e}enterPlayScene(e,s,t){this._adoptionStack.push({scene:this._scene,objectMap:this._objectMap,extras:this._captureAdoptionExtras(),selection:new Set(this.shell.selectedEntityIds),imageConfig:this._adoptedImageConfig}),this._scene=e,this._applyAdoptedImageConfig(s);const i=t?new Map(t):(()=>{const o=new Map,a=n=>{if(L(n))return;const l=F(n);l!==void 0&&o.set(l,n);for(const p of n.children)a(p)};for(const n of e.children)a(n);return o})();this._objectMap=i,this.shell.applySelectionBeforePresentation([...this.shell.selectedEntityIds].filter(o=>i.has(o))),this._lodForcedLevels.clear(),this._composerVersion++,this.shell.notifyChange()}get hasAdoptedScene(){return this._adoptionStack.length>0}exitPlayScene(){const e=this._adoptionStack.pop();e&&(this._scene=e.scene,this._objectMap=e.objectMap,this._applyAdoptedImageConfig(e.imageConfig),this._restoreAdoptionExtras(e.extras),this.shell.applySelectionBeforePresentation([...e.selection]),this._composerVersion++,this.shell.notifyChange())}releaseAdoptedScene(e){if(this._scene===e){this.exitPlayScene();return}const s=this._adoptionStack.findIndex(t=>t.scene===e);s!==-1&&this._adoptionStack.splice(s,1)}_adoptedImageConfig;get adoptedImageConfig(){return this._adoptedImageConfig}_applyAdoptedImageConfig(e){e!==this._adoptedImageConfig&&(this._adoptedImageConfig=e,this._composerVersion++)}get isAdoptedSceneActive(){return this._adoptionStack.length>0}get vertexSnapActive(){return this._vertexSnapActive}setVertexSnapActive(e){this._vertexSnapActive=e,this.shell.notifyChange()}static THUMBNAIL_INTERVAL_MS=6e4;static THUMBNAIL_SIZE=256;_renderViewportImage(e,s){if(!this._renderer||!this._scene||!this._camera)return null;const t=typeof e=="number"?e:e.width,i=typeof e=="number"?e:e.height;if(!Number.isFinite(t)||t<1||!Number.isFinite(i)||i<1)return null;const o=t*2,a=i*2,n=this._renderer,l=new C(o,a,{type:V}),p=new C(o,a),T=n.getRenderTarget(),w=n.getPixelRatio(),h=this._camera,I=h.layers.mask,c=h instanceof k?h:null,u=c?.aspect;s?h.layers.enableAll():(h.layers.disableAll(),h.layers.enable(0));try{c&&(c.aspect=t/i,c.updateProjectionMatrix()),n.setPixelRatio(1),n.setRenderTarget(l),D(this._scene,()=>n.render(this._scene,h)),x().render(n,p,l,0,!1)}finally{n.setRenderTarget(T),n.setPixelRatio(w),h.layers.mask=I,c&&u!==void 0&&(c.aspect=u,c.updateProjectionMatrix())}const _=o*4,b=new Uint8Array(_*a);n.readRenderTargetPixels(p,0,0,o,a,b),p.dispose(),l.dispose();const g=document.createElement("canvas");g.width=o,g.height=a;const M=g.getContext("2d"),S=M.createImageData(o,a);for(let m=0;m<a;m++){const v=(a-1-m)*_,j=m*_;S.data.set(b.subarray(v,v+_),j)}M.putImageData(S,0,0);const f=document.createElement("canvas");return f.width=t,f.height=i,f.getContext("2d").drawImage(g,0,0,t,i),f.toDataURL("image/png")}_captureThumbnail(){const e=Date.now();if(e-this._lastThumbnailTime<d.THUMBNAIL_INTERVAL_MS)return;this._lastThumbnailTime=e;const s=this._renderViewportImage(d.THUMBNAIL_SIZE,!1);s&&this._statePersistence?.saveThumbnail?.(s)}captureViewportImage(e=d.THUMBNAIL_SIZE){return this._renderViewportImage(e,!0)}viewportCanvas(){return this._renderer?.domElement??null}static EDITOR_STATE_INTERVAL_MS=6e4;_saveEditorStateIfDue(){if(!this._statePersistence)return;const e=Date.now();if(e-this._lastEditorStateSaveTime<d.EDITOR_STATE_INTERVAL_MS)return;this._lastEditorStateSaveTime=e;const s={transformMode:this.shell.transformMode,transformSpace:this.shell.transformSpace,snapEnabled:this.shell.snapEnabled,snapValues:this.shell.snapValues,preserveChildrenTransform:this.shell.preserveChildrenTransform,pivotMode:this.shell.pivotMode,gizmoAnchor:this.shell.gizmoAnchor,showHelpers:this.shell.showHelpers,helperVisibility:{...this.shell.helperVisibility},showStats:this._showStats,shadingMode:this._shadingMode};if(Object.assign(s,this._editorStateExtras()),this._camera){const t=this._camera;s.camera={position:t.position.toArray(),target:this._orbitTarget?this._orbitTarget.toArray():[0,0,0]}}this._statePersistence.save(s)}_lodForcedLevels=new Map;get lodForcedLevels(){return this._lodForcedLevels}getLodForcedLevel(e){return this._lodForcedLevels.get(e)??null}setLodForcedLevel(e,s){if(s===null){this._lodForcedLevels.delete(e);const t=this._objectMap.get(e),i=new Set(this._objectMap.values()),o=t?O(t,a=>i.has(a)):null;o&&(o.autoUpdate=!0)}else this._lodForcedLevels.set(e,s);this.shell.notifyChange()}toggleStats(){this._showStats=!this._showStats,this.shell.notifyChange()}setShadingMode(e){this._shadingMode=e,this.shell.notifyChange()}_captureAdoptionExtras(){}_restoreAdoptionExtras(e){}_editorStateExtras(){return{}}}const A=new WeakMap;function q(r){let e=A.get(r);return e||(e=new d(r),A.set(r,e)),e}export{O as f,q as t,D as w};
@@ -1 +1 @@
1
- import{s as r,g as i}from"./user-data-DX18I5LS.js";import{a as s}from"./three-contract-Dkt6PmWY.js";function f(e,t,n){return s(e.hierarchy,n)??t.get(n)??null}function a(e){const t=i(e,"entityId");return typeof t=="string"&&t?t:void 0}function o(e){return a(e)!==void 0}function y(e){let t=e??null;for(;t&&!o(t);)t=t.parent;return t}function d(e,t){r(e,"entityId",t)}export{f as a,a as e,o as i,y as n,d as s};
1
+ import{s as r,g as i}from"./user-data-BsgiyhZb.js";import{a as s}from"./three-contract-Dkt6PmWY.js";function f(e,t,n){return s(e.hierarchy,n)??t.get(n)??null}function a(e){const t=i(e,"entityId");return typeof t=="string"&&t?t:void 0}function o(e){return a(e)!==void 0}function y(e){let t=e??null;for(;t&&!o(t);)t=t.parent;return t}function d(e,t){r(e,"entityId",t)}export{f as a,a as e,o as i,y as n,d as s};
@@ -1,4 +1,4 @@
1
- import{a as Uu}from"./jsx-runtime-DPjLkJKQ.js";import{m as Vy,x as oy}from"./index-bQE2NA0D.js";import{c as pa,C as Hu,G as gy,A as by,e as cm,T as Ef}from"./index-B0ciEDFT.js";import{r as Wl}from"./index-nmcBqr7Y.js";import{g as Jy}from"./_commonjsHelpers-D6-XlEtG.js";import{r as xy}from"./index-D_NuPfjr.js";var mf={exports:{}},_t={};/**
1
+ import{a as Uu}from"./jsx-runtime-DPjLkJKQ.js";import{m as Vy,x as oy}from"./index-bQE2NA0D.js";import{c as pa,C as Hu,G as gy,A as by,e as cm,T as Ef}from"./index-DDurbNnD.js";import{r as Wl}from"./index-nmcBqr7Y.js";import{g as Jy}from"./_commonjsHelpers-D6-XlEtG.js";import{r as xy}from"./index-D_NuPfjr.js";var mf={exports:{}},_t={};/**
2
2
  * @license React
3
3
  * react-reconciler-constants.production.js
4
4
  *
@@ -1 +1 @@
1
- import{fe as c,ff as o,ax as s,d4 as u}from"./index-Bn8WGRJh.js";import{E as h,a as E,F as g,c as m}from"./instance-fork-actions-D3sRzS3K.js";import{t as i}from"./editor-shell-store-DhM6KcjO.js";function l(t,e){return c(t,e)}function F(t,e){const n=s(t.shell);return E(n.hierarchy.node(e),l(n,e),e)}let r=null;function O(){r||(r=o(({nodeId:t,store:e})=>F(i(e),t),({nodeId:t,store:e})=>{const n=l(s(e),t);return[{label:h,action:()=>{n?.extractComponent?.(t).then(u)}}]}))}function b(){r?.(),r=null}function f(t,e){return c(t,e)}function p(t,e){const n=s(t.shell);return m(n.hierarchy.node(e),f(n,e),e)}let a=null;function A(){a||(a=o(({nodeId:t,store:e})=>p(i(e),t),({nodeId:t,store:e})=>{const n=f(s(e),t);return[{label:g,action:()=>{n?.forkComponent?.(t).then(u)}}]}))}function C(){a?.(),a=null}export{l as a,A as b,C as c,O as e,f as i,b as u};
1
+ import{fe as c,ff as o,ax as s,d4 as u}from"./index-DMsonpRx.js";import{E as h,a as E,F as g,c as m}from"./instance-fork-actions-D3sRzS3K.js";import{t as i}from"./editor-shell-store-BqJU8Lu8.js";function l(t,e){return c(t,e)}function F(t,e){const n=s(t.shell);return E(n.hierarchy.node(e),l(n,e),e)}let r=null;function O(){r||(r=o(({nodeId:t,store:e})=>F(i(e),t),({nodeId:t,store:e})=>{const n=l(s(e),t);return[{label:h,action:()=>{n?.extractComponent?.(t).then(u)}}]}))}function b(){r?.(),r=null}function f(t,e){return c(t,e)}function p(t,e){const n=s(t.shell);return m(n.hierarchy.node(e),f(n,e),e)}let a=null;function A(){a||(a=o(({nodeId:t,store:e})=>p(i(e),t),({nodeId:t,store:e})=>{const n=f(s(e),t);return[{label:g,action:()=>{n?.forkComponent?.(t).then(u)}}]}))}function C(){a?.(),a=null}export{l as a,A as b,C as c,O as e,f as i,b as u};
@@ -1 +1 @@
1
- import{r as b}from"./index-nmcBqr7Y.js";import{gJ as R,gK as S,gL as B,gM as I,gN as P,gO as C,gP as _,gQ as $,gR as A,x as N}from"./index-Bn8WGRJh.js";function X(){b.useSyncExternalStore(R,S,S),b.useSyncExternalStore(B,I,I),b.useSyncExternalStore(P,C,C);const t=N();return(t==="workspace:game"?_($()):null)??A(t)}function Y(t){return t?{capture:typeof t.captureFrame=="function",memory:typeof t.memorySnapshot=="function"}:null}class D{constructor(s=10){this.capacity=s}captures=[];selectedId=null;add(s){this.captures.push(s),this.captures.length>this.capacity&&this.captures.splice(0,this.captures.length-this.capacity),this.selectedId=s.id}get all(){return this.captures}select(s){this.captures.some(e=>e.id===s)&&(this.selectedId=s)}get selectedIdOrNull(){return this.selectedId}get selected(){return this.selectedId===null?null:this.captures.find(s=>s.id===this.selectedId)??null}clear(){this.captures=[],this.selectedId=null}}function J(t){const s=new Map,e=[];for(const o of t.drawCalls){const r=o.target.kind==="canvas"?"canvas":o.target.label??"framebuffer";let n=s.get(r);n||(n=[],s.set(r,n),e.push(r)),n.push(o)}return e.map(o=>({target:o,draws:s.get(o)??[]}))}function Q(t){const s=new Set;for(const e of t.drawCalls)s.add(e.target.kind==="canvas"?"canvas":e.target.label??"framebuffer");return{id:t.id,drawCalls:t.totals.drawCalls,unattributed:t.totals.unattributed,truncated:t.totals.truncated,targets:s.size}}function q(t,s){let e=Math.max(0,t.cpuMs);for(const a of t.phases)e=Math.max(e,(a.startMs??0)+a.ms);for(const a of t.systems)e=Math.max(e,a.startMs+a.ms);for(const a of t.components)e=Math.max(e,a.startMs+a.ms);const o=e>0?e:1,r=s/o,n=(a,l,u,p)=>({x:Math.max(0,a*r),w:Math.max(0,l*r),depth:u,label:p,ms:l}),c=[n(0,t.cpuMs,0,`frame ${t.id}`)];for(const a of t.phases)c.push(n(a.startMs??0,a.ms,1,a.name));for(const a of t.systems)c.push(n(a.startMs,a.ms,2,a.name));for(const a of t.components)c.push(n(a.startMs,a.ms,3,a.name));return c}function Z(t,s,e){if(t.length===0)return[];const o=Math.max(1,...t.map(n=>n.cpuMs)),r=s/t.length;return t.map((n,c)=>({index:c,frameId:n.id,x:c*r,w:r,h:Math.max(0,n.cpuMs/o*e),cpuMs:n.cpuMs}))}function tt(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<s.length-1;)e/=1024,o++;return`${e<10?e.toFixed(2):e.toFixed(1)} ${s[o]}`}function et(t,s){const e=Math.max(0,t),o=Math.max(0,e-Math.max(0,s));return{frameMs:e,gapMs:o,dominated:e>20&&o>e/2}}function L(t){const s=new Map;let e=0,o=0;for(const r of t){e+=r.duration;for(const n of r.scripts??[]){o+=n.duration;const c=n.sourceURL?n.sourceURL.split("/").slice(-2).join("/"):"",a=n.sourceFunctionName||n.invoker||"(anonymous)",l=c?`${a} @ ${c}`:a,u=s.get(l)??{totalMs:0,count:0};u.totalMs+=n.duration,u.count+=1,s.set(l,u)}}return{longFrameCount:t.length,totalLongMs:Math.round(e),unattributedMs:Math.round(Math.max(0,e-o)),scripts:[...s.entries()].map(([r,n])=>({key:r,totalMs:Math.round(n.totalMs),count:n.count})).sort((r,n)=>n.totalMs-r.totalMs).slice(0,8)}}const T=5,U=20;function G(t,s,e){const o=t.filter(i=>i.timestamp>=s&&i.intervalMs>0);if(o.length<T)return null;let r=0,n=0,c=0,a=0;for(const i of o)r+=i.intervalMs,n+=i.cpuMs,i.render.gpuMs!==null&&(c+=i.render.gpuMs,a++);const l=o.length,u=r/l,p=n/l,m=e!==null&&e.sampleCount>=U?Math.max(0,e.busyMs-n)/l:null;return{frames:l,fps:u>0?1e3/u:0,frameMs:u,loopMs:p,otherMainMs:m,pipelineMs:Math.max(0,u-p-(m??0)),gpuDrawMs:a>0?c/a:null}}const w=.05,v=3,O=4;function W(t,s){return t.filter(e=>e.timestamp>=s&&e.intervalMs>0)}function E(t,s){const e=new Map;for(const[r,n]of t)e.set(r,(e.get(r)??0)+n);const o=new Map;for(const[r,n]of e)o.set(r,n/s);return o}function H(t,s){const e=t.length,o=E(t.flatMap(l=>l.phases.map(u=>[u.name,u.ms])),e),r=E(t.flatMap(l=>l.systems.map(u=>[`${u.phase} ${u.name}`,u.ms])),e),n=[];let c=0;for(const[l,u]of[...o.entries()].sort((p,m)=>m[1]-p[1])){c+=u,n.push({label:l,depth:2,ms:u});const p=[...r.entries()].filter(([i])=>i.startsWith(`${l} `)).map(([i,f])=>{const x=i.slice(l.length+1);return[x.split(" / ").at(-1)??x,f]}).sort((i,f)=>f[1]-i[1]);for(const[i,f]of p.slice(0,v))n.push({label:i,depth:3,ms:f});const m=p.slice(v);m.length>0&&n.push({label:`${m.length} more system${m.length===1?"":"s"}`,depth:3,ms:m.reduce((i,[,f])=>i+f,0)})}const a=s-c;return a>w&&n.push({label:"outside the phases",depth:2,ms:a}),n}function V(t,s,e,o){if(t===null)return[];const r=L(s.filter(l=>(l.startTime??0)>=e)),n=[];let c=0;for(const l of r.scripts.slice(0,O)){const u=Math.min(l.totalMs/o,t-c);u<=w||(c+=u,n.push({label:l.key,depth:2,ms:u,note:"named by the browser (long frames)"}))}const a=t-c;return(a>w||n.length===0)&&n.push({label:"unattributed",depth:2,ms:Math.max(0,a),note:"below the browser's 50ms attribution threshold"}),n}function st(t,s,e,o){const r=G(t,s,e);if(r===null)return null;const n=W(t,s),c=[{label:"Frame interval",depth:0,ms:r.frameMs,note:`${r.frames} frames at ${r.fps.toFixed(0)} fps`},{label:"Scene loop (CPU)",depth:1,ms:r.loopMs},...H(n,r.loopMs),{label:"Other main thread",depth:1,ms:r.otherMainMs,note:r.otherMainMs===null?"not sampled yet":"React, timers, observers"},...V(r.otherMainMs,o,s,r.frames),{label:"Display pipeline",depth:1,ms:r.pipelineMs,note:"everything after the main thread — the remainder"}];return r.gpuDrawMs!==null&&(c.push({label:"viewport GPU draw",depth:2,ms:r.gpuDrawMs,note:"measured; runs in parallel with the CPU rows",parallel:!0}),c.push({label:"compositor + vsync wait",depth:2,ms:Math.max(0,r.pipelineMs-r.gpuDrawMs),note:"post-effects, glass chrome, waiting for the next frame slot"})),{rows:c,budget:r}}let M=new D,F=null,g=!1,h=null,k=0;const y=new Set;function d(){k++;for(const t of y)t()}function nt(t){return y.add(t),()=>y.delete(t)}function rt(){return k}function K(t){t!==F&&(F=t,M=new D,h=null,d())}function at(){return M}function ot(){return g}function ct(){return h}function ut(t){M.select(t),d()}function lt(){M.clear(),h=null,d()}async function it(t){if(!(!t||g)){K(t),g=!0,h=null,d();try{const s=await t.captureFrame();M.add(s)}catch(s){h=s instanceof Error?s.message:String(s)}finally{g=!1,d()}}}export{K as a,lt as b,it as c,Y as d,Q as e,rt as f,at as g,ut as h,ot as i,J as j,Z as k,ct as l,q as m,tt as n,et as o,L as p,nt as s,st as t,X as u};
1
+ import{r as b}from"./index-nmcBqr7Y.js";import{gJ as R,gK as S,gL as B,gM as I,gN as P,gO as C,gP as _,gQ as $,gR as A,x as N}from"./index-DMsonpRx.js";function X(){b.useSyncExternalStore(R,S,S),b.useSyncExternalStore(B,I,I),b.useSyncExternalStore(P,C,C);const t=N();return(t==="workspace:game"?_($()):null)??A(t)}function Y(t){return t?{capture:typeof t.captureFrame=="function",memory:typeof t.memorySnapshot=="function"}:null}class D{constructor(s=10){this.capacity=s}captures=[];selectedId=null;add(s){this.captures.push(s),this.captures.length>this.capacity&&this.captures.splice(0,this.captures.length-this.capacity),this.selectedId=s.id}get all(){return this.captures}select(s){this.captures.some(e=>e.id===s)&&(this.selectedId=s)}get selectedIdOrNull(){return this.selectedId}get selected(){return this.selectedId===null?null:this.captures.find(s=>s.id===this.selectedId)??null}clear(){this.captures=[],this.selectedId=null}}function J(t){const s=new Map,e=[];for(const o of t.drawCalls){const r=o.target.kind==="canvas"?"canvas":o.target.label??"framebuffer";let n=s.get(r);n||(n=[],s.set(r,n),e.push(r)),n.push(o)}return e.map(o=>({target:o,draws:s.get(o)??[]}))}function Q(t){const s=new Set;for(const e of t.drawCalls)s.add(e.target.kind==="canvas"?"canvas":e.target.label??"framebuffer");return{id:t.id,drawCalls:t.totals.drawCalls,unattributed:t.totals.unattributed,truncated:t.totals.truncated,targets:s.size}}function q(t,s){let e=Math.max(0,t.cpuMs);for(const a of t.phases)e=Math.max(e,(a.startMs??0)+a.ms);for(const a of t.systems)e=Math.max(e,a.startMs+a.ms);for(const a of t.components)e=Math.max(e,a.startMs+a.ms);const o=e>0?e:1,r=s/o,n=(a,l,u,p)=>({x:Math.max(0,a*r),w:Math.max(0,l*r),depth:u,label:p,ms:l}),c=[n(0,t.cpuMs,0,`frame ${t.id}`)];for(const a of t.phases)c.push(n(a.startMs??0,a.ms,1,a.name));for(const a of t.systems)c.push(n(a.startMs,a.ms,2,a.name));for(const a of t.components)c.push(n(a.startMs,a.ms,3,a.name));return c}function Z(t,s,e){if(t.length===0)return[];const o=Math.max(1,...t.map(n=>n.cpuMs)),r=s/t.length;return t.map((n,c)=>({index:c,frameId:n.id,x:c*r,w:r,h:Math.max(0,n.cpuMs/o*e),cpuMs:n.cpuMs}))}function tt(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<s.length-1;)e/=1024,o++;return`${e<10?e.toFixed(2):e.toFixed(1)} ${s[o]}`}function et(t,s){const e=Math.max(0,t),o=Math.max(0,e-Math.max(0,s));return{frameMs:e,gapMs:o,dominated:e>20&&o>e/2}}function L(t){const s=new Map;let e=0,o=0;for(const r of t){e+=r.duration;for(const n of r.scripts??[]){o+=n.duration;const c=n.sourceURL?n.sourceURL.split("/").slice(-2).join("/"):"",a=n.sourceFunctionName||n.invoker||"(anonymous)",l=c?`${a} @ ${c}`:a,u=s.get(l)??{totalMs:0,count:0};u.totalMs+=n.duration,u.count+=1,s.set(l,u)}}return{longFrameCount:t.length,totalLongMs:Math.round(e),unattributedMs:Math.round(Math.max(0,e-o)),scripts:[...s.entries()].map(([r,n])=>({key:r,totalMs:Math.round(n.totalMs),count:n.count})).sort((r,n)=>n.totalMs-r.totalMs).slice(0,8)}}const T=5,U=20;function G(t,s,e){const o=t.filter(i=>i.timestamp>=s&&i.intervalMs>0);if(o.length<T)return null;let r=0,n=0,c=0,a=0;for(const i of o)r+=i.intervalMs,n+=i.cpuMs,i.render.gpuMs!==null&&(c+=i.render.gpuMs,a++);const l=o.length,u=r/l,p=n/l,m=e!==null&&e.sampleCount>=U?Math.max(0,e.busyMs-n)/l:null;return{frames:l,fps:u>0?1e3/u:0,frameMs:u,loopMs:p,otherMainMs:m,pipelineMs:Math.max(0,u-p-(m??0)),gpuDrawMs:a>0?c/a:null}}const w=.05,v=3,O=4;function W(t,s){return t.filter(e=>e.timestamp>=s&&e.intervalMs>0)}function E(t,s){const e=new Map;for(const[r,n]of t)e.set(r,(e.get(r)??0)+n);const o=new Map;for(const[r,n]of e)o.set(r,n/s);return o}function H(t,s){const e=t.length,o=E(t.flatMap(l=>l.phases.map(u=>[u.name,u.ms])),e),r=E(t.flatMap(l=>l.systems.map(u=>[`${u.phase} ${u.name}`,u.ms])),e),n=[];let c=0;for(const[l,u]of[...o.entries()].sort((p,m)=>m[1]-p[1])){c+=u,n.push({label:l,depth:2,ms:u});const p=[...r.entries()].filter(([i])=>i.startsWith(`${l} `)).map(([i,f])=>{const x=i.slice(l.length+1);return[x.split(" / ").at(-1)??x,f]}).sort((i,f)=>f[1]-i[1]);for(const[i,f]of p.slice(0,v))n.push({label:i,depth:3,ms:f});const m=p.slice(v);m.length>0&&n.push({label:`${m.length} more system${m.length===1?"":"s"}`,depth:3,ms:m.reduce((i,[,f])=>i+f,0)})}const a=s-c;return a>w&&n.push({label:"outside the phases",depth:2,ms:a}),n}function V(t,s,e,o){if(t===null)return[];const r=L(s.filter(l=>(l.startTime??0)>=e)),n=[];let c=0;for(const l of r.scripts.slice(0,O)){const u=Math.min(l.totalMs/o,t-c);u<=w||(c+=u,n.push({label:l.key,depth:2,ms:u,note:"named by the browser (long frames)"}))}const a=t-c;return(a>w||n.length===0)&&n.push({label:"unattributed",depth:2,ms:Math.max(0,a),note:"below the browser's 50ms attribution threshold"}),n}function st(t,s,e,o){const r=G(t,s,e);if(r===null)return null;const n=W(t,s),c=[{label:"Frame interval",depth:0,ms:r.frameMs,note:`${r.frames} frames at ${r.fps.toFixed(0)} fps`},{label:"Scene loop (CPU)",depth:1,ms:r.loopMs},...H(n,r.loopMs),{label:"Other main thread",depth:1,ms:r.otherMainMs,note:r.otherMainMs===null?"not sampled yet":"React, timers, observers"},...V(r.otherMainMs,o,s,r.frames),{label:"Display pipeline",depth:1,ms:r.pipelineMs,note:"everything after the main thread — the remainder"}];return r.gpuDrawMs!==null&&(c.push({label:"viewport GPU draw",depth:2,ms:r.gpuDrawMs,note:"measured; runs in parallel with the CPU rows",parallel:!0}),c.push({label:"compositor + vsync wait",depth:2,ms:Math.max(0,r.pipelineMs-r.gpuDrawMs),note:"post-effects, glass chrome, waiting for the next frame slot"})),{rows:c,budget:r}}let M=new D,F=null,g=!1,h=null,k=0;const y=new Set;function d(){k++;for(const t of y)t()}function nt(t){return y.add(t),()=>y.delete(t)}function rt(){return k}function K(t){t!==F&&(F=t,M=new D,h=null,d())}function at(){return M}function ot(){return g}function ct(){return h}function ut(t){M.select(t),d()}function lt(){M.clear(),h=null,d()}async function it(t){if(!(!t||g)){K(t),g=!0,h=null,d();try{const s=await t.captureFrame();M.add(s)}catch(s){h=s instanceof Error?s.message:String(s)}finally{g=!1,d()}}}export{K as a,lt as b,it as c,Y as d,Q as e,rt as f,at as g,ut as h,ot as i,J as j,Z as k,ct as l,q as m,tt as n,et as o,L as p,nt as s,st as t,X as u};
@@ -1 +1 @@
1
- import{i as e}from"./index-Bn8WGRJh.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 p=e()({contractVersion:{optional:!1,kind:"value",required:"shape"},root:{optional:!0,kind:"value",required:"effect"},presentation:{optional:!0,kind:"value",required:"effect"},world:{optional:!0,kind:"value",required:"effect"},ready:{optional:!0,kind:"value",required:"effect"},lifecycle:{optional:!0,kind:"value",required:"effect"},scenes:{optional:!0,kind:"value",required:"effect"},systems:{optional:!0,kind:"value",required:"operation"}}),s=e()({start:{optional:!0,kind:"function",required:"effect"},pause:{optional:!0,kind:"function",required:"effect"},resume:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!0,kind:"function",required:"effect"}}),f=e()({list:{optional:!1,kind:"function",required:"operation"},current:{optional:!1,kind:"function",required:"operation"},goTo:{optional:!1,kind:"function",required:"effect"}}),c=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"}}),k=e()({name:{optional:!1,kind:"value",required:"shape"},description:{optional:!0,kind:"value",required:"shape"},argsJsonSchema:{optional:!0,kind:"value",required:"shape"},run:{optional:!1,kind:"function",required:"effect"}}),q=e()({name:{optional:!1,kind:"value",required:"shape"},tier:{optional:!0,kind:"value",required:"shape"},read:{optional:!1,kind:"function",required:"operation"}}),E=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"},count:{optional:!1,kind:"value",required:"operation"}}),v=e()({commands:{optional:!0,kind:"value",required:"operation"},state:{optional:!0,kind:"value",required:"operation"},hierarchy:{optional:!0,kind:"function",required:"operation"},systemAdapters:{optional:!0,kind:"value",required:"operation"}}),A=e()({physics:{optional:!0,kind:"value",required:"effect"},networking:{optional:!0,kind:"value",required:"operation"},navigation:{optional:!0,kind:"value",required:"operation"},audio:{optional:!0,kind:"value",required:"effect"},camera:{optional:!0,kind:"value",required:"effect"},renderDebug:{optional:!0,kind:"value",required:"effect"}}),S=e()({present:{optional:!1,kind:"value",required:"shape"},evidence:{optional:!1,kind:"value",required:"claim"}});export{k as GAME_COMMAND_SHAPE,p as GAME_CONTRACT_SHAPE,E as GAME_HIERARCHY_GROUP_SHAPE,s as GAME_LIFECYCLE_SHAPE,f as GAME_SCENES_SHAPE,c as GAME_SCENE_SHAPE,q as GAME_STATE_PROVIDER_SHAPE,v as GAME_SYSTEMS_SHAPE,A as GAME_SYSTEM_ADAPTERS_SHAPE,S as GAME_SYSTEM_EMPTY_SHAPE};
1
+ import{i as e}from"./index-DMsonpRx.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 p=e()({contractVersion:{optional:!1,kind:"value",required:"shape"},root:{optional:!0,kind:"value",required:"effect"},presentation:{optional:!0,kind:"value",required:"effect"},world:{optional:!0,kind:"value",required:"effect"},ready:{optional:!0,kind:"value",required:"effect"},lifecycle:{optional:!0,kind:"value",required:"effect"},scenes:{optional:!0,kind:"value",required:"effect"},systems:{optional:!0,kind:"value",required:"operation"}}),s=e()({start:{optional:!0,kind:"function",required:"effect"},pause:{optional:!0,kind:"function",required:"effect"},resume:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!0,kind:"function",required:"effect"}}),f=e()({list:{optional:!1,kind:"function",required:"operation"},current:{optional:!1,kind:"function",required:"operation"},goTo:{optional:!1,kind:"function",required:"effect"}}),c=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"}}),k=e()({name:{optional:!1,kind:"value",required:"shape"},description:{optional:!0,kind:"value",required:"shape"},argsJsonSchema:{optional:!0,kind:"value",required:"shape"},run:{optional:!1,kind:"function",required:"effect"}}),q=e()({name:{optional:!1,kind:"value",required:"shape"},tier:{optional:!0,kind:"value",required:"shape"},read:{optional:!1,kind:"function",required:"operation"}}),E=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"},count:{optional:!1,kind:"value",required:"operation"}}),v=e()({commands:{optional:!0,kind:"value",required:"operation"},state:{optional:!0,kind:"value",required:"operation"},hierarchy:{optional:!0,kind:"function",required:"operation"},systemAdapters:{optional:!0,kind:"value",required:"operation"}}),A=e()({physics:{optional:!0,kind:"value",required:"effect"},networking:{optional:!0,kind:"value",required:"operation"},navigation:{optional:!0,kind:"value",required:"operation"},audio:{optional:!0,kind:"value",required:"effect"},camera:{optional:!0,kind:"value",required:"effect"},renderDebug:{optional:!0,kind:"value",required:"effect"}}),S=e()({present:{optional:!1,kind:"value",required:"shape"},evidence:{optional:!1,kind:"value",required:"claim"}});export{k as GAME_COMMAND_SHAPE,p as GAME_CONTRACT_SHAPE,E as GAME_HIERARCHY_GROUP_SHAPE,s as GAME_LIFECYCLE_SHAPE,f as GAME_SCENES_SHAPE,c as GAME_SCENE_SHAPE,q as GAME_STATE_PROVIDER_SHAPE,v as GAME_SYSTEMS_SHAPE,A as GAME_SYSTEM_ADAPTERS_SHAPE,S as GAME_SYSTEM_EMPTY_SHAPE};
@@ -1,4 +1,4 @@
1
- import{g as Rt}from"./_commonjsHelpers-D6-XlEtG.js";import{jK as N}from"./index-Bn8WGRJh.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";var j={exports:{}},qe;function Ot(){if(qe)return j.exports;qe=1;var d=String,x=function(){return{isColorSupported:!1,reset:d,bold:d,dim:d,italic:d,underline:d,inverse:d,hidden:d,strikethrough:d,black:d,red:d,green:d,yellow:d,blue:d,magenta:d,cyan:d,white:d,gray:d,bgBlack:d,bgRed:d,bgGreen:d,bgYellow:d,bgBlue:d,bgMagenta:d,bgCyan:d,bgWhite:d,blackBright:d,redBright:d,greenBright:d,yellowBright:d,blueBright:d,magentaBright:d,cyanBright:d,whiteBright:d,bgBlackBright:d,bgRedBright:d,bgGreenBright:d,bgYellowBright:d,bgBlueBright:d,bgMagentaBright:d,bgCyanBright:d,bgWhiteBright:d}};return j.exports=x(),j.exports.createColors=x,j.exports}var te,ze;function Ee(){if(ze)return te;ze=1;let d=Ot(),x=N;class v extends Error{constructor(y,b,g,w,S,o){super(y),this.name="CssSyntaxError",this.reason=y,S&&(this.file=S),w&&(this.source=w),o&&(this.plugin=o),typeof b<"u"&&typeof g<"u"&&(typeof b=="number"?(this.line=b,this.column=g):(this.line=b.line,this.column=b.column,this.endLine=g.line,this.endColumn=g.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,v)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(y){if(!this.source)return"";let b=this.source;y==null&&(y=d.isColorSupported);let g=e=>e,w=e=>e,S=e=>e;if(y){let{bold:e,gray:t,red:i}=d.createColors(!0);w=n=>e(i(n)),g=n=>t(n),x&&(S=n=>x(n))}let o=b.split(/\r?\n/),f=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),r=String(s).length;return o.slice(f,s).map((e,t)=>{let i=f+1+t,n=" "+(" "+i).slice(-r)+" | ";if(i===this.line){if(e.length>160){let c=20,u=Math.max(0,this.column-c),l=Math.max(this.column+c,this.endColumn+c),a=e.slice(u,l),h=g(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,c-1)).replace(/[^\t]/g," ");return w(">")+g(n)+S(a)+`
1
+ import{g as Rt}from"./_commonjsHelpers-D6-XlEtG.js";import{jK as N}from"./index-DMsonpRx.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";var j={exports:{}},qe;function Ot(){if(qe)return j.exports;qe=1;var d=String,x=function(){return{isColorSupported:!1,reset:d,bold:d,dim:d,italic:d,underline:d,inverse:d,hidden:d,strikethrough:d,black:d,red:d,green:d,yellow:d,blue:d,magenta:d,cyan:d,white:d,gray:d,bgBlack:d,bgRed:d,bgGreen:d,bgYellow:d,bgBlue:d,bgMagenta:d,bgCyan:d,bgWhite:d,blackBright:d,redBright:d,greenBright:d,yellowBright:d,blueBright:d,magentaBright:d,cyanBright:d,whiteBright:d,bgBlackBright:d,bgRedBright:d,bgGreenBright:d,bgYellowBright:d,bgBlueBright:d,bgMagentaBright:d,bgCyanBright:d,bgWhiteBright:d}};return j.exports=x(),j.exports.createColors=x,j.exports}var te,ze;function Ee(){if(ze)return te;ze=1;let d=Ot(),x=N;class v extends Error{constructor(y,b,g,w,S,o){super(y),this.name="CssSyntaxError",this.reason=y,S&&(this.file=S),w&&(this.source=w),o&&(this.plugin=o),typeof b<"u"&&typeof g<"u"&&(typeof b=="number"?(this.line=b,this.column=g):(this.line=b.line,this.column=b.column,this.endLine=g.line,this.endColumn=g.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,v)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(y){if(!this.source)return"";let b=this.source;y==null&&(y=d.isColorSupported);let g=e=>e,w=e=>e,S=e=>e;if(y){let{bold:e,gray:t,red:i}=d.createColors(!0);w=n=>e(i(n)),g=n=>t(n),x&&(S=n=>x(n))}let o=b.split(/\r?\n/),f=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),r=String(s).length;return o.slice(f,s).map((e,t)=>{let i=f+1+t,n=" "+(" "+i).slice(-r)+" | ";if(i===this.line){if(e.length>160){let c=20,u=Math.max(0,this.column-c),l=Math.max(this.column+c,this.endColumn+c),a=e.slice(u,l),h=g(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,c-1)).replace(/[^\t]/g," ");return w(">")+g(n)+S(a)+`
2
2
  `+h+w("^")}let p=g(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return w(">")+g(n)+S(e)+`
3
3
  `+p+w("^")}return" "+g(n)+S(e)}).join(`
4
4
  `)}toString(){let y=this.showSourceCode();return y&&(y=`
@@ -1 +1 @@
1
- import{kW as ht,kX as be,kY as gt,cM as vt,K,kZ as xt,k_ as we,k$ as yt,l0 as Se,a0 as L,a1 as ue,l1 as bt,l2 as wt,cR as Z,cS as G,l3 as St,l4 as jt,a5 as de,l5 as Et,aK as $e,l6 as Mt,l7 as It,ev as Te,aw as ze,f_ as Rt,f$ as Ct,g0 as Dt,g1 as Pt,r as oe,af as h,O as At,gN as _t,gO as je,gQ as kt,gj as Ft,eF as Ne,l8 as $t,dj as Tt,l9 as zt,p as Oe}from"./index-Bn8WGRJh.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r as i}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{u as Nt,d as Ot,c as Gt}from"./frame-debugger-store-QZzA9Bp6.js";import{m as Vt}from"./audio-meter-Cddyq1vI.js";import{p as Ge}from"./utility-view-state-CV4sNyaf.js";import{P as Lt}from"./PlayBar-DlSAPez7.js";import{a as Ee,r as Ht,f as Bt,R as Wt}from"./presentation-Dr2MWsec.js";import{setUserData as Ve}from"./user-data-CODoGZqA.js";import{I as pe,J as Ut,K as ne,L as qt,M as Le,O as He,P as Be,Q as We,w as Kt,x as Xt,R as me,v as Y,S as Yt,T as Qt,U as Zt,V as se,W as Ue,X as Me,Y as qe,Z as Jt,_ as Ke,a as en,$ as tn,a0 as Ie,a1 as nn,b as Xe,a2 as sn}from"./game-network-BRvp9Eya.js";import{aq as on,cp as Ye,aI as rn,bX as an,ey as ln,bh as fe,co as Re,s as cn,fo as W,bV as un,N as Qe,M as Ce,dg as dn,df as pn}from"./three.core-3arARmh6.js";import{e as mn,S as fn}from"./surface-state-_ZZJugmc.js";import{d as hn}from"./surface-content-Dg9Kkazf.js";import{a as gn,R as Ze}from"./active-ingest-DCi6B_Mk.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"./configurations-BQSxxjbY.js";import"./run-selection-D1vl12vH.js";import"./ingest-source-persistence-C-gTDfvH.js";import"./capability-coverage-4xMPa566.js";import"./game-contract-seams-Bk8NMwX4.js";import"./object-marks-BnvSuCTt.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-C_1Fna30.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B6pk-yrQ.js";import"./contract-system-adapters-CEuzOynM.js";import"./seeded-random-BMbOsD5m.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-H6S9jMp9.js";import"./edit-mode-authoring-D4gF7ToY.js";import"./json-history-resource-DiN_PLbn.js";import"./binding-resolver-CqJs8FS9.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-ugwrIrZB.js";import"./canvas-entry-runtime-C4V45HMi.js";import"./three-ingest-runtime-BsCSoTG8.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./pixi-story-model-DNkfnWUV.js";import"./viewport-root-presentation-h3E0Xsra.js";import"./mounted-authoring-Cjmi_MYm.js";import"./entity-object-B77fPnTJ.js";import"./user-data-DX18I5LS.js";import"./workspace-arrangement-Dg7zIkwR.js";import"./three-contract-Dkt6PmWY.js";import"./three-BiLYjlR0.js";import"./editor-layers-BGId-Uru.js";import"./component-instance-root-CgmR0Q36.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DlqC-T90.js";import"./source-persistence-backend-B2YaNBbK.js";import"./three-projection-core-C0R8NXF5.js";import"./body-marks-C1LxJtQb.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BATEkxoi.js";import"./deferred-ingest-play-GNKwMor5.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BUU8rhRd.js";import"./board-guides-CFM0Dzzw.js";import"./relative-import-specifier-CbIyU_9J.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C1HaQduW.js";import"./inference-diagnostics-BPtSODNJ.js";import"./writer-tw6EcuVO.js";import"./three-state-28vYMAez.js";import"./editor-shell-store-DhM6KcjO.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-C_XkG4b1.js";import"./game-surface-defaults-D8S4cRxi.js";const Je=8,re=1e3/60;function vn(e,t=Je){return!(e>0)||t<=0?0:Math.min(t,Math.max(1,Math.round(Vt(e)/100*t)))}function De(e,t){const n=e.filter(a=>a.id>t),r=n.at(-1)?.id??t,o=n.map(a=>a.intervalMs).filter(a=>Number.isFinite(a)&&a>0).sort((a,m)=>a-m);if(o.length===0)return{frameId:r,intervalMs:null};const l=Math.floor((o.length-1)*.95);return{frameId:r,intervalMs:o[l]??null}}function xn(e){const t=e.slice(-3);return t.slice(-2).length===2&&t.slice(-2).every(n=>n>=50)?"danger":t.length===3&&t.every(n=>n>re*1.05)?"warning":"normal"}function yn(e,t,n,r=50){if(e.length===0||t<=0||n<=0)return"";const o=Math.max(1,e.length-1);return e.map((l,a)=>{const m=a/o*t,d=Math.min(1,Math.max(0,l/r)),g=n-d*n;return`${m.toFixed(1)},${g.toFixed(1)}`}).join(" ")}const et="muted",Pe={enabled:!1,recording:!1,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:{gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:0}};function Ae(){return St(et)===!0}function bn(e){jt(et,e)}function wn(e,t){const n=t.find(o=>o.id==="master")?.level;if(!e.isMuted()&&n!==void 0)return n;const r=t.filter(o=>o.id!=="master").map(o=>o.level);return r.length>0?Math.max(...r):n??0}function Sn(){const e=K();i.useSyncExternalStore(e.subscribe,e.getShellSnapshot??e.getSnapshot);const t=e.playState==="playing",[n,r]=i.useState(!1),[o,l]=i.useState(0),[a,m]=i.useState(!1),[d,g]=i.useState(!1),[u,T]=i.useState(Ae),R=i.useRef(Ae()),E=i.useRef(new WeakMap),y=i.useRef(null),C=i.useSyncExternalStore(xt,we,we),v=yt();i.useEffect(()=>{const p=R.current||!t;for(const f of Se())E.current.get(f)!==p&&(f.setMuted(p),E.current.set(f,p))},[C,t]),i.useEffect(()=>{if(!v){l(0),m(!1),g(!1);return}const p=v.acquireMeters?.()??null;g(p!==null);const f=()=>{m(v.isMuted()),l(p?wn(v,p.read()):0)};f();const A=setInterval(f,100);return()=>{clearInterval(A),p?.dispose()}},[v]);const M=()=>{const p=!R.current,f=p||!t;for(const A of Se())A.resume?.(),A.setMuted(f),E.current.set(A,f);R.current=p,T(p),bn(p),m(f)},D=vn(o),z=v&&a&&!u&&!t?" (not playing)":"",P=v?a?"Audio muted":o>0?"Audio playing":"Audio quiet":"Audio unavailable";return s.jsxs("div",{className:"volter-header-audio","data-muted":a||void 0,"data-available":!!v,children:[s.jsxs(L,{ref:y,type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button","data-testid":"header-audio-telemetry","aria-label":`${P}; open audio controls`,"aria-haspopup":"menu","aria-expanded":n,title:`${P}${z}${d?"":" · level metering unavailable"}`,onClick:()=>r(p=>!p),children:[s.jsx(ue,{icon:a?bt:wt,size:"sm"}),s.jsx("span",{className:"volter-audio-vu","aria-hidden":"true",children:Array.from({length:Je},(p,f)=>s.jsx("i",{"data-filled":f<D||void 0},f))})]}),n&&s.jsx(Z,{anchorRef:y,onDismiss:()=>r(!1),gap:3,children:s.jsx(G,{onClick:()=>{M(),r(!1)},children:u?"Unmute audio":"Mute audio"})})]})}function jn(){const e=Nt(),t=e?.profiler??null,[n,r]=i.useState(Pe),[o,l]=i.useState([]);i.useEffect(()=>{if(!t){r(Pe),l([]);return}const R=t.telemetryEnabled;t.telemetryEnabled=!0;const E=t.getSnapshot(),y=De(E.frames,0);let C=y.frameId;r(E),l(y.intervalMs===null?[]:[y.intervalMs]);let v=null;const M=()=>{v=null;const z=t.getSnapshot(),P=De(z.frames,C);C=P.frameId,r(z);const p=P.intervalMs;p!==null&&l(f=>[...f,p].slice(-24))},D=t.subscribe(()=>{v===null&&(v=setTimeout(M,500))});return()=>{D(),v!==null&&clearTimeout(v),R||(t.telemetryEnabled=!1)}},[t]);const a=o.at(-1)??null,m=yn(o,72,18),d=a?Math.round(1e3/a):n.fps>0?Math.round(n.fps):null,g=a??(n.fps>0?1e3/n.fps:null),u=xn(o),T=e?`${e.label}: ${d??"—"} FPS · ${g?.toFixed(1)??"—"} ms frame time · open Profiler`:"The active document has no live render loop to profile";return s.jsxs(L,{type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button volter-header-performance","data-testid":"header-performance-telemetry","data-performance-tone":u,disabled:!e,"aria-label":T,title:T,onClick:()=>Ge.open("profiler"),children:[s.jsxs("svg",{className:"volter-performance-graph","aria-hidden":"true",viewBox:"0 0 72 18",width:"72",height:"18",children:[s.jsx("line",{className:"volter-performance-budget",x1:"0",x2:"72",y1:18-re/50*18,y2:18-re/50*18}),m&&s.jsx("polyline",{className:"volter-performance-sparkline",points:m})]}),s.jsxs("span",{className:"volter-performance-readout",children:[s.jsxs("strong",{className:"volter-header-fps",children:[d??"—"," FPS"]}),s.jsxs("span",{className:"volter-header-frame-ms",children:[g?.toFixed(1)??"—"," ms"]})]})]})}function En(){return i.useSyncExternalStore(ht,be,be),gt().telemetry==="hidden"?null:s.jsxs(vt,{className:"volter-header-telemetry volter-chrome-island volter-glass-island","data-island-scale":"compact",align:"center",gap:1,children:[s.jsx(Sn,{}),s.jsx(jn,{})]})}let Q=!1,ie=0,w=null,N=null;const Mn=new on(1,1,1,16,1,!0),In=new Ye({color:2280686,transparent:!0,opacity:.45,side:rn,depthWrite:!1}),Rn=new an({color:16755200,transparent:!0,opacity:.9}),Cn=new ln(.12,12,8),Dn=new Ye({color:16755200,depthWrite:!1}),Pn=16724804,An=2280686;let $=[];function _e(){return Q}function _n(e){e!==Q&&(Q=e,e?ie=requestAnimationFrame(tt):(cancelAnimationFrame(ie),$n()))}function tt(){if(!Q)return;ie=requestAnimationFrame(tt);const e=pe(),t=e?de().navigation?.crowdAgents?.()??[]:[];if(e!==N&&(N&&w&&N.remove(w),N=e,e&&(w||(w=new fe,w.name="crowd-debug-draw",Ve(w,"editorHelper",!0)),e.add(w))),!(!w||!e)){kn(w,t.length);for(let n=0;n<t.length;n++)Fn($[n],t[n])}}function kn(e,t){for(;$.length<t;){const n=new fe,r=In.clone(),o=new Re(Mn,r),l=new cn(new W(1,0,0),new W,1,16755200),a=new un(new Qe,Rn),m=new Re(Cn,Dn);n.add(o),n.add(l),e.add(n),e.add(a),e.add(m),$.push({root:n,cylinder:o,cylinderMaterial:r,arrow:l,path:a,target:m})}for(;$.length>t;){const n=$.pop();e.remove(n.root),e.remove(n.path),e.remove(n.target),n.arrow.dispose(),n.path.geometry.dispose(),n.cylinderMaterial.dispose()}}function Fn(e,t){e.root.position.set(t.position.x,t.position.y,t.position.z),e.cylinder.scale.set(t.radius,t.height,t.radius),e.cylinder.position.y=t.height/2,e.cylinderMaterial.color.setHex(t.state==="invalid"?Pn:An);const n=t.corners??[];n.length>0?(e.path.visible=!0,e.path.geometry.setFromPoints([new W(t.position.x,t.position.y+.05,t.position.z),...n.map(o=>new W(o.x,o.y+.05,o.z))])):e.path.visible=!1,t.target&&n.length>0?(e.target.visible=!0,e.target.position.set(t.target.x,t.target.y+.05,t.target.z)):e.target.visible=!1;const r=Math.hypot(t.velocity.x,t.velocity.y,t.velocity.z);r>.01?(e.arrow.visible=!0,e.arrow.position.y=t.height/2,e.arrow.setDirection(new W(t.velocity.x/r,t.velocity.y/r,t.velocity.z/r)),e.arrow.setLength(Math.max(r*.5,.2))):e.arrow.visible=!1}function $n(){if(w){N?.remove(w);for(const e of $)e.arrow.dispose();w.clear()}$=[],w=null,N=null}function Tn({onPresetChange:e}){const[t,n]=i.useState(!1),r=i.useRef(null),o=Le(),l=o.kind==="fit";return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:r,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":t,"aria-controls":t?"volter-device-preset-menu":void 0,"data-testid":"device-preset-picker",onClick:()=>n(a=>!a),title:"Device preview — constrain the game to a device resolution + DPR. Phone/tablet presets show the safe area, set --volter-safe-area-inset-top/right/bottom/left CSS vars on the game mount, and send mouse input as touch.",children:[s.jsx(ue,{icon:Et,size:"md"}),s.jsx($e,{variant:"code",children:l?"Device":`${o.width}×${o.height}`})]}),t&&s.jsxs(Z,{id:"volter-device-preset-menu",anchorRef:r,className:"volter-resolution-menu",gap:4,onDismiss:()=>n(!1),children:[Ut.map(a=>s.jsx(G,{role:"menuitemradio","aria-checked":a.id===o.id,"data-testid":`device-preset-${a.id}`,onSelect:()=>{e(a),n(!1)},children:a.label},a.id)),s.jsxs(G,{role:"menuitemcheckbox","aria-checked":ne(),"data-testid":"device-touch-toggle",onSelect:()=>qt(!ne()),children:[ne()?"✓ ":" ","Pointer as touch"]})]})]})}function zn(){const e=Mt(()=>It()??null),n=Ot(e)?.capture===!0;return s.jsx(L,{type:"button",size:"compact",variant:"ghost","data-testid":"game-capture-frame",className:"volter-frame-capture-game-button",disabled:!n,title:n?"Capture one rendered frame and open the Frame debugger":"No render-debug adapter registered for this world — frame capture is unavailable",onClick:()=>{Gt(e),Ge.open("frame")},children:"Capture frame"})}let nt={label:"Fill",width:null,height:null},ae=1,st=0;const le=new Set;function V(){st++;for(const e of le)e()}function ot(e){return le.add(e),()=>{le.delete(e)}}const rt=()=>st;function it(){return nt}function at(e){nt=e,V()}function lt(e,t){return e.width!==null||!t?e:{label:`Project — ${t.width}×${t.height}`,width:t.width,height:t.height}}function Nn(e){return e?[lt({label:"Fill",width:null,height:null},e),...Ee.filter(t=>t.width!==null)]:Ee}function ct(e){He(e.id),at(e.width===null||e.height===null?{label:"Fill",width:null,height:null}:{label:e.label,width:e.width,height:e.height})}function On(e){e!==ae&&(ae=e,V())}function Gn(){return ae}function ut(e){return Array.from(e.children).filter(t=>t.dataset?.volterRootSurface==="true")}function Vn(e,t,n){for(const r of t)r.contains(e)||e.appendChild(r);if(n)for(const r of ut(n))e.appendChild(r)}function Ln({name:e}){return s.jsx("div",{"data-testid":"game-instance-name",style:{flex:"0 0 auto",padding:"3px 10px",background:h.surface.chrome,color:h.content.primary,borderBottom:`1px solid ${h.boundary.default}`,fontSize:11,fontWeight:600,userSelect:"none"},children:e})}function dt({name:e,testId:t,borderLeft:n,focused:r,onFocus:o,children:l}){return s.jsxs("div",{"data-testid":t,"data-focused":r||void 0,onPointerDownCapture:o,style:{flex:1,minWidth:0,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",cursor:o&&!r?"pointer":void 0,...n?{borderLeft:`1px solid ${h.boundary.default}`}:{}},children:[s.jsx(Ln,{name:e}),s.jsx("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:l}),r&&s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:40,border:`2px solid ${h.accent.default}`,boxShadow:`inset 0 0 0 1px ${h.accent.default}`}})]})}function Hn({index:e}){const t=i.useRef(null),n=qe(e+1),r=i.useSyncExternalStore(Ke,en),[o,l]=i.useState(null),a=i.useSyncExternalStore(me,Y);return i.useEffect(()=>{const m=t.current;if(!m||!r)return;let d=null,g=!1;return tn(m,n).then(u=>{g?Ie(u):(d=u,l(u))},u=>{At.error(`Failed to mount ${n}: ${u}`,"play-mode")}),()=>{g=!0,l(null),d&&Ie(d)}},[e,r]),s.jsx(dt,{name:n,testId:`game-instance-slot-${e+1}`,borderLeft:!0,focused:o!=null&&a===o,onFocus:o?()=>Ue(o):void 0,children:s.jsx("div",{ref:t,"data-volter-instance-viewport":"",style:{position:"absolute",inset:0}})})}function Bn({style:e}){const t=i.useSyncExternalStore(Te,ze),r=K().playState!=="stopped",o=i.useRef(null);i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(Be,We);const l=i.useSyncExternalStore(Kt,Xt),a=l>0,m=i.useSyncExternalStore(me,Y),d=Le(),g=it(),[u,T]=i.useState({width:0,height:0}),[R,E]=i.useState(0),y=i.useRef(null),C=i.useSyncExternalStore(Rt,Ct),v=i.useSyncExternalStore(Dt,Pt),M=Jt(),D=gn(),z=M.length>0?M.map(c=>c.rootId):D?[D.worldId]:C.filter(c=>c.mechanism==="host-mount").map(c=>c.rootId),P=!!(y.current&&hn(y.current)),p=M.length>0?M.some(c=>c.hasRenderableContent):P,f=M.length>0||D!==null,A=r?mn({surface:"Game",rootIds:z,phase:f?"ready":"loading",content:f?p?"present":"empty":"unknown",readiness:C,failures:v}):null;i.useEffect(()=>{if(!r||!f||p)return;const c=window.setTimeout(()=>E(x=>x+1),250);return()=>window.clearTimeout(c)},[R,p,r,f]),i.useEffect(()=>{const c=o.current;if(!c||typeof MutationObserver>"u")return;const x=new MutationObserver(()=>E(I=>I+1));return x.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>x.disconnect()},[]),i.useEffect(()=>{const c=Yt();c.width!==null&&(ct(c),V())},[]);const J=i.useRef([]),he=i.useCallback(c=>{if(c===y.current)return;!c&&y.current&&(J.current=ut(y.current)),c&&(Vn(c,J.current,y.current),J.current=[]);const x=y.current;y.current=c,c?oe().workspace.liveDocument.setContainer(c):x&&oe().workspace.liveDocument.releaseContainer(x),c?Qt(c):x&&Zt(x)},[]);i.useEffect(()=>{const c=o.current;if(!c)return;const x=new ResizeObserver(([I])=>{if(!I)return;const{width:X,height:ye}=I.contentRect;T(te=>te.width===X&&te.height===ye?te:{width:X,height:ye})});return x.observe(c),()=>x.disconnect()},[]);const mt=t?.config.resolution,_=Ht(g,mt),ge=_.kind==="fill",ft=ge||a,H=_.kind==="logical"?_.width:null,B=_.kind==="logical"?_.height:null,ve=d.dpr;i.useEffect(()=>{const c=ve??nn();a?u.width>0&&u.height>0&&se(u.width/(l+1),u.height,c):H===null||B===null?u.width>0&&u.height>0&&se(u.width,u.height,c):se(H,B,c)},[H,B,u.width,u.height,ve,r,a,l]);const ee=Bt(u,{width:H??0,height:B??0},{allowUpscale:_.kind==="logical"&&_.allowUpscale}),k=ge?1:ee.scale;i.useEffect(()=>{On(k)},[k]);const b=d.safeArea,xe={"--volter-safe-area-inset-top":`${b?.top??0}px`,"--volter-safe-area-inset-right":`${b?.right??0}px`,"--volter-safe-area-inset-bottom":`${b?.bottom??0}px`,"--volter-safe-area-inset-left":`${b?.left??0}px`};return s.jsx("div",{style:{overflow:"hidden",position:"relative",flexDirection:"column",...e},children:s.jsxs("div",{ref:o,style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(()=>{const c=ft?s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{position:"absolute",inset:0,...r?{}:{visibility:"hidden"},...xe}},"game-mount-fill"):s.jsxs("div",{style:{position:"relative",width:ee.width,height:ee.height,overflow:"hidden",...r?{}:{visibility:"hidden"}},children:[s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{width:H??0,height:B??0,transformOrigin:"top left",transform:`scale(${k})`,...xe}}),b&&s.jsx("div",{"data-testid":"device-safe-area-overlay",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:2},children:[["top",b.top,{top:0,left:0,right:0,height:b.top*k}],["bottom",b.bottom,{bottom:0,left:0,right:0,height:b.bottom*k}],["left",b.left,{top:0,bottom:0,left:0,width:b.left*k}],["right",b.right,{top:0,bottom:0,right:0,width:b.right*k}]].map(([x,I,X])=>I>0?s.jsx("div",{"data-testid":`device-safe-area-${x}`,style:{position:"absolute",...X,background:h.semantic.dangerFaint,boxShadow:`inset 0 0 0 1px ${h.semantic.dangerMuted}`}},x):null)})]},"game-mount-device");return a?s.jsxs(s.Fragment,{children:[s.jsx(dt,{name:qe(0),testId:"game-instance-slot-0",focused:m===Me(),onFocus:()=>Ue(Me()),children:c}),Array.from({length:l},(x,I)=>s.jsx(Hn,{index:I},I))]}):c})(),!r&&s.jsxs("div",{"data-testid":"game-stopped-placeholder",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,background:h.surface.shell,color:h.content.dim,fontSize:11,pointerEvents:"none"},children:[s.jsx("span",{style:{color:h.content.primary,fontSize:13},children:"Game is stopped"}),s.jsx("span",{children:"Press Play to start the composed runtime."})]}),r&&s.jsx(fn,{explanation:A,testId:"game-surface-status",style:{zIndex:30,background:h.surface.shell}})]})})}function ke(){return Xe().map(({id:e,name:t})=>`${e}\0${t}`).join("")}function Wn({instanceId:e}){const t=K();i.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);const n=i.useSyncExternalStore(me,Y,Y),[,r]=i.useState(0);i.useEffect(()=>{const g=window.setInterval(()=>r(u=>u+1),250);return()=>window.clearInterval(g)},[]);const o=Ze(e),l=zt(),a=o?(o.loop.activeTimeouts??0)+(o.loop.activeIntervals??0)+(o.loop.activeAnimationFrames??0)+o.loop.pending:0,m=o?o.listeners.window+o.listeners.document:0,d=[["Mount",e],["Simulation",t.playState==="paused"?"Paused":"Running"],["Input",n===e?"Keyboard focus":"Inactive"],["Input events",o?`${o.loop.input??0} observed · ${o.loop.inputBlocked??0} blocked`:"Not measured"],["Network",l?l.getConnectionState?.()??"Not reported by this adapter":"Not registered"],["Owned callbacks",String(a)],["Owned listeners",String(m)],["Realm globals",String(o?.globals??0)],["Browser storage",o?`Shared origin · ${o.storage.local.reads+o.storage.session.reads} reads · ${o.storage.local.writes+o.storage.session.writes} writes`:"Shared origin"]];return s.jsx("div",{role:"none",style:{display:"grid",gridTemplateColumns:"112px minmax(120px, 1fr)",gap:"4px 12px",padding:"8px 10px",fontSize:10,lineHeight:"15px"},children:d.map(([g,u])=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("span",{style:{color:h.content.dim},children:g}),s.jsx("span",{style:{color:h.content.primary,fontFamily:g==="Mount"?h.typography.mono:void 0,overflow:"hidden",textOverflow:"ellipsis"},children:u})]},g))})}function Un(){i.useSyncExternalStore(Ke,ke,ke),i.useSyncExternalStore(_t,je,je);const e=Xe(),t=kt(),n=e.find(d=>d.id===t)??e[0],[r,o]=i.useState(!1),l=i.useRef(null);if(e.length<2||!n)return null;const m=(Ze(n.id)?.loop.firedWhileHeld??0)>0;return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:l,variant:"ghost",size:"compact","aria-haspopup":"menu","aria-expanded":r,onClick:()=>o(d=>!d),title:`Runtime instruments inspect ${n.name}; agent-addressed commands are unchanged`,children:[s.jsx(ue,{icon:Ft,size:"sm",style:{color:m?h.semantic.warning:void 0}}),s.jsxs($e,{variant:"code",children:["Inspect ",n.name]}),s.jsx(Ne,{direction:"down"})]}),r&&s.jsxs(Z,{anchorRef:l,gap:3,onDismiss:()=>o(!1),style:{minWidth:270},children:[e.map(d=>s.jsxs(G,{role:"menuitemradio","aria-checked":d.id===n.id,onSelect:()=>$t(d.id),children:[d.id===n.id?"✓ ":" ",d.name]},d.id)),s.jsx(Tt,{}),s.jsx(Wn,{instanceId:n.id})]})]})}let q=!1,ce=0,S=null,O=null,U=null,j=null,F=0;function Fe(){return q}function qn(e){e!==q&&(q=e,e?ce=requestAnimationFrame(pt):(cancelAnimationFrame(ce),U?.setDebugDrawEnabled?.(!1),Qn()))}function pt(){if(!q)return;ce=requestAnimationFrame(pt);const e=pe(),t=e?Oe(de().physics):null;if(t!==U&&(U?.setDebugDrawEnabled?.(!1),U=t,t?.setDebugDrawEnabled?.(!0)),Kn(e),!S||!e)return;const n=t?.contactPoints?.()??null;Xn(S,n)}function Kn(e){e!==O&&(O&&S&&O.remove(S),O=e,e&&(S||(S=new fe,S.name="physics-debug-draw",Ve(S,"editorHelper",!0)),e.add(S)))}function Xn(e,t){const n=t?t.length/3:0;if(!j){F=64;const l=new Qe;l.setAttribute("position",new Ce(new Float32Array(F*3),3));const a=new dn({color:16724821,size:10,sizeAttenuation:!1,depthTest:!1,transparent:!0,opacity:.95});j=new pn(l,a),j.renderOrder=999,j.frustumCulled=!1,e.add(j)}const r=j.geometry;if(n>F){for(;F<n;)F*=2;r.setAttribute("position",new Ce(new Float32Array(F*3),3))}const o=r.getAttribute("position");t&&n>0&&o.array.set(t),o.needsUpdate=!0,r.setDrawRange(0,n),j.visible=n>0}function Yn(){const e=pe(),n=(e?Oe(de().physics):null)?.debugDraw?.()??null;let r=!1;n&&e&&e.traverse(a=>{a===n&&(r=!0)});const o=n?.geometry.getAttribute("position"),l=j?.geometry.drawRange.count??0;return{enabled:q,wireframeInScene:r,wireframeVisible:n?.visible??!1,wireframeVertexCount:o?.count??0,contactMarkerCount:j?.visible&&Number.isFinite(l)?l:0}}typeof window<"u"&&(window.__volterPhysicsDebug=Yn);function Qn(){S&&(O?.remove(S),j&&(j.geometry.dispose(),j.material.dispose()),S.clear()),j=null,F=0,S=null,O=null,U=null}function Zn(){const[e,t]=i.useState(!1),n=i.useRef(null);return s.jsxs("div",{style:{position:"relative"},children:[s.jsxs(L,{ref:n,type:"button",variant:"outline",size:"compact","data-testid":"game-debug-menu","aria-haspopup":"menu","aria-expanded":e,"aria-controls":e?"volter-game-debug-menu":void 0,onClick:()=>t(r=>!r),children:[s.jsx("span",{children:"Debug"}),s.jsx(Ne,{direction:"down"})]}),e&&s.jsxs(Z,{id:"volter-game-debug-menu",anchorRef:n,gap:3,onDismiss:()=>t(!1),style:{minWidth:190},children:[s.jsxs(G,{onClick:()=>{_n(!_e()),V()},children:[_e()?"✓ ":" ","Crowd debug draw"]}),s.jsxs(G,{onClick:()=>{qn(!Fe()),V()},children:[Fe()?"✓ ":" ","Physics debug draw"]})]})]})}function Jn(e){const t=i.useSyncExternalStore(Te,ze),n=K();return i.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(Be,We),s.jsxs("div",{"data-testid":"game-doc-toolbar",style:{display:"grid",alignItems:"center",gridTemplateColumns:"minmax(0, 1fr) auto minmax(0, 1fr)",width:"100%",gap:6,padding:"2px 8px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,overflow:"auto"},children:[s.jsx(Un,{}),s.jsx(Tn,{onPresetChange:r=>{ct(r),V()}}),s.jsx(Wt,{resolution:lt(it(),t?.config.resolution),options:Nn(t?.config.resolution),onResolutionChange:r=>{He(sn),at(r)},scale:Gn(),title:"Change game resolution"}),s.jsx(Zn,{}),n.playState!=="stopped"&&s.jsx(zn,{})]}),s.jsx(Lt,{placement:"runtime"}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",minWidth:0},children:s.jsx(En,{})})]})}function es(e){const t=K();i.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot);const n=t.playState!=="stopped";return s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[s.jsx(Bn,{style:{flex:1,position:"relative",display:"flex",flexDirection:"column",pointerEvents:"auto",...t.playState==="playing"?{outline:`2px solid ${h.semantic.success}`,outlineOffset:-2}:n?{outline:`2px solid ${h.semantic.warning}`,outlineOffset:-2}:{}}}),t.playState==="paused"&&s.jsx("div",{"data-testid":"game-paused-notice",style:{position:"absolute",left:"50%",top:12,transform:"translateX(-50%)",padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,.72)",color:h.content.primary,fontSize:12,letterSpacing:".04em",pointerEvents:"none",zIndex:2},children:"Paused by the editor — press ▶ Play to resume (Escape pauses)"})]})}const To="workspace.service";function zo(){return oe().workspace.liveDocument.register({Content:es,Toolbar:Jn})}export{To as point,zo as start};
1
+ import{kW as ht,kX as be,kY as gt,cM as vt,K,kZ as xt,k_ as we,k$ as yt,l0 as Se,a0 as L,a1 as ue,l1 as bt,l2 as wt,cR as Z,cS as G,l3 as St,l4 as jt,a5 as de,l5 as Et,aK as $e,l6 as Mt,l7 as It,ev as Te,aw as ze,f_ as Rt,f$ as Ct,g0 as Dt,g1 as Pt,r as oe,af as h,O as At,gN as _t,gO as je,gQ as kt,gj as Ft,eF as Ne,l8 as $t,dj as Tt,l9 as zt,p as Oe}from"./index-DMsonpRx.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r as i}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{u as Nt,d as Ot,c as Gt}from"./frame-debugger-store-B7Jbgb39.js";import{m as Vt}from"./audio-meter-Cddyq1vI.js";import{p as Ge}from"./utility-view-state-Aza1mypE.js";import{P as Lt}from"./PlayBar-CGjjGuF8.js";import{a as Ee,r as Ht,f as Bt,R as Wt}from"./presentation-D4z-Nsdr.js";import{setUserData as Ve}from"./user-data-CODoGZqA.js";import{I as pe,J as Ut,K as ne,L as qt,M as Le,O as He,P as Be,Q as We,w as Kt,x as Xt,R as me,v as Y,S as Yt,T as Qt,U as Zt,V as se,W as Ue,X as Me,Y as qe,Z as Jt,_ as Ke,a as en,$ as tn,a0 as Ie,a1 as nn,b as Xe,a2 as sn}from"./game-network-1JI7uhYb.js";import{aq as on,cp as Ye,aI as rn,bX as an,ey as ln,bh as fe,co as Re,s as cn,fo as W,bV as un,N as Qe,M as Ce,dg as dn,df as pn}from"./three.core-3arARmh6.js";import{e as mn,S as fn}from"./surface-state-IkyRZBV7.js";import{d as hn}from"./surface-content-Dg9Kkazf.js";import{a as gn,R as Ze}from"./active-ingest-CEa53vF0.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"./configurations-B45jigJP.js";import"./run-selection-BQzUtW8L.js";import"./ingest-source-persistence-B0NaYeRY.js";import"./capability-coverage-BW0jhUWf.js";import"./game-contract-seams-6S6C0ztA.js";import"./object-marks-BnvSuCTt.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BAc7TBPq.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DWXKHjIJ.js";import"./contract-system-adapters-Cgl3IHIO.js";import"./seeded-random-MSFUDgJ4.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-DWfBuVx7.js";import"./edit-mode-authoring-DbOPyppg.js";import"./json-history-resource-BF-O43PD.js";import"./binding-resolver-CTLBEZNC.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CoCivh2s.js";import"./canvas-entry-runtime-CB0dWiqf.js";import"./three-ingest-runtime-Cw0ElzJG.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./pixi-story-model-DNkfnWUV.js";import"./viewport-root-presentation-DtrhPv-6.js";import"./mounted-authoring-D8pHcD_a.js";import"./entity-object-S9jvlW_s.js";import"./user-data-BsgiyhZb.js";import"./workspace-arrangement-CHzaISez.js";import"./three-contract-Dkt6PmWY.js";import"./three-CKv5ucoa.js";import"./editor-layers-C-4kqPi7.js";import"./component-instance-root-CuhMBeTq.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C7fn0FHE.js";import"./source-persistence-backend-cM6_hFF1.js";import"./three-projection-core-D26OWHpV.js";import"./body-marks-C1LxJtQb.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DrjAxMEm.js";import"./deferred-ingest-play-Ck7KAYWK.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CI1sk6F6.js";import"./board-guides-DvGa-v8v.js";import"./relative-import-specifier-C6rJbXKw.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-D4blh5_a.js";import"./inference-diagnostics-CUavJjuI.js";import"./writer-tw6EcuVO.js";import"./three-state-TqrpCspu.js";import"./editor-shell-store-BqJU8Lu8.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-D7E51csI.js";import"./game-surface-defaults-D8S4cRxi.js";const Je=8,re=1e3/60;function vn(e,t=Je){return!(e>0)||t<=0?0:Math.min(t,Math.max(1,Math.round(Vt(e)/100*t)))}function De(e,t){const n=e.filter(a=>a.id>t),r=n.at(-1)?.id??t,o=n.map(a=>a.intervalMs).filter(a=>Number.isFinite(a)&&a>0).sort((a,m)=>a-m);if(o.length===0)return{frameId:r,intervalMs:null};const l=Math.floor((o.length-1)*.95);return{frameId:r,intervalMs:o[l]??null}}function xn(e){const t=e.slice(-3);return t.slice(-2).length===2&&t.slice(-2).every(n=>n>=50)?"danger":t.length===3&&t.every(n=>n>re*1.05)?"warning":"normal"}function yn(e,t,n,r=50){if(e.length===0||t<=0||n<=0)return"";const o=Math.max(1,e.length-1);return e.map((l,a)=>{const m=a/o*t,d=Math.min(1,Math.max(0,l/r)),g=n-d*n;return`${m.toFixed(1)},${g.toFixed(1)}`}).join(" ")}const et="muted",Pe={enabled:!1,recording:!1,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:{gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:0}};function Ae(){return St(et)===!0}function bn(e){jt(et,e)}function wn(e,t){const n=t.find(o=>o.id==="master")?.level;if(!e.isMuted()&&n!==void 0)return n;const r=t.filter(o=>o.id!=="master").map(o=>o.level);return r.length>0?Math.max(...r):n??0}function Sn(){const e=K();i.useSyncExternalStore(e.subscribe,e.getShellSnapshot??e.getSnapshot);const t=e.playState==="playing",[n,r]=i.useState(!1),[o,l]=i.useState(0),[a,m]=i.useState(!1),[d,g]=i.useState(!1),[u,T]=i.useState(Ae),R=i.useRef(Ae()),E=i.useRef(new WeakMap),y=i.useRef(null),C=i.useSyncExternalStore(xt,we,we),v=yt();i.useEffect(()=>{const p=R.current||!t;for(const f of Se())E.current.get(f)!==p&&(f.setMuted(p),E.current.set(f,p))},[C,t]),i.useEffect(()=>{if(!v){l(0),m(!1),g(!1);return}const p=v.acquireMeters?.()??null;g(p!==null);const f=()=>{m(v.isMuted()),l(p?wn(v,p.read()):0)};f();const A=setInterval(f,100);return()=>{clearInterval(A),p?.dispose()}},[v]);const M=()=>{const p=!R.current,f=p||!t;for(const A of Se())A.resume?.(),A.setMuted(f),E.current.set(A,f);R.current=p,T(p),bn(p),m(f)},D=vn(o),z=v&&a&&!u&&!t?" (not playing)":"",P=v?a?"Audio muted":o>0?"Audio playing":"Audio quiet":"Audio unavailable";return s.jsxs("div",{className:"volter-header-audio","data-muted":a||void 0,"data-available":!!v,children:[s.jsxs(L,{ref:y,type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button","data-testid":"header-audio-telemetry","aria-label":`${P}; open audio controls`,"aria-haspopup":"menu","aria-expanded":n,title:`${P}${z}${d?"":" · level metering unavailable"}`,onClick:()=>r(p=>!p),children:[s.jsx(ue,{icon:a?bt:wt,size:"sm"}),s.jsx("span",{className:"volter-audio-vu","aria-hidden":"true",children:Array.from({length:Je},(p,f)=>s.jsx("i",{"data-filled":f<D||void 0},f))})]}),n&&s.jsx(Z,{anchorRef:y,onDismiss:()=>r(!1),gap:3,children:s.jsx(G,{onClick:()=>{M(),r(!1)},children:u?"Unmute audio":"Mute audio"})})]})}function jn(){const e=Nt(),t=e?.profiler??null,[n,r]=i.useState(Pe),[o,l]=i.useState([]);i.useEffect(()=>{if(!t){r(Pe),l([]);return}const R=t.telemetryEnabled;t.telemetryEnabled=!0;const E=t.getSnapshot(),y=De(E.frames,0);let C=y.frameId;r(E),l(y.intervalMs===null?[]:[y.intervalMs]);let v=null;const M=()=>{v=null;const z=t.getSnapshot(),P=De(z.frames,C);C=P.frameId,r(z);const p=P.intervalMs;p!==null&&l(f=>[...f,p].slice(-24))},D=t.subscribe(()=>{v===null&&(v=setTimeout(M,500))});return()=>{D(),v!==null&&clearTimeout(v),R||(t.telemetryEnabled=!1)}},[t]);const a=o.at(-1)??null,m=yn(o,72,18),d=a?Math.round(1e3/a):n.fps>0?Math.round(n.fps):null,g=a??(n.fps>0?1e3/n.fps:null),u=xn(o),T=e?`${e.label}: ${d??"—"} FPS · ${g?.toFixed(1)??"—"} ms frame time · open Profiler`:"The active document has no live render loop to profile";return s.jsxs(L,{type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button volter-header-performance","data-testid":"header-performance-telemetry","data-performance-tone":u,disabled:!e,"aria-label":T,title:T,onClick:()=>Ge.open("profiler"),children:[s.jsxs("svg",{className:"volter-performance-graph","aria-hidden":"true",viewBox:"0 0 72 18",width:"72",height:"18",children:[s.jsx("line",{className:"volter-performance-budget",x1:"0",x2:"72",y1:18-re/50*18,y2:18-re/50*18}),m&&s.jsx("polyline",{className:"volter-performance-sparkline",points:m})]}),s.jsxs("span",{className:"volter-performance-readout",children:[s.jsxs("strong",{className:"volter-header-fps",children:[d??"—"," FPS"]}),s.jsxs("span",{className:"volter-header-frame-ms",children:[g?.toFixed(1)??"—"," ms"]})]})]})}function En(){return i.useSyncExternalStore(ht,be,be),gt().telemetry==="hidden"?null:s.jsxs(vt,{className:"volter-header-telemetry volter-chrome-island volter-glass-island","data-island-scale":"compact",align:"center",gap:1,children:[s.jsx(Sn,{}),s.jsx(jn,{})]})}let Q=!1,ie=0,w=null,N=null;const Mn=new on(1,1,1,16,1,!0),In=new Ye({color:2280686,transparent:!0,opacity:.45,side:rn,depthWrite:!1}),Rn=new an({color:16755200,transparent:!0,opacity:.9}),Cn=new ln(.12,12,8),Dn=new Ye({color:16755200,depthWrite:!1}),Pn=16724804,An=2280686;let $=[];function _e(){return Q}function _n(e){e!==Q&&(Q=e,e?ie=requestAnimationFrame(tt):(cancelAnimationFrame(ie),$n()))}function tt(){if(!Q)return;ie=requestAnimationFrame(tt);const e=pe(),t=e?de().navigation?.crowdAgents?.()??[]:[];if(e!==N&&(N&&w&&N.remove(w),N=e,e&&(w||(w=new fe,w.name="crowd-debug-draw",Ve(w,"editorHelper",!0)),e.add(w))),!(!w||!e)){kn(w,t.length);for(let n=0;n<t.length;n++)Fn($[n],t[n])}}function kn(e,t){for(;$.length<t;){const n=new fe,r=In.clone(),o=new Re(Mn,r),l=new cn(new W(1,0,0),new W,1,16755200),a=new un(new Qe,Rn),m=new Re(Cn,Dn);n.add(o),n.add(l),e.add(n),e.add(a),e.add(m),$.push({root:n,cylinder:o,cylinderMaterial:r,arrow:l,path:a,target:m})}for(;$.length>t;){const n=$.pop();e.remove(n.root),e.remove(n.path),e.remove(n.target),n.arrow.dispose(),n.path.geometry.dispose(),n.cylinderMaterial.dispose()}}function Fn(e,t){e.root.position.set(t.position.x,t.position.y,t.position.z),e.cylinder.scale.set(t.radius,t.height,t.radius),e.cylinder.position.y=t.height/2,e.cylinderMaterial.color.setHex(t.state==="invalid"?Pn:An);const n=t.corners??[];n.length>0?(e.path.visible=!0,e.path.geometry.setFromPoints([new W(t.position.x,t.position.y+.05,t.position.z),...n.map(o=>new W(o.x,o.y+.05,o.z))])):e.path.visible=!1,t.target&&n.length>0?(e.target.visible=!0,e.target.position.set(t.target.x,t.target.y+.05,t.target.z)):e.target.visible=!1;const r=Math.hypot(t.velocity.x,t.velocity.y,t.velocity.z);r>.01?(e.arrow.visible=!0,e.arrow.position.y=t.height/2,e.arrow.setDirection(new W(t.velocity.x/r,t.velocity.y/r,t.velocity.z/r)),e.arrow.setLength(Math.max(r*.5,.2))):e.arrow.visible=!1}function $n(){if(w){N?.remove(w);for(const e of $)e.arrow.dispose();w.clear()}$=[],w=null,N=null}function Tn({onPresetChange:e}){const[t,n]=i.useState(!1),r=i.useRef(null),o=Le(),l=o.kind==="fit";return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:r,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":t,"aria-controls":t?"volter-device-preset-menu":void 0,"data-testid":"device-preset-picker",onClick:()=>n(a=>!a),title:"Device preview — constrain the game to a device resolution + DPR. Phone/tablet presets show the safe area, set --volter-safe-area-inset-top/right/bottom/left CSS vars on the game mount, and send mouse input as touch.",children:[s.jsx(ue,{icon:Et,size:"md"}),s.jsx($e,{variant:"code",children:l?"Device":`${o.width}×${o.height}`})]}),t&&s.jsxs(Z,{id:"volter-device-preset-menu",anchorRef:r,className:"volter-resolution-menu",gap:4,onDismiss:()=>n(!1),children:[Ut.map(a=>s.jsx(G,{role:"menuitemradio","aria-checked":a.id===o.id,"data-testid":`device-preset-${a.id}`,onSelect:()=>{e(a),n(!1)},children:a.label},a.id)),s.jsxs(G,{role:"menuitemcheckbox","aria-checked":ne(),"data-testid":"device-touch-toggle",onSelect:()=>qt(!ne()),children:[ne()?"✓ ":" ","Pointer as touch"]})]})]})}function zn(){const e=Mt(()=>It()??null),n=Ot(e)?.capture===!0;return s.jsx(L,{type:"button",size:"compact",variant:"ghost","data-testid":"game-capture-frame",className:"volter-frame-capture-game-button",disabled:!n,title:n?"Capture one rendered frame and open the Frame debugger":"No render-debug adapter registered for this world — frame capture is unavailable",onClick:()=>{Gt(e),Ge.open("frame")},children:"Capture frame"})}let nt={label:"Fill",width:null,height:null},ae=1,st=0;const le=new Set;function V(){st++;for(const e of le)e()}function ot(e){return le.add(e),()=>{le.delete(e)}}const rt=()=>st;function it(){return nt}function at(e){nt=e,V()}function lt(e,t){return e.width!==null||!t?e:{label:`Project — ${t.width}×${t.height}`,width:t.width,height:t.height}}function Nn(e){return e?[lt({label:"Fill",width:null,height:null},e),...Ee.filter(t=>t.width!==null)]:Ee}function ct(e){He(e.id),at(e.width===null||e.height===null?{label:"Fill",width:null,height:null}:{label:e.label,width:e.width,height:e.height})}function On(e){e!==ae&&(ae=e,V())}function Gn(){return ae}function ut(e){return Array.from(e.children).filter(t=>t.dataset?.volterRootSurface==="true")}function Vn(e,t,n){for(const r of t)r.contains(e)||e.appendChild(r);if(n)for(const r of ut(n))e.appendChild(r)}function Ln({name:e}){return s.jsx("div",{"data-testid":"game-instance-name",style:{flex:"0 0 auto",padding:"3px 10px",background:h.surface.chrome,color:h.content.primary,borderBottom:`1px solid ${h.boundary.default}`,fontSize:11,fontWeight:600,userSelect:"none"},children:e})}function dt({name:e,testId:t,borderLeft:n,focused:r,onFocus:o,children:l}){return s.jsxs("div",{"data-testid":t,"data-focused":r||void 0,onPointerDownCapture:o,style:{flex:1,minWidth:0,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",cursor:o&&!r?"pointer":void 0,...n?{borderLeft:`1px solid ${h.boundary.default}`}:{}},children:[s.jsx(Ln,{name:e}),s.jsx("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:l}),r&&s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:40,border:`2px solid ${h.accent.default}`,boxShadow:`inset 0 0 0 1px ${h.accent.default}`}})]})}function Hn({index:e}){const t=i.useRef(null),n=qe(e+1),r=i.useSyncExternalStore(Ke,en),[o,l]=i.useState(null),a=i.useSyncExternalStore(me,Y);return i.useEffect(()=>{const m=t.current;if(!m||!r)return;let d=null,g=!1;return tn(m,n).then(u=>{g?Ie(u):(d=u,l(u))},u=>{At.error(`Failed to mount ${n}: ${u}`,"play-mode")}),()=>{g=!0,l(null),d&&Ie(d)}},[e,r]),s.jsx(dt,{name:n,testId:`game-instance-slot-${e+1}`,borderLeft:!0,focused:o!=null&&a===o,onFocus:o?()=>Ue(o):void 0,children:s.jsx("div",{ref:t,"data-volter-instance-viewport":"",style:{position:"absolute",inset:0}})})}function Bn({style:e}){const t=i.useSyncExternalStore(Te,ze),r=K().playState!=="stopped",o=i.useRef(null);i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(Be,We);const l=i.useSyncExternalStore(Kt,Xt),a=l>0,m=i.useSyncExternalStore(me,Y),d=Le(),g=it(),[u,T]=i.useState({width:0,height:0}),[R,E]=i.useState(0),y=i.useRef(null),C=i.useSyncExternalStore(Rt,Ct),v=i.useSyncExternalStore(Dt,Pt),M=Jt(),D=gn(),z=M.length>0?M.map(c=>c.rootId):D?[D.worldId]:C.filter(c=>c.mechanism==="host-mount").map(c=>c.rootId),P=!!(y.current&&hn(y.current)),p=M.length>0?M.some(c=>c.hasRenderableContent):P,f=M.length>0||D!==null,A=r?mn({surface:"Game",rootIds:z,phase:f?"ready":"loading",content:f?p?"present":"empty":"unknown",readiness:C,failures:v}):null;i.useEffect(()=>{if(!r||!f||p)return;const c=window.setTimeout(()=>E(x=>x+1),250);return()=>window.clearTimeout(c)},[R,p,r,f]),i.useEffect(()=>{const c=o.current;if(!c||typeof MutationObserver>"u")return;const x=new MutationObserver(()=>E(I=>I+1));return x.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>x.disconnect()},[]),i.useEffect(()=>{const c=Yt();c.width!==null&&(ct(c),V())},[]);const J=i.useRef([]),he=i.useCallback(c=>{if(c===y.current)return;!c&&y.current&&(J.current=ut(y.current)),c&&(Vn(c,J.current,y.current),J.current=[]);const x=y.current;y.current=c,c?oe().workspace.liveDocument.setContainer(c):x&&oe().workspace.liveDocument.releaseContainer(x),c?Qt(c):x&&Zt(x)},[]);i.useEffect(()=>{const c=o.current;if(!c)return;const x=new ResizeObserver(([I])=>{if(!I)return;const{width:X,height:ye}=I.contentRect;T(te=>te.width===X&&te.height===ye?te:{width:X,height:ye})});return x.observe(c),()=>x.disconnect()},[]);const mt=t?.config.resolution,_=Ht(g,mt),ge=_.kind==="fill",ft=ge||a,H=_.kind==="logical"?_.width:null,B=_.kind==="logical"?_.height:null,ve=d.dpr;i.useEffect(()=>{const c=ve??nn();a?u.width>0&&u.height>0&&se(u.width/(l+1),u.height,c):H===null||B===null?u.width>0&&u.height>0&&se(u.width,u.height,c):se(H,B,c)},[H,B,u.width,u.height,ve,r,a,l]);const ee=Bt(u,{width:H??0,height:B??0},{allowUpscale:_.kind==="logical"&&_.allowUpscale}),k=ge?1:ee.scale;i.useEffect(()=>{On(k)},[k]);const b=d.safeArea,xe={"--volter-safe-area-inset-top":`${b?.top??0}px`,"--volter-safe-area-inset-right":`${b?.right??0}px`,"--volter-safe-area-inset-bottom":`${b?.bottom??0}px`,"--volter-safe-area-inset-left":`${b?.left??0}px`};return s.jsx("div",{style:{overflow:"hidden",position:"relative",flexDirection:"column",...e},children:s.jsxs("div",{ref:o,style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(()=>{const c=ft?s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{position:"absolute",inset:0,...r?{}:{visibility:"hidden"},...xe}},"game-mount-fill"):s.jsxs("div",{style:{position:"relative",width:ee.width,height:ee.height,overflow:"hidden",...r?{}:{visibility:"hidden"}},children:[s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{width:H??0,height:B??0,transformOrigin:"top left",transform:`scale(${k})`,...xe}}),b&&s.jsx("div",{"data-testid":"device-safe-area-overlay",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:2},children:[["top",b.top,{top:0,left:0,right:0,height:b.top*k}],["bottom",b.bottom,{bottom:0,left:0,right:0,height:b.bottom*k}],["left",b.left,{top:0,bottom:0,left:0,width:b.left*k}],["right",b.right,{top:0,bottom:0,right:0,width:b.right*k}]].map(([x,I,X])=>I>0?s.jsx("div",{"data-testid":`device-safe-area-${x}`,style:{position:"absolute",...X,background:h.semantic.dangerFaint,boxShadow:`inset 0 0 0 1px ${h.semantic.dangerMuted}`}},x):null)})]},"game-mount-device");return a?s.jsxs(s.Fragment,{children:[s.jsx(dt,{name:qe(0),testId:"game-instance-slot-0",focused:m===Me(),onFocus:()=>Ue(Me()),children:c}),Array.from({length:l},(x,I)=>s.jsx(Hn,{index:I},I))]}):c})(),!r&&s.jsxs("div",{"data-testid":"game-stopped-placeholder",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,background:h.surface.shell,color:h.content.dim,fontSize:11,pointerEvents:"none"},children:[s.jsx("span",{style:{color:h.content.primary,fontSize:13},children:"Game is stopped"}),s.jsx("span",{children:"Press Play to start the composed runtime."})]}),r&&s.jsx(fn,{explanation:A,testId:"game-surface-status",style:{zIndex:30,background:h.surface.shell}})]})})}function ke(){return Xe().map(({id:e,name:t})=>`${e}\0${t}`).join("")}function Wn({instanceId:e}){const t=K();i.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);const n=i.useSyncExternalStore(me,Y,Y),[,r]=i.useState(0);i.useEffect(()=>{const g=window.setInterval(()=>r(u=>u+1),250);return()=>window.clearInterval(g)},[]);const o=Ze(e),l=zt(),a=o?(o.loop.activeTimeouts??0)+(o.loop.activeIntervals??0)+(o.loop.activeAnimationFrames??0)+o.loop.pending:0,m=o?o.listeners.window+o.listeners.document:0,d=[["Mount",e],["Simulation",t.playState==="paused"?"Paused":"Running"],["Input",n===e?"Keyboard focus":"Inactive"],["Input events",o?`${o.loop.input??0} observed · ${o.loop.inputBlocked??0} blocked`:"Not measured"],["Network",l?l.getConnectionState?.()??"Not reported by this adapter":"Not registered"],["Owned callbacks",String(a)],["Owned listeners",String(m)],["Realm globals",String(o?.globals??0)],["Browser storage",o?`Shared origin · ${o.storage.local.reads+o.storage.session.reads} reads · ${o.storage.local.writes+o.storage.session.writes} writes`:"Shared origin"]];return s.jsx("div",{role:"none",style:{display:"grid",gridTemplateColumns:"112px minmax(120px, 1fr)",gap:"4px 12px",padding:"8px 10px",fontSize:10,lineHeight:"15px"},children:d.map(([g,u])=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("span",{style:{color:h.content.dim},children:g}),s.jsx("span",{style:{color:h.content.primary,fontFamily:g==="Mount"?h.typography.mono:void 0,overflow:"hidden",textOverflow:"ellipsis"},children:u})]},g))})}function Un(){i.useSyncExternalStore(Ke,ke,ke),i.useSyncExternalStore(_t,je,je);const e=Xe(),t=kt(),n=e.find(d=>d.id===t)??e[0],[r,o]=i.useState(!1),l=i.useRef(null);if(e.length<2||!n)return null;const m=(Ze(n.id)?.loop.firedWhileHeld??0)>0;return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:l,variant:"ghost",size:"compact","aria-haspopup":"menu","aria-expanded":r,onClick:()=>o(d=>!d),title:`Runtime instruments inspect ${n.name}; agent-addressed commands are unchanged`,children:[s.jsx(ue,{icon:Ft,size:"sm",style:{color:m?h.semantic.warning:void 0}}),s.jsxs($e,{variant:"code",children:["Inspect ",n.name]}),s.jsx(Ne,{direction:"down"})]}),r&&s.jsxs(Z,{anchorRef:l,gap:3,onDismiss:()=>o(!1),style:{minWidth:270},children:[e.map(d=>s.jsxs(G,{role:"menuitemradio","aria-checked":d.id===n.id,onSelect:()=>$t(d.id),children:[d.id===n.id?"✓ ":" ",d.name]},d.id)),s.jsx(Tt,{}),s.jsx(Wn,{instanceId:n.id})]})]})}let q=!1,ce=0,S=null,O=null,U=null,j=null,F=0;function Fe(){return q}function qn(e){e!==q&&(q=e,e?ce=requestAnimationFrame(pt):(cancelAnimationFrame(ce),U?.setDebugDrawEnabled?.(!1),Qn()))}function pt(){if(!q)return;ce=requestAnimationFrame(pt);const e=pe(),t=e?Oe(de().physics):null;if(t!==U&&(U?.setDebugDrawEnabled?.(!1),U=t,t?.setDebugDrawEnabled?.(!0)),Kn(e),!S||!e)return;const n=t?.contactPoints?.()??null;Xn(S,n)}function Kn(e){e!==O&&(O&&S&&O.remove(S),O=e,e&&(S||(S=new fe,S.name="physics-debug-draw",Ve(S,"editorHelper",!0)),e.add(S)))}function Xn(e,t){const n=t?t.length/3:0;if(!j){F=64;const l=new Qe;l.setAttribute("position",new Ce(new Float32Array(F*3),3));const a=new dn({color:16724821,size:10,sizeAttenuation:!1,depthTest:!1,transparent:!0,opacity:.95});j=new pn(l,a),j.renderOrder=999,j.frustumCulled=!1,e.add(j)}const r=j.geometry;if(n>F){for(;F<n;)F*=2;r.setAttribute("position",new Ce(new Float32Array(F*3),3))}const o=r.getAttribute("position");t&&n>0&&o.array.set(t),o.needsUpdate=!0,r.setDrawRange(0,n),j.visible=n>0}function Yn(){const e=pe(),n=(e?Oe(de().physics):null)?.debugDraw?.()??null;let r=!1;n&&e&&e.traverse(a=>{a===n&&(r=!0)});const o=n?.geometry.getAttribute("position"),l=j?.geometry.drawRange.count??0;return{enabled:q,wireframeInScene:r,wireframeVisible:n?.visible??!1,wireframeVertexCount:o?.count??0,contactMarkerCount:j?.visible&&Number.isFinite(l)?l:0}}typeof window<"u"&&(window.__volterPhysicsDebug=Yn);function Qn(){S&&(O?.remove(S),j&&(j.geometry.dispose(),j.material.dispose()),S.clear()),j=null,F=0,S=null,O=null,U=null}function Zn(){const[e,t]=i.useState(!1),n=i.useRef(null);return s.jsxs("div",{style:{position:"relative"},children:[s.jsxs(L,{ref:n,type:"button",variant:"outline",size:"compact","data-testid":"game-debug-menu","aria-haspopup":"menu","aria-expanded":e,"aria-controls":e?"volter-game-debug-menu":void 0,onClick:()=>t(r=>!r),children:[s.jsx("span",{children:"Debug"}),s.jsx(Ne,{direction:"down"})]}),e&&s.jsxs(Z,{id:"volter-game-debug-menu",anchorRef:n,gap:3,onDismiss:()=>t(!1),style:{minWidth:190},children:[s.jsxs(G,{onClick:()=>{_n(!_e()),V()},children:[_e()?"✓ ":" ","Crowd debug draw"]}),s.jsxs(G,{onClick:()=>{qn(!Fe()),V()},children:[Fe()?"✓ ":" ","Physics debug draw"]})]})]})}function Jn(e){const t=i.useSyncExternalStore(Te,ze),n=K();return i.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(Be,We),s.jsxs("div",{"data-testid":"game-doc-toolbar",style:{display:"grid",alignItems:"center",gridTemplateColumns:"minmax(0, 1fr) auto minmax(0, 1fr)",width:"100%",gap:6,padding:"2px 8px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,overflow:"auto"},children:[s.jsx(Un,{}),s.jsx(Tn,{onPresetChange:r=>{ct(r),V()}}),s.jsx(Wt,{resolution:lt(it(),t?.config.resolution),options:Nn(t?.config.resolution),onResolutionChange:r=>{He(sn),at(r)},scale:Gn(),title:"Change game resolution"}),s.jsx(Zn,{}),n.playState!=="stopped"&&s.jsx(zn,{})]}),s.jsx(Lt,{placement:"runtime"}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",minWidth:0},children:s.jsx(En,{})})]})}function es(e){const t=K();i.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot);const n=t.playState!=="stopped";return s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[s.jsx(Bn,{style:{flex:1,position:"relative",display:"flex",flexDirection:"column",pointerEvents:"auto",...t.playState==="playing"?{outline:`2px solid ${h.semantic.success}`,outlineOffset:-2}:n?{outline:`2px solid ${h.semantic.warning}`,outlineOffset:-2}:{}}}),t.playState==="paused"&&s.jsx("div",{"data-testid":"game-paused-notice",style:{position:"absolute",left:"50%",top:12,transform:"translateX(-50%)",padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,.72)",color:h.content.primary,fontSize:12,letterSpacing:".04em",pointerEvents:"none",zIndex:2},children:"Paused by the editor — press ▶ Play to resume (Escape pauses)"})]})}const To="workspace.service";function zo(){return oe().workspace.liveDocument.register({Content:es,Toolbar:Jn})}export{To as point,zo as start};
@@ -1,2 +1,2 @@
1
- import{createGameModuleResolver as k,setFocusedInstanceProvider as M}from"./game-module-access-DcIMKmZ-.js";import{n as d}from"./command-results-CUQD49AB.js";import{i as g}from"./active-ingest-DCi6B_Mk.js";import{a as y,u as h,v as w}from"./game-network-BRvp9Eya.js";import"./index-Bn8WGRJh.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"./game-contract-seams-Bk8NMwX4.js";import"./capability-coverage-4xMPa566.js";import"./ingest-source-persistence-C-gTDfvH.js";import"./contract-system-adapters-CEuzOynM.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-C_1Fna30.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B6pk-yrQ.js";import"./seeded-random-BMbOsD5m.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-H6S9jMp9.js";import"./edit-mode-authoring-D4gF7ToY.js";import"./json-history-resource-DiN_PLbn.js";import"./binding-resolver-CqJs8FS9.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-ugwrIrZB.js";import"./canvas-entry-runtime-C4V45HMi.js";import"./three-ingest-runtime-BsCSoTG8.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-h3E0Xsra.js";import"./mounted-authoring-Cjmi_MYm.js";import"./entity-object-B77fPnTJ.js";import"./user-data-DX18I5LS.js";import"./workspace-arrangement-Dg7zIkwR.js";import"./three-contract-Dkt6PmWY.js";import"./three-BiLYjlR0.js";import"./editor-layers-BGId-Uru.js";import"./component-instance-root-CgmR0Q36.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DlqC-T90.js";import"./source-persistence-backend-B2YaNBbK.js";import"./three-projection-core-C0R8NXF5.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BATEkxoi.js";import"./deferred-ingest-play-GNKwMor5.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BUU8rhRd.js";import"./board-guides-CFM0Dzzw.js";import"./relative-import-specifier-CbIyU_9J.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C1HaQduW.js";import"./inference-diagnostics-BPtSODNJ.js";import"./writer-tw6EcuVO.js";import"./three-state-28vYMAez.js";import"./editor-shell-store-DhM6KcjO.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-C_XkG4b1.js";import"./game-surface-defaults-D8S4cRxi.js";class E extends Error{member;supported;constructor(e,r,o){super(`playwright-shim: ${e}.${r} is not supported by the in-page shim. Supported ${e} members: ${o.join(", ")}. This shim is DOM-only — canvas gameplay input must use game.input.*, while React-only DOM games may use Page keyboard/locator input. See packages/editor-game/src/host/playwright-shim.ts for the full supported subset and the wire's closure-capture limitation.`),this.name="PageShimUnsupportedError",this.member=r,this.supported=o}}function v(t,e){const r=Object.keys(t);return new Proxy(t,{get(o,i,n){if(typeof i=="symbol"||i in o)return Reflect.get(o,i,n);throw new E(e,i,r)}})}function m(t){return t.replace(/\s+/g," ").trim()}function O(t){const e=t.tagName.toLowerCase();if(e==="button")return"button";if(e==="a"&&t.hasAttribute("href"))return"link";if(/^h[1-6]$/.test(e))return"heading";if(e==="textarea")return"textbox";if(e==="select")return"combobox";if(e==="img")return"img";if(e==="input"){const r=(t.getAttribute("type")??"text").toLowerCase();return r==="button"||r==="submit"||r==="reset"?"button":r==="checkbox"?"checkbox":r==="radio"?"radio":"textbox"}return null}function b(t){return t.getAttribute("role")??O(t)}function S(t){const e=t.getAttribute("aria-label");return e&&e.trim()?m(e):m(t.textContent??"")}function T(t,e){if(e===void 0)return!0;const r=S(t);return e instanceof RegExp?e.test(r):r===e}function x(t,e,r){return Array.from(t.querySelectorAll("*")).filter(i=>b(i)===e&&T(i,r?.name))}function I(t,e){const r=Array.from(t.querySelectorAll("*")).filter(n=>n.tagName!=="SCRIPT"&&n.tagName!=="STYLE"),o=n=>{const s=m(n.textContent??"");return s.length===0?!1:e instanceof RegExp?e.test(s):s.includes(e)},i=r.filter(o);return i.filter(n=>!i.some(s=>s!==n&&n.contains(s)))}function C(t,e){return Array.from(t.querySelectorAll("[data-testid]")).filter(r=>{const o=r.getAttribute("data-testid")??"";return e instanceof RegExp?e.test(o):o===e})}function L(t){if(!(t instanceof HTMLElement))return!0;if(t.hidden)return!1;const e=getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"}function _(t){const e=t.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r=e.left+e.width/2,o=e.top+e.height/2,i={bubbles:!0,cancelable:!0,clientX:r,clientY:o,button:0};typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mousedown",i)),typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mouseup",i)),t.dispatchEvent(new MouseEvent("click",i))}function N(t){const e=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(e,"value");return o=>{r?.set?r.set.call(t,o):t.value=o}}function G(t,e){if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement))throw new Error(`playwright-shim: fill() target is not an <input>/<textarea> (got <${t.tagName.toLowerCase()}>)`);t.focus(),N(t)(e),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}const l=new Set(["Alt","Control","Meta","Shift"]);function p(t){return t!=="ControlOrMeta"?t:/Mac|iPhone|iPad/.test(navigator.platform)?"Meta":"Control"}function B(t){return/^[a-z]$/i.test(t)?`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?`Digit${t}`:t===" "?"Space":t}function K(t){const e=document.activeElement;return e instanceof HTMLElement&&t.contains(e)?e:t}function f(t,e,r,o){K(t).dispatchEvent(new KeyboardEvent(e,{key:r,code:B(r),bubbles:!0,cancelable:!0,altKey:o.has("Alt"),ctrlKey:o.has("Control"),metaKey:o.has("Meta"),shiftKey:o.has("Shift")}))}function F(t){const e=new Set,r=async i=>{const n=p(i);e.add(n),f(t,"keydown",n,e)},o=async i=>{const n=p(i);f(t,"keyup",n,e),e.delete(n)};return{down:r,up:o,async press(i){const n=i.split("+").map(p),s=n.filter(c=>l.has(c)),a=n.find(c=>!l.has(c));for(const c of s)await r(c);a&&(await r(a),await o(a));for(const c of s.reverse())await o(c)}}}function R(t){const e=[];function r(o,i){const n=b(o);if(n){const a=S(o);e.push(`${" ".repeat(i)}- ${n}${a?` "${a}"`:""}`)}const s=n?i+1:i;for(const a of Array.from(o.children))r(a,s)}for(const o of Array.from(t.children))r(o,0);return e.join(`
1
+ import{createGameModuleResolver as k,setFocusedInstanceProvider as M}from"./game-module-access-CpqKQme4.js";import{n as d}from"./command-results-CUQD49AB.js";import{i as g}from"./active-ingest-CEa53vF0.js";import{a as y,u as h,v as w}from"./game-network-1JI7uhYb.js";import"./index-DMsonpRx.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"./game-contract-seams-6S6C0ztA.js";import"./capability-coverage-BW0jhUWf.js";import"./ingest-source-persistence-B0NaYeRY.js";import"./contract-system-adapters-Cgl3IHIO.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BAc7TBPq.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DWXKHjIJ.js";import"./seeded-random-MSFUDgJ4.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-DWfBuVx7.js";import"./edit-mode-authoring-DbOPyppg.js";import"./json-history-resource-BF-O43PD.js";import"./binding-resolver-CTLBEZNC.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CoCivh2s.js";import"./canvas-entry-runtime-CB0dWiqf.js";import"./three-ingest-runtime-Cw0ElzJG.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DtrhPv-6.js";import"./mounted-authoring-D8pHcD_a.js";import"./entity-object-S9jvlW_s.js";import"./user-data-BsgiyhZb.js";import"./workspace-arrangement-CHzaISez.js";import"./three-contract-Dkt6PmWY.js";import"./three-CKv5ucoa.js";import"./editor-layers-C-4kqPi7.js";import"./component-instance-root-CuhMBeTq.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C7fn0FHE.js";import"./source-persistence-backend-cM6_hFF1.js";import"./three-projection-core-D26OWHpV.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DrjAxMEm.js";import"./deferred-ingest-play-Ck7KAYWK.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CI1sk6F6.js";import"./board-guides-DvGa-v8v.js";import"./relative-import-specifier-C6rJbXKw.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-D4blh5_a.js";import"./inference-diagnostics-CUavJjuI.js";import"./writer-tw6EcuVO.js";import"./three-state-TqrpCspu.js";import"./editor-shell-store-BqJU8Lu8.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-D7E51csI.js";import"./game-surface-defaults-D8S4cRxi.js";class E extends Error{member;supported;constructor(e,r,o){super(`playwright-shim: ${e}.${r} is not supported by the in-page shim. Supported ${e} members: ${o.join(", ")}. This shim is DOM-only — canvas gameplay input must use game.input.*, while React-only DOM games may use Page keyboard/locator input. See packages/editor-game/src/host/playwright-shim.ts for the full supported subset and the wire's closure-capture limitation.`),this.name="PageShimUnsupportedError",this.member=r,this.supported=o}}function v(t,e){const r=Object.keys(t);return new Proxy(t,{get(o,i,n){if(typeof i=="symbol"||i in o)return Reflect.get(o,i,n);throw new E(e,i,r)}})}function m(t){return t.replace(/\s+/g," ").trim()}function O(t){const e=t.tagName.toLowerCase();if(e==="button")return"button";if(e==="a"&&t.hasAttribute("href"))return"link";if(/^h[1-6]$/.test(e))return"heading";if(e==="textarea")return"textbox";if(e==="select")return"combobox";if(e==="img")return"img";if(e==="input"){const r=(t.getAttribute("type")??"text").toLowerCase();return r==="button"||r==="submit"||r==="reset"?"button":r==="checkbox"?"checkbox":r==="radio"?"radio":"textbox"}return null}function b(t){return t.getAttribute("role")??O(t)}function S(t){const e=t.getAttribute("aria-label");return e&&e.trim()?m(e):m(t.textContent??"")}function T(t,e){if(e===void 0)return!0;const r=S(t);return e instanceof RegExp?e.test(r):r===e}function x(t,e,r){return Array.from(t.querySelectorAll("*")).filter(i=>b(i)===e&&T(i,r?.name))}function I(t,e){const r=Array.from(t.querySelectorAll("*")).filter(n=>n.tagName!=="SCRIPT"&&n.tagName!=="STYLE"),o=n=>{const s=m(n.textContent??"");return s.length===0?!1:e instanceof RegExp?e.test(s):s.includes(e)},i=r.filter(o);return i.filter(n=>!i.some(s=>s!==n&&n.contains(s)))}function C(t,e){return Array.from(t.querySelectorAll("[data-testid]")).filter(r=>{const o=r.getAttribute("data-testid")??"";return e instanceof RegExp?e.test(o):o===e})}function L(t){if(!(t instanceof HTMLElement))return!0;if(t.hidden)return!1;const e=getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"}function _(t){const e=t.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r=e.left+e.width/2,o=e.top+e.height/2,i={bubbles:!0,cancelable:!0,clientX:r,clientY:o,button:0};typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mousedown",i)),typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mouseup",i)),t.dispatchEvent(new MouseEvent("click",i))}function N(t){const e=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(e,"value");return o=>{r?.set?r.set.call(t,o):t.value=o}}function G(t,e){if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement))throw new Error(`playwright-shim: fill() target is not an <input>/<textarea> (got <${t.tagName.toLowerCase()}>)`);t.focus(),N(t)(e),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}const l=new Set(["Alt","Control","Meta","Shift"]);function p(t){return t!=="ControlOrMeta"?t:/Mac|iPhone|iPad/.test(navigator.platform)?"Meta":"Control"}function B(t){return/^[a-z]$/i.test(t)?`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?`Digit${t}`:t===" "?"Space":t}function K(t){const e=document.activeElement;return e instanceof HTMLElement&&t.contains(e)?e:t}function f(t,e,r,o){K(t).dispatchEvent(new KeyboardEvent(e,{key:r,code:B(r),bubbles:!0,cancelable:!0,altKey:o.has("Alt"),ctrlKey:o.has("Control"),metaKey:o.has("Meta"),shiftKey:o.has("Shift")}))}function F(t){const e=new Set,r=async i=>{const n=p(i);e.add(n),f(t,"keydown",n,e)},o=async i=>{const n=p(i);f(t,"keyup",n,e),e.delete(n)};return{down:r,up:o,async press(i){const n=i.split("+").map(p),s=n.filter(c=>l.has(c)),a=n.find(c=>!l.has(c));for(const c of s)await r(c);a&&(await r(a),await o(a));for(const c of s.reverse())await o(c)}}}function R(t){const e=[];function r(o,i){const n=b(o);if(n){const a=S(o);e.push(`${" ".repeat(i)}- ${n}${a?` "${a}"`:""}`)}const s=n?i+1:i;for(const a of Array.from(o.children))r(a,s)}for(const o of Array.from(t.children))r(o,0);return e.join(`
2
2
  `)}function u(t,e){const r=i=>{const n=t()[0];if(!n)throw new Error(`playwright-shim: ${i}() found no element for ${e}`);return n};return v({async click(){_(r("click"))},async fill(i){G(r("fill"),i)},async textContent(){const i=t()[0];return i?i.textContent??null:null},async evaluate(i,n){return i(r("evaluate"),n)},async count(){return t().length},async waitFor(i){const n=i?.timeout??5e3,s=i?.state??"visible",a=Date.now()+n;for(;;){const c=t()[0];if(c&&(s==="attached"||L(c)))return;if(Date.now()>=a)throw new Error(`playwright-shim: waitFor() timed out after ${n}ms waiting for ${e} to be ${s}`);await new Promise(P=>setTimeout(P,50))}},first(){return u(()=>t().slice(0,1),`${e}.first()`)},nth(i){return u(()=>{const n=t()[i];return n?[n]:[]},`${e}.nth(${i})`)},async ariaSnapshot(){return R(r("ariaSnapshot"))}},"Locator")}async function D(t,e){if(typeof t=="function")return t(e);if(typeof t=="string")return new Function("arg",`return (${t})(arg)`)(e);throw new Error("playwright-shim: evaluate() requires a function or a function-source string")}function A(t){const e={keyboard:F(t),evaluate:async(r,o)=>D(r,o),locator:r=>u(()=>Array.from(t.querySelectorAll(r)),`locator(${JSON.stringify(r)})`),getByRole:(r,o)=>u(()=>x(t,r,o),`getByRole(${JSON.stringify(r)}${o?.name!==void 0?`, {name: ${JSON.stringify(String(o.name))}}`:""})`),getByText:r=>u(()=>I(t,r),`getByText(${JSON.stringify(String(r))})`),getByTestId:r=>u(()=>C(t,r),`getByTestId(${JSON.stringify(String(r))})`),click:async r=>{await e.locator(r).click()},fill:async(r,o)=>{await e.locator(r).fill(o)},ariaSnapshot:async()=>R(t)};return v(e,"Page")}const he="workspace.command";typeof window<"u"&&(M(w),window.__volterGameEval=async(t,e)=>{const r=await $({src:t,...e===void 0?{}:{instance:e}});if(!r.ok)throw new Error(r.error??"game-eval failed");return r.data?.result??null});async function $(t){if(!y()&&!g())return d();const e=t.src;if(typeof e!="string")return{ok:!1,error:`game-eval requires a string "src" (the step's toString())`};const r=h();if(!r)return{ok:!1,error:"game-eval: no play-mode game container is mounted yet",data:{code:"GAME_EVAL_ERROR"}};const o=t.instance,i=typeof o=="string"?o:void 0;let n;try{n=new Function("scope",`return (${e})(scope)`)}catch(a){return{ok:!1,error:`game-eval: failed to reconstruct the step function from source — ${a instanceof Error?a.message:String(a)}`,data:{code:"GAME_EVAL_ERROR"}}}const s={page:A(r),modules:k(i),instanceId:i??w()};try{const a=await n(s),c=a===void 0?null:a;try{JSON.stringify(c)}catch{return{ok:!1,error:`game-eval: the step returned an unserializable value (${Object.prototype.toString.call(c)}) — return plain data (numbers, strings, arrays, plain objects), not live module objects.`,data:{code:"GAME_EVAL_UNSERIALIZABLE"}}}return{ok:!0,data:{result:c}}}catch(a){return{ok:!1,error:`game-eval step failed: ${a instanceof Error?a.stack??a.message:String(a)}`,data:{code:"GAME_EVAL_ERROR"}}}}async function H(t){if(!y()&&!g())return d();const e=t.src;if(typeof e!="string")return{ok:!1,error:`page-script requires a string "src" (the step's toString())`};const r=h();if(!r)return{ok:!1,error:"page-script: no play-mode game container is mounted yet",data:{code:"PAGE_SCRIPT_ERROR"}};let o;try{o=new Function("page",`return (${e})(page)`)}catch(n){return{ok:!1,error:`page-script: failed to reconstruct the step function from source — ${n instanceof Error?n.message:String(n)}`,data:{code:"PAGE_SCRIPT_ERROR"}}}const i=A(r);try{const n=await o(i);return{ok:!0,data:{result:n===void 0?null:n}}}catch(n){return n instanceof E?{ok:!1,error:n.message,data:{code:"PAGE_SHIM_UNSUPPORTED",member:n.member,supported:[...n.supported]}}:{ok:!1,error:`page-script: step threw — ${n instanceof Error?n.message:String(n)}`,data:{code:"PAGE_SCRIPT_ERROR"}}}}const we={"game-eval":{timeoutMs:6e4,derivedRefresh:"always",handle:$},"page-script":{timeoutMs:6e4,derivedRefresh:"always",handle:H}};export{we as commands,he as point};
@@ -1 +1 @@
1
- import{B as d}from"./index-Bn8WGRJh.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 l="volter-mount";let i=null;function u(t){return globalThis.__volterGameModuleUrls?.(t)??[]}function S(t){i=t}function h(t){const o=t.replace(/^\/+/,"");if(!o.startsWith("src/")||/[?#]/.test(o))throw new Error(`modules("${t}"): pass the project-relative served path, starting "src/" with its real extension and no query — e.g. modules("src/sim/host.ts").`);return o}function m(t){const o=u(t).flatMap(r=>{const{pathname:e,searchParams:a}=new URL(r);if(a.get(l)!==t)return[];const s=e.lastIndexOf("/src/");return s===-1?[]:[e.slice(s+1)]});return[...new Set(o)].sort()}function b(t){const o=r=>p(r,w(r,t));return Object.defineProperty(o,"loaded",{enumerable:!0,get:()=>{const r=t??i?.();return r?m(r):[]}}),o}const f=new Set(["then","catch","finally","constructor","toJSON"]);function p(t,o){return new Proxy(o,{get(r,e){if(e==="then"||e==="catch"||e==="finally")return Reflect.get(r,e).bind(r);if(typeof e=="symbol"||f.has(e))return Reflect.get(r,e);throw new Error(`modules("${t}") returns a PROMISE — it dynamic-imports the running mount's own copy of that module — so \`.${String(e)}\` reads a promise, not your export. Await it: \`const m = await modules("${t}"); m.${String(e)}\` (and make the \`game.run\` callback \`async\`).`)}})}async function w(t,o){const r=h(t),e=o??i?.();if(!e)throw new Error(`modules(): no play instance is mounted — enter Play first (${d("play")}).`);const a=`/${r}`,s=u(e).find(n=>{const c=new URL(n);return c.pathname.endsWith(a)&&c.searchParams.get(l)===e});if(!s){const n=m(e);throw new Error(`modules("${t}"): the running mount has not loaded that module (nothing to reach — a module the game never imported has no live instance). Loaded project modules (also readable as modules.loaded): ${n.join(", ")||"(none yet — play first)"}`)}try{return await import(s)}catch(n){throw new Error(`modules("${t}") could not load ${s} — the path must be the exact served file (check the extension: .ts vs .tsx). ${n instanceof Error?n.message:String(n)}`)}}export{b as createGameModuleResolver,w as importGameModule,m as loadedGameModulePaths,h as normalizeGameModulePath,S as setFocusedInstanceProvider};
1
+ import{B as d}from"./index-DMsonpRx.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 l="volter-mount";let i=null;function u(t){return globalThis.__volterGameModuleUrls?.(t)??[]}function S(t){i=t}function h(t){const o=t.replace(/^\/+/,"");if(!o.startsWith("src/")||/[?#]/.test(o))throw new Error(`modules("${t}"): pass the project-relative served path, starting "src/" with its real extension and no query — e.g. modules("src/sim/host.ts").`);return o}function m(t){const o=u(t).flatMap(r=>{const{pathname:e,searchParams:a}=new URL(r);if(a.get(l)!==t)return[];const s=e.lastIndexOf("/src/");return s===-1?[]:[e.slice(s+1)]});return[...new Set(o)].sort()}function b(t){const o=r=>p(r,w(r,t));return Object.defineProperty(o,"loaded",{enumerable:!0,get:()=>{const r=t??i?.();return r?m(r):[]}}),o}const f=new Set(["then","catch","finally","constructor","toJSON"]);function p(t,o){return new Proxy(o,{get(r,e){if(e==="then"||e==="catch"||e==="finally")return Reflect.get(r,e).bind(r);if(typeof e=="symbol"||f.has(e))return Reflect.get(r,e);throw new Error(`modules("${t}") returns a PROMISE — it dynamic-imports the running mount's own copy of that module — so \`.${String(e)}\` reads a promise, not your export. Await it: \`const m = await modules("${t}"); m.${String(e)}\` (and make the \`game.run\` callback \`async\`).`)}})}async function w(t,o){const r=h(t),e=o??i?.();if(!e)throw new Error(`modules(): no play instance is mounted — enter Play first (${d("play")}).`);const a=`/${r}`,s=u(e).find(n=>{const c=new URL(n);return c.pathname.endsWith(a)&&c.searchParams.get(l)===e});if(!s){const n=m(e);throw new Error(`modules("${t}"): the running mount has not loaded that module (nothing to reach — a module the game never imported has no live instance). Loaded project modules (also readable as modules.loaded): ${n.join(", ")||"(none yet — play first)"}`)}try{return await import(s)}catch(n){throw new Error(`modules("${t}") could not load ${s} — the path must be the exact served file (check the extension: .ts vs .tsx). ${n instanceof Error?n.message:String(n)}`)}}export{b as createGameModuleResolver,w as importGameModule,m as loadedGameModulePaths,h as normalizeGameModulePath,S as setFocusedInstanceProvider};