@volter/game-editor 0.5.81 → 0.5.83
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.
- package/BUNDLED_NOTICES +22 -22
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/music.json +2 -2
- package/catalog/entries/reflections.json +1 -1
- package/catalog/project-source/src/lib/reflections/ReflectionProbe.tsx +34 -5
- package/catalog/project-source/src/lib/reflections/index.ts +1 -0
- package/catalog/project-source/src/lib/reflections/probe-controller.ts +44 -3
- package/catalog/project-source/src/lib/reflections/reflection-probe-registry.ts +32 -7
- package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +638 -160
- package/dist/.vite/manifest.json +2184 -2165
- package/dist/assets/{AssetBudgetPanel-CfVYW4ED.js → AssetBudgetPanel-SrgQ5Lx5.js} +3 -3
- package/dist/assets/{AudioViewer-J10BXrtm.js → AudioViewer-BqEwLSZN.js} +1 -1
- package/dist/assets/{CanvasBoardDocument-BgIbuOQF.js → CanvasBoardDocument-BfzWZdLX.js} +1 -1
- package/dist/assets/CanvasSceneViewport-CQ7ewAlO.js +1 -0
- package/dist/assets/{ColorInput-fX1V5l8_.js → ColorInput-DQ6YyPD_.js} +1 -1
- package/dist/assets/EntityModelDocument-By-BM9dS.js +1 -0
- package/dist/assets/{EnvironmentAssetDocument-QuLkCom9.js → EnvironmentAssetDocument-CrD37BI0.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-D0z5Mc0R.js → GameplaySessionTimeline-DYtnW0Si.js} +1 -1
- package/dist/assets/{ImageViewer-DWUPPWRf.js → ImageViewer-CZNpdUEA.js} +1 -1
- package/dist/assets/InspectorObjectPreview-gWOVV6Ll.js +1 -0
- package/dist/assets/{JsonAssetDocument-C0Lr6RwY.js → JsonAssetDocument-Bg74MDXy.js} +1 -1
- package/dist/assets/{LiveModuleDocument-CaGmr0EA.js → LiveModuleDocument-CSqzNMjn.js} +1 -1
- package/dist/assets/{LutAssetDocument-B6GmsOYd.js → LutAssetDocument-CsboXa8x.js} +1 -1
- package/dist/assets/ModelAssetDocument-DDVoKZpQ.js +1 -0
- package/dist/assets/{NonThreeAuthoringBootstrap-byKqf1kp.js → NonThreeAuthoringBootstrap-DcqD6_34.js} +1 -1
- package/dist/assets/Object3DDocumentToolbar-p2pd2TuS.js +1 -0
- package/dist/assets/Object3DDocumentViewport-BvNfSHi_.js +2 -0
- package/dist/assets/{Object3DPreview-pn9i3vwZ.js → Object3DPreview-Bv0fZcdS.js} +1 -1
- package/dist/assets/{OnlineAssetDetail-PDCDAcqz.js → OnlineAssetDetail-CPDafN4x.js} +1 -1
- package/dist/assets/{PlayBar-DEnkv3v6.js → PlayBar-CBD4rcED.js} +1 -1
- package/dist/assets/{QuarksAssetDocument-2x66XymD.js → QuarksAssetDocument-DUUhKUxZ.js} +1 -1
- package/dist/assets/{ReactCanvasControls-rFwp2CeP.js → ReactCanvasControls-3ual87uP.js} +1 -1
- package/dist/assets/{RootSelectionOverlay-B9rf-SSV.js → RootSelectionOverlay-DtX8yWUQ.js} +1 -1
- package/dist/assets/{ShaderAssetDocument-ImI6jbzB.js → ShaderAssetDocument-rkhRdPRk.js} +5 -5
- package/dist/assets/{ShadowEditor-DXxVxTzk.js → ShadowEditor-B-3FlftY.js} +1 -1
- package/dist/assets/{SourceAssetViewer-CMbp_o7v.js → SourceAssetViewer-CsMPohqK.js} +1 -1
- package/dist/assets/StageHost-BOaImrmu.js +2 -0
- package/dist/assets/{StoryPreviewMount-D2zLWzWy.js → StoryPreviewMount-BI-ANJix.js} +1 -1
- package/dist/assets/{ThreeBoardDocument-nX3UiY3u.js → ThreeBoardDocument-CoBjs8BP.js} +2 -2
- package/dist/assets/{ThreeIsolationSceneContent-CGHM0vsg.js → ThreeIsolationSceneContent-uShwSK1O.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-BfNcqtFv.js → ToolObject3DPreview-CBZdWA_7.js} +1 -1
- package/dist/assets/{Toolbar-BJRJsbHG.js → Toolbar-DJK7o_be.js} +1 -1
- package/dist/assets/{TransientHint-CDvYgnzu.js → TransientHint-Dgu6u7U5.js} +1 -1
- package/dist/assets/{VideoViewer-B6Dv2zeQ.js → VideoViewer-BwTcASO2.js} +1 -1
- package/dist/assets/{ViewportShadingMenu-CrTY7tnk.js → ViewportShadingMenu-DUROUZdC.js} +1 -1
- package/dist/assets/{active-ingest-lrfMBhf9.js → active-ingest-Ra07ruDo.js} +3 -3
- package/dist/assets/{animation-clock-DktVGV5-.js → animation-clock-CKeqYCt9.js} +1 -1
- package/dist/assets/{animation-mixers.service-fkojNtor.js → animation-mixers.service-BNiEU2dA.js} +1 -1
- package/dist/assets/{animation-timeline.utility-DDrUZKe8.js → animation-timeline.utility-DQqMh1lF.js} +1 -1
- package/dist/assets/{asset-budget-asset.menu-CDlgKSO9.js → asset-budget-asset.menu-DFFih9b4.js} +1 -1
- package/dist/assets/{asset-budget.action-D6n-wIR3.js → asset-budget.action-C3SMMeSX.js} +1 -1
- package/dist/assets/{asset-budget.document-DFByoagB.js → asset-budget.document-B5NTy5dU.js} +1 -1
- package/dist/assets/{asset-budget.menu-B2u_1dWR.js → asset-budget.menu-Cclz2utV.js} +1 -1
- package/dist/assets/{asset-editor-persistence-e6bYhVnm.js → asset-editor-persistence-DsIjTddX.js} +1 -1
- package/dist/assets/{asset-loaders-Bsq-3hNt.js → asset-loaders-CQiLyapK.js} +1 -1
- package/dist/assets/{asset-preview-B7j9QV6N.js → asset-preview-BkFAKkZH.js} +1 -1
- package/dist/assets/{audio-unlock.service-7oO4YVIj.js → audio-unlock.service-CupzdUuC.js} +1 -1
- package/dist/assets/{audio.utility-9fcsT3YY.js → audio.utility-0il96T5s.js} +1 -1
- package/dist/assets/autoplay.service-SQBFaKvM.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-BJfYxqDM.js → babylon-authoring-adapter-HZ_SbAet.js} +1 -1
- package/dist/assets/{binding-resolver-CBXePHiR.js → binding-resolver-BoecCqTq.js} +2 -2
- package/dist/assets/blender-emscripten-engine-Dk-rq4bm.js +2 -0
- package/dist/assets/{blender-node-editor.document-xA7eGv3-.js → blender-node-editor.document-B_MGPd1D.js} +1 -1
- package/dist/assets/{blender-properties-tab-nY8UOQUL.js → blender-properties-tab-ITmWT_gZ.js} +1 -1
- package/dist/assets/blender-runtime-host-CACzxt1b.js +4 -0
- package/dist/assets/{blender-runtime-skin-D3Arti9-.js → blender-runtime-skin-CwFW2Hj7.js} +36 -36
- package/dist/assets/blender-runtime.document-CozOB5TX.js +13 -0
- package/dist/assets/blender-screenshot.menu-BFR44H0L.js +1 -0
- package/dist/assets/{blender-timeline.document-DXoQ7y8E.js → blender-timeline.document-C0Zzi8Vo.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-CMOyob1N.js → blender-uv-editor.document-BktbYoor.js} +1 -1
- package/dist/assets/{blender-version.status-16xnuezC.js → blender-version.status-CLPjDPFV.js} +1 -1
- package/dist/assets/blender-wali-engine-CUWSQ_vI.js +2 -0
- package/dist/assets/{blender.command-Br2EUk6Q.js → blender.command-DdHEHM62.js} +1 -1
- package/dist/assets/{board-guides-whelE-Dr.js → board-guides-DhwRYHGT.js} +1 -1
- package/dist/assets/bridge.command-D4O9w4ft.js +3 -0
- package/dist/assets/{browserAll-BfZu7-UJ.js → browserAll-BhQBgoJL.js} +1 -1
- package/dist/assets/build-player.document-DFr-d97N.js +1 -0
- package/dist/assets/{build-profiles.document-DNncGOL3.js → build-profiles.document-C-64YHSV.js} +2 -2
- package/dist/assets/{build-progress.status-DnJetNft.js → build-progress.status-DVm95Lmt.js} +1 -1
- package/dist/assets/{build-session-BaEmzCkm.js → build-session-C_SD2MNJ.js} +1 -1
- package/dist/assets/{build.action-exbllMgM.js → build.action-CPee4b_9.js} +1 -1
- package/dist/assets/{build.command-Imykh8LN.js → build.command-CrZ5sHYt.js} +1 -1
- package/dist/assets/{build.header-9RzLy3UQ.js → build.header-DDbhXD6t.js} +1 -1
- package/dist/assets/{build.menu-CRhA3yID.js → build.menu-Ci-W_A1E.js} +1 -1
- package/dist/assets/{build.service-CxIdSEPw.js → build.service-CpUtTLP4.js} +1 -1
- package/dist/assets/{camera-BiBGeQQ4.js → camera-BZM67LhS.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-DmRFynxC.js → camera-runtime.inspector-BLgPGd97.js} +1 -1
- package/dist/assets/{canvas-design-mount-DJ6zQJKG.js → canvas-design-mount-DPAhHuIQ.js} +6 -6
- package/dist/assets/{canvas-entry-runtime-Cjga4XYp.js → canvas-entry-runtime-DeyvFKWS.js} +2 -2
- package/dist/assets/{canvas-preview-frames-EoYgD6W4.js → canvas-preview-frames-Cm0GJ-40.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-D5UntNCd.js → canvas-story-capture.service-Ziv9XNot.js} +2 -2
- package/dist/assets/{capability-coverage-9qm5WVwt.js → capability-coverage-39yK3DGt.js} +4 -4
- package/dist/assets/collaboration-presence-MR8LW4mZ.js +1 -0
- package/dist/assets/{collider-CTHtUvnl.js → collider-4Sgmy-qt.js} +1 -1
- package/dist/assets/{component-board.service-yIS2UB-T.js → component-board.service-BdcOkwgn.js} +2 -2
- package/dist/assets/{component-board.service-Bf-ETQF0.js → component-board.service-DO_oHdnS.js} +2 -2
- package/dist/assets/{component-board.service-foqmr9Ii.js → component-board.service-DRJcETCR.js} +2 -2
- package/dist/assets/{component-contracts.service-Do9hADdW.js → component-contracts.service-BYQTO1HK.js} +1 -1
- package/dist/assets/{component-instance-root-MBgAuUpp.js → component-instance-root-CzRnRMe6.js} +1 -1
- package/dist/assets/{component-verbs.command-DtMdPuyO.js → component-verbs.command-CFv5y_pR.js} +1 -1
- package/dist/assets/component-verbs.service-BMBAwqjA.js +1 -0
- package/dist/assets/{config-B6tt9xy3.js → config-C6iAsozB.js} +2 -2
- package/dist/assets/configurations-Dua_x6Wx.js +1 -0
- package/dist/assets/{connection.status-BNPvWdJD.js → connection.status-DQJvEgdT.js} +1 -1
- package/dist/assets/{constraints.inspector-DoOn25Lk.js → constraints.inspector-AHeP-LBc.js} +1 -1
- package/dist/assets/{content-bounds-BFpR_e--.js → content-bounds-tMCAobKq.js} +1 -1
- package/dist/assets/{contract-system-adapters-BRHtWOi_.js → contract-system-adapters-D6ion7SF.js} +1 -1
- package/dist/assets/{coverage.service-BB1XhwsL.js → coverage.service-Dm_H5o74.js} +2 -2
- package/dist/assets/{create-runtime-B6u6x5eK.js → create-runtime-C82CmCbc.js} +2 -2
- package/dist/assets/{curve-D11mIGoN.js → curve-C7Gg05DV.js} +1 -1
- package/dist/assets/{data-asset-DejEwzXj.js → data-asset-BquhdFX2.js} +1 -1
- package/dist/assets/{data-ref-DJNVzksb.js → data-ref-Dcq9KJIG.js} +1 -1
- package/dist/assets/{debug-bridge-DlGIEyTc.js → debug-bridge-DODnLefz.js} +1 -1
- package/dist/assets/{debug-registry-Dagj3b6J.js → debug-registry-CwYeaZ9J.js} +1 -1
- package/dist/assets/deferred-ingest-play-7EJo_GNB.js +2 -0
- package/dist/assets/{design-time-canvas-mount-Cpb_jITI.js → design-time-canvas-mount-DCINR1Hg.js} +2 -2
- package/dist/assets/{design-time-layers-DT4X-pJp.js → design-time-layers-i1N-JjPz.js} +1 -1
- package/dist/assets/{design-time-mount.service-DEa-41ij.js → design-time-mount.service-CtnijZJJ.js} +2 -2
- package/dist/assets/{design-time-mount.service-Ck5Hjxtn.js → design-time-mount.service-DrUVDx2-.js} +2 -2
- package/dist/assets/{design-time-react-mount-DCTpYS51.js → design-time-react-mount-CpgoPMGr.js} +1 -1
- package/dist/assets/{document-preview-three-TjlxMDBR.js → document-preview-three-CuBUMP4o.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-C3ZsI41l.js → dom-authoring-adapter-DSM-2JgU.js} +1 -1
- package/dist/assets/{draco3d-Ddr7J1sS.js → draco3d--d91Ay95.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-D047aZ6I.js → edit-mode-audio.service-C9_299G0.js} +1 -1
- package/dist/assets/{edit-mode-authoring-DubxVdEM.js → edit-mode-authoring-DgvzXpiM.js} +1 -1
- package/dist/assets/{edit-mode-networking.service-DitjC2ZL.js → edit-mode-networking.service-B6l9ESo-.js} +1 -1
- package/dist/assets/editor-api-D9NJWRVZ.js +1 -0
- package/dist/assets/{editor-layers-BK3fNRb7.js → editor-layers-D7HXdvWY.js} +1 -1
- package/dist/assets/{editor-shell-store-Bro0arjr.js → editor-shell-store-CGWO4Ldz.js} +1 -1
- package/dist/assets/{entity-object-BFppZ54X.js → entity-object-Dl04-FE8.js} +1 -1
- package/dist/assets/{extend-MkXq6t1H.js → extend-GXzJ7XU_.js} +1 -1
- package/dist/assets/fork-menu-DO1KASKk.js +1 -0
- package/dist/assets/{frame-debugger-store-xbOH83D0.js → frame-debugger-store-DOewah-x.js} +1 -1
- package/dist/assets/{game-contract-seams-5IUqvr7b.js → game-contract-seams-B5a-Ev-f.js} +1 -1
- package/dist/assets/{game-css-scope-transform-DDAoTvZQ.js → game-css-scope-transform-CQhuDfMR.js} +1 -1
- package/dist/assets/game-document.service-CMc6SfH9.js +1 -0
- package/dist/assets/{game-eval.command-DcFoKUe7.js → game-eval.command-MY5YxNL-.js} +1 -1
- package/dist/assets/{game-module-access-ABBzTWg7.js → game-module-access-BafPamOR.js} +1 -1
- package/dist/assets/game-network-COQRxS_4.js +22 -0
- package/dist/assets/gameplay-export-i_fnSpRp.js +1 -0
- package/dist/assets/gameplay-replay-BM_frdpr.js +1 -0
- package/dist/assets/{gameplay.command-qdQLKC3A.js → gameplay.command-Dkp2IG9Q.js} +1 -1
- package/dist/assets/generation-jobs-B6T_j2D_.js +1 -0
- package/dist/assets/{generation.service-CdwRWoIV.js → generation.service-BXJTa6dr.js} +1 -1
- package/dist/assets/{generations-nW4LG5qG.js → generations-DqNhoKz8.js} +1 -1
- package/dist/assets/{generations.status-DgjVrgGL.js → generations.status-Dt8TW7Lk.js} +1 -1
- package/dist/assets/{hierarchy-marks-Pb6wnNcu.js → hierarchy-marks-fSNwXIFe.js} +1 -1
- package/dist/assets/{hosted-asset-materialization-BCnTLunr.js → hosted-asset-materialization-76jdNP28.js} +2 -2
- package/dist/assets/ibl-override-material-C09OAhCc.js +6 -0
- package/dist/assets/{index-CvGsVzTo.js → index-C5tasxXb.js} +294 -294
- package/dist/assets/{index-D7q1gYjq.js → index-CKznhnFr.js} +1 -1
- package/dist/assets/{index-BPuw4yre.js → index-CO6HFW9e.js} +1 -1
- package/dist/assets/{index-CaZZDx3x.js → index-Cf-uQvPt.js} +1 -1
- package/dist/assets/{index-BlWeDGvp.js → index-Cub6ESrb.js} +2 -2
- package/dist/assets/{index-Ds9fZyOU.js → index-D5pDWxZH.js} +1 -1
- package/dist/assets/{index-BYoN6-Qw.js → index-c6fd_bqy.js} +1 -1
- package/dist/assets/{index-Bz4YDJ7o.js → index-cGaEzVz5.js} +1 -1
- package/dist/assets/{index-Db2ixdvK.js → index-cNdu8TlA.js} +1 -1
- package/dist/assets/{inference-diagnostics-BCwXk-CS.js → inference-diagnostics-D7uYs70A.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-BPER30gQ.js → ingest-boot-viewport-CjtFKkMD.js} +1 -1
- package/dist/assets/ingest-siblings-Dlx0quan.js +1 -0
- package/dist/assets/{ingest-source-persistence-CPlDA2D8.js → ingest-source-persistence-SAe0xIy-.js} +1 -1
- package/dist/assets/{ingest.service-BhwFGlqY.js → ingest.service-BXkZ1vXa.js} +1 -1
- package/dist/assets/{inspect-DxfAFkho.js → inspect-BqIL-41D.js} +1 -1
- package/dist/assets/instances.command-wpQVWPb9.js +1 -0
- package/dist/assets/{json-history-resource-CckDydoO.js → json-history-resource-BUJgH5iK.js} +1 -1
- package/dist/assets/layered-pick-RElCrqXb.js +1 -0
- package/dist/assets/{light-DF4nTzTq.js → light-DLADuHH2.js} +1 -1
- package/dist/assets/live-project-verbs-Cc1GXtG5.js +1 -0
- package/dist/assets/{machine.document-DaPLAXaa.js → machine.document-ER7OD-37.js} +1 -1
- package/dist/assets/{machines.finder-C9s8SFtp.js → machines.finder-CZ2ZxPFR.js} +1 -1
- package/dist/assets/material-CspuVO3Q.js +1 -0
- package/dist/assets/{material-factory-CCcnlv8E.js → material-factory-KV4mqSzl.js} +1 -1
- package/dist/assets/{mesh-CVBvSsCX.js → mesh-CrIkl8_H.js} +1 -1
- package/dist/assets/{model-asset-sections.service-vVRv6iOD.js → model-asset-sections.service-Cyom1FRs.js} +1 -1
- package/dist/assets/{model-inspection-Dd-hn5v2.js → model-inspection-BLOiPoW4.js} +1 -1
- package/dist/assets/{model-thumbnail-BDU_QU37.js → model-thumbnail-B7DVMYtQ.js} +1 -1
- package/dist/assets/{models.finder-CQMZz5xX.js → models.finder-At2wuWE3.js} +1 -1
- package/dist/assets/{module-mode-DcBz3aI7.js → module-mode-CHqvCb69.js} +2 -2
- package/dist/assets/{mount-canvas-ingest-root-DMWeT_c3.js → mount-canvas-ingest-root-uISMj3zn.js} +2 -2
- package/dist/assets/{mount-dom-ingest-root-Bx1TmleJ.js → mount-dom-ingest-root-C8PsgrCd.js} +2 -2
- package/dist/assets/{mount-ingest-root-BDP8atUq.js → mount-ingest-root-Dmb_D_oY.js} +2 -2
- package/dist/assets/{mount-manifest-C5QVCZlS.js → mount-manifest-CGwCOZO6.js} +1 -1
- package/dist/assets/{mount-three-ingest-root-DSmhgOJn.js → mount-three-ingest-root-BGdd6UoG.js} +1 -1
- package/dist/assets/{mounted-authoring-D-tXkNKH.js → mounted-authoring-BS53gpIm.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-Snu9yn1n.js → mounted-story-viewport-source-CL9Ra-_N.js} +1 -1
- package/dist/assets/{native-debug-module-XfhvyMrK.js → native-debug-module-DRmkIrIW.js} +1 -1
- package/dist/assets/{navigation-CTTcWe0R.js → navigation-DOuNvaV6.js} +1 -1
- package/dist/assets/{navmesh.menu-mFjQ30B0.js → navmesh.menu-9g4nO2dp.js} +1 -1
- package/dist/assets/{navmesh.service-BJPp7ZXu.js → navmesh.service-B7MllQj9.js} +1 -1
- package/dist/assets/network-observer.service-DY_39EdG.js +1 -0
- package/dist/assets/{network.utility-C-_7MTIV.js → network.utility-BgzPLUS5.js} +1 -1
- package/dist/assets/object3d-document-session-registry-Bk-I9jZH.js +2 -0
- package/dist/assets/{oid-transform-Bgdv7kST.js → oid-transform-CHeHFNUu.js} +1 -1
- package/dist/assets/{particles-CHXYb9Jd.js → particles-RD4cI69F.js} +1 -1
- package/dist/assets/{pixi-authoring-adapter-lj5CidSR.js → pixi-authoring-adapter-BuP3Qc7X.js} +1 -1
- package/dist/assets/{pixi-live-write-target-BEL9GCCr.js → pixi-live-write-target-DzyXhmiw.js} +1 -1
- package/dist/assets/play.command-C7iZbm26.js +2 -0
- package/dist/assets/{presentation-CmK-bEDi.js → presentation-43UAzXCV.js} +1 -1
- package/dist/assets/{product-gjrRHe-K.js → product-BfaoEtK8.js} +1 -1
- package/dist/assets/{profiler.action-CZ6UQi9A.js → profiler.action-DIp4OPNA.js} +1 -1
- package/dist/assets/{profiler.menu-DxbnC3d6.js → profiler.menu-tHZqii7c.js} +1 -1
- package/dist/assets/{profiler.utility-BvARl7sM.js → profiler.utility-CSg5WNN8.js} +1 -1
- package/dist/assets/{project-authoring-session-CBKXzBlD.js → project-authoring-session-BbwFHEzZ.js} +2 -2
- package/dist/assets/{properties-bone-constraints.inspector-Co8UpbhC.js → properties-bone-constraints.inspector-ooGWoGiI.js} +1 -1
- package/dist/assets/{properties-bone.inspector-CFXh2lQH.js → properties-bone.inspector-C_UdJjDe.js} +1 -1
- package/dist/assets/{properties-collection.inspector-Jq9X8fEq.js → properties-collection.inspector-Dm4MNZQK.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-CMcKD_Jc.js → properties-constraints.inspector-DlCHF3Nd.js} +1 -1
- package/dist/assets/{properties-data.inspector-cP3izSat.js → properties-data.inspector-DTfv2ILq.js} +1 -1
- package/dist/assets/{properties-material.inspector-CrZIovv9.js → properties-material.inspector-C_-GsOvF.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-DqQMxoiL.js → properties-modifiers.inspector-BELGiG49.js} +1 -1
- package/dist/assets/{properties-object.inspector-DM63eANJ.js → properties-object.inspector-COLlzAo4.js} +1 -1
- package/dist/assets/{properties-output.inspector-B475IBEd.js → properties-output.inspector-DLpqLRCp.js} +1 -1
- package/dist/assets/{properties-particles.inspector-vGXQ4kWx.js → properties-particles.inspector-C8ZhuG-X.js} +1 -1
- package/dist/assets/{properties-physics.inspector-CfwqpVGS.js → properties-physics.inspector-DQ3fUdPx.js} +1 -1
- package/dist/assets/{properties-render.inspector-BYLknsM7.js → properties-render.inspector-DlPuoXQ-.js} +1 -1
- package/dist/assets/{properties-scene.inspector-BcIZBfGk.js → properties-scene.inspector-itnV8qGu.js} +1 -1
- package/dist/assets/{properties-texture.inspector-p3Owurhl.js → properties-texture.inspector-BZbBAQ_O.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-CN-5jzB9.js → properties-view-layer.inspector-CNOevOy3.js} +1 -1
- package/dist/assets/{properties-world.inspector-DVp8fYWx.js → properties-world.inspector-C7u-dAkO.js} +1 -1
- package/dist/assets/r3f-design-session-DbXiRez3.js +2 -0
- package/dist/assets/{r3f-physics-binding-BcTFD1ZS.js → r3f-physics-binding-B8Je7bNy.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-DVnhzoxp.js → r3f-source-authoring-adapter-CarxaAwC.js} +1 -1
- package/dist/assets/{react-canvas-navigation-CBorZtWB.js → react-canvas-navigation-BTVCmK_d.js} +1 -1
- package/dist/assets/{react-inspector.service-Dc99kogU.js → react-inspector.service-BV9ZVls7.js} +1 -1
- package/dist/assets/{react-story-board-6-BjI32N.js → react-story-board-CETbMKNG.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-BO2XPUEM.js → react-three-rapier.esm-BQ3IBcaP.js} +1 -1
- package/dist/assets/{react-world-authoring-adapter-B6BiehHR.js → react-world-authoring-adapter-DsywMgco.js} +1 -1
- package/dist/assets/{realm-services-DCnaxwIb.js → realm-services-DoN23Ol2.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-CWneVfEe.js → reflection-probe-capture.inspector-D0grUDdX.js} +1 -1
- package/dist/assets/{registry-BQ9YcFZF.js → registry-CZxNkOhN.js} +1 -1
- package/dist/assets/{relative-import-specifier-BvzqkvYS.js → relative-import-specifier-DMppRnNH.js} +1 -1
- package/dist/assets/{render-env-F320_iHT.js → render-env-BAO3Rc6G.js} +1 -1
- package/dist/assets/{render-features-DFwHsGxu.js → render-features-CBm-s0QE.js} +1 -1
- package/dist/assets/{render-settings-BPcHd4LA.js → render-settings-DCZaLK-j.js} +1 -1
- package/dist/assets/{resolve-three-CnxafYrg.js → resolve-three-Bwj7rkZB.js} +13 -13
- package/dist/assets/{root-seam-contract-CueaHgB9.js → root-seam-contract-DMUsCBFW.js} +1 -1
- package/dist/assets/{run-selection-BMQWV9Fn.js → run-selection-DRkjJF-w.js} +1 -1
- package/dist/assets/{scene-capture-DcMYbX9_.js → scene-capture-DVXdql_1.js} +1 -1
- package/dist/assets/{scene-document.service-CZpLI3b6.js → scene-document.service-CxGQ1BN-.js} +2 -2
- package/dist/assets/{scene-framing-nVyYC4Y-.js → scene-framing-DUd4lKtW.js} +1 -1
- package/dist/assets/{seeded-random-D0QPgfm6.js → seeded-random-DzZFJTfh.js} +1 -1
- package/dist/assets/{setup-renderer-ji8Qt-PP.js → setup-renderer-DF2zFw-E.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-owosRx07.js → source-object3d-authoring-adapter-RimvAMDG.js} +1 -1
- package/dist/assets/{source-persistence-backend-Djuk0m-7.js → source-persistence-backend-BRcy23H9.js} +1 -1
- package/dist/assets/stage-keyboard-JRZ1CNbL.js +1 -0
- package/dist/assets/stage-overlay-set-DHN11xPU.js +1 -0
- package/dist/assets/{stage-presence-markers-CQlXR9fX.js → stage-presence-markers-AQuGIbnu.js} +1 -1
- package/dist/assets/stage-transform-tools-B8u8n8gJ.js +1 -0
- package/dist/assets/{standard-viewport-dressing-e4mnLmI6.js → standard-viewport-dressing-NHKaiGVg.js} +3 -3
- package/dist/assets/{state-watch.action-Cv3W67Kr.js → state-watch.action-B_conRk5.js} +1 -1
- package/dist/assets/{state-watch.menu-Cuziz9RM.js → state-watch.menu-B6GNrnYH.js} +1 -1
- package/dist/assets/{state-watch.utility-B1zkFd_6.js → state-watch.utility-CxuUOPhl.js} +1 -1
- package/dist/assets/story-capture-DYXQlnlZ.js +1 -0
- package/dist/assets/{story-documents-Cjoy-ydN.js → story-documents-D_Tg0idt.js} +1 -1
- package/dist/assets/{story-documents.service-Csto-LsX.js → story-documents.service-DQh0SkkQ.js} +1 -1
- package/dist/assets/{story-documents.service-gVxcUtso.js → story-documents.service-ES8nxeNu.js} +1 -1
- package/dist/assets/story-media-presence-D4w-waFJ.js +1 -0
- package/dist/assets/{story-pixi-preview-uA6AevDw.js → story-pixi-preview-B6GFGUQG.js} +1 -1
- package/dist/assets/{story-presentation-DgAoj9Qt.js → story-presentation-6qhUDkv4.js} +1 -1
- package/dist/assets/{story-three-preview-CQYi1rZ_.js → story-three-preview-BgLSJIlN.js} +2 -2
- package/dist/assets/{studio-environment-DK0ke0m0.js → studio-environment-BGU84AOG.js} +1 -1
- package/dist/assets/{surface-state-DlUcJe84.js → surface-state-BtNEZzCd.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-92aOVqyZ.js → syntactic-prop-specs-B309atpv.js} +1 -1
- package/dist/assets/{team-playtest.service-CGBismiY.js → team-playtest.service-B8leDEE-.js} +1 -1
- package/dist/assets/{three-bdxPiUPb.js → three-BRZq2Px5.js} +1 -1
- package/dist/assets/{three-authoring-adapter-BuqO9MDt.js → three-authoring-adapter-DkfGlaNQ.js} +1 -1
- package/dist/assets/three-authoring.service-sOchR4o8.js +2 -0
- package/dist/assets/{three-ingest-runtime-CwRnwvb0.js → three-ingest-runtime-D9JoNRjk.js} +1 -1
- package/dist/assets/three-integration-D3zBmOoj.js +2 -0
- package/dist/assets/three-integration.service-CE8aNHob.js +1 -0
- package/dist/assets/{three-projection-core-BO23VKAP.js → three-projection-core-Dt5ARGlM.js} +1 -1
- package/dist/assets/{three-state-BhQOBgKC.js → three-state-3qPk0Sq8.js} +1 -1
- package/dist/assets/{three-story-capture.service-BAtrzxHq.js → three-story-capture.service-B3U2L4qG.js} +2 -2
- package/dist/assets/{three-story-model-D_bo7Gl-.js → three-story-model-C96x-E0V.js} +1 -1
- package/dist/assets/{three-viewport-presentation-CWanX03c.js → three-viewport-presentation-DGctcUkE.js} +5 -5
- package/dist/assets/transform-mode-request-C0cdwtJf.js +1 -0
- package/dist/assets/{transport-strip-CFLRAIQd.js → transport-strip-8OsPiJIm.js} +1 -1
- package/dist/assets/transport.header-D1Otpit3.js +1 -0
- package/dist/assets/{tuples-BKzzn3tK.js → tuples-CaBWqclR.js} +1 -1
- package/dist/assets/ui-board-document-BMTAhmJP.js +2 -0
- package/dist/assets/{user-data-DfBtZvxw.js → user-data-4Ls0MsfF.js} +1 -1
- package/dist/assets/{utility-view-state-CL4NJh3n.js → utility-view-state-gIzv2Oo_.js} +1 -1
- package/dist/assets/{viewport-door-CuJjGYTz.js → viewport-door-C4Fu0zS3.js} +1 -1
- package/dist/assets/{viewport-root-presentation-CkSAEMH-.js → viewport-root-presentation-DMMIH4rt.js} +1 -1
- package/dist/assets/{viewport-surface-status-D3t-0oLs.js → viewport-surface-status-CdI6sQko.js} +1 -1
- package/dist/assets/{webworkerAll-DCmB9rsA.js → webworkerAll-BINEvomm.js} +1 -1
- package/dist/assets/worker-Cu9kIzIf.js +2 -0
- package/dist/assets/{workspace-arrangement-C9uemwSK.js → workspace-arrangement-w-T2xUGF.js} +1 -1
- package/dist/assets/{world-documents-Dvn8e5I0.js → world-documents-feEUCgVE.js} +1 -1
- package/dist/assets/{world-root-stage-binding-BB7acZV_.js → world-root-stage-binding-BDb6wt_C.js} +1 -1
- package/dist/assets/{xstate-animation-binding-DctwT981.js → xstate-animation-binding-Bhz1Uhhw.js} +1 -1
- package/dist/assets/{xstate-animation-meta-s4Vc8Wu3.js → xstate-animation-meta-CvDlYgrt.js} +1 -1
- package/dist-node/cli.js +21 -18
- package/package.json +16 -16
- package/template/src/lib/reflections/ReflectionProbe.tsx +34 -5
- package/template/src/lib/reflections/index.ts +1 -0
- package/template/src/lib/reflections/probe-controller.ts +44 -3
- package/template/src/lib/reflections/reflection-probe-registry.ts +32 -7
- package/template/src/lib/reflections/volume-reflection-material.ts +638 -160
- package/dist/assets/CanvasSceneViewport-Z8OReqpB.js +0 -1
- package/dist/assets/EntityModelDocument-BltE1A7W.js +0 -1
- package/dist/assets/InspectorObjectPreview-BpttBw3o.js +0 -1
- package/dist/assets/ModelAssetDocument-BBDnXTQm.js +0 -1
- package/dist/assets/Object3DDocumentToolbar-BHuuMZnS.js +0 -1
- package/dist/assets/Object3DDocumentViewport-ByDDwGJD.js +0 -2
- package/dist/assets/StageHost-D1Sz5aud.js +0 -2
- package/dist/assets/autoplay.service-DncOrn-K.js +0 -1
- package/dist/assets/blender-emscripten-engine-DQljvfR7.js +0 -2
- package/dist/assets/blender-runtime-host-CcqXT39s.js +0 -4
- package/dist/assets/blender-runtime.document-DDW5jIJe.js +0 -12
- package/dist/assets/blender-wali-engine-CO-jG_ik.js +0 -2
- package/dist/assets/bridge.command-T93eURWq.js +0 -3
- package/dist/assets/build-player.document-DJQLP4xM.js +0 -1
- package/dist/assets/collaboration-presence-Q6zcL5v0.js +0 -1
- package/dist/assets/component-verbs.service-CJYq28Zw.js +0 -1
- package/dist/assets/configurations-BcYOQ7i-.js +0 -1
- package/dist/assets/deferred-ingest-play-DZiOEH9a.js +0 -2
- package/dist/assets/editor-api-CPh65aBN.js +0 -1
- package/dist/assets/fork-menu-DzoCyQvA.js +0 -1
- package/dist/assets/game-document.service-CxfiFnxt.js +0 -1
- package/dist/assets/game-network-BPTyOFqA.js +0 -22
- package/dist/assets/gameplay-export-CRnHCUBb.js +0 -1
- package/dist/assets/gameplay-replay-yPaMxi2o.js +0 -1
- package/dist/assets/generation-jobs-Cy1oE-Ff.js +0 -1
- package/dist/assets/ibl-override-material-CMo_a49U.js +0 -6
- package/dist/assets/ingest-siblings-2QHhcCgA.js +0 -1
- package/dist/assets/instances.command-BJ-I9vtW.js +0 -1
- package/dist/assets/layered-pick-BaxBYi7u.js +0 -1
- package/dist/assets/live-project-verbs-B7S-wGjC.js +0 -1
- package/dist/assets/material-rGFsBrD0.js +0 -1
- package/dist/assets/network-observer.service-CjeDB1Id.js +0 -1
- package/dist/assets/object3d-document-session-registry-CWaOPDYg.js +0 -2
- package/dist/assets/play.command-C9QyYFgv.js +0 -2
- package/dist/assets/r3f-design-session-Cyy1sDGH.js +0 -2
- package/dist/assets/stage-keyboard-G6HMStmP.js +0 -1
- package/dist/assets/stage-overlay-set-ChHqsFiR.js +0 -1
- package/dist/assets/stage-transform-tools-BM9u9Awe.js +0 -1
- package/dist/assets/story-capture-Drqhmo7i.js +0 -1
- package/dist/assets/story-media-presence-CYc2fP4y.js +0 -1
- package/dist/assets/three-authoring.service-CMym8IbB.js +0 -2
- package/dist/assets/three-integration-BHoulbny.js +0 -2
- package/dist/assets/three-integration.service-BlgF9hV3.js +0 -1
- package/dist/assets/transform-mode-request-Bg6T_rOC.js +0 -1
- package/dist/assets/transport.header-B3dK1KaC.js +0 -1
- package/dist/assets/ui-board-document-DMxgQ-9n.js +0 -2
- package/dist/assets/worker-CJIsrsP6.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X as A,V as x}from"./index-CvGsVzTo.js";import{c as y,B as C,O as I,W as O,C as S,Q as g,d as V,e as k}from"./output-DK8waum9.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function F(a){let r=0,e=0,t=0;for(const n of a)for(let s=0;s<n.length;s++){const i=n[s]??0;r+=i*i,e=Math.max(e,Math.abs(i)),t++}return{rms:t>0?Math.sqrt(r/t):0,peak:e}}const u="opus",R=128e3;function z(a){const r=a.fps??30;if(!Number.isInteger(r)||r<1||r>60||60%r!==0)throw new Error("Video export FPS must be a positive divisor of 60.");if(!Number.isSafeInteger(a.frames)||a.frames<1)throw new Error("Video export frames must be a positive safe integer.");if(a.frames/r>300)throw new Error("Video export is limited to five minutes per file.");return r}async function N(a){if(!await y("vp9",{width:a.clientWidth,height:a.clientHeight}))throw new Error("This browser cannot encode VP9 video at the game resolution.")}async function G(a,r,e){const{buffer:t}=await a.render(a.startSeconds,a.startSeconds+r),n=t.length/t.sampleRate;if(Math.abs(n-r)>1/e)throw new Error(`Offline audio render returned ${n.toFixed(4)}s for a ${r.toFixed(4)}s export window (tolerance one frame, ${(1/e).toFixed(4)}s).`);if(!await k(u,{numberOfChannels:t.numberOfChannels,sampleRate:t.sampleRate}))throw new Error(`This browser cannot encode ${u} at ${t.sampleRate} Hz, ${t.numberOfChannels} channel(s).`);const s=[];for(let o=0;o<t.numberOfChannels;o++)s.push(t.getChannelData(o));const i=F(s);return{buffer:t,track:{codec:u,sampleRate:t.sampleRate,channels:t.numberOfChannels,durationSeconds:n,rms:i.rms,peak:i.peak}}}async function Q(a,r,e){const t=z(r),n=performance.now(),s=a.ownerDocument.createElement("canvas");if(s.width=a.clientWidth,s.height=a.clientHeight,s.width<1||s.height<1)throw new Error("Game surface has no exportable size.");const i=s.width,o=s.height,v=r.frames/t,m=e.audio?await G(e.audio,v,t):null;e.signal?.throwIfAborted(),e.assertActive();let c=null;const h=new C,f=new I({target:h,format:new O}),l=new S(s,{codec:"vp9",quality:new g({bitrate:3e6})});f.addVideoTrack(l,{frameRate:t}),m&&(c=new V({codec:u,quality:new g({bitrate:R})}),f.addAudioTrack(c));const E=x();let w=null;const p=()=>{w??=f.cancel()};e.signal?.addEventListener("abort",p,{once:!0});try{e.signal?.throwIfAborted(),await f.start(),c&&m&&(await c.add(m.buffer),c.close(),e.signal?.throwIfAborted());for(let d=0;d<r.frames;d++){if(e.signal?.throwIfAborted(),e.assertActive(),!a.isConnected)throw new Error("Game surface was removed during video export.");if(a.clientWidth!==i||a.clientHeight!==o)throw new Error("Game surface resized during video export.");if(d>0)for(let b=0;b<60/t;b++)e.step();if(await A(a,s,{size:{width:i,height:o},snapshots:E,canvasFrame:e.canvasFrame}),e.signal?.throwIfAborted(),e.assertActive(),a.clientWidth!==i||a.clientHeight!==o)throw new Error("Game surface resized during video export.");await l.add(d/t,1/t,{keyFrame:d%(t*2)===0})}if(e.assertActive(),e.signal?.throwIfAborted(),await f.finalize(),e.signal?.throwIfAborted(),e.assertActive(),!h.buffer)throw new Error("Video encoder produced no output.");return{blob:new Blob([h.buffer],{type:"video/webm"}),frames:r.frames,fps:t,durationMs:r.frames*1e3/t,wallMs:performance.now()-n,width:i,height:o,audio:m?.track??!1}}catch(d){throw w?await w:f.state!=="finalized"&&await f.cancel(),d}finally{e.signal?.removeEventListener("abort",p)}}export{N as assertGameplayVideoSupport,Q as exportGameplayVideo,z as validateGameplayExport};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as N,E as P}from"./rrweb-Cd2ifIRP.js";import{Q as C,U as L,V as U,X as F}from"./index-CvGsVzTo.js";import{B as O,O as B,W as D,C as I,Q as A,I as W,a as $,U as H,A as V,b as q}from"./output-DK8waum9.js";function x(e,r){const o=new URLSearchParams({replay:e,file:r});return`${C}/recording/replay-file?${o}`}async function T(e,r){const o=await fetch(x(e,r));if(!o.ok)throw new Error(`could not load replay ${r}: HTTP ${o.status}`);return o.text()}function z(e){return new Promise((r,o)=>{const s=new FileReader;s.onload=()=>r(String(s.result)),s.onerror=()=>o(s.error??new Error("could not read replay asset")),s.readAsDataURL(e)})}async function j(e){let r=await T(e,"events.json");const o=new Set(r.match(/https:\/\/replay-assets\.invalid\/\d{6}\.(?:png|jpg|webp|gif|svg)/g)??[]),s=await Promise.all([...o].map(async a=>{const i=a.split("/").at(-1),n=await fetch(x(e,`assets/${i}`));if(!n.ok)throw new Error(`could not load replay asset ${i}`);return[a,await z(await n.blob())]}));for(const[a,i]of s)r=r.replaceAll(a,i);const t=JSON.parse(r);if(!Array.isArray(t)||t.length===0)throw new Error("replay contains no DOM events");return t}function G(e,r,o){return Math.max(0,e.videoStartEpochMs+o-r[0].timestamp)}function Q(e,r,o){const s=e.videoStartEpochMs+o;let t={rect:e.canvas,drawingWidth:e.canvas.drawingWidth,drawingHeight:e.canvas.drawingHeight};for(const a of r){if(a.timestamp>s)break;a.type===P.Custom&&a.data.tag==="volter-canvas-layout"&&a.data.payload&&typeof a.data.payload=="object"&&"rect"in a.data.payload&&"drawingWidth"in a.data.payload&&"drawingHeight"in a.data.payload&&(t=a.data.payload)}return t}async function _(e,r){await new Promise((o,s)=>{const t=()=>{clearTimeout(n),e.removeEventListener("loadeddata",a),e.removeEventListener("error",i)},a=()=>{t(),o()},i=()=>{t(),s(new Error("replay video failed to load"))},n=setTimeout(()=>{t(),s(new Error("replay video load timed out"))},15e3);e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?a():(e.addEventListener("loadeddata",a,{once:!0}),e.addEventListener("error",i,{once:!0}))}),!(Math.abs(e.currentTime-r)<.001)&&await new Promise((o,s)=>{const t=()=>{clearTimeout(n),e.removeEventListener("seeked",a),e.removeEventListener("error",i)},a=()=>{t(),o()},i=()=>{t(),s(new Error("replay video seek failed"))},n=setTimeout(()=>{t(),s(new Error("replay video seek timed out"))},15e3);e.addEventListener("seeked",a,{once:!0}),e.addEventListener("error",i,{once:!0}),e.currentTime=r})}async function J(e){e.fonts.size>0&&e.fonts.status!=="loaded"&&await Promise.race([e.fonts.ready.then(()=>{}),new Promise(r=>setTimeout(r,3e3))]),await Promise.all(Array.from(e.images,r=>r.decode().catch(()=>{})))}async function S(e,r){const[o,s]=await Promise.all([T(e,"manifest.json"),j(e)]),t=JSON.parse(o);if(t.status!=="complete"||t.format!=="canvas-dom"||t.version!==1||!t.capture||typeof t.capture.durationMs!="number")throw new Error("replay manifest is incomplete or unsupported");const a=document.createElement("div");a.setAttribute("data-volter-replay-block",""),Object.assign(a.style,{position:"fixed",left:"-100000px",top:"0",width:`${t.viewport.width}px`,height:`${t.viewport.height}px`,overflow:"hidden",pointerEvents:"none"});const i=document.createElement("div");a.append(i),document.body.append(a);const n=document.createElement("video");n.muted=!0,n.preload="auto",n.playsInline=!0,n.src=x(e,"video"),a.append(n);let w;try{w=new N(s,{root:i,showWarning:!1,showDebug:!1,mouseTail:!1,UNSAFE_replayCanvas:!0,insertStyleRules:["[data-volter-replay-video] { visibility: hidden !important; }"]});const f=w;return await r({manifest:t,async render(u){const h=Math.max(0,Math.min(u,t.capture.durationMs));await _(n,h/1e3),f.pause(G(t,s,h)),await J(f.iframe.contentDocument);const y=f.getMirror().getNode(t.canvas.nodeId),p=f.getMirror().getNode(t.surfaceNodeId);if(!y||y.tagName!=="CANVAS")throw new Error("replay canvas placeholder is unavailable");if(!p||typeof p.getBoundingClientRect!="function")throw new Error("replay game surface is unavailable");const c=y,g=p;c.setAttribute("data-volter-root-surface","true");const E=Q(t,s,h);c.width=E.drawingWidth,c.height=E.drawingHeight;const d=c.getContext("2d");if(!d)throw new Error("replay canvas has no 2D context");return d.drawImage(n,0,0,c.width,c.height),c.style.setProperty("visibility","visible","important"),g}})}finally{n.pause(),w?.destroy(),n.removeAttribute("src"),n.load(),a.remove()}}async function Z(e,r){return S(e,async({manifest:o,render:s})=>{const t=Math.max(0,Math.min(r,o.capture.durationMs)),a=await s(t),i=await L(a),n=a.getBoundingClientRect();return{...i,replayPath:e,positionMs:t,width:Math.max(1,Math.round(n.width)),height:Math.max(1,Math.round(n.height))}})}async function ee(e){const r=e.fps??30;if(!Number.isInteger(r)||r<1||r>60)throw new Error("replay export fps must be an integer from 1 to 60");return S(e.replayPath,async({manifest:o,render:s})=>{const t=e.startMs??0,a=e.endMs??o.capture.durationMs;if(!Number.isFinite(t)||!Number.isFinite(a)||t<0||a<=t||a>o.capture.durationMs||a-t>3e5)throw new Error("replay export requires a valid recorded interval of at most five minutes");const i=t/1e3,n=a/1e3,w=Math.ceil((n-i)*r),f=await s(t),u=document.createElement("canvas"),h=f.getBoundingClientRect();u.width=Math.max(1,Math.round(h.width)),u.height=Math.max(1,Math.round(h.height));const y={width:u.width,height:u.height},p=new O,c=new B({target:p,format:new D}),g=new I(u,{codec:"vp9",quality:new A({bitrate:3e6})});c.addVideoTrack(g,{frameRate:r});const E=new W({source:new H(x(e.replayPath,"video")),formats:[$]});try{const d=await E.getPrimaryAudioTrack();if(o.capture.audio&&!d)throw new Error("recorded audio track is missing");const M=d?new V({codec:"opus",quality:new A({bitrate:128e3})}):null;M&&c.addAudioTrack(M),await c.start();const R=async()=>{if(!(!M||!d)){for await(const l of new q(d).samples(i,n))try{const m=Math.max(0,Math.ceil((i-l.timestamp)*l.sampleRate)),v=Math.min(l.numberOfFrames,Math.ceil((n-l.timestamp)*l.sampleRate));if(v<=m)continue;const b=l.trim(m,v);try{b.setTimestamp(Math.max(0,b.timestamp-i)),await M.add(b)}finally{b.close()}}finally{l.close()}M.close()}},k=async()=>{const l=U();for(let m=0;m<w;m++){const v=m/r;await F(await s(t+v*1e3),u,{size:y,snapshots:l}),await g.add(v,Math.min(1/r,n-i-v),{keyFrame:m%(r*2)===0})}g.close()};if(await Promise.all([R(),k()]),await c.finalize(),!p.buffer)throw new Error("replay encoder produced no output");return{blob:new Blob([p.buffer],{type:"video/webm"}),frames:w,fps:r,durationMs:a-t,...y,audio:d!==null}}catch(d){throw c.state!=="finalized"&&await c.cancel(),d}finally{E.dispose()}})}export{Z as c,ee as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as l,Z as a,a6 as c}from"./index-CvGsVzTo.js";const g={version:1,jobs:[]};let u=g,i=null,s=0,o=!1;const r=new Set;function w(e,n=null){u=e,i=n,s++;for(const d of r)d()}function J(){return u}function v(){return i}function E(){return s}function y(e){return r.add(e),()=>r.delete(e)}function p(e){return e.status==="queued"||e.status==="running"}function h(e){return!p(e)&&(!e.readAt||Date.parse(e.readAt)<Date.parse(e.updatedAt))}function b(e){return e.filter(h).length}async function t(){try{const e=await fetch("/__editor/generations");w(await l(e,"Generation activity request failed"))}catch(e){i=e instanceof Error?e.message:String(e),s++;for(const n of r)n()}}async function G(){if(!o){o=!0;try{const e=await fetch("/__editor/generations/reconcile",{method:"POST"});a(e,"Generation reconciliation failed"),await t()}finally{o=!1}}}async function _(e){const n=await c(e.poll.tool,e.poll.input);if(!n.ok)throw new Error(n.error.message);if(n.generationWarning)throw new Error(n.generationWarning);return await t(),await f(e.id),n.data}async function S(e){if(!e.accept)throw new Error("This completed generation has no project asset to add.");const n=await c(e.accept.tool,e.accept.input,{confirm:!0});if(!n.ok)throw new Error(n.error.message);if(n.generationWarning)throw new Error(n.generationWarning);await t(),await f(e.id)}async function f(e){const n=await fetch(`/__editor/generations/${encodeURIComponent(e)}/read`,{method:"POST"});a(n,"Mark generation read failed"),await t()}async function T(e){const n=await fetch(`/__editor/generations/${encodeURIComponent(e)}`,{method:"DELETE"});a(n,"Forget generation job failed"),await t()}function A(){t();const e=window.setInterval(()=>void t(),2e3);return()=>{window.clearInterval(e)}}export{b as a,p as b,S as c,v as d,h as e,T as f,J as g,A as h,_ as i,E as j,f as m,G as p,t as r,y as s};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{S as s}from"./three.module-BLhyNg0e.js";import{au as d,dw as u,ff as p,ae as f}from"./three.core-3arARmh6.js";const o="volterIblWorldPosition";function v(){return s.envmap_physical_pars_fragment.replaceAll("getIBLIrradiance","getBaseIBLIrradiance").replaceAll("getIBLRadiance","getBaseIBLRadiance")}function y(e){return(Array.isArray(e.material)?e.material:[e.material]).filter(a=>!!a.isMeshStandardMaterial)}function _(){const e=new d(new Uint8Array(1024),16,16,u,p);return e.mapping=f,e.needsUpdate=!0,e}function I(e,n){const a=e.onBeforeCompile,i=e.customProgramCacheKey;let t=null;return e.onBeforeCompile=(r,c)=>{a.call(e,r,c),l(r.vertexShader,"#include <worldpos_vertex>"),l(r.fragmentShader,"#include <envmap_physical_pars_fragment>"),r.vertexShader=`varying vec3 ${o};
|
|
2
|
-
${r.vertexShader.replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
3
|
-
#if defined(USE_ENVMAP)
|
|
4
|
-
${o} = worldPosition.xyz;
|
|
5
|
-
#endif`)}`,r.fragmentShader=`varying vec3 ${o};
|
|
6
|
-
${r.fragmentShader.replace("#include <envmap_physical_pars_fragment>",n.fragment())}`,t=r,n.onCompile?.(r)},e.customProgramCacheKey=()=>`${i.call(e)}|${n.cacheKey()}`,e.needsUpdate=!0,{material:e,get shader(){return t},restore(){e.onBeforeCompile=a,e.customProgramCacheKey=i,e.needsUpdate=!0,t=null}}}function l(e,n){if(!e.includes(n))throw new Error(`overrideMaterialIbl needs three's ${n} shader chunk, and this material's program no longer contains it.`)}export{o as IBL_WORLD_POSITION,v as baseIblFunctions,_ as createIblSentinelTexture,I as overrideMaterialIbl,y as standardMaterialsOf};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aa as y,O as v,bp as b,bq as R,d5 as S,d6 as E,bs as f}from"./index-CvGsVzTo.js";import{w as k}from"./mounted-authoring-D-tXkNKH.js";import{P as w}from"./pixi-authoring-adapter-lj5CidSR.js";import{createLiveCanvasWriteTarget as A}from"./pixi-live-write-target-BEL9GCCr.js";import{resolveCanvasPixiForEditor as x}from"./canvas-entry-runtime-Cjga4XYp.js";import{C}from"./crash-null-boundary-v3a0uEgw.js";import{a as l}from"./json-history-resource-CckDydoO.js";import{a as I}from"./realm-services-DCnaxwIb.js";import{r as P}from"./react-root-BHA-cdrW.js";import{D as $}from"./dom-authoring-adapter-C3ZsI41l.js";import{w as D,R as M}from"./react-world-authoring-adapter-B6BiehHR.js";import{createPhysics2DRegistry as j}from"./physics-registry-B2Jkp8e6.js";import{createPhysicsAdapter2D as O}from"./system-adapters-rIC8FSGP.js";import{s as z}from"./three-authoring-adapter-BuqO9MDt.js";import{r as h}from"./index-nmcBqr7Y.js";import{r as B}from"./index-CtzuWnCS.js";import{a as F}from"./client-DNXj_opT.js";import{mountModuleRootRuntime as T}from"./module-mode-DcBz3aI7.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./entity-object-BFppZ54X.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./three-contract-Dkt6PmWY.js";import"./index-BlWeDGvp.js";import"./source-persistence-backend-Djuk0m-7.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./component-instance-root-MBgAuUpp.js";import"./pixi-transform-channels-P4rvmusc.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./debug-registry-Dagj3b6J.js";import"./three-ingest-runtime-CwRnwvb0.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./board-guides-whelE-Dr.js";import"./relative-import-specifier-BvzqkvYS.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./writer-tw6EcuVO.js";import"./three-projection-core-BO23VKAP.js";import"./editor-layers-BK3fNRb7.js";import"./three-bdxPiUPb.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BcTFD1ZS.js";import"./capability-coverage-9qm5WVwt.js";import"./game-contract-seams-5IUqvr7b.js";import"./binding-resolver-CBXePHiR.js";import"./native-debug-module-XfhvyMrK.js";import"./native-entry-surface-BE8LJNdu.js";import"./contract-system-adapters-BRHtWOi_.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./index-bQE2NA0D.js";import"./relative-path-guard-GiM7Lsz8.js";function g(t,i,n){t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.zIndex=String(i.zOrder??0),t.style.pointerEvents=n}async function W(t,i,n,s){const r=await I(n,S()),a=await P(t,r),e=document.createElement("div");e.dataset.volterRootSurface="true",g(e,t,"none"),i.appendChild(e);const u=F.createRoot(e);let m=null;if(B.flushSync(()=>{u.render(h.createElement(C,{onCaught:c=>{m=c}},h.createElement(a)))}),m!==null)throw u.unmount(),e.remove(),m instanceof Error?m:new Error(String(m));let o;if(s)if(D(e).nodes.size>0){const p=E("An ingest sibling’s react layer");o=new M(e,s.shell,{...p?{writeBackend:p}:{}})}else o=new $(e,s,{journal:l(t.id)});return{worldId:t.id,...o?{authoring:o}:{},dispose(){u.unmount(),e.remove()}}}async function L(t,i,n,s,r){const a=document.createElement("div");g(a,i,"auto"),n.appendChild(a);try{const e=n.clientWidth||800,u=n.clientHeight||600,{session:m}=await T(t,i,s,a,e,u),o=m.game.roots[0],c=o.mounted.authoring;let p;if(r)if(c)p=k(c,r);else if(o.kind==="three")p=z(r,o.threeScene(),{frameControl:"host",journal:l(i.id)});else if(o.kind==="canvas")if(o.mounted.kind!=="canvas"||o.mounted.substrate.name!=="pixi")p=o.mounted.authoring??f(r.shell,`${i.id} (${o.mounted.kind==="canvas"?o.mounted.substrate.name:"unknown"} authoring unavailable)`);else{const d=O(o.physics2d??j());p=new w(o.canvasRoot(),r,{pixi:await x(),target:A({physics:d}),journal:l(i.id),surface:()=>a})}else p=f(r.shell,`${i.id} (no authoring surface)`);return{worldId:i.id,...p?{authoring:p}:{},setPaused(d){d?m.pause():m.resume()},dispose(){m.stop(),a.remove()}}}catch(e){throw a.remove(),e}}function N(t){throw new Error(`sibling world "${t.id}" (kind: ${t.surface}, adapter identity: "${t.adapter.identity}") has no known composite-sibling mount path — every currently-resolvable identity (three/canvas/dom/module) is routed above; this is reached only for a genuinely unroutable shape.`)}function q(t){return t.adapter.type==="module"||t.adapter.identity==="three"||t.adapter.identity==="canvas"?"scoped-runtime":t.adapter.identity==="dom"?"react-layer":null}async function H(t,i,n,s,r){switch(q(i)){case"scoped-runtime":return L(t,i,n,s,r);case"react-layer":return W(i,n,s,r);default:N(i)}}async function ae(t,i,n,s,r){const a=[];for(const e of y(t))if(e.id!==i)try{a.push(await H(t,e,n,s,r))}catch(u){v.error(`Composite sibling "${e.id}" failed to mount: ${u}`,"ingest"),b({worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:R(u)})}return a}export{ae as mountIngestSiblings,q as siblingMountRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ab as m}from"./index-CvGsVzTo.js";import{b as p,a as e,c as n,s}from"./game-network-BPTyOFqA.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-XfhvyMrK.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dagj3b6J.js";import"./contract-system-adapters-BRHtWOi_.js";import"./game-contract-seams-5IUqvr7b.js";import"./seeded-random-D0QPgfm6.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B7S-wGjC.js";import"./capability-coverage-9qm5WVwt.js";import"./edit-mode-authoring-DubxVdEM.js";import"./json-history-resource-CckDydoO.js";import"./binding-resolver-CBXePHiR.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DCnaxwIb.js";import"./canvas-entry-runtime-Cjga4XYp.js";import"./three-ingest-runtime-CwRnwvb0.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-lrfMBhf9.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CkSAEMH-.js";import"./mounted-authoring-D-tXkNKH.js";import"./entity-object-BFppZ54X.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./three-contract-Dkt6PmWY.js";import"./three-bdxPiUPb.js";import"./editor-layers-BK3fNRb7.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BuqO9MDt.js";import"./source-persistence-backend-Djuk0m-7.js";import"./three-projection-core-BO23VKAP.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BcTFD1ZS.js";import"./deferred-ingest-play-DZiOEH9a.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-B6BiehHR.js";import"./board-guides-whelE-Dr.js";import"./relative-import-specifier-BvzqkvYS.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./writer-tw6EcuVO.js";import"./three-state-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CuJjGYTz.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),Bt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{Bt as commands,zt as point};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{stackOrder as D}from"./root-stacking-BEd9ZvxC.js";import{ax as O,aA as g,aB as S,aC as b,aD as y,x as z,aE as E}from"./index-CvGsVzTo.js";function m(d,o,r,c){const e=d.pickable?.pick(o,r)??null;return e?d.selection?.resolve?.(e,{intent:c,scopeId:y()})?.id??e:null}function C(d,o,r,c,e=!1){const a=d.pickable?.candidates?.(o,r,e?{includeLocked:e}:void 0)??[],s=[],l=new Set;for(const f of a){const i=d.selection?.resolve?.(f,{intent:c,scopeId:y()})?.id??f;l.has(i)||(l.add(i),s.push(i))}return s}function N(d,o,r,c={}){const e=c.intent??"normal",a=O(d);if(!(a instanceof g))return m(a,o,r,e);const s=a.childAdapters(),f=z()===E?[]:s.filter(n=>n.kind!=="three"),i=s.filter(n=>n.kind==="three"),h=f.map(n=>({id:n.worldId,zOrder:n.zOrder,worldId:n.worldId,adapter:n.adapter})),v=[...D(h).reverse(),...i];for(const{worldId:n,adapter:k}of v){if(S(n)||b(n))continue;const u=m(k,o,r,e);if(u)return u}return null}function P(d,o,r,c={}){const e=c.intent??"normal",a=c.includeLocked===!0,s=c.adapter??O(d);if(!(s instanceof g)){const t=C(s,o,r,e,a),p=m(s,o,r,e);return t.length>0?t:p?[p]:[]}const l=s.childAdapters(),i=z()===E?[]:l.filter(t=>t.kind!=="three"),h=l.filter(t=>t.kind==="three"),v=i.map(t=>({id:t.worldId,zOrder:t.zOrder,worldId:t.worldId,adapter:t.adapter})),n=[...D(v).reverse(),...h],k=[],u=new Set;for(const{worldId:t,adapter:p}of n){if(S(t)||b(t))continue;const I=C(p,o,r,e,a),w=m(p,o,r,e);for(const A of I.length>0?I:w?[w]:[])u.has(A)||(u.add(A),k.push(A))}return k}export{N as a,P as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as l,d as c}from"./capability-coverage-9qm5WVwt.js";import{aw as a,Y as u}from"./index-CvGsVzTo.js";function d(e,t){return{slot:e,state:"unanswered",evidence:`nobody has read this project's own files yet, so ${e} is unmeasured — `+(t??"the editor has not asked its dev server for them")}}function p(e){return e.length>0&&e.every(t=>t.type==="ingest")}function h(e){const{scripts:t,roots:n}=e;return t===null||n===null?d("export",e.unavailable):t.includes("build")?{slot:"export",state:"present",evidence:`this project declares a \`build\` script, which is what the export path runs to emit the \`dist/\` it stages${p(n)?"; this ingest project ships the standalone bundle produced by its own build unchanged":""}`}:{slot:"export",state:"absent",evidence:e.hasPackageJson?"this project's package.json declares no `build` script, and the export path runs `npm run build` in the project and stages the `dist/` it emits":"this project has no package.json, so there is no `build` script for the export path to run",missing:"this project cannot produce a standalone build, so it runs NOWHERE but the editor — the dev-served standalone page refuses an unexported game outright",fix:"add the scaffold's `build` script (`build: tsc && vite build`), which is what the export path runs"}}function f(e){const t={export:h};return l.map(n=>t[n](e))}let r=null,i=null,o=null;function m(){r=null,i=null,o=null}async function b(e,t=fetch){return r&&o===e?r:(i&&o===e||(o=e,r=null,i=(async()=>{let n;try{const s=await t("/__editor/project-verbs");n=await u(s,"project-verbs did not answer")}catch(s){n={scripts:null,hasPackageJson:!1,dependencies:null,roots:null,unavailable:`the editor could not reach its dev server to read this project's own files (${s instanceof Error?s.message:String(s)})`}}return r=n,n})()),i)}function w(){const e=a();return e?(o===e.rootPath?r:null)?.dependencies??null:null}function g(){const e=a();if(!e)return null;b(e.rootPath);const t=o===e.rootPath?r:null;return{scripts:t?.scripts??null,hasPackageJson:t?.hasPackageJson??!1,roots:t?.roots??null,unavailable:t?.unavailable??(t?null:"the editor has not finished reading this project’s own files yet")}}function x(){const e=g();if(!e)return null;const t=a();return c({worldId:t?.config.name??"project",projectVerbs:f(e)})}export{x as a,g as b,m as i,w as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,bA as e,v as i,e1 as o,bz as a,by as s}from"./index-CvGsVzTo.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 n=t({type:s(["standard","physical","basic","toon"]).describe("Material shading model"),color:i().optional().describe('Base color as CSS hex string (e.g. "#ff0000")'),metalness:e().optional().describe("Metalness factor 0–1 (standard/physical only)"),roughness:e().optional().describe("Roughness factor 0–1 (standard/physical only)"),map:i().optional().describe("Path to albedo/diffuse texture image"),normalMap:i().optional().describe("Path to normal map texture image"),emissive:i().optional().describe("Emissive color as CSS hex string"),emissiveIntensity:e().optional().describe("Emissive light intensity multiplier"),emissiveMap:i().optional().describe("Path to emissive map texture image"),aoMap:i().optional().describe("Path to ambient occlusion map texture image"),lightMap:i().optional().describe("Path to a baked lightmap texture (uses the mesh's second UV set). Applies the pre-baked GI/shadow result on top of the material."),lightMapIntensity:e().optional().describe("Lightmap intensity multiplier (default 1)."),roughnessMap:i().optional().describe("Path to roughness map texture image"),metalnessMap:i().optional().describe("Path to metalness map texture image"),opacity:e().optional().describe("Opacity 0–1. Set transparent: true to enable"),transparent:a().optional().describe("Enable alpha blending for this material"),side:s(["front","back","double"]).optional().describe("Which face sides to render"),flatShading:a().optional().describe("Use flat (faceted) shading instead of smooth"),clearcoat:t({clearcoat:e().describe("Clearcoat layer intensity 0–1"),clearcoatRoughness:e().optional().describe("Clearcoat roughness 0–1"),clearcoatMap:i().optional().describe("Path to clearcoat intensity map"),clearcoatRoughnessMap:i().optional().describe("Path to clearcoat roughness map")}).optional().describe("Clearcoat layer (physical only)"),transmission:t({transmission:e().describe("Transmission intensity 0–1 (glass, liquid)"),ior:e().optional().describe("Index of refraction (default 1.5)"),thickness:e().optional().describe("Volume thickness for refraction"),attenuationColor:i().optional().describe("Color absorbed over distance"),attenuationDistance:e().optional().describe("Distance at which attenuation color takes full effect"),transmissionMap:i().optional().describe("Path to transmission map")}).optional().describe("Light transmission (physical only)"),sheen:t({sheen:e().describe("Sheen intensity 0–1 (fabric, velvet)"),sheenColor:i().optional().describe("Sheen tint color"),sheenRoughness:e().optional().describe("Sheen roughness 0–1"),sheenColorMap:i().optional().describe("Path to sheen color map"),sheenRoughnessMap:i().optional().describe("Path to sheen roughness map")}).optional().describe("Sheen layer (physical only)"),iridescence:t({iridescence:e().describe("Iridescence intensity 0–1 (soap bubbles, oil slick)"),iridescenceIOR:e().optional().describe("Thin-film IOR (default 1.3)"),iridescenceThicknessRange:o([e(),e()]).optional().describe("Min/max thin-film thickness in nm"),iridescenceMap:i().optional().describe("Path to iridescence intensity map"),iridescenceThicknessMap:i().optional().describe("Path to iridescence thickness map")}).optional().describe("Iridescence thin-film (physical only)"),displacementMap:i().optional().describe("Path to displacement/height map"),displacementScale:e().optional().describe("Displacement height multiplier"),displacementBias:e().optional().describe("Displacement offset")}).strict(),g=n.describe("Material appearance properties");export{g as MaterialDescriptorSchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as t}from"./game-network-BPTyOFqA.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CvGsVzTo.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-XfhvyMrK.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dagj3b6J.js";import"./contract-system-adapters-BRHtWOi_.js";import"./game-contract-seams-5IUqvr7b.js";import"./seeded-random-D0QPgfm6.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B7S-wGjC.js";import"./capability-coverage-9qm5WVwt.js";import"./edit-mode-authoring-DubxVdEM.js";import"./json-history-resource-CckDydoO.js";import"./binding-resolver-CBXePHiR.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DCnaxwIb.js";import"./canvas-entry-runtime-Cjga4XYp.js";import"./three-ingest-runtime-CwRnwvb0.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-lrfMBhf9.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CkSAEMH-.js";import"./mounted-authoring-D-tXkNKH.js";import"./entity-object-BFppZ54X.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./three-contract-Dkt6PmWY.js";import"./three-bdxPiUPb.js";import"./editor-layers-BK3fNRb7.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BuqO9MDt.js";import"./source-persistence-backend-Djuk0m-7.js";import"./three-projection-core-BO23VKAP.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BcTFD1ZS.js";import"./deferred-ingest-play-DZiOEH9a.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-B6BiehHR.js";import"./board-guides-whelE-Dr.js";import"./relative-import-specifier-BvzqkvYS.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./writer-tw6EcuVO.js";import"./three-state-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CuJjGYTz.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.service";function At(){t()}export{zt as point,At as start};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-BHuuMZnS.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-CvGsVzTo.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-CPiRKiDC.css","assets/asset-preview-B7j9QV6N.js","assets/editor-layers-BK3fNRb7.js","assets/workspace-arrangement-C9uemwSK.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-Pb6wnNcu.js","assets/studio-environment-DK0ke0m0.js","assets/user-data-DfBtZvxw.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.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/model-inspection-Dd-hn5v2.js","assets/viewport-door-CuJjGYTz.js","assets/ViewportShadingMenu-CrTY7tnk.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aF as f,aG as p,aH as l,aI as m,aJ as D,_ as g}from"./index-CvGsVzTo.js";import{r as b}from"./index-nmcBqr7Y.js";const v=b.lazy(()=>g(()=>import("./Object3DDocumentToolbar-BHuuMZnS.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])).then(e=>({default:e.Object3DDocumentToolbar}))),o=new Map,a=new Map;let s=0;const c=new Set;function i(){s++;for(const e of c)e()}function O(e,t={}){o.set(e.documentId,e);const r=f(e),n=p(e.documentId,{...w(e),...t});return i(),()=>{n(),r(),o.get(e.documentId)===e&&(o.delete(e.documentId),i())}}const d=([e,t,r])=>({x:e,y:t,z:r});function w(e){return{read:()=>{const t=e.cameraPose(),r=e.presentation();return{camera:{position:d(t.position),target:d(t.target),...t.fov?{fov:t.fov}:{}},diagnostic:r.skeleton?"skeleton":r.mode,grid:D(e.documentId)}},setDiagnostic:t=>{if(t==="preview"||t==="rendered"){const r=l(e.documentId)?.stageKind;if(!r||m(r)?.modes?.[t]?.lighting===void 0)return!1}return e.setSkeleton(t==="skeleton"),e.setBounds(t==="bounds"),e.setMode(t==="skeleton"||t==="bounds"?"solid":t),!0},setCamera:t=>(typeof t!="string"?e.setCameraPose(t.position,t.target,t.fov):t==="perspective"?(e.setProjection("perspective"),e.frame()):e.setViewPreset(t),!0),frame:t=>t==="selection"?e.frameSelection():(e.frame(),!0),selection:{read:()=>e.selection(),apply:t=>e.select(t)},idsNamed:t=>{const r=[];return e.root.traverse(n=>{if(n.name!==t)return;const u=e.idForObject(n);u&&r.push(u)}),r},setTransformMode:t=>e.viewport.setTransformMode(t),capture:t=>e.captureImage(t??512),prepare:()=>S(e.documentId),HeaderControls:v}}function P(e){return o.get(e)??null}function I(e,t){return a.set(e,t),()=>{a.get(e)===t&&a.delete(e)}}async function S(e){await a.get(e)?.()}function V(){return[...o.values()]}function _(e){return c.add(e),()=>c.delete(e)}function k(){return s}export{P as a,V as b,O as c,k as o,I as r,_ as s};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CvGsVzTo.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/gameplay-export-CRnHCUBb.js","assets/output-DK8waum9.js","assets/game-network-BPTyOFqA.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/native-debug-module-XfhvyMrK.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-Dagj3b6J.js","assets/contract-system-adapters-BRHtWOi_.js","assets/game-contract-seams-5IUqvr7b.js","assets/seeded-random-D0QPgfm6.js","assets/game-audio-BeCyd0Ha.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/index-bQE2NA0D.js","assets/live-project-verbs-B7S-wGjC.js","assets/capability-coverage-9qm5WVwt.js","assets/edit-mode-authoring-DubxVdEM.js","assets/json-history-resource-CckDydoO.js","assets/binding-resolver-CBXePHiR.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-DCnaxwIb.js","assets/canvas-entry-runtime-Cjga4XYp.js","assets/three-ingest-runtime-CwRnwvb0.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/active-ingest-lrfMBhf9.js","assets/ingest-source-persistence-CPlDA2D8.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-CkSAEMH-.js","assets/mounted-authoring-D-tXkNKH.js","assets/entity-object-BFppZ54X.js","assets/user-data-DfBtZvxw.js","assets/workspace-arrangement-C9uemwSK.js","assets/three-contract-Dkt6PmWY.js","assets/three-bdxPiUPb.js","assets/editor-layers-BK3fNRb7.js","assets/component-instance-root-MBgAuUpp.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-BuqO9MDt.js","assets/source-persistence-backend-Djuk0m-7.js","assets/three-projection-core-BO23VKAP.js","assets/body-marks-C1LxJtQb.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/r3f-physics-binding-BcTFD1ZS.js","assets/deferred-ingest-play-DZiOEH9a.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-B6BiehHR.js","assets/board-guides-whelE-Dr.js","assets/relative-import-specifier-BvzqkvYS.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-DxfAFkho.js","assets/inference-diagnostics-BCwXk-CS.js","assets/writer-tw6EcuVO.js","assets/three-state-BhQOBgKC.js","assets/editor-shell-store-Bro0arjr.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-CuJjGYTz.js","assets/game-surface-defaults-D8S4cRxi.js","assets/editor-api-CPh65aBN.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as y,ac as g,_ as f,ad as R,a5 as w}from"./index-CvGsVzTo.js";import{d as D,n as F,f as A,h as M,j as O,e as T,k as $,g as L,l as N,p as W}from"./game-network-BPTyOFqA.js";import{r as q}from"./index-CtzuWnCS.js";import{n as z,s as k}from"./command-results-CUQD49AB.js";import{s as H,a as j}from"./run-selection-BMQWV9Fn.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-XfhvyMrK.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dagj3b6J.js";import"./contract-system-adapters-BRHtWOi_.js";import"./game-contract-seams-5IUqvr7b.js";import"./seeded-random-D0QPgfm6.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B7S-wGjC.js";import"./capability-coverage-9qm5WVwt.js";import"./edit-mode-authoring-DubxVdEM.js";import"./json-history-resource-CckDydoO.js";import"./binding-resolver-CBXePHiR.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DCnaxwIb.js";import"./canvas-entry-runtime-Cjga4XYp.js";import"./three-ingest-runtime-CwRnwvb0.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-lrfMBhf9.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CkSAEMH-.js";import"./mounted-authoring-D-tXkNKH.js";import"./entity-object-BFppZ54X.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./three-contract-Dkt6PmWY.js";import"./three-bdxPiUPb.js";import"./editor-layers-BK3fNRb7.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BuqO9MDt.js";import"./source-persistence-backend-Djuk0m-7.js";import"./three-projection-core-BO23VKAP.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BcTFD1ZS.js";import"./deferred-ingest-play-DZiOEH9a.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-B6BiehHR.js";import"./board-guides-whelE-Dr.js";import"./relative-import-specifier-BvzqkvYS.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./writer-tw6EcuVO.js";import"./three-state-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CuJjGYTz.js";import"./game-surface-defaults-D8S4cRxi.js";import"./configurations-BcYOQ7i-.js";const kt="workspace.command";async function x(e){const{liveCanvasFrame:t}=await f(async()=>{const{liveCanvasFrame:r}=await import("./index-CvGsVzTo.js").then(o=>o.tZ);return{liveCanvasFrame:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t(e)}function Z(){const e=L();e?.loop.liveness==="loop-starved"&&e.runTicks?.(1,{render:"last"})}function B(){const e=w().audio,t=e?.renderOffline;if(!e||!t)return;let r=null;try{const o=w().debug?.state("time");typeof o?.simSeconds=="number"&&Number.isFinite(o.simSeconds)&&(r=o.simSeconds)}catch{r=null}if(r!==null)return{startSeconds:r,render:t.bind(e)}}let d=null;const xt={play:{timeoutMs:12e4,derivedRefresh:"always",handle:async e=>{try{const o=e.seed,l=e.name,m=await j();if(!m.ok)return{ok:!1,error:`${m.title}: ${m.detail}`};await T(typeof o=="number"?o:void 0,void 0,typeof l=="string"?l:null)}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}if(!y().live.playing())return{ok:!1,error:"Play did not start: the run was superseded before it finished booting (a stop, or a newer play, landed during startup). Nothing is running."};const t=e.record,r=await $(g()??y().workspace.liveDocument.container(),{name:typeof t=="string"?t:null,audio:w().audio?.acquireRecordingStream?.()??null,canvasFrame:x,refreshFrame:Z});return{ok:!0,...r?{data:{recording:r}}:{}}}},stop:{timeoutMs:3e4,derivedRefresh:"always",handle:async()=>{d?.abort(new Error("Video export cancelled by Stop."));const e=await M("stop");return O(),await H(),{ok:!0,...e?{data:{recording:e}}:{}}}},pause:{derivedRefresh:"always",handle:()=>(W(),{ok:!0})},resume:{derivedRefresh:"always",handle:()=>(N(),{ok:!0})},step:{derivedRefresh:"always",handle:()=>(A(),{ok:!0})},"bridge-recording-export":{timeoutMs:6e5,derivedRefresh:"none",handle:async e=>{const t=y();if(t.session.playState()!=="paused")return{ok:!1,error:"Pause the game before exporting video."};const r=g();if(!r)return z();if(d)return{ok:!1,error:"A video export is already active."};const{exportGameplayVideo:o,validateGameplayExport:l,assertGameplayVideoSupport:m}=await f(async()=>{const{exportGameplayVideo:n,validateGameplayExport:u,assertGameplayVideoSupport:s}=await import("./gameplay-export-CRnHCUBb.js");return{exportGameplayVideo:n,validateGameplayExport:u,assertGameplayVideoSupport:s}},__vite__mapDeps([10,0,1,2,3,4,5,6,7,8,9,11])),h={frames:Number(e.frames),fps:e.fps===void 0?30:Number(e.fps)};try{l(h)}catch(n){return k(n)}if(d)return{ok:!1,error:"A video export is already active."};const i=new AbortController;d=i,R(!0);const S=setTimeout(()=>i.abort(new Error("Video export exceeded its ten-minute deadline.")),59e4),v=t.live.runWindow()?.startedAt??null,_=t.session.subscribe(()=>{(t.session.playState()!=="paused"||(t.live.runWindow()?.startedAt??null)!==v)&&i.abort(new Error("Video export cancelled: the Play session changed."))}),b=B();try{await m(r),i.signal.throwIfAborted();const{gameplayRecordingActive:n}=await f(async()=>{const{gameplayRecordingActive:a}=await import("./game-network-BPTyOFqA.js").then(p=>p.a3);return{gameplayRecordingActive:a}},__vite__mapDeps([12,13,14,2,0,1,3,4,5,6,7,8,9,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82]));n()&&await D();const{blob:u,...s}=await o(r,h,{step:()=>q.flushSync(()=>A()),assertActive:()=>{if(F(),t.session.playState()!=="paused"||g()!==r||(t.live.runWindow()?.startedAt??null)!==v)throw new Error("Video export interrupted: its game must remain paused and mounted.")},canvasFrame:x,signal:i.signal,...b?{audio:b}:{}}),{beginGameplayRecordingSink:E,appendGameplayRecordingChunk:P,finishGameplayRecordingSink:G,abortGameplayRecordingSink:V}=await f(async()=>{const{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:p,finishGameplayRecordingSink:I,abortGameplayRecordingSink:C}=await import("./editor-api-CPh65aBN.js");return{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:p,finishGameplayRecordingSink:I,abortGameplayRecordingSink:C}},__vite__mapDeps([83,0,1,2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82]));i.signal.throwIfAborted();const c=await E({startedAt:new Date().toISOString(),mimeType:"video/webm",purpose:"export",name:typeof e.name=="string"?e.name:`export-${Date.now()}`},i.signal);try{for(let a=0,p=0;a<u.size;a+=4*1024*1024,p++)i.signal.throwIfAborted(),await P(c,p,u.slice(a,a+4*1024*1024),i.signal);i.signal.throwIfAborted(),await G(c,s.audio?`fixed-step export with audio (${s.audio.codec}, ${s.audio.channels}ch @ ${s.audio.sampleRate} Hz)`:"fixed-step export, video only: this world has no AudioAdapter.renderOffline",i.signal),i.signal.throwIfAborted()}catch(a){throw await V(c),a}return{ok:!0,data:{...s,path:c.path}}}catch(n){return k(n)}finally{_(),clearTimeout(S),d=null,R(!1)}}}};export{xt as commands,kt as point};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-source-authoring-adapter-DVnhzoxp.js","assets/component-instance-root-MBgAuUpp.js","assets/user-data-DfBtZvxw.js","assets/workspace-arrangement-C9uemwSK.js","assets/index-CvGsVzTo.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/live-gesture-lock-DJbrjOqf.js","assets/relative-import-specifier-BvzqkvYS.js","assets/three-projection-core-BO23VKAP.js","assets/editor-layers-BK3fNRb7.js","assets/three-bdxPiUPb.js","assets/entity-object-BFppZ54X.js","assets/three-contract-Dkt6PmWY.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three.core-3arARmh6.js","assets/inference-diagnostics-BCwXk-CS.js","assets/instance-fork-actions-D3sRzS3K.js","assets/oid-transform-Bgdv7kST.js","assets/writer-tw6EcuVO.js","assets/r3f-physics-binding-BcTFD1ZS.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/three.module-BLhyNg0e.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{gm as Me,aa as Ae,gV as Ce,_ as Ee,g8 as Pe,O as T,p as ce,ds as pe,jw as xe,d7 as de,jx as Fe,jy as Ie,bq as je,jz as De,jA as Be,jB as He,bp as Le,aw as Ve,bu as ue,d5 as Oe,hc as Ge}from"./index-CvGsVzTo.js";import{p as _e,B as fe,q as ye}from"./edit-mode-authoring-DubxVdEM.js";import{F as ze,G as We,H as qe}from"./game-network-BPTyOFqA.js";import{a as Ue}from"./binding-resolver-CBXePHiR.js";import{a as Ne}from"./realm-services-DCnaxwIb.js";import{p as Qe}from"./scene-framing-nVyYC4Y-.js";import{i as Je,b as Ke,n as Xe,a as Ze}from"./native-debug-module-XfhvyMrK.js";import{createAssetCache as Ye}from"./assets-BcrMQHRv.js";import{d as ke,a as et,b as tt}from"./create-runtime-B6u6x5eK.js";import{T as st}from"./three.module-BLhyNg0e.js";import{_ as me,fp as ee,el as ot}from"./three.core-3arARmh6.js";import{w as rt,l as nt}from"./live-gesture-lock-DJbrjOqf.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./seeded-random-D0QPgfm6.js";import"./debug-registry-Dagj3b6J.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B7S-wGjC.js";import"./capability-coverage-9qm5WVwt.js";import"./game-contract-seams-5IUqvr7b.js";import"./json-history-resource-CckDydoO.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-lrfMBhf9.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./contract-system-adapters-BRHtWOi_.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CkSAEMH-.js";import"./mounted-authoring-D-tXkNKH.js";import"./entity-object-BFppZ54X.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./three-contract-Dkt6PmWY.js";import"./three-bdxPiUPb.js";import"./editor-layers-BK3fNRb7.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./adapter-surface-Y37Nzcyw.js";import"./three-authoring-adapter-BuqO9MDt.js";import"./source-persistence-backend-Djuk0m-7.js";import"./three-projection-core-BO23VKAP.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BcTFD1ZS.js";import"./deferred-ingest-play-DZiOEH9a.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-B6BiehHR.js";import"./board-guides-whelE-Dr.js";import"./relative-import-specifier-BvzqkvYS.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./writer-tw6EcuVO.js";import"./three-state-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./viewport-door-CuJjGYTz.js";import"./game-surface-defaults-D8S4cRxi.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./canvas-entry-runtime-Cjga4XYp.js";import"./three-ingest-runtime-CwRnwvb0.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./CSS3DRenderer-BsAqfavI.js";import"./native-entry-surface-BE8LJNdu.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./binding-Bmxqznjk.js";import"./root-stacking-BEd9ZvxC.js";import"./setup-renderer-ji8Qt-PP.js";import"./index-DHhMOs_s.js";import"./defaults-DKiBJCPN.js";import"./render-settings-BPcHd4LA.js";import"./render-features-DFwHsGxu.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./performance-profiler-CMbwGBuk.js";function it(t,e){const i=()=>{},a=new Set(["dispose","forceContextLoss","forceContextRestore","setAnimationLoop","setSize","setPixelRatio","setDrawingBufferSize"]),u=new Map,v={...e.shadowMap};let R=e.xr.enabled;const b=e.getClearColor(new me);let C=e.getClearAlpha(),M=null,V=0,O=0;const d=e.getViewport(new ee),h=e.getScissor(new ee);let P=e.getScissorTest(),y=!1,x=!1,F=!1;const G=(c,s,o,n,w)=>{typeof s=="number"?c.set(s,o,n,w):c.copy(s)},B=new Proxy(e.xr,{get(c,s){if(s==="enabled")return R;if(s==="setAnimationLoop"||s==="addEventListener"||s==="removeEventListener")return i;const o=Reflect.get(c,s,c);return typeof o=="function"?o.bind(c):o},set(c,s,o){return s==="enabled"?(R=o,!0):Reflect.set(c,s,o,c)}}),q=new Proxy(e.renderLists,{get(c,s){if(s==="dispose")return i;const o=Reflect.get(c,s,c);return typeof o=="function"?o.bind(c):o}});function _(c,s){const o=new Map,n={...e.shadowMap},w=e.xr.enabled,$=e.getClearColor(new me),I=e.getClearAlpha(),J=e.getRenderTarget(),K=e.getActiveCubeFace(),W=e.getActiveMipmapLevel(),U=e.getViewport(new ee),te=e.getScissor(new ee),X=e.getScissorTest();try{for(const[j,N]of u)o.set(j,Reflect.get(e,j)),Reflect.set(e,j,N);return Object.assign(e.shadowMap,v),e.xr.enabled=R,e.setClearColor(b,C),e.setViewport(d),e.setScissor(h),e.setScissorTest(P),e.setRenderTarget(M,V,O),y&&e.setViewport(d),x&&e.setScissor(h),F&&e.setScissorTest(P),c.apply(e,s)}finally{for(const[j,N]of o)Reflect.set(e,j,N);Object.assign(e.shadowMap,n),e.xr.enabled=w,e.setClearColor($,I),e.setViewport(U),e.setScissor(te),e.setScissorTest(X),e.setRenderTarget(J,K,W)}}const z=new Map;return new Proxy(e,{get(c,s){if(s==="domElement")return t;if(s==="shadowMap")return v;if(s==="xr")return B;if(s==="renderLists")return q;if(a.has(s))return i;if(s==="getRenderTarget")return()=>M;if(s==="getActiveCubeFace")return()=>V;if(s==="getActiveMipmapLevel")return()=>O;if(s==="setRenderTarget")return(n,w=0,$=0)=>{M=n,V=w,O=$,y=x=F=!1};if(s==="getViewport")return n=>n.copy(d);if(s==="getCurrentViewport")return n=>M&&!y?n.copy(M.viewport):(n.copy(d).multiplyScalar(e.getPixelRatio()),y?n.round():n.floor());if(s==="getScissor")return n=>n.copy(h);if(s==="getScissorTest")return()=>P;if(s==="setViewport")return(n,w,$,I)=>{G(d,n,w,$,I),y=!0};if(s==="setScissor")return(n,w,$,I)=>{G(h,n,w,$,I),x=!0};if(s==="setScissorTest")return n=>{P=n,F=!0};if(s==="getClearColor")return n=>n.copy(b);if(s==="getClearAlpha")return()=>C;if(s==="setClearColor")return(n,w=C)=>{b.set(n),C=w};if(s==="setClearAlpha")return n=>{C=n};if(u.has(s))return u.get(s);const o=Reflect.get(c,s,c);if(typeof o!="function")return o;if(!z.has(s)){const n=/^(render|compile|clear|copy|init|readRenderTarget)/.test(String(s));z.set(s,n?(...w)=>{if(!((s==="render"||String(s).startsWith("clear"))&&!M))return _(o,w)}:o.bind(c))}return z.get(s)},set(c,s,o){return s!=="domElement"&&u.set(s,o),!0}})}class at{pending=new WeakMap;remember(e,i){const a=[...i];a.length===0?this.pending.delete(e):this.pending.set(e,a)}take(e,i){const a=[...i],u=this.pending.get(e)??[];return this.pending.delete(e),a.length>0?a:u}}function he(t){return decodeURIComponent(t.split("?")[0]).replace(/^\/@fs\/(?=[A-Za-z]:\/)/,"").replace(/^\/@fs/,"")}class lt{sources=new Map;applied=new Map;expected=new Map;missingRevision=!1;source(e){this.sources.set(e.file,e)}complete(e){for(const[i,a]of this.sources){const u=e.filter(R=>a.timestamp===R.timestamp);(a.boundaries?a.boundaries.every(R=>u.some(b=>b.acceptedPath===R)):u.some(R=>he(R.acceptedPath)===i))&&(this.applied.set(a.path,a.sha),this.sources.delete(i))}}matches(e){const i=he(e.acceptedPath);return[...this.sources.values()].some(a=>a.timestamp===e.timestamp&&(a.boundaries?a.boundaries.includes(e.acceptedPath):a.file===i))}revision(e){for(const i of e)this.expected.set(i.path,i.sha),i.sha===null&&this.applied.delete(i.path)}needsRemount(){if(this.missingRevision)return!0;for(const[e,i]of this.expected)if(i===null||this.applied.get(e)!==i)return!0;return!1}missing(){this.missingRevision=!0}mounted(){this.expected.clear(),this.applied.clear(),this.sources.clear(),this.missingRevision=!1}}function ct(t){return t instanceof ot||t!==null&&typeof t=="object"&&t.isScene===!0}function pt(t){return t.find(e=>e.surface==="three")?.id??null}const ge=new at;function dt(t,e,i){return new Error(`three root "${t}" failed to mount: ${e} did not export a RootAdapter or a default React component (exports: ${i.join(", ")||"(nothing)"}).`)}function ut(t,e){const i=je(e);T.error(`[r3f-design] world "${t}" failed to mount: ${i}`,"authoring");const a=De(i);return a&&Be(a).then(u=>T.error(`[r3f-design] world "${t}": ${He(u)}`,"authoring")),Le({worldId:t,kind:"three",identity:"default-three",message:i}),i}async function ft(t,e,i,a){const u=await t.loadEntryModule(i,e,"three"),v=a===i?u:await t.loadEntryModule(a,e,"three");return{designModule:u,rootModule:v}}function mt(t,e,i,a,u,v){ke(t,e,i,{id:a}),Je(t,u?[u]:[]),Ke(t,We(t,v?[v]:[]))}function ht(t){const e=document.createElement("canvas"),i=it(e,t),a=Ye(),u=et({loop:tt({update:()=>{}}),assets:a});return{game:u,host:{three:st,surface:{canvas:e,width:1280,height:720},renderer:i,assets:a,headless:!1,game:u},dispose:()=>u.dispose()}}function we(t){return{id:t.id,kind:t.surface,adapter:t.adapter,entryOrScenePath:t.entry??t.scene,zOrder:t.zOrder??0,pausable:t.pausable??!0}}function ne(t){let e=!1,i=!1;const a=()=>{e||i||t.shell.playState!=="stopped"||(i=!0,ye())},u=t.shell.subscribe(a);return a(),()=>{e=!0,u()}}async function ao(t,e,i){const a=Ve();if(!a)return()=>{};const u=await Me();if(t.shell.playState!=="stopped")return ne(t);const v=_e(u);if(!v)return()=>{};const R=pt(Ae(v)),b=R?Ce(v,R):void 0;if(!b)return()=>{};const C=b.world?.entry??b.entry,M=b.world?.export;if(!C||!/\.(tsx|jsx)$/.test(C))return()=>{};const V=Ee(()=>import("./r3f-source-authoring-adapter-DVnhzoxp.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])),O=Pe();let d=!1,h=!1,P=null,y=null,x=!1,F=null,G=!1,B=!1,q,_,z,c=null,s=null;const o=b.id,n=C,w=()=>{s||!c||d||h||t.shell.playState!=="stopped"||(s=c.systemAdapters,ue(s))},$=()=>{s&&(s=null,ue(null))},I=async()=>{const r=await Ne(a.rootPath,Oe()),{designModule:p,rootModule:f}=await ft(r,o,n,b.entry??n),l=Xe(o,f),m=Ze(o,f,"three"),g=await Ue(p,o,{...M===void 0?{}:{namedExport:M},entryPath:n});if(!g)throw dt(o,n,Object.keys(p));return M!==void 0?{adapter:g,entryDebug:l,entrySystems:m}:{adapter:g,entryDebug:l,entrySystems:m,components:p.components??p.behaviors}},J=async(r,p,f)=>{const{host:l,game:m,dispose:g}=ht(i);let S;try{S=await r.mount(l)}catch(Y){throw g(),Y}if(S.kind!=="three"||!ct(S.scene))throw S.dispose(),g(),new Error(`entry adapter for world "${o}" did not mount a three scene`);return mt(m,r,S,o,p,f),{root:S,game:m,disposeHost:g}},K=r=>{P=r.root,c=r.game,_?.();const p=r.game;_=p.subscribeSystemAdapters?.(()=>{if(c!==p)return;const f=p.systemAdapters;s&&(s=f,Ge(f)),t.shell.notifyIngestEdit()}),q=r.disposeHost},W=()=>{$(),_?.(),_=void 0,c=null;try{P?.dispose()}catch(r){T.error(`[r3f-design] dispose failed: ${r}`,"authoring")}P=null;try{q?.()}catch(r){T.error(`[r3f-design] design host dispose failed: ${r}`,"authoring")}q=void 0},U=()=>{if(!x)return;x=!1;const r=F;F=null,r?t.releaseAdoptedScene(r):t.exitPlayScene()},te=()=>{h=!0,U(),W(),e.replaceChild(o,new fe(t.shell,we(b),"R3F design session suspended by play mode — Stop restores it.")),t.shell.notifyIngestEdit()},X=r=>{const p=ut(o,r);e.replaceChild(o,new fe(t.shell,we(b),p)),t.shell.notifyIngestEdit()},j=setTimeout(()=>{T.warn(`[r3f-design] world "${o}" is still importing after 20s (${n}). The in-browser compiler or a module download may be stalled on a slow connection — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4);try{const[r,{R3fSourceAuthoringAdapter:p},f]=await Promise.all([I(),V,O]);if(clearTimeout(j),!r)return T.warn(`[r3f-design] world "${o}" produced no design entry (${n}) — the scene stays empty. This is a bug worth reporting; reload the tab to retry.`,"authoring"),()=>{};if(d)return()=>{};if(t.shell.playState!=="stopped")return ne(t);const l=await J(r.adapter,r.entryDebug,r.entrySystems);if(K(l),d||t.shell.playState!=="stopped")return W(),d?()=>{}:ne(t);y=new p(t,l.root.scene,{worldId:o,entryPath:n,writeBackend:f,physics:()=>ce(c?.systemAdapters.physics)}),e.replaceChild(o,y),ze(l.root.scene).then(S=>{S&&!d&&t.shell.notifyIngestEdit()});const m=ge.take(t,t.shell.selectedEntityIds);t.enterPlayScene(l.root.scene,l.root.rendererConfig),x=!0,F=l.root.scene,t.focusOnScene(()=>Qe(null,l.root.scene));const g=m.filter(S=>e.hierarchy.node(S)!==null);g.length>0&&t.shell.selectMultiple(g),pe(o),w(),t.shell.notifyIngestEdit(),T.log(`[r3f-design] world "${o}" mounted for design-time authoring (${n})`,"authoring")}catch(r){clearTimeout(j),X(r)}const N=(r,p,f,l,m)=>{const g=performance.now()-p;g<400||console.info(`[r3f-design] world "${r}" remounted in ${g.toFixed(0)}ms (import ${(f-p).toFixed(0)}ms, mount ${(l-f).toFixed(0)}ms, settle ${(m-l).toFixed(0)}ms, adopt ${(performance.now()-m).toFixed(0)}ms)`)},be=async()=>{if(d||h)return;const r=[...t.shell.selectedEntityIds],p=H,f=t.shell.projectHistory?.getSnapshot().busy===!0;let l="importing";const m=setTimeout(()=>{T.warn(`[r3f-design] world "${o}" remount is still ${l} after 20s (${n}) — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4),g=performance.now();let S=g,Y=g,ae=g;try{const D=await I();if(S=performance.now(),!D||d||h){console.info(`[r3f-design] world "${o}" remount abandoned after import (${D?d?"torn down":"suspended":"no entry"})`);return}l="mounting";const A=await J(D.adapter,D.entryDebug,D.entrySystems);Y=performance.now();for(let E=0;E<50&&(await rt(),await Se(),!(!nt()&&t.shell.projectHistory?.getSnapshot().busy!==!0));E+=1);if(ae=performance.now(),!d&&!h&&H!==p){A.root.dispose(),A.disposeHost(),L();return}if(d||h){console.info(`[r3f-design] world "${o}" remount abandoned after mount (${d?"torn down":"suspended"})`),A.root.dispose(),A.disposeHost();return}const k=new Set(t.shell.selectedEntityIds);if(U(),W(),K(A),y)y.adoptScene(A.root.scene),e.childAdapters().find(re=>re.worldId===o)?.adapter!==y&&(e.replaceChild(o,y),T.log(`[r3f-design] world "${o}" recovered and remounted for design-time authoring (${n})`,"authoring"));else{const[{R3fSourceAuthoringAdapter:E},re]=await Promise.all([V,O]);y=new E(t,A.root.scene,{worldId:o,entryPath:n,writeBackend:re,physics:()=>ce(c?.systemAdapters.physics)}),e.replaceChild(o,y),T.log(`[r3f-design] world "${o}" recovered and mounted for design-time authoring (${n})`,"authoring")}const $e=k.size>0&&(k.size!==r.length||r.some(E=>!k.has(E)));t.enterPlayScene(A.root.scene,A.root.rendererConfig),x=!0,F=A.root.scene;const le=($e?[...k]:r).filter(E=>y?.hierarchy.node(E)!==null);le.length>0&&t.shell.selectMultiple(le),pe(o),w(),t.shell.notifyIngestEdit(),N(o,g,S,Y,ae),Q.mounted(),clearTimeout(Z),B=!1}catch(D){X(D),!B&&!d&&!h?(B=!0,setTimeout(()=>{!d&&!h&&L()},400)):!d&&!h&&(H===p&&!f?ve(D):(B=!1,L()))}finally{clearTimeout(m),!d&&!h&&H!==p&&L()}},Se=async()=>{const r=t.shell.projectHistory;if(!r)return;const p=Date.now()+1e4;for(;r.getSnapshot().busy&&Date.now()<p;)await new Promise(f=>{const l=setTimeout(f,250),m=r.subscribe(()=>{clearTimeout(l),m(),f()})})},ve=async r=>{const p=r instanceof Error?r.message:String(r);if(!p.includes("fiber crashed"))return;if(/Could not load |Failed to fetch|Unexpected token '<'|not valid JSON/.test(p)){T.error(`World "${o}" failed to load a project asset (${p}). The edit is kept; the world remounts once the asset can be served.`,"authoring");return}const f=t.shell.projectHistory;if(!f)return;const l=f.getSnapshot(),m=l.canUndo?l.transactions[l.cursor-1]:void 0;if(!m||Date.now()-m.timestamp>15e3){console.info(`[r3f-design] world "${o}" crash auto-undo skipped (${m?"last edit too old":l.canUndo?"no entry":`cannot undo: busy=${l.busy} blocked=${l.blocked}`})`);return}if(!await f.undo().catch(()=>!1)){console.info(`[r3f-design] world "${o}" crash auto-undo refused by history`);return}B=!1,T.error(`Undid “${m.label}”: that edit crashed world "${o}" (${r instanceof Error?r.message:String(r)}). The previous source is restored.`,"authoring"),L()};let H=0;const Q=new lt;let Z;const L=()=>{if(d||h){console.info(`[r3f-design] world "${o}" remount skipped: ${d?"session torn down":"suspended for play"}`);return}G||(G=!0,setTimeout(()=>{G=!1,be()},80))},Re=xe(r=>{qe(r).then(()=>{H+=1,L()})});let se=de()?.revision??0;const Te=Fe(r=>{H+=1;const f=de()?.revisions.filter(m=>m.revision>se)??[];f.length!==r-se&&Q.missing(),se=r;const l=f.flatMap(m=>m.resources);Q.revision(l),!(l.length&&!Q.needsRemount())&&(clearTimeout(Z),Z=setTimeout(()=>{l.length&&!Q.needsRemount()||(H+=1,L())},2e3))});let ie=!1,oe=!1;return z=t.shell.subscribe(()=>{if(!d){if(t.shell.playState==="stopped"?w():$(),!h&&!oe&&t.shell.playState!=="stopped"){oe=!0,Ie(()=>{oe=!1,!(d||h||t.shell.playState==="stopped")&&te()});return}h&&!ie&&t.shell.playState==="stopped"&&(ie=!0,ye())}}),()=>{d=!0,console.info(`[r3f-design] world "${o}" design session torn down`),$(),Re(),Te(),clearTimeout(Z),z?.(),!h&&t.shell.playState==="stopped"&&t.shell.selectedEntityIds.size>0&&ge.remember(t,t.shell.selectedEntityIds),U(),W()}}export{ft as loadR3FDesignEntryModules,ao as mountR3FDesignSession,mt as registerR3FDesignRoot,ut as reportDesignMountFailure,dt as unresolvedDesignEntryError};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as h}from"./index-nmcBqr7Y.js";import{s as b,c as f,l as V,a as x,t as S,v as P,p as T,b as y}from"./camera-authoring-DYjhU5Zp.js";import{h7 as L,aH as A,dR as C,aJ as k,x as g,r as O,d4 as M,h8 as E,g4 as R,h9 as z}from"./index-CvGsVzTo.js";import{a as D}from"./object3d-document-session-registry-CWaOPDYg.js";import{r as s}from"./transform-mode-request-Bg6T_rOC.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function H(){const e=f();if(e.view)return[{id:"camera.exitView",label:"Exit Camera View",execute:V}];const i=x();return i?[{id:"camera.viewThrough",label:`View Through ${i.name}`,execute:()=>P(i)},...i.canAuthorPose?[{id:"camera.pilot",label:`Pilot ${i.name}`,execute:()=>T(i)},{id:"camera.alignToView",label:`Align ${i.name} to Current View`,execute:()=>y(i)}]:[],{id:"camera.pinPreview",label:e.previewPinned?"Unpin Camera Preview":"Pin Camera Preview",execute:S}]:[]}function j(){const e=g();return e?D(e):null}function a(e,i){const o=j();o?o.setMode(i):e.setShadingMode(i)}function $(e){const i=[{id:"mode.select",label:"Select Tool (no gizmo)",shortcut:"transform.select",execute:()=>s(e.shell,"select")},{id:"mode.combined",label:"Transform Mode (all handles)",shortcut:"transform.combined",execute:()=>s(e.shell,"combined")},{id:"mode.translate",label:"Translate Mode",shortcut:"transform.translate",execute:()=>s(e.shell,"translate")},{id:"mode.rotate",label:"Rotate Mode",shortcut:"transform.rotate",execute:()=>s(e.shell,"rotate")},{id:"mode.scale",label:"Scale Mode",shortcut:"transform.scale",execute:()=>s(e.shell,"scale")},{id:"mode.world",label:"World Space",execute:()=>e.shell.setTransformSpace("world")},{id:"mode.local",label:"Local Space",execute:()=>e.shell.setTransformSpace("local")},{id:"toggle.grid",label:"Toggle Grid",execute:()=>{const l=g();l&&A(l)&&C(l,!k(l))}},{id:"toggle.helpers",label:"Toggle Helpers",execute:()=>e.shell.toggleHelpers()},{id:"toggle.stats",label:"Toggle Stats Overlay",execute:()=>e.toggleStats()},{id:"toggle.snap",label:"Toggle Snap",shortcut:"viewport.toggleSnap",execute:()=>e.shell.toggleSnap()},{id:"toggle.surface-snap",label:"Toggle Surface Snap",execute:()=>e.shell.toggleSnapToSurface()},{id:"shading.solid",label:"Material Shading",execute:()=>a(e,"solid")},{id:"shading.clay",label:"Solid Shading",execute:()=>a(e,"clay")},{id:"shading.wireframe",label:"Wireframe Shading",execute:()=>a(e,"wireframe")},{id:"shading.unlit",label:"Unlit Shading",execute:()=>a(e,"unlit")},{id:"shading.normals",label:"Normal Shading",execute:()=>a(e,"normals")},{id:"shading.overdraw",label:"Overdraw Shading",execute:()=>a(e,"overdraw")},{id:"view.top",label:"Top View",shortcut:"view.top",execute:()=>e.shell.setViewPreset("top")},{id:"view.front",label:"Front View",shortcut:"view.front",execute:()=>e.shell.setViewPreset("front")},{id:"view.right",label:"Right View",shortcut:"view.right",execute:()=>e.shell.setViewPreset("right")},{id:"view.bottom",label:"Bottom View",shortcut:"view.bottom",execute:()=>e.shell.setViewPreset("bottom")},{id:"view.back",label:"Back View",shortcut:"view.back",execute:()=>e.shell.setViewPreset("back")},{id:"view.left",label:"Left View",shortcut:"view.left",execute:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",label:"Orbit Left",shortcut:"view.orbitLeft",execute:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",label:"Orbit Right",shortcut:"view.orbitRight",execute:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",label:"Orbit Up",shortcut:"view.orbitUp",execute:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",label:"Orbit Down",shortcut:"view.orbitDown",execute:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",label:"Opposite View",shortcut:"view.opposite",execute:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",label:"Roll Left",shortcut:"view.rollLeft",execute:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",label:"Roll Right",shortcut:"view.rollRight",execute:()=>e.shell.stepView("roll-right")},{id:"view.all",label:"Frame All",shortcut:"view.all",execute:()=>e.shell.frameAll()},{id:"view.zoomIn",label:"Zoom In",shortcut:"view.zoomIn",execute:()=>e.shell.zoomView(1)},{id:"view.zoomOut",label:"Zoom Out",shortcut:"view.zoomOut",execute:()=>e.shell.zoomView(-1)},{id:"view.perspective",label:"Perspective View",shortcut:"view.perspective",execute:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",label:"Perspective/Orthographic",shortcut:"view.projection",execute:()=>e.shell.toggleProjection()},{id:"view.camera",label:"Camera View",shortcut:"view.camera",execute:()=>e.shell.toggleCameraView()},{id:"focus.selected",label:"Focus Selected",shortcut:"viewport.frameSelection",execute:()=>e.shell.focusOnSelection()}];return L({actions:()=>[...i,...H()],subscribe:b})}function F(e,i,o){const{keyboard:l}=O(),r=t=>()=>{i.isFlying||s(e.shell,t)},v=l.bindActions([{id:"transform.select",scope:"stage",run:r("select")},{id:"transform.combined",scope:"stage",run:r("combined")},{id:"transform.translate",scope:"stage",run:r("translate")},{id:"transform.rotate",scope:"stage",run:r("rotate")},{id:"transform.scale",scope:"stage",run:r("scale")},{id:"viewport.toggleSnap",scope:"stage",run:()=>{e.shell.toggleSnap();const{translate:t,rotate:n,scale:m}=e.shell.snapValues,p=`${l.shortcutFor("viewport.toggleSnap")??""} toggles; hold Ctrl while dragging to snap once`;M(e.shell.snapEnabled?`Snap on — ${t} units, ${n}°, ×${m} (${p})`:`Snap off (${p})`)}},{id:"viewport.frameSelection",scope:"stage",run:()=>e.shell.focusOnSelection()},{id:"viewport.cyclePivot",scope:"stage",run:()=>{const t=["active-element","median-point","individual-origins"],n=t.indexOf(e.shell.pivotMode);e.shell.setPivotMode(t[(n+1)%t.length])}},{id:"view.top",scope:"stage",run:()=>e.shell.setViewPreset("top")},{id:"view.front",scope:"stage",run:()=>e.shell.setViewPreset("front")},{id:"view.right",scope:"stage",run:()=>e.shell.setViewPreset("right")},{id:"view.bottom",scope:"stage",run:()=>e.shell.setViewPreset("bottom")},{id:"view.back",scope:"stage",run:()=>e.shell.setViewPreset("back")},{id:"view.left",scope:"stage",run:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",scope:"stage",run:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",scope:"stage",run:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",scope:"stage",run:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",scope:"stage",run:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",scope:"stage",run:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",scope:"stage",run:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",scope:"stage",run:()=>e.shell.stepView("roll-right")},{id:"view.all",scope:"stage",run:()=>e.shell.frameAll()},{id:"view.zoomIn",scope:"stage",run:()=>e.shell.zoomView(1)},{id:"view.zoomOut",scope:"stage",run:()=>e.shell.zoomView(-1)},{id:"view.perspective",scope:"stage",run:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",scope:"stage",run:()=>e.shell.toggleProjection()},{id:"view.camera",scope:"stage",run:()=>e.shell.toggleCameraView()},{id:"viewport.snapToFloor",scope:"stage",run:()=>i.snapSelectionToFloor()}]),c=()=>R("viewport");o.addEventListener("pointerdown",c),E();const d=t=>l.chordsFor("viewport.vertexSnapHold").some(n=>n.key===t.key.toLowerCase()),u=t=>{if(d(t)&&!t.metaKey&&!t.ctrlKey&&!t.repeat){if(z()!=="viewport"||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement)return;e.setVertexSnapActive(!0),i.activateVertexSnap()}},w=t=>{d(t)&&!t.metaKey&&!t.ctrlKey&&(e.setVertexSnapActive(!1),i.deactivateVertexSnap())};return window.addEventListener("keydown",u),window.addEventListener("keyup",w),()=>{v(),o.removeEventListener("pointerdown",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",w)}}function Y({stage:e}){return h.useEffect(()=>F(e.store,e.viewport,e.canvas),[e.store,e.viewport,e.canvas]),h.useEffect(()=>$(e.store),[e.store]),null}export{Y as StageKeyboardBinding};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import{iS as w,g_ as R,cM as D,aK as f,af as v,iT as L,gJ as E,gK as k,iU as V,iV as T,d2 as A,dG as C,dH as b,aJ as N,iW as H,iX as I,cD as U,cE as M,aL as z,a1 as F,iY as $,dR as W,iZ as _,i_ as G,a4 as q,i$ as J,j0 as K,j1 as Z,dI as X}from"./index-CvGsVzTo.js";import{s as B,o as O,a as Y}from"./object3d-document-session-registry-CWaOPDYg.js";import{r as Q}from"./index-CtzuWnCS.js";import{T as ee}from"./TransientHint-CDvYgnzu.js";import{d as te,b as se}from"./ViewportShadingMenu-CrTY7tnk.js";import{V as j,s as oe}from"./StageHost-D1Sz5aud.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-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BK3fNRb7.js";import"./workspace-arrangement-C9uemwSK.js";import"./user-data-DfBtZvxw.js";import"./entity-object-BFppZ54X.js";import"./three-contract-Dkt6PmWY.js";import"./standard-viewport-dressing-e4mnLmI6.js";import"./content-bounds-BFpR_e--.js";import"./hierarchy-marks-Pb6wnNcu.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-Dd-hn5v2.js";import"./three-viewport-presentation-CWanX03c.js";import"./clip-planes-CnAI6DZn.js";import"./three-bdxPiUPb.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./model-thumbnail-BDU_QU37.js";import"./studio-environment-DK0ke0m0.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-BHoulbny.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-BaxBYi7u.js";import"./root-stacking-BEd9ZvxC.js";import"./viewport-door-CuJjGYTz.js";import"./asset-preview-B7j9QV6N.js";import"./bitmap-label-Ct4k6ehY.js";import"./scene-framing-nVyYC4Y-.js";import"./source-object3d-authoring-adapter-owosRx07.js";import"./three-projection-core-BO23VKAP.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-CFLRAIQd.js";import"./viewport-surface-status-D3t-0oLs.js";function h(t){return t.toFixed(2)}function re(){const t=w(),[o,r]=s.useState({x:0,y:0,z:0}),[i,n]=s.useState({x:0,y:0,z:0}),a=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),a.current=requestAnimationFrame(u)}return a.current=requestAnimationFrame(u),()=>cancelAnimationFrame(a.current)},[t]),e.jsx(R,{variant:"overlay",border:!0,className:"volter-camera-info volter-chrome-island volter-glass-island","data-island-scale":"compact",children:e.jsxs(D,{gap:8,align:"center",style:{whiteSpace:"nowrap"},children:[e.jsxs(f,{variant:"code",children:["Pos ",h(o.x)," ",h(o.y)," ",h(o.z)]}),e.jsxs(f,{variant:"code",children:["Target ",h(i.x)," ",h(i.y)," ",h(i.z)]})]})})}function ie(){const t=w(),[,o]=s.useState(0),r=L();return s.useEffect(()=>{const i=setInterval(()=>o(n=>n+1),200);return()=>clearInterval(i)},[]),e.jsxs("div",{className:"volter-hud-overlay volter-chrome-island volter-glass-island","data-island-scale":"compact","data-hud-border":"strong",style:{position:"absolute",top:"var(--volter-viewport-overlay-hud-top, 48px)",right:8,padding:"6px 10px",pointerEvents:"auto",fontSize:"var(--volter-font-base)",color:v.content.primary,fontFamily:v.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 ae({store:t,documentId:o}){s.useSyncExternalStore(t.shell.subscribe,t.shell.getSnapshot),s.useSyncExternalStore(E,k),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O);const{adapter:r}=A(t.shell),i=Y(o);s.useSyncExternalStore(i?.subscribe??le,i?.getSnapshot??ce),s.useSyncExternalStore(C,b);const n=N(o),a=H(),u=I(),m=a.viewName==="bar"||a.viewName==="menu",[p,l]=s.useState(null),y=()=>p?.closest(".volter-dock-document-content")?.querySelector(':scope > .volter-stage-bar [data-stage-bar-slot="display"]')??null,x=s.useId(),g=y(),d=g&&(g.dataset.owner===void 0||g.dataset.owner===x)?g:null,[,P]=s.useReducer(c=>c+1,0);s.useEffect(()=>{const c=y();c&&c.dataset.owner===void 0&&(c.dataset.owner=x),(c&&c.dataset.owner===x?c:null)!==d&&P()}),s.useEffect(()=>()=>{d?.dataset.owner===x&&delete d.dataset.owner},[d,x]);const S=e.jsxs(U,{label:"Viewport display",className:"volter-viewport-toolbar volter-viewport-toolbar-right volter-stage-display",children:[a.viewName==="bar"&&i?e.jsx(j,{shell:t.shell,documentId:o,label:oe(i.viewport,i.projection(),"long")}):null,e.jsx(M,{text:`Grid: ${n?"On":"Off"}`,children:e.jsx(z,{"aria-label":"Toggle grid","aria-pressed":n,size:"comfortable",onClick:()=>W(o,!n),children:e.jsx(F,{icon:$,size:"md"})})}),e.jsx(pe,{store:t,word:u.helpers}),e.jsx(te,{mode:ne(i)??t.shadingMode,onChange:c=>i?i.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?Q.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[,i]=s.useReducer(a=>a+1,0);s.useEffect(()=>o.subscribe?.(i),[o]);const n=s.useMemo(()=>_(o),[o,r.shell.contentVersion]);return n===0?null:e.jsx(M,{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:G,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(i=>({id:i.key,label:i.label,enabled:t.shell.helperVisibility[i.key],onToggle:()=>t.shell.toggleHelperType(i.key)}))})}function vt({store:t,documentId:o,stage:r,active:i,chrome:n}){const a=r?.store??t;s.useSyncExternalStore(t.shell.subscribe,t.shell.getShellSnapshot??t.shell.getSnapshot),s.useSyncExternalStore(a.shell.subscribe,a.shell.getShellSnapshot??a.shell.getSnapshot),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O),s.useSyncExternalStore(E,k);const u=K(t.shell,o,n),m=Z(u);s.useSyncExternalStore(C,b,b);const p=X(o).overlays.cameraReadout;return e.jsxs(e.Fragment,{children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ae,{store:a,documentId:o}),p?e.jsx(re,{}):null]}):null,u.surface==="three"&&a.showStats&&e.jsx(ie,{}),i?e.jsx(ee,{}):null]})}export{vt as StageOverlaySet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./jsx-runtime-DPjLkJKQ.js";import{dD as n,dE as m,K as l,dF as f,e2 as c,dI as S}from"./index-CvGsVzTo.js";import{r as e}from"./index-nmcBqr7Y.js";import{t as T}from"./StageHost-D1Sz5aud.js";import{t as u}from"./editor-shell-store-Bro0arjr.js";import{T as h,a as g}from"./Toolbar-BJRJsbHG.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-BhQOBgKC.js";import"./standard-viewport-dressing-e4mnLmI6.js";import"./content-bounds-BFpR_e--.js";import"./hierarchy-marks-Pb6wnNcu.js";import"./workspace-arrangement-C9uemwSK.js";import"./three.core-3arARmh6.js";import"./editor-layers-BK3fNRb7.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-DfBtZvxw.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-Dd-hn5v2.js";import"./three-viewport-presentation-CWanX03c.js";import"./clip-planes-CnAI6DZn.js";import"./three-bdxPiUPb.js";import"./component-instance-root-MBgAuUpp.js";import"./entity-object-BFppZ54X.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./model-thumbnail-BDU_QU37.js";import"./studio-environment-DK0ke0m0.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-BHoulbny.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-BaxBYi7u.js";import"./root-stacking-BEd9ZvxC.js";import"./object3d-document-session-registry-CWaOPDYg.js";import"./viewport-door-CuJjGYTz.js";import"./asset-preview-B7j9QV6N.js";import"./bitmap-label-Ct4k6ehY.js";import"./scene-framing-nVyYC4Y-.js";import"./source-object3d-authoring-adapter-owosRx07.js";import"./three-projection-core-BO23VKAP.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-CFLRAIQd.js";import"./viewport-surface-status-D3t-0oLs.js";import"./transform-mode-request-Bg6T_rOC.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 Mr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l();return a.jsx(h,{store:f(r)??t})}export{Mr as ThreeStageTransformControls,Cr as ThreeStageTransformTools};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as T}from"./react-story-board-6-BjI32N.js";import{d as P}from"./bitmap-label-Ct4k6ehY.js";import{b8 as S,b9 as M,ao as $,ba as C,bb as E,bc as j,bd as I,U as v,be as D,bf as R,bg as O,aw as U,ap as L}from"./index-CvGsVzTo.js";import{m as k}from"./StoryPreviewMount-D2zLWzWy.js";import{s as B}from"./story-presentation-DgAoj9Qt.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";async function ae(s,o){await S();const r=L(),c=M().filter(e=>$({modulePath:e.modulePath,regions:r}).medium==="dom"),t=document.createElement("canvas");t.width=s,t.height=o;const l=t.getContext("2d");if(!l)throw new Error("UI Canvas preview could not create a 2D output context.");if(c.length===0)return t.toDataURL("image/png");const m=B(c),d=U()?.config.resolution,u={width:d?.width??640,height:d?.height??400},h=new Map,f=new Map;for(const e of c){const n=m.resolve(e,u),[y]=await x(e.modulePath,[e],{width:n.width,height:n.height,capture:v,cropToContent:n.layout!=="fullscreen",layout:n.layout,transparent:!0});if(!y)throw new Error(`No preview rendered for ${e.id}.`);const g=new Image;g.src=`data:${y.mimeType};base64,${y.base64}`,await g.decode(),h.set(e.id,g),f.set(e.id,{width:g.naturalWidth,height:g.naturalHeight})}const i=T(c,m.index,e=>f.get(e.id)),a=Math.min(s/i.width,o/i.height),p=(s-i.width*a)/2,w=(o-i.height*a)/2;for(const[e,n]of i.layouts)l.drawImage(h.get(e),p+n.x*a,w+n.y*a,n.width*a,n.height*a);return t.toDataURL("image/png")}const A="#ffffff",H="#14171c";async function oe(s,o){const{modulePath:r,width:c,height:t}=o;if(!s)throw new Error(`No project is open, so '${r}' cannot be loaded. Open the project first.`);const l=await C(s),m=l.find(e=>e.modulePath===r);if(!m)throw new Error(`'${r}' is not a story file of this project. `+(l.length===0?"This project has no *.stories.tsx / *.stories.ts under src/.":`This project's story files are: ${l.map(e=>e.modulePath).join(", ")}.`));await E(await j(s));let d;try{d=await m.load()}catch(e){throw new Error(`'${r}' failed to import — ${e instanceof Error?e.message:String(e)}`)}const u=await I(r,d);if(!u.ok)throw new Error(u.error);const h=N(r,u.stories,o.story),f=o.capture??v,i=D("three"),a=o.captureThree??(i?(e,n)=>i(e,{...n,...o.camera===void 0?{}:{camera:o.camera},...o.pose===void 0?{}:{pose:o.pose}}):void 0);if((o.camera||o.pose)&&!a)throw new Error(`'${r}': camera/clip parameters need the three capture leg, which this environment cannot provide (no WebGL).`);const p=await x(r,h,{width:c,height:t,capture:f,...a?{captureThree:a}:{},requireThree:!!(o.camera||o.pose)}),w=await _(p,c,t);return{modulePath:r,width:c,height:t,variants:p,contactSheet:w}}function N(s,o,r){if(r===void 0)return o;const c=o.find(t=>t.name===r);if(!c)throw new Error(`'${s}' exports no story named '${r}'. It exports: ${o.map(t=>t.name).join(", ")}.`);return[c]}async function x(s,o,r){const{width:c,height:t,capture:l,captureThree:m,requireThree:d,cropToContent:u=!0}=r,h=document.createElement("div");h.setAttribute("style",`position:fixed;left:-20000px;top:0;width:${c}px;height:${t}px;overflow:hidden;contain:strict;pointer-events:none;background:${r.transparent?"transparent":A};`),document.body.appendChild(h);const f=[];try{for(const i of o){if(m){const e=await m(i.Component,{width:c,height:t}).catch(n=>(R(n)||console.warn(`[story-capture] three mount for '${i.name}' failed — falling back to the DOM leg:`,n instanceof Error?n.stack??n.message:String(n)),null));if(e===null&&d)throw new Error(`story '${i.name}' did not render on the three leg — --azimuth/--elevation/--distance/--clip/--time apply to three (R3F) stories only, and falling back to the DOM leg would silently ignore them. Narrow to a three story with --story <export>, or drop the camera/clip flags.`);if(e!==null){const n=e.indexOf(",");f.push({name:i.name,label:i.label,base64:n>=0?e.slice(n+1):e,mimeType:"image/png"});continue}}const a=document.createElement("div");a.setAttribute("style",`position:relative;width:${c}px;height:${t}px;overflow:hidden;`),r.layout==="padded"&&(a.style.padding="16px"),r.layout==="centered"&&(a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center"),a.style.boxSizing="border-box",h.replaceChildren(a);const p=await O(async()=>{const e=await k(a,s,i.name,i.Component);return await W(a),e});await p.settled();const w=p.result;try{const e=await l(h,{canvasFrame:p.frame,cropToContent:u,...r.transparent?{allowTransparent:!0}:{}});f.push({name:i.name,label:i.label,base64:e.base64,mimeType:"image/png"})}finally{w?.unmount(),await new Promise(e=>setTimeout(e,0)),a.remove()}}}finally{h.remove()}return f}async function W(s,o=10){for(let t=0;t<o&&!(s.childNodes.length>0);t++)await new Promise(l=>setTimeout(l,0));if(s.childNodes.length===0)return;const r=200,c=5e3;await new Promise(t=>{let l=null,m=!1;const d=new MutationObserver(()=>{l!==null&&clearTimeout(l),l=setTimeout(h,r)}),u=setTimeout(h,c);function h(){m||(m=!0,d.disconnect(),l!==null&&clearTimeout(l),clearTimeout(u),t())}d.observe(s,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),l=setTimeout(h,r)})}async function _(s,o,r,c={}){const t=Math.min(Math.max(1,s.length),Math.max(1,Math.floor(c.columns??2))),l=Math.max(1,Math.ceil(s.length/t)),m=[];for(const e of s){const n=new Image;n.src=`data:${e.mimeType};base64,${e.base64}`,await n.decode(),m.push(n)}const d=Math.max(1,...m.map(e=>e.naturalWidth),m.length?0:o),u=Math.max(1,...m.map(e=>e.naturalHeight),m.length?0:r),h=d*t,f=u*l,i=document.createElement("canvas");i.width=h,i.height=f;const a=i.getContext("2d");if(!a)throw new Error("Unable to create the story variant sheet.");a.fillStyle=H,a.fillRect(0,0,h,f);for(const[e,n]of s.entries()){const y=e%t*d,g=Math.floor(e/t)*u,b=m[e];a.drawImage(b,y+Math.floor((d-b.naturalWidth)/2),g+Math.floor((u-b.naturalHeight)/2)),c.labels!==!1&&P(a,n.name.toUpperCase(),y,g,d,u)}const p=i.toDataURL("image/png"),w=p.indexOf(",");return{width:h,height:f,base64:w>=0?p.slice(w+1):p,mimeType:"image/png"}}export{ae as captureDomStoryBoardPreview,oe as captureProjectStoryVariants,_ as composeVariantSheet,x as renderStoryVariants};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{am as p,an as S,ao as b,ap as y,aq as v}from"./index-CvGsVzTo.js";const f={three:!1,canvas:!1,dom:!1};let r=f,a=0;const n=new Set;let i=!1;function j(){return l(),r}function N(e){return l(),n.add(e),()=>{n.delete(e)}}function l(){i||(i=!0,p(()=>{d()}),d())}function u(e){if(!(e.three===r.three&&e.canvas===r.canvas&&e.dom===r.dom)){r=e;for(const t of n)t()}}function M(e){const t=b({modulePath:e.modulePath,regions:y()});if(t.medium)return t.medium;e.modulePath&&v(e.modulePath,t.reason)}async function d(){const e=++a,t=S().flatMap(s=>s.ok?s.stories.map(o=>({...o,modulePath:s.modulePath})):[]);if(t.length===0)return u(f),r;const c={three:!1,canvas:!1,dom:!1};for(const s of t){const o=M(s);if(o&&(c[o]=!0),e!==a)return r}const{three:m,canvas:h,dom:P}=c;return e!==a||u({three:m,canvas:h,dom:P}),r}export{j as g,N as s};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-Cyy1sDGH.js","assets/index-CvGsVzTo.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/edit-mode-authoring-DubxVdEM.js","assets/game-network-BPTyOFqA.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/native-debug-module-XfhvyMrK.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-Dagj3b6J.js","assets/contract-system-adapters-BRHtWOi_.js","assets/game-contract-seams-5IUqvr7b.js","assets/seeded-random-D0QPgfm6.js","assets/game-audio-BeCyd0Ha.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/index-bQE2NA0D.js","assets/live-project-verbs-B7S-wGjC.js","assets/capability-coverage-9qm5WVwt.js","assets/json-history-resource-CckDydoO.js","assets/binding-resolver-CBXePHiR.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-DCnaxwIb.js","assets/canvas-entry-runtime-Cjga4XYp.js","assets/three-ingest-runtime-CwRnwvb0.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/active-ingest-lrfMBhf9.js","assets/ingest-source-persistence-CPlDA2D8.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-CkSAEMH-.js","assets/mounted-authoring-D-tXkNKH.js","assets/entity-object-BFppZ54X.js","assets/user-data-DfBtZvxw.js","assets/workspace-arrangement-C9uemwSK.js","assets/three-contract-Dkt6PmWY.js","assets/three-bdxPiUPb.js","assets/editor-layers-BK3fNRb7.js","assets/component-instance-root-MBgAuUpp.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-BuqO9MDt.js","assets/source-persistence-backend-Djuk0m-7.js","assets/three-projection-core-BO23VKAP.js","assets/body-marks-C1LxJtQb.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/r3f-physics-binding-BcTFD1ZS.js","assets/deferred-ingest-play-DZiOEH9a.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-B6BiehHR.js","assets/board-guides-whelE-Dr.js","assets/relative-import-specifier-BvzqkvYS.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-DxfAFkho.js","assets/inference-diagnostics-BCwXk-CS.js","assets/writer-tw6EcuVO.js","assets/three-state-BhQOBgKC.js","assets/editor-shell-store-Bro0arjr.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-CuJjGYTz.js","assets/game-surface-defaults-D8S4cRxi.js","assets/scene-framing-nVyYC4Y-.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-B6u6x5eK.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-ji8Qt-PP.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-BPcHd4LA.js","assets/render-features-DFwHsGxu.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/performance-profiler-CMbwGBuk.js","assets/live-gesture-lock-DJbrjOqf.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as s,az as n}from"./index-CvGsVzTo.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import{q as c}from"./edit-mode-authoring-DubxVdEM.js";import{a as u}from"./json-history-resource-CckDydoO.js";import{o as h}from"./three-authoring-adapter-BuqO9MDt.js";import{t as i}from"./editor-shell-store-Bro0arjr.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-MBgAuUpp.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./source-persistence-backend-Djuk0m-7.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./three-projection-core-BO23VKAP.js";import"./editor-layers-BK3fNRb7.js";import"./three-bdxPiUPb.js";import"./entity-object-BFppZ54X.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three.core-3arARmh6.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BcTFD1ZS.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-Cyy1sDGH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]));r.catch(()=>{});const m=n("three",(t,o)=>h(i(t),()=>i(t).scene,o,u(o))),e=a({kind:"three",owner:"@volter/editor-game/three/three-authoring",async mountWorldRootSession(t){const o=t,{mountR3FDesignSession:p}=await r;return p(o.store,o.composite,o.renderer)}});return c(),()=>{e(),m()}}export{U as point,X as start};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolObject3DPreview-BfNcqtFv.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/Object3DPreview-pn9i3vwZ.js","assets/index-CvGsVzTo.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-CPiRKiDC.css","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/OrbitControls-B13MKuwC.js","assets/asset-preview-B7j9QV6N.js","assets/editor-layers-BK3fNRb7.js","assets/workspace-arrangement-C9uemwSK.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-Pb6wnNcu.js","assets/studio-environment-DK0ke0m0.js","assets/user-data-DfBtZvxw.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/editor-presentation-activity-CqJH4G9t.js","assets/model-thumbnail-BDU_QU37.js","assets/StageHost-D1Sz5aud.js","assets/three-state-BhQOBgKC.js","assets/editor-shell-store-Bro0arjr.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/entity-object-BFppZ54X.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-e4mnLmI6.js","assets/content-bounds-BFpR_e--.js","assets/preview-renderer-BrYNFV1p.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/model-inspection-Dd-hn5v2.js","assets/three-viewport-presentation-CWanX03c.js","assets/clip-planes-CnAI6DZn.js","assets/three-bdxPiUPb.js","assets/component-instance-root-MBgAuUpp.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-nVyYC4Y-.js","assets/object3d-document-session-registry-CWaOPDYg.js","assets/source-object3d-authoring-adapter-owosRx07.js","assets/three-projection-core-BO23VKAP.js","assets/viewport-door-CuJjGYTz.js","assets/transport-strip-CFLRAIQd.js","assets/viewport-surface-status-D3t-0oLs.js","assets/ModelAssetDocument-BBDnXTQm.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-BaxBYi7u.js","assets/root-stacking-BEd9ZvxC.js","assets/EntityModelDocument-BltE1A7W.js","assets/EnvironmentAssetDocument-QuLkCom9.js","assets/asset-editor-persistence-e6bYhVnm.js","assets/LutAssetDocument-B6GmsOYd.js","assets/index-DHhMOs_s.js","assets/ShaderAssetDocument-ImI6jbzB.js","assets/ColorInput-fX1V5l8_.js","assets/LiveModuleDocument-CaGmr0EA.js","assets/Object3DDocumentViewport-ByDDwGJD.js","assets/QuarksAssetDocument-2x66XymD.js","assets/project-provenance-BGnJXJwa.js","assets/InspectorObjectPreview-BpttBw3o.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aB as De,kN as Me,kM as X,aA as Te,ll as xe,g2 as Re,d2 as je,ax as Ve,_ as y,ae as Ne,lm as Le,ln as ze,lo as Fe,lp as Be,lq as He,lr as qe,ls as Ue,lt as We,lu as Ge,hh as Qe,lv as $e,bs as Je,lw as Ye,lx as Ke,ly as he,kP as z,aH as Z,aI as Xe,x as B,dR as Ze,lz as et,r as ve,B as tt,aJ as rt,lA as ot,lB as nt,lC as W,J as at,ct as st,kE as it}from"./index-CvGsVzTo.js";import{r as ct}from"./host-hierarchy-objects-BV3WqU2w.js";import{m as ge,l as ut}from"./renderer-ownership-BovSEcLv.js";import{W as we}from"./three.module-BLhyNg0e.js";import{cP as ye,ej as lt,_ as be,I as dt,fo as P,V as Se,dp as J,cp as ft,el as pt,bh as ee,d5 as mt}from"./three.core-3arARmh6.js";import{i as ht}from"./preview-renderer-BrYNFV1p.js";import{a as vt}from"./layered-pick-BaxBYi7u.js";import{g as H}from"./user-data-DfBtZvxw.js";import{a as h}from"./jsx-runtime-DPjLkJKQ.js";import{r as f}from"./index-nmcBqr7Y.js";import{r as gt}from"./model-thumbnail-BDU_QU37.js";import{b as wt,a as Pe}from"./object3d-document-session-registry-CWaOPDYg.js";import{t as k}from"./three-state-BhQOBgKC.js";import{a as q}from"./entity-object-BFppZ54X.js";import{i as _e,c as yt}from"./hierarchy-marks-Pb6wnNcu.js";import{a as bt}from"./component-instance-root-MBgAuUpp.js";import{a as St}from"./three-contract-Dkt6PmWY.js";import{t as I}from"./editor-shell-store-Bro0arjr.js";import{c as Pt,a as U}from"./viewport-door-CuJjGYTz.js";import{a as _t}from"./content-bounds-BFpR_e--.js";import{h as Et,d as Ee,p as Ct,j as te,r as re,s as At,k as oe,A as Ot,n as kt,o as It,c as Dt,q as Mt,m as Tt,t as xt,b as Rt,C as jt,u as ne,v as Vt,w as G,x as Nt,y as Lt,z as zt,B as Ft,D as Bt,E as Ht,F as qt,e as Ut,f as Wt}from"./asset-preview-B7j9QV6N.js";const Gt=1,C=[];function $(t){const e=C.indexOf(t);e>=0&&C.splice(e,1),t.renderer.dispose(),t.renderer.forceContextLoss(),t.canvas.remove()}function Qt(t,e){const r=document.createElement("canvas");r.style.width="100%",r.style.height="100%",r.style.display="block",r.width=Math.max(1,t),r.height=Math.max(1,e);const o={canvas:r,renderer:ge(new we({canvas:r,antialias:!0,alpha:!0})),leased:!0,lost:!1,onContextLost:null};return r.addEventListener("webglcontextlost",()=>{o.lost=!0,o.onContextLost?.();const n=C.indexOf(o);n>=0&&C.splice(n,1),o.leased||$(o)}),C.push(o),o}function $t(t){const{renderer:e}=t;e.setRenderTarget(null),e.setScissorTest(!1),e.setViewport(0,0,Math.max(1,t.canvas.width),Math.max(1,t.canvas.height)),e.setScissor(0,0,Math.max(1,t.canvas.width),Math.max(1,t.canvas.height)),e.autoClear=!0,e.autoClearColor=!0,e.autoClearDepth=!0,e.autoClearStencil=!0,e.sortObjects=!0,e.localClippingEnabled=!1,e.clippingPlanes=[],e.shadowMap.enabled=!1,e.shadowMap.autoUpdate=!0,e.toneMapping=ye,e.toneMappingExposure=1,e.outputColorSpace=lt,e.xr.enabled=!1,e.setAnimationLoop(null),e.setClearColor(0,0),e.clear(!0,!0,!0),e.info.reset()}function uo(t,e,r){let o=C.find(s=>!s.leased&&!s.lost);o||(o=Qt(t,e)),o.leased=!0,o.onContextLost=r??null;const n=o;let a=!1;return{canvas:n.canvas,renderer:n.renderer,release(){if(a)return;if(a=!0,n.leased=!1,n.onContextLost=null,n.canvas.remove(),n.lost){$(n);return}$t(n);const s=C.filter(c=>!c.leased&&!c.lost);for(const c of s.slice(Gt))$(c)}}}function Jt(){return{active:C.filter(t=>t.leased&&!t.lost).length,idle:C.filter(t=>!t.leased&&!t.lost).length}}function Yt(t,e){if(e!==null&&De(e))for(const o of t.values())o.visible=!1}const Kt=new be("#aaaaaa");function Xt(t){t.background=Kt,t.fog=null,t.environment=null,t.traverse(e=>{H(e,"envObject")&&(e.visible=!1)})}const Zt={activeAuthoring:t=>Ve(t),panelAuthoring:t=>je(t).adapter,pick:(t,e,r,o)=>vt(t,e,r,{intent:o}),toolOwner:(t,e)=>Re(t,e),toolOwnerPainted:(t,e)=>X(t)&&xe(t,e),threeSurfaceShowing:(t,e)=>X(t)&&(e instanceof Te?e.childAdapters().some(r=>r.kind==="three"):!e.rects&&typeof e.hierarchy.object3D=="function"),threeViewportRootId:t=>Me(t),applyRootHiddenVisibility:Yt,suppressRootEnvironment:Xt},er=f.lazy(async()=>({default:(await y(async()=>{const{ToolObject3DPreview:t}=await import("./ToolObject3DPreview-BfNcqtFv.js");return{ToolObject3DPreview:t}},__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]))).ToolObject3DPreview})),tr=f.lazy(async()=>({default:(await y(async()=>{const{ToolObject3DAuthoring:t}=await import("./StageHost-D1Sz5aud.js").then(e=>e.S);return{ToolObject3DAuthoring:t}},__vite__mapDeps([32,4,5,2,6,1,7,8,9,10,11,33,34,35,12,13,36,16,17,21,37,38,39,40,19,25,26,27,28,41,18,42,43,44,45,46,47,48,49,31,20,22,23,24,14,50,51,52,53,54,55,30,56,57,58]))).ToolObject3DAuthoring}));function rr(t){return h.jsx(f.Suspense,{fallback:h.jsx("div",{style:{minHeight:240},children:"Loading 3D preview…"}),children:h.jsx(er,{...t})})}function or(t){return f.useEffect(()=>Ne(t.documentId),[t.documentId]),h.jsx(f.Suspense,{fallback:h.jsx("div",{style:{minHeight:240},children:"Loading 3D authoring surface…"}),children:h.jsx(tr,{...t})})}const ae={model:f.lazy(async()=>{const{ModelAssetDocument:t}=await y(async()=>{const{ModelAssetDocument:e}=await import("./ModelAssetDocument-BBDnXTQm.js");return{ModelAssetDocument:e}},__vite__mapDeps([59,1,2,5,6,7,8,4,9,10,11,15,16,17,18,19,20,21,22,12,13,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,14,50,51,52,53,54,55,30,56,57,58,60,61,62]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,displayName:e.displayName,active:e.active})}}),"entity-model":f.lazy(async()=>{const{EntityModelDocument:t}=await y(async()=>{const{EntityModelDocument:e}=await import("./EntityModelDocument-BltE1A7W.js");return{EntityModelDocument:e}},__vite__mapDeps([63,1,2,34,35,12,13,36,16,17,4,5,6,7,8,9,10,11,21,37,38,42,15,18,19,20,22,23,24,25,26,27,28,29,32,33,39,40,41,43,44,45,46,47,48,49,31,14,50,51,52,53,54,55,30,56,57,58,60,61,62]));return{default:e=>h.jsx(t,{documentId:e.documentId,entityId:e.entityId??"",displayName:e.displayName,active:e.active})}}),environment:f.lazy(async()=>{const{EnvironmentAssetDocument:t}=await y(async()=>{const{EnvironmentAssetDocument:e}=await import("./EnvironmentAssetDocument-QuLkCom9.js");return{EnvironmentAssetDocument:e}},__vite__mapDeps([64,1,2,4,5,6,7,8,9,10,11,12,13,14,27,28,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),lut:f.lazy(async()=>{const{LutAssetDocument:t}=await y(async()=>{const{LutAssetDocument:e}=await import("./LutAssetDocument-B6GmsOYd.js");return{LutAssetDocument:e}},__vite__mapDeps([66,1,2,4,5,6,7,8,9,10,11,67,12,13,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),shader:f.lazy(async()=>{const{ShaderAssetDocument:t}=await y(async()=>{const{ShaderAssetDocument:e}=await import("./ShaderAssetDocument-ImI6jbzB.js");return{ShaderAssetDocument:e}},__vite__mapDeps([68,1,2,4,5,6,7,8,9,10,11,69,12,13,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),"model-preview":f.lazy(async()=>{const{Object3DPreview:t}=await y(async()=>{const{Object3DPreview:e}=await import("./Object3DPreview-pn9i3vwZ.js");return{Object3DPreview:e}},__vite__mapDeps([3,4,5,2,6,1,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]));return{default:e=>h.jsx(t,{assetPath:e.assetPath,...e.materialPath?{materialPath:e.materialPath}:{},displayName:e.displayName})}}),module:f.lazy(async()=>{const{LiveModuleDocument:t}=await y(async()=>{const{LiveModuleDocument:e}=await import("./LiveModuleDocument-CaGmr0EA.js");return{LiveModuleDocument:e}},__vite__mapDeps([70,1,2,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,12,13,23,24,25,26,27,28,29,53,71,58,39,40]));return{default:e=>e.projectRoot?h.jsx(t,{documentId:e.documentId,projectRoot:e.projectRoot,modulePath:(e.assetPath.split(/[?#]/,1)[0]??e.assetPath).replace(/^\//,""),displayName:e.displayName,active:e.active,fallback:e.fallback}):e.fallback}})},nr={recognize:async(t,e)=>(await y(async()=>{const{loadNativeQuarksJsonSource:r}=await import("./QuarksAssetDocument-2x66XymD.js");return{loadNativeQuarksJsonSource:r}},__vite__mapDeps([72,1,2,5,6,7,8,4,9,10,11,20,21,17,22,12,13,23,24,25,26,27,28,51,73,32,33,34,35,36,16,37,38,39,40,19,41,18,42,43,44,45,46,47,48,49,31,14,50,52,53,54,55,30,56,57,58,60,61,62,15,29]))).loadNativeQuarksJsonSource(t,e),Viewer:f.lazy(async()=>{const{QuarksAssetDocument:t}=await y(async()=>{const{QuarksAssetDocument:e}=await import("./QuarksAssetDocument-2x66XymD.js");return{QuarksAssetDocument:e}},__vite__mapDeps([72,1,2,5,6,7,8,4,9,10,11,20,21,17,22,12,13,23,24,25,26,27,28,51,73,32,33,34,35,36,16,37,38,39,40,19,41,18,42,43,44,45,46,47,48,49,31,14,50,52,53,54,55,30,56,57,58,60,61,62,15,29]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,displayName:e.displayName,active:e.active,source:e.content})}})};function ar(){const t=[...Object.keys(ae).map(e=>Le(e,ae[e])),ze(nr)];return()=>{for(const e of t)e()}}async function se(t){const e=new Image;return e.src=t,await e.decode(),e}function sr(){return Fe((t,e)=>{const r=k();if(r&&r.viewportCanvas()===t)return(async()=>{const n=await Be(t);if(n)return n;const a=r.captureViewportImage(e);return a?se(a):null})();const o=wt().find(n=>n.renderer.domElement===t);return o?(async()=>{const n=await o.requestPresentedFrame();if(n)return n;const a=o.captureImage(e);return a?se(a):null})():null})}function ir(t){const e=yt(t);if(e||_e(t)||H(t,"authoringRoot")===!0||!bt(t))return e;const r=H(t,"authoringComponent");return typeof r=="string"&&r?r:void 0}function cr(t){if(typeof t.object3D!="function")return He;const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=St(t,o),a=n?{componentRoot:ir(n),authoredEntity:H(n,"authoringRoot")===!0,builtInternal:_e(n)}:void 0;return r.set(o,a),a}}const ur=1e-4,lr="World-anchored — content is placed in world space by the game each frame; moving this container offsets future placements away from their source.";function Ce(t){if(!t)return 0;const e=t;if(e.isInstancedMesh!==!0)return 0;const r=e.count;return typeof r=="number"&&r>0?r:0}function dr(t){const e=t.elements;for(let r=0;r<16;r++){const o=r%5===0?1:0,n=e[r];if(!Number.isFinite(n)||Math.abs(n-o)>ur)return!1}return!0}const ie=new dt,ce=new P;function fr(t,e){const r=Ce(t);if(r===0)return null;const o=pr(t,e);return{units:r,detail:Ae(r),worldAnchored:o,note:o?lr:null}}function pr(t,e){if(!e||e.isEmpty()||!dr(t.matrixWorld))return!1;const r=t.geometry;return r.boundingBox===null&&r.computeBoundingBox(),r.boundingBox?(ie.copy(r.boundingBox),e.getCenter(ce),!ie.containsPoint(ce)):!1}function mr(t){const e=Ce(t);return e===0?null:Ae(e)}function Ae(t){return`${t} instanced unit${t===1?"":"s"}`}function hr(){return qe({detail:(t,e,r)=>mr(q(t,I(r).objectMap,e)),marks:t=>cr(t),structureLog:t=>{const e=I(t);return{epoch:()=>e.gizmoEpoch,parentChangesSince:r=>e.ingestObjectMapChangesSince(r)}}})}function vr(t){return Math.min(1600,Math.max(800,900+t*25))}function gr(t){return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function Oe(t,e,r=new P(0,1,0)){const o=new P().subVectors(e,t),n=o.length();if(n<1e-6)return[t.clone(),t.clone(),e.clone(),e.clone()];const a=Math.min(n*.18,6),s=new P().crossVectors(o,r);s.lengthSq()>1e-9?s.normalize().multiplyScalar(Math.min(n*.08,2.5)):s.set(0,0,0);const c=r.clone().normalize().multiplyScalar(a),u=t.clone().addScaledVector(o,.3).add(c).add(s),m=e.clone().addScaledVector(o,-.3).addScaledVector(c,.6).addScaledVector(s,.5);return[t.clone(),u,m,e.clone()]}const wr=1<<31;function yr(t){return(t.layers.mask&wr)!==0||/gizmo/i.test(t.name)}function ke(t){if(yr(t))return null;if(t.isCamera)return t;for(const e of t.children){const r=ke(e);if(r)return r}return null}function br(t,e,r){const o=new P,n=new J;return e.getWorldPosition(o),e.getWorldQuaternion(n),{entityId:t,position:o.toArray(),quaternion:n.toArray(),fov:r}}function Sr(t){for(const[e,r]of t.objectMap){const o=ke(r);if(!o)continue;const n=o;return br(e,o,n.isPerspectiveCamera?n.fov:60)}return null}function Pr(t){t.curve=new Se(Oe(t.startPos,t.endPos))}let D=null;function _r(t){const e=U(),r=k()?.objectMap,o=r?Sr({objectMap:r}):null;if(!o||!e)return!1;const n=e.camera.position.clone(),a=new P().fromArray(o.position);return D={runtime:{startPos:n,startQuat:e.camera.quaternion.clone(),startFov:e.camera.fov,endPos:a,endQuat:new J().fromArray(o.quaternion),endFov:o.fov,curve:new Se(Oe(n,a)),startedAt:performance.now(),durationMs:vr(n.distanceTo(a)),landed:!1},snapshot:{position:e.camera.position.clone(),target:e.orbit.target.clone(),up:e.camera.up.clone(),fov:e.camera.fov},onLanded:t,getLiveCamera:null,driving:!0},e.orbit.enabled=!1,!0}function Er(){const t=U(),e=D;if(!e||(e.driving=!1,!t))return;const r=t.camera,o=new P(0,0,-1).applyQuaternion(r.quaternion),n=Math.max(1,e.snapshot.position.distanceTo(e.snapshot.target));t.orbit.target.copy(r.position).addScaledVector(o,n),r.up.set(0,1,0).applyQuaternion(r.quaternion),t.orbit.enabled=!0}function Cr(){const t=D;if(!t)return;D=null;const e=U();if(!e)return;const r=t.snapshot;e.camera.position.copy(r.position),e.orbit.target.copy(r.target),e.camera.up.copy(r.up),e.camera.lookAt(r.target),e.camera.fov!==r.fov&&(e.camera.fov=r.fov,e.camera.updateProjectionMatrix()),e.orbit.enabled=!0,e.orbit.update()}const Q=new P,ue=new J;Pt(Ar);function Ar(){const t=D,e=U();if(!t||!e||!t.driving)return;const r=t.runtime,o=t.getLiveCamera?.()??null,n=o?.isObject3D?o:null;if(n){n.getWorldPosition(Q),n.getWorldQuaternion(ue),Q.distanceToSquared(r.endPos)>1e-8&&(r.endPos.copy(Q),Pr(r)),r.endQuat.copy(ue);const u=n.fov;typeof u=="number"&&(r.endFov=u)}const a=e.camera;if(r.landed){a.position.copy(r.endPos),a.quaternion.copy(r.endQuat),a.fov!==r.endFov&&(a.fov=r.endFov,a.updateProjectionMatrix());return}const s=Math.min(1,(performance.now()-r.startedAt)/r.durationMs),c=gr(s);a.position.copy(r.curve.getPoint(c)),a.quaternion.slerpQuaternions(r.startQuat,r.endQuat,c),a.fov=r.startFov+(r.endFov-r.startFov)*c,a.updateProjectionMatrix(),s>=1&&(r.landed=!0,t.onLanded())}function Or(){return Ue({begin:_r,track:t=>{D&&(D.getLiveCamera=t)},settle:Er,end:Cr})}const kr=f.lazy(()=>y(()=>import("./InspectorObjectPreview-BpttBw3o.js"),__vite__mapDeps([74,1,2,63,34,35,12,13,36,16,17,4,5,6,7,8,9,10,11,21,37,38,42,15,18,19,20,22,23,24,25,26,27,28,29,32,33,39,40,41,43,44,45,46,47,48,49,31,14,50,51,52,53,54,55,30,56,57,58,60,61,62])).then(t=>({default:t.InspectorObjectPreview})));function Ir(t,e){return{preview:t.isCamera?null:({displayName:r,previewKey:o,actions:n})=>a=>f.createElement(Ge,{picture:()=>f.createElement(kr,{previewKey:o,object:t,displayName:r,fill:!0}),previewKey:o,actions:n,...a?{mode:a}:{}}),instanced:fr(t,_t(t)),assetDocument:e}}function Dr(){return We((t,e)=>{const r=k();if(!r)return null;const o=q(t,r.objectMap,e);return o?Ir(o,r.objectMap.has(e)?{open:()=>Qe("asset-editor:entity",r.shell,{entityId:e,title:o.name||e})}:null):null})}const le=new WeakMap,Y={activeAuthoring(t){let e=le.get(t);return e||(e=Je(t,"No authoring adapter"),le.set(t,e)),e},panelAuthoring(t){return Y.activeAuthoring(t)},pick(){return null},toolOwner:$e,toolOwnerPainted(){return!0},threeSurfaceShowing(t,e){return!e.rects&&typeof e.hierarchy.object3D=="function"},threeViewportRootId(){return null},applyRootHiddenVisibility(){},suppressRootEnvironment(){}};let F=Y;function Mr(t){if(F!==t){if(F!==Y)throw new Error("A viewport authoring policy is already installed.");F=t}}function lo(){return F}const de=0,Tr=16777215,fe=10;function xr(t){return Ct(t,"Compare reference GLB")}function pe(t,e){const r=Dt(t),o=new ee;o.rotation.y=Mt(e),o.add(r);const n=new ee;n.add(o),n.updateWorldMatrix(!0,!0);const a=Tt(n,"front"),s=[a.center.x-a.size.x/2,a.center.y-a.size.y/2,a.center.z-a.size.z/2],c=[a.center.x+a.size.x/2,a.center.y+a.size.y/2,a.center.z+a.size.z/2],u=xt(s,c);return n.scale.setScalar(u.scale),n.position.set(...u.position),n.updateWorldMatrix(!0,!0),{wrapper:n,dispose:()=>Rt(r)}}function Rr(t,e){const r=jt,o=r*e,n=new mt(-o,o,r,-r,.01,fe*4),a=t==="front"?new P(0,0,1):new P(1,0,0);return n.position.set(0,ne,0).addScaledVector(a,fe),n.up.set(0,1,0),n.lookAt(0,ne,0),n.updateProjectionMatrix(),n.updateMatrixWorld(!0),n}function jr(t,e,r={}){const o=te(r.width),n=te(r.height),a=o/n,s=[];let c=null;try{const u=pe(t,re(t));s.push(u.dispose);const m=pe(e,r.refForward??re(e));s.push(m.dispose);const O=new ft({color:Tr});s.push(()=>O.dispose());const L=p=>{const i=new pt;return i.background=new be(de),i.overrideMaterial=O,i.add(p),i},v=L(u.wrapper),b=L(m.wrapper),_=ge(new we({antialias:!1,alpha:!1,preserveDrawingBuffer:!0}));c=_,_.setPixelRatio(1),_.toneMapping=ye,_.setClearColor(de,1),_.setSize(o,n,!1);const M=document.createElement("canvas");M.width=o,M.height=n;const S=M.getContext("2d");if(!S)throw new Error("Unable to create the compare readback canvas.");const A=(p,i,R,g)=>{_.render(p,i),S.clearRect(0,0,o,n),S.drawImage(_.domElement,0,0);const j=S.getImageData(0,0,o,n).data,V=At(j,o*n);if(!V.some(K=>K!==0))throw new Error(`Compare ${g} view rendered an empty ${R} silhouette — nothing to score.`);return{image:{base64:oe(M),mimeType:"image/png"},mask:V}},w=document.createElement("canvas");w.width=o,w.height=n;const T=w.getContext("2d");if(!T)throw new Error("Unable to create the compare overlay canvas.");const x=[];for(const p of Ot){const i=Rr(p,a),R=A(v,i,"asset",p),g=A(b,i,"reference",p),j=kt(R.mask,g.mask);T.putImageData(new ImageData(It(R.mask,g.mask),o,n),0,0),x.push({view:p,iou:j.iou,overlay:{base64:oe(w),mimeType:"image/png"},asset:R.image,ref:g.image})}return{width:o,height:n,views:x}}finally{c?.dispose(),c?.forceContextLoss();for(const u of s.reverse())u()}}async function Vr(t,e,r={}){const o=await Et(t);try{return await Ie(o,e,r)}finally{Ee(o)}}async function Ie(t,e,r={}){const o=await xr(e);try{return jr(t,o,r)}finally{Ee(o)}}async function Nr(t,e){const r=e.assetPath,o=e.entityId,n=e.glbBase64;if(+(typeof r=="string")+ +(typeof o=="string")+ +(typeof n=="string")!==1)return{ok:!1,error:"capture-asset-preview requires exactly one of assetPath, entityId or glbBase64."};const s=e.width,c=e.height,u=e.background,m=e.shots,O=e.shotSet,L=e.forward,v=e.compare,b=e.stage,_=e.camera,M=e.pose;if(s!==void 0&&typeof s!="number"||c!==void 0&&typeof c!="number"||u!==void 0&&u!=="neutral"&&u!=="transparent"||m!==void 0&&m!=="source")return{ok:!1,error:"Invalid asset preview dimensions, background, or shots mode."};if(b!==void 0&&b!=="lab"&&b!=="scene")return{ok:!1,error:`capture-asset-preview stage must be "lab" or "scene", got ${String(b)}.`};if(O!==void 0&&m!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine a shotSet definition with a shots mode."};const S=Ye("capture-asset-preview",_);if(typeof S=="string")return{ok:!1,error:S};const A=Ke("capture-asset-preview",M);if(typeof A=="string")return{ok:!1,error:A};if((S||A)&&(m!==void 0||O!==void 0||v!==void 0||b==="scene"))return{ok:!1,error:'capture-asset-preview cannot combine camera/pose with a shots mode, a shotSet definition, compare, or stage "scene" — those legs stage their own cameras and poses.'};let w;if(O!==void 0)try{w=Vt(O)}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}const T=G(L);if(m==="source"&&T===null)return{ok:!1,error:"capture-asset-preview --shots source requires a non-degenerate forward [x,y,z]."};if(v!==void 0){if(m!==void 0||w!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine compare with shots."};if(typeof v!="object"||v===null||typeof v.glbBase64!="string"||v.forward!==void 0&&G(v.forward)===null)return{ok:!1,error:"capture-asset-preview compare requires { glbBase64: string, forward?: [x, y, z] } with a non-degenerate ground-plane forward."}}if(typeof n=="string"){if(m!==void 0||v!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine glbBase64 with a named shots mode or compare."};if(b==="scene")return{ok:!1,error:'capture-asset-preview stage "scene" photographs a live scene entity — glbBase64 bytes stand nowhere in the scene.'}}const x=b==="scene"?t.scene:null;if(b==="scene"){if(typeof o!="string")return{ok:!1,error:'capture-asset-preview stage "scene" photographs a live scene entity — pass entityId, not assetPath.'};if(m!==void 0||w!==void 0||v!==void 0)return{ok:!1,error:'capture-asset-preview cannot combine stage "scene" with a shots mode, a shotSet definition or compare.'};if(!x)return{ok:!1,error:'capture-asset-preview stage "scene" requires a bound viewport scene; none is bound yet.'}}const p=typeof o=="string"?q(he(t.shell),t.objectMap,o):null;if(typeof o=="string"&&!p)return{ok:!1,error:`Entity not found: ${o}`};try{const i={...typeof s=="number"?{width:s}:{},...typeof c=="number"?{height:c}:{},...u?{background:u}:{},...S?{camera:S}:{},...A?{pose:A}:{}};if(v!==void 0){const g=v,j=G(g.forward),V={...typeof s=="number"?{width:s}:{},...typeof c=="number"?{height:c}:{},...j?{refForward:j}:{}};return{ok:!0,data:{...typeof r=="string"?await Vr(r,g.glbBase64,V):await Ie(p,g.glbBase64,V)}}}return w!==void 0?{ok:!0,data:{...typeof n=="string"?await Nt(n,w,i):typeof r=="string"?await Lt(r,w,i):zt(p,w,i)}}:m==="source"?{ok:!0,data:{...typeof r=="string"?await Ft(r,T,i):Bt(p,T,i)}}:x?{ok:!0,data:{...Ht(p,x,i)}}:typeof n=="string"?{ok:!0,data:{...await qt(n,i)}}:{ok:!0,data:{...typeof r=="string"?await Ut(r,i):Wt(p,i)}}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}}function E(){const t=B();return t?Pe(t):null}function l(t,e,r="none"){return{...e===void 0?{}:{timeoutMs:e},derivedRefresh:r,handle:o=>{const n=k();return n?t(n,o):{ok:!1,error:`${o.type} needs an editor session; none has opened yet.`}}}}const d={ok:!0},Lr={"focus-entity":l((t,e)=>(E()?.frameIds([e.id])||t.shell.focusOnEntity(e.id),d)),"frame-entity":l((t,e)=>{const r=e.id;if(typeof r!="string"||r.length===0)return{ok:!1,error:'frame-entity requires a string "id" (the entity to frame).'};const o=E();if(o)return o.frameIds([r])?d:{ok:!1,error:`Entity not found: ${r}`,data:{code:"ENTITY_NOT_FOUND"}};const n=he(t.shell);return n.hierarchy.node(r)!==null&&n.rects||q(n,t.objectMap,r)?(t.shell.focusOnEntity(r),d):{ok:!1,error:`Entity not found: ${r}`,data:{code:"ENTITY_NOT_FOUND"}}}),"focus-selection":l(t=>(E()?.frameSelection()||t.shell.focusOnSelection(),d)),"view-preset":l((t,e)=>{const r=e.preset,o=["top","front","right","perspective"];if(typeof r!="string"||!o.includes(r))return{ok:!1,error:`view-preset requires one of ${o.join(", ")}, got ${r===void 0?"nothing":JSON.stringify(r)}.`};const n=r,a=E();return a?a.setViewPreset(n==="perspective"?"isometric":n):t.shell.setViewPreset(n),d}),"set-camera":l((t,e)=>{const r=e.position,o=e.target,n=e.fov;if(!r||!o||typeof r.x!="number"||typeof r.y!="number"||typeof r.z!="number"||typeof o.x!="number"||typeof o.y!="number"||typeof o.z!="number")return{ok:!1,error:"set-camera requires numeric {x,y,z} position and target."};const a=E();return a?a.setCameraPose(r,o,n):t.shell.setCameraPose(r,o,n),d}),"document-orbit":l((t,e)=>me(e),12e4),"document-turntable":l((t,e)=>me(e),12e4),"document-frame":l((t,e)=>{const r=E();if(!r)return{ok:!1,error:"document-frame needs an Object3D document open and active. For the Scene viewport use `frame-entity`/`focus-selection`.",data:{code:"NO_ACTIVE_OBJECT3D_DOCUMENT"}};const o=e.fit;return o!==void 0&&(typeof o!="number"||!(o>=.1&&o<=10))?{ok:!1,error:'document-frame: "fit" must be a number in 0.1..10.'}:r.frame(typeof o=="number"?o:1)?{ok:!0,data:{...r.cameraPose()}}:{ok:!1,error:"Nothing to frame: the document subject has no measurable bounds.",data:{code:"EMPTY_FRAME_BOUNDS"}}}),"capture-viewport":l(async(t,e)=>{const r=et(e);if("error"in r)return{ok:!1,error:r.error};if(t.hasAdoptedScene)try{const s=await ve().documents.captureActive(r.size);return{ok:!0,data:{base64:s.base64,mimeType:s.mimeType}}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}const o=t.captureViewportImage(r.size);if(!o)return{ok:!1,error:`This door photographs the editor's own three.js Scene viewport, and nothing has bound one (no renderer/scene/camera). A canvas-surface world (a first-party canvas root, or a PixiJS/Phaser/Babylon ingest) never binds it — it draws on its own canvas in the Game document. Capture that through \`capture-active-document\` (\`editor.captureActiveDocument()\`) or the running game through \`bridge-screenshot\` (${tt("screenshot")}).`};const n=o.indexOf(",");return{ok:!0,data:{base64:n>=0?o.slice(n+1):o,mimeType:"image/png"}}},void 0,"if-content-changed"),"capture-asset-preview":l((t,e)=>Nr(t,e),3e4,"if-content-changed"),"set-grid":l((t,e)=>{const r=B();return!r||!Z(r)?{ok:!1,error:"set-grid: the active document draws no grid."}:(Ze(r,e.enabled),d)}),"set-helpers":l((t,e)=>{const r=z(t.shell);return r.showHelpers!==e.enabled&&r.toggleHelpers(),d}),"set-stats":l((t,e)=>{const r=z(t.shell);return I(r).showStats!==e.enabled&&I(r).toggleStats(),d}),"set-shading-mode":l((t,e)=>{const r=E(),o=e.mode;if(o==="preview"||o==="rendered"){const n=B(),a=n?Z(n)?.stageKind:void 0;if(!r||!a||Xe(a)?.modes?.[o]?.lighting===void 0)return{ok:!1,error:`Shading mode "${o}" is lit as a stage says, and the active document's stage says nothing for it.`}}return r?r.setMode(e.mode):t.setShadingMode(e.mode),d}),"set-helper-type":l((t,e)=>{const r=z(t.shell),o=e.helperType,n=E();return n&&o==="bounds"?(n.setBounds(e.enabled),d):n&&o==="skeletons"?(n.setSkeleton(e.enabled),d):(r.helperVisibility[o]!==e.enabled&&r.toggleHelperType(o),d)}),"set-transform-mode":l((t,e)=>(t.shell.setTransformMode(e.mode),d)),"set-transform-space":l((t,e)=>(t.shell.setTransformSpace(e.space),d)),"set-snap":l((t,e)=>(t.shell.snapEnabled!==e.enabled&&t.shell.toggleSnap(),d))};async function me(t){const e=E();if(!e)return{ok:!1,error:`${t.type} needs an Object3D document open and active (a model, a live module, an entity model). Open one with \`editor.openAsset(<path>)\` first.`,data:{code:"NO_ACTIVE_OBJECT3D_DOCUMENT"}};const r=t.type==="document-orbit"?t.duration:t.seconds;return r!==void 0&&(typeof r!="number"||!(r>=0&&r<=60))?{ok:!1,error:`${t.type}: the move's length must be a number of seconds in 0..60.`}:{ok:!0,data:{...t.type==="document-orbit"?await e.orbit({...typeof t.azimuth=="number"?{azimuth:t.azimuth}:{},...typeof t.elevation=="number"?{elevation:t.elevation}:{},...typeof r=="number"?{duration:r}:{}}):await e.turntable({...typeof r=="number"?{seconds:r}:{},...typeof t.revolutions=="number"?{revolutions:t.revolutions}:{}})}}}function zr(){return ve().session.reportFacet(()=>{const t=k();if(!t)return{};const e=z(t.shell),r=B(),o=r?Pe(r)?.presentation():void 0,n=I(e).cameraPose;return{showGrid:r?rt(r):!0,showHelpers:e.showHelpers,showStats:I(e).showStats,shadingMode:o?.mode??t.shadingMode,helperVisibility:{...e.helperVisibility,...o?{bounds:o.bounds,skeletons:o.skeleton}:{}},transformMode:e.transformMode,transformSpace:t.shell.transformSpace,snapEnabled:t.shell.snapEnabled,...n?{camera:{position:{x:n.position.x,y:n.position.y,z:n.position.z},target:{x:n.target.x,y:n.target.y,z:n.target.z},fov:n.fov}}:{}}})}const Fr={save:t=>it("view",t),saveThumbnail:st},Br=new Map;let N=null;function fo(){if(N)return N;const t=[ot({Object3DPreview:rr,Object3DAuthoring:or}),nt("three-viewport",Lr),ar(),Dr(),gt(),zr(),sr(),hr(),Or(),ct({object:e=>k()?.objectMap.get(e)??null,objects:()=>k()?.objectMap??Br}),W("hostLive",ut),W("interactive",Jt),W("inspectorPreview",ht),at(e=>I(e).attachStatePersistence(Fr))];return Mr(Zt),N=()=>{for(const e of t.reverse())e();N=null},N}export{uo as a,fr as d,fo as e,Ce as i,lo as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as r}from"./three-integration-BHoulbny.js";import"./index-CvGsVzTo.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-BaxBYi7u.js";import"./root-stacking-BEd9ZvxC.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./model-thumbnail-BDU_QU37.js";import"./studio-environment-DK0ke0m0.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-CWaOPDYg.js";import"./three-state-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./editor-layers-BK3fNRb7.js";import"./entity-object-BFppZ54X.js";import"./three-contract-Dkt6PmWY.js";import"./hierarchy-marks-Pb6wnNcu.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-door-CuJjGYTz.js";import"./content-bounds-BFpR_e--.js";import"./asset-preview-B7j9QV6N.js";import"./bitmap-label-Ct4k6ehY.js";const Q="workspace.service";function R(){return r()}export{Q as point,R as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d0 as c,d1 as l,d2 as u,d3 as f,d4 as m}from"./index-CvGsVzTo.js";function g(t,n){if(t.setTransformMode(n),n==="select")return;const r=[...t.selectedEntityIds];if(r.length===0)return;const a=c(t),s=((a===null?null:l(a)?.adapter)??u(t).adapter).transforms?.editability;if(!s)return;let e;for(const i of r){const o=f(d=>s(i,d));if(!o.locked)return;e??=o.reason}e&&m(e)}export{g as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as t}from"./index-CvGsVzTo.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-DEnkv3v6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./configurations-BcYOQ7i-.js";import"./run-selection-BMQWV9Fn.js";import"./game-network-BPTyOFqA.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-XfhvyMrK.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dagj3b6J.js";import"./contract-system-adapters-BRHtWOi_.js";import"./game-contract-seams-5IUqvr7b.js";import"./seeded-random-D0QPgfm6.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B7S-wGjC.js";import"./capability-coverage-9qm5WVwt.js";import"./edit-mode-authoring-DubxVdEM.js";import"./json-history-resource-CckDydoO.js";import"./binding-resolver-CBXePHiR.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DCnaxwIb.js";import"./canvas-entry-runtime-Cjga4XYp.js";import"./three-ingest-runtime-CwRnwvb0.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-lrfMBhf9.js";import"./ingest-source-persistence-CPlDA2D8.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CkSAEMH-.js";import"./mounted-authoring-D-tXkNKH.js";import"./entity-object-BFppZ54X.js";import"./user-data-DfBtZvxw.js";import"./workspace-arrangement-C9uemwSK.js";import"./three-contract-Dkt6PmWY.js";import"./three-bdxPiUPb.js";import"./editor-layers-BK3fNRb7.js";import"./component-instance-root-MBgAuUpp.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BuqO9MDt.js";import"./source-persistence-backend-Djuk0m-7.js";import"./three-projection-core-BO23VKAP.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BcTFD1ZS.js";import"./deferred-ingest-play-DZiOEH9a.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-B6BiehHR.js";import"./board-guides-whelE-Dr.js";import"./relative-import-specifier-BvzqkvYS.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./writer-tw6EcuVO.js";import"./three-state-BhQOBgKC.js";import"./editor-shell-store-Bro0arjr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CuJjGYTz.js";import"./game-surface-defaults-D8S4cRxi.js";const Dr="workspace.header",Fr=0;function Gr(){const{project:r}=t();return m.useSyncExternalStore(r.subscribe,r.mounts,r.mounts)?o.jsx(p,{}):null}export{Gr as default,Fr as order,Dr as point};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-Drqhmo7i.js","assets/react-story-board-6-BjI32N.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-CvGsVzTo.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/bitmap-label-Ct4k6ehY.js","assets/StoryPreviewMount-D2zLWzWy.js","assets/story-presentation-DgAoj9Qt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{dm as m,am as s,dn as a,aw as n,_ as c,b9 as d}from"./index-CvGsVzTo.js";import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{d as l,p as v,r as P}from"./design-time-layers-DT4X-pJp.js";import{RootDocumentContent as w}from"./world-documents-Dvn8e5I0.js";import{U as _}from"./component-board.service-yIS2UB-T.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-DubxVdEM.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./react-story-board-6-BjI32N.js";import"./game-surface-defaults-D8S4cRxi.js";import"./react-canvas-navigation-CBorZtWB.js";import"./component-board-registry-DrIa2csL.js";import"./surface-state-DlUcJe84.js";import"./board-guides-whelE-Dr.js";import"./CanvasSceneViewport-Z8OReqpB.js";import"./RootSelectionOverlay-B9rf-SSV.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-BaxBYi7u.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-DxfAFkho.js";import"./inference-diagnostics-BCwXk-CS.js";import"./Toolbar-BJRJsbHG.js";import"./transform-mode-request-Bg6T_rOC.js";import"./TransientHint-CDvYgnzu.js";import"./ReactCanvasControls-rFwp2CeP.js";import"./story-media-presence-CYc2fP4y.js";const y={revision:()=>JSON.stringify(d().map(({id:i,modulePath:t})=>[i,t])),subscribe:s,capture:async({width:i,height:t})=>{const{captureDomStoryBoardPreview:o}=await c(async()=>{const{captureDomStoryBoardPreview:e}=await import("./story-capture-Drqhmo7i.js");return{captureDomStoryBoardPreview:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]));return o(i,t)}};function Z({store:i,composite:t}){const o=l(t).find(r=>r.kind==="dom")??v(),e=r=>u.jsx(w,{...r,composite:t,descriptor:o,store:i});m({id:a,title:_,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:o.worldId,...o.path?{sourcePath:o.path}:{}},Content:e,preview:y,presentation:()=>{const r=n()?.rootPath,p=r?P(r,o.worldId):void 0;return{kind:"workspace",id:a,...p?{story:p}:{}}}},{category:"canvas",default:!t.childAdapters().some(r=>r.kind==="three"||r.kind==="canvas")})}export{Z as installUiBoard};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const d="/work/.volter-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],P="/__editor/blender-wasm";function D(e){return new URL(`${P}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${P}/status answered ${e.status}`]}}async function J(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine-CO-jG_ik.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-DQljvfR7.js");return r(e,t)}function U(e){return e<200?1:e<5e3?5:25}const C=e=>new Promise(t=>setTimeout(t,e)),B=new TextDecoder;function ie(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(w=>w.endsWith(".done")));await s(l);for(const w of l){const h=w.slice(0,-5);if(Number(h)<=a)continue;a=Number(h);const $=JSON.parse(B.decode(await e.readFile(`${d}/ask/${h}.json`)));let p;try{p=await t.ask($)}catch(S){p={error:S instanceof Error?S.message:String(S)}}await Promise.all([e.writeFile(`${d}/reply/${h}.json`,JSON.stringify(p??null)),e.writeFile(`${d}/reply/${h}.done`,"1")]),o.add(h)}}async function c(u){const l=String(++n);await Promise.all([e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),e.writeFile(`${d}/in/${l}.done`,"1")]);const w=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const p=JSON.parse(B.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),p.error)throw new Error(p.error);return p.result}const h=r?.();if(h)throw new Error(`Blender is gone, so this call will never be answered: ${h}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const $=U(performance.now()-w);await(e.changed?e.changed($):C($))}}return{request:c}}const L=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",W={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=W[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function H(e,t){const r=(n,a)=>{if(L(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function V(e,t){const r=async(n,a)=>{if(L(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(w=>w.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const m=e=>self.postMessage(e),k=(e,t)=>m({op:"log",level:e,text:t});let b=null,v=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,E=null,T=!1,A=Promise.resolve();function Q(e){const t=A.then(e);return A=t.catch(()=>{}),t}function N(e){T=e,m({op:"document-dirty",dirty:e})}async function R(){if(!f||E===null)return;const e=E;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}N(!1),k("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await J({project:e,log:k,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&E!==null&&N(!0);const c=await r.engine.readArena(),u=await V(c,o),l=await K(H(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await _(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&(E=t),b={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(b)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return v=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function O(e){x.has(e)||(x.add(e),k("error",e))}async function ee(e){const t=s=>(O(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&O(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function _(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){O(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function F(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!b||!v||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return T?(await R(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await _(t,v);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return b.sceneInfo();case"object-info":return b.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await b.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&m({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){F(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await F(e);T&&await R(),await I(),m({id:e.id,result:t})}catch(t){let r=g(t);try{await I()}catch(n){r+=`
|
|
2
|
-
Unable to deliver Blender history: ${g(n)}`}m({id:e.id,error:r})}re()}async function I(){if(!f||!b)return;const e=await f.request({op:"history-events"});e.length&&m({op:"history",entries:e})}export{P as A,se as P,d as S,D as a,ae as b,ie as o,C as s};
|