@volter/game-editor 0.5.67 → 0.5.69

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 (568) hide show
  1. package/BUNDLED_NOTICES +10954 -5077
  2. package/LICENSE +1 -1
  3. package/LICENSE-BLENDER +2 -2
  4. package/NOTICE +2 -2
  5. package/additions/canvas/package.json +8 -0
  6. package/additions/canvas/src/canvas-mount.ts +46 -0
  7. package/additions/canvas/src/scene2d.tsx +18 -0
  8. package/catalog/entries/bake.json +1 -1
  9. package/catalog/entries/blender.json +3 -3
  10. package/catalog/entries/music.json +6 -6
  11. package/catalog/project-source/LICENSE +1 -1
  12. package/catalog/project-source/src/contributions/bake.kind.ts +2 -2
  13. package/catalog/project-source/src/contributions/builder-document.tsx +1 -1
  14. package/catalog/project-source/src/contributions/builder-ui.tsx +3 -3
  15. package/catalog/project-source/src/contributions/module-source.ts +4 -4
  16. package/catalog/project-source/src/lib/music/music-player.ts +18 -12
  17. package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +59 -59
  18. package/catalog/project-source/src/lib/static-batch/Frozen.tsx +1 -1
  19. package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +1 -1
  20. package/catalog/project-source/src/tools/bake-preview.tool.ts +9 -9
  21. package/dist/.vite/manifest.json +4106 -3965
  22. package/dist/assets/{AssetBudgetPanel-x_FNJbfZ.js → AssetBudgetPanel-BMR3AQhc.js} +10 -10
  23. package/dist/assets/AudioViewer-DESxi7pU.js +1 -0
  24. package/dist/assets/CanvasBoardDocument-Q_nrYFlB.js +1 -0
  25. package/dist/assets/CanvasSceneViewport-WZMoKy_F.js +1 -0
  26. package/dist/assets/ColorInput-C2EK-OnD.js +1 -0
  27. package/dist/assets/{EntityModelDocument-CzUHsH9E.js → EntityModelDocument-B_4ENTCq.js} +1 -1
  28. package/dist/assets/{EnvironmentAssetDocument-ByEB7_4A.js → EnvironmentAssetDocument-BZBp6OFJ.js} +1 -1
  29. package/dist/assets/{GameplaySessionTimeline-dhG-oiqd.js → GameplaySessionTimeline-1ivaucpv.js} +1 -1
  30. package/dist/assets/ImageViewer-D16OExYu.js +1 -0
  31. package/dist/assets/{InspectorCanvasPreview-CEr_Kxna.js → InspectorCanvasPreview-BrFjhoiD.js} +1 -1
  32. package/dist/assets/InspectorObjectPreview-CY5xVsPR.js +1 -0
  33. package/dist/assets/JsonAssetDocument-CvjTlcdr.js +2 -0
  34. package/dist/assets/{LiveModuleDocument-DL8QHSlk.js → LiveModuleDocument-ne1o9giX.js} +1 -1
  35. package/dist/assets/{LutAssetDocument-BImiug2M.js → LutAssetDocument-Cp0v-O7q.js} +1 -1
  36. package/dist/assets/ModelAssetDocument-Ceu7OIN9.js +1 -0
  37. package/dist/assets/{NonThreeAuthoringBootstrap-B40qmGGS.js → NonThreeAuthoringBootstrap-DiElZf-e.js} +1 -1
  38. package/dist/assets/Object3DDocumentToolbar-BLNamqii.js +1 -0
  39. package/dist/assets/Object3DDocumentViewport-D6QoHfa_.js +2 -0
  40. package/dist/assets/{Object3DPreview-ClYDoH2L.js → Object3DPreview-ZVokr044.js} +1 -1
  41. package/dist/assets/OnlineAssetDetail-Dnckd7zB.js +1 -0
  42. package/dist/assets/PlayBar-DsMitSgy.js +1 -0
  43. package/dist/assets/{QuarksAssetDocument-B-VOj-n4.js → QuarksAssetDocument-B5J8uHFM.js} +1 -1
  44. package/dist/assets/ReactCanvasControls-CmfvxJYY.js +1 -0
  45. package/dist/assets/RootSelectionOverlay-BWsNiSuM.js +1 -0
  46. package/dist/assets/{ShaderAssetDocument-Kn8IvRGV.js → ShaderAssetDocument-CT7XzsZq.js} +5 -5
  47. package/dist/assets/ShadowEditor-YO5KEfnz.js +1 -0
  48. package/dist/assets/{SourceAssetViewer-CLQ95VSD.js → SourceAssetViewer-FSLup2km.js} +1 -1
  49. package/dist/assets/StageHost-DYfGYwvq.js +2 -0
  50. package/dist/assets/{StoryPreviewMount-D2lg37et.js → StoryPreviewMount-BhvT5QlB.js} +1 -1
  51. package/dist/assets/ThreeBoardDocument-B-z2nwnH.js +2 -0
  52. package/dist/assets/{ThreeIsolationSceneContent-DbYIylZQ.js → ThreeIsolationSceneContent-B5pU4Y6k.js} +1 -1
  53. package/dist/assets/{ToolObject3DPreview-WEi6C9uU.js → ToolObject3DPreview-VtraiQ4Q.js} +1 -1
  54. package/dist/assets/Toolbar-M62Gob9T.js +1 -0
  55. package/dist/assets/{TransientHint-BpDLhRLd.js → TransientHint-Cc40mHWE.js} +1 -1
  56. package/dist/assets/VideoViewer-BxcUwXQm.js +1 -0
  57. package/dist/assets/ViewportShadingMenu-BoMPnTVh.js +1 -0
  58. package/dist/assets/active-ingest-0QjJWb7i.js +3 -0
  59. package/dist/assets/{animation-clock-Bm80XdqP.js → animation-clock-BXEwUJtz.js} +1 -1
  60. package/dist/assets/animation-mixers.service-C-Ko4KzM.js +1 -0
  61. package/dist/assets/animation-timeline.utility-Bl15-rYb.js +1 -0
  62. package/dist/assets/{asset-budget-asset.menu-CEgP0Kiw.js → asset-budget-asset.menu-BUa3g0Wy.js} +1 -1
  63. package/dist/assets/{asset-budget.action-D4R1c3wi.js → asset-budget.action-Dl5eVPIo.js} +1 -1
  64. package/dist/assets/{asset-budget.document-Syzjn1U1.js → asset-budget.document-DJylQ-0h.js} +1 -1
  65. package/dist/assets/{asset-budget.menu-BbRiqXeM.js → asset-budget.menu-BJtvNMLj.js} +1 -1
  66. package/dist/assets/asset-editor-persistence-BIbf5u0Q.js +1 -0
  67. package/dist/assets/asset-loaders-DoNflsHL.js +2 -0
  68. package/dist/assets/{asset-preview-B1tDziF1.js → asset-preview-DxlSdRZn.js} +1 -1
  69. package/dist/assets/{audio-unlock.service-ucMfCVBw.js → audio-unlock.service-CTaiyXF9.js} +1 -1
  70. package/dist/assets/audio.utility-CEmNc68t.js +1 -0
  71. package/dist/assets/autoplay.service-BZLSUyL8.js +1 -0
  72. package/dist/assets/{babylon-authoring-adapter-C8mFMXSr.js → babylon-authoring-adapter-BZvV2bz_.js} +1 -1
  73. package/dist/assets/binding-resolver-DGbk9_XR.js +2 -0
  74. package/dist/assets/blender-emscripten-engine-B7lfg-RX.js +2 -0
  75. package/dist/assets/{blender-node-editor.document-C1YmwWls.js → blender-node-editor.document-wXJobGNH.js} +1 -1
  76. package/dist/assets/{blender-properties-tab-B8lyjgj3.js → blender-properties-tab-7GFf80ev.js} +1 -1
  77. package/dist/assets/{blender-runtime-host-CyQlImSR.js → blender-runtime-host-CILxrx5T.js} +2 -2
  78. package/dist/assets/{blender-runtime-skin-BK7ShZ6z.js → blender-runtime-skin-Cd5lQYsC.js} +7 -7
  79. package/dist/assets/{blender-runtime.document-B0nVQs0P.js → blender-runtime.document-C0r_R49S.js} +7 -7
  80. package/dist/assets/{blender-timeline.document-CMcdE2CK.js → blender-timeline.document-BaISZMBc.js} +1 -1
  81. package/dist/assets/{blender-uv-editor.document-CjqNo4sZ.js → blender-uv-editor.document-CT_fsyyA.js} +1 -1
  82. package/dist/assets/blender-version.status-DzEx7u7k.js +1 -0
  83. package/dist/assets/blender-wali-engine-DOiQCBXH.js +2 -0
  84. package/dist/assets/{blender.command-C6NmRBo5.js → blender.command-DdiKd8mZ.js} +1 -1
  85. package/dist/assets/blender.keymap-BmOBRY7p.js +1 -0
  86. package/dist/assets/blender.status-BMETIbb2.js +1 -0
  87. package/dist/assets/board-guides-CjHQ9Ynm.js +1 -0
  88. package/dist/assets/body-marks-C1LxJtQb.js +1 -0
  89. package/dist/assets/bridge.command-DXUeavn5.js +3 -0
  90. package/dist/assets/{browserAll-lF_dLQVz.js → browserAll-Dg46xT22.js} +1 -1
  91. package/dist/assets/build-player.document-BHwVV3K0.js +1 -0
  92. package/dist/assets/build-profiles.document-HkpS-Kxa.js +2 -0
  93. package/dist/assets/build-progress.status-u1J0Rm1D.js +1 -0
  94. package/dist/assets/build-session-BLboUUbw.js +9 -0
  95. package/dist/assets/{build.action-DRX2IcYt.js → build.action-C00DL83N.js} +1 -1
  96. package/dist/assets/{build.command-BGvLaLG0.js → build.command-Cjk_NY75.js} +1 -1
  97. package/dist/assets/build.header-BWNmNWFT.js +1 -0
  98. package/dist/assets/{build.menu-UenrjPWS.js → build.menu-BBYtqCIq.js} +1 -1
  99. package/dist/assets/{build.service-BIUoTY6l.js → build.service-DOU15tKN.js} +1 -1
  100. package/dist/assets/{camera-DrvaM47S.js → camera-7DGyYW7Y.js} +1 -1
  101. package/dist/assets/{camera-runtime.inspector-CjJALNO8.js → camera-runtime.inspector-n-jiOR-3.js} +1 -1
  102. package/dist/assets/canvas-design-mount-CSRHU-ag.js +6 -0
  103. package/dist/assets/canvas-entry-runtime-BST8yRuK.js +2 -0
  104. package/dist/assets/{canvas-preview-frames-C0QTagA3.js → canvas-preview-frames-Cja32aW2.js} +1 -1
  105. package/dist/assets/{canvas-story-capture.service-Dgjr-rT1.js → canvas-story-capture.service-D5R5HJ8n.js} +2 -2
  106. package/dist/assets/capability-coverage-ByWftxk4.js +7 -0
  107. package/dist/assets/{collaboration-presence-BVIQuN1l.js → collaboration-presence-D6MC9xJN.js} +1 -1
  108. package/dist/assets/{collider-C7SbIYKY.js → collider-B78EcUc9.js} +1 -1
  109. package/dist/assets/{component-board.service-BEsFAw4_.js → component-board.service-BaQI5Oas.js} +2 -2
  110. package/dist/assets/component-board.service-CkjrsD8x.js +2 -0
  111. package/dist/assets/{component-board.service-CWFaGMCO.js → component-board.service-Dvjz_g-x.js} +2 -2
  112. package/dist/assets/component-contracts.service-C3-AXQp7.js +1 -0
  113. package/dist/assets/component-instance-root-DLI40MiB.js +1 -0
  114. package/dist/assets/{component-verbs.command-oNtGgzQL.js → component-verbs.command-Brr_WcaR.js} +1 -1
  115. package/dist/assets/component-verbs.service-DC2sC3j3.js +1 -0
  116. package/dist/assets/{config-_wCzzlM_.js → config-BI_7osdR.js} +3 -3
  117. package/dist/assets/{configurations-BXU4GGbV.js → configurations-XP9YLkrt.js} +1 -1
  118. package/dist/assets/connection.status-BhRwcFx0.js +1 -0
  119. package/dist/assets/{constraint-5KLYpGm7.js → constraint-Bp1l8hY-.js} +1 -1
  120. package/dist/assets/constraints.inspector-Dm1cycK3.js +1 -0
  121. package/dist/assets/{content-bounds-BeuIXKYu.js → content-bounds-DROIchTa.js} +1 -1
  122. package/dist/assets/{contract-system-adapters-Bic_7sev.js → contract-system-adapters-Cn7OW_ay.js} +1 -1
  123. package/dist/assets/coverage.service-l42ty7lr.js +3 -0
  124. package/dist/assets/create-runtime-B_uTwsmi.js +3 -0
  125. package/dist/assets/curve-THOUsg-j.js +1 -0
  126. package/dist/assets/{data-asset-DfQ2Pjse.js → data-asset-DAANayR6.js} +1 -1
  127. package/dist/assets/data-check-core-CHqar_E8.js +1 -0
  128. package/dist/assets/data-ref-CN34UeVw.js +1 -0
  129. package/dist/assets/debug-bridge-BD1XVAIB.js +1 -0
  130. package/dist/assets/debug-registry-ggQWxtu-.js +1 -0
  131. package/dist/assets/{deferred-ingest-play-BdR4qGk6.js → deferred-ingest-play-B2JUlwlT.js} +2 -2
  132. package/dist/assets/{design-time-canvas-mount-DPQeHSN2.js → design-time-canvas-mount-as9cN9I6.js} +2 -2
  133. package/dist/assets/design-time-layers-BRseeSmV.js +1 -0
  134. package/dist/assets/{design-time-mount.service-Ks-5Wkcs.js → design-time-mount.service-BTVu3yKo.js} +2 -2
  135. package/dist/assets/{design-time-mount.service-Ca-DZGFV.js → design-time-mount.service-DKvc7lVK.js} +2 -2
  136. package/dist/assets/design-time-react-mount-C7rB56QD.js +1 -0
  137. package/dist/assets/{document-preview-three-DThkjI1S.js → document-preview-three-CxmRhCcV.js} +1 -1
  138. package/dist/assets/{dom-authoring-adapter-BrLU8IJ_.js → dom-authoring-adapter-L8OzXfmE.js} +1 -1
  139. package/dist/assets/{draco3d-B2cwv46o.js → draco3d-BjNuXv66.js} +1 -1
  140. package/dist/assets/{edit-mode-audio.service-D4ITNbsm.js → edit-mode-audio.service-BwI5u845.js} +1 -1
  141. package/dist/assets/edit-mode-authoring-D5f7aHHl.js +1 -0
  142. package/dist/assets/{edit-mode-networking.service-BNv-FTRh.js → edit-mode-networking.service-DqP_4lbI.js} +1 -1
  143. package/dist/assets/editor-api-BM7H_F4G.js +1 -0
  144. package/dist/assets/{editor-layers-BDJnAAzj.js → editor-layers-D-CTUqco.js} +1 -1
  145. package/dist/assets/editor-presentation-activity-CqJH4G9t.js +1 -0
  146. package/dist/assets/{editor-shell-store-ChLcVeNB.js → editor-shell-store-DHVWS8cE.js} +1 -1
  147. package/dist/assets/{entity-object-JmYMfLsx.js → entity-object-MKYemTFM.js} +1 -1
  148. package/dist/assets/{extend-Cc-nEa_A.js → extend-BrgqZiMY.js} +1 -1
  149. package/dist/assets/fork-menu-DE2MK3Nq.js +1 -0
  150. package/dist/assets/{frame-debugger-store-DaCbAYSW.js → frame-debugger-store-BXoLKTdZ.js} +1 -1
  151. package/dist/assets/game-audio-BeCyd0Ha.js +1 -0
  152. package/dist/assets/{game-contract-seams-BnPFGLll.js → game-contract-seams-tyKDsfaP.js} +1 -1
  153. package/dist/assets/{game-css-scope-transform-D_p7cVgW.js → game-css-scope-transform-DcjrwtVc.js} +2 -2
  154. package/dist/assets/game-document.service-CTb2itHQ.js +1 -0
  155. package/dist/assets/game-eval.command-CpDKXOQU.js +2 -0
  156. package/dist/assets/game-module-access-BTInp2NG.js +1 -0
  157. package/dist/assets/game-network-DW5ARz4R.js +22 -0
  158. package/dist/assets/{gameplay-export-BzYzLZPi.js → gameplay-export-cHk3v9y-.js} +1 -1
  159. package/dist/assets/gameplay-replay-HRenPTtU.js +1 -0
  160. package/dist/assets/gameplay.command-DcY2lKKX.js +1 -0
  161. package/dist/assets/generation-CdOATubd.css +1 -0
  162. package/dist/assets/{generation-jobs-BZhOMrp-.js → generation-jobs-CJBehuUp.js} +1 -1
  163. package/dist/assets/generation.service-BMOc-C9i.js +1 -0
  164. package/dist/assets/{generations-DVDht_31.js → generations-ssgVOe_6.js} +1 -1
  165. package/dist/assets/generations.status-B_SmPReI.js +1 -0
  166. package/dist/assets/hierarchy-marks-BuCO8Ke-.js +1 -0
  167. package/dist/assets/hierarchy-marks-CsTaTkc7.js +1 -0
  168. package/dist/assets/hosted-asset-materialization-CiXZI85V.js +2 -0
  169. package/dist/assets/{ibl-override-material-CiKkaOTW.js → ibl-override-material-CMo_a49U.js} +1 -1
  170. package/dist/assets/index-B0S4fQQV.js +1 -0
  171. package/dist/assets/{index-C3Pw-9So.js → index-B9bd4k-t.js} +1 -1
  172. package/dist/assets/index-BMxv2MNV.js +1 -0
  173. package/dist/assets/{index-DUZeuA7g.js → index-Bm4_DmRO.js} +1 -1
  174. package/dist/assets/{index-cNc-iFbq.js → index-BvBlIRwM.js} +1 -1
  175. package/dist/assets/{index-Ck3JFh48.js → index-BweKDdi_.js} +1 -1
  176. package/dist/assets/{index-BRJMIUK0.js → index-C5ZAyrKq.js} +346 -345
  177. package/dist/assets/index-CPiRKiDC.css +1 -0
  178. package/dist/assets/index-CfpGZrbC.js +1 -0
  179. package/dist/assets/index-Czvj6whv.js +1 -0
  180. package/dist/assets/{index-SS9EugVg.js → index-DgPDGGSV.js} +2 -2
  181. package/dist/assets/{inference-diagnostics-xecGdohW.js → inference-diagnostics-DLt9ql9I.js} +1 -1
  182. package/dist/assets/{ingest-boot-viewport-DAt8WFSy.js → ingest-boot-viewport-BXVXjYpG.js} +1 -1
  183. package/dist/assets/ingest-siblings-DWJ7OGB_.js +1 -0
  184. package/dist/assets/ingest-source-persistence-6ShMoSCa.js +1 -0
  185. package/dist/assets/ingest.service-BBbX8ibg.js +1 -0
  186. package/dist/assets/{inspect-Dr4qvDpJ.js → inspect-Cz3Zyx_1.js} +1 -1
  187. package/dist/assets/inspection-D8fZOHCM.js +1 -0
  188. package/dist/assets/instances.command-BrdlngrL.js +1 -0
  189. package/dist/assets/{json-history-resource-DwS10tqD.js → json-history-resource-Uqrihfc8.js} +1 -1
  190. package/dist/assets/layered-pick-CAVQMPI7.js +1 -0
  191. package/dist/assets/{light-DcFqVCmv.js → light-CqzsCWeJ.js} +1 -1
  192. package/dist/assets/{live-project-verbs-C3LzprCe.js → live-project-verbs-CdFmLYOo.js} +1 -1
  193. package/dist/assets/{machine.document-BzZxubYQ.js → machine.document-DRIFOVaa.js} +1 -1
  194. package/dist/assets/{machines.finder-BR02bfVG.js → machines.finder-DPCT6few.js} +1 -1
  195. package/dist/assets/material-BVApn1V_.js +1 -0
  196. package/dist/assets/{material-factory-COz7qZhC.js → material-factory-B_75xxFD.js} +1 -1
  197. package/dist/assets/{mesh-DcmO-mWI.js → mesh-DdA3mExo.js} +1 -1
  198. package/dist/assets/model-asset-sections-D1uxOu2v.css +1 -0
  199. package/dist/assets/model-asset-sections.service-CJnSIckZ.js +1 -0
  200. package/dist/assets/{model-inspection-CXHxrafK.js → model-inspection-DvspbmJl.js} +1 -1
  201. package/dist/assets/{model-thumbnail-BEKPWg4l.js → model-thumbnail-BmQs-h6t.js} +1 -1
  202. package/dist/assets/{models.finder-c1I0tp2M.js → models.finder-Qv_Hsccy.js} +1 -1
  203. package/dist/assets/module-mode-MJ4Gbsry.js +2 -0
  204. package/dist/assets/mount-canvas-ingest-root-BxtM8OaB.js +2 -0
  205. package/dist/assets/mount-dom-ingest-root-pGatqO46.js +2 -0
  206. package/dist/assets/mount-ingest-root-C7jb-mCl.js +2 -0
  207. package/dist/assets/mount-manifest-BfoHBuzn.js +1 -0
  208. package/dist/assets/mount-readiness-DyAd17pe.js +4 -0
  209. package/dist/assets/mount-three-ingest-root-Boa5mcaF.js +1 -0
  210. package/dist/assets/{mounted-authoring-Clftxx0x.js → mounted-authoring-DxMISwvR.js} +1 -1
  211. package/dist/assets/{mounted-story-viewport-source-B4-eAYGI.js → mounted-story-viewport-source-DfnLxI1f.js} +1 -1
  212. package/dist/assets/{native-debug-module-2_HVupdg.js → native-debug-module-BlrALjM3.js} +1 -1
  213. package/dist/assets/{navigation-CH3-zr1n.js → navigation-CqG5o5AR.js} +1 -1
  214. package/dist/assets/{navmesh.menu-Dfi-Pk-8.js → navmesh.menu-D4TdVDhe.js} +1 -1
  215. package/dist/assets/{navmesh.service-Cz7QFY-M.js → navmesh.service-DWKT5ruQ.js} +1 -1
  216. package/dist/assets/network-observer.service-ZRAquNq4.js +1 -0
  217. package/dist/assets/network.utility-DjeOEvAY.js +1 -0
  218. package/dist/assets/object-marks-BnvSuCTt.js +1 -0
  219. package/dist/assets/{object3d-authoring-subject-BDrxd1GA.js → object3d-authoring-subject-XccsO0xG.js} +1 -1
  220. package/dist/assets/{object3d-document-session-registry-DJDEDM0p.js → object3d-document-session-registry-CMRJdFp6.js} +2 -2
  221. package/dist/assets/{oid-transform-D5Kxt6ij.js → oid-transform-DaA6yW6o.js} +1 -1
  222. package/dist/assets/{particles-vRp0Lf3o.js → particles-DsQRcDBY.js} +1 -1
  223. package/dist/assets/{performance-profiler-OwnXQX0M.js → performance-profiler-CMbwGBuk.js} +1 -1
  224. package/dist/assets/pixi-authoring-adapter-BoBt8bB5.js +1 -0
  225. package/dist/assets/pixi-live-write-target-CYZgvC6U.js +1 -0
  226. package/dist/assets/play.command-D9JGJP-e.js +2 -0
  227. package/dist/assets/pose-guard-CLabLSzf.js +1 -0
  228. package/dist/assets/presentation-COhHQdmR.js +1 -0
  229. package/dist/assets/{product-CxmUIxmr.js → product-CaRGoiIH.js} +1 -1
  230. package/dist/assets/{profiler.action-Dzy9DuAc.js → profiler.action-Cz7HYWjh.js} +1 -1
  231. package/dist/assets/{profiler.menu-jLDO3U6N.js → profiler.menu-D5aR_FBy.js} +1 -1
  232. package/dist/assets/profiler.utility-KwxlIPKb.js +1 -0
  233. package/dist/assets/{project-authoring-session-C3eusefK.js → project-authoring-session-DKXHVwxO.js} +2 -2
  234. package/dist/assets/project-provenance-BGnJXJwa.js +1 -0
  235. package/dist/assets/{properties-bone-constraints.inspector-B_PbSMV7.js → properties-bone-constraints.inspector-Bo-sU8eR.js} +1 -1
  236. package/dist/assets/{properties-bone.inspector-CMDEQuBd.js → properties-bone.inspector-BQiWplQv.js} +1 -1
  237. package/dist/assets/{properties-collection.inspector-D7Ay8yRj.js → properties-collection.inspector-C5BnR-GE.js} +1 -1
  238. package/dist/assets/{properties-constraints.inspector-DS1fZgXK.js → properties-constraints.inspector-CyheU12R.js} +1 -1
  239. package/dist/assets/{properties-data.inspector-k2pGN2Mp.js → properties-data.inspector-CkycARja.js} +1 -1
  240. package/dist/assets/{properties-material.inspector-Bb3yAGUx.js → properties-material.inspector-Bl_PUmY-.js} +1 -1
  241. package/dist/assets/{properties-modifiers.inspector-BcJfe-Wy.js → properties-modifiers.inspector-j7SnOxQq.js} +1 -1
  242. package/dist/assets/{properties-object.inspector-CUSfXJuq.js → properties-object.inspector-DcR3MGLK.js} +1 -1
  243. package/dist/assets/{properties-output.inspector-BTVW2kn1.js → properties-output.inspector-BLjw6K4b.js} +1 -1
  244. package/dist/assets/{properties-particles.inspector-Cw0fxx3B.js → properties-particles.inspector-BUIm2-Jf.js} +1 -1
  245. package/dist/assets/{properties-physics.inspector-C-0bD2bu.js → properties-physics.inspector-DNvRcxb6.js} +1 -1
  246. package/dist/assets/{properties-render.inspector-C8D5UpjX.js → properties-render.inspector-8FMZ-qoZ.js} +1 -1
  247. package/dist/assets/{properties-scene.inspector-HjK6QHGg.js → properties-scene.inspector-Dx7_z75k.js} +1 -1
  248. package/dist/assets/{properties-texture.inspector-CckZgUaI.js → properties-texture.inspector-WT15951-.js} +1 -1
  249. package/dist/assets/{properties-view-layer.inspector-C1ajtVSk.js → properties-view-layer.inspector-P7VNTdqr.js} +1 -1
  250. package/dist/assets/{properties-world.inspector-BiT_EdT-.js → properties-world.inspector-B3t1q8TF.js} +1 -1
  251. package/dist/assets/r3f-design-session-lsbFnoWH.js +2 -0
  252. package/dist/assets/{r3f-physics-binding-DzrbpqjM.js → r3f-physics-binding-Cx8yhuwt.js} +1 -1
  253. package/dist/assets/{r3f-source-authoring-adapter-DbbeRcvt.js → r3f-source-authoring-adapter-jH3G0TeH.js} +2 -2
  254. package/dist/assets/react-canvas-navigation-B_gOe3CI.js +1 -0
  255. package/dist/assets/react-inspector.service-CZf1vfdX.js +1 -0
  256. package/dist/assets/react-story-board-CCm2Opwn.js +1 -0
  257. package/dist/assets/{react-three-rapier.esm-U8J7g6tH.js → react-three-rapier.esm-CHXGG51p.js} +1 -1
  258. package/dist/assets/react-world-authoring-adapter-CnzxMtYz.js +1 -0
  259. package/dist/assets/{realm-services-CnY105XU.js → realm-services-Do9J6nsb.js} +1 -1
  260. package/dist/assets/reflection-probe-capture.inspector-BAjjIybz.js +1 -0
  261. package/dist/assets/{reflection-probe-BHNGwVyz.js → reflection-probe-sIto9mh0.js} +1 -1
  262. package/dist/assets/registry-Xnduk02T.js +1 -0
  263. package/dist/assets/{relative-import-specifier-BFKIWEWs.js → relative-import-specifier-CPFTrxi4.js} +1 -1
  264. package/dist/assets/{render-env-BkKZ4uMA.js → render-env-YJlI8K0i.js} +1 -1
  265. package/dist/assets/{render-features-rxbawsRb.js → render-features-DMSV2qKJ.js} +1 -1
  266. package/dist/assets/{render-settings-DS5leCed.js → render-settings-CRyDhHyz.js} +1 -1
  267. package/dist/assets/{resolve-three-CVnMRHxw.js → resolve-three-D27rMc37.js} +19 -19
  268. package/dist/assets/root-seam-contract-gjWUd5uu.js +1 -0
  269. package/dist/assets/run-selection-B0jOdyYt.js +2 -0
  270. package/dist/assets/scene-capture-Di9cM1p4.js +1 -0
  271. package/dist/assets/scene-document.service-XxGs4HHE.js +2 -0
  272. package/dist/assets/{scene-framing-BQt72ZCw.js → scene-framing-DkZKDwH3.js} +1 -1
  273. package/dist/assets/{scene-index--lRWLEmW.js → scene-index-DHeKmalD.js} +1 -1
  274. package/dist/assets/{scene-query-s1y04OVB.js → scene-query-ByZtXA2m.js} +1 -1
  275. package/dist/assets/seeded-random-BJthDRMu.js +1 -0
  276. package/dist/assets/{session-CTXsU1lK.js → session-x8E_NJk2.js} +34 -34
  277. package/dist/assets/{setup-renderer-Cwkl1Ar6.js → setup-renderer-F9mG7t6r.js} +1 -1
  278. package/dist/assets/{source-object3d-authoring-adapter-DF679Ncb.js → source-object3d-authoring-adapter-CvmFpSUj.js} +1 -1
  279. package/dist/assets/{source-persistence-backend-CwLYVPXj.js → source-persistence-backend-au3WtEn6.js} +1 -1
  280. package/dist/assets/{spark-renderer-lifecycle-DfYpvEJa.js → spark-renderer-lifecycle-B6Axb6jm.js} +1 -1
  281. package/dist/assets/{stage-keyboard-B8BEW592.js → stage-keyboard-BQkndG_D.js} +1 -1
  282. package/dist/assets/stage-overlay-set-g6eWhuRv.js +1 -0
  283. package/dist/assets/stage-presence-markers-0CDfO5f4.js +1 -0
  284. package/dist/assets/stage-transform-tools-BzPl7OIo.js +1 -0
  285. package/dist/assets/standard-viewport-dressing-BW-dM_1h.js +24 -0
  286. package/dist/assets/{state-watch.action-DnR5Zjr-.js → state-watch.action-Z1nQ5awu.js} +1 -1
  287. package/dist/assets/{state-watch.menu-wYLCLsAw.js → state-watch.menu-CQHGUF3W.js} +1 -1
  288. package/dist/assets/state-watch.utility-DCIg2i79.js +1 -0
  289. package/dist/assets/{story-capture-BmnwHGDV.js → story-capture-BIrjDKeY.js} +1 -1
  290. package/dist/assets/story-documents-BvG2xeaR.js +3 -0
  291. package/dist/assets/{story-documents.service-B6v7Z-WE.js → story-documents.service-DOSEa3ja.js} +1 -1
  292. package/dist/assets/{story-documents.service-yagl1wGp.js → story-documents.service-y1m7XGMJ.js} +1 -1
  293. package/dist/assets/{story-media-presence-BqRMu572.js → story-media-presence-HLV-KaMj.js} +1 -1
  294. package/dist/assets/{story-pixi-preview-Da6afqLg.js → story-pixi-preview-CMhho2gG.js} +1 -1
  295. package/dist/assets/{story-presentation-DMSYRWaz.js → story-presentation-CYhVv8Ku.js} +1 -1
  296. package/dist/assets/story-three-preview-CgcLF5lE.js +2 -0
  297. package/dist/assets/{structural-ids-Br2zjINh.js → structural-ids-BOo2BRoY.js} +1 -1
  298. package/dist/assets/studio-environment-R9qXUUcC.js +2 -0
  299. package/dist/assets/{surface-state-1lTOi8FD.js → surface-state-D8Qnowo6.js} +1 -1
  300. package/dist/assets/{syntactic-prop-specs-eiQXwMIc.js → syntactic-prop-specs-8gkBuc5j.js} +1 -1
  301. package/dist/assets/team-playtest.service-BBMZ2iyk.js +1 -0
  302. package/dist/assets/{three-TCuY32m_.js → three-DiL6vMXq.js} +1 -1
  303. package/dist/assets/three-authoring-adapter-CkLR2zGf.js +1 -0
  304. package/dist/assets/three-authoring.service-CovhlCGx.js +2 -0
  305. package/dist/assets/{three-ingest-runtime-B7rtg3QE.js → three-ingest-runtime-CwTqAHgX.js} +1 -1
  306. package/dist/assets/{three-integration-BdN5Nhsg.js → three-integration-DXOFI88n.js} +2 -2
  307. package/dist/assets/three-integration.service-rCAqpqSp.js +1 -0
  308. package/dist/assets/three-projection-core-B7Lf8tOp.js +1 -0
  309. package/dist/assets/{three-state-DwFE3ay2.js → three-state-BCACvUtm.js} +1 -1
  310. package/dist/assets/{three-story-capture.service-CvpV3v5a.js → three-story-capture.service-rTFKNtHA.js} +2 -2
  311. package/dist/assets/{three-story-model-C2r2BuiA.js → three-story-model-BjKr7OMn.js} +1 -1
  312. package/dist/assets/three-viewport-presentation-CBzvc2v2.js +141 -0
  313. package/dist/assets/tools-DfctM216.js +1 -0
  314. package/dist/assets/transform-mode-request-DlEApNrA.js +1 -0
  315. package/dist/assets/transport-strip-xCg94CuI.js +1 -0
  316. package/dist/assets/transport.header-BRtdky0x.js +1 -0
  317. package/dist/assets/{trigger-volume-DP0G1VBe.js → trigger-volume-BLkHmfm9.js} +1 -1
  318. package/dist/assets/tuples-BDz3wbQL.js +1 -0
  319. package/dist/assets/ui-board-document-DvbK_HVN.js +2 -0
  320. package/dist/assets/{user-data-Bpj7diUS.js → user-data-C84W0V47.js} +1 -1
  321. package/dist/assets/user-data-CODoGZqA.js +1 -0
  322. package/dist/assets/{utility-view-state-CAfbFbKQ.js → utility-view-state-CDRxZSo-.js} +1 -1
  323. package/dist/assets/viewport-door-BARIpMu-.js +1 -0
  324. package/dist/assets/{viewport-root-presentation-vgxsTyj4.js → viewport-root-presentation-hRLF0BeO.js} +1 -1
  325. package/dist/assets/{viewport-surface-status-cwCiBGa7.js → viewport-surface-status-TUfhXKR9.js} +1 -1
  326. package/dist/assets/{webworkerAll-Cm3gTjWi.js → webworkerAll-PJtcQ1FD.js} +1 -1
  327. package/dist/assets/worker-BtXrsgFy.js +2 -0
  328. package/dist/assets/workspace-arrangement-DqG5sUns.js +1 -0
  329. package/dist/assets/world-documents-D69XaqUX.js +1 -0
  330. package/dist/assets/world-root-stage-binding-BgZWZEuD.js +1 -0
  331. package/dist/assets/{xstate-animation-binding-BGLxcZT_.js → xstate-animation-binding-CIyLzGHs.js} +1 -1
  332. package/dist/assets/{xstate-animation-meta-D_T441Ru.js → xstate-animation-meta-CbYWup3R.js} +1 -1
  333. package/dist/volter-shared-react.json +10 -0
  334. package/dist/volter-shared-three.json +3 -0
  335. package/dist-node/cli.js +253 -210
  336. package/dist-node/create.js +103 -82
  337. package/package.json +23 -20
  338. package/src/contributions.d.ts +1 -1
  339. package/src/index.ts +10 -10
  340. package/starter/cube.py +1 -1
  341. package/template/.agents/references/project-manual.md +17 -17
  342. package/template/.agents/skills/editor/SKILL.md +6 -6
  343. package/template/.agents/skills/editor/agents/openai.yaml +3 -3
  344. package/template/.agents/skills/editor/references/editor-control.md +62 -62
  345. package/template/{.claude/skills/vgai-3d-models → .agents/skills/volter-3d-models}/SKILL.md +3 -3
  346. package/template/{.github/skills/vgai-ingest-existing-game → .agents/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  347. package/template/.agents/skills/{vgai-music → volter-music}/SKILL.md +35 -11
  348. package/template/{.claude/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/SKILL.md +9 -9
  349. package/template/.agents/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  350. package/template/{.github/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  351. package/template/.claude/skills/editor/SKILL.md +6 -6
  352. package/template/.claude/skills/editor/agents/openai.yaml +3 -3
  353. package/template/.claude/skills/editor/references/editor-control.md +62 -62
  354. package/template/{.agents/skills/vgai-3d-models → .claude/skills/volter-3d-models}/SKILL.md +3 -3
  355. package/template/{.agents/skills/vgai-ingest-existing-game → .claude/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  356. package/template/{.github/skills/vgai-threejs-authoring → .claude/skills/volter-threejs-authoring}/SKILL.md +9 -9
  357. package/template/.claude/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  358. package/template/.claude/skills/{vgai-threejs-authoring → volter-threejs-authoring}/references/helper-catalog.md +1 -1
  359. package/template/.github/copilot-instructions.md +1 -1
  360. package/template/.github/skills/editor/SKILL.md +6 -6
  361. package/template/.github/skills/editor/agents/openai.yaml +3 -3
  362. package/template/.github/skills/editor/references/editor-control.md +62 -62
  363. package/template/.github/skills/{vgai-3d-models → volter-3d-models}/SKILL.md +3 -3
  364. package/template/{.claude/skills/vgai-ingest-existing-game → .github/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  365. package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/SKILL.md +9 -9
  366. package/template/.github/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  367. package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  368. package/template/.mcp.json +3 -3
  369. package/template/AGENTS.md +24 -23
  370. package/template/DEVLOG.md +1 -1
  371. package/template/IDIOMS.md +3 -3
  372. package/template/LICENSE +3 -3
  373. package/template/README.md +12 -12
  374. package/template/check-idioms.ts +51 -51
  375. package/template/manifest-entry-modules-plugin.ts +17 -4
  376. package/template/package.json +12 -12
  377. package/template/server/loopback.ts +1 -1
  378. package/template/server/main.ts +4 -4
  379. package/template/server/rooms/arena-room.ts +8 -8
  380. package/template/server/rooms/game-room.ts +8 -8
  381. package/template/server/rooms.ts +2 -2
  382. package/template/src/bot/QaTester.tsx +1 -1
  383. package/template/src/bot/bot-station.ts +2 -2
  384. package/template/src/bot/tester-station.ts +1 -1
  385. package/template/src/contributions/README.md +1 -1
  386. package/template/src/contributions/analytics.analytics.tsx +1 -1
  387. package/template/src/contributions/data.document.tsx +2 -2
  388. package/template/src/contributions/pages.finder.ts +1 -1
  389. package/template/src/contributions/tester.inspector.tsx +2 -2
  390. package/template/src/contributions/use-game-modules.ts +1 -1
  391. package/template/src/input.ts +2 -2
  392. package/template/src/lib/reflections/volume-reflection-material.ts +59 -59
  393. package/template/src/lib/static-batch/Frozen.tsx +1 -1
  394. package/template/src/lib/static-batch/mutation-watch.ts +1 -1
  395. package/template/src/main.ts +58 -6
  396. package/template/src/manifest-entry-modules.d.ts +12 -1
  397. package/template/src/prefabs/HeroBox.stories.tsx +1 -1
  398. package/template/src/world.tsx +1 -1
  399. package/template/tsconfig.json +1 -1
  400. package/template/validate-manifest.ts +3 -3
  401. package/template/vite.config.ts +11 -11
  402. package/template/{vgai.adapter.ts → volter.adapter.ts} +1 -1
  403. package/template/{vgai.project.json → volter.project.json} +2 -2
  404. package/template-dotfiles/gitignore +27 -27
  405. package/workbench/src/media/game-cover.css +11 -11
  406. package/workbench/src/product.contribution.ts +28 -28
  407. package/workbench/src/{vgaiGameSkew.ts → volterGameSkew.ts} +16 -16
  408. package/dist/assets/AudioViewer-BDPqHDfU.js +0 -1
  409. package/dist/assets/CanvasBoardDocument-mxL0oJ3N.js +0 -1
  410. package/dist/assets/CanvasSceneViewport-C_mapCwC.js +0 -1
  411. package/dist/assets/ColorInput-QUPS1pEB.js +0 -1
  412. package/dist/assets/ImageViewer-tlVvkdM4.js +0 -1
  413. package/dist/assets/InspectorObjectPreview-W-y079DS.js +0 -1
  414. package/dist/assets/JsonAssetDocument-CPmcWFPW.js +0 -2
  415. package/dist/assets/ModelAssetDocument-De1HKuxG.js +0 -1
  416. package/dist/assets/Object3DDocumentToolbar-Cks81kCS.js +0 -1
  417. package/dist/assets/Object3DDocumentViewport-DCwiSY3O.js +0 -2
  418. package/dist/assets/OnlineAssetDetail-CNuwSQRQ.js +0 -1
  419. package/dist/assets/PlayBar-bT8Xdrap.js +0 -1
  420. package/dist/assets/ReactCanvasControls-CnJrPj-B.js +0 -1
  421. package/dist/assets/RootSelectionOverlay-CpaGluQu.js +0 -1
  422. package/dist/assets/ShadowEditor-CVtMlALn.js +0 -1
  423. package/dist/assets/StageHost-B89HKcvd.js +0 -2
  424. package/dist/assets/ThreeBoardDocument-BAgHrbtu.js +0 -2
  425. package/dist/assets/Toolbar-DkTHnQto.js +0 -1
  426. package/dist/assets/VideoViewer-DMV8lf4P.js +0 -1
  427. package/dist/assets/ViewportShadingMenu-CXPi6fl8.js +0 -1
  428. package/dist/assets/active-ingest-DA426a81.js +0 -3
  429. package/dist/assets/adapter-runtime-bindings-4cmsRvRh.js +0 -2
  430. package/dist/assets/animation-mixers.service-DK64IuYq.js +0 -1
  431. package/dist/assets/animation-timeline.utility-D-g0zrOl.js +0 -1
  432. package/dist/assets/asset-editor-persistence-BGWIqZdk.js +0 -1
  433. package/dist/assets/asset-loaders-C0KQI5eY.js +0 -2
  434. package/dist/assets/audio.utility-BmE9WMUg.js +0 -1
  435. package/dist/assets/autoplay.service-CjPnv3QW.js +0 -1
  436. package/dist/assets/binding-resolver-dE0GnZT5.js +0 -2
  437. package/dist/assets/blender-emscripten-engine-BeWFjMn-.js +0 -2
  438. package/dist/assets/blender-version.status-OsFoc9SA.js +0 -1
  439. package/dist/assets/blender-wali-engine-da698rDf.js +0 -2
  440. package/dist/assets/blender.keymap-_rF_vRX8.js +0 -1
  441. package/dist/assets/blender.status-ujwGU6dU.js +0 -1
  442. package/dist/assets/board-guides-BEKPgD9M.js +0 -1
  443. package/dist/assets/body-marks-RKb_LTwL.js +0 -1
  444. package/dist/assets/bridge.command-BF00Iefm.js +0 -3
  445. package/dist/assets/build-profiles.document-CqNrDdh9.js +0 -2
  446. package/dist/assets/build-progress.status-Bo1ZgJcb.js +0 -1
  447. package/dist/assets/build-session-GZcSAfPN.js +0 -9
  448. package/dist/assets/build.header-Bt1kwHWl.js +0 -1
  449. package/dist/assets/canvas-design-mount-BbLW_Nci.js +0 -6
  450. package/dist/assets/canvas-entry-runtime-UNYuSfG0.js +0 -2
  451. package/dist/assets/capability-coverage-DZ-onC5j.js +0 -7
  452. package/dist/assets/component-board.service-q_TM9BCw.js +0 -2
  453. package/dist/assets/component-contracts.service-CPbfXE1h.js +0 -1
  454. package/dist/assets/component-instance-root-B0C5oNEm.js +0 -1
  455. package/dist/assets/component-verbs.service-CnA11bJq.js +0 -1
  456. package/dist/assets/connection.status-Yvt0bX0r.js +0 -1
  457. package/dist/assets/constraints.inspector-4r8jWq5a.js +0 -1
  458. package/dist/assets/coverage.service-DcpEoBuf.js +0 -3
  459. package/dist/assets/create-runtime-DBfUy0SO.js +0 -3
  460. package/dist/assets/curve-DVd18iAX.js +0 -1
  461. package/dist/assets/data-check-core-CQEjuFyt.js +0 -1
  462. package/dist/assets/data-ref-CWnkj-HX.js +0 -1
  463. package/dist/assets/debug-bridge-D3_-EgRE.js +0 -1
  464. package/dist/assets/debug-registry-P0_YQGWd.js +0 -1
  465. package/dist/assets/design-time-layers-ChswRUJt.js +0 -1
  466. package/dist/assets/design-time-react-mount-C85KfXOd.js +0 -1
  467. package/dist/assets/edit-mode-authoring-DeCxPcHM.js +0 -1
  468. package/dist/assets/editor-api-BFTIRlWa.js +0 -1
  469. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +0 -1
  470. package/dist/assets/entry-adjudication-Dc18TIqT.js +0 -1
  471. package/dist/assets/fork-menu-DpKqRhF5.js +0 -1
  472. package/dist/assets/game-audio-CaGKzia4.js +0 -1
  473. package/dist/assets/game-document.service-Chmt4065.js +0 -1
  474. package/dist/assets/game-eval.command-DRSvOJ_1.js +0 -2
  475. package/dist/assets/game-module-access-o3iXZpCA.js +0 -1
  476. package/dist/assets/game-network-Ct2FQYmu.js +0 -1
  477. package/dist/assets/gameplay-replay-BwdxV4oF.js +0 -1
  478. package/dist/assets/gameplay.command-Boqv1hnc.js +0 -1
  479. package/dist/assets/generation-DhwCUHPf.css +0 -1
  480. package/dist/assets/generation.service-o9aXlsx4.js +0 -1
  481. package/dist/assets/generations.status-BvzgHlyk.js +0 -1
  482. package/dist/assets/hierarchy-marks-BLPfSIym.js +0 -1
  483. package/dist/assets/hierarchy-marks-Cc_3lxw6.js +0 -1
  484. package/dist/assets/hosted-asset-materialization-BpbnhJac.js +0 -2
  485. package/dist/assets/index-0Lm0Nf1M.css +0 -1
  486. package/dist/assets/index-BHoAKyAC.js +0 -1
  487. package/dist/assets/index-BeK4RPgj.js +0 -1
  488. package/dist/assets/index-C1c3eOmm.js +0 -1
  489. package/dist/assets/index.module-Ycad3DJq.js +0 -1
  490. package/dist/assets/ingest-siblings-BtiEXLnh.js +0 -1
  491. package/dist/assets/ingest-source-persistence-Dmdo-UBp.js +0 -1
  492. package/dist/assets/ingest.service-vbCucMz7.js +0 -1
  493. package/dist/assets/inspection-CObLhnrs.js +0 -1
  494. package/dist/assets/instances.command-BwayrqNm.js +0 -1
  495. package/dist/assets/layered-pick-kiQf53t5.js +0 -1
  496. package/dist/assets/material-B_V78pTt.js +0 -1
  497. package/dist/assets/model-asset-sections-CFvvihfx.css +0 -1
  498. package/dist/assets/model-asset-sections.service-CqSclZGY.js +0 -1
  499. package/dist/assets/module-mode-BH2R93XP.js +0 -2
  500. package/dist/assets/mount-canvas-ingest-root-D1z9i5B3.js +0 -2
  501. package/dist/assets/mount-dom-ingest-root-BAmmNxlm.js +0 -2
  502. package/dist/assets/mount-ingest-root-DYR0TMIt.js +0 -2
  503. package/dist/assets/mount-manifest-DdkFYdVA.js +0 -1
  504. package/dist/assets/mount-readiness-Ds0HvvLH.js +0 -4
  505. package/dist/assets/mount-three-ingest-root-DVbACDUy.js +0 -1
  506. package/dist/assets/network-observer.service-Ce83TdsU.js +0 -1
  507. package/dist/assets/network.utility-DFDul2Xb.js +0 -1
  508. package/dist/assets/object-marks-DwvIEBOK.js +0 -1
  509. package/dist/assets/pixi-authoring-adapter-BChknIdC.js +0 -1
  510. package/dist/assets/pixi-live-write-target-BjDsBQbp.js +0 -1
  511. package/dist/assets/play-mode-DICV4cKP.js +0 -22
  512. package/dist/assets/play.command-NHyi5rzF.js +0 -2
  513. package/dist/assets/pose-guard-DILO6gGq.js +0 -1
  514. package/dist/assets/presentation-BeNFBfKg.js +0 -1
  515. package/dist/assets/profiler.utility-Do2Bw7MY.js +0 -1
  516. package/dist/assets/project-provenance-4ldz-EOG.js +0 -1
  517. package/dist/assets/r3f-design-session-B5GsZI5M.js +0 -2
  518. package/dist/assets/react-canvas-navigation-Cp3cOHJa.js +0 -1
  519. package/dist/assets/react-inspector.service-Bm0OnanU.js +0 -1
  520. package/dist/assets/react-story-board-GaXqr03H.js +0 -1
  521. package/dist/assets/react-world-authoring-adapter-DOjv2pYm.js +0 -1
  522. package/dist/assets/reflection-probe-capture.inspector-DqSW9p1v.js +0 -1
  523. package/dist/assets/registry-CaCdF63N.js +0 -1
  524. package/dist/assets/root-seam-contract-CxLZaRio.js +0 -1
  525. package/dist/assets/run-selection-DzEkGesJ.js +0 -2
  526. package/dist/assets/scene-capture-0a-bTjT8.js +0 -1
  527. package/dist/assets/scene-document.service-CeDwVA7t.js +0 -2
  528. package/dist/assets/seeded-random-BgCwIAAU.js +0 -1
  529. package/dist/assets/stage-overlay-set-BGE03mqb.js +0 -1
  530. package/dist/assets/stage-presence-markers-DIP7YMcO.js +0 -1
  531. package/dist/assets/stage-transform-tools-BQB7EY4l.js +0 -1
  532. package/dist/assets/standard-viewport-dressing-BCA51Tum.js +0 -24
  533. package/dist/assets/state-watch.utility-CFG1Tu1m.js +0 -1
  534. package/dist/assets/story-documents-BTo90DiA.js +0 -3
  535. package/dist/assets/story-three-preview-R1JvrggS.js +0 -2
  536. package/dist/assets/studio-environment-DRxxq_QX.js +0 -2
  537. package/dist/assets/team-playtest.service-hLfjgScx.js +0 -1
  538. package/dist/assets/three-authoring-adapter-htbnVej2.js +0 -1
  539. package/dist/assets/three-authoring.service-BIQAtVdX.js +0 -2
  540. package/dist/assets/three-integration.service-CS8Nvbd2.js +0 -1
  541. package/dist/assets/three-projection-core-CG01r5Ta.js +0 -1
  542. package/dist/assets/three-viewport-presentation-B0z_cECu.js +0 -141
  543. package/dist/assets/tools-B_NJsk05.js +0 -1
  544. package/dist/assets/transform-mode-request-DzD9aUNA.js +0 -1
  545. package/dist/assets/transport-strip-CUjNltnb.js +0 -1
  546. package/dist/assets/transport.header-Bb4FpQ8J.js +0 -1
  547. package/dist/assets/tuples-DfWSY2tr.js +0 -1
  548. package/dist/assets/ui-board-document-CCiiXjX9.js +0 -2
  549. package/dist/assets/user-data-dHvLdpwM.js +0 -1
  550. package/dist/assets/viewport-door-Bj_ZIP85.js +0 -1
  551. package/dist/assets/worker-CC9Ug5Ei.js +0 -2
  552. package/dist/assets/workspace-arrangement-BdAlBwvd.js +0 -1
  553. package/dist/assets/world-documents-DBybpBq8.js +0 -1
  554. package/dist/assets/world-root-stage-binding-ZVYIgr74.js +0 -1
  555. package/dist/vgai-shared-react.json +0 -10
  556. package/dist/vgai-shared-three.json +0 -3
  557. package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  558. package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  559. package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  560. /package/dist/assets/{vgai-shared-fontawesome-CU65D4Ij.js → volter-shared-fontawesome-CU65D4Ij.js} +0 -0
  561. /package/dist/assets/{vgai-shared-jsx-dev-runtime-DFDKL7fx.js → volter-shared-jsx-dev-runtime-DFDKL7fx.js} +0 -0
  562. /package/dist/assets/{vgai-shared-jsx-runtime-DIqBpTut.js → volter-shared-jsx-runtime-DIqBpTut.js} +0 -0
  563. /package/dist/assets/{vgai-shared-react-BT7rMc2H.js → volter-shared-react-BT7rMc2H.js} +0 -0
  564. /package/dist/assets/{vgai-shared-react-dom-DFajMqMT.js → volter-shared-react-dom-DFajMqMT.js} +0 -0
  565. /package/dist/assets/{vgai-shared-react-dom-client-S0ozfl6_.js → volter-shared-react-dom-client-S0ozfl6_.js} +0 -0
  566. /package/dist/assets/{vgai-shared-three-DH4yxKwt.js → volter-shared-three-DH4yxKwt.js} +0 -0
  567. /package/template/{.vgai → .volter}/assets.json +0 -0
  568. /package/template/{.vgai → .volter}/provenance.json +0 -0
@@ -1 +0,0 @@
1
- import{g as re,a as oe}from"./board-guides-BEKPgD9M.js";import{el as se,bg as ne,bf as ie,ak as ae,em as le,dz as P,cw as D,dq as M,ap as I,di as $,en as C,eo as ce,ep as de,eq as O,er as ue,bk as pe,M as he,bl as ge}from"./index-BRJMIUK0.js";import{r as fe,c as ye}from"./relative-import-specifier-BFKIWEWs.js";import{s as be}from"./story-arg-descriptors-Ek86ExX7.js";import{b as me,a as Se,c as we,d as Re,e as E,f as ve,g as y,h as j,i as Ie,j as Ee}from"./inspect-Dr4qvDpJ.js";import{n as W,p as ke,t as Ae}from"./writer-tw6EcuVO.js";const _={count:0},Te="data-oid";function xe(u){return{count:u.size}}function K(u){return u.tagName.toLowerCase()==="svg"}function Y(u,e){const t=new Map,r=[];e.begin?.();const o=(s,n,i)=>{const l=Array.from(s.children);l.forEach((d,c)=>{if(e.skip?.(d))return;const a=e.identify(d,{ownerId:n,ownedByAncestor:i,parent:s,siblingIndex:c,siblings:l});a!==null&&(t.set(a,{object:d,id:a,parentId:n,childIds:[]}),n===null?r.push(a):t.get(n)?.childIds.push(a));const p=a??n,g=i||a!==null;e.descend?.(d)!==!1&&o(d,p,g),e.leave?.(d,a)})};return o(u,null,!1),{nodes:t,rootIds:r,stats:xe(t)}}function Ze(){return{project:u=>{const e=new Map;return Y(u,{begin:()=>e.clear(),identify:(t,r)=>{const o=t.tagName.toLowerCase();let s=0;for(let c=0;c<r.siblingIndex;c++)r.siblings[c].tagName.toLowerCase()===o&&s++;const n=`${o}[${s}]`,i=r.ownerId?e.get(r.ownerId)??"":"",l=i?`${i}/${n}`:n,d=`rdom:${l}`;return e.set(d,l),d},descend:t=>!K(t)})}}}function q(){return{project:u=>{const e=new Map;return Y(u,{begin:()=>e.clear(),identify:t=>{const r=t.getAttribute(Te);if(!r)return null;const o=e.get(r)??0;return e.set(r,o+1),o===0?r:`${r}#${o}`},descend:t=>!K(t)})}}}function Pe(u){return q().project(u)}class $e{constructor(e){this.identity=e}nodesById=new Map;objectsById=new Map;idsByObjectIndex=new Map;roots=[];walkStats=_;project(e){if(!e)return this.nodesById=new Map,this.objectsById=new Map,this.idsByObjectIndex=new Map,this.roots=[],this.walkStats=_,this.walkStats;const{nodes:t,rootIds:r,stats:o}=this.identity.project(e);return this.nodesById=t,this.objectsById=new Map([...t].map(([s,n])=>[s,n.object])),this.idsByObjectIndex=new Map([...t].map(([s,n])=>[n.object,s])),this.roots=r,this.walkStats=o,o}get nodes(){return this.nodesById}get objects(){return this.objectsById}get idsByObject(){return this.idsByObjectIndex}get rootIds(){return this.roots}get stats(){return this.walkStats}node(e){return this.nodesById.get(e)??null}rootNodes(){return this.roots.map(e=>this.nodesById.get(e)).filter(e=>e!==void 0)}objectOf(e){return this.objectsById.get(e)??null}idOf(e){return this.idsByObjectIndex.get(e)??null}}const H=64;function S(u){const e=u?.replace(/\s+/g," ").trim();return e?e.length<=H?e:`${e.slice(0,H-1).trimEnd()}…`:null}function x(u,e){return u?u[e]:void 0}const Ce=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+\s*)?\)$/;function Oe(u){if(typeof u!="string"||u==="")return;if(u.startsWith("#"))return u;const e=Ce.exec(u);if(!e)return;const t=r=>Number.parseInt(r,10).toString(16).padStart(2,"0");return`#${t(e[1])}${t(e[2])}${t(e[3])}`}function Be(u,e){switch(u){case"width":case"height":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":return{prop:u,cssValue:t=>`${t}px`};case"x":return e?{prop:"left",cssValue:t=>`${t}px`}:null;case"y":return e?{prop:"top",cssValue:t=>`${t}px`}:null;case"rotate":return{prop:"transform",cssValue:t=>`rotate(${t}deg)`};default:return null}}const Ne="data-oid",Le="http://www.w3.org/1999/xhtml",De=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function F(u,e){const t=u.namespaceURI;return t!=null&&t!==Le?!1:!De.has(e)}function k(u){const e=u.replaceAll("\\","/").replace(/^\.\//,""),t=e.lastIndexOf("/src/");return t>=0?e.slice(t+1):e}function Me(u){return Q(Pe(u))}function Q(u){const e=new Map;for(const[t,r]of u.nodes)e.set(t,{id:t,oid:r.object.getAttribute(Ne)??t,tag:r.object.tagName.toLowerCase(),el:r.object,parentId:r.parentId,childIds:[...r.childIds]});return{nodes:e,rootIds:[...u.rootIds]}}const Z=[{prop:"display",label:"Display",type:"enum",group:"Layout",options:["block","flex","grid","inline","inline-block","inline-flex","none"]},{prop:"flexDirection",label:"Direction",type:"enum",group:"Layout",options:["row","column","row-reverse","column-reverse"]},{prop:"flexWrap",label:"Wrap",type:"enum",group:"Layout",options:["nowrap","wrap","wrap-reverse"]},{prop:"justifyContent",label:"Justify",type:"enum",group:"Layout",options:["flex-start","center","flex-end","space-between","space-around","space-evenly"]},{prop:"alignItems",label:"Align",type:"enum",group:"Layout",options:["stretch","flex-start","center","flex-end","baseline"]},{prop:"gap",label:"Gap",type:"number",group:"Layout"},{prop:"gridTemplateColumns",label:"Columns",type:"string",group:"Layout"},{prop:"gridTemplateRows",label:"Rows",type:"string",group:"Layout"},{prop:"gridAutoFlow",label:"Flow",type:"enum",group:"Layout",options:["row","column","row dense","column dense"]},{prop:"rowGap",label:"Row Gap",type:"number",group:"Layout"},{prop:"columnGap",label:"Col Gap",type:"number",group:"Layout"},{prop:"gridColumn",label:"Grid Col",type:"string",group:"Layout"},{prop:"gridRow",label:"Grid Row",type:"string",group:"Layout"},{prop:"justifySelf",label:"Justify Self",type:"enum",group:"Layout",options:["auto","start","center","end","stretch"]},{prop:"overflow",label:"Overflow",type:"enum",group:"Layout",options:["visible","hidden","scroll","auto"]},{prop:"width",label:"Width",type:"number",group:"Layout"},{prop:"height",label:"Height",type:"number",group:"Layout"},{prop:"minWidth",label:"Min W",type:"number",group:"Layout"},{prop:"minHeight",label:"Min H",type:"number",group:"Layout"},{prop:"maxWidth",label:"Max W",type:"number",group:"Layout"},{prop:"maxHeight",label:"Max H",type:"number",group:"Layout"},{prop:"position",label:"Position",type:"enum",group:"Position",options:["static","relative","absolute","fixed","sticky"]},{prop:"top",label:"Top",type:"number",group:"Position"},{prop:"right",label:"Right",type:"number",group:"Position"},{prop:"bottom",label:"Bottom",type:"number",group:"Position"},{prop:"left",label:"Left",type:"number",group:"Position"},{prop:"zIndex",label:"Z Index",type:"number",group:"Position"},{prop:"flexGrow",label:"Grow",type:"number",group:"Position"},{prop:"flexShrink",label:"Shrink",type:"number",group:"Position"},{prop:"flexBasis",label:"Basis",type:"string",group:"Position"},{prop:"alignSelf",label:"Self Align",type:"enum",group:"Position",options:["auto","stretch","flex-start","center","flex-end","baseline"]},{prop:"marginTop",label:"Margin T",type:"number",group:"Spacing"},{prop:"marginRight",label:"Margin R",type:"number",group:"Spacing"},{prop:"marginBottom",label:"Margin B",type:"number",group:"Spacing"},{prop:"marginLeft",label:"Margin L",type:"number",group:"Spacing"},{prop:"paddingTop",label:"Padding T",type:"number",group:"Spacing"},{prop:"paddingRight",label:"Padding R",type:"number",group:"Spacing"},{prop:"paddingBottom",label:"Padding B",type:"number",group:"Spacing"},{prop:"paddingLeft",label:"Padding L",type:"number",group:"Spacing"},{prop:"color",label:"Color",type:"color",group:"Type"},{prop:"fontSize",label:"Size",type:"number",group:"Type"},{prop:"fontWeight",label:"Weight",type:"string",group:"Type"},{prop:"lineHeight",label:"Line H",type:"string",group:"Type"},{prop:"letterSpacing",label:"Spacing",type:"string",group:"Type"},{prop:"textAlign",label:"Align",type:"enum",group:"Type",options:["left","center","right","justify"]},{prop:"textTransform",label:"Transform",type:"enum",group:"Type",options:["none","uppercase","lowercase","capitalize"]},{prop:"fontStyle",label:"Style",type:"enum",group:"Type",options:["normal","italic"]},{prop:"fontFamily",label:"Font",type:"string",group:"Type"},{prop:"textDecoration",label:"Decoration",type:"enum",group:"Type",options:["none","underline","line-through","overline"]},{prop:"backgroundColor",label:"Background",type:"color",group:"Fill"},{prop:"backgroundImage",label:"Fills",type:"string",group:"Fill"},{prop:"backgroundSize",label:"Size",type:"enum",group:"Fill",options:["auto","cover","contain"]},{prop:"backgroundPosition",label:"Pos",type:"string",group:"Fill"},{prop:"backgroundRepeat",label:"Repeat",type:"enum",group:"Fill",options:["repeat","no-repeat","repeat-x","repeat-y"]},{prop:"borderColor",label:"Border Color",type:"color",group:"Stroke"},{prop:"borderWidth",label:"Border Width",type:"number",group:"Stroke"},{prop:"borderStyle",label:"Border Style",type:"enum",group:"Stroke",options:["none","solid","dashed","dotted","double"]},{prop:"borderRadius",label:"Radius",type:"number",group:"Stroke"},{prop:"opacity",label:"Opacity",type:"number",group:"Effects"},{prop:"boxShadow",label:"Box Shadow",type:"string",group:"Effects"},{prop:"mixBlendMode",label:"Blend",type:"enum",group:"Effects",options:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},{prop:"filter",label:"Filter",type:"string",group:"Effects"},{prop:"backdropFilter",label:"Backdrop",type:"string",group:"Effects"},{prop:"textShadow",label:"Text Shadow",type:"string",group:"Effects"},{prop:"cursor",label:"Cursor",type:"enum",group:"Effects",options:["auto","default","pointer","text","move","wait","help","crosshair","not-allowed","grab","grabbing","zoom-in","zoom-out","col-resize","row-resize","none"]},{prop:"transform",label:"Transform",type:"string",group:"Transform"}],f="style.",w="component source (JSX, via /__ui-source — writes are immediate; nothing pending to flush)",B="component source (JSX) — no source-write backend in this session",b="prop.",R="token.",A="story.arg.",G="text",je=30;let z=!1;const V=40,J="The source value is a dynamic expression, so replacing it with a literal is guarded.",ee={border:["borderWidth","borderStyle","borderColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderStyle:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"],margin:["marginTop","marginRight","marginBottom","marginLeft"],inset:["top","right","bottom","left"]},U=new Map(Object.entries(ee).flatMap(([u,e])=>e.map(t=>[t,u])));function We(u){const e=[];for(let t=U.get(u);t;t=U.get(t))e.unshift(t);return e}const T="portable-document",N="React Preview",_e=new Map(Z.map(({prop:u,type:e})=>[u,e])),He={borderTopLeftRadius:"borderRadius",borderTopRightRadius:"borderRadius",borderBottomLeftRadius:"borderRadius",borderBottomRightRadius:"borderRadius",borderTopWidth:"borderWidth",borderRightWidth:"borderWidth",borderBottomWidth:"borderWidth",borderLeftWidth:"borderWidth",borderTopStyle:"borderStyle",borderRightStyle:"borderStyle",borderBottomStyle:"borderStyle",borderLeftStyle:"borderStyle",borderTopColor:"borderColor",borderRightColor:"borderColor",borderBottomColor:"borderColor",borderLeftColor:"borderColor"},Fe=[{kind:"div",label:"Container"},{kind:"span",label:"Text"},{kind:"p",label:"Paragraph"},{kind:"button",label:"Button"},{kind:"a",label:"Link"},{kind:"img",label:"Image"},{kind:"ul",label:"List"},{kind:"li",label:"List Item"}],Ge=/\.(?:avif|gif|jpe?g|png|svg|webp)(?:[?#].*)?$/i;function ze(u,e){return e.type==="number"?String(Number(u)):e.type==="boolean"?u===!0||u==="true"?"true":"false":e.type==="vec3"&&Array.isArray(u)?`[${u.map(t=>Number(t)).join(", ")}]`:e.type==="json"?JSON.stringify(u):JSON.stringify(String(u))}const Ve={source:"source-code",label:"jsx",detail:"The JSX source is the document — edits write back to the component source file."};function X(u){const e=u;return(typeof e?.getAttribute=="function"?e.getAttribute("class")??"":"").split(/\s+/).filter(Boolean)}function Je(u,e){const t=u.style;return typeof t?.getPropertyValue!="function"?!1:t.getPropertyValue(Ee(e))!==""}class et{constructor(e,t,r={}){this.root=e,this.store=t,this.assetRoot=r.assetRoot??e,this.provenance=r.provenance??Ve,this.writeBackend=se(r.writeBackend,t.projectHistory),this.computedStyle=r.computedStyle??me,this.matchedCssRules=r.matchedCssRules??(a=>Se(a));const o=()=>{const a=this.root,p=typeof Element<"u"&&a instanceof Element?a.querySelector("[data-vgai-game-styles]")??a.closest?.("[data-vgai-game-styles]")??a:typeof document<"u"?document.documentElement:null;return typeof getComputedStyle=="function"&&p instanceof Element?getComputedStyle(p):void 0};this.designTokens=r.designTokens??(()=>we(o())),this.designTokenValue=r.designTokens?a=>r.designTokens().find(p=>p.name===a)?.value:a=>o()?.getPropertyValue(a).trim()||void 0,this.portableStories=[...r.portableStories??[]];for(const a of this.portableStories)this.portableStoryArgs.set(a.id,{...a.args??{}});const s=r.portableDocuments??(this.portableStories.length>0?[{id:T,label:N,storyIds:this.portableStories.map(a=>a.id)}]:[]),n=new Set(this.portableStories.map(a=>a.id)),i=new Set,l=new Set,d=s.flatMap(a=>{if(l.has(a.id))return[];l.add(a.id);const p=a.storyIds.filter(g=>!n.has(g)||i.has(g)?!1:(i.add(g),!0));return p.length===0?[]:[{id:a.id,label:a.label??(a.path?ne(ie({modulePath:a.path,title:a.title})):N),...a.path?{path:a.path}:{},storyIds:p}]}),c=this.portableStories.map(a=>a.id).filter(a=>!i.has(a));c.length>0&&d.push({id:l.has(T)?`${T}:unassigned`:T,label:N,storyIds:c}),this.portableDocuments=d,this.portableHierarchy=r.portableHierarchy??null,this.portableDefaultStoryId=this.portableStories.some(a=>a.id===r.activePortableStoryId)?r.activePortableStoryId??null:this.portableStories[0]?.id??null,this.onPortableStoryApplied=r.onPortableStoryApplied,this.onPortableStoryArgsChanged=r.onPortableStoryArgsChanged,this.activeStoryId=this.portableDefaultStoryId,this.capabilities={transform:!1,inspectorFields:!0,persist:!0};{const a=ae(()=>this.reconcileEchoAfterReload());this.disposeReloadSignal=a}this.writeBackend?.index&&this.writeBackend.index().then(a=>{this.oidIndex=new Map(Object.entries(a)),this.store.notifyIngestEdit()}).catch(()=>{})}capabilities;provenance;writeBackend;projector=new $e(q());hierarchySnapshotCache=null;hierarchySnapshotClearQueued=!1;computedStyle;matchedCssRules;designTokens;designTokenValue;oidIndex=new Map;dirty=!1;valueEcho=new Map;guardedPaths=new Map;lockedIds=new Set;assetRoot;pendingSourceReconcile=0;lastResolvedSelection=[];selectionRepairWatching=!1;disposeReloadSignal;portableStories;portableStoryArgs=new Map;portableDocuments;portableHierarchy;portableDefaultStoryId;onPortableStoryApplied;onPortableStoryArgsChanged;activeStoryId=null;boxEditSession=null;boxEditTail=Promise.resolve();snapshot(){return this.projector.project(this.root),Q({nodes:this.projector.nodes,rootIds:[...this.projector.rootIds]})}hierarchySnapshot(){return this.hierarchySnapshotCache??=this.snapshot(),this.hierarchySnapshotClearQueued||(this.hierarchySnapshotClearQueued=!0,queueMicrotask(()=>{this.hierarchySnapshotCache=null,this.hierarchySnapshotClearQueued=!1})),this.hierarchySnapshotCache}async refreshOidIndex(){const e=await this.writeBackend?.index?.();e&&(this.oidIndex=new Map(Object.entries(e)),this.store.notifyIngestEdit())}setEcho(e,t,r){let o=this.valueEcho.get(e);o||(o=new Map,this.valueEcho.set(e,o)),o.set(t,r)}clearEcho(e,t){const r=this.valueEcho.get(e);r&&(r.delete(t),r.size===0&&this.valueEcho.delete(e))}markGuarded(e,t,r){this.guardedPaths.set(`${e}|${t}`,r)}readEcho(e,t){const r=this.valueEcho.get(e);return r?.has(t)?{hit:!0,value:r.get(t)}:{hit:!1,value:void 0}}reconcileEchoAfterReload(){this.scheduleSelectionRepair(),!(this.valueEcho.size===0&&this.pendingSourceReconcile===0)&&(this.valueEcho.clear(),this.pendingSourceReconcile>0&&this.pendingSourceReconcile--,this.store.notifyIngestEdit())}scheduleSelectionRepair(){if(this.selectionRepairWatching||this.lastResolvedSelection.length===0)return;this.selectionRepairWatching=!0;let e=0,t=!1;const r=()=>{if(e++,t=this.repairSelectionAfterReprojection(t)||t,e>=je){this.selectionRepairWatching=!1;return}setTimeout(r,V)};setTimeout(r,V)}repairSelectionAfterReprojection(e){const t=this.lastResolvedSelection;if(t.length===0||this.store.selectedEntityIds.size>0)return!1;const r=this.snapshot(),o=t.filter(s=>r.nodes.has(s));return o.length===0?(e||console.warn(`[ReactRootAuthoringAdapter] the re-projection dropped the selection (${t.join(", ")}) and none of those ids resolve in the remounted tree, so it cannot be restored. An inspector write issued now has no subject — re-select.`),this.lastResolvedSelection=[],!0):(!e&&!z&&(z=!0,console.warn(`[ReactRootAuthoringAdapter] OPEN DEFECT, repaired: an HMR re-projection drops this root's selection, and the editor is putting it back — restoring ${o.length} of ${t.length} id(s) that still resolve in the remounted tree (${o.join(", ")}). A write issued in that window has no subject. Named once per session; the repair runs on every re-projection.`)),this.store.selectMultiple([...o]),!0)}disposeReactRootAdapter(){this.disposeReloadSignal?.()}componentName(e){return this.oidIndex.get(e.oid)?.component??Re(e.el)??null}elementLabel(e,t){const r=S(e.el.getAttribute("data-vgai-name"));if(r)return r;const o=e.el.getAttribute("aria-labelledby");if(o){const l=o.split(/\s+/).map(c=>Array.from(t.nodes.values()).find(a=>a.el.getAttribute("id")===c)).map(c=>S(c?.el.textContent)).filter(c=>c!==null),d=S(l.join(" "));if(d)return d}const s=S(e.el.getAttribute("aria-label"));if(s)return s;if(["section","article","aside","nav","main","header","footer"].includes(e.tag)){const l=e.childIds.map(c=>t.nodes.get(c)).find(c=>c!==void 0&&/^h[1-6]$/.test(c.tag)),d=S(l?.el.textContent);if(d)return d}if(/^(h[1-6]|p|span|label|button|a|time|output|dt|dd|li|legend|caption|summary)$/.test(e.tag)){const l=S(e.el.textContent);if(l)return l}for(const l of["alt","title","placeholder","name"]){const d=S(e.el.getAttribute(l));if(d)return d}const n=e.el.getAttribute("id");if(n)return`#${n}`;const i=(e.el.getAttribute("class")??"").split(/\s+/).filter(Boolean)[0];return i?`${e.tag}.${i}`:e.tag}toEditorNode(e,t=this.snapshot()){const r=this.componentName(e),o=e.parentId?t.nodes.get(e.parentId):null,s=o?this.componentName(o):null,n=r!==null&&r!==s,i=e.el.getAttribute("data-vgai-hierarchy-id"),l=e.el.getAttribute("data-vgai-hierarchy-parent-id"),d=e.el.getAttribute("data-vgai-hierarchy-order"),c=e.el.getAttribute("data-vgai-hierarchy-group-label"),a=d===null?void 0:Number(d),p={id:e.id,label:n?r:this.elementLabel(e,t),...n?{secondaryLabel:`<${e.tag}>`}:{},role:n?"component":"element",kind:e.tag,parentId:e.parentId,childIds:e.childIds,...i===null?{}:{crossSurfaceId:i},...l===null?{}:{crossSurfaceParentId:l},...a===void 0||!Number.isInteger(a)?{}:{crossSurfaceOrder:a},...c===null?{}:{crossSurfaceGroupLabel:c}};return this.portableStories.length>0&&p.parentId===null?{...p,parentId:this.activeStoryId}:p}crossSurfaceStructureSignature(){const e=this.hierarchySnapshot(),t=new Set;for(const r of e.nodes.values())(r.el.getAttribute("data-vgai-hierarchy-id")!==null||r.el.getAttribute("data-vgai-hierarchy-parent-id")!==null||r.el.getAttribute("data-vgai-hierarchy-order")!==null||r.el.getAttribute("data-vgai-hierarchy-group-label")!==null)&&t.add(r.id);return t.size===0?null:JSON.stringify([...e.nodes.values()].flatMap(r=>{if(!t.has(r.id))return[];let o=r.parentId;for(;o!==null&&!t.has(o);)o=e.nodes.get(o)?.parentId??null;return[[r.id,o,r.el.getAttribute("data-vgai-hierarchy-id"),r.el.getAttribute("data-vgai-hierarchy-parent-id"),r.el.getAttribute("data-vgai-hierarchy-order"),r.el.getAttribute("data-vgai-hierarchy-group-label")]]}))}portableDocumentNode(e){return{id:e.id,label:e.label,...e.path?{secondaryLabel:e.path}:{},role:"document",kind:"tsx",parentId:null,childIds:[...e.storyIds]}}portableDocumentForStory(e){return this.portableDocuments.find(t=>t.storyIds.includes(e))??null}portableHierarchyNode(e){return this.portableHierarchy?.nodes.find(t=>t.id===e)??null}portableStoriesForNode(e){if(e===le)return[...this.portableStories];if(!this.portableHierarchy)return[...this.portableStories];const t=this.portableHierarchyNode(e);if(t&&t.role!=="component")return[];const r=t?.role==="component"?t.id:this.portableHierarchy.storyParentIds.get(e)??this.portableHierarchy.storyParentIds.get(this.activeStoryId??"");if(!r)return[];const o=this.portableHierarchyNode(r),s=new Set(o?.childIds??[]);return this.portableStories.filter(n=>s.has(n.id))}portableStoryNode(e,t){const r=e.id===this.activeStoryId;return{id:e.id,label:e.label,role:"story",kind:"story",parentId:this.portableHierarchy?.storyParentIds.get(e.id)??this.portableDocumentForStory(e.id)?.id??T,childIds:r?t:[]}}hierarchy={crossSurfaceStructureSignature:()=>this.crossSurfaceStructureSignature(),roots:()=>{const e=this.hierarchySnapshot(),{nodes:t,rootIds:r}=e;return this.portableStories.length>0?this.portableHierarchy?this.portableHierarchy.rootIds.flatMap(o=>{const s=this.portableHierarchy?.nodes.find(n=>n.id===o);return s?[{...s,childIds:[...s.childIds]}]:[]}):this.portableDocuments.map(o=>this.portableDocumentNode(o)):r.map(o=>this.toEditorNode(t.get(o),e))},node:e=>{if(this.portableStories.length>0){const o=this.portableHierarchy?.nodes.find(i=>i.id===e);if(o)return{...o,childIds:[...o.childIds]};const s=this.portableDocuments.find(i=>i.id===e);if(s)return this.portableDocumentNode(s);const n=this.portableStories.find(i=>i.id===e);if(n)return this.portableStoryNode(n,this.hierarchySnapshot().rootIds)}const t=this.hierarchySnapshot(),r=t.nodes.get(e);return r?this.toEditorNode(r,t):null}};selection={get:()=>{const e=[...this.store.selectedEntityIds];return e.length>0&&(this.lastResolvedSelection=e),e},set:e=>this.store.selectMultiple(e),resolve:(e,t)=>{const r=this.hierarchy.node(e);if(!r)return null;const o=[];let s=r,n=0;for(;s&&n++<1e3;)(s.role==="component"||s.role==="instance"||s.role==="boundary")&&o.push(s),s=s.parentId?this.hierarchy.node(s.parentId):null;const i=o.reverse();if(i.length===0)return{id:e};const l=t?.scopeId?i.findIndex(a=>a.id===t.scopeId):-1;let d=l>=0?l+1:0;return t?.intent==="deep"&&(d+=1),{id:(i[d]??r).id}}};truth={resolve:e=>{const t=this.snapshot().nodes.get(e);if(!t)return{site:{anchored:!1,reason:"This row is a design document, not a JSX element."},writeAnchorKind:void 0};const r=this.oidIndex.get(t.oid),o=this.writeBackend?"source-prop":"live-only";if(!r)return{site:{anchored:!1,reason:"Source metadata is still loading or unavailable."},writeAnchorKind:o};const s=k(r.file);return{site:{anchored:!0,kind:"source",file:s,line:r.line,col:r.col,display:`${s}:${r.line}`},writeAnchorKind:o}}};related={links:e=>this.hierarchy.node(e)?.role!=="component"||this.stories.storiesFor(e).length===0?[]:[{id:`definition:${P}`,title:"Open in UI Components",open:()=>{D(P)}}]};instanceSource(e){const t=this.snapshot().nodes.get(e);if(!t||this.hierarchy.node(e)?.role!=="component")return null;const r=E(t.el);if(!r)return null;const o=this.oidIndex.get(r.callSiteOid);return!o||!/^[A-Z]/.test(o.tag)?null:{node:t,callSiteOid:r.callSiteOid,callSite:o,props:r.props}}instanceProp(e,t){if(!t.startsWith(b))return null;const r=this.instanceSource(e);if(!r)return null;const o=t.slice(b.length),s=r.callSite.props?.find(i=>i.name===o),n=r.callSite.authoredProps?.find(i=>i.name===o);return s&&n?{source:r,prop:o,spec:s,authored:n}:null}affectedInstances(e,t){const r=this.instanceSource(e);if(!r)return 0;let o=0;for(const s of this.snapshot().nodes.values()){const n=E(s.el);if(!n)continue;const i=this.oidIndex.get(n.callSiteOid);!i||i.tag!==r.callSite.tag||(s.id===e||!i.authoredProps?.some(l=>l.name===t))&&o++}return Math.max(1,o)}instances={openComponent:()=>{D(P)},describe:e=>{const t=this.instanceSource(e);if(!t||this.stories.storiesFor(e).length===0)return null;const r=Object.entries(t.props).flatMap(([o,s])=>{const n=`${b}${o}`,i=this.instanceProp(e,n);if(!i)return[];const l=i.authored.literal&&i.spec.defaultValue!==void 0&&t.node.oid!==t.callSiteOid&&!!this.writeBackend?.runGesture&&!!this.writeBackend.writeComponentDefault&&!!this.writeBackend.removeProp;return[{path:n,label:o,value:s,...i.spec.defaultText===void 0?{}:{defaultText:i.spec.defaultText},canApplyToComponent:l,affectedInstanceCount:this.affectedInstances(e,o),...l?{}:{applyUnavailableReason:i.authored.literal?i.spec.defaultValue===void 0?"The component default is computed or absent, so source cannot be changed safely.":"This session cannot atomically update the component and its callsite.":"The callsite value is a dynamic expression, so it cannot become a component literal."}}]});return{componentName:t.callSite.tag,sourcePath:k(t.callSite.file),overrides:r}},revert:async(e,t)=>{const r=this.instanceSource(e),o=this.writeBackend;if(!r||!o?.removeProp)return;const s=t.map(l=>this.instanceProp(e,l)?.prop).filter(l=>!!l);let n=!1;const i=async l=>{for(const d of s){const c=await l.removeProp?.(r.callSiteOid,d);n||=c?.changed===!0}};if(s.length>1&&o.runGesture?await o.runGesture(`Revert ${s.length} Overrides`,i):await i(o),!!n)return this.dirty=!0,this.pendingSourceReconcile++,await this.refreshOidIndex(),{destination:w,persisted:!0}},applyToComponent:async(e,t)=>{const r=this.instanceProp(e,t),o=this.writeBackend;if(!r||!r.authored.literal||r.spec.defaultValue===void 0||r.source.node.oid===r.source.callSiteOid||!o?.runGesture||!o.writeComponentDefault||!o.removeProp)return{changed:!1,message:"Apply was refused because both literal source writes are not available."};const s=r.source.props[r.prop];return await o.runGesture(`Apply ${r.prop} to ${r.source.callSite.tag}`,async n=>{const i=await n.writeComponentDefault?.(r.source.node.oid,r.prop,ze(s,r.spec));if(!i?.changed)throw new Error(i?.error??"The component default did not change.");const l=await n.removeProp?.(r.source.callSiteOid,r.prop);if(!l?.changed)throw new Error(l?.error??"The callsite override was not removed.")}),this.dirty=!0,this.pendingSourceReconcile++,await this.refreshOidIndex(),{changed:!0,message:`${r.prop} now defaults to ${String(s)} in ${r.source.callSite.tag}.`,write:{destination:w,persisted:!0}}}};pickable={pick:(e,t)=>{const{nodes:r}=this.snapshot();let o=null,s=Number.POSITIVE_INFINITY,n=-1,i=-1;for(const l of r.values()){if(i++,this.lockedIds.has(l.id)||x(l.el.style,"pointerEvents")==="none")continue;const d=l.el.getBoundingClientRect?.();if(!d||e<d.left||e>d.right||t<d.top||t>d.bottom)continue;const c=d.width*d.height;(c<s||c===s&&i>n)&&(o=l.id,s=c,n=i)}return o}};hostRect(){const e=this.root.getBoundingClientRect?.();return{left:e?.left??0,top:e?.top??0}}toHostRelative(e){const t=this.hostRect(),r=M().zoom;return{x:(e.left-t.left)/r,y:(e.top-t.top)/r,width:e.width/r,height:e.height/r}}rects={rect:e=>{const r=this.snapshot().nodes.get(e)?.el.getBoundingClientRect?.();return r?this.toHostRelative(r):null},contextRects:e=>{const{nodes:t}=this.snapshot(),r=t.get(e);if(!r)return{};const o=r.parentId?t.get(r.parentId):void 0,s=o?.el.getBoundingClientRect?.(),i=(o?o.childIds:this.snapshot().rootIds).filter(h=>h!==e).map(h=>t.get(h)?.el.getBoundingClientRect?.()).filter(h=>h!=null).map(h=>this.toHostRelative(h)),l=r.el,d=l.getBoundingClientRect?.();let c;if(d){const h=I(y(l,"borderTopWidth",this.computedStyle))??0,v=I(y(l,"borderRightWidth",this.computedStyle))??0,te=I(y(l,"borderBottomWidth",this.computedStyle))??0,L=I(y(l,"borderLeftWidth",this.computedStyle))??0;c=this.toHostRelative({left:d.left+L,top:d.top+h,width:Math.max(0,d.width-L-v),height:Math.max(0,d.height-h-te)})}const a=re(),p=this.hostRect(),g=M().zoom,m=a.x.length>0||a.y.length>0?{x:a.x.map(h=>(h-p.left)/g),y:a.y.map(h=>(h-p.top)/g)}:void 0;return{...s?{parent:this.toHostRelative(s)}:{},...i.length?{siblings:i}:{},...c?{paddingBox:c}:{},...m?{guideEdges:m}:{}}},emptyContainers:()=>{const{nodes:e}=this.snapshot(),t=[];for(const r of e.values()){const o=r.el.getBoundingClientRect?.();!o||!F(r.el,r.tag)||t.push({oid:r.id,rect:this.toHostRelative(o),displayName:r.tag,hasVisibleChildren:r.el.children.length>0,hasText:(r.el.textContent??"").trim().length>0})}return ve(t).map(r=>({id:r.oid,rect:r.rect,displayName:r.displayName}))}};colorSample={backgroundChainAt:(e,t)=>{const r=this.pickable.pick(e,t);if(!r)return null;const{nodes:o}=this.snapshot(),s=[];let n=o.get(r);for(;n;)s.push(y(n.el,"backgroundColor",this.computedStyle)),n=n.parentId?o.get(n.parentId):void 0;return s}};boxEdit={begin:e=>{this.boxEditSession={id:e,touched:new Map,priorInline:new Map}},apply:(e,t)=>{const r=this.boxEditSession;if(!r||r.id!==e)return;const o=this.snapshot().nodes.get(e);if(!o)return;const s=y(o.el,"position",this.computedStyle),n=s==="absolute"||s==="fixed";for(const[i,l]of Object.entries(t)){const d=Be(i,n);if(!d){console.warn(`[ReactRootAuthoringAdapter] boxEdit: dropping patch key "${i}" for "${e}" — `+(i==="x"||i==="y"?`node is not absolutely/fixed positioned (computed position: "${s}"), no left/top to move`:"unrecognized box-edit patch key")),(i==="x"||i==="y")&&!r.hinted&&(r.hinted=!0,$(`${o.tag} flows in its layout (position: ${s}), so a drag cannot move it. Set Position to "abs" in the Inspector to place it freely; drag a handle to resize.`));continue}if(!r.priorInline.has(d.prop)){const p=x(o.el.style,d.prop);r.priorInline.set(d.prop,p==null?"":String(p))}let c=l;if((i==="x"||i==="y")&&typeof l=="number"){const p=o.el,g=p.getBoundingClientRect?.();if(g&&typeof p.offsetLeft=="number"&&typeof p.offsetTop=="number"){const m=this.toHostRelative(g),h=i==="x"?m.x-p.offsetLeft:m.y-p.offsetTop;c=Math.round(l-h)}}const a=d.cssValue(c);o.el.style&&(o.el.style[d.prop]=a),r.touched.set(d.prop,d.prop==="transform"?a:c)}},end:e=>{const t=this.boxEditSession;this.boxEditSession=null,!(!t||t.id!==e||t.touched.size===0)&&(this.boxEditTail=this.boxEditTail.then(()=>this.commitBoxEdit(e,t.touched,t.priorInline),()=>this.commitBoxEdit(e,t.touched,t.priorInline)),this.boxEditTail.catch(r=>{console.error("[ReactRootAuthoringAdapter] box edit failed and was not committed.",r)}))}};async commitBoxEdit(e,t,r){const o=this.dirty;for(const[i,l]of t)this.setEcho(e,`${f}${i}`,l);let s=0;this.lastStyleWriteRefusal=null;const n=async i=>{for(const[l,d]of t){const c=typeof d=="number"?`${d}px`:d;await this.writeStyleEntry(e,l,c,r.get(l),i)&&(s+=1)}if(s===0&&t.size>0){const l=this.lastStyleWriteRefusal??"the write was refused without a reason";he.error(`The last edit on this element was NOT saved — ${l}`,"authoring"),$("Not saved: the edit could not be written to source — see the Console.")}};try{this.writeBackend?.runGesture?await this.writeBackend.runGesture(`Edit ${t.size} Styles`,n):await n(this.writeBackend)}catch(i){const l=this.snapshot().nodes.get(e);for(const[d,c]of r)this.clearEcho(e,`${f}${d}`),l?.el.style&&(l.el.style[d]=c);throw this.dirty=o,this.store.notifyIngestEdit(),i}}text={get:e=>{if(this.guardedPaths.has(`${e}|${G}`))return null;const t=this.snapshot().nodes.get(e);if(!t||t.el.children.length>0)return null;const r=t.el.textContent;if(r==null)return null;const o=r.trim();return o||null},set:(e,t)=>{this.editText(e,t)}};inspector={properties:e=>{const t=this.portableHierarchyNode(e);if(t)return t.secondaryLabel?[{path:"document.path",label:"Source",type:"string",readonly:!0,group:"Document"}]:[];const r=this.portableDocuments.find(n=>n.id===e);if(r)return r.path?[{path:"document.path",label:"Source",type:"string",readonly:!0,group:"Document"}]:[];if(this.portableStories.some(n=>n.id===e))return this.portableStoryArgDescriptors(e);const s=[...Z.map(({prop:n,label:i,type:l,group:d,options:c})=>({path:`${f}${n}`,label:i,type:l,group:d,...c?{options:c}:{}})),...this.propDescriptors(e),...this.tokenDescriptors()];return this.guardedPaths.size===0?s:s.map(n=>{const i=this.guardedPaths.get(`${e}|${n.path}`);return i?{...n,readonly:!0,readonlyReason:i}:n})},get:(e,t)=>{const r=this.portableHierarchyNode(e);if(r)return t==="document.path"?r.secondaryLabel:void 0;const o=this.portableDocuments.find(a=>a.id===e);if(o)return t==="document.path"?o.path:void 0;if(this.portableStories.some(a=>a.id===e))return t==="story.active"?e===this.activeStoryId:t.startsWith(A)?this.portableStoryArgs.get(e)?.[t.slice(A.length)]:void 0;const s=this.readEcho(e,t);if(s.hit)return s.value;if(t==="locked")return this.lockedIds.has(e);if(t==="visible"){const a=this.readEcho(e,`${f}visibility`);if(a.hit)return a.value!=="hidden";const p=this.snapshot().nodes.get(e);return p?y(p.el,"visibility",this.computedStyle)!=="hidden":void 0}if(t.startsWith(R)){const a=t.slice(R.length);return this.designTokenValue(a)}if(t.startsWith(b)){const a=this.snapshot().nodes.get(e);return(a?E(a.el):null)?.props[t.slice(b.length)]}if(!t.startsWith(f))return;const n=t.slice(f.length),i=this.snapshot().nodes.get(e);if(!i)return;const l=x(i.el.style,n),d=typeof l=="string"&&l!==""?l:typeof l=="number"?String(l):y(i.el,n,this.computedStyle),c=_e.get(n);return c==="number"?I(d):c==="color"?Oe(d):d||void 0},set:(e,t,r)=>{if(this.portableHierarchyNode(e)||this.portableDocuments.some(s=>s.id===e))return;if(this.portableStories.some(s=>s.id===e)){if(!t.startsWith(A))return;const s=t.slice(A.length),n=this.portableStoryArgs.get(e);if(!n||!(s in n))return;const i={...n,[s]:r};this.portableStoryArgs.set(e,i),this.onPortableStoryArgsChanged?.(e,{...i}),this.store.notifyIngestEdit();return}if(t==="locked"){r?this.lockedIds.add(e):this.lockedIds.delete(e),this.store.notifyIngestEdit();return}if(t==="visible"){const s=r?"visible":"hidden";return this.setEcho(e,`${f}visibility`,s),this.pipedSourceWrite(()=>this.writeStyle(e,"visibility",s))}if(t.startsWith(b))return this.setEcho(e,t,r),this.pipedSourceWrite(()=>this.writePropEdit(e,t.slice(b.length),String(r)));if(t.startsWith(R))return this.setEcho(e,t,r),this.pipedSourceWrite(()=>this.writeTokenValue(e,t.slice(R.length),String(r)));if(!t.startsWith(f))return;const o=t.slice(f.length);return this.setEcho(e,t,r),this.pipedSourceWrite(()=>this.writeStyle(e,o,r))},remove:(e,t)=>{if(!t.startsWith(f))return;const r=t.slice(f.length),o=He[r];return o?this.setEcho(e,t,this.inspector.get(e,`${f}${o}`)):this.clearEcho(e,t),this.pipedSourceWrite(()=>this.removeStyleProp(e,r))}};assetSubject={get:e=>this.assetSubjectForNode(this.snapshot(),e),entries:()=>{const e=Me(this.assetRoot);return[...e.nodes.keys()].flatMap(t=>{const r=this.assetSubjectForNode(e,t);return r?[{id:t,subject:r}]:[]})}};assetSubjectForNode(e,t){const r=e.nodes.get(t);if(!r||r.tag!=="svg"||!r.el.outerHTML)return null;const o=this.oidIndex.get(r.oid);return{kind:"image",name:this.componentName(r)??this.elementLabel(r,e),mediaType:"image/svg+xml",text:r.el.outerHTML,...o?.file?{sourcePath:k(o.file)}:{}}}portableStoryArgDescriptors(e){return be(this.portableStoryArgs.get(e)??{},A)}portableArgs(e){const t=this.portableStoryArgs.get(e);return t?{...t}:null}elementClasses(e){const r=this.snapshot().nodes.get(e)?.el;if(!r||typeof r.getAttribute!="function")return[];const o=(r.getAttribute("class")??"").split(/\s+/).filter(Boolean),s=(typeof r.closest=="function"?r.closest("[data-vgai-game-styles]"):null)??r.ownerDocument;return o.map(n=>{let i=0;try{i=s?.querySelectorAll?.(`.${CSS.escape(n)}`).length??0}catch{}return{name:n,count:i,styledIn:j(n)?.sourceFile??null}})}async writeNamedStyle(e,t){const r=this.snapshot().nodes.get(e);if(!r)return{changed:!1,error:`"${e}" no longer resolves in this root`};const o=c=>(console.warn(`[ReactRootAuthoringAdapter] named-style ${t.kind} refused: ${c}`),{changed:!1,error:c});if(t.kind==="remove"){const c=await C({op:"remove",oid:r.oid,className:t.className});return c.changed?(this.dirty=!0,this.store.notifyIngestEdit(),{changed:!0}):o(c.error??"no change")}if(j(t.className)){const c=await C({op:"apply",oid:r.oid,className:t.className});return c.changed?(this.dirty=!0,this.store.notifyIngestEdit(),{changed:!0}):o(c.error??"the element already wears this class")}const n=c=>c!==void 0&&!c.includes("/packages/editor/")&&!c.includes("/node_modules/")&&!c.includes("/vendor/"),i=this.matchedCssRules(r.el).filter(c=>n(c.sourceFile)),l=i[i.length-1]?.sourceFile??Ie().find(n),d=await C({op:"create",oid:r.oid,className:t.className,...l!==void 0?{file:l}:{}});return d.changed?(this.dirty=!0,this.store.notifyIngestEdit(),{changed:!0,created:!0}):o(d.error??"no change")}async writeStory(e,t){const r=this.portableStories.find(n=>n.id===e);if(!r)return{changed:!1,error:`unknown portable story '${e}'`};if(!r.name||!r.modulePath)return{changed:!1,error:`story '${r.label}' carries no source address (name/modulePath) — it is not writable from this session`};const o=t.kind==="save-as"?{op:"save",file:r.modulePath,name:t.name,args:this.portableStoryArgs.get(e)??{}}:t.kind==="rename"?{op:"rename",file:r.modulePath,name:r.name,newName:t.newName}:{op:"delete",file:r.modulePath,name:r.name},s=await ce(o);if(!s.changed)return console.warn(`[ReactRootAuthoringAdapter] csf-story ${t.kind} refused for '${r.label}': ${s.error??"no change"}`),{changed:!1,...s.error!==void 0?{error:s.error}:{}};if(t.kind==="rename")r.name=t.newName,r.label=t.newName.replace(/([a-z])([A-Z])/g,"$1 $2");else if(t.kind==="delete"){const n=this.portableStories.indexOf(r);n>=0&&this.portableStories.splice(n,1),this.activeStoryId===e&&(this.activeStoryId=null)}return this.dirty=!0,this.store.notifyIngestEdit(),{changed:!0}}resetPortableArgs(e){const t=this.portableStories.find(o=>o.id===e);if(!t)return;const r={...t.args??{}};this.portableStoryArgs.set(e,r),this.onPortableStoryArgsChanged?.(e,{...r}),this.store.notifyIngestEdit()}propDescriptors(e){const t=this.snapshot().nodes.get(e),r=t?E(t.el):null;return r?Object.keys(r.props).map(o=>({path:`${b}${o}`,label:o,type:"string",group:"Props"})):[]}tokenDescriptors(){return this.designTokens().map(e=>({path:`${R}${e.name}`,label:e.name,type:"string",group:"Tokens",readonly:!e.declaredIn}))}async writeTokenValue(e,t,r){const o=`${R}${t}`,s=this.designTokens().find(l=>l.name===t);if(!s)return this.clearEcho(e,o),console.warn(`[ReactRootAuthoringAdapter] unknown design token "${t}".`),!1;if(!s.declaredIn)return this.clearEcho(e,o),console.warn(`[ReactRootAuthoringAdapter] token "${t}" has no stylesheet declaration to edit — it is set by script (a theme data module mirroring itself onto :root, or host style). Edit that source; it is plain data.`),!1;const n=this.writeBackend;if(!n?.writeCss)return this.clearEcho(e,o),console.warn(`[ReactRootAuthoringAdapter] cannot write token "${t}": no css-capable source-write backend in this session (hosted/no dev server).`),!1;const i=await n.writeCss(s.declaredIn.sourceFile,s.declaredIn.selector,t,r);return i.changed?(this.dirty=!0,this.store.notifyIngestEdit(),!0):(this.clearEcho(e,o),console.warn(`[ReactRootAuthoringAdapter] token write refused/no-op for "${t}" at ${s.declaredIn.sourceFile} (${s.declaredIn.selector}): ${i.error??"no change"}`),!1)}stories={storiesFor:e=>this.portableStories.length>0?this.portableStoriesForNode(e):[],active:e=>this.activeStoryId,apply:(e,t)=>{if(t!==null&&!this.portableStories.some(r=>r.id===t)){console.warn(`[ReactRootAuthoringAdapter] stories.apply: unknown portable CSF story id "${t}" — ignoring.`);return}this.activeStoryId=t??this.portableDefaultStoryId,this.onPortableStoryApplied?.(t),this.store.notifyIngestEdit()},unavailable:()=>de()};structure={create:(e,t)=>({id:"",ack:this.structOp(t??"","create",{wrapperTag:e})}),remove:e=>this.removeElement(e),removeMany:e=>this.removeManyElements(e),duplicate:e=>({id:e,ack:this.structOp(e,"duplicate")}),reparent:(e,t)=>{const r=t?this.oidOf(t):void 0;return r?this.structOp(e,"reparent",{parentOid:r}):this.structRefusal(`reparent refused: "${t??"the document root"}" has no authored source element to move into.`)},reorder:(e,t)=>{const r=t===null?this.snapshot().nodes.get(e)?.parentId??null:null;return this.reorder(e,t,r)},creatableKinds:()=>[...Fe],wrap:(e,t)=>this.wrap(e,t),unwrap:e=>this.unwrap(e)};assetDrop={accepts:(e,t,r)=>this.assetDropPlan(e,t,r).ok,drop:(e,t,r)=>{const o=this.assetDropPlan(e,t,r);return o.ok?this.structOp(o.parentId,"create",{snippet:o.snippet,...o.ensureImport?{ensureImport:o.ensureImport}:{}}):this.structRefusal(`asset drop refused — ${o.reason}`)}};assetDropPlan(e,t,r){if(!this.writeBackend)return{ok:!1,reason:"This session has no source writer, so nothing can be added."};const o=this.snapshot().nodes.get(e);if(!o)return{ok:!1,reason:"That row has no authored JSX element."};if(!F(o.el,o.tag))return{ok:!1,reason:`<${o.tag}> cannot contain child elements.`};const s=r?.item?.kind==="component"?r.item:null;if(s){if(s.surface!=="dom")return{ok:!1,reason:`${s.name} is a ${s.surface} component, not a React UI component.`};const n=this.sourceLocation(e)?.file;return n?{ok:!0,parentId:e,snippet:`<${s.name} />`,ensureImport:{name:s.name,module:this.relativeProjectModule(n,s.sourcePath),kind:s.exportKind}}:{ok:!1,reason:"The target source location has not loaded yet."}}return Ge.test(t)?{ok:!0,parentId:e,snippet:`<img src=${JSON.stringify(t)} alt="" />`}:{ok:!1,reason:`${t} is not a browser image asset and has no DOM element to become.`}}relativeProjectModule(e,t){return fe(k(e),k(t))}wrap(e,t="div"){return this.structOp(e,"wrap",{wrapperTag:t})}unwrap(e){return this.structOp(e,"unwrap")}reorder(e,t,r){const o={},s=t?this.oidOf(t):void 0,n=r?this.oidOf(r):void 0;return s&&(o.targetOid=s),n&&(o.parentOid=n),this.structOp(e,"reorder",o)}oidOf(e){return this.snapshot().nodes.get(e)?.oid}sourceLocation(e){const t=this.oidOf(e);if(t)return this.oidIndex.get(t)}structOp(e,t,r){return this.structPipe.structOp(this.oidOf(e),e,t,r,w)}lastStyleWriteRefusal=null;refuseStyleWrite(e){this.lastStyleWriteRefusal=e,console.warn(e)}async writeStyleEntry(e,t,r,o,s=this.writeBackend){const n=`${f}${t}`,i=this.snapshot().nodes.get(e);if(!i)return this.clearEcho(e,n),this.refuseStyleWrite(`[ReactRootAuthoringAdapter] cannot write "${t}": "${e}" no longer resolves in this root (the tree was re-projected — an HMR remount — between the selection and the write). Nothing was written. Re-select and retry.`),!1;if(!s)return this.clearEcho(e,n),this.refuseStyleWrite(`[ReactRootAuthoringAdapter] cannot write "${t}" on "${e}": no source-write backend in this session (hosted/no dev server) — selection/inspection still work.`),!1;await this.expandShorthandsFor(e,t,s);const l=oe();if(l!==null){const c=W(this.matchedCssRules(i.el),X(i.el)),a=s.writeCss?c?null:"no style class carries this element — create one in the Style class row first (inline styles cannot be responsive, so a breakpoint edit needs a class rule).":"breakpoint edits need the dev-server css door (a hosted session cannot write @media).";if(a!==null||!c||!s.writeCss)return this.clearEcho(e,n),a&&(this.markGuarded(e,n,a),$(a)),this.store.notifyIngestEdit(),this.refuseStyleWrite(`[ReactRootAuthoringAdapter] breakpoint edit refused: ${a}`),!1;const p=await s.writeCss(c.sourceFile,c.selectorText,t,O(t,r),l);return p.changed?(this.dirty=!0,this.store.notifyIngestEdit(),!0):(this.clearEcho(e,n),this.refuseStyleWrite(`[ReactRootAuthoringAdapter] breakpoint css write refused/no-op for "${c.selectorText}" ${t} at ${l}: ${p.error??"no change"}`),!1)}if(s.writeCss){const c=this.matchedCssRules(i.el),a=ke(c,t),p=!a&&!Je(i.el,t)?W(c,X(i.el)):null,g=a?.rule??p;if(g){const m={rule:g},{rule:h}=m,v=await s.writeCss(h.sourceFile,h.selectorText,t,O(t,r));if(v.changed)return this.dirty=!0,this.store.notifyIngestEdit(),!0;if(!v.generated)return this.clearEcho(e,n),this.refuseStyleWrite(`[ReactRootAuthoringAdapter] CSS write refused/no-op for selector "${h.selectorText}" prop "${t}": ${v.error??"no change"}`),!1}}r=ue(r,x(i.el.style,t));const d=await s.writeStyle(i.oid,t,r);if(!d.changed){this.clearEcho(e,n);const c=d.tokenRef?Ae(t,d.tokenRef):d.dynamic?J:null;return c&&this.markGuarded(e,n,c),this.store.notifyIngestEdit(),this.refuseStyleWrite(`[ReactRootAuthoringAdapter] style write refused/no-op for oid "${i.oid}" prop "${t}": ${c??d.error??"no change"}`),!1}return this.dirty=!0,o===void 0&&i.el.style&&(i.el.style[t]=O(t,r)),this.store.notifyIngestEdit(),!0}async writeStyle(e,t,r){return this.writeStyleEntry(e,t,r)}async expandShorthandsFor(e,t,r){const o=We(t);if(o.length===0)return;const s=this.snapshot().nodes.get(e);if(!(!s||!r))for(const n of o){const i=ee[n]??[],l=i.map(d=>y(s.el,d,this.computedStyle));if(await this.removeStyleProp(e,n,r))for(const[d,c]of i.entries()){if(c===t)continue;const a=l[d];a&&await this.writeStyleEntry(e,c,a,void 0,r)}}}async removeStyleProp(e,t,r=this.writeBackend){const o=this.snapshot().nodes.get(e);return!o||!r||!(await r.removeStyle(o.oid,t)).changed?!1:(this.dirty=!0,o.el.style&&delete o.el.style[t],this.store.notifyIngestEdit(),!0)}async editText(e,t){const r=this.snapshot().nodes.get(e);if(!r)return;if(!this.writeBackend?.writeText){console.warn(`[ReactRootAuthoringAdapter] cannot edit text on "${e}": no source-write backend with text support in this session (hosted/no dev server).`);return}const o=await this.writeBackend.writeText(r.oid,t);if(!o.changed){o.dynamic&&this.markGuarded(e,G,"The body has an expression or child elements, so replacing it with text is guarded."),this.store.notifyIngestEdit(),console.warn(`[ReactRootAuthoringAdapter] text edit refused/no-op for oid "${r.oid}": ${o.dynamic?"body has an expression/children (guarded)":o.error??"no change"}`);return}this.dirty=!0,this.pendingSourceReconcile++,this.store.notifyIngestEdit()}async writePropEdit(e,t,r){const o=`${b}${t}`,s=this.snapshot().nodes.get(e);if(!s)return this.clearEcho(e,o),!1;if(!this.writeBackend?.writeProp)return this.clearEcho(e,o),console.warn(`[ReactRootAuthoringAdapter] cannot write prop "${t}" on "${e}": no source-write backend with prop support in this session (hosted/no dev server).`),!1;const n=E(s.el);if(!n)return this.clearEcho(e,o),console.warn(`[ReactRootAuthoringAdapter] "${e}" is not a component call site with props — cannot write prop "${t}".`),!1;const i=await this.writeBackend.writeProp(n.callSiteOid,t,r);return i.changed?(this.dirty=!0,this.store.notifyIngestEdit(),!0):(this.clearEcho(e,o),i.dynamic&&this.markGuarded(e,o,J),this.store.notifyIngestEdit(),console.warn(`[ReactRootAuthoringAdapter] prop write refused/no-op for oid "${n.callSiteOid}" prop "${t}": ${i.dynamic?"value is a dynamic expression (guarded)":i.error??"no change"}`),!1)}removeElement(e){const t=this.snapshot().nodes.get(e);return t?this.structPipe.structOp(t.oid,e,"delete",void 0,w):this.structRefusal(`cannot delete "${e}": no such node in this world.`)}removeManyElements(e){const t=this.snapshot(),r=[...new Set(e.map(o=>t.nodes.get(o)?.oid).filter(o=>!!o))];return r.length===0?this.structRefusal("batch delete reached no source-addressable element."):this.structPipe.structMany(r,"delete",void 0,w)}subscribe(e){return this.store.subscribe(e)}get persistence(){const e=this.writeBackend;return{isDirty:()=>this.dirty,save:async()=>{},destination:e?w:B}}pipedSourceWrite(e){return pe({resolve:()=>this.writeBackend?{reaches:"writer",anchorKind:"source-prop",destination:w,write:e}:ge(B),record:()=>{},report:t=>console.warn(`[ReactRootAuthoringAdapter] this edit stays live-only — ${t}.`)})}structPipe=ye({report:e=>console.warn(`[ReactRootAuthoringAdapter] ${e}`),noWriterReason:B,backend:()=>this.writeBackend,onChanged:()=>{this.dirty=!0,this.pendingSourceReconcile++,this.store.notifyIngestEdit()}});structRefusal(e){return this.structPipe.structRefusal(e)}}export{$e as D,et as R,x as a,Oe as c,Be as m,Ze as s,Me as w};
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{a as l}from"./three-contract-Dkt6PmWY.js";import{reflectionProbeOf as m}from"./reflection-probe-BHNGwVyz.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{e1 as f,fk as h,fl as a,aI as s,Z as x}from"./index-BRJMIUK0.js";import{u as b}from"./three-state-DwFE3ay2.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.js";import"./user-data-Bpj7diUS.js";import"./entity-object-JmYMfLsx.js";function j(r,o){return r?.kind==="reflection-probe"}const g={idle:"Not captured",queued:"Capture queued",capturing:"Capturing…",ready:"Ready",error:"Capture failed"},C={status:"idle",lastCapturedAt:null};function S({adapter:r,nodeId:o}){const i=b(),c=o?i.objectMap.get(o)??l(r.hierarchy,o):null,e=m(c),n=d.useSyncExternalStore(u=>e?.subscribe(u)??(()=>{}),()=>e?.getSnapshot()??C);if(!e)return null;const p=e.config.captureMode==="on-change"?"On change":e.config.captureMode==="realtime"?"Realtime":"Manual";return t.jsxs(t.Fragment,{children:[n.status==="error"&&n.message?t.jsx(f,{tone:"error",children:n.message}):null,t.jsxs(h,{children:[t.jsx(a,{label:"Status",children:t.jsx(s,{tone:n.status==="error"?"danger":n.status==="ready"?"success":"muted",children:g[n.status]})}),t.jsx(a,{label:"Update",children:t.jsx(s,{tone:"muted",children:p})}),t.jsx(a,{label:"Cubemap",children:t.jsx(s,{tone:"muted",children:`${e.config.resolution} × ${e.config.resolution}`})}),t.jsx(a,{label:"Capture",children:t.jsx(x,{size:"compact",disabled:n.status==="capturing",onClick:()=>e.recapture(),children:"Recapture"})})]})]})}const v="selection.inspector",D="Capture",I="camera-rotate",J=500;function K(r,o){return j(r)}function Q({adapter:r,nodeId:o}){return t.jsx(S,{adapter:r,nodeId:o})}export{Q as default,I as icon,K as match,J as order,v as point,D as title};
@@ -1 +0,0 @@
1
- import{a7 as g,a8 as d}from"./index-BRJMIUK0.js";const f=Object.assign({}),$=Object.assign({}),c=Object.assign({}),o="vgai.adapter.ts",l="packages/editor/src/ingest/games";function b(t){return c[u(t,o)]?`${l}/${t}/${o}`:null}async function M(t){const e=c[u(t,o)];return e?await e():null}const h=Object.assign({}),p=/^\.\/games\/([^/]+)\/vgai\.project\.json$/;function u(t,e){return`./games/${t}/${e}`}function m(t){const e=p.exec(t);if(!e?.[1])throw new Error(`ingest registry: unexpected manifest glob key "${t}"`);return e[1]}function E(t,e){const a=g(e,{configurationKinds:"defer"}),n=d(a);if(n.length!==1)throw new Error(`ingest registry: "${t}/vgai.project.json" must declare exactly one root (found ${n.length}).`);const s=n[0];if(s.adapter.type!=="ingest")throw new Error(`ingest registry: "${t}/vgai.project.json"'s root must be an { ingest } root (found adapter identity "${s.adapter.identity}").`);const i=s;return{folderId:t,manifest:a,root:i,surface:i.adapter.surface}}let r=null;function y(){return r||(r=Object.entries(f).map(([t,e])=>E(m(t),e)).sort((t,e)=>t.folderId.localeCompare(e.folderId))),r}function R(t){return y().filter(e=>e.surface===t)}export{b as a,R as b,h as c,$ as e,u as g,M as i};
@@ -1 +0,0 @@
1
- import{i as e}from"./index-BRJMIUK0.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()({id:{optional:!1,kind:"value",required:"shape"},mount:{optional:!1,kind:"function",required:"effect"}}),f=e()({drivesOwnLoop:{optional:!1,kind:"value",required:"shape"},updateCadence:{optional:!0,kind:"value",required:"shape"},update:{optional:!0,kind:"function",required:"effect"},fixedUpdate:{optional:!0,kind:"function",required:"effect"},setPaused:{optional:!0,kind:"function",required:"effect"},step:{optional:!0,kind:"function",required:"effect"},resize:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!1,kind:"function",required:"effect"},disposeComplete:{optional:!0,kind:"value",required:"effect"},authoring:{optional:!0,kind:"value",required:"operation"},systems:{optional:!0,kind:"value",required:"operation"},systemScope:{optional:!0,kind:"value",required:"operation"},observe:{optional:!0,kind:"value",required:"effect"}}),s=e()({subscribe:{optional:!1,kind:"function",required:"effect"},snapshot:{optional:!1,kind:"function",required:"operation"}}),c=e()({kind:{optional:!1,kind:"value",required:"shape"},scene:{optional:!1,kind:"value",required:"effect"},camera:{optional:!1,kind:"value",required:"effect"},rendererConfig:{optional:!0,kind:"value",required:"shape"}}),k=e()({kind:{optional:!1,kind:"value",required:"shape"},canvas:{optional:!1,kind:"value",required:"effect"},substrate:{optional:!1,kind:"value",required:"effect"}}),q=e()({kind:{optional:!1,kind:"value",required:"shape"},container:{optional:!1,kind:"value",required:"effect"}});export{k as MOUNTED_CANVAS_SURFACE_SHAPE,q as MOUNTED_DOM_SURFACE_SHAPE,f as MOUNTED_ROOT_BASE_SHAPE,c as MOUNTED_THREE_SURFACE_SHAPE,p as ROOT_ADAPTER_SHAPE,s as ROOT_STATE_OBSERVER_SHAPE};
@@ -1,2 +0,0 @@
1
- import{q as s}from"./index-BRJMIUK0.js";import{s as l,l as d,a as f}from"./configurations-BXU4GGbV.js";import{s as g}from"./play-mode-DICV4cKP.js";const a="play",u="runSelection";function p(){return s().projectLocalState.read(u)??null}function y(n){s().projectLocalState.write(u,n)}function m(n,o=p()){return o??n.find(t=>t.role==="run"&&t.kind==="compound"&&t.run?.includes(a))?.id??a}let r=null;async function h(){const n=await d().catch(()=>[]),o=m(n),t=n.find(i=>i.id===o);if(!t||o===a)return{ok:!0,started:null};let e;try{e=await f(t.id)}catch(i){return{ok:!1,title:`Run "${t.id}"`,detail:i instanceof Error?i.message:String(i)}}return e.ready?(t.kind==="compound"&&t.instances!=null&&g(Math.max(0,t.instances-1)),r=t.id,{ok:!0,started:t.id}):{ok:!1,title:`Run "${t.id}" is not ready`,detail:Object.entries(e.logs).map(([i,c])=>`${i}: ${c.slice(-3).join(" | ")||"no output"}`).join(`
2
- `)}}async function k(){const n=r;r=null,n&&await l(n).catch(o=>s().notify({tone:"error",title:`Stop "${n}"`,detail:o instanceof Error?o.message:String(o)}))}export{a as P,h as a,m as b,p as c,y as d,k as s};
@@ -1 +0,0 @@
1
- import{s as z,d as N}from"./resolve-three-CVnMRHxw.js";import"./index-BRJMIUK0.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"./capability-coverage-DZ-onC5j.js";import"./game-contract-seams-BnPFGLll.js";import"./json-history-resource-DwS10tqD.js";import"./dom-authoring-adapter-BrLU8IJ_.js";import"./react-world-authoring-adapter-DOjv2pYm.js";import"./board-guides-BEKPgD9M.js";import"./relative-import-specifier-BFKIWEWs.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Dr4qvDpJ.js";import"./inference-diagnostics-xecGdohW.js";import"./writer-tw6EcuVO.js";import"./debug-registry-P0_YQGWd.js";import"./contract-system-adapters-Bic_7sev.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./three.core-3arARmh6.js";import"./active-ingest-DA426a81.js";import"./ingest-source-persistence-Dmdo-UBp.js";const F=8;function _(l){const d=l,c=typeof d?.type=="string"?d.type:"unknown",w=typeof d?.uuid=="string"?d.uuid:"(no uuid)";return`${c}:${w}`}function q(l){const d=globalThis;if(typeof EventTarget!="function")return()=>{};const c=d.__THREE_DEVTOOLS__===void 0;c&&(d.__THREE_DEVTOOLS__=new EventTarget);const w=d.__THREE_DEVTOOLS__;if(!w)return()=>{};const u=[];function f(p,o,h){const m=p[o];Object.defineProperty(p,o,{configurable:!0,writable:!0,value:h}),u.push(()=>{Object.defineProperty(p,o,{configurable:!0,writable:!0,value:m})})}const n=p=>{const o=p.detail;if(!o||typeof o!="object"||typeof o.render!="function"||!o.domElement||l.alreadyTrapped(o)||l.isHostRenderer(o))return;const h=o.render;f(o,"render",function(...b){return l.observeRender(o,h,b)});const m=o.setAnimationLoop;if(typeof m=="function"){const b=m;f(o,"setAnimationLoop",function(E){return typeof E=="function"&&l.recordLoop(o,E),b.call(o,E)})}};return w.addEventListener("observe",n),()=>{w.removeEventListener("observe",n);for(const p of u.splice(0))p();c&&delete d.__THREE_DEVTOOLS__}}function Re(l,d,c){const u=l.WebGLRenderer.prototype,f=Symbol("vgai.realRender");let n=null,p=0,o=null;const h=new Set;let m=null;const b=[],E=Object.getOwnPropertyDescriptor(u,"render"),S=Symbol("vgai.realSetAnimationLoop"),A=new WeakMap,j=new Set;let v=null;const H=Object.getOwnPropertyDescriptor(u,"setAnimationLoop");function D(){if(!(n||!v||!(v.suspended?.()??v.hidden())))for(const e of j){try{A.get(e)?.(0)}catch{}if(n)return}}Object.defineProperty(u,"setAnimationLoop",{configurable:!0,set(e){this[S]=e},get(){const e=this;return function(t){t&&k(e,t);const i=e[S];return typeof i=="function"?i.call(e,t):void 0}}});function C(e,r,t){const i=m;if(i===null||!n||e!==n.renderer)return r.apply(e,t);i.before();try{return r.apply(e,t)}finally{i.after()}}function W(e,r){return C(e,e[f],r)}function k(e,r){A.set(e,r),j.add(e),queueMicrotask(D)}function V(e,r,t){if(o===null&&(o=c?.declaredScene?.()??null),!(o!==null&&o!==r)){n={scene:r,camera:t,renderer:e},c?.onWorldAdoption?.({phase:"adopted",source:o===null?"measured":"declared",sceneId:_(r),cameraId:_(t)});for(const i of b.splice(0))i(n)}}function I(e,r,t){if(!n||h.size>=F||r===n.scene&&t===n.camera)return;const i=e===n.renderer,a=`${_(r)}|${_(t)}|${i}`;h.has(a)||(h.add(a),c?.onWorldAdoption?.({phase:"alternate",sceneId:_(r),cameraId:_(t),sameRenderer:i,drawCount:p}))}function L(e,r,t){(!n||e===n.renderer)&&p++,c?.isHostRenderer?.(e)!==!0&&r?.isScene&&(n?I(e,r,t):V(e,r,t))}Object.defineProperty(u,"render",{configurable:!0,set(e){this[f]=e},get(){const e=this;return function(...t){const[i,a]=t;return L(e,i,a),W(e,t)}}});const M=new WeakSet,$=q({alreadyTrapped:e=>e[f]!==void 0,isHostRenderer:e=>c?.isHostRenderer?.(e)===!0,observeRender:(e,r,t)=>(M.add(e),L(e,t[0],t[1]),C(e,r,t)),recordLoop:k}),T=[];for(const e of c?.additionalRendererCtors??[]){const t=e?.prototype;if(!t||t===u)continue;const i=t.render;if(typeof i=="function"){t.render=function(...s){L(this,s[0],s[1]);const R=m;if(R===null||!n||this!==n.renderer)return i.apply(this,s);R.before();try{return i.apply(this,s)}finally{R.after()}},T.push(()=>{t.render=i});continue}const a=Object.getOwnPropertyDescriptor(t,"render");Object.defineProperty(t,"render",{configurable:!0,set(s){this[f]=s},get(){const s=this;return function(...y){return L(s,y[0],y[1]),W(s,y)}}}),T.push(()=>{a?Object.defineProperty(t,"render",a):delete t.render})}const P=new Set;let O,g;d&&(O=d.prototype,g=O.render,O.render=function(...r){const t=g?.apply(this,r);return n&&this.renderer===n.renderer&&P.add(this),t});function x(){O&&(g?O.render=g:delete O.render)}return{get captured(){return n},get capturedVia(){return n?M.has(n.renderer)?"devtools-observer":"shared-three":null},getDrawCount(){return p},setRenderPassHooks(e){m=e},getAnimationLoop(e){return A.get(e)??null},resizeComposers(e,r){if(!n||P.size===0)return;const t=n.renderer.getPixelRatio?.();if(t!==void 0)for(const i of P)i.setSize(e,r),i.setPixelRatio(t)},waitForCapture(e){const r=typeof e=="number"?{timeoutMs:e}:e??{},t=r.timeoutMs??1e4;return n?Promise.resolve(n):new Promise((i,a)=>{const s=z({budgetMs:t,...r.visibility!==void 0?{clock:r.visibility}:{},onExpire:()=>{const y=b.indexOf(R);y>=0&&b.splice(y,1),v=null,r.onWait?.(null),a(new Error(`Scene capture timed out after ${t}ms of VISIBLE time (${Math.round(s.elapsedHiddenMs())}ms browser-suspended, which is not counted because no frame can be presented) — no three renderer of ANY instance drew a scene: neither the host's own \`three\` (the shared prototype trap) nor a renderer announcing itself on three's \`__THREE_DEVTOOLS__\` seam, which is what reaches a game that bundles its own copy. The game never rendered.`))}}),R=y=>{s.cancel(),v=null,r.onWait?.(null),i(y)};b.push(R),v=r.visibility??N(),r.onWait?.(s),queueMicrotask(D)})},uninstall(){if(n){const r=n.renderer[f];typeof r=="function"&&Object.defineProperty(n.renderer,"render",{configurable:!0,writable:!0,value:r})}if(E?Object.defineProperty(u,"render",E):delete u.render,n){const r=n.renderer[S];typeof r=="function"&&Object.defineProperty(n.renderer,"setAnimationLoop",{configurable:!0,writable:!0,value:r})}H?Object.defineProperty(u,"setAnimationLoop",H):delete u.setAnimationLoop,x(),$();for(const e of T)e()}}}export{F as MAX_RECORDED_ALTERNATES,Re as installSceneCapture};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeIsolationSceneContent-DbYIylZQ.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/document-preview-three-DThkjI1S.js","assets/content-bounds-BeuIXKYu.js","assets/hierarchy-marks-Cc_3lxw6.js","assets/workspace-arrangement-BdAlBwvd.js","assets/three.core-3arARmh6.js","assets/editor-layers-BDJnAAzj.js","assets/renderer-ownership-BovSEcLv.js","assets/three.module-BLhyNg0e.js","assets/scene-framing-BQt72ZCw.js","assets/mounted-story-viewport-source-B4-eAYGI.js","assets/story-three-preview-R1JvrggS.js","assets/asset-preview-B1tDziF1.js","assets/studio-environment-DRxxq_QX.js","assets/user-data-Bpj7diUS.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/crash-null-boundary-v3a0uEgw.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/story-mount-turn-DFRTj5hi.js","assets/Object3DDocumentViewport-DCwiSY3O.js","assets/viewport-surface-status-cwCiBGa7.js","assets/world-root-stage-binding-ZVYIgr74.js","assets/object3d-document-session-registry-DJDEDM0p.js","assets/RootSelectionOverlay-CpaGluQu.js","assets/eyedropper-session-bjPXnfeX.js","assets/layered-pick-kiQf53t5.js","assets/root-stacking-BEd9ZvxC.js","assets/react-story-board-GaXqr03H.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/inspect-Dr4qvDpJ.js","assets/inference-diagnostics-xecGdohW.js","assets/surface-state-1lTOi8FD.js","assets/surface-content-Dg9Kkazf.js","assets/camera-authoring-DYjhU5Zp.js","assets/performance-profiler-OwnXQX0M.js","assets/renderer-config-CaPR4dB_.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/loader-BTUKnX5Q.js","assets/render-settings-DS5leCed.js","assets/render-features-rxbawsRb.js","assets/soft-particle-depth-DNGwWJ8c.js","assets/viewport-shading-D9BMDb1N.js","assets/matcap-texture-Dm2c-VQa.js","assets/setup-renderer-Cwkl1Ar6.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/project-authoring-session-C3eusefK.js","assets/edit-mode-authoring-DeCxPcHM.js","assets/three-integration-BdN5Nhsg.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/preview-renderer-BrYNFV1p.js","assets/model-thumbnail-BEKPWg4l.js","assets/three-state-DwFE3ay2.js","assets/editor-shell-store-ChLcVeNB.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/entity-object-JmYMfLsx.js","assets/three-contract-Dkt6PmWY.js","assets/component-instance-root-B0C5oNEm.js","assets/viewport-door-Bj_ZIP85.js","assets/canvas-preview-frames-C0QTagA3.js","assets/index-SS9EugVg.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/three-viewport-presentation-B0z_cECu.js","assets/standard-viewport-dressing-BCA51Tum.js","assets/clip-planes-CnAI6DZn.js","assets/three-TCuY32m_.js","assets/model-inspection-CXHxrafK.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/live-gesture-lock-DJbrjOqf.js","assets/live-mixers-B-bwLZ7c.js","assets/viewport-root-presentation-vgxsTyj4.js","assets/mounted-authoring-Clftxx0x.js","assets/asset-editor-persistence-BGWIqZdk.js","assets/stage-presence-markers-DIP7YMcO.js","assets/collaboration-presence-BVIQuN1l.js"])))=>i.map(i=>d[i]);
2
- import{F as m,aC as c,au as g,E as h,eI as T,G as y,dy as b,eJ as R,eK as f,w as S,cw as w,eL as P,eM as E,_ as v,M as D,ad as u,Z as _,eN as N}from"./index-BRJMIUK0.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{O as x}from"./Object3DDocumentViewport-DCwiSY3O.js";import{r as p}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as C}from"./after-paint-CB4bz1-e.js";import{o as k}from"./three-state-DwFE3ay2.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"./viewport-surface-status-cwCiBGa7.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.js";import"./user-data-Bpj7diUS.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";const d="Scene";function A(e){const t=()=>{const r=h()?.scenes,n=(r?y(r).find(l=>l.plan.kind==="root-document"):void 0)?.entry.source,i=n?.path??e.sourcePath??e.savePath;return i?{path:i,...n?.export===void 0?{}:{exportName:n.export}}:null};return{revision:()=>{const r=t();return r?`${r.path}:${r.exportName??"default"}`:"unavailable"},subscribe:r=>{let o=JSON.stringify(t());const n=()=>{const a=JSON.stringify(t());a!==o&&(o=a,r())},i=e.subscribe(n),l=m(n);return()=>{i(),l()}},capture:async r=>{const o=t();if(!o)throw new Error("The Scene has no declared source module to preview.");return(await v(()=>import("./ThreeIsolationSceneContent-DbYIylZQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]))).captureThreeIsolationScenePreview({path:o.path,exportName:o.exportName,label:d},r)}}}const I=/creating WebGL context/i,j=/null \(reading 'precision'\)/;function V(e){return I.test(e.message)||j.test(e.message)}const O=3;class M extends p.Component{state={error:null,autoRetryPending:!1};autoRetryCount=0;retryTimer=null;static getDerivedStateFromError(t){return{error:t,autoRetryPending:!1}}clearPendingRetry(){this.retryTimer!==null&&(window.clearTimeout(this.retryTimer),this.retryTimer=null)}componentDidCatch(t,r){if(D.error(`Viewport failed to start: ${t.message}`,"editor"),console.error("[vgai] Viewport failed to start",t,r.componentStack),V(t)&&this.autoRetryCount<O){this.clearPendingRetry();const o=500*2**this.autoRetryCount;this.autoRetryCount++,this.retryTimer=window.setTimeout(()=>{this.retryTimer=null,this.setState({error:null,autoRetryPending:!1})},o),this.setState({autoRetryPending:!0})}}componentWillUnmount(){this.clearPendingRetry()}handleManualRetry=()=>{this.clearPendingRetry(),this.setState({error:null,autoRetryPending:!1})};render(){if(!this.state.error)return this.props.children;const t=this.state.autoRetryPending;return s.jsxs("div",{"data-testid":"viewport-startup-error",role:"alert",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:24,background:u.surface.shell,color:u.content.muted,textAlign:"center"},children:[s.jsx("div",{style:{color:u.content.primary,fontSize:14},children:t?"Viewport unavailable — retrying…":"Viewport unavailable"}),s.jsx("div",{style:{maxWidth:520,color:u.content.dim,fontSize:11},children:this.state.error.message}),s.jsx(_,{type:"button",className:"vgai-btn","data-testid":"retry-viewport",onClick:this.handleManualRetry,children:"Retry Viewport"})]})}}const W={kind:"world-root",load:()=>v(()=>import("./world-root-stage-binding-ZVYIgr74.js"),__vite__mapDeps([39,1,2,16,14,3,4,5,6,7,8,9,10,40,41,42,43,44,45,46,47,48,49,50,51,52,17,53,54,55,56,25,18,15,26,27,57,58,59,60,61,62,63,64,65,66,67,68,69,70,28,29,30,31,24,71,23,72,73,74,75,76,77,13,78,79,12,22,32,80,81,82,83,84,85,86,87,88,89,90,91,19,92,93,94,95,96,97])).then(e=>e.worldRootStageBinding)};function L({documentId:e,active:t}){const[r,o]=p.useState(!1);return p.useEffect(()=>C(()=>o(!0)),[]),s.jsx(M,{children:r?s.jsx(x,{documentId:e,active:t,content:W,displayName:d}):null})}function U(e){const t=e.sourcePath??e.savePath;return{scene:{id:c,title:d,kind:"scene",workspaceRole:"authored-subject",...t?{provenance:{sourcePath:t}}:{},Content:L,preview:A(e),presentation:()=>e.savePath?{kind:"scene",path:e.savePath}:{kind:"workspace",id:c}}}}function F(e,t,r=!0){const o=h()?.scenes;if(r&&!(o&&T(o))){const n=o?y(o).find(i=>i.plan.kind==="root-document"):void 0;b({...t.scene,title:n?.plan.kind==="root-document"?n.plan.title:t.scene.title,provenance:{...t.scene.provenance,...n?.entry.source?.path?{sourcePath:n.entry.source.path}:{},...n?.plan.kind==="root-document"?{rootId:n.plan.regionId}:{}}},{category:"scene",rootId:n?.plan.kind==="root-document"?n.plan.regionId:void 0,default:o!==void 0&&(n?.isDefault??o.entries.length===0)}),R(c,e.isDirty)}else f(c);r&&S()===null&&w(c)}function B(e){let t=null;const r={subscribe:a=>e.shell.subscribe(a),get playState(){return e.shell.playState},get activeViewportTab(){return e.shell.activeViewportTab},get savePath(){return E(e.shell)},get sourcePath(){const a=P(e.shell);return a&&(t=a),t},get isDirty(){return N(e.shell)==="unsaved"}},o=U(r),n=()=>F(r,o,g()?.config.hasThreeRoot!==!1);n();const i=e.shell.subscribe(n),l=m(n);return()=>{i(),l()}}const de="workspace.service";function me(){let e=null;const t=k(r=>{e?.(),e=B(r)});return()=>{t(),e?.(),e=null,f(c)}}export{de as point,me as start};
@@ -1 +0,0 @@
1
- import{c as f}from"./debug-registry-P0_YQGWd.js";function E(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||e<=0||t<=0)return 0;const a=t/e;return a>=1?1:a}const m={min:0,max:8};function M(t){return Number.isFinite(t)?Math.min(m.max,Math.max(m.min,t)):m.min}function R(t,e,a,n){const{fixedDt:i,maxSubSteps:c}=n,s=i*c,o=Math.min(e,s)*a;let r=t+o;r>s&&(r=s);let u=0;for(;r>=i&&u<c;)r-=i,u++;return{steps:u,accumulator:r,alpha:E(r,i),displayDt:o}}function l(t){let e=t>>>0;return function(){e=e+1831565813|0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}const b="vgai-render",h="vgai-seed",g="gameplay",A=2654435769;function p(t){let e=2166136261;for(let a=0;a<t.length;a++)e^=t.charCodeAt(a),e=Math.imul(e,16777619);return e>>>0}function _(t){let e=t>>>0;const a=new Map;function n(o){return(p(o)^e)>>>0}function i(o){let r=a.get(o);return r||(r={gen:l(n(o))},a.set(o,r)),r}function c(o){const r=i(o);return()=>r.gen()}const s=(()=>i(g).gen());return Object.defineProperties(s,{stream:{value:c,enumerable:!0},reseed:{value:o=>{e=o>>>0;for(const[r,u]of a)u.gen=l(n(r))},enumerable:!0},seed:{get:()=>e,enumerable:!0}}),s}const d=f("seeded-random");function x(t,e){d.set(t,e)}function D(t){return d.get(t)??null}export{A as D,h as R,m as T,_ as a,b,M as c,D as g,R as p,x as r};
@@ -1 +0,0 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import{ju as w,gR as R,d2 as P,aI as v,ad as f,jv as D,gA as E,gB as k,jw as V,jx as T,dg as L,cA as B,cB as b,aH as H,jy as N,jz as I,cE as $,cF as C,aJ as z,$ as F,cG as U,cH as G,jA as W,jB as _,a2 as q,jC as J,jD as K,jE as Z,dR as Q}from"./index-BRJMIUK0.js";import{s as M,o as O,a as X}from"./object3d-document-session-registry-DJDEDM0p.js";import{r as Y}from"./index-CtzuWnCS.js";import{T as ee}from"./TransientHint-BpDLhRLd.js";import{d as te,b as se}from"./ViewportShadingMenu-CXPi6fl8.js";import{V as j,s as oe}from"./StageHost-B89HKcvd.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./three-state-DwFE3ay2.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.js";import"./user-data-Bpj7diUS.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";import"./standard-viewport-dressing-BCA51Tum.js";import"./content-bounds-BeuIXKYu.js";import"./hierarchy-marks-Cc_3lxw6.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./model-inspection-CXHxrafK.js";import"./three-viewport-presentation-B0z_cECu.js";import"./clip-planes-CnAI6DZn.js";import"./three-TCuY32m_.js";import"./component-instance-root-B0C5oNEm.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./model-thumbnail-BEKPWg4l.js";import"./studio-environment-DRxxq_QX.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./three-integration-BdN5Nhsg.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-kiQf53t5.js";import"./root-stacking-BEd9ZvxC.js";import"./viewport-door-Bj_ZIP85.js";import"./asset-preview-B1tDziF1.js";import"./bitmap-label-Ct4k6ehY.js";import"./scene-framing-BQt72ZCw.js";import"./source-object3d-authoring-adapter-DF679Ncb.js";import"./three-projection-core-CG01r5Ta.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./transport-strip-CUjNltnb.js";import"./viewport-surface-status-cwCiBGa7.js";function h(t){return t.toFixed(2)}function re(){const t=w(),[o,r]=s.useState({x:0,y:0,z:0}),[a,n]=s.useState({x:0,y:0,z:0}),i=s.useRef(0);return s.useEffect(()=>{function u(){const m=t.cameraPosition,p=t.cameraTarget;r(l=>l.x!==m.x||l.y!==m.y||l.z!==m.z?{x:m.x,y:m.y,z:m.z}:l),n(l=>l.x!==p.x||l.y!==p.y||l.z!==p.z?{x:p.x,y:p.y,z:p.z}:l),i.current=requestAnimationFrame(u)}return i.current=requestAnimationFrame(u),()=>cancelAnimationFrame(i.current)},[t]),e.jsx(R,{variant:"overlay",border:!0,className:"vgai-camera-info vgai-chrome-island vgai-glass-island","data-island-scale":"compact",children:e.jsxs(P,{gap:8,align:"center",style:{whiteSpace:"nowrap"},children:[e.jsxs(v,{variant:"code",children:["Pos ",h(o.x)," ",h(o.y)," ",h(o.z)]}),e.jsxs(v,{variant:"code",children:["Target ",h(a.x)," ",h(a.y)," ",h(a.z)]})]})})}function ae(){const t=w(),[,o]=s.useState(0),r=D();return s.useEffect(()=>{const a=setInterval(()=>o(n=>n+1),200);return()=>clearInterval(a)},[]),e.jsxs("div",{className:"vgai-hud-overlay vgai-chrome-island vgai-glass-island","data-island-scale":"compact","data-hud-border":"strong",style:{position:"absolute",top:"var(--vgai-viewport-overlay-hud-top, 48px)",right:8,padding:"6px 10px",pointerEvents:"auto",fontSize:"var(--vgai-font-base)",color:f.content.primary,fontFamily:f.typography.mono,lineHeight:"16px"},children:[e.jsxs("div",{children:["FPS: ",t.fps.toFixed(0)]}),e.jsxs("div",{children:["Draw: ",t.drawCalls]}),e.jsxs("div",{children:["Tris: ",t.triangles.toLocaleString()]}),e.jsxs("div",{children:["Frame: ",t.frameTime.toFixed(1),"ms"]}),r!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Heap: ",r.heapUsedMB===null?"n/a":`${r.heapUsedMB.toFixed(0)}MB`,r.heapLimitMB===null?"":` / ${r.heapLimitMB.toFixed(0)}MB`]}),e.jsxs("div",{children:["Mount epochs: ",r.mountEpochs]}),e.jsxs("div",{children:["Canvas: ",r.canvasMB.toFixed(1),"MB ×",r.canvases]}),r.textures!==void 0&&e.jsxs("div",{children:["GPU: ",r.textures," tex, ",r.geometries??0," geo",r.programs===void 0?"":`, ${r.programs} prog`]})]})]})}function ie({store:t,documentId:o}){s.useSyncExternalStore(t.shell.subscribe,t.shell.getSnapshot),s.useSyncExternalStore(E,k),s.useSyncExternalStore(V,T),s.useSyncExternalStore(M,O);const{adapter:r}=L(t.shell),a=X(o);s.useSyncExternalStore(a?.subscribe??le,a?.getSnapshot??ce),s.useSyncExternalStore(B,b);const n=H(o),i=N(),u=I(),m=i.viewName==="bar"||i.viewName==="menu",[p,l]=s.useState(null),y=()=>p?.closest(".vgai-dock-document-content")?.querySelector(':scope > .vgai-stage-bar [data-stage-bar-slot="display"]')??null,g=s.useId(),x=y(),d=x&&(x.dataset.owner===void 0||x.dataset.owner===g)?x:null,[,A]=s.useReducer(c=>c+1,0);s.useEffect(()=>{const c=y();c&&c.dataset.owner===void 0&&(c.dataset.owner=g),(c&&c.dataset.owner===g?c:null)!==d&&A()}),s.useEffect(()=>()=>{d?.dataset.owner===g&&delete d.dataset.owner},[d,g]);const S=e.jsxs($,{label:"Viewport display",className:"vgai-viewport-toolbar vgai-viewport-toolbar-right vgai-stage-display",children:[i.viewName==="bar"&&a?e.jsx(j,{shell:t.shell,documentId:o,label:oe(a.viewport,a.projection(),"long")}):null,e.jsx(C,{text:`Grid: ${n?"On":"Off"}`,children:e.jsx(z,{"aria-label":"Toggle grid","aria-pressed":n,size:"comfortable",onClick:()=>G(o,!n),children:e.jsx(F,{icon:U,size:"md"})})}),e.jsx(pe,{store:t,word:u.helpers}),e.jsx(te,{mode:ne(a)??t.shadingMode,onChange:c=>a?a.setMode(c):t.setShadingMode(c),words:u.shading}),m?null:e.jsx(j,{shell:t.shell,documentId:o}),e.jsx(me,{adapter:r,store:t})]});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:l,hidden:!0}),d?Y.createPortal(S,d):S]})}function ne(t){return t?.presentation().mode??null}const le=()=>()=>{},ce=()=>0,me=s.memo(function({adapter:o,store:r}){const[,a]=s.useReducer(i=>i+1,0);s.useEffect(()=>o.subscribe?.(a),[o]);const n=s.useMemo(()=>W(o),[o,r.shell.contentVersion]);return n===0?null:e.jsx(C,{text:`Open Light Explorer · ${n} ${n===1?"light":"lights"}`,children:e.jsx(z,{"aria-label":"Open Light Explorer",size:"comfortable",onClick:()=>q(J.lightExplorer.id),children:e.jsx(F,{icon:_,size:"md"})})})});function pe({store:t,word:o}){const r=[{key:"bounds",label:"Bounds"},{key:"lights",label:"Lights"},{key:"cameras",label:"Cameras"},{key:"colliders",label:"Colliders"},{key:"joints",label:"Joints"},{key:"particles",label:"Particle Emitters"},{key:"lod",label:"LOD"},{key:"audio",label:"Audio"},{key:"splines",label:"Splines"},{key:"navmesh",label:"NavMesh"},{key:"constraints",label:"Constraints"},{key:"reflectionProbes",label:"Reflection Probes"},{key:"triggerVolumes",label:"Trigger Volumes"},{key:"skeletons",label:"Skeletons"},{key:"weights",label:"Weights"},{key:"cursor",label:"3D Cursor"},{key:"empties",label:"Empties"}];return e.jsx(se,{label:"Helpers",...o!==void 0?{word:o}:{},master:{enabled:t.shell.showHelpers,onToggle:()=>t.shell.toggleHelpers()},choices:r.map(a=>({id:a.key,label:a.label,enabled:t.shell.helperVisibility[a.key],onToggle:()=>t.shell.toggleHelperType(a.key)}))})}function ft({store:t,documentId:o,stage:r,active:a,chrome:n}){const i=r?.store??t;s.useSyncExternalStore(t.shell.subscribe,t.shell.getShellSnapshot??t.shell.getSnapshot),s.useSyncExternalStore(i.shell.subscribe,i.shell.getShellSnapshot??i.shell.getSnapshot),s.useSyncExternalStore(V,T),s.useSyncExternalStore(M,O),s.useSyncExternalStore(E,k);const u=K(t.shell,o,n),m=Z(u);s.useSyncExternalStore(B,b,b);const p=Q(o).overlays.cameraReadout;return e.jsxs(e.Fragment,{children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ie,{store:i,documentId:o}),p?e.jsx(re,{}):null]}):null,u.surface==="three"&&i.showStats&&e.jsx(ae,{}),a?e.jsx(ee,{}):null]})}export{ft as StageOverlaySet};
@@ -1 +0,0 @@
1
- import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{dl as Y,ah as j,w as Q,dm as V,dn as _}from"./index-BRJMIUK0.js";import{a as O}from"./content-bounds-BeuIXKYu.js";import{r as w}from"./collaboration-presence-BVIQuN1l.js";import{e6 as G,fd as W,d9 as H,S as U,_ as M,T as k,ej as J,eE as K,eF as ee,dp as te,fo as x,cW as oe,J as ne,a$ as re,N as ie,bX as ae,bV as se}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./hierarchy-marks-Cc_3lxw6.js";import"./workspace-arrangement-BdAlBwvd.js";function ce(){const e=document.querySelector(`.${V}`);return(e?getComputedStyle(e).getPropertyValue("--vgai-content-on-accent").trim():"")||_.color.content.onAccent}function Z(e,r){const o=e.image,n=o.getContext("2d");if(!n)return;n.clearRect(0,0,o.width,o.height),n.fillStyle=r.color,n.beginPath(),n.roundRect(2,2,o.width-4,o.height-4,16),n.fill(),n.fillStyle=ce(),n.font="600 22px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle";const c=r.kind==="agent"?" · AI":"";n.fillText(`${r.displayName}${c}`,o.width/2,o.height/2,238),e.needsUpdate=!0}function le(e){const r=new H(50,1,.2,1.4),o=new U(r),n=new M(e.color);o.setColors(n,n,n,n,n),o.name=`Collaboration camera: ${e.displayName}`,o.userData.editorOnly=!0;const c=document.createElement("canvas");c.width=256,c.height=64;const p=new k(c);p.colorSpace=J;const d=new K(new ee({map:p,depthTest:!1,transparent:!0}));return d.name=`Collaboration label: ${e.displayName}`,d.userData.editorOnly=!0,d.scale.set(1.8,.45,1),d.renderOrder=1e4,Z(p,e),{camera:r,helper:o,label:d,texture:p,signature:"",targetPosition:new x,targetQuaternion:new te,targetFov:50,initialized:!1}}function de(e,r){const o=r.presence.camera;if(!o)return;e.targetPosition.set(o.x,o.y,o.z);const n=new oe;n.position.copy(e.targetPosition),n.lookAt(o.targetX,o.targetY,o.targetZ),e.targetQuaternion.copy(n.quaternion),e.targetFov=o.fov,e.initialized||(e.initialized=!0,e.camera.position.copy(e.targetPosition),e.camera.quaternion.copy(e.targetQuaternion),e.camera.fov=e.targetFov);const c=`${r.displayName}|${r.kind}|${r.color}|${r.status}`;c!==e.signature&&(e.signature=c,Z(e.texture,r))}function pe(e,r){const o=1-Math.exp(-12*Math.max(0,r));e.camera.position.lerp(e.targetPosition,o),e.camera.quaternion.slerp(e.targetQuaternion,o),e.camera.fov+=(e.targetFov-e.camera.fov)*o,e.camera.updateProjectionMatrix(),e.camera.updateMatrixWorld(!0),e.helper.update(),e.label.position.copy(e.camera.position),e.label.position.y+=.55}function A(e){e.helper.removeFromParent(),e.label.removeFromParent(),e.helper.dispose(),e.texture.dispose(),e.label.material.dispose()}function ue(e,r){const o=O(e),n=new ne(o,new M(r));return n.name=`Collaboration selection: ${e.name||e.uuid}`,n.userData.editorOnly=!0,n.renderOrder=9999,n.material.depthTest=!1,{object:e,box:o,helper:n}}function b(e){e.helper.removeFromParent(),e.helper.geometry.dispose(),e.helper.material.dispose()}function me(e){if(!e||e.type!=="pointer-ray"||!["originX","originY","originZ","directionX","directionY","directionZ","length"].every(p=>typeof e[p]=="number"&&Number.isFinite(e[p])))return null;const o=new x(e.originX,e.originY,e.originZ),n=new x(e.directionX,e.directionY,e.directionZ),c=Math.min(1e3,Math.max(.1,e.length));return n.lengthSq()<1e-6?null:{origin:o,end:o.clone().add(n.normalize().multiplyScalar(c))}}function Le(e){const{scene:r,store:o,documentId:n,container:c,canvas:p,viewport:d,readVisibleCameraPose:R}=e,y=()=>Q()===n,v=()=>{if(!y())return;const i=R();w({camera:{x:i.position.x,y:i.position.y,z:i.position.z,targetX:i.target.x,targetY:i.target.y,targetZ:i.target.z,fov:i.fov}})};d.orbitControls.addEventListener("change",v);let C=!1;const I=i=>{const s=i.value===!0;C=s,y()&&w({gesture:s?{type:"transform",selection:[...o.shell.selectedEntityIds]}:null})};d.transformControls.addEventListener("dragging-changed",I);const S=new G,P=new W,z=i=>{if(C||i.buttons!==0||!y())return;const s=p.getBoundingClientRect();if(s.width<=0||s.height<=0)return;P.set((i.clientX-s.left)/s.width*2-1,-((i.clientY-s.top)/s.height)*2+1),S.setFromCamera(P,d.renderCamera);const l=S.ray,g=R();w({gesture:{type:"pointer-ray",originX:l.origin.x,originY:l.origin.y,originZ:l.origin.z,directionX:l.direction.x,directionY:l.direction.y,directionZ:l.direction.z,length:Math.max(2,g.position.distanceTo(g.target))}})},E=()=>{!C&&y()&&w({gesture:null})};c.addEventListener("pointermove",z),c.addEventListener("pointerleave",E),v();const m=new Map,u=new Map,f=new Map;let L=-1;const q=()=>{const i=Y();if(!i||i.sequence===L)return;L=i.sequence;const s=i.participants.filter(t=>t.participantId!==j&&t.presence.document===n),l=s.filter(t=>t.presence.camera),g=new Set(l.map(t=>t.participantId));for(const[t,a]of m)g.has(t)||(A(a),m.delete(t));for(const t of l){let a=m.get(t.participantId);a||(a=le(t),m.set(t.participantId,a),r.add(a.helper,a.label)),de(a,t)}const F=s.flatMap(t=>t.presence.selection.slice(0,20).map(a=>({key:`${t.participantId}:${a}`,objectId:a,color:t.color}))),B=new Set(F.map(t=>t.key));for(const[t,a]of u)B.has(t)||(b(a),u.delete(t));for(const t of F){const a=o.objectMap.get(t.objectId),h=u.get(t.key);if(!a){h&&(b(h),u.delete(t.key));continue}if(h?.object===a)continue;h&&b(h);const $=ue(a,t.color);u.set(t.key,$),r.add($.helper)}const X=s.flatMap(t=>{const a=me(t.presence.gesture);return a?[{participantId:t.participantId,color:t.color,ray:a}]:[]}),N=new Set(X.map(t=>t.participantId));for(const[t,a]of f)N.has(t)||(D(a),f.delete(t));for(const t of X){let a=f.get(t.participantId);a||(a=fe(t.color),f.set(t.participantId,a),r.add(a.line)),ge(a,t.ray)}},T=i=>{if(!y())return;const s=i.detail?.participantId;if(typeof s!="string")return;const l=Y()?.participants.find(g=>g.participantId===s)?.presence.camera;l&&o.shell.setCameraPose({x:l.x,y:l.y,z:l.z},{x:l.targetX,y:l.targetY,z:l.targetZ},l.fov)};return window.addEventListener("editor:collaboration-join",T),{reportCamera:v,syncMarkers:i=>{q();for(const s of m.values())pe(s,i);for(const s of u.values())O(s.object,s.box)},live:()=>m.size+u.size+f.size>0,dispose:()=>{d.orbitControls.removeEventListener("change",v),d.transformControls.removeEventListener("dragging-changed",I),c.removeEventListener("pointermove",z),c.removeEventListener("pointerleave",E),window.removeEventListener("editor:collaboration-join",T);for(const i of m.values())A(i);m.clear();for(const i of u.values())b(i);u.clear();for(const i of f.values())D(i);f.clear()}}}function fe(e){const r=new re(new Float32Array(6),3),o=new ie;o.setAttribute("position",r);const n=new ae({color:new M(e),depthTest:!1,transparent:!0,opacity:.9}),c=new se(o,n);return c.name="Collaboration pointer ray",c.userData.editorOnly=!0,c.renderOrder=10001,{line:c,positions:r}}function ge(e,r){e.positions.setXYZ(0,r.origin.x,r.origin.y,r.origin.z),e.positions.setXYZ(1,r.end.x,r.end.y,r.end.z),e.positions.needsUpdate=!0,e.line.geometry.computeBoundingSphere()}function D(e){e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()}export{Le as bindStagePresenceMarkers};
@@ -1 +0,0 @@
1
- import{a}from"./jsx-runtime-DPjLkJKQ.js";import{dO as n,dP as m,J as l,dQ as f,ea as c,dR as S}from"./index-BRJMIUK0.js";import{r as e}from"./index-nmcBqr7Y.js";import{t as T}from"./StageHost-B89HKcvd.js";import{t as u}from"./editor-shell-store-ChLcVeNB.js";import{a as h,T as g}from"./Toolbar-DkTHnQto.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three-state-DwFE3ay2.js";import"./standard-viewport-dressing-BCA51Tum.js";import"./content-bounds-BeuIXKYu.js";import"./hierarchy-marks-Cc_3lxw6.js";import"./workspace-arrangement-BdAlBwvd.js";import"./three.core-3arARmh6.js";import"./editor-layers-BDJnAAzj.js";import"./environment-Dg-YaLsA.js";import"./three.module-BLhyNg0e.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-Bpj7diUS.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./three-contract-Dkt6PmWY.js";import"./model-inspection-CXHxrafK.js";import"./three-viewport-presentation-B0z_cECu.js";import"./clip-planes-CnAI6DZn.js";import"./three-TCuY32m_.js";import"./component-instance-root-B0C5oNEm.js";import"./entity-object-JmYMfLsx.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./model-thumbnail-BEKPWg4l.js";import"./studio-environment-DRxxq_QX.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./three-integration-BdN5Nhsg.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-kiQf53t5.js";import"./root-stacking-BEd9ZvxC.js";import"./object3d-document-session-registry-DJDEDM0p.js";import"./viewport-door-Bj_ZIP85.js";import"./asset-preview-B1tDziF1.js";import"./bitmap-label-Ct4k6ehY.js";import"./scene-framing-BQt72ZCw.js";import"./source-object3d-authoring-adapter-DF679Ncb.js";import"./three-projection-core-CG01r5Ta.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./transport-strip-CUjNltnb.js";import"./viewport-surface-status-cwCiBGa7.js";import"./transform-mode-request-DzD9aUNA.js";const s=new WeakMap;function x(r,t){if(r===null)return;const o=s.get(r)??new Set;if(s.set(r,o),o.has(t))return;o.add(t);const i={select:"select",transform:"combined",move:"translate",rotate:"rotate",scale:"scale"};r.shell.setTransformMode(i[S(t).interaction.bootTool])}function Cr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l(),o=T(r),i=f(r);if(e.useEffect(()=>{o==="gizmo"&&x(i&&u(i),r)},[o,i,r]),o==="none")return null;const p=o==="modal"?c(r):null;return a.jsx(g,{store:i??t,...p?{door:p}:{}})}function Dr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l();return a.jsx(h,{store:f(r)??t})}export{Dr as ThreeStageTransformControls,Cr as ThreeStageTransformTools};
@@ -1,24 +0,0 @@
1
- import{a as nt}from"./content-bounds-BeuIXKYu.js";import{EDITOR_LAYER as bt}from"./editor-layers-BDJnAAzj.js";import{loadEnvironmentImage as St}from"./environment-Dg-YaLsA.js";import{s as Y}from"./user-data-Bpj7diUS.js";import{P as J,S as Z}from"./three.module-BLhyNg0e.js";import{fv as xt,fw as kt,M as It}from"./index-BRJMIUK0.js";import{aE as q,bh as tt,j as Ft,I as Pt,co as Ct,db as Gt,fo as et,ap as Tt,e as Et,A as Rt,cP as _t,cj as d,_ as f,au as it,dw as rt,bi as Dt,aT as $t,c7 as Ot,c1 as z,ej as st,bg as At,aw as Bt,cx as Lt}from"./three.core-3arARmh6.js";let at=0;function zt(){at++}function se(){return at}const Ht=[.8,.5,-1],N=new f(1975600),U=new f(5004144);function lt(){const i=typeof document>"u"?null:document.querySelector("[data-vgai-palette]");if(!i)return{bottom:N.clone(),top:U.clone()};const t=getComputedStyle(i),o=document.createElement("canvas");o.width=o.height=1;const e=o.getContext("2d"),r=(s,u)=>{const p=t.getPropertyValue(s).trim();if(!e||!p||!CSS.supports("color",p))return u.clone();e.fillStyle=u.getStyle(),e.fillRect(0,0,1,1),e.fillStyle=t.getPropertyValue("--vgai-surface-shell").trim(),e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);const[y,l,M]=e.getImageData(0,0,1,1).data;return new f().setRGB(y/255,l/255,M/255,st)},n=r("--vgai-surface-panel",N),a=r("--vgai-surface-raised",U),h=n.lerp(N,.25).lerp(new f(16777215),.03),c=a.lerp(U,.25).lerp(new f(16777215),.04);return{bottom:h,top:c}}function Nt(i){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-vgai-palette]");if(!t)return()=>{};const o=new MutationObserver(()=>{i(),zt()});return o.observe(t,{attributes:!0,attributeFilter:["data-vgai-palette","data-vgai-material"]}),()=>o.disconnect()}function ct(i=lt()){const o=new Uint8Array(512),e=new f;for(let n=0;n<128;n++)e.copy(i.bottom).lerp(i.top,n/127).convertLinearToSRGB(),o[n*4]=Math.round(e.r*255),o[n*4+1]=Math.round(e.g*255),o[n*4+2]=Math.round(e.b*255),o[n*4+3]=255;const r=new it(o,1,128,rt);return r.colorSpace=st,r.magFilter=z,r.minFilter=z,r.needsUpdate=!0,r}function Ut(i){const t=nt(i);if(t.isEmpty())return{size:50,centre:[0,0]};const o=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(o/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function Wt(i){for(const t of[1,2,5,10])if(i/t<=60)return Math.round(i/t);return Math.round(i/10)}function ut(i,t){const o=t/2,e=o*.55,r=o;i.onBeforeCompile=n=>{n.uniforms.uGridFadeStart={value:e},n.uniforms.uGridFadeEnd={value:r},n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
2
- varying vec2 vGridPlanePosition;`).replace("#include <begin_vertex>",`#include <begin_vertex>
3
- vGridPlanePosition = position.xz;`),n.fragmentShader=n.fragmentShader.replace("#include <common>",`#include <common>
4
- varying vec2 vGridPlanePosition;
5
- uniform float uGridFadeStart;
6
- uniform float uGridFadeEnd;`).replace("#include <color_fragment>",`#include <color_fragment>
7
- diffuseColor.a *= 1.0 - smoothstep(uGridFadeStart, uGridFadeEnd, length(vGridPlanePosition));`)},i.customProgramCacheKey=()=>`vgai-grid-fade:${e}:${r}`}function jt(i,t){const{environment:o,background:e=!0,keyLight:r=!0,grid:n=!1}=t,a=[],h=[];let c=null;if(o&&(i.environment=o.texture),e&&(c=ct(),i.background=c),r){const l=new q(16774109,1.9);l.name="vgai:standard-dressing-key",l.position.set(6,10,-4),l.castShadow=!0,Y(l,"editorHelper",!0),i.add(l),a.push(l),h.push(l)}let s=null,u="";const p=l=>{if(!n)return;const{size:M,centre:w}=Ut(l),b=`${M}:${w.join(":")}`;if(b===u)return;u=b,s&&(s.removeFromParent(),s.dispose(),a.splice(a.indexOf(s),1));const g=new At(M,Wt(M),10066329,10066329);s=g;const S=g.material;S.transparent=!0,S.opacity=.35,S.depthWrite=!1,ut(S,M),g.name="vgai:standard-dressing-grid",g.position.set(w[0],-.02,w[1]),g.layers.set(bt),Y(g,"editorHelper",!0),i.add(g),a.push(g)};p(t.content??i);let y=!1;return{backgroundTexture:c,lights:h,frameContent:p,dispose(){if(!y){y=!0;for(const l of a)l.removeFromParent(),l.dispose?.();o&&(i.environment===o.texture&&(i.environment=null),o.dispose()),c&&(i.background===c&&(i.background=null),c.dispose())}}}}const W=12,qt=`
8
- vec3 vgaiHable( vec3 x ) {
9
- const float A = 0.22 * 4.0;
10
- const float B = 0.30 * 2.0;
11
- const float C = 0.10;
12
- const float D = 0.20;
13
- const float E = 0.01;
14
- const float F = 0.30;
15
- return ( ( x * ( A * x + C * B ) + D * E ) / ( x * ( A * x + B ) + D * F ) ) - E / F;
16
- }
17
- vec3 CustomToneMapping( vec3 color ) {
18
- color *= toneMappingExposure;
19
- return clamp( vgaiHable( max( vec3( 0.0 ), color ) ) / vgaiHable( vec3( 1.0 ) ), 0.0, 1.0 );
20
- }`;{const i=Z.tonemapping_pars_fragment,t="vec3 CustomToneMapping( vec3 color ) { return color; }";i.includes(t)&&(Z.tonemapping_pars_fragment=i.replace(t,qt))}const Vt={none:_t,aces:Rt,agx:Et,filmic:Tt};function ot(i){return`image|${i.id}|${i.url}`}function j(i){return i*i*(3-2*i)}function k(i,t,o){let e=Math.imul(i,374761393)^Math.imul(t,668265263)^Math.imul(o,1440662683);return e=Math.imul(e^e>>>13,1274126177),((e^e>>>16)>>>0)/4294967296}function Kt(i,t,o){const e=Math.floor(i),r=Math.floor(t),n=Math.floor(o),a=j(i-e),h=j(t-r),c=j(o-n),s=d.lerp,u=s(k(e,r,n),k(e+1,r,n),a),p=s(k(e,r+1,n),k(e+1,r+1,n),a),y=s(k(e,r,n+1),k(e+1,r,n+1),a),l=s(k(e,r+1,n+1),k(e+1,r+1,n+1),a);return s(s(u,p,h),s(y,l,h),c)}function dt(i,t,o){let e=0,r=.5,n=1,a=0;for(let h=0;h<5;h++)e+=r*Kt(i*n,t*n,o*n),a+=r,r*=.5,n*=2;return e/a}let D=null;function Xt(i){if(!D){const o=new Float32Array(4096);for(let e=0;e<o.length;e++){const r=1-2*(e+.5)/o.length,n=Math.sqrt(1-r*r),a=e*2.399963229728653;o[e]=dt(Math.cos(a)*n*4,r*4,Math.sin(a)*n*4)}D=o.sort()}const t=d.clamp(Math.round((1-i)*(D.length-1)),0,D.length-1);return D[t]}function Qt(i){if(!i)return null;const t=(e,r)=>typeof e=="number"&&Number.isFinite(e)?e:r,o={cover:d.clamp(t(i.cover,.5),0,1),opacity:d.clamp(t(i.opacity,1),0,1),scale:Math.max(t(i.scale,4),.1)};return o.cover>0&&o.opacity>0?o:null}const E=4,V=400;function Yt(){const i=new Lt({roughness:.9,metalness:0,transparent:!0,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),t=V/2;return i.onBeforeCompile=o=>{o.vertexShader=o.vertexShader.replace("void main() {",`varying vec2 vFloorPlane;
21
- void main() {`).replace("#include <begin_vertex>",`#include <begin_vertex>
22
- vFloorPlane = position.xz;`),o.fragmentShader=o.fragmentShader.replace("void main() {",`varying vec2 vFloorPlane;
23
- void main() {`).replace("#include <dithering_fragment>",`#include <dithering_fragment>
24
- gl_FragColor.a *= 1.0 - smoothstep(${(t*.3).toFixed(1)}, ${(t*.95).toFixed(1)}, length(vFloorPlane));`)},i.customProgramCacheKey=()=>"vgai-fading-floor",i}class Jt{constructor(t,o){this.onReady=o,this.group.name="vgai:stage-presentation-rig",this.group.userData.editorHelper=!0,this.group.add(this.ambient),t.add(this.group),this.previewGroup.name="vgai:stage-preview-rig",this.previewGroup.userData.editorHelper=!0,this.sun.name="vgai:preview-sun",this.sun.userData.editorHelper=!0,this.previewGroup.add(this.sun,this.sun.target),this.previewGroup.visible=!1,t.add(this.previewGroup),this.floor.name="vgai:preview-floor",this.floor.userData.editorHelper=!0,this.floor.receiveShadow=!0,this.floor.renderOrder=-1,this.floor.visible=!1,t.add(this.floor)}group=new tt;ambient=new Ft(16777215,0);lights=[];preset=null;presentation=null;source="studio";previewGroup=new tt;sun=new q(16777215,1);floorBounds=new Pt;floorContent=null;floor=new Ct(new Gt(V,V).rotateX(-Math.PI/2),Yt());sky=null;pmrem=null;direction=new et;loadingImage=null;pendingImage=null;failedImages=new Set;latestSky=null;rotation=0;disposed=!1;apply(t,o,e,r={}){this.presentation=t;const{lighting:n}=t,a=r.floor!==!1&&t.overlays.floor.visible,h=a&&!this.floor.visible;this.floor.visible=a,h&&this.floorContent&&this.placeFloor(this.floorContent),this.floor.material.color.set(t.overlays.floor.color);const c=xt(n.studioPreset);c!==this.preset&&this.build(c),this.source=n.source,this.group.visible=n.source==="studio",r.tone!==!1&&(o.toneMapping=e??Vt[n.tone.mapper],o.toneMappingExposure=n.tone.exposure);const{sun:s,environment:u}=n.preview,p=d.degToRad(s.altitude),y=d.degToRad(s.azimuth);this.sun.color.set(s.color),this.sun.intensity=s.enabled?s.energy:0,this.sun.position.set(Math.sin(y)*Math.cos(p),Math.sin(p),-Math.cos(y)*Math.cos(p)).multiplyScalar(W),this.sun.castShadow=s.enabled&&s.shadowDistance>0;const l=Math.min(Math.max(s.shadowDistance,1),50)/2;if(Object.assign(this.sun.shadow.camera,{left:-l,right:l,top:l,bottom:-l}),this.sun.shadow.camera.updateProjectionMatrix(),this.sun.updateMatrixWorld(),this.sun.target.updateMatrixWorld(),this.rotation=d.degToRad(u.rotation),!(r.sky!==!1&&u.enabled&&(n.source==="preview"||t.backdrop.source==="environment"))){this.loadingImage=null,this.pendingImage=null;return}const w=u.image===null?null:kt(u.image),b=()=>this.buildSky(u.sky,o,s.enabled?{direction:this.sun.position.clone().normalize(),color:s.color,energy:s.energy}:null);if(this.latestSky=b,w&&!this.failedImages.has(ot(w))){this.sky||b(),this.buildImage(w,o);return}this.loadingImage=null,this.pendingImage=u.image===null?null:{id:u.image,state:w?"failed":"unregistered"},b()}buildImage(t,o){const e=ot(t);if(this.sky?.key===e){this.pendingImage=null;return}this.loadingImage!==e&&(this.loadingImage=e,this.pendingImage={id:t.id,state:"loading"},St(t.url,t.format).then(r=>{if(this.disposed||this.loadingImage!==e){r.dispose();return}let n;try{this.pmrem??=new J(o),n=this.pmrem.fromEquirectangular(r)}catch(a){throw r.dispose(),a}this.loadingImage=null,this.pendingImage=null,this.disposeSky(),this.sky={key:e,image:t.id,background:r,environment:n},this.onReady?.()}).catch(r=>{this.disposed||this.loadingImage!==e||(this.loadingImage=null,this.failedImages.add(e),this.pendingImage={id:t.id,state:"failed"},It.error(`Environment image "${t.id}" (${t.url}) did not load: ${String(r)}`,"viewport"),this.latestSky?.(),this.onReady?.())}))}placeFloor(t){if(this.floorContent=t,!this.floor.visible)return;const o=nt(t,this.floorBounds);this.floor.position.y=o.isEmpty()?0:o.min.y,this.floor.updateMatrixWorld()}forgetFailedImages(){this.failedImages.clear()}sceneLightsShown(){return this.source!=="preview"||this.presentation?.lighting.preview.sceneLights!==!1}imageReport(){return{shown:this.sky?.image??null,pending:this.pendingImage}}turn(){return this.sky?.image?this.rotation:0}buildSky(t,o,e){const r=e?`${e.direction.toArray().map(m=>m.toFixed(4)).join(",")}|${e.color}|${e.energy}`:"none",n=Qt(t.clouds),a=n?`${n.cover}|${n.opacity}|${n.scale}`:"clear",h=`${t.top}|${t.horizon}|${t.ground}|${t.topCurve}|${t.groundCurve}|${a}|${r}`;if(this.sky?.key===h)return;this.disposeSky();const c=1024,s=512,u=d.degToRad(.5),p=d.degToRad(30),y=.15,l=new f(t.top),M=new f(t.horizon),w=new f(t.ground),b=e?new f(e.color).multiplyScalar(e.energy):null,g=new Uint16Array(c*s*4),S=m=>Bt.toHalfFloat(Math.min(m,65504)),ht=Math.max(t.topCurve,.001),pt=Math.max(t.groundCurve,.001),$=new f,I=new f,gt=new f(.92,.93,.95).lerp(M,.2),R=c/E,H=s/2/E+1,K=n?Xt(n.cover):1;let O=null;if(n){O=new Float32Array(R*H);for(let m=0;m<H;m++){const P=((Math.min(s/2+m*E,s-1)+.5)/s-.5)*Math.PI;for(let C=0;C<R;C++){const v=((C*E+.5)/c-.5)*Math.PI*2;O[m*R+C]=dt(Math.cos(v)*Math.cos(P)*n.scale,Math.sin(P)*n.scale,Math.sin(v)*Math.cos(P)*n.scale)}}}const X=new et;for(let m=0;m<s;m++){const x=((m+.5)/s-.5)*Math.PI,P=Math.PI/2-x;if(P<=Math.PI/2){const v=1-P/(Math.PI/2);$.copy(M).lerp(l,d.clamp(1-Math.pow(1-v,1/ht),0,1))}else{const v=(P-Math.PI/2)/(Math.PI/2);$.copy(M).lerp(w,d.clamp(1-Math.pow(1-v,1/pt),0,1))}const C=n&&x>0?d.smoothstep(Math.sin(x),0,.25):0;for(let v=0;v<c;v++){if(I.copy($),n&&O&&C>0){const _=v/E,G=(m-s/2)/E,T=Math.floor(_),B=Math.max(0,Math.floor(G)),Q=_-T,ft=G-Math.floor(G),L=(Mt,wt)=>O[Math.min(wt,H-1)*R+Mt%R],vt=d.lerp(d.lerp(L(T,B),L(T+1,B),Q),d.lerp(L(T,B+1),L(T+1,B+1),Q),ft),yt=d.smoothstep(vt,K-.1,K+.1);I.lerp(gt,yt*n.opacity*C)}if(b&&e&&x>-Math.PI/2){const _=((v+.5)/c-.5)*Math.PI*2;X.set(Math.cos(_)*Math.cos(x),Math.sin(x),Math.sin(_)*Math.cos(x));const G=X.angleTo(e.direction);if(G<u)I.copy(b);else if(G<p){const T=(G-u)/(p-u);I.copy(b).lerp($,d.clamp(1-Math.pow(1-T,1/y),0,1))}}const A=(m*c+v)*4;g[A]=S(I.r),g[A+1]=S(I.g),g[A+2]=S(I.b),g[A+3]=S(1)}}const F=new it(g,c,s,rt,Dt);F.mapping=$t,F.colorSpace=Ot,F.magFilter=z,F.minFilter=z,F.needsUpdate=!0,this.pmrem??=new J(o);const mt=this.pmrem.fromEquirectangular(F);this.sky={key:h,image:null,background:F,environment:mt}}disposeSky(){this.sky?.background.dispose(),this.sky?.environment.dispose(),this.sky=null}environment(){const t=this.presentation?.lighting;return t?this.source==="studio"?{texture:null,intensity:this.preset?.environmentIntensity??0,rotation:0}:this.source==="preview"?t.preview.environment.enabled?{texture:this.sky?.environment.texture??null,intensity:t.preview.environment.energy,rotation:this.turn()}:{texture:null,intensity:0,rotation:0}:null:null}backdrop(){const t=this.presentation?.backdrop;return!t||t.source==="fill"||t.source==="scene"?"keep":t.source==="transparent"?{value:null,blur:0,intensity:1,rotation:0}:t.source==="color"?{value:new f(t.color),blur:0,intensity:1,rotation:0}:this.sky?{value:this.sky.background,blur:t.blur,intensity:t.opacity,rotation:this.turn()}:"keep"}resolveSource(t){const o=this.presentation?.lighting;let e=o?.source??"studio";return o?.auto&&e!=="scene"&&o.auto.takeover.some(r=>t[r]===!0)&&(e="scene"),this.source=e,this.group.visible=e==="studio",this.previewGroup.visible=e==="preview",e}roots(){return[this.group,this.previewGroup,this.floor]}lightsVisible(){return this.group.visible&&this.lights.length>0}presetId(){return this.preset?.id??null}update(t){if(this.group.visible)for(const{light:o,spec:e}of this.lights)this.direction.set(...e.direction).normalize(),e.space==="camera"&&this.direction.applyQuaternion(t.quaternion),o.position.copy(this.direction).multiplyScalar(-W),o.target.position.set(0,0,0),o.updateMatrixWorld(),o.target.updateMatrixWorld()}dispose(){this.disposed=!0,this.clearLights(),this.group.removeFromParent(),this.previewGroup.removeFromParent(),this.floor.removeFromParent(),this.floor.geometry.dispose(),this.floor.material.dispose(),this.sun.dispose(),this.disposeSky(),this.pmrem?.dispose()}build(t){this.clearLights(),this.preset=t,this.ambient.color.set(t.ambient.color),this.ambient.intensity=t.ambient.intensity;for(const o of t.lights){const e=new q(o.color,o.intensity);e.name=`vgai:studio-light:${t.id}`,e.castShadow=o.castShadow===!0,e.userData.editorHelper=!0,this.group.add(e),this.group.add(e.target),this.lights.push({light:e,spec:o})}this.direction.set(0,0,0);for(const{light:o,spec:e}of this.lights)e.space==="world"&&(this.direction.set(...e.direction).normalize(),o.position.copy(this.direction).multiplyScalar(-W),o.updateMatrixWorld(),o.target.updateMatrixWorld())}clearLights(){for(const{light:t}of this.lights)t.removeFromParent(),t.target.removeFromParent(),t.dispose();this.lights=[]}}const ae=Object.freeze(Object.defineProperty({__proto__:null,STANDARD_COMPONENT_CAMERA_DIRECTION:Ht,StagePresentationRig:Jt,applyGridDistanceFade:ut,applyStandardViewportDressing:jt,createGradientBackgroundTexture:ct,paletteBackdropStops:lt,watchPaletteBackdrop:Nt},Symbol.toStringTag,{value:"Module"}));export{Ht as S,Jt as a,jt as b,ct as c,ae as d,zt as i,se as s,Nt as w};
@@ -1 +0,0 @@
1
- import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{ae as S,ad as o,aK as B,Z as L,q as $,eO as H}from"./index-BRJMIUK0.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const F=250,M=200,P=500,z="stateWatchPins";function x(e){return JSON.stringify([e.provider,...e.path])}function y(e){return[e.provider,...e.path].join(".")}function D(){return $().projectLocalState.projectRootPath()??"__unscoped__"}function k(e){const t=$().projectLocalState.read(z);return Array.isArray(t)?t.filter(r=>typeof r?.provider=="string"&&Array.isArray(r.path)&&r.path.every(s=>typeof s=="string")):[]}function N(e,t){$().projectLocalState.write(z,t.map(r=>({provider:r.provider,path:[...r.path]})))}function j(e){return e!==null&&typeof e=="object"}function A(e){if(typeof e=="string")return`“${e}”`;if(typeof e=="number")return Number.isInteger(e)?String(e):e.toFixed(3);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="bigint")return`${e}n`;if(typeof e=="function")return"[Function]";if(j(e))try{return Array.isArray(e)?`Array(${e.length})`:`Object(${Object.keys(e).length})`}catch{return"[Unreadable object]"}return String(e)}function _(e){try{return Object.entries(e)}catch{return[]}}function V(e,t){try{if(!Object.hasOwn(e,t.provider))return{available:!1,value:void 0};let r=e[t.provider];for(const s of t.path){if(!j(r)||!Object.hasOwn(r,s))return{available:!1,value:void 0};r=r[s]}return{available:!0,value:r}}catch{return{available:!1,value:void 0}}}function R(e,t,r,s,l,c){if(l.length>=P)return;const g=j(t)&&c.includes(t);if(!j(t)||g){const a={provider:e,path:r,value:g?"[Circular]":t};(y(a).toLowerCase().includes(s)||A(a.value).toLowerCase().includes(s))&&l.push(a);return}const p=[...c,t],m=_(t);if(m.length===0){const a={provider:e,path:r,value:t};y(a).toLowerCase().includes(s)&&l.push(a);return}for(const[a,v]of m)if(R(e,v,[...r,a],s,l,p),l.length>=P)return}const C={fontFamily:o.typography.mono,fontSize:11};function T({leaf:e,pinned:t,onTogglePin:r,depth:s=0}){const l=e.path.at(-1)??e.provider;return n.jsxs("div",{style:{...C,minHeight:22,display:"grid",gridTemplateColumns:"minmax(100px, 0.65fr) minmax(120px, 1fr) auto",alignItems:"center",gap:8,paddingLeft:8+s*14,paddingRight:8,borderBottom:`1px solid ${o.boundary.default}`},title:y(e),children:[n.jsx("span",{style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:l}),n.jsx("span",{style:{color:o.content.muted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A(e.value)}),n.jsx(L,{type:"button",size:"compact",variant:t?"primary":"secondary","aria-pressed":t,title:t?`Remove ${y(e)} from watches`:`Watch ${y(e)}`,onClick:()=>r(e),children:t?"Pinned":"Pin"})]})}function W({provider:e,name:t,value:r,path:s,depth:l,ancestors:c,pinnedKeys:g,onTogglePin:p}){const m=j(r)&&c.includes(r),[a,v]=d.useState(l===0);if(!j(r)||m){const f={provider:e,path:s,value:m?"[Circular]":r};return n.jsx(T,{leaf:f,depth:l,pinned:g.has(x(f)),onTogglePin:p})}const h=_(r),b=h.slice(0,M);return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>v(f=>!f),style:{...C,width:"100%",minHeight:22,display:"flex",alignItems:"center",gap:4,padding:`0 8px 0 ${8+l*14}px`,color:o.content.primary,background:"transparent",border:0,borderBottom:`1px solid ${o.boundary.default}`,textAlign:"left",cursor:"pointer"},children:[n.jsx("span",{style:{width:12,color:o.content.muted},children:n.jsx(H,{direction:a?"down":"right"})}),n.jsx("span",{children:t}),n.jsx("span",{style:{color:o.content.dim},children:Array.isArray(r)?`[${h.length}]`:`{${h.length}}`})]}),a&&b.map(([f,i])=>n.jsx(W,{provider:e,name:f,value:i,path:[...s,f],depth:l+1,ancestors:[...c,r],pinnedKeys:g,onTogglePin:p},f)),a&&h.length>b.length&&n.jsxs("div",{style:{...C,padding:`3px 8px 3px ${8+(l+1)*14}px`,color:o.content.dim},children:[h.length-b.length," more values — narrow with search"]})]})}function E(e){if(!e)return{providers:[],state:{},error:null};let t;try{t=e.providers()}catch(r){return{providers:[],state:{},error:r instanceof Error?r.message:String(r)}}try{return{providers:t,state:e.stateAll(),error:null}}catch(r){return{providers:t,state:{},error:r instanceof Error?r.message:String(r)}}}function K(){const e=D(),[t,r]=d.useState(()=>E(S())),[s,l]=d.useState(!1),[c,g]=d.useState(""),[p,m]=d.useState(()=>k());d.useEffect(()=>m(k()),[e]);const a=d.useCallback(()=>r(E(S())),[]);d.useEffect(()=>{if(a(),s)return;const i=window.setInterval(a,F);return()=>window.clearInterval(i)},[s,a]);const v=d.useMemo(()=>new Set(p.map(x)),[p]),h=d.useCallback(i=>{m(u=>{const w=x(i),I=u.some(O=>x(O)===w)?u.filter(O=>x(O)!==w):[...u,{provider:i.provider,path:[...i.path]}];return N(e,I),I})},[e]),b=d.useMemo(()=>{const i=c.trim().toLowerCase();if(!i)return[];const u=[];for(const w of t.providers)R(w.name,t.state[w.name],[],i,u,[]);return u},[c,t]);return S()?n.jsxs("div",{style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:{minHeight:34,display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx(B,{value:c,onChange:i=>g(i.target.value),placeholder:"Filter state paths or values…","aria-label":"Filter state watches",style:{width:240}}),n.jsx(L,{type:"button",size:"compact",onClick:()=>l(i=>!i),children:s?"Resume":"Pause"}),n.jsx(L,{type:"button",size:"compact",disabled:!s,onClick:a,children:"Refresh"}),n.jsxs("span",{style:{color:o.content.dim,fontSize:10},children:[t.providers.length," provider",t.providers.length===1?"":"s"," ·"," ",p.length," pinned",s?" · paused":""]}),t.error&&n.jsx("span",{style:{color:o.semantic.danger,fontSize:10},children:t.error})]}),n.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"minmax(280px, 1fr) minmax(240px, 0.65fr)"},children:[n.jsxs("section",{"aria-label":"Live state",style:{minWidth:0,overflow:"auto"},children:[c.trim()?b.length>0?b.map(i=>n.jsx(T,{leaf:i,pinned:v.has(x(i)),onTogglePin:h},x(i))):n.jsxs("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:["No state values match “",c.trim(),"”."]}):t.providers.map(i=>n.jsx(W,{provider:i.name,name:`${i.name} · ${i.tier}`,value:t.state[i.name],path:[],depth:0,ancestors:[],pinnedKeys:v,onTogglePin:h},i.name)),t.providers.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"The running game has not registered any state providers."})]}),n.jsxs("aside",{"aria-label":"Pinned watches",style:{minWidth:0,overflow:"auto",borderLeft:`1px solid ${o.boundary.default}`},children:[n.jsx("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 8px",color:o.content.muted,background:o.surface.panel,borderBottom:`1px solid ${o.boundary.default}`,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Watches"}),p.map(i=>{const u=V(t.state,i);return n.jsxs("div",{style:{...C,display:"grid",gridTemplateColumns:"minmax(130px, 1fr) minmax(100px, 0.7fr) auto",alignItems:"center",gap:8,minHeight:24,padding:"2px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx("span",{title:y(i),style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:y(i)}),n.jsx("span",{style:{color:u.available?o.content.muted:o.content.dim,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.available?A(u.value):"unavailable"}),n.jsx(L,{type:"button",size:"compact",onClick:()=>h(i),children:"Remove"})]},x(i))}),p.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"Pin values from the live tree to keep them visible while you inspect the game."})]})]})]}):n.jsx("div",{style:{padding:12,color:o.content.muted,fontSize:11},children:"State Watch is available while a game with debug providers is running."})}const te="workspace.utility",re="State Watch",ne=19,ie=()=>S()!=null;function oe(){return n.jsx(K,{})}export{ie as available,oe as default,ne as order,te as point,re as title};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/axe-LkjAB6Lv.js","assets/_commonjsHelpers-D6-XlEtG.js"])))=>i.map(i=>d[i]);
2
- import{f8 as se,eR as ie,dH as ae,f9 as ce,fa as le,fb as K,fc as H,a5 as U,eT as de,ak as L,al as T,ad as s,ew as u,ey as d,Z as A,eB as ue,aP as ye,aK as V,_ as pe,fd as fe,am as me,an as he,fe as Z,ff as ge,fg as ve,fh as xe,b6 as J,fi as Q,au as Se}from"./index-BRJMIUK0.js";import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{R as we,f as be}from"./presentation-BeNFBfKg.js";import{e as X,S as q}from"./surface-state-1lTOi8FD.js";import{m as ee,r as je}from"./StoryPreviewMount-D2lg37et.js";import{d as te}from"./surface-content-Dg9Kkazf.js";const Re=se,y=new Map;let oe=0;const M=new Set;function m(){oe++;for(const t of M)t()}function E(t){return M.add(t),()=>{M.delete(t)}}function O(){return oe}function Ee(t,e){return`story:${t}#${e}`}function Oe(t,e){return`story-docs:${t}#${e}`}function $(){const t=K();if(!t||t.descriptor.kind!=="story")return null;const e=y.get(t.descriptor.id);return e?.mode==="preview"?{...e,id:t.descriptor.id}:null}function F(t,e,o){const n=y.get(t);if(n){if(o===void 0){const i={...n.argOverrides};delete i[e],n.argOverrides=i}else n.argOverrides={...n.argOverrides,[e]:o};m()}}function Ce(t,e,o){const n=y.get(t);n&&(n.actionLog=[...n.actionLog,{name:e,args:o,time:Date.now()}].slice(-200),m())}function ke(t){const e=y.get(t);!e||e.actionLog.length===0||(e.actionLog=[],m())}function re(t,e,o,n={}){Ue();const i=Ee(e,o);y.has(i)||(y.set(i,{modulePath:e,storyName:o,mode:"preview",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m());const a=n.activate===void 0?{}:{activate:n.activate};return Q({id:i,title:n.title??o,kind:"story",workspaceRole:"authored-subject",provenance:{sourcePath:e},Content:Te,Toolbar:$e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"preview"}),persist:()=>({modulePath:e,storyName:o}),onDispose:p=>{y.delete(p)&&m()}},a)}function Y(t,e,o){const n=Oe(e,o);return y.has(n)||(y.set(n,{modulePath:e,storyName:o,mode:"docs",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m()),Q({id:n,title:`${o} — Docs`,kind:"story",workspaceRole:"workspace-reference",provenance:{sourcePath:e},Content:_e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"docs"}),persist:()=>({modulePath:e,storyName:o,view:"docs"}),onDispose:i=>{y.delete(i)&&m()}})}function Ne(){const t=Se();return t?xe(t).then(J,J):Promise.resolve()}fe({kind:"story",owner:"story-documents",prepare:Ne,restore:({state:t,store:e})=>{const o=t,n=typeof o?.modulePath=="string"?o.modulePath:null,i=typeof o?.storyName=="string"?o.storyName:null;if(!n||!i)return!1;const a=T().find(c=>c.modulePath===n);if(!a?.ok||!a.stories.some(c=>c.name===i))return!1;if(o?.view==="docs")return Y(e,n,i),!0;const{medium:p}=me({modulePath:n,regions:he()});return p!=="dom"&&p!=="canvas"?!1:(re(e,n,i),!0)}});Z({id:ge,owner:"story-documents",open:(t,e)=>re(t,e.modulePath,e.storyName,{...e.title===void 0?{}:{title:e.title},...e.activate===void 0?{}:{activate:e.activate}})});Z({id:ve,owner:"story-documents",open:(t,e)=>Y(t,e.modulePath,e.storyName)});function W(t,e){const o=T().find(n=>n.modulePath===t);return o?o.ok?{story:o.stories.find(n=>n.name===e),moduleError:void 0}:{story:void 0,moduleError:o.error}:{story:void 0,moduleError:void 0}}function ne(t){const e=t.Component.args;return e&&typeof e=="object"?e:{}}function Pe(t,e){const o=y.get(t),n={};for(const[i,a]of Object.entries(ne(e)))typeof a=="function"&&(n[i]=(...p)=>(Ce(t,i,p),a(...p)));return{...n,...o?.argOverrides??{}}}function Te({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>T());const e=y.get(t),o=l.useRef(null),n=l.useRef(null),[i,a]=l.useState(!1),[p,c]=l.useState("unknown"),[v,w]=l.useState(null),[z,D]=l.useState({width:0,height:0}),{story:b,moduleError:x}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0},h=e?JSON.stringify(e.argOverrides):"";l.useEffect(()=>{const f=o.current;if(!f)return;if(typeof ResizeObserver>"u"){D({width:f.clientWidth,height:f.clientHeight});return}const j=new ResizeObserver(([R])=>{if(!R)return;const{width:_,height:N}=R.contentRect;D(P=>P.width===_&&P.height===N?P:{width:_,height:N})});return j.observe(f),()=>j.disconnect()},[]),l.useEffect(()=>{const f=n.current;if(!f||!e)return;e.container!==f&&(e.container=f,m());const j=e.previewRevision+1;if(e.previewRevision=j,e.previewReady=!1,e.playResult=null,e.accessibility={status:"idle",violations:[]},m(),c("unknown"),w(null),!b){a(!1),c("empty");return}let R=!1,_,N;const P=()=>{R||c(te(f)?"present":"empty")},G=new MutationObserver(P);return G.observe(f,{childList:!0,subtree:!0,characterData:!0}),a(!0),ee(f,e.modulePath,e.storyName,b.Component,Pe(t,b)).then(S=>{if(R){S?.unmount();return}if(!S){y.get(t)?.previewRevision===j&&(a(!1),c("empty"));return}const B=y.get(t);if(!B||B.previewRevision!==j){S.unmount();return}_=S.unmount,B.previewReady=!0,a(!1),N=setTimeout(P,0),m()},S=>{R||y.get(t)?.previewRevision!==j||(a(!1),w(S instanceof Error?S.message:String(S)),c("empty"))}),()=>{R=!0,G.disconnect(),N!==void 0&&clearTimeout(N),_?.()}},[t,e,b,h]);const C=e?.resolution.width===null,g=!e||C?1:be(z,{width:e.resolution.width,height:e.resolution.height}).scale;if(l.useEffect(()=>{!e||!Number.isFinite(g)||g<=0||e.scale===g||(e.scale=g,m())},[g,e]),!e)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.muted,pointerEvents:"auto"},children:"This story document is no longer available."});const k=`${e.modulePath}#${e.storyName}`,I=b?v?{tone:"error",title:`Story ${k} failed`,description:v}:X({surface:"Story",rootIds:[k],phase:i?"loading":"ready",content:p}):{tone:"error",title:`Story ${k} is unavailable`,description:x??`No story export named “${e.storyName}” exists in ${e.modulePath}; it may have been renamed or removed.`};return r.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",pointerEvents:"auto"},children:r.jsx("div",{ref:o,style:{position:"relative",flex:1,minHeight:0,overflow:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsxs("div",{style:C?{position:"absolute",inset:0}:{position:"relative",width:e.resolution.width*g,height:e.resolution.height*g,flex:"0 0 auto"},children:[r.jsx("div",{"data-testid":"story-preview-root",ref:n,style:{position:"absolute",inset:0,isolation:"isolate",contain:"layout paint",overflow:"auto",background:s.surface.inset,...C?{}:{width:e.resolution.width,height:e.resolution.height,transform:`scale(${g})`,transformOrigin:"top left"}}}),r.jsx(q,{explanation:I,testId:"story-surface-status"})]})})})}function De(t){const e=t.parameters.docs;if(!e||typeof e!="object")return{};const o=e.description;if(typeof o=="string")return{story:o};if(!o||typeof o!="object")return{};const n=o;return{...typeof n.component=="string"?{component:n.component}:{},...typeof n.story=="string"?{story:n.story}:{}}}function _e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>T());const e=y.get(t),o=l.useRef(null),[n,i]=l.useState("unknown"),[a,p]=l.useState(null),{story:c,moduleError:v}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0};if(l.useEffect(()=>{const x=o.current;if(!x||!e||!c)return;let h=!1,C=null,g;i("unknown"),p(null);const k=()=>{h||i(te(x)?"present":"empty")},I=new MutationObserver(k);return I.observe(x,{childList:!0,subtree:!0,characterData:!0}),ee(x,e.modulePath,e.storyName,c.Component).then(f=>{if(!f){h||i("empty");return}h?f.unmount():(C=f.unmount,g=setTimeout(k,0))},f=>{h||(p(f instanceof Error?f.message:String(f)),i("empty"))}),()=>{h=!0,I.disconnect(),g!==void 0&&clearTimeout(g),C?.()}},[e,c]),!e||!c)return r.jsx("div",{style:{padding:u[8],color:s.semantic.danger,fontSize:d.md},children:v??"This Storybook Docs document is no longer available."});const w=De(c),z=c.args,D=`${e.modulePath}#${e.storyName}`,b=a?{tone:"error",title:`Story ${D} failed`,description:a}:X({surface:"Story",rootIds:[D],phase:n==="unknown"?"loading":"ready",content:n});return r.jsx("article",{"data-testid":"story-docs-document",className:"vgai-content-frost",style:{flex:1,minHeight:0,overflow:"auto",pointerEvents:"auto",padding:"24px clamp(18px, 5vw, 64px)"},children:r.jsxs("div",{style:{maxWidth:920,margin:"0 auto",display:"flex",flexDirection:"column",gap:22},children:[r.jsxs("header",{children:[r.jsx("div",{style:{color:s.content.dim,fontSize:d.base,marginBottom:5},children:c.title??e.modulePath}),r.jsx("h1",{style:{color:s.content.primary,fontSize:d.heading,margin:0},children:c.label}),(w.story??w.component)&&r.jsx("p",{style:{color:s.content.primary,lineHeight:1.6,maxWidth:760,whiteSpace:"pre-wrap"},children:w.story??w.component})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:s.content.primary,fontSize:d.xl},children:"Canvas"}),r.jsxs("div",{style:{position:"relative",minHeight:180},children:[r.jsx("div",{ref:o,"data-testid":"story-docs-canvas",style:{position:"relative",isolation:"isolate",contain:"layout paint",minHeight:180,padding:18,overflow:"auto",background:s.surface.inset,border:`1px solid ${s.boundary.default}`,borderRadius:s.shape.medium}}),r.jsx(q,{explanation:b,testId:"story-docs-surface-status"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:s.content.primary,fontSize:d.xl},children:"Args"}),r.jsxs("div",{style:{border:`1px solid ${s.boundary.default}`,borderRadius:s.shape.medium,overflow:"hidden"},children:[Object.entries(z).map(([x,h])=>r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(120px, .4fr) minmax(140px, .6fr) 1fr",gap:u[6],padding:`${u[4]} ${u[5]}`,borderBottom:`1px solid ${s.boundary.default}`,fontSize:d.base},children:[r.jsx("code",{style:{color:s.accent.default},children:x}),r.jsx("span",{style:{color:s.content.muted},children:Array.isArray(h)?"array":typeof h}),r.jsx("code",{style:{color:s.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:typeof h=="function"?"function":JSON.stringify(h)})]},x)),Object.keys(z).length===0&&r.jsx("div",{style:{padding:u[5],color:s.content.dim,fontSize:d.base},children:"This story declares no args."})]})]}),r.jsxs("footer",{style:{color:s.content.dim,fontSize:d.sm},children:[e.modulePath," · ",e.storyName]})]})})}function $e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>T());const e=y.get(t);if(!e)return null;const{story:o}=W(e.modulePath,e.storyName),n=typeof o?.Component.play=="function",i=e.playResult;return r.jsxs("div",{"data-testid":"story-document-toolbar",style:{display:"flex",alignItems:"center",gap:u[4],padding:"3px 10px",fontSize:d.sm,color:s.content.muted,borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsxs("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:[e.modulePath," —"," ",r.jsx("code",{style:{color:s.accent.default},children:e.storyName})]}),r.jsx(we,{resolution:e.resolution,scale:e.scale,onResolutionChange:a=>{e.resolution=a,m()}}),r.jsx(A,{size:"compact","data-testid":"story-open-docs",onClick:()=>Y(e.store,e.modulePath,e.storyName),style:{flexShrink:0},children:"Docs"}),n&&o&&r.jsx(A,{variant:"outline",size:"compact","data-testid":"story-run-play",onClick:async()=>{if(!e.container||!e.previewReady)return;const a=e.previewRevision,p=await je(e.modulePath,e.storyName,o.Component,e.container),c=y.get(t);c?.previewReady&&c.previewRevision===a&&(c.playResult=p,m())},disabled:!e.previewReady,style:{flexShrink:0},children:"Run play()"}),i?.ran&&!i.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:s.semantic.success,fontWeight:600},children:"play() ran"}),i?.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:s.semantic.danger},children:i.error})]})}function ze({id:t,name:e,value:o}){return r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:u[3],padding:"3px 0"},children:[r.jsx("span",{style:{width:90,flexShrink:0,fontSize:d.base,color:s.content.muted,overflow:"hidden",textOverflow:"ellipsis"},title:e,children:e}),typeof o=="boolean"?r.jsx(ye,{className:"vgai-checkbox","data-testid":`story-arg-${e}`,checked:o,onChange:n=>F(t,e,n.target.checked)}):typeof o=="number"?r.jsx(V,{type:"number",className:"vgai-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>{const i=n.target.value,a=Number.parseFloat(i);F(t,e,i===""||Number.isNaN(a)?void 0:a)},style:{width:80}}):typeof o=="string"?r.jsx(V,{type:"text",className:"vgai-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>F(t,e,n.target.value),style:{flex:1,minWidth:0}}):r.jsx("span",{style:{fontSize:d.base,color:s.content.dim},"data-testid":`story-arg-${e}`,children:typeof o=="function"?"fn (logged to Actions)":JSON.stringify(o)})]})}function Ie(){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>T());const t=$();if(!t)return null;const{story:e}=W(t.modulePath,t.storyName),o=e?{...ne(e),...t.argOverrides}:{},n=Object.keys(o);return r.jsxs("div",{"data-testid":"inspector-story-args",style:{pointerEvents:"auto",padding:u[4],borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsx("div",{style:{fontSize:d.base,color:s.content.dim,textTransform:"uppercase",marginBottom:u[2]},children:"Story Args"}),r.jsx("div",{style:{fontSize:d.base,color:s.content.primary,fontWeight:600,marginBottom:u[2]},children:t.storyName}),n.length===0&&r.jsx("div",{style:{fontSize:d.base,color:s.content.dim},children:e?"This story declares no args.":"Story source unavailable."}),n.map(i=>r.jsx(ze,{id:t.id,name:i,value:o[i]},i))]})}function Ae(){l.useSyncExternalStore(E,O);const t=$();return t?r.jsxs("div",{"data-testid":"story-actions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[4],fontSize:d.base},children:[r.jsx(A,{size:"compact",style:{marginBottom:u[3]},onClick:()=>ke(t.id),children:"Clear"}),t.actionLog.length===0?r.jsx("div",{style:{color:s.content.dim},children:"No actions logged — function-valued args are wrapped with logging spies; interact with the story preview to see calls here."}):t.actionLog.map((e,o)=>r.jsxs("div",{style:{padding:`${u[1]} 0`,borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsx("code",{style:{color:s.accent.default},children:e.name})," ",r.jsxs("span",{style:{color:s.content.muted},children:["(",e.args.map(n=>{try{return typeof n=="object"?JSON.stringify(n)?.slice(0,80):String(n)}catch{return String(n)}}).join(", "),")"]})]},o))]}):r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."})}function Le(){l.useSyncExternalStore(E,O);const t=$();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."});const e=t.playResult;return r.jsxs("div",{"data-testid":"story-interactions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[6],fontSize:d.md},children:[!e&&r.jsx("div",{style:{color:s.content.dim},children:"No interaction run yet — use the story document's “Run play()”."}),e&&!e.ran&&r.jsx("div",{style:{color:s.content.dim},children:"This story declares no play() function."}),e?.ran&&!e.error&&r.jsx("div",{style:{color:s.semantic.success,fontWeight:600},children:"play() ran without errors."}),e?.error&&r.jsx("div",{style:{color:s.semantic.danger,whiteSpace:"pre-wrap"},children:e.error})]})}async function We(t){const e=y.get(t);if(!e?.container||!e.previewReady)return;const o=e.container,n=e.previewRevision;e.accessibility={status:"running",violations:[]},m();try{const a=await(await pe(async()=>{const{default:c}=await import("./axe-LkjAB6Lv.js").then(v=>v.a);return{default:c}},__vite__mapDeps([0,1]))).default.run(o),p=y.get(t);if(!p?.previewReady||p.previewRevision!==n||p.container!==o)return;p.accessibility={status:"complete",violations:a.violations.map(c=>({id:c.id,impact:c.impact??null,help:c.help,helpUrl:c.helpUrl,nodes:c.nodes.map(v=>({html:v.html,target:v.target.map(String)}))}))},m()}catch(i){const a=y.get(t);if(!a?.previewReady||a.previewRevision!==n||a.container!==o)return;a.accessibility={status:"error",violations:[],error:i instanceof Error?i.message:String(i)},m()}}function Be(){l.useSyncExternalStore(E,O);const t=$();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."});const e=t.accessibility;return r.jsxs("div",{"data-testid":"story-accessibility-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[5],fontSize:d.base},children:[r.jsx(A,{variant:"outline",size:"compact",disabled:!t.container||!t.previewReady||e.status==="running",onClick:()=>void We(t.id),style:{marginBottom:u[4]},children:e.status==="running"?"Checking…":"Run accessibility check"}),e.status==="idle"&&r.jsx("div",{style:{color:s.content.dim},children:"Run axe against the mounted story preview."}),e.status==="error"&&r.jsx("div",{style:{color:s.semantic.danger},children:e.error}),e.status==="complete"&&e.violations.length===0&&r.jsx("div",{style:{color:s.semantic.success,fontWeight:600},children:"No accessibility violations found."}),e.violations.map(o=>r.jsxs("details",{style:{borderBottom:`1px solid ${s.boundary.default}`,padding:`${u[3]} 0`},children:[r.jsxs("summary",{style:{color:o.impact==="critical"||o.impact==="serious"?s.semantic.danger:s.content.primary,cursor:"pointer"},children:[o.help," · ",o.nodes.length," node",o.nodes.length===1?"":"s"]}),r.jsx("a",{href:o.helpUrl,target:"_blank",rel:"noreferrer",style:{color:s.accent.default,display:"inline-block",margin:"5px 0"},children:"How to fix"}),o.nodes.map((n,i)=>r.jsxs("pre",{style:{color:s.content.muted,fontFamily:ue,fontSize:d.sm,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:[n.target.join(" "),`
3
- `,n.html]},`${o.id}:${i}`))]},o.id))]})}const He=de();function Ue(){He.ensure(t=>{t(ie({match:()=>K()?.descriptor.kind==="story",id:le,title:ce,icon:Re,order:ae,Section:Ie}));const e=()=>$()!==null;t(H({...U.storyActions,Content:Ae,available:e})),t(H({...U.storyInteractions,Content:Le,available:e})),t(H({...U.storyAccessibility,Content:Be,available:e}))})}export{Re as S,Ue as e,Ne as p,Ee as s};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-three-rapier.esm-U8J7g6tH.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/BufferGeometryUtils-FJZNEiJN.js"])))=>i.map(i=>d[i]);
2
- import{L as U,gW as W,gX as z,_ as H}from"./index-BRJMIUK0.js";import{r as F}from"./index-nmcBqr7Y.js";import{f as G}from"./asset-preview-B1tDziF1.js";import{C as $}from"./crash-null-boundary-v3a0uEgw.js";import{T as q}from"./three.module-BLhyNg0e.js";import{e as Q,f as V}from"./events-156d8d12.esm-CYeuVCYr.js";import{r as X}from"./story-mount-turn-DFRTj5hi.js";import{A as J,ej as K,d7 as Y}from"./three.core-3arARmh6.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-Cc_3lxw6.js";import"./studio-environment-DRxxq_QX.js";import"./user-data-Bpj7diUS.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-bQE2NA0D.js";const Z=1/60,ee=6,te=15,N=1e-4,ne=2,re=10,oe=250,ie=4e3;function b(e){e.updateMatrixWorld(!0);const t=[];return e.traverse(n=>{const r=n.matrixWorld.elements;t.push(r[12],r[13],r[14])}),t}function D(e){let t=0;return e.traverse(()=>{t++}),t}function x(e,t){if(e.length!==t.length)return Number.NaN;let n=0;for(let r=0;r<t.length;r+=3){const o=t[r]-e[r],a=t[r+1]-e[r+1],i=t[r+2]-e[r+2],s=Math.sqrt(o*o+a*a+i*i);if(!Number.isFinite(s))return Number.NaN;s>n&&(n=s)}return n}const se=()=>new Promise(e=>setTimeout(e,0));async function ae(e,t,n){const r=n();let o=D(e),a=r,i=!1;for(;n()-r<ie;){if(n()-a>=oe){i=!0;break}await t();const s=D(e);s!==o&&(o=s,a=n())}return{buildWaitMs:n()-r,buildSettled:i}}function C(e){return{outcome:e,steps:0,lastMotion:0,buildWaitMs:0,buildSettled:!0}}function ce(e){return e.hasPhysicsSubscriber!==!1}async function ue(e,t={}){const n=t.yieldTurn??se,r=t.now??(()=>Date.now()),o=e.update?.bind(e);if(!o)return C("unsupported");if(!ce(e))return C("still");const{buildWaitMs:a,buildSettled:i}=await ae(e.scene,n,r);let s=b(e.scene),l=0,u=0,h=!1,E=0,y="still";for(let d=0;d<te;d++){for(let w=0;w<ee;w++)o(Z),l++;await n();const m=b(e.scene),p=x(s,m);if(s=m,!Number.isFinite(p)){u=0;continue}if(E=p,p>N){h=!0,u=0,y="budget";continue}if(u++,h&&u>=ne){y="rest";break}}for(let d=0;d<re;d++){await n();const m=b(e.scene),p=x(s,m);if(s=m,Number.isFinite(p)&&p<=N)break}return{outcome:y,steps:l,lastMotion:E,buildWaitMs:a,buildSettled:i}}const le={packaged:!1,createElement:F.createElement,createR3FRoot:V,extendThree:Q,three:q};let R=null;async function de(){const e=await import(W);for(const t of["createElement","createR3FRoot","extendThree"])if(typeof e[t]!="function")throw new Error(`The packaged R3F preview runtime did not export ${t} as a function — see vite-plugin-module-doorways.ts.`);if(typeof e.projectThree!="object"||e.projectThree===null)throw new Error("The packaged R3F preview runtime did not export projectThree — see vite-plugin-module-doorways.ts.");return{packaged:!0,createElement:e.createElement,createR3FRoot:e.createR3FRoot,extendThree:e.extendThree,three:e.projectThree}}async function me(){return await U()?(R||(R=de()),R):le}let T=null;function nt(){return T}const v="vgai:story-preview-root",pe=1e4;function P(e){if(typeof e=="function"){const t=e;return t.displayName||t.name||""}if(e&&typeof e=="object"){const t=e;return typeof t.displayName=="string"&&t.displayName.length>0?t.displayName:typeof t.name=="string"&&t.name.length>0?t.name:P(t.type??t.render)}return""}function fe(e){const t=e,n=t._reactInternals??t._reactInternalFiber;return n&&typeof n=="object"?n:void 0}function he(e){const t=[P(e.type),P(e.elementType)];if(!(t.includes("RigidBody")||t.includes("InstancedRigidBodies")))return{provider:t.includes("Physics"),body:!1,movingBody:!1};const r=e.memoizedProps&&typeof e.memoizedProps=="object"?e.memoizedProps:{};return{provider:t.includes("Physics"),body:!0,movingBody:r.type!=="fixed"}}function ye(e){const t=e?[e]:[],n=new Set;let r=!1,o=!1,a=!1;for(;t.length>0;){const i=t.pop();if(n.has(i))continue;n.add(i);const s=he(i);r||=s.provider,o||=s.body,a||=s.movingBody,i.child&&t.push(i.child),i.sibling&&t.push(i.sibling)}return r?!o||a:!1}class we extends F.Component{componentDidMount(){this.props.onReport(ye(fe(this)))}render(){return this.props.children??null}}function Ee(e){return e instanceof Error&&e.message.includes("is not part of the THREE namespace")}function L(e){return Ee(e)?!0:e instanceof Error?e.message.includes("Hooks can only be used within the Canvas component")||e.message.includes("useGame: no Game in context"):!1}function rt(e){return L(e)}function I(e){return e instanceof Error&&e.message.includes("useRapier must be used within <Physics")}async function Te(e){try{return(e.packaged?await import("/@id/@react-three/rapier"):await H(()=>import("./react-three-rapier.esm-U8J7g6tH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))).Physics}catch{return null}}function ge(e,t,n){const r=globalThis,o=r.reportError,a=typeof o=="function"?o.bind(globalThis):i=>{console.error(i)};r.reportError=i=>{L(i)||t&&I(i)||a(i)};try{return n(e)}finally{r.reportError=o}}function Se(e){return{domElement:e,xr:{enabled:!1,addEventListener(){},removeEventListener(){},setAnimationLoop(){},getSession(){return null}},shadowMap:{enabled:!1,type:Y},outputColorSpace:K,toneMapping:J,setPixelRatio(){},setSize(){},setClearColor(){},setClearAlpha(){},setViewport(){},setScissor(){},setScissorTest(){},setAnimationLoop(){},clear(){},render(){},compile(){},dispose(){},getPixelRatio(){return 1},getContext(){return null}}}let O=null;function k(e){return X(()=>e(Pe))}function be(e){O!==e.extendThree&&(O=e.extendThree,e.extendThree(e.three))}async function Re(e,t={}){return k(n=>n(e,t))}function ve(e){return k(async()=>e.dispose())}async function Pe(e,t={}){const n=z();T=null;const r=n?Date.now():0,o=await me(),a=n?Date.now()-r:0,i=n?Date.now():0;typeof e.load=="function"&&await e.load();const s=n?Date.now()-i:0;try{return await j(o,e,t,void 0,{timed:n,runtimeMs:a,loadMs:s})}catch(l){if(!I(l))throw l;const u=await Te(o);if(!u)throw l;return await j(o,e,t,h=>o.createElement(u,{paused:!1},h),{timed:n,runtimeMs:a,loadMs:s})}}async function j(e,t,n,r,o){be(e);const a=document.createElement("canvas"),i=ge(a,r===void 0,e.createR3FRoot);let s;const l=new Promise(c=>{s=c});await i.configure({gl:(()=>Se(a)),frameloop:"never",size:{width:128,height:96,top:0,left:0},onCreated:c=>s(c)});let u=null,h;const E=new Promise((c,S)=>{h=S}),y=c=>{u??=new Error("mountStoryObject3D: the story threw while reconciling into an R3F root — it does not render `three` content (a DOM/React story), or its component crashed. Original error: "+String(c instanceof Error?c.message:c),{cause:c}),h(u)},d=e.createElement(t,n);let m=!1;const p=c=>{m=c};i.render(e.createElement("group",{name:v},e.createElement($,{onCaught:y},e.createElement(we,{onReport:p},r?r(d):d))));const w=o?.timed?Date.now():0;let M;const f=await Promise.race([l,E,new Promise((c,S)=>{M=setTimeout(()=>S(new Error("mountStoryObject3D: onCreated did not fire within 10s — the story never reached its first R3F commit and never threw. Either it is still SUSPENDED on a slow load (a suspending loader with no <Suspense> boundary holds the first commit until its content is ready), or its render is hung.")),pe)})]).catch(c=>{throw o?.timed&&(T={runtimeMs:o.runtimeMs,loadMs:o.loadMs,fiberMs:Date.now()-w,settleMs:0}),i.unmount(),c}).finally(()=>clearTimeout(M));if(u)throw i.unmount(),u;f.clock.autoStart=!1,f.clock.stop();const g=f.scene.getObjectByName(v);if(!g)throw i.unmount(),new Error(`mountStoryObject3D: the story's wrapper group ("${v}") is not in the scene after its first commit — the story rendered nothing mountable.`);const A=o?.timed?Date.now()-w:0,B=o?.timed?Date.now():0;await ue({scene:g,update:c=>{f.advance(f.clock.elapsedTime+Math.min(c,.1),!1)},hasPhysicsSubscriber:m}),o?.timed&&(T={runtimeMs:o.runtimeMs,loadMs:o.loadMs,fiberMs:A,settleMs:Date.now()-B});let _=f.clock.elapsedTime;return{root:g,scene:f.scene,advance(c){!(c>0)||!Number.isFinite(c)||(_+=Math.min(c,.1),f.advance(_,!1))},dispose(){i.unmount()}}}async function ot(e,t={}){const n=await Re(e,t.props??{});try{const r=G(n.root,{width:t.width??128,height:t.height??96,...t.camera===void 0?{}:{camera:t.camera},...t.pose===void 0?{}:{pose:t.pose}}),o=r.views.find(a=>a.view==="perspective")??r.views[0];if(!o)throw new Error("Story preview capture returned no views.");return`data:${o.mimeType};base64,${o.base64}`}finally{await ve(n)}}function it(){return typeof WebGLRenderingContext<"u"&&typeof navigator<"u"&&!navigator.userAgent.toLowerCase().includes("jsdom")}export{v as PREVIEW_ROOT_NAME,ot as captureStoryComponentThumbnail,ve as disposeStoryObject3D,rt as isStoryThreeClassificationRefusal,nt as lastStoryMountPhaseTiming,Re as mountStoryObject3D,it as supportsThreeStoryCapture,k as withStoryMountTurn};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-Byplgb8G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js"])))=>i.map(i=>d[i]);
2
- import{_ as y}from"./index-BRJMIUK0.js";import{s as l}from"./user-data-Bpj7diUS.js";import{D as T,K as S,M as E}from"./KTX2Loader-CaqVE6nY.js";import{GLTFLoader as L}from"./GLTFLoader-KeoruJgS.js";import{cc as M,eX as v,fo as p,co as I,K as b}from"./three.core-3arARmh6.js";import{createStandardEnvironment as x}from"./environment-Dg-YaLsA.js";let D="/";function w(t){return t.startsWith("/")||t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:")?t:D+t}const r=new M;r.setURLModifier(w);new v(r);const h=new T(r);h.setDecoderPath("/jsm/libs/draco/gltf/");const _=new S(r);_.setTranscoderPath("/jsm/libs/basis/");const f=new L(r);f.setDRACOLoader(h);f.setKTX2Loader(_);f.setMeshoptDecoder(E);function N(t){return w(t)}const i=new Map;async function z(t,a){let e=i.get(t);!e&&a&&(e=Promise.resolve(a),i.set(t,e)),e||(e=fetch(N(t)).then(async s=>{if(!s.ok)throw new Error(`Failed to load Gaussian splat: ${t} (${s.status} ${s.statusText})`);return new Uint8Array(await s.arrayBuffer())}),i.set(t,e));try{const[{SplatMesh:s},g]=await Promise.all([y(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3])),e]),n=new s({fileBytes:g,fileName:t,raycastable:!0});await n.initialized,l(n,"gaussianSplat",{src:t,numSplats:n.numSplats});const d=n.getBoundingBox();if(!d.isEmpty()){const m=d.getSize(new p).multiplyScalar(1.5),u=d.getCenter(new p),o=new I(new b(m.x,m.y,m.z));o.name="__vgai_splat_bounds",o.position.copy(u),o.visible=!1,o.raycast=()=>{},l(o,"engineInternal",!0),n.add(o)}return n}catch(s){throw i.delete(t),s}}const O=.45,C=.25,c=new WeakMap;function K(t,a){let e=c.get(a);e||(e=x(a),c.set(a,e)),t.environment=e.texture,t.environmentIntensity=O}function V(t){const a=c.get(t);a&&(c.delete(t),a.dispose())}export{C as S,K as a,V as d,f as g,z as l,N as r};
@@ -1 +0,0 @@
1
- import{af as d,ag as k,ah as b,ai as N}from"./index-BRJMIUK0.js";import{r as m}from"./collaboration-presence-BVIQuN1l.js";import{e as v,h as P,l as I}from"./play-mode-DICV4cKP.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"./adapter-runtime-bindings-4cmsRvRh.js";import"./native-debug-module-2_HVupdg.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-P0_YQGWd.js";import"./contract-system-adapters-Bic_7sev.js";import"./game-contract-seams-BnPFGLll.js";import"./seeded-random-BgCwIAAU.js";import"./game-audio-CaGKzia4.js";import"./game-network-Ct2FQYmu.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.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-C3LzprCe.js";import"./capability-coverage-DZ-onC5j.js";import"./edit-mode-authoring-DeCxPcHM.js";import"./json-history-resource-DwS10tqD.js";import"./binding-resolver-dE0GnZT5.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Dc18TIqT.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CnY105XU.js";import"./canvas-entry-runtime-UNYuSfG0.js";import"./three-ingest-runtime-B7rtg3QE.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-C7SNSmTd.js";import"./active-ingest-DA426a81.js";import"./ingest-source-persistence-Dmdo-UBp.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-vgxsTyj4.js";import"./mounted-authoring-Clftxx0x.js";import"./entity-object-JmYMfLsx.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./three-contract-Dkt6PmWY.js";import"./three-TCuY32m_.js";import"./editor-layers-BDJnAAzj.js";import"./component-instance-root-B0C5oNEm.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-htbnVej2.js";import"./source-persistence-backend-CwLYVPXj.js";import"./three-projection-core-CG01r5Ta.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./r3f-physics-binding-DzrbpqjM.js";import"./deferred-ingest-play-BdR4qGk6.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DOjv2pYm.js";import"./board-guides-BEKPgD9M.js";import"./relative-import-specifier-BFKIWEWs.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Dr4qvDpJ.js";import"./inference-diagnostics-xecGdohW.js";import"./writer-tw6EcuVO.js";import"./three-state-DwFE3ay2.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-Bj_ZIP85.js";const $t="workspace.service";function tr(){let i=null;const p=new Set;let e=null,n=null,a=d();const l=()=>{e?.(),e=null,n?.(),n=null,a=null},y=k(u=>{const w=u.participants.find(r=>r.participantId===b)?.capabilities.includes("test")??!1,t=u.activePlaytest,s=I();if(!w||!t){i=null,l(),m({playtest:null}),s?.mode==="team"&&P(),t||p.clear();return}s?.mode==="team"&&s.id===t.id||i!==t.id&&(p.has(t.id)||(i=t.id,m({playtest:{id:t.id,play:"starting",networking:"connecting",roomName:null,problem:null}}),v(t.seed,{mode:"team",id:t.id,roomKey:t.roomKey,revision:t.revision,participantId:b}).then(()=>{if(i!==t.id)return;l();const r=()=>{const o=d(),c=o?.getConnectionState?.(),f=o?.getRoomInfo?.();m({playtest:{id:t.id,play:"ready",networking:o?c==="connected"&&f?"ready":c==="error"?"error":"connecting":"not-declared",roomName:f?.roomName??null,problem:c==="error"?"The game networking adapter reported an error.":null}})},g=()=>{const o=d();o!==a&&(e?.(),a=o,e=o?.subscribe(r)??null),r()};n=N(g),g()}).catch(r=>{i===t.id&&(i=null,p.add(t.id),m({playtest:{id:t.id,play:"error",networking:"error",roomName:null,problem:r instanceof Error?r.message:String(r)}}))})))});return()=>{l(),y()}}export{$t as point,tr as start};
@@ -1 +0,0 @@
1
- import{dk as k,el as B,M as v,aq as A,au as X,eg as O,gq as z,gr as R,bk as W,gs as U,af as P,bl as N,bi as G,bj as Q,k as Y,bm as Z}from"./index-BRJMIUK0.js";import{a as q,o as ee,b as C}from"./component-instance-root-B0C5oNEm.js";import{c as te,p as L,m as re,a as se}from"./source-persistence-backend-CwLYVPXj.js";import{J as oe,c as ie}from"./json-history-resource-DwS10tqD.js";import{r as f,d as ne,a as ae}from"./ingest-source-persistence-Dmdo-UBp.js";import{r as ce}from"./three-projection-core-CG01r5Ta.js";import{a as _,T as le,n as he,b as ue}from"./three-TCuY32m_.js";import{isEditorOwnedObject as x}from"./editor-layers-BDJnAAzj.js";import{bodyOwningNode as T}from"./body-marks-RKb_LTwL.js";import{colorMaterialOf as y}from"./structural-ids-Br2zjINh.js";import{object3DAuthoringSubjectOf as F}from"./object3d-authoring-subject-BDrxd1GA.js";import{createRapierBodyEditing as de}from"./rapier-physics-adapter-CaZqWLu0.js";import{getUserData as m}from"./user-data-dHvLdpwM.js";import{b as fe,c as me}from"./r3f-physics-binding-DzrbpqjM.js";const pe={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scale",kind:"vector3"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"name",kind:"string"},"material.color":{owner:"material",member:"color",kind:"color"},"light.color":{owner:"self",member:"color",kind:"color"},"light.intensity":{owner:"self",member:"intensity",kind:"number"},"light.distance":{owner:"self",member:"distance",kind:"number"},"camera.fov":{owner:"self",member:"fov",kind:"number"},"camera.near":{owner:"self",member:"near",kind:"number"},"camera.far":{owner:"self",member:"far",kind:"number"},"shadow.cast":{owner:"self",member:"castShadow",kind:"boolean"},"shadow.receive":{owner:"self",member:"receiveShadow",kind:"boolean"}},be={position:{owner:"self",member:"position",kind:"vector2",componentMembers:["x","y"]},rotation:{owner:"self",member:"rotation",kind:"number"},scale:{owner:"self",member:"scale",kind:"vector2"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"label",kind:"string"},alpha:{owner:"self",member:"alpha",kind:"number"},tint:{owner:"self",member:"tint",kind:"color"}},ye={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scaling",kind:"vector3"},name:{owner:"self",member:"name",kind:"string"},visible:{owner:"self",member:"isVisible",kind:"boolean"},visibility:{owner:"self",member:"visibility",kind:"number"}};function D(l,t="three"){return(t==="pixi"?be:t==="babylon"?ye:pe)[l]??null}const J="the game's own JSX source (source-stamp write-back)",S={position:"position",rotation:"rotation",scale:"scale",visible:"visible",name:"name","material.color":"color","light.color":"color","light.intensity":"intensity","light.distance":"distance","camera.fov":"fov","camera.near":"near","camera.far":"far","shadow.cast":"castShadow","shadow.receive":"receiveShadow"};function M(l){const t=Math.round(l*1e4)/1e4;return Object.is(t,-0)?"0":String(t)}function K(l,t){const e=D(l)?.kind;return e==="vector3"||e==="euler"?!Array.isArray(t)||t.length!==3||!t.every(r=>typeof r=="number"&&Number.isFinite(r))?null:`[${t.map(M).join(", ")}]`:e==="number"?typeof t=="number"&&Number.isFinite(t)?M(t):null:e==="boolean"?typeof t=="boolean"?String(t):null:(e==="color"||e==="string")&&typeof t=="string"?t.replace(/["\\]/g,""):null}function V(l,t){const e=fe(l??void 0,t);if(e)return e;const r=l?.r3fAuthoring;if(!r||t!=="position"&&t!=="rotation"&&t!=="scale")return null;const s=`<${l?.tag??"this component"}>`;return r.simulationOwnedTransform===!0?`${s} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:r.transformProps.includes(t)?null:`${s} does not forward ${t} to its native root`}function I(l){const t=l.file.replaceAll("\\","/"),e=X()?.rootPath.replaceAll("\\","/").replace(/\/$/,""),r=e&&t.startsWith(`${e}/`)?t.slice(e.length+1):t;return{anchored:!0,kind:"source",file:r,line:l.line,col:l.col,display:`${r}:${l.line}`}}async function _e(l){try{const e=await(l??k("Live source locations"))?.index?.();return r=>{const s=e?.[r];return s?I(s):null}}catch{return()=>null}}async function ge(l,t,e){const r=l.writeProp;if(!r)throw new Error("the gesture-scoped source writer cannot write JSX props");let s=0;for(const{property:o,text:i}of e){const a=await r(t,o,i,{addIfMissing:!0,allowShapeUpgrade:!0});if(a.dynamic)throw new Error(`${o} is bound to a JSX expression, not an authored literal`);if(!a.changed&&a.error)throw new Error(a.error);a.changed&&s++}return s}function ve(l){const t=l.backend??k("The Play→source transform committer"),e=B(t,l.history),r=o=>o?!e?.runGesture||!e.writeProp||!e.index?{available:!1,reason:"This editor session cannot open a checksum-guarded project-source gesture."}:{available:!0}:{available:!1,reason:"This live node has no OID source stamp, so no authored literal owns its pose."},s=o=>(v.warn(`[play] Commit live transform to source refused: ${o}`,"play-mode"),{destination:A,persisted:!1});return{availability:r,async commit(o,i){const a=r(o);if(!a.available||!o||!e?.runGesture||!e.index)return s(a.reason??"the source writer is unavailable");const c=(await e.index())[o]??null;if(!c)return s(`the current source index has no entry for OID "${o}"`);const h=["position","rotation","scale"].map(d=>{const j=V(c,d);if(j)throw new Error(j);const w=i[d],$=w===void 0?null:K(d,w);if($===null)throw new Error(`${d} is not a finite transform literal`);return{property:d,text:$}});let u;try{u=await e.runGesture("Commit Play Transform to Source",d=>ge(d,o,h))}catch(d){return s(d instanceof Error?d.message:String(d))}return u===0?(v.log("[play] Source already matches the selected live transform.","play-mode"),{destination:"source already matched the live transform",persisted:!1}):(v.log(`[play] Committed ${u} live transform literal(s) to ${c.file}:${c.line}.`,"play-mode"),{destination:J,persisted:!0})}}}function we(l){let t=null,e=new Map,r=!1;const s=async()=>{const n=t?.index;if(n)try{e=new Map(Object.entries(await n.call(t))),r=!0}catch{}},o=n=>n?e.get(n)??null:null,i=n=>{const c=o(n);return c?I(c).display:null},a=(n,c)=>{if(!n)return{ok:!1,reason:"this object carries no source stamp — the game built it at runtime rather than writing it as an element of its own source"};if(!t?.writeProp)return{ok:!1,reason:"this editor tier cannot write project source"};const h=S[c];if(!h)return{ok:!1,reason:`${c} has no JSX attribute this seam can write`};const u=V(o(n),h);if(u)return{ok:!1,reason:u};if(!O()){const d=i(n);return{ok:!1,reason:`${d?`written at ${d}`:"source-stamped"}, but this game is playing — hold it to author`}}return{ok:!0}};return{attach(){const n=l.backend??k("This world’s OID source persistence")??null;t=n?B(n,l.history)??n:null,s()},anchor(n){const c=e.get(n);return c?I(c):null},physicsPlaced(n,c){return me(o(n)??void 0,S[c]??c)},describe({sourceOid:n,property:c}){const h=a(n,c);if(!h.ok)return`Live-only edit — ${h.reason}.`;const u=i(n);return u?`Persisting to ${u}.`:`Persisting to this element's own JSX${r?"":" (source index still loading)"}.`},gate({sourceOid:n,property:c}){return a(n,c)},armed:()=>t?.writeProp!==void 0&&O(),report:(n,c)=>f(n,c),async write(n){const c=a(n.sourceOid,n.property);if(!c.ok)return f(n.label,c.reason),!1;const h=S[n.property],u=K(n.property,n.next);if(u===null)return f(n.label,`the new ${n.property} is not a value this seam can spell as a JSX literal`),!1;try{const d=await t.writeProp(n.sourceOid,h,u,{addIfMissing:!0,allowShapeUpgrade:!0});return d.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression, not a literal`),!1):d.changed?(v.log(`[ingest] ${n.label} written to the game's own source — ${h} → ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,d.error??"the source writer made no change"),!1)}catch(d){return f(n.label,`the write failed: ${d instanceof Error?d.message:String(d)}`),!1}},removal:{available({sourceOid:n,property:c}){return t?.removeProp?a(n,c).ok:!1},async perform(n){const c=a(n.sourceOid,n.property);if(!c.ok||!t?.removeProp)return f(n.label,c.ok?"this editor tier cannot remove project source":c.reason),!1;const h=S[n.property];try{const u=await t.removeProp(n.sourceOid,h);return u.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression — removing it would delete the game's own wiring, not an override`),!1):u.changed?(v.log(`[ingest] ${n.label} — ${h} dropped from the game's own source at ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,u.error??`${i(n.sourceOid)??"this element"} authors no ${h} attribute, so there was nothing to drop`),!1)}catch(u){return f(n.label,`the removal failed: ${u instanceof Error?u.message:String(u)}`),!1}}},destination(){return t?.writeProp&&O()?J:A},dispose(){t=null,e=new Map,r=!1}}}const Se={source:"live",label:"live",detail:"Running objects adopted from the live scene. Edits affect this session only and are discarded when play stops."},je="Applied to the running world; code that drives this transform each frame may overwrite it.",Oe={source:"foreign",label:"live-only",detail:"Unmodified ingested game — edits apply to the running game for this session only and are never saved."},Ce={source:"foreign",label:"game source",detail:"Ingested game whose own source carries the editor's authoring stamps — a literal JSX prop writes back to the game’s own file (expression-bound props stay read-only)."};function p(l){return l.isLight?l:null}function g(l){const t=l;return t.isPointLight||t.isSpotLight?t:null}function Ie(l){const t=l;return t.isDirectionalLight||t.isPointLight||t.isSpotLight?t:null}function b(l){const t=l;return t.isPerspectiveCamera?t:null}function H(l){const t=l;return t.isMesh&&t.geometry?t.geometry:null}class E{constructor(t,e,r){if(this.store=t,this.options=r,this.sceneRef=e,this.identity=r.identity,this.projector=new le(this.identity,{pickScope:"projection"}),this.persist=r.persistence??null,this.loop=r.loop,this.frameControl=r.frameControl??"adapter",this.provenance=r.provenance??Se,r.sourceCommit){const i={availability:a=>r.sourceCommit.availability(C(this.objectOf(a))),commit:async a=>{const n=this.objectOf(a),c=this.captureChannelBaseline(a)??{},h=await r.sourceCommit.commit(C(n),c);return h.persisted&&this.store.shell.notifyIngestEdit(),h}};Object.assign(this.transforms,{sourceCommit:i})}r.sourceDeclaresStories&&(this.stories=z("three",t.shell,i=>{const a=this.hierarchy.node(i);return a?.role!=="component"?null:{name:a.typeLabel??a.label}})),this.refresh(),this.watchStructure();const s=t.shell.projectHistory;this.historyResource=this.persist&&s?new oe({history:s,kind:"session-state",scope:"session",subject:{...r.journal,id:`${r.journal.id}/live-three-edits`},displayName:"Live edits",capture:()=>this.captureHistoryState(),conflictIdentity:i=>i.edits,restore:async i=>{this.restoreHistoryState(i)}}):null;const o=this.persist;o&&(o.attach({read:(i,a)=>this.readChannel(i,a),apply:(i,a,n)=>this.applyChannel(i,a,n)}),this.persistence={...ie(),get destination(){return o.destination()}},o.readSiteLiterals&&(this.instances=this.creationSiteInstances(o)))}sceneRef;projector;watchedForStructure=new Set;changedStructureRoots=new Set;structureRefreshQueued=!1;disposed=!1;crossSurfaceStructureRevision=0;hasCrossSurfaceStructure=!1;identity;persist;loop;frameControl;instanceLiterals=new Map;instanceLiteralRequests=new Map;markedBodies=de(t=>{const e=this.objectOf(t);if(!e)return{kind:"unresolved"};const r=T(e);return r?{kind:"body",body:r}:{kind:"no-body"}});bodyOwnershipByObject=new WeakMap;physicsFor(t){const e=R();return e&&e.ownerOf(t)!=="unresolved"?e:null}edits={};historyResource;editStartState;editBaseline;capabilities={transform:!0,inspectorFields:!0,persist:!1};stories;instances;provenance;persistence;get scene(){return typeof this.sceneRef=="function"?this.sceneRef():this.sceneRef}refresh(){const t=this.projector.project(this.scene);return this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++,t}crossSurfaceStructureSignature(){return this.hasCrossSurfaceStructure?String(this.crossSurfaceStructureRevision):null}objectCarriesCrossSurfaceStructure(t){return m(t,"authoringHierarchyId")!==void 0||m(t,"authoringHierarchyParentId")!==void 0||m(t,"authoringHierarchyOrder")!==void 0}subtreeCarriesCrossSurfaceStructure(t){let e=!1;return t.traverse(r=>{this.objectCarriesCrossSurfaceStructure(r)&&(e=!0)}),e}refreshCrossSurfacePresence(){this.hasCrossSurfaceStructure=!1;for(const t of this.projector.nodes.values())if(this.objectCarriesCrossSurfaceStructure(t.object)){this.hasCrossSurfaceStructure=!0;return}}onStructureChanged=t=>{x(t.child)||this.disposed||(this.changedStructureRoots.add(t.child),!this.structureRefreshQueued&&(this.structureRefreshQueued=!0,queueMicrotask(()=>{if(this.structureRefreshQueued=!1,this.disposed)return;const e=[...this.changedStructureRoots];this.changedStructureRoots.clear();const r=e.some(o=>this.subtreeCarriesCrossSurfaceStructure(o));for(const o of e)this.unwatchStructureSubtree(o);const s=this.projector.projectSubtrees(this.scene,e);if(s===null)this.refresh(),this.watchStructure();else for(const o of e)this.structureRootIsAttached(o)&&this.watchStructureSubtree(o);r&&(this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++),this.syncAdoptedObjectMap(s??void 0),this.store.notifyIngestObjectMapEdit(s===null?void 0:{changedParentIds:s.changedParentIds,rootsChanged:s.rootsChanged,addedIds:s.addedIds,removedIds:s.removedIds})})))};watchStructure(){for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear();const t=this.scene;t&&this.watchStructureSubtree(t)}watchStructureSubtree(t){const e=r=>{if(!(x(r)||this.watchedForStructure.has(r))){r.addEventListener("childadded",this.onStructureChanged),r.addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.add(r);for(const s of r.children)e(s)}};e(t)}structureRootIsAttached(t){const e=this.scene;if(e===null)return!1;for(let r=t;r!==null;r=r.parent)if(r===e)return!0;return!1}unwatchStructureSubtree(t){t.traverse(e=>{this.watchedForStructure.delete(e)&&(e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged))})}syncAdoptedObjectMap(t){const e=this.scene;if(!e||this.store.scene!==e)return;const r=this.store.objectMap;if(t===void 0){r.clear();for(const[o,i]of this.projector.objectMapSnapshot())r.set(o,i)}else{for(const o of t.removedIds)r.delete(o);for(const o of t.addedIds){const i=this.projector.objectOf(o);i!==null&&r.set(o,i)}}const s=[...this.store.shell.selectedEntityIds].filter(o=>r.has(o));s.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(s)}invalidate(){this.refresh()}adoptScene(t){this.sceneRef=t,this.refresh(),this.watchStructure(),this.syncAdoptedObjectMap()}objectOf(t){return this.projector.objectOf(t)}objectMapSnapshot(){return this.projector.objectMapSnapshot()}record(t,e){this.edits[t]={...this.edits[t],...e}}toEditorNode(t){const e=t.object,r=m(e,"authoringHierarchyId"),s=m(e,"authoringHierarchyParentId"),o=m(e,"authoringHierarchyOrder"),i=q(e)&&m(e,"authoringRoot")!==!0,a=m(e,"authoringComponent"),n=(i?m(e,"authoringLabel"):void 0)||e.name||e.type;return{id:t.id,label:n,role:i?"component":"entity",kind:he(e),typeLabel:i?a||n:e.type,parentId:t.parentId,childIds:[...t.childIds],...r===void 0?{}:{crossSurfaceId:r},...s===void 0?{}:{crossSurfaceParentId:s},...o===void 0?{}:{crossSurfaceOrder:o}}}hierarchy={crossSurfaceStructureSignature:()=>this.crossSurfaceStructureSignature(),roots:()=>this.projector.rootNodes().map(t=>this.toEditorNode(t)),node:t=>{const e=this.projector.node(t);return e?this.toEditorNode(e):null},object3D:t=>this.objectOf(t),idForObject3D:t=>this.projector.idOf(t)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t),resolve:(t,e)=>{const r=this.hierarchy.node(t);if(!r)return null;const s=[];let o=r,i=0;for(;o&&i++<1e3;)(o.role==="component"||o.role==="instance")&&s.push(o),o=o.parentId?this.hierarchy.node(o.parentId):null;const a=s.reverse();if(a.length===0)return{id:t};const n=e?.scopeId?a.findIndex(u=>u.id===e.scopeId):-1,c=n>=0?Math.min(n+1,a.length-1):0,h=e?.intent==="deep"?Math.min(c+1,a.length-1):c;return{id:a[h].id}}};pickable={pick:(t,e)=>(this.refresh(),this.projector.pick(this.store,t,e)),candidates:(t,e)=>(this.refresh(),this.projector.candidates(this.store,t,e))};truth={resolve:(t,e)=>{const r=this.anchorFor(t,e);return{site:r.anchor,writeAnchorKind:r.anchorKind}}};related=te(t=>this.truth.resolve(t,"position").site);transforms={get:t=>ce(this.objectOf(t)),editability:(t,e)=>{if(!this.objectOf(t))return{writable:!1,reason:U};const r=P();return r?.networkId(t)&&!r.editable(t)?{writable:!1,reason:"This transform is controlled by remote or server network authority."}:this.bodyOwns(t)?{writable:!0,reason:"Moves the physics body that owns this node.",...this.removableFlag(t,e)}:this.frameControl==="host"&&this.store.shell.playState==="playing"?{writable:!0,reason:je,...this.removableFlag(t,e)}:this.persist?{writable:!0,reason:this.persist.describe(this.anchorFor(t,e)),...this.removableFlag(t,e)}:{writable:!0}},beginEdit:t=>{this.historyResource?.assertCanMutate(),!(!this.objectOf(t)||!this.editableByNetwork(t))&&(this.loop?.pause(),this.physicsFor(t)?.freeze(t),this.markedBodies.freeze(t),this.editStartState=this.persist?this.captureHistoryState():void 0,this.editBaseline=void 0)},apply:(t,e)=>{!this.objectOf(t)||!this.editableByNetwork(t)||(this.persist&&!this.editBaseline&&(this.editBaseline=this.captureChannelBaseline(t)),this.writeTransform(t,e),this.physicsFor(t)?.commit(t,e),this.markedBodies.commit(t,e),this.store.shell.notifyIngestEdit())},endEdit:t=>{this.loop?.resume();const e=this.objectOf(t),r=`Transform ${e?.name||"Object"}`,s=this.editStartState,o=this.editBaseline;return this.editStartState=void 0,this.editBaseline=void 0,e&&(this.physicsFor(t)?.unfreeze(t),this.markedBodies.unfreeze(t),this.store.shell.notifyIngestEdit()),this.persist?this.persistOrJournal(t,r,s,o):void 0},remove:(t,e)=>{if(this.persist?.removal)return W(this.pipedRemove(t,e))}};removableFlag(t,e){const r=this.persist?.removal;return r?r.available(this.anchorFor(t,e))?{removable:!0}:{}:{}}pipedRemove(t,e){const r=this.persist,s=r.removal,o=`Remove ${this.objectOf(t)?.name||"Object"} ${e}`;return{resolve:()=>{const i=this.anchorFor(t,e);return s.available(i)?i.anchorKind==="live-only"?N(r.describe(i)):{reaches:"writer",anchorKind:i.anchorKind,destination:r.destination(),write:()=>s.perform({...i,label:o})}:N(r.describe(i))},record:()=>{},report:i=>{r.armed()&&r.report(o,i)}}}bodyOwns(t){const e=this.objectOf(t);if(!e)return!1;const r=this.bodyOwnershipByObject.get(e);if(r!==void 0)return r;const s=R()?.ownerOf(t);if(s==="physics")return this.bodyOwnershipByObject.set(e,!0),!0;const o=T(e)!==void 0;return(o||s==="editor")&&this.bodyOwnershipByObject.set(e,o),o}editableByNetwork(t){const e=P();return e?e.editable(t):!0}inspector={properties:t=>{const e=this.objectOf(t);if(!e)return[];const r=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean"},{path:"object.type",label:"Native type",type:"string",readonly:!0}],s=F(e);return s?.fields&&r.push(...s.fields().filter(i=>!["name","visible"].includes(i.path)).map(({value:i,...a})=>a)),y(e)&&r.push({path:"material.color",label:"Color",type:"color",group:"Material"}),p(e)&&(r.push({path:"light.intensity",label:"Intensity",type:"number"}),r.push({path:"light.color",label:"Light Color",type:"color"}),g(e)&&r.push({path:"light.distance",label:"Distance",type:"number"}),Ie(e)&&r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"})),b(e)&&(r.push({path:"camera.fov",label:"FOV",type:"number"}),r.push({path:"camera.near",label:"Near",type:"number"}),r.push({path:"camera.far",label:"Far",type:"number"})),H(e)&&(r.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0}),r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"}),r.push({path:"shadow.receive",label:"Receive Shadow",type:"boolean"})),r},get:(t,e)=>{const r=this.objectOf(t);if(!r)return;if(e==="name")return r.name;if(e==="visible")return r.visible;if(e==="object.type")return r.type;const s=F(r)?.fields?.().find(o=>o.path===e);if(s)return s.value();if(e==="material.color"){const o=y(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="light.intensity")return p(r)?.intensity;if(e==="light.distance")return g(r)?.distance;if(e==="light.color"){const o=p(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="camera.fov")return b(r)?.fov;if(e==="camera.near")return b(r)?.near;if(e==="camera.far")return b(r)?.far;if(e==="mesh.vertices"){const o=H(r);return o?o.getAttribute("position")?.count??0:void 0}if(e==="shadow.cast")return r.castShadow;if(e==="shadow.receive")return r.receiveShadow},set:(t,e,r)=>{if(this.historyResource?.assertCanMutate(),!this.persist){this.writeProp(t,e,r);return}const s=this.captureHistoryState(),o=this.readChannel(t,e);this.writeProp(t,e,r);const i=`Set ${this.objectOf(t)?.name||"Object"} ${e}`,a=this.readChannel(t,e);if(!(o!==void 0&&a!==void 0&&JSON.stringify(o)!==JSON.stringify(a))){this.recordHistory(i,s);return}return L({backend:this.persist,subject:()=>this.anchorFor(t,e),baseline:o,next:a,label:i,journal:()=>this.recordHistory(i,s)})}};subscribe(t){return this.store.shell.subscribe(t)}dispose(){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear(),this.changedStructureRoots.clear(),this.historyResource?.dispose(),this.persist?.dispose()}readChannel(t,e){const r=this.objectOf(t);if(r)return e==="position"?r.position.toArray():e==="rotation"?[r.rotation.x,r.rotation.y,r.rotation.z]:e==="scale"?r.scale.toArray():this.inspector.get(t,e)}applyChannel(t,e,r){const s=this.objectOf(t);if(s){if(e==="position"&&Array.isArray(r))s.position.fromArray(r);else if(e==="rotation"&&Array.isArray(r)){const[o,i,a]=r;s.rotation.set(o??0,i??0,a??0)}else if(e==="scale"&&Array.isArray(r))s.scale.fromArray(r);else{this.writeProp(t,e,r);return}this.store.shell.notifyIngestEdit()}}writeTransform(t,e){this.historyResource?.assertCanMutate();const r=this.objectOf(t);r&&(r.position.set(e.position[0],e.position[1],e.position[2]),r.quaternion.set(e.rotation[0],e.rotation[1],e.rotation[2],e.rotation[3]),r.scale.set(e.scale[0],e.scale[1],e.scale[2]),this.record(t,{position:e.position,rotation:e.rotation,scale:e.scale}))}writeProp(t,e,r){const s=this.objectOf(t);if(s){if(e==="name")s.name=String(r);else if(e==="visible")s.visible=!!r,this.record(t,{visible:s.visible});else if(e==="material.color"){const o=y(s);o&&(o.color.set(String(r)),this.record(t,{color:`#${o.color.getHexString()}`}))}else if(e==="light.intensity"){const o=p(s);o&&(o.intensity=Number(r))}else if(e==="light.distance"){const o=g(s);o&&(o.distance=Number(r))}else if(e==="light.color")p(s)?.color.set(String(r));else if(e==="camera.fov"||e==="camera.near"||e==="camera.far"){const o=b(s);o&&(o[e.split(".")[1]]=Number(r),o.updateProjectionMatrix())}else e==="shadow.cast"?s.castShadow=!!r:e==="shadow.receive"&&(s.receiveShadow=!!r);this.store.shell.notifyIngestEdit()}}anchorFor(t,e){const r=this.objectOf(t),s=D(e),o=r&&s?.owner==="material"?y(r):r,i=s?.owner==="material"?ee(o):C(o),a=i?this.persist?.anchor?.(i):null;if(a){const h=i?this.persist?.physicsPlaced?.(i,e):!1;return{entityId:t,property:e,anchor:a,anchorKind:h?"physics-binding":"source-prop",instances:1,sourceOid:i}}const n=ne(o);if(n!==null)return{entityId:t,property:e,anchor:ae(n),anchorKind:"data-record",instances:1,...i?{sourceOid:i}:{}};const c=i?this.options.sourceAnchor?.(i)??{anchored:!1,reason:"The source index has not resolved this object’s OID."}:G(o??null);return{entityId:t,property:e,anchor:c,anchorKind:i?this.persist?.anchor?"source-prop":"live-only":c.anchored?"construction-literal":"live-only",instances:c.anchored&&c.kind==="source"?i?1:Q(c):0,...i?{sourceOid:i}:{}}}measureWriteReach(){this.refresh();let t=0;const e=Y();for(const r of this.projector.nodes.keys()){const s=this.anchorFor(r,"position");e[s.anchorKind]++,s.anchor.anchored&&t++}return{addressable:t,total:this.projector.nodes.size,destination:this.persist?.destination()??A,byKind:e}}captureChannelBaseline(t){const e=this.objectOf(t);if(e)return{position:e.position.toArray(),rotation:[e.rotation.x,e.rotation.y,e.rotation.z],scale:e.scale.toArray()}}persistOrJournal(t,e,r,s){const o=this.persist;if(!o)return;const i=s?this.captureChannelBaseline(t):void 0,a=s&&i?Object.keys(s).filter(c=>JSON.stringify(s[c])!==JSON.stringify(i[c])):[];a.length>1&&o.report(e,re(a));const n=a.length===1?a[0]:null;if(n===null){this.recordHistory(e,r);return}return L({backend:o,subject:()=>this.anchorFor(t,n),baseline:s[n],next:i[n],label:e,journal:()=>this.recordHistory(e,r)})}creationSiteKey(t){const e=t.anchor;return e.anchored&&e.kind==="source"?`${e.file}:${e.line}:${e.col}`:null}instancePropertyPaths(t,e){const r=["position","rotation","scale",...this.inspector.properties(t).filter(s=>!s.readonly).map(s=>s.path)];return[...new Set(r)].filter(s=>this.creationSiteKey(this.anchorFor(t,s))===e)}loadInstanceLiterals(t,e,r,s){const o=this.instanceLiteralRequests.get(s);if(o)return o;const i=this.instancePropertyPaths(e,s).map(n=>({property:n,live:this.readChannel(e,n)})).filter(n=>n.live!==void 0),a=t.readSiteLiterals({anchor:r.anchor,instances:r.instances,writeScope:"creation-site",properties:i}).then(n=>(this.instanceLiterals.set(s,n),this.store.shell.notifyIngestEdit(),n));return this.instanceLiteralRequests.set(s,a),a}sameInstanceValue(t,e){return Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>this.sameInstanceValue(r,e[s])):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=1e-6:t===e}instanceComponentName(t){return t.constructor.name||t.type}instanceCountLabel(t){return`${t} ${t===1?"instance":"instances"}`}instanceOverride(t,e,r,s,o){const i=s[r],a=this.readChannel(e,r);if(!i||i.literal===null||a===void 0||this.sameInstanceValue(i.literal,a))return null;const n=t.gate({...this.anchorFor(e,r),writeScope:"creation-site"}),c=i.writable?n.ok?void 0:n.reason:i.reason,h=this.inspector.properties(e).find(u=>u.path===r)?.label??r;return{path:r,label:h,value:a,...i.text?{defaultText:i.text}:{},canApplyToComponent:c===void 0,...c?{applyUnavailableReason:c}:{},affectedInstanceCount:o.instances}}async applyInstanceDefault(t,e,r,s){const o={...this.anchorFor(r,s),writeScope:"creation-site"},i=this.creationSiteKey(o);if(!i)return{changed:!1,message:"This object has no source site."};const a=this.objectOf(r);if(!a)return{changed:!1,message:"This object is no longer in the live world."};const n=(await e(r,o,i))[s];if(!n)return{changed:!1,message:`The construction site names no ${s}.`};if(n.literal===null)return{changed:!1,message:`The construction site names no ${s} default.`};const c=this.readChannel(r,s);if(c===void 0)return{changed:!1,message:`${s} has no live value.`};if(!n.writable)return{changed:!1,message:n.reason??`${s} cannot be rewritten.`};const h=t.gate(o);if(!h.ok)return{changed:!1,message:h.reason};const u=o.instances,d=`Apply ${s} to ${this.instanceComponentName(a)} default (${this.instanceCountLabel(u)})`;if(!await t.write({...o,baseline:n.literal,next:c,label:d}))return{changed:!1,message:`${d} did not land; the console names why.`};this.instanceLiterals.delete(i),this.instanceLiteralRequests.delete(i),this.store.shell.notifyIngestEdit();const w=o.anchor.anchored?o.anchor.display:"this source site";return{changed:!0,message:`${s} now applies to all ${this.instanceCountLabel(u)} from ${w}.`,write:{destination:w,persisted:!0}}}creationSiteInstances(t){const e=async(r,s,o)=>this.instanceLiterals.get(o)??this.loadInstanceLiterals(t,r,s,o);return{describe:r=>{const s=this.anchorFor(r,"position"),o=this.creationSiteKey(s),i=this.objectOf(r);if(!o||!i)return null;const a=this.instanceLiterals.get(o);if(!a)return this.loadInstanceLiterals(t,r,s,o),null;if(Object.keys(a).length===0)return null;const n=this.instancePropertyPaths(r,o).map(c=>this.instanceOverride(t,r,c,a,s)).filter(c=>c!==null);return{componentName:this.instanceComponentName(i),...s.anchor.anchored?{sourcePath:s.anchor.display}:{},overrides:n}},revert:async(r,s)=>{const o=this.anchorFor(r,"position"),i=this.creationSiteKey(o);if(!i)return;const a=await e(r,o,i),n=this.captureHistoryState();let c=0;for(const h of s){const u=a[h]?.literal;u!=null&&(this.applyChannel(r,h,u),c++)}return c>0&&this.recordHistory(`Revert ${c} instance override(s)`,n),c>0?Z:void 0},applyToComponent:(r,s)=>this.applyInstanceDefault(t,e,r,s)}}recordHistory(t,e){!this.historyResource||!e||this.historyResource.record(t,e,this.captureHistoryState()).catch(r=>{v.error(`[ingest] failed to journal "${t}" into project history — the edit is applied but has no history entry (it cannot be undone): ${r instanceof Error?r.message:String(r)}`)})}captureHistoryState(){const t={};for(const[e,r]of this.projector.nodes){const s=r.object,o=y(s),i=p(s),a=b(s);t[e]={name:s.name,visible:s.visible,transform:this.transforms.get(e),...o?{color:`#${o.color.getHexString()}`}:{},...i?{lightIntensity:i.intensity,lightColor:`#${i.color.getHexString()}`,...g(s)?{lightDistance:g(s).distance}:{}}:{},...a?{camera:{fov:a.fov,near:a.near,far:a.far}}:{},castShadow:s.castShadow,receiveShadow:s.receiveShadow}}return{edits:structuredClone(this.edits),objects:t}}restoreHistoryState(t){for(const[e,r]of Object.entries(t.objects)){const s=this.objectOf(e);if(!s)continue;s.name=r.name,s.visible=r.visible,s.position.fromArray(r.transform.position),s.quaternion.fromArray(r.transform.rotation),s.scale.fromArray(r.transform.scale),this.physicsFor(e)?.commit(e,r.transform),this.markedBodies.commit(e,r.transform),r.color&&y(s)?.color.set(r.color);const o=p(s);if(o&&(r.lightIntensity!==void 0&&(o.intensity=r.lightIntensity),r.lightColor&&o.color.set(r.lightColor),r.lightDistance!==void 0)){const a=g(s);a&&(a.distance=r.lightDistance)}const i=b(s);i&&r.camera&&(i.fov=r.camera.fov,i.near=r.camera.near,i.far=r.camera.far,i.updateProjectionMatrix()),s.castShadow=r.castShadow,s.receiveShadow=r.receiveShadow}this.edits=structuredClone(t.edits),this.store.shell.notifyIngestEdit()}}function De(l,t,e){return new E(l,t,{identity:ue({camera:e.camera}),journal:e.journal,persistence:se({history:l.shell.projectHistory,writer:e.sourceWriter}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Oe})}function Je(l,t,e){return new E(l,t,{identity:_(e.worldId,{camera:e.camera}),journal:e.journal,persistence:we({history:l.shell.projectHistory,backend:e.backend}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Ce,sourceDeclaresStories:!0})}function Ke(l,t,e,r,s={}){return new E(l,t,{identity:_(e),journal:r,frameControl:"host",sourceAnchor:s.sourceAnchor,...s.explicitSourceCommit?{sourceCommit:ve({history:l.shell.projectHistory,...s.backend?{backend:s.backend}:{}})}:{}})}export{Je as a,Ke as o,_e as r,De as s};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-B5GsZI5M.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/edit-mode-authoring-DeCxPcHM.js","assets/adapter-runtime-bindings-4cmsRvRh.js","assets/native-debug-module-2_HVupdg.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-P0_YQGWd.js","assets/contract-system-adapters-Bic_7sev.js","assets/game-contract-seams-BnPFGLll.js","assets/seeded-random-BgCwIAAU.js","assets/game-audio-CaGKzia4.js","assets/game-network-Ct2FQYmu.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/index-bQE2NA0D.js","assets/live-project-verbs-C3LzprCe.js","assets/capability-coverage-DZ-onC5j.js","assets/entry-adjudication-Dc18TIqT.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-CnY105XU.js","assets/canvas-entry-runtime-UNYuSfG0.js","assets/three-ingest-runtime-B7rtg3QE.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/scene-framing-BQt72ZCw.js","assets/editor-layers-BDJnAAzj.js","assets/workspace-arrangement-BdAlBwvd.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-DBfUy0SO.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-Cwkl1Ar6.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-DS5leCed.js","assets/render-features-rxbawsRb.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/performance-profiler-OwnXQX0M.js","assets/live-gesture-lock-DJbrjOqf.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,ax as n}from"./index-BRJMIUK0.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import{q as c}from"./edit-mode-authoring-DeCxPcHM.js";import{a as u}from"./json-history-resource-DwS10tqD.js";import{o as h}from"./three-authoring-adapter-htbnVej2.js";import{t as i}from"./editor-shell-store-ChLcVeNB.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./component-instance-root-B0C5oNEm.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./source-persistence-backend-CwLYVPXj.js";import"./ingest-source-persistence-Dmdo-UBp.js";import"./three-projection-core-CG01r5Ta.js";import"./editor-layers-BDJnAAzj.js";import"./three-TCuY32m_.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three.core-3arARmh6.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-DzrbpqjM.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./Pass-D1MRT672.js";const U="workspace.service";function X(){const r=s(()=>import("./r3f-design-session-B5GsZI5M.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]));r.catch(()=>{});const m=n("three",(t,o)=>h(i(t),()=>i(t).scene,o,u(o))),e=a({kind:"three",owner:"@volter/editor-game/three/three-authoring",async mountWorldRootSession(t){const o=t,{mountR3FDesignSession:p}=await r;return p(o.store,o.composite,o.renderer)}});return c(),()=>{e(),m()}}export{U as point,X as start};
@@ -1 +0,0 @@
1
- import{e as r}from"./three-integration-BdN5Nhsg.js";import"./index-BRJMIUK0.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./renderer-ownership-BovSEcLv.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./layered-pick-kiQf53t5.js";import"./root-stacking-BEd9ZvxC.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./model-thumbnail-BEKPWg4l.js";import"./studio-environment-DRxxq_QX.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-DJDEDM0p.js";import"./three-state-DwFE3ay2.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./editor-layers-BDJnAAzj.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";import"./hierarchy-marks-Cc_3lxw6.js";import"./component-instance-root-B0C5oNEm.js";import"./viewport-door-Bj_ZIP85.js";import"./content-bounds-BeuIXKYu.js";import"./asset-preview-B1tDziF1.js";import"./bitmap-label-Ct4k6ehY.js";const Q="workspace.service";function R(){return r()}export{Q as point,R as start};