@volter/game-editor 0.5.156 → 0.5.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUNDLED_NOTICES +22 -22
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/music.json +2 -2
- package/dist/.vite/manifest.json +2163 -2163
- package/dist/assets/{AssetBudgetPanel-BQdPOlqp.js → AssetBudgetPanel-X38cPCO3.js} +3 -3
- package/dist/assets/{AudioViewer-C5y-GQP-.js → AudioViewer-xMM7RZH9.js} +1 -1
- package/dist/assets/{CanvasBoardDocument-DbChIzOl.js → CanvasBoardDocument-DCyh4eaO.js} +1 -1
- package/dist/assets/{CanvasSceneViewport-BAUsxjQl.js → CanvasSceneViewport-BA8eRjJY.js} +1 -1
- package/dist/assets/{ColorInput-DGN6sIXS.js → ColorInput-y8NzQ5q8.js} +1 -1
- package/dist/assets/{ColorPicker-C83d-sVK.js → ColorPicker-C3HI90eU.js} +1 -1
- package/dist/assets/{EntityModelDocument-D4IbBjti.js → EntityModelDocument-DrWN0e0N.js} +1 -1
- package/dist/assets/{EnvironmentAssetDocument-BqTeI8cz.js → EnvironmentAssetDocument-Bv8M7C1O.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-FqH6Sz1y.js → GameplaySessionTimeline-mMVtRemn.js} +1 -1
- package/dist/assets/{ImageViewer-C_4yhkuB.js → ImageViewer-D1mswm2G.js} +1 -1
- package/dist/assets/InspectorObjectPreview-DMNRuc0X.js +1 -0
- package/dist/assets/{JsonAssetDocument-C-drMm6I.js → JsonAssetDocument-DxLYMceV.js} +1 -1
- package/dist/assets/{LiveModuleDocument-C73e8H-p.js → LiveModuleDocument-BOO4_ypf.js} +1 -1
- package/dist/assets/{LutAssetDocument-DfBf46zV.js → LutAssetDocument-jf9ogNqN.js} +1 -1
- package/dist/assets/{ModelAssetDocument-BgP4YOdh.js → ModelAssetDocument-DbtKJsGQ.js} +1 -1
- package/dist/assets/{NonThreeAuthoringBootstrap-qnG1AmuP.js → NonThreeAuthoringBootstrap-ChEoVJQP.js} +1 -1
- package/dist/assets/{Object3DDocumentToolbar-34bmavxS.js → Object3DDocumentToolbar-Y-jpI3WD.js} +1 -1
- package/dist/assets/Object3DDocumentViewport-BOi94JfA.js +2 -0
- package/dist/assets/{Object3DPreview-wWjXCo6v.js → Object3DPreview-7LnLFpmg.js} +1 -1
- package/dist/assets/{OnlineAssetDetail-C4iaJDOr.js → OnlineAssetDetail-DVdZv1D1.js} +1 -1
- package/dist/assets/{PlayBar-CBvuzv1Q.js → PlayBar-B-GGRbBB.js} +1 -1
- package/dist/assets/{QuarksAssetDocument-BlYjfRGp.js → QuarksAssetDocument-2MqOJHlY.js} +1 -1
- package/dist/assets/{ReactCanvasControls-C06AmSIB.js → ReactCanvasControls-COp1PvO1.js} +1 -1
- package/dist/assets/{RootSelectionOverlay-CPw5aFQf.js → RootSelectionOverlay-6M-HHI3M.js} +1 -1
- package/dist/assets/{ShaderAssetDocument-BVeK6Owt.js → ShaderAssetDocument-PrwCSYxk.js} +1 -1
- package/dist/assets/{ShadowEditor-BKEyyzOq.js → ShadowEditor-EXaJ1Kud.js} +1 -1
- package/dist/assets/{SourceAssetViewer-DB6Fg4Re.js → SourceAssetViewer-Bk_LGk7S.js} +1 -1
- package/dist/assets/{StageHost-dHitOcUe.js → StageHost-CK78ezTC.js} +2 -2
- package/dist/assets/{StoryPreviewMount-BONsNxze.js → StoryPreviewMount-IbbNNzF4.js} +1 -1
- package/dist/assets/{ThreeBoardDocument-D4CSNWux.js → ThreeBoardDocument-DUakOh0j.js} +2 -2
- package/dist/assets/{ThreeIsolationSceneContent-DkXfPv14.js → ThreeIsolationSceneContent-BjAyHzL2.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-DvGqYC9c.js → ToolObject3DPreview-CRb_pBHc.js} +1 -1
- package/dist/assets/{Toolbar-BqUPRrhs.js → Toolbar-Bb7KArdo.js} +1 -1
- package/dist/assets/{TransientHint-w6qEumzV.js → TransientHint-BlB2atrU.js} +1 -1
- package/dist/assets/{VideoViewer-B99XdTSg.js → VideoViewer-D5fNjrcg.js} +1 -1
- package/dist/assets/{ViewportShadingMenu-9AaJLhq_.js → ViewportShadingMenu-D_-wHbzW.js} +1 -1
- package/dist/assets/{active-ingest-DwF45MBm.js → active-ingest-DJ8FmH5M.js} +2 -2
- package/dist/assets/{animation-clock-DW8tJ4l7.js → animation-clock-CINkiVZd.js} +1 -1
- package/dist/assets/{animation-mixers.service-kllpdYjk.js → animation-mixers.service-BST_khGa.js} +1 -1
- package/dist/assets/{animation-timeline.utility-C9UVqsSv.js → animation-timeline.utility-X54fMzvE.js} +1 -1
- package/dist/assets/{asset-budget-asset.menu-Cl8tmAtz.js → asset-budget-asset.menu-CfJth8-V.js} +1 -1
- package/dist/assets/{asset-budget.action-dw6ctYdi.js → asset-budget.action-ByyoIoUI.js} +1 -1
- package/dist/assets/{asset-budget.document-BfDL1bS4.js → asset-budget.document-CO1NrMEa.js} +1 -1
- package/dist/assets/{asset-budget.menu-DiOMl0Yh.js → asset-budget.menu-Cb99KwLd.js} +1 -1
- package/dist/assets/{asset-editor-persistence-D2o6zb5I.js → asset-editor-persistence-BF2Eqt0F.js} +1 -1
- package/dist/assets/{asset-loaders-bMb8Nvq8.js → asset-loaders-2LtXp4_y.js} +1 -1
- package/dist/assets/{asset-preview-uRqIcg3G.js → asset-preview-t-7PYPjJ.js} +1 -1
- package/dist/assets/{audio-unlock.service-CBeaLfYT.js → audio-unlock.service-DwkIGA6J.js} +1 -1
- package/dist/assets/{audio.utility-iWLchCUR.js → audio.utility-Mn4GcZIb.js} +1 -1
- package/dist/assets/autoplay.service-D7c8d5PV.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-Bt8B089v.js → babylon-authoring-adapter-BB5HErRG.js} +1 -1
- package/dist/assets/{binding-resolver-qdReeiXP.js → binding-resolver-CXF3o1ZX.js} +2 -2
- package/dist/assets/{blender-node-editor.document-DHj3Luuz.js → blender-node-editor.document-djNJTSeo.js} +1 -1
- package/dist/assets/{blender-properties-tab-mrwIpZz_.js → blender-properties-tab-06D6TYA0.js} +1 -1
- package/dist/assets/{blender-runtime-host-rAbOjzv5.js → blender-runtime-host-Cqitl1ZO.js} +1 -1
- package/dist/assets/{blender-runtime-skin-CVACAkwd.js → blender-runtime-skin-RX6nlrgy.js} +72 -58
- package/dist/assets/{blender-runtime.document-VP-2qjfk.js → blender-runtime.document-pgD63Zep.js} +1 -1
- package/dist/assets/{blender-screenshot.menu-B_zThqdR.js → blender-screenshot.menu-DZ44fIU0.js} +1 -1
- package/dist/assets/{blender-timeline.document-BMNJBWXP.js → blender-timeline.document-D53mR9D6.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-B2xmye2O.js → blender-uv-editor.document-Dux9ZXaj.js} +1 -1
- package/dist/assets/{blender-version.status-BzVGyJhB.js → blender-version.status-hK0_7tRC.js} +1 -1
- package/dist/assets/{blender.command-CNlvvxaj.js → blender.command-BF9RHCP_.js} +1 -1
- package/dist/assets/{board-guides-BPvQZ1ob.js → board-guides-BYnclES1.js} +1 -1
- package/dist/assets/{bridge.command-dqFe1Lyp.js → bridge.command-CS12Cp-B.js} +3 -3
- package/dist/assets/{browserAll-DLXEw1rV.js → browserAll-CGQ_uBbB.js} +1 -1
- package/dist/assets/{build-player.document-Bra3vDcF.js → build-player.document-RpeG8U_t.js} +1 -1
- package/dist/assets/{build-profiles.document-DuSvWEO8.js → build-profiles.document-DydU-eTF.js} +1 -1
- package/dist/assets/{build-progress.status-hkKRXBcc.js → build-progress.status-arvTBGok.js} +1 -1
- package/dist/assets/{build-session-B5GOV8fm.js → build-session-D8B-93_A.js} +1 -1
- package/dist/assets/{build.action-DUrS97Yw.js → build.action-CYKD0CrB.js} +1 -1
- package/dist/assets/{build.command-fNnr9pdz.js → build.command-BH-4yWaL.js} +1 -1
- package/dist/assets/{build.header-C-WQMQD8.js → build.header-B5-bZp5Z.js} +1 -1
- package/dist/assets/{build.menu-CsVJRmY6.js → build.menu-CyOe8xXz.js} +1 -1
- package/dist/assets/{build.service-CJfK8K6X.js → build.service-BuhAa1EB.js} +1 -1
- package/dist/assets/{camera-CpvCFt-Y.js → camera-KM5i-TaU.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-BwSdtfTT.js → camera-runtime.inspector-DA-GqhBI.js} +1 -1
- package/dist/assets/{canvas-design-mount-CE-67ZS9.js → canvas-design-mount-PWQPVLiY.js} +3 -3
- package/dist/assets/{canvas-entry-runtime-CBpGQGRw.js → canvas-entry-runtime-nWfnVKYb.js} +2 -2
- package/dist/assets/{canvas-preview-frames-DoDVjE4O.js → canvas-preview-frames-BwWVTr-u.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-hibqSqwB.js → canvas-story-capture.service-B1o-VBky.js} +2 -2
- package/dist/assets/{capability-coverage-DWVel6Wq.js → capability-coverage-aT7nf05J.js} +1 -1
- package/dist/assets/{collaboration-presence-B9eqNDDB.js → collaboration-presence-h1Fxju0A.js} +1 -1
- package/dist/assets/{collider-DD5wreOq.js → collider-BDLEjrr-.js} +1 -1
- package/dist/assets/{component-board.service-r8KlRes9.js → component-board.service-CetsHh4L.js} +2 -2
- package/dist/assets/{component-board.service-eXvcrWzD.js → component-board.service-DAeFLAlB.js} +2 -2
- package/dist/assets/{component-board.service-B1RineLo.js → component-board.service-qH45JxuD.js} +2 -2
- package/dist/assets/{component-contracts.service-YWaJqTzM.js → component-contracts.service-nYhZ_ceu.js} +1 -1
- package/dist/assets/{component-instance-root-BrRLxTKu.js → component-instance-root-QYCCyhxU.js} +1 -1
- package/dist/assets/{component-verbs.command-D5LCfxHY.js → component-verbs.command-y1H2CFq-.js} +1 -1
- package/dist/assets/{component-verbs.service-BUTHHNRT.js → component-verbs.service-QvBBdzY3.js} +1 -1
- package/dist/assets/{config-DQqPM4dV.js → config-YwJJtCF0.js} +2 -2
- package/dist/assets/{configurations-Dn9LLbWO.js → configurations-B52h5RGp.js} +1 -1
- package/dist/assets/{connection.status-CMZKs7ch.js → connection.status-DnEU1lk4.js} +1 -1
- package/dist/assets/{constraints.inspector-CRay8pK8.js → constraints.inspector-DgbM_8l2.js} +1 -1
- package/dist/assets/{content-bounds-UvcUv1DD.js → content-bounds-BRS42hfD.js} +1 -1
- package/dist/assets/{contract-system-adapters-Bbw5uUUi.js → contract-system-adapters-DIpeIRm_.js} +1 -1
- package/dist/assets/{coverage.service-DeTXoRCC.js → coverage.service-Cjy9MO9F.js} +1 -1
- package/dist/assets/{create-runtime-Z7LcpKwn.js → create-runtime-ByZWXstA.js} +1 -1
- package/dist/assets/{curve-DGhnvtG4.js → curve-DaFJmPin.js} +1 -1
- package/dist/assets/{data-asset-CrnqULWS.js → data-asset-DRCqFyxF.js} +1 -1
- package/dist/assets/{data-ref-ym18xkxV.js → data-ref-CkvCIusA.js} +1 -1
- package/dist/assets/{debug-bridge-BknWW_8M.js → debug-bridge-C7NLsHKu.js} +1 -1
- package/dist/assets/{debug-registry-C7poEnyY.js → debug-registry-BzagDrhV.js} +1 -1
- package/dist/assets/{deferred-ingest-play-3qS-wvgF.js → deferred-ingest-play-DMp_yRhc.js} +2 -2
- package/dist/assets/{design-time-canvas-mount-JkGmMINz.js → design-time-canvas-mount-kB1ZRIvt.js} +2 -2
- package/dist/assets/{design-time-layers-nxUfMfKI.js → design-time-layers-Dzu3jW_N.js} +1 -1
- package/dist/assets/{design-time-mount.service-EBZKN6cL.js → design-time-mount.service-CLEJHBLW.js} +2 -2
- package/dist/assets/{design-time-mount.service-DQganiM8.js → design-time-mount.service-Dgswmfff.js} +2 -2
- package/dist/assets/{design-time-react-mount-COvuTCBY.js → design-time-react-mount-B71UACVS.js} +1 -1
- package/dist/assets/{document-preview-three-BaWpv458.js → document-preview-three-DxAxdZRF.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-wlPbZwHo.js → dom-authoring-adapter-CQiwffQ4.js} +1 -1
- package/dist/assets/{draco3d-DdFfLaRu.js → draco3d-CWfPSgkb.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-B74d6zkz.js → edit-mode-audio.service-CikRAHOi.js} +1 -1
- package/dist/assets/{edit-mode-authoring-Cf83TffW.js → edit-mode-authoring-DthrLbz-.js} +1 -1
- package/dist/assets/{edit-mode-networking.service-C7FSPHzl.js → edit-mode-networking.service-DBmK8YGU.js} +1 -1
- package/dist/assets/{editor-api-DLfSJ2g2.js → editor-api-CqqOlRSi.js} +1 -1
- package/dist/assets/{editor-layers-BVicagU1.js → editor-layers-k0AjpomL.js} +1 -1
- package/dist/assets/{editor-shell-store-CV73gQk5.js → editor-shell-store-B3c29A3l.js} +1 -1
- package/dist/assets/{entity-object-DTQ4I2K5.js → entity-object-BOLh6DVA.js} +1 -1
- package/dist/assets/{extend-B7YOIXSU.js → extend-CJ7vLkP1.js} +1 -1
- package/dist/assets/{fork-menu-BToX8Jv4.js → fork-menu-Bzl-5_GA.js} +1 -1
- package/dist/assets/{frame-debugger-store-CuCtiEQ1.js → frame-debugger-store-NGsJt0AK.js} +1 -1
- package/dist/assets/{game-contract-seams-DRUf45xM.js → game-contract-seams-CuBiefwV.js} +1 -1
- package/dist/assets/{game-css-scope-transform-rbFoxfMV.js → game-css-scope-transform-5yv5zl6t.js} +1 -1
- package/dist/assets/{game-document.service-D409VVnQ.js → game-document.service-DtML_s2L.js} +1 -1
- package/dist/assets/{game-eval.command-BJ51kPy3.js → game-eval.command-Cghc-6r3.js} +1 -1
- package/dist/assets/{game-module-access-ib9tWhJc.js → game-module-access-DPnqfsy_.js} +1 -1
- package/dist/assets/{game-network-BZM-o9Ey.js → game-network-TjOj3K-Z.js} +3 -3
- package/dist/assets/{gameplay-export-Bsvbs7wO.js → gameplay-export-ebDdiP9T.js} +1 -1
- package/dist/assets/{gameplay-replay-k_14DJ5F.js → gameplay-replay-B4BPQnTZ.js} +1 -1
- package/dist/assets/{gameplay.command-DGVwoOz_.js → gameplay.command-C__OjBjz.js} +1 -1
- package/dist/assets/{generation-jobs-BxpAnwDo.js → generation-jobs-C57_oOgx.js} +1 -1
- package/dist/assets/{generation.service-D1win2Pl.js → generation.service-BJel-Oiy.js} +1 -1
- package/dist/assets/{generations-Dlu2fhGN.js → generations-DNfmqqzL.js} +1 -1
- package/dist/assets/{generations.status-BPYUSGr_.js → generations.status-nXpY7bFU.js} +1 -1
- package/dist/assets/{hierarchy-marks-Dn7SO2iG.js → hierarchy-marks-C2temlO0.js} +1 -1
- package/dist/assets/{hosted-asset-materialization-DPmn23AM.js → hosted-asset-materialization-BtbO5pyX.js} +1 -1
- package/dist/assets/{index-B41IX0yA.js → index-7J5pTwW2.js} +1 -1
- package/dist/assets/{index-C_XSSPHO.js → index-B5GZkByz.js} +1 -1
- package/dist/assets/{index-_-7lUYI-.js → index-B69_nH5F.js} +1 -1
- package/dist/assets/{index-D9shXtZ9.js → index-BfqJPhFO.js} +7 -7
- package/dist/assets/{index-BjUxirz3.js → index-BiH6f3Mk.js} +1 -1
- package/dist/assets/{index-FWtJb07f.js → index-CFS_B4hc.js} +2 -2
- package/dist/assets/{index-B4NI0L5I.js → index-DYoPv2Wb.js} +1 -1
- package/dist/assets/{index-Cp9b5Qfa.js → index-my7iu018.js} +1 -1
- package/dist/assets/{index-D1nMmQxJ.js → index-zXacXllH.js} +1 -1
- package/dist/assets/{inference-diagnostics-V4igFQX2.js → inference-diagnostics-NvA3SRR7.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-DBpKatwo.js → ingest-boot-viewport-DHhBi66w.js} +1 -1
- package/dist/assets/{ingest-siblings-C8OmNNTc.js → ingest-siblings-CMWO3uRZ.js} +1 -1
- package/dist/assets/{ingest-source-persistence-DH7q9G1S.js → ingest-source-persistence-CrXFBT__.js} +1 -1
- package/dist/assets/{ingest.service-D3Ru3YUS.js → ingest.service-BYEo4j1s.js} +1 -1
- package/dist/assets/{inspect-Bhr2b3pa.js → inspect-UxYR9Ls5.js} +1 -1
- package/dist/assets/instances.command-DDOJ3aWq.js +1 -0
- package/dist/assets/{json-history-resource-B8_YpeAT.js → json-history-resource-De8KJl61.js} +1 -1
- package/dist/assets/{layered-pick-MdBIQeUt.js → layered-pick-Dito5b_J.js} +1 -1
- package/dist/assets/{light-BvCKNW4e.js → light-BnSS9Nzc.js} +1 -1
- package/dist/assets/{live-project-verbs-DggWGgn-.js → live-project-verbs-CDRzC_D1.js} +1 -1
- package/dist/assets/{machine.document-CTyXmK5a.js → machine.document-CVG78EGi.js} +1 -1
- package/dist/assets/{machines.finder-C6WR7N-k.js → machines.finder-vrUR_Pb_.js} +1 -1
- package/dist/assets/{material-BoHGaIcq.js → material-7mmxSi8g.js} +1 -1
- package/dist/assets/{material-factory-D-cyMEti.js → material-factory-CXvJ2goL.js} +1 -1
- package/dist/assets/{mesh-B-ksBKUU.js → mesh-DpK09Vho.js} +1 -1
- package/dist/assets/{model-asset-sections.service-DHsGD1SZ.js → model-asset-sections.service-ByE7kOXW.js} +1 -1
- package/dist/assets/{model-inspection-Bsfj6b48.js → model-inspection-PgxfYOnI.js} +1 -1
- package/dist/assets/{model-thumbnail-Bp-1yQ-X.js → model-thumbnail-Dnv7DCt7.js} +1 -1
- package/dist/assets/{models.finder-DksRlbR8.js → models.finder-BaD41xeQ.js} +1 -1
- package/dist/assets/{module-mode-qROy_5Tk.js → module-mode-Bb9fFtEw.js} +2 -2
- package/dist/assets/{mount-canvas-ingest-root-CLbJS_Ob.js → mount-canvas-ingest-root-B0_ckx79.js} +2 -2
- package/dist/assets/{mount-dom-ingest-root-CI7VtdaS.js → mount-dom-ingest-root-BnZQSayp.js} +2 -2
- package/dist/assets/{mount-ingest-root-BX_usF8y.js → mount-ingest-root-DHVNQKHi.js} +2 -2
- package/dist/assets/{mount-manifest-lQBlK2Y1.js → mount-manifest-cYykTsXQ.js} +1 -1
- package/dist/assets/{mount-three-ingest-root-g6yhs1S-.js → mount-three-ingest-root-CI-gjlh8.js} +1 -1
- package/dist/assets/{mounted-authoring-D5cvzNXX.js → mounted-authoring-B2dc__pv.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-C-RZo_xH.js → mounted-story-viewport-source-Ceh05FK8.js} +1 -1
- package/dist/assets/{native-debug-module-Bh_HQdg_.js → native-debug-module-L_Ofssyj.js} +1 -1
- package/dist/assets/{navigation-DVO5eQO6.js → navigation-CADCnkrx.js} +1 -1
- package/dist/assets/{navmesh.menu-Cu9R-p4V.js → navmesh.menu-3D6ZEGhB.js} +1 -1
- package/dist/assets/{navmesh.service-D6EeQxE0.js → navmesh.service-D_TdU1xw.js} +1 -1
- package/dist/assets/network-observer.service-D9nUCc15.js +1 -0
- package/dist/assets/{network.utility-D4Uo1xUC.js → network.utility-B3riF8KT.js} +1 -1
- package/dist/assets/{object3d-document-session-registry-bor-eSgr.js → object3d-document-session-registry-CLizyhis.js} +2 -2
- package/dist/assets/{oid-transform-rEmA5PfE.js → oid-transform-CinlfHYa.js} +1 -1
- package/dist/assets/{particles-BxlIkQUX.js → particles--V50tPi5.js} +1 -1
- package/dist/assets/{pixi-authoring-adapter-CTSRtvNw.js → pixi-authoring-adapter-qbP0YW7g.js} +1 -1
- package/dist/assets/{pixi-live-write-target-DaUAvNu7.js → pixi-live-write-target-coTAFFGW.js} +1 -1
- package/dist/assets/{play.command-BtV56gUr.js → play.command-kc7rzTlg.js} +2 -2
- package/dist/assets/{presentation-DxTT40_3.js → presentation-jBjhcEq1.js} +1 -1
- package/dist/assets/{product-BAGhTFHw.js → product-DgYRVeaY.js} +1 -1
- package/dist/assets/{profiler.action-DaSS1RoY.js → profiler.action-Dj94ZJLY.js} +1 -1
- package/dist/assets/{profiler.menu-5OyI3lyY.js → profiler.menu-BHplCv7a.js} +1 -1
- package/dist/assets/{profiler.utility-DLzaMOPh.js → profiler.utility-D32oIOGk.js} +1 -1
- package/dist/assets/{project-authoring-session-DZOgiTch.js → project-authoring-session-Cd8SeWEJ.js} +2 -2
- package/dist/assets/{properties-bone-constraints.inspector-JMlHKfN2.js → properties-bone-constraints.inspector-VPTHP6BI.js} +1 -1
- package/dist/assets/{properties-bone.inspector-C-c7iGEx.js → properties-bone.inspector-4GD1gzCp.js} +1 -1
- package/dist/assets/{properties-collection.inspector-PXHDUs1b.js → properties-collection.inspector-CehoAair.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-CQnnGi1O.js → properties-constraints.inspector-LgPoqURT.js} +1 -1
- package/dist/assets/{properties-data.inspector-DuEPeVBm.js → properties-data.inspector-D3uEJD3t.js} +1 -1
- package/dist/assets/{properties-material.inspector-BhKP0Zc_.js → properties-material.inspector-2n9K5IFo.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-lOMb72vk.js → properties-modifiers.inspector-B_RsuDyF.js} +1 -1
- package/dist/assets/{properties-object.inspector-BU2hn26Q.js → properties-object.inspector-CBZA72yZ.js} +1 -1
- package/dist/assets/{properties-output.inspector-yNaC3IgX.js → properties-output.inspector-DxDAmKI-.js} +1 -1
- package/dist/assets/{properties-particles.inspector-CaHfdQZB.js → properties-particles.inspector-pPS920CT.js} +1 -1
- package/dist/assets/{properties-physics.inspector-Bt9Xjyu-.js → properties-physics.inspector-XUnPp5Q3.js} +1 -1
- package/dist/assets/{properties-render.inspector-Cl8UBLPY.js → properties-render.inspector-DnC4sgP3.js} +1 -1
- package/dist/assets/{properties-scene.inspector-D9cgONMx.js → properties-scene.inspector-MZ-gCrYM.js} +1 -1
- package/dist/assets/{properties-texture.inspector-804GEF8F.js → properties-texture.inspector-B7QGBzm5.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-CLo0Z-B1.js → properties-view-layer.inspector-rt2qT9SA.js} +1 -1
- package/dist/assets/{properties-world.inspector-CjywenDE.js → properties-world.inspector-Vg7GD9HK.js} +1 -1
- package/dist/assets/{r3f-design-session-B2k02ypD.js → r3f-design-session-DfRwB6oN.js} +2 -2
- package/dist/assets/{r3f-physics-binding-D1rgVgsz.js → r3f-physics-binding-EfYECbQc.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-Dj0r13-b.js → r3f-source-authoring-adapter-CVupdJt5.js} +1 -1
- package/dist/assets/{react-canvas-navigation-t00NiEKB.js → react-canvas-navigation-DwiPTVdH.js} +1 -1
- package/dist/assets/{react-inspector.service-Xp4f-M0O.js → react-inspector.service-DffkStxd.js} +1 -1
- package/dist/assets/{react-story-board-DAQaZNga.js → react-story-board-CynnmKqO.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-D13B7Exz.js → react-three-rapier.esm-DnUfnQnM.js} +1 -1
- package/dist/assets/{react-world-authoring-adapter-zzyaxcpN.js → react-world-authoring-adapter-Cf1jv2dl.js} +1 -1
- package/dist/assets/{realm-services-CyeBcuLZ.js → realm-services-CxfLBQQ9.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-BpdGQ2gf.js → reflection-probe-capture.inspector-DfzDNtJF.js} +1 -1
- package/dist/assets/{registry-DM1tIelZ.js → registry-69pUwZEm.js} +1 -1
- package/dist/assets/{relative-import-specifier-txHdCBKR.js → relative-import-specifier-J1WeZQaJ.js} +1 -1
- package/dist/assets/{render-env-DiO35wd3.js → render-env-CmR-momj.js} +1 -1
- package/dist/assets/{render-features-Bv3_74_x.js → render-features-D7pQr-dE.js} +1 -1
- package/dist/assets/{render-settings-8kb_yvkr.js → render-settings-BUT8gPkc.js} +1 -1
- package/dist/assets/{resolve-three-D9rgCC5Z.js → resolve-three-Dhw2LtAp.js} +3 -3
- package/dist/assets/{root-seam-contract-BgkkJVuJ.js → root-seam-contract-BFs0rvG9.js} +1 -1
- package/dist/assets/{run-selection-WrcYgYP3.js → run-selection-CEuu_sxz.js} +1 -1
- package/dist/assets/{scene-capture-C08wT5TW.js → scene-capture-DgUSqWTB.js} +1 -1
- package/dist/assets/{scene-document.service-D7sb6hvQ.js → scene-document.service-BDDoO22G.js} +2 -2
- package/dist/assets/{scene-framing-BSvegpi4.js → scene-framing-Dm-rCn3G.js} +1 -1
- package/dist/assets/{seeded-random-Bc5190so.js → seeded-random-C9256-Ag.js} +1 -1
- package/dist/assets/{setup-renderer-JwrNwzqH.js → setup-renderer-CWvtkVDR.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-BJwLQVsv.js → source-object3d-authoring-adapter-ehtz9UK_.js} +1 -1
- package/dist/assets/{source-persistence-backend-DsG30XMj.js → source-persistence-backend-CbCbDOjd.js} +1 -1
- package/dist/assets/{stage-keyboard-BnzybgXw.js → stage-keyboard-DiRyZTZd.js} +1 -1
- package/dist/assets/{stage-overlay-set-BWxO_Pk6.js → stage-overlay-set-6pmCmKpX.js} +1 -1
- package/dist/assets/{stage-presence-markers-BD5JPVX6.js → stage-presence-markers-mZPecAeK.js} +1 -1
- package/dist/assets/{stage-transform-tools-CHvXlnKB.js → stage-transform-tools-Qc0QjPrc.js} +1 -1
- package/dist/assets/{standard-viewport-dressing-4xAZCGJ3.js → standard-viewport-dressing-BhTPIZTQ.js} +1 -1
- package/dist/assets/{state-watch.action-0KAywung.js → state-watch.action-DJfW26od.js} +1 -1
- package/dist/assets/{state-watch.menu-4xjTZIEx.js → state-watch.menu-B1GRE_HT.js} +1 -1
- package/dist/assets/{state-watch.utility-DZgzPGEZ.js → state-watch.utility-BQaTOFU-.js} +1 -1
- package/dist/assets/{story-capture-d695eMLJ.js → story-capture-DZNUtuCH.js} +1 -1
- package/dist/assets/{story-documents-C1hZeYU3.js → story-documents-DArOiGNt.js} +1 -1
- package/dist/assets/{story-documents.service-CSXB6uqT.js → story-documents.service-Bi89tZQ5.js} +1 -1
- package/dist/assets/{story-documents.service-bB0UDbvA.js → story-documents.service-DaPhxnzw.js} +1 -1
- package/dist/assets/{story-media-presence-CxD6G_Mu.js → story-media-presence-CMJ7U-7_.js} +1 -1
- package/dist/assets/{story-pixi-preview-CJKGDBKs.js → story-pixi-preview-jmF1ab99.js} +1 -1
- package/dist/assets/{story-presentation-BBS9x4BP.js → story-presentation-DNXF37vS.js} +1 -1
- package/dist/assets/{story-three-preview-v22RRpqB.js → story-three-preview-CH6Kk934.js} +2 -2
- package/dist/assets/{studio-environment-CvCEc6PK.js → studio-environment-BNM-AjAn.js} +1 -1
- package/dist/assets/{surface-state-EsG-yMSi.js → surface-state-BLuxJ4lb.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-DvSr6VoQ.js → syntactic-prop-specs-Coas9J4z.js} +1 -1
- package/dist/assets/{team-playtest.service-Bp6j6MAv.js → team-playtest.service-C3cEeDBv.js} +1 -1
- package/dist/assets/{three-Do16bEo9.js → three-BvhtsSAr.js} +1 -1
- package/dist/assets/{three-authoring-adapter-C2QFVlpK.js → three-authoring-adapter-K8a5THvW.js} +1 -1
- package/dist/assets/three-authoring.service-D-uSiCHc.js +2 -0
- package/dist/assets/{three-ingest-runtime-DW-lHDmp.js → three-ingest-runtime-QhrURliQ.js} +1 -1
- package/dist/assets/{three-integration-C1onOQwq.js → three-integration-CaC8ivB7.js} +2 -2
- package/dist/assets/three-integration.service-BvTtbtlD.js +1 -0
- package/dist/assets/{three-projection-core-1FETWj5n.js → three-projection-core-C2Zj6hTy.js} +1 -1
- package/dist/assets/{three-state-d-szeOea.js → three-state-cYB28OIz.js} +1 -1
- package/dist/assets/{three-story-capture.service-gnrRzcjj.js → three-story-capture.service-H2Z2O7Nz.js} +2 -2
- package/dist/assets/{three-story-model-CbEMWEte.js → three-story-model-DVfgIOzi.js} +1 -1
- package/dist/assets/{three-viewport-presentation-D1ysWIW4.js → three-viewport-presentation-DoViPvQB.js} +1 -1
- package/dist/assets/{transform-mode-request-B3AxgwGW.js → transform-mode-request-CflM_ccL.js} +1 -1
- package/dist/assets/{transport-strip-D4N14xHx.js → transport-strip-DPoEy7PU.js} +1 -1
- package/dist/assets/transport.header-DdI58npA.js +1 -0
- package/dist/assets/{tuples-B3URXxaa.js → tuples-CA3u4T9B.js} +1 -1
- package/dist/assets/{ui-board-document-BSrfzH8L.js → ui-board-document-CoKY7MDM.js} +2 -2
- package/dist/assets/{user-data-DHB4MWum.js → user-data-CTT8ZvVB.js} +1 -1
- package/dist/assets/{utility-view-state-CfZ51NRS.js → utility-view-state-BaO3Fx_-.js} +1 -1
- package/dist/assets/{viewport-door-DkDcO9tp.js → viewport-door-BBtilr3V.js} +1 -1
- package/dist/assets/{viewport-root-presentation-DtuBFJ-J.js → viewport-root-presentation-DmDBAZ8E.js} +1 -1
- package/dist/assets/{viewport-surface-status-HKbJtC2G.js → viewport-surface-status-BiDiAZ6z.js} +1 -1
- package/dist/assets/{webworkerAll-JD3yAUg1.js → webworkerAll-BCvjBZqG.js} +1 -1
- package/dist/assets/{workspace-arrangement-BOk46mGq.js → workspace-arrangement-BXM0R-Uu.js} +1 -1
- package/dist/assets/{world-documents-AnhAH_9y.js → world-documents-DGk_J8cp.js} +1 -1
- package/dist/assets/{world-root-stage-binding-H0SUNbfK.js → world-root-stage-binding-KaIVpo80.js} +1 -1
- package/dist/assets/{xstate-animation-binding-BjWKb5ne.js → xstate-animation-binding-D_kxRsxS.js} +1 -1
- package/dist/assets/{xstate-animation-meta-CTBp-Vc5.js → xstate-animation-meta-CX5oWqQv.js} +1 -1
- package/dist-node/cli.js +16 -16
- package/package.json +16 -16
- package/dist/assets/InspectorObjectPreview-DCEUdndv.js +0 -1
- package/dist/assets/Object3DDocumentViewport-Blr8aQeS.js +0 -2
- package/dist/assets/autoplay.service---Nu6koq.js +0 -1
- package/dist/assets/instances.command-CDIwEW8H.js +0 -1
- package/dist/assets/network-observer.service-CLE3M7gH.js +0 -1
- package/dist/assets/three-authoring.service-DxL4grJx.js +0 -2
- package/dist/assets/three-integration.service-26hsEOk3.js +0 -1
- package/dist/assets/transport.header-D3j_V-tN.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-Byplgb8G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as We}from"./index-D9shXtZ9.js";import{EDITOR_LAYER as ye,isEditorOwnedObject as Ve}from"./editor-layers-BVicagU1.js";import{m as _}from"./renderer-ownership-BovSEcLv.js";import{i as je}from"./hierarchy-marks-Dn7SO2iG.js";import{l as Ge,g as be,a as q,d as X,S as He}from"./studio-environment-CvCEc6PK.js";import{h as z}from"./user-data-DHB4MWum.js";import{W}from"./three.module-BLhyNg0e.js";import{d5 as Ye,fo as b,eW as qe,cm as ee,I as ve,d9 as Xe,cj as O,ev as Ze,bu as Je,co as xe,c0 as Ke,b$ as Qe,bV as et,df as tt,eE as nt,bK as ot,F as rt,bh as Ee,cW as st,ej as V,A as j,n as at,el as it,bj as ct,aE as J,_ as lt}from"./three.core-3arARmh6.js";import{d as P,m as Se}from"./bitmap-label-Ct4k6ehY.js";const pn=["front","side"],Me=1,dn=.55,hn=Me/2,K=128,ut=[24,26,31],pt=[235,137,52],dt=[56,189,248],ht=[236,240,238];function fn(e,t){if(e.length<t*4)throw new Error(`Silhouette mask expected ${t*4} RGBA bytes but received ${e.length}.`);const o=new Uint8Array(t);for(let n=0;n<t;n++){const r=n*4,s=e[r]>=K||e[r+1]>=K||e[r+2]>=K;o[n]=s?1:0}return o}function mn(e,t){if(e.length!==t.length)throw new Error(`Mask IoU requires equal-size masks (${e.length} vs ${t.length}).`);let o=0,n=0,r=0;for(let a=0;a<e.length;a++){const i=e[a]!==0,c=t[a]!==0;i&&n++,c&&r++,i&&c&&o++}const s=n+r-o;return{intersection:o,union:s,aCount:n,bCount:r,iou:s===0?0:o/s}}function gn(e,t){if(e.length!==t.length)throw new Error(`Overlay requires equal-size masks (${e.length} vs ${t.length}).`);const o=new Uint8ClampedArray(e.length*4);for(let n=0;n<e.length;n++){const r=e[n]!==0,s=t[n]!==0,a=r&&s?ht:r?pt:s?dt:ut,i=n*4;o[i]=a[0],o[i+1]=a[1],o[i+2]=a[2],o[i+3]=255}return o}function ft(e){if(!Array.isArray(e)||e.length!==3)return null;const[t,o,n]=e;return typeof t!="number"||typeof o!="number"||typeof n!="number"||!Number.isFinite(t)||!Number.isFinite(o)||!Number.isFinite(n)||Math.hypot(t,n)<1e-6?null:[t,o,n]}function Ae(e){const[t,,o]=e;if(!Number.isFinite(t)||!Number.isFinite(o)||Math.hypot(t,o)<1e-6)throw new Error(`Cannot derive a facing from forward vector [${e.join(", ")}].`);return Math.atan2(t,o)}function wn(e,t,o=Me){const n=t[1]-e[1];if(!Number.isFinite(n)||n<=0)throw new Error(`Compare normalization needs positive model height, got ${n}.`);const r=o/n,s=(e[0]+t[0])/2,a=(e[2]+t[2])/2;return{scale:r,position:[-s*r,-e[1]*r,-a*r]}}const H=1.2,Ie=.001;function te(e){const t=new b(Math.sin(e),0,Math.cos(e)),n=new b(0,1,0).clone().cross(t).normalize(),r=t.clone().cross(n).normalize();return{direction:t,right:n,up:r}}function Ce(){return{minRight:Number.POSITIVE_INFINITY,maxRight:Number.NEGATIVE_INFINITY,minUp:Number.POSITIVE_INFINITY,maxUp:Number.NEGATIVE_INFINITY,minDepth:Number.POSITIVE_INFINITY,maxDepth:Number.NEGATIVE_INFINITY}}function oe(e){return e.maxRight<e.minRight}function mt(e){e.minRight=Number.POSITIVE_INFINITY,e.maxRight=Number.NEGATIVE_INFINITY,e.minUp=Number.POSITIVE_INFINITY,e.maxUp=Number.NEGATIVE_INFINITY,e.minDepth=Number.POSITIVE_INFINITY,e.maxDepth=Number.NEGATIVE_INFINITY}function Te(e,t,o){const n=t.dot(o.right),r=t.dot(o.up),s=t.dot(o.direction);n<e.minRight&&(e.minRight=n),n>e.maxRight&&(e.maxRight=n),r<e.minUp&&(e.minUp=r),r>e.maxUp&&(e.maxUp=r),s<e.minDepth&&(e.minDepth=s),s>e.maxDepth&&(e.maxDepth=s)}function gt(e,t){if(oe(e))throw new Error("Asset preview cannot frame an empty projected span.");return new b().addScaledVector(t.right,(e.minRight+e.maxRight)/2).addScaledVector(t.up,(e.minUp+e.maxUp)/2).addScaledVector(t.direction,(e.minDepth+e.maxDepth)/2)}function Re(e,t,o,n=H){const r=Math.max(t,e/o,Ie)*n;return{halfHeight:r,halfWidth:r*o}}function wt(e,t,o=H){if(oe(e))throw new Error("Asset preview cannot frame an empty projected span.");return Re((e.maxRight-e.minRight)/2,(e.maxUp-e.minUp)/2,t,o)}function yt(e){if(e.length===0)throw new Error("Asset preview cannot union an empty set of frames.");let t=0,o=0;for(const n of e)t=Math.max(t,n.halfWidth),o=Math.max(o,n.halfHeight);return{halfWidth:t,halfHeight:o}}function bt(e,t,o,n,r,s){const a=Math.max(n*r,Ie);let i=a,c=a;const l=new b;for(const u of e)l.copy(u).sub(t),i=Math.max(i,Math.abs(l.dot(o.right))+a),c=Math.max(c,Math.abs(l.dot(o.up))+a);return i=Math.max(i,c*s),c=Math.max(c,i/s),{halfWidth:i,halfHeight:c}}function vt(e){if(e.length===0)throw new Error("Asset preview cannot centre a bone-zoom crop on zero anchors.");const t=new b;for(const o of e)t.add(o);return t.multiplyScalar(1/e.length)}function xt(e,t){const o=e.position.dot(t.right),n=e.position.dot(t.up),r=e.position.dot(t.direction),s=e.zoom||1;return{minRight:o+e.left/s,maxRight:o+e.right/s,minUp:n+e.bottom/s,maxUp:n+e.top/s,minDepth:r-e.far,maxDepth:r-e.near}}function Et(e,t){return oe(e)?!1:e.maxRight>=t.minRight&&e.minRight<=t.maxRight&&e.maxUp>=t.minUp&&e.minUp<=t.maxUp&&e.maxDepth>=t.minDepth&&e.minDepth<=t.maxDepth}function re(e,t,o,n,r){const s=new Ye(-o.halfWidth,o.halfWidth,o.halfHeight,-o.halfHeight,.01,r);return s.position.copy(e).addScaledVector(t.direction,n),s.up.copy(t.up),s.lookAt(e),s.updateProjectionMatrix(),s.updateMatrixWorld(!0),s}const k=["front","right","top","perspective"],ue=24;function Le(e){const t=e;return typeof t=="object"&&t!==null&&typeof t.bone=="string"&&t.bone.length>0&&(t.axis==="x"||t.axis==="y"||t.axis==="z")&&typeof t.radians=="number"&&Number.isFinite(t.radians)}function Ne(e){const t=e;return typeof t=="object"&&t!==null&&typeof t.morph=="string"&&t.morph.length>0&&typeof t.influence=="number"&&Number.isFinite(t.influence)}function Pe(e){const t=e;return typeof t=="object"&&t!==null&&typeof t.bone=="string"&&t.bone.length>0&&(t.axis==="x"||t.axis==="y"||t.axis==="z")&&typeof t.meters=="number"&&Number.isFinite(t.meters)}function St(e){return Le(e)||Ne(e)||Pe(e)}function Mt(e,t){const o=e;if(typeof o!="object"||o===null||typeof o.label!="string"||!/^[a-z0-9][a-z0-9-]*$/i.test(o.label)||o.pose!==void 0&&(typeof o.pose!="string"||!t.has(o.pose)))return!1;if(o.view==="turntable")return typeof o.yaw=="number"&&Number.isFinite(o.yaw);if(o.view==="bone-zoom"){const n=o;return n.yaw!==void 0&&(typeof n.yaw!="number"||!Number.isFinite(n.yaw))?!1:Array.isArray(n.bones)&&n.bones.length>0&&n.bones.every(r=>typeof r=="string"&&r.length>0)&&typeof n.spanFraction=="number"&&Number.isFinite(n.spanFraction)&&n.spanFraction>0&&n.spanFraction<=2}return!1}function yn(e){const t=c=>{throw new Error(`Asset preview shot-set definition is invalid: ${c}`)},o=e;(typeof o!="object"||o===null)&&t("expected an object.");const n=o;(typeof n.name!="string"||!/^[a-z0-9][a-z0-9-]*$/i.test(n.name))&&t("`name` must be a short alphanumeric/dash identifier."),n.requiredBones!==void 0&&(!Array.isArray(n.requiredBones)||n.requiredBones.some(c=>typeof c!="string"||c.length===0))&&t("`requiredBones` must be an array of non-empty bone names."),n.rigRequirementHint!==void 0&&typeof n.rigRequirementHint!="string"&&t("`rigRequirementHint` must be a string.");const r=n.poses??{};(typeof r!="object"||r===null||Array.isArray(r))&&t("`poses` must be an object of named pose-step lists.");for(const[c,l]of Object.entries(r))(!Array.isArray(l)||!l.every(St))&&t(`pose ${JSON.stringify(c)} must be an array of {bone, axis, radians} and/or {morph, influence}.`);const s=new Set(Object.keys(r));(!Array.isArray(n.shots)||n.shots.length===0||n.shots.length>ue)&&t(`\`shots\` must list 1-${ue} shots.`);const a=n.shots,i=new Set;for(const c of a){Mt(c,s)||t('every shot needs a label plus either {view:"turntable", yaw} or {view:"bone-zoom", bones, spanFraction, yaw?}, with every `yaw` a finite number of radians and `pose` naming a declared pose.');const{label:l}=c;i.has(l)&&t(`duplicate shot label ${JSON.stringify(l)}.`),i.add(l)}return n}const At=512,pe=64,de=1024,U=2106410,It=25e3,N=64*1024*1024;function T(e){const t=e??At;if(!Number.isInteger(t)||t<pe||t>de)throw new Error(`Asset preview dimensions must be integers from ${pe} to ${de}.`);return t}function C(e){const t=e.toDataURL("image/png"),o=t.indexOf(",");return o>=0?t.slice(o+1):t}function bn(e){const t=new Set;e.traverse(n=>t.add(n));let o=e;return e.traverse(n=>{const r=n;if(!(!r.isSkinnedMesh||!r.skeleton))for(const s of r.skeleton.bones){if(!s||t.has(s))continue;const a=new Set;for(let c=o;c;c=c.parent)a.add(c);let i=null;for(let c=s;c;c=c.parent)if(a.has(c)){i=c;break}i&&i!==o&&(o=i,o.traverse(c=>t.add(c)))}}),o}function $(e){const t=new Set;e.traverse(a=>{t.add(a)});const o=Tt(e,t),n=Rt(e,o),r=Ct(e);n.matrix.copy(r),n.matrix.decompose(n.position,n.quaternion,n.scale),n.matrixAutoUpdate=!1,n.matrixWorld.copy(r),n.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,n.visible=!0;const s=[];n.traverse(a=>{a!==n&&a.userData.editorHelper&&s.push(a)});for(const a of s)a.parent?.remove(a);return n}function Ct(e){const t=[];let o=e;for(;o;)t.push(o),o=o.parent;const n=t.findIndex(i=>!i.matrixWorldAutoUpdate),r=n>=0?t[n].matrixWorld.clone():new ee,s=new ee,a=n>=0?n-1:t.length-1;for(let i=a;i>=0;i--){const c=t[i];c.matrixAutoUpdate?s.compose(c.position,c.quaternion,c.scale):s.copy(c.matrix),r.multiply(s)}return r}function Tt(e,t){const o=new Map,n=new Map;let r=null;const s=()=>{if(r)return r;const a=new Map;for(const i of t){const c=i;if(!c.isBone||c.name==="")continue;const l=a.get(c.name);l?l.push(c):a.set(c.name,[c])}return r=a,a};if(e.traverse(a=>{const i=a;if(!i.isSkinnedMesh)return;const c=i.name||i.uuid;for(const l of i.skeleton.bones){if(l&&t.has(l)||l&&o.has(l))continue;const u=l?s().get(l.name)??[]:[];if(u.length===1){o.set(l,u[0]);continue}const p=l?.name||"(unnamed bone)";n.set(`${c} -> ${p}`,{mesh:c,bone:p,sameNamed:u.length})}}),n.size>0){const a=[...n.values()].map(({mesh:i,bone:c,sameNamed:l})=>l>1?`${i} -> ${c} (${l} bones inside the selection share that name — which one is meant is ambiguous)`:`${i} -> ${c} (no bone of that name inside the selection)`).join("; ");throw new Error(`Asset preview selection references bones outside its hierarchy that it cannot bind to: ${a}. Select the complete skeleton root — the node that owns both the skinned mesh and its bones.`)}return o}function Rt(e,t=new Map){const o=new Map,n=[],r=a=>{const i=Lt(a);o.set(a,i),Nt(a,i),a.isSkinnedMesh&&n.push([a,i]);const c=a;if(c.isLOD){const l=i,u=c.levels.filter(m=>m.object.visible),p=u.length===1?u[0]:c.levels[0];l.autoUpdate=!1;const d=new Set(c.levels.map(m=>m.object));for(const m of c.levels){if(Q(m.object))continue;const w=r(m.object);w.visible=c.autoUpdate?m===p:m.object.visible,l.addLevel(w,m.distance,m.hysteresis)}for(const m of a.children)!d.has(m)&&!Q(m)&&i.add(r(m))}else for(const l of a.children)Q(l)||i.add(r(l));return i},s=r(e);for(const[a,i]of n){const c=a.skeleton.clone();c.bones=a.skeleton.bones.map(l=>{const u=o.get(t.get(l)??l);if(!u?.isBone)throw new Error(`Asset preview could not map skeleton bone: ${l.name||l.uuid}`);return u}),i.skeleton=c,i.bindMode=a.bindMode,i.bindMatrix.copy(a.bindMatrix),i.bindMatrixInverse.copy(a.bindMatrixInverse)}return s}function Lt(e){const t=e;if(t.isSkinnedMesh)return new Ze(t.geometry,t.material);const o=e;if(o.isInstancedMesh){const i=new Je(o.geometry,o.material,o.count);return i.instanceMatrix.copy(o.instanceMatrix),i.instanceColor=o.instanceColor?o.instanceColor.clone():null,i.morphTexture=o.morphTexture,i}const n=e;if(n.isMesh)return new xe(n.geometry,n.material);const r=e;if(e.isLineSegments)return new Ke(r.geometry,r.material);if(e.isLineLoop)return new Qe(r.geometry,r.material);if(r.isLine)return new et(r.geometry,r.material);const s=e;if(s.isPoints)return new tt(s.geometry,s.material);const a=e;return a.isSprite?new nt(a.material):e.isLOD?new ot:e.isBone?new rt:e.isGroup?new Ee:new st}function Nt(e,t){t.name=e.name,t.up.copy(e.up),t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.copy(e.scale),t.matrix.copy(e.matrix),t.matrixWorld.copy(e.matrixWorld),t.matrixAutoUpdate=e.matrixAutoUpdate,t.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,t.visible=e.visible,t.castShadow=e.castShadow,t.receiveShadow=e.receiveShadow,t.frustumCulled=!1,t.renderOrder=e.renderOrder,t.layers.set(0),t.animations=[...e.animations];const o=e,n=t;o.morphTargetInfluences&&(o.morphTargetDictionary&&(n.morphTargetDictionary={...o.morphTargetDictionary}),n.morphTargetInfluences=[...o.morphTargetInfluences]);const r=e;r.isSprite&&t.center.copy(r.center)}function Q(e){const t=1<<ye;return!!(e.userData.editorHelper||e.userData.editorIcon||(e.layers.mask&t)!==0)}function G(e){const t=new Set;e.traverse(o=>{const n=o;n.isSkinnedMesh&&t.add(n.skeleton);const r=o;if(r.isInstancedMesh){const s=r.morphTexture;r.morphTexture=null,r.dispose(),r.morphTexture=s}});for(const o of t)o.dispose()}function vn(e){const t=e();let o;try{o=$(t.root),o.animations=[...t.animations??t.root.animations]}catch(r){try{t.dispose()}catch(s){throw new AggregateError([r,s],"Object3D preview snapshot creation and source cleanup both failed.")}throw r}let n=!1;return{root:o,dispose(){if(n)return;n=!0;const r=[];try{G(o)}catch(s){r.push(s)}try{t.dispose()}catch(s){r.push(s)}if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Object3D preview snapshot cleanup failed.")}}}function R(e,t="front"){se(e);const o=Pt(e,t);if(o.isEmpty())throw new Error("Asset preview source has no renderable bounds.");const n=o.getCenter(new b),r=o.getSize(new b);return{center:n,size:r,radius:Math.max(r.length()/2,.001)}}function se(e){e.parent?.updateWorldMatrix(!0,!1),e.updateMatrixWorld(!0)}function Pt(e,t){const o=new ve;return ae(e,Z(t),t==="perspective",n=>o.expandByPoint(n)),o}function Ut(e,t){const o=t.map(()=>Ce());return t.length===0||(se(e),ae(e,t[0],!1,n=>{for(let r=0;r<t.length;r++)Te(o[r],n,t[r])})),o}function Bt(e,t){const o=t.map(()=>0);let n=0;if(t.length===0)return{framed:o,total:n};se(e);const r=t.map(()=>Ce());let s=-1;const a=()=>{if(!(s<0)){n++;for(let i=0;i<t.length;i++)Et(r[i],t[i].window)&&o[i]++,mt(r[i])}};return ae(e,t[0].basis,!1,(i,c)=>{c!==s&&(a(),s=c);for(let l=0;l<t.length;l++)Te(r[l],i,t[l].basis)}),a(),{framed:o,total:n}}function ae(e,t,o,n){const r=new ve,s=new b,a=new b,i=new ee;let c=0;const l=u=>{if(!u.visible||u!==e&&je(u))return;if(z(u,"gaussianSplat")){r.copy(u.getBoundingBox()).applyMatrix4(u.matrixWorld);const w=c++;for(const f of[r.min.x,r.max.x])for(const E of[r.min.y,r.max.y])for(const v of[r.min.z,r.max.z])n(s.set(f,E,v),w)}const p=u;if(p.isLOD&&p.levels.length>0){const w=new Set(p.levels.map(f=>f.object));for(const f of p.levels)l(f.object);for(const f of u.children)w.has(f)||l(f);return}const d=u;if(d.isSprite&&d.material.visible){if(o&&!d.material.sizeAttenuation)throw new Error("Asset preview cannot deterministically frame a perspective Sprite with sizeAttenuation disabled.");const w=new b().setFromMatrixPosition(d.matrixWorld),f=new b().setFromMatrixScale(d.matrixWorld),E=Math.cos(d.material.rotation),v=Math.sin(d.material.rotation),x=c++;for(const A of[-d.center.x,1-d.center.x])for(const h of[-d.center.y,1-d.center.y]){const g=A*Math.abs(f.x),y=h*Math.abs(f.y),S=E*g-v*y,M=v*g+E*y;n(w.clone().addScaledVector(t.right,S).addScaledVector(t.up,M),x)}}const m=d.isSprite?void 0:u.geometry;if(m){const w=m.getAttribute("position");if(w){const f=Ft(u,m,w.count),E=Ot(u,f.length),v=Math.ceil(f.length/E),x=u;if(x.isInstancedMesh){const A=new xe(x.geometry,x.material);for(let h=0;h<x.count;h++)x.getMatrixAt(h,i),x.morphTexture&&x.getMorphAt(h,A),f.forEach((g,y)=>{A.getVertexPosition(g,a),a.applyMatrix4(i).applyMatrix4(x.matrixWorld),n(a,c+Math.floor(y/E))}),c+=v}else{const A=u;f.forEach((h,g)=>{A.isMesh?A.getVertexPosition(h,a):$t(u,m,h,a),a.applyMatrix4(u.matrixWorld),n(a,c+Math.floor(g/E))}),c+=v}}}for(const w of u.children)l(w)};l(e)}function Ft(e,t,o){const n=e.material;if(!n)return[];const r=t.index?.count??o,s=Math.max(0,t.drawRange.start),a=Math.min(r,Number.isFinite(t.drawRange.count)?s+t.drawRange.count:r),i=[];if(Array.isArray(n))for(const l of t.groups){const u=l.materialIndex??0;if(!n[u]?.visible)continue;const p=Math.max(s,l.start),d=Math.min(a,l.start+l.count);d>p&&i.push([p,d])}else n.visible&&a>s&&i.push([s,a]);const c=[];for(const[l,u]of i){const p=kt(e,u-l);for(let d=l;d<l+p;d++)c.push(t.index?t.index.getX(d):d)}return c}function Ot(e,t){return e.isMesh?3:e.isLineSegments?2:e.isLine?Math.max(t,1):1}function kt(e,t){return e.isMesh?t-t%3:e.isLineSegments?t-t%2:e.isLine?t>=2?t:0:t}function $t(e,t,o,n){const r=t.getAttribute("position");n.fromBufferAttribute(r,o);const s=t.morphAttributes.position,a=e.morphTargetInfluences;if(!s||!a)return n;const i=n.clone(),c=new b,l=new b;for(let u=0;u<s.length;u++){const p=a[u]??0;p!==0&&(l.fromBufferAttribute(s[u],o),t.morphTargetsRelative||l.sub(i),c.addScaledVector(l,p))}return n.add(c)}function Dt(e,t,o){const{center:n,size:r,radius:s}=t;let a=r.x,i=r.y;const c=Z(e),{direction:l,up:u}=c;e==="right"?a=r.z:e==="top"&&(a=r.x,i=r.z);const p=Re(a/2,i/2,o);return re(n,{direction:l,right:c.right,up:u},p,s*3+1,s*10+10)}function Y(e,t,o,n){const r=new Xe(35,t,.01,e.radius*20+20),s=O.degToRad(r.fov/2),a=Math.atan(Math.tan(s)*t),i=Z("perspective"),c=o?.clone().normalize()??i.direction,l=Math.abs(c.y)>.999?new b(0,0,1):new b(0,1,0),u=o?l.clone().cross(c).normalize():i.right,p=o?c.clone().cross(u).normalize():i.up,d=e.size.clone().multiplyScalar(.5);let m=0;for(const w of[-1,1])for(const f of[-1,1])for(const E of[-1,1]){const v=new b(w*d.x,f*d.y,E*d.z),x=v.dot(c);m=Math.max(m,x+Math.abs(v.dot(u))*H/Math.tan(a),x+Math.abs(v.dot(p))*H/Math.tan(s))}return r.position.copy(e.center).addScaledVector(c,Math.max(n??m,.01)),r.lookAt(e.center),r.updateProjectionMatrix(),r.updateMatrixWorld(!0),r}function Z(e){const t=e==="front"?new b(0,0,1):e==="right"?new b(1,0,0):e==="top"?new b(0,1,0):new b(1,.72,1).normalize(),n=(e==="top"?new b(0,0,-1):new b(0,1,0)).clone().cross(t).normalize(),r=t.clone().cross(n).normalize();return{direction:t,right:n,up:r}}function ie(e,t,o){return e==="perspective"?Y(t,o):Dt(e,t,o)}function he(e,t,o){return Y(e,t,o)}function Ue(e,t,o,n){const r=o.map(te),s=Ut(e,r),a=yt(s.map(c=>wt(c,n))),i=new Map;return o.forEach((c,l)=>{i.set(c,re(gt(s[l],r[l]),r[l],a,t.radius*3+1,t.radius*10+10))}),i}function _t(e,t,o={}){const n=T(o.width),r=T(o.height),s=o.background??"neutral",a=$(e);let i=null;try{const c=R(a,"perspective"),l=D(a,c),u=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));i=u,u.setPixelRatio(1),u.outputColorSpace=V,u.toneMapping=j,u.toneMappingExposure=1,u.setClearColor(U,s==="transparent"?0:1),u.setSize(n,r,!1),q(l,u);const p=Math.atan2(t[0],t[2]),d=n/r,m=y=>new b(Math.sin(y),.72,Math.cos(y)).normalize(),w=[p,p+Math.PI,p-Math.PI/2,p+Math.PI/2],f=Ue(a,c,w,d),E=[{label:"front",camera:f.get(w[0])},{label:"back",camera:f.get(w[1])},{label:"left",camera:f.get(w[2])},{label:"right",camera:f.get(w[3])},{label:"quarter-left",camera:he(c,d,m(p-Math.PI/4))},{label:"quarter-right",camera:he(c,d,m(p+Math.PI/4))}],v=[],x=2,A=3,h=document.createElement("canvas");h.width=n*x,h.height=r*A;const g=h.getContext("2d");if(!g)throw new Error("Unable to create the source-review contact sheet.");return E.forEach(({label:y,camera:S},M)=>{u.render(l,S),v.push({label:y,base64:C(u.domElement),mimeType:"image/png"});const I=M%x*n,F=Math.floor(M/x)*r;g.drawImage(u.domElement,I,F,n,r);const ze=y==="quarter-left"?"3/4-L":y==="quarter-right"?"3/4-R":y.toUpperCase();P(g,ze,I,F,n,r)}),{width:n,height:r,shots:v,contactSheet:{width:n*x,height:r*A,base64:C(h),mimeType:"image/png"}}}finally{i&&X(i),i?.dispose(),i?.forceContextLoss(),G(a)}}function zt(e,t,o,n,r){const s=vt(e),a=bt(e,s,t,o,n,r),i=o*3+1;return re(s,t,a,i,i+o*4+1)}function fe(e,t){const o=new Map;e.traverse(a=>{const i=a;i.isBone&&a.name&&o.set(a.name,i)});const n=t.requiredBones??[],r=n.filter(a=>!o.has(a)),s=t.rigRequirementHint?` (${t.rigRequirementHint})`:"";if(n.length>0&&o.size===0)throw new Error(`Asset preview '--shots ${t.name}' requires a rigged GLB${s}, but this model has no skeleton at all. Required joints: ${n.join(", ")}.`);if(r.length>0)throw new Error(`Asset preview '--shots ${t.name}' requires joints this GLB's skeleton does not have${s}. Missing joint(s): ${r.join(", ")}.`);return o}function Wt(e,t,o){const n=o.filter(Ne);for(const r of o)if(Le(r)){const s=t.get(r.bone);if(!s)continue;r.axis==="x"?s.rotateX(r.radians):r.axis==="y"?s.rotateY(r.radians):s.rotateZ(r.radians)}else if(Pe(r)){const s=t.get(r.bone);if(!s)continue;r.axis==="x"?s.translateX(r.meters):r.axis==="y"?s.translateY(r.meters):s.translateZ(r.meters)}n.length!==0&&e.traverse(r=>{const s=r,a=s.morphTargetDictionary,i=s.morphTargetInfluences;if(!(!a||!i))for(const{morph:c,influence:l}of n){const u=a[c];u!==void 0&&(i[u]=l)}})}function Be(e){let t=null;return e.traverse(o=>{t||(t=ft(o.userData.forward))}),t??[0,0,1]}function ne(e,t){const o=new Ee;return o.rotation.y=Ae(t),o.add(e),o.updateMatrixWorld(!0),o}function D(e,t){const o=new it;o.add(e),o.add(new ct(16777215,3489874,1.8*He));const n=new J(16777215,2.2);n.position.copy(t.center).addScaledVector(new b(1,1.5,1),t.radius*3),o.add(n);const r=new J(12572671,.8);r.position.copy(t.center).addScaledVector(new b(-1,.5,-.7),t.radius*2),o.add(r);const s=new J(16773596,.45);return s.position.copy(t.center).addScaledVector(new b(.3,-1,.4),t.radius*2),o.add(s),o}let L=null;function me(){const e=L;L=null,e&&(X(e),e.dispose(),e.forceContextLoss())}function Vt(){if(L?.getContext().isContextLost()&&me(),!L){const e=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));L=e,e.domElement.addEventListener("webglcontextlost",()=>{L===e&&me()})}return L}function Fe(e,t={}){let o=!1;if(e.traverse(i=>{z(i,"gaussianSplat")&&(o=!0)}),o)throw new Error("Gaussian-splat capture requires the async project-asset capture path so Spark can sort each view.");const n=T(t.width),r=T(t.height),s=t.background??"neutral",a=$(e);try{const i=Be(e);t.pose&&Gt(a,t.pose);const c=ne(a,i),l=ce(i),u=R(c,"perspective"),p=D(c,u),d=Vt();if(d.setPixelRatio(1),d.outputColorSpace=V,d.toneMapping=j,d.toneMappingExposure=1,d.setClearColor(U,s==="transparent"?0:1),q(p,d),t.camera)return Ht(d,p,Y(u,n/r,ge(t.camera),t.camera.distance),n,r,t.camera,l);const m=new Map;for(const f of k)m.set(f,ie(f,R(c,f),n/r));const w=Y(u,n/r,ge({azimuthDegrees:30,elevationDegrees:-60}));return ke(d,p,m,n,r,l,w)}finally{G(a)}}function jt(e,t,o){const n=Oe(t,o.yawDegrees);if(!n)return e;const r=document.createElement("canvas");r.width=e.width,r.height=e.height;const s=r.getContext("2d");if(!s)return e;s.drawImage(e,0,0);const a=Se(n.text,e.width,e.height),i=n.edge==="left"?0:e.width-a.width;return P(s,n.text,i,e.height-a.height,e.width,e.height),r}function ce(e){const t=Ae(e);return{forward:[e[0],e[1],e[2]],yawDegrees:Math.round(O.radToDeg(t))}}function Gt(e,t){if(!Number.isFinite(t.timeSeconds)||t.timeSeconds<0)throw new Error(`Asset preview pose time must be a finite number of seconds >= 0, got ${t.timeSeconds}.`);const o=e.animations??[],n=o.find(s=>s.name===t.clip);if(!n){const s=o.map(a=>`'${a.name}'`).join(", ");throw new Error(`Asset preview pose clip '${t.clip}' not found on the subject. `+(s?`Its clips are: ${s}.`:"The subject carries no animation clips at all — clips live on the model root (GLB animations, or a builder module’s `root.animations`)."))}const r=new at(e);r.clipAction(n).play(),r.update(t.timeSeconds),e.updateMatrixWorld(!0)}function ge(e){const t=O.degToRad(e.azimuthDegrees),o=O.degToRad(e.elevationDegrees);return new b(Math.sin(t)*Math.cos(o),Math.sin(o),Math.cos(t)*Math.cos(o)).normalize()}function Ht(e,t,o,n,r,s,a){e.setSize(n,r,!1),e.render(t,o);const i={view:"perspective",base64:C(e.domElement),mimeType:"image/png"},c=document.createElement("canvas");c.width=n,c.height=r;const l=c.getContext("2d");if(!l)throw new Error("Unable to create the asset preview contact sheet.");l.drawImage(e.domElement,0,0,n,r);const u=`AZ ${Math.round(s.azimuthDegrees)} EL ${Math.round(s.elevationDegrees)}`+(s.distance===void 0?"":` D ${Math.round(s.distance)}`);return P(l,u,0,0,n,r),{width:n,height:r,orientation:a,views:[i],contactSheet:{width:n,height:r,base64:C(c),mimeType:"image/png"}}}function Oe(e,t){if(e==="perspective")return null;const o=O.degToRad(t),n=Z(e).right.applyAxisAngle(new b(0,1,0),-o),r=[["X",new b(1,0,0)],["Y",new b(0,1,0)],["Z",new b(0,0,1)]];for(const[s,a]of r){const i=n.dot(a);if(i>.99)return{text:`+${s}>`,edge:"right"};if(i<-.99)return{text:`<+${s}`,edge:"left"}}return{text:`YAW ${t}`,edge:"left"}}function ke(e,t,o,n,r,s,a){const i=[],c=a?[...k,"below"]:[...k],l=a?3:2,u=n*l,p=r*2,d=document.createElement("canvas");d.width=u,d.height=p;const m=d.getContext("2d");if(!m)throw new Error("Unable to create the asset preview contact sheet.");e.getClearAlpha()>0&&(m.fillStyle=`#${new lt(U).getHexString()}`,m.fillRect(0,0,u,p)),e.setSize(n,r,!1),c.forEach((f,E)=>{const v=f==="below"?a:o.get(f);if(!v)return;e.render(t,v),i.push({view:f,base64:C(f==="below"?e.domElement:jt(e.domElement,f,s)),mimeType:"image/png"});const x=E%l,A=Math.floor(E/l),h=x*n,g=A*r;m.drawImage(e.domElement,h,g,n,r);const y=f==="perspective"?"3/4":f.toUpperCase();if(P(m,y,h,g,n,r),f==="below")return;const S=Oe(f,s.yawDegrees);if(S){const M=Se(S.text,n,r),I=S.edge==="left"?h:h+n-M.width;P(m,S.text,I,g+r-M.height,n,r)}});const w={width:u,height:p,base64:C(d),mimeType:"image/png"};return{width:n,height:r,orientation:s,views:i,contactSheet:w}}function xn(e,t,o={}){let n=!1;if(e.traverse(l=>{z(l,"gaussianSplat")&&(n=!0)}),n)throw new Error("Gaussian-splat capture requires the async project-asset capture path so Spark can sort each view.");const r=T(o.width),s=T(o.height),a=o.background??"neutral",i=[];let c=null;try{t.traverse(p=>{p.visible&&Ve(p)&&(p.visible=!1,i.push(p))});const l=new Map;for(const p of k){const d=ie(p,R(e,p),r/s);d.layers.enableAll(),d.layers.disable(ye),l.set(p,d)}const u=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));return c=u,u.setPixelRatio(1),u.outputColorSpace=V,u.toneMapping=j,u.toneMappingExposure=1,u.setClearColor(U,a==="transparent"?0:1),ke(u,t,l,r,s,ce([0,0,1]))}finally{for(const l of i)l.visible=!0;c?.dispose(),c?.forceContextLoss()}}function Yt(e,t,o){const n=e.pose===void 0?"":` under pose '${e.pose}'`,r=e.view==="bone-zoom"?`bone-zoom on ${e.bones.join(", ")} at yaw ${(e.yaw??0).toFixed(3)}`:`turntable at yaw ${e.yaw.toFixed(3)}`,s=e.view==="bone-zoom"?"Zoom anchors are read from the REST skeleton for every shot, so a pose that MOVES the anchor leaves the crop behind where the joint used to be: re-aim the shot (another joint or yaw), widen its spanFraction, or drop it.":"Check the shot yaw and the pose it renders under.";return{label:e.label,reason:"empty-frame",...e.view==="bone-zoom"?{bones:[...e.bones]}:{},...e.pose===void 0?{}:{pose:e.pose},message:`Asset preview '--shots ${t}' shot ${JSON.stringify(e.label)} (${r}${n}) framed NONE of the subject's ${o} rendered faces: the image is background only and proves nothing about the asset. ${s}`}}function qt(e,t,o){const n=[],r=()=>{for(const s of n)G(s);n.length=0};try{const s=$(e);n.push(s);const a=fe(s,t),i=Be(e),c=ne(s,i),l=R(c,"perspective"),u=D(c,l),p={subject:c,scene:u,framing:l},d=new Map;for(const h of t.shots){if(h.pose===void 0||d.has(h.pose))continue;const g=t.poses?.[h.pose]??[],y=$(e);n.push(y);const S=fe(y,t);Wt(y,S,g),y.updateMatrixWorld(!0);const M=ne(y,i),I=R(M,"perspective");d.set(h.pose,{subject:M,scene:D(M,I),framing:I})}const m=h=>h===void 0?p:d.get(h),w=h=>new b().setFromMatrixPosition(a.get(h).matrixWorld),f=new Map;for(const h of new Set(t.shots.filter(g=>g.view==="turntable").map(g=>g.pose??void 0))){const g=m(h),y=[...new Set(t.shots.filter(S=>S.view==="turntable"&&(S.pose??void 0)===h).map(S=>S.yaw))];f.set(h,Ue(g.subject,g.framing,y,o))}const E=t.shots.map(h=>{const g=m(h.pose);if(h.view==="turntable")return{label:h.label,camera:f.get(h.pose??void 0).get(h.yaw),scene:g.scene,stage:g,basis:te(h.yaw)};const y=h.bones.find(M=>!a.has(M));if(y!==void 0)throw new Error(`Asset preview '--shots ${t.name}' shot ${JSON.stringify(h.label)} zooms on a joint this GLB's skeleton does not have: ${y}. List it in the definition's requiredBones or fix the rig.`);const S=te(h.yaw??0);return{label:h.label,camera:zt(h.bones.map(w),S,l.radius,h.spanFraction,o),scene:g.scene,stage:g,basis:S}}),v=[],x=new Map,A=new Map;E.forEach(({stage:h},g)=>{const y=A.get(h);y?y.push(g):A.set(h,[g])});for(const[h,g]of A){const{framed:y,total:S}=Bt(h.subject,g.map(M=>{const I=E[M];return{basis:I.basis,window:xt(I.camera,I.basis)}}));g.forEach((M,I)=>{if(y[I]!==0)return;const F=Yt(t.shots[M],t.name,S);x.set(M,F),v.push(F)})}return{shots:E.map(({label:h,camera:g,scene:y},S)=>{const M=x.get(S);return{label:h,camera:g,scene:y,...M?{warning:M}:{}}}),warnings:v,dispose:r}}catch(s){throw r(),s}}function $e(e,t,o={}){const n=T(o.width),r=T(o.height),s=o.background??"neutral",a=qt(e,t,n/r);let i=null;try{const c=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));i=c,c.setPixelRatio(1),c.outputColorSpace=V,c.toneMapping=j,c.toneMappingExposure=1,c.setClearColor(U,s==="transparent"?0:1),c.setSize(n,r,!1);for(const v of a.shots)q(v.scene,c);const l=[],u=2,p=Math.ceil(a.shots.length/u),d=n*u,m=r*p,w=document.createElement("canvas");w.width=d,w.height=m;const f=w.getContext("2d");if(!f)throw new Error("Unable to create the asset preview contact sheet.");a.shots.forEach(({label:v,camera:x,scene:A,warning:h},g)=>{c.render(A,x),l.push({label:v,base64:C(c.domElement),mimeType:"image/png"});const y=g%u,S=Math.floor(g/u),M=y*n,I=S*r;f.drawImage(c.domElement,M,I,n,r),P(f,h?`${v.toUpperCase()} - EMPTY`:v.toUpperCase(),M,I,n,r,h?"warning":"normal")});const E={width:d,height:m,base64:C(w),mimeType:"image/png"};return{width:n,height:r,shots:l,warnings:a.warnings,contactSheet:E}}finally{i&&X(i),i?.dispose(),i?.forceContextLoss(),a.dispose()}}function Xt(e){const t=e.replace(/^\/?public(\/|$)/,"/");if(!t.startsWith("/")||t.startsWith("//")||t.includes("\\")||t.includes("?")||t.includes("#"))throw new Error("Model asset paths must be the served web path (project-root absolute, with public/ stripped): e.g. /models/generated/hero.glb");let o;try{o=decodeURIComponent(t)}catch{throw new Error("Asset Editor model path contains invalid URL encoding.")}if(o.split("/").some(s=>s==="."||s===".."))throw new Error("Asset Editor model paths cannot traverse outside the project root.");const n=globalThis.location?.origin??"http://localhost",r=new URL(t,n);if(r.origin!==n||!r.pathname.toLowerCase().match(/\.(?:glb|gltf|spz)$/))throw new Error("Asset Editor loads bounded, same-origin project .glb, .gltf, or .spz files only.");return r}async function De(e,t,o=N){const n=await fetch(e,{signal:t});if(!n.ok)throw new Error(`Unable to load project model (${n.status} ${n.statusText}).`);const r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>o)throw new Error(`Asset Editor project models must be ${N/1024/1024} MiB or less.`);if(!n.body){const u=await n.arrayBuffer();if(u.byteLength>o)throw new Error(`Asset Editor project models must be ${N/1024/1024} MiB or less.`);return u}const s=n.body.getReader(),a=[];let i=0;try{for(;;){const{done:u,value:p}=await s.read();if(u)break;if(i+=p.byteLength,i>o)throw await s.cancel(),new Error(`Asset Editor project models must be ${N/1024/1024} MiB or less.`);a.push(p)}}finally{s.releaseLock()}const c=new Uint8Array(i);let l=0;for(const u of a)c.set(u,l),l+=u.byteLength;return c.buffer}function we(e,t,o){return new Promise((n,r)=>{let s=!1;const a=c=>s?!1:(s=!0,o.removeEventListener("abort",i),c(),!0),i=()=>a(()=>r(o.reason));if(o.addEventListener("abort",i,{once:!0}),o.aborted){i();return}be.parse(e,new URL(".",t).href,c=>{c.scene.animations=[...c.animations],a(()=>n(c.scene))||B(c.scene)},c=>a(()=>r(c)))})}function Zt(e,t){if(e.includes("\\")||e.includes("?")||e.includes("#"))throw new Error("Asset Editor .gltf dependencies must be plain same-origin project paths.");const o=new URL(e,t);if(o.origin!==t.origin)throw new Error("Asset Editor .gltf dependencies must stay on the project origin.");return o}function Jt(e,t){if(typeof e.mimeType=="string")return e.mimeType;const o=t.pathname.split(".").pop()?.toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="webp"?"image/webp":"application/octet-stream"}async function Kt(e,t,o){let n;try{n=JSON.parse(new TextDecoder().decode(e))}catch{throw new Error("Asset Editor could not parse the project .gltf JSON document.")}const r=[...Array.isArray(n.buffers)?n.buffers:[],...Array.isArray(n.images)?n.images:[]];let s=e.byteLength;for(const a of r){if(typeof a.uri!="string"||a.uri.startsWith("data:"))continue;const i=Zt(a.uri,t),c=await De(i,o,N-s);s+=c.byteLength;const l=new Uint8Array(c);let u="";for(let p=0;p<l.length;p+=32768)u+=String.fromCharCode(...l.subarray(p,p+32768));a.uri=`data:${Jt(a,i)};base64,${btoa(u)}`}return JSON.stringify(n)}function _e(e,t){let o;try{const n=atob(e);o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)}catch{throw new Error(`${t} is not valid base64.`)}if(o.byteLength===0||o.byteLength>N)throw new Error(`${t} must be non-empty and at most ${N/1024/1024} MiB.`);return new Promise((n,r)=>{be.parse(o.buffer,"",s=>{s.scene.animations=[...s.animations],n(s.scene)},s=>r(s instanceof Error?s:new Error(String(s))))})}async function En(e,t={}){const o=await _e(e,"Asset preview GLB bytes");try{return Fe(o,t)}finally{B(o)}}async function Sn(e,t,o={}){const n=await _e(e,"Asset preview GLB bytes");try{return $e(n,t,o)}finally{B(n)}}async function Qt(e,t){const o=Xt(e),n=new AbortController,r=()=>n.abort(t?.reason);t?.aborted?r():t?.addEventListener("abort",r,{once:!0});const s=globalThis.setTimeout(()=>n.abort(new Error("Asset Editor project model load timed out after 25 seconds.")),It);try{const a=await De(o,n.signal);if(n.signal.throwIfAborted(),o.pathname.toLowerCase().endsWith(".spz"))return{root:await Ge(e,new Uint8Array(a)),sourceBytes:null};if(o.pathname.toLowerCase().endsWith(".glb")){const c=new Uint8Array(a.slice(0));return{root:await we(a,o,n.signal),sourceBytes:c}}const i=await Kt(a,o,n.signal);return{root:await we(i,o,n.signal),sourceBytes:null}}finally{globalThis.clearTimeout(s),t?.removeEventListener("abort",r)}}async function le(e,t){return(await Qt(e,t)).root}function B(e){z(e,"gaussianSplat")&&e.dispose(),G(e),e.traverse(t=>{const o=t;o.isInstancedMesh&&o.morphTexture?.dispose();const n=t;if(n.geometry?.dispose(),!n.material)return;const r=Array.isArray(n.material)?n.material:[n.material];for(const s of r){for(const a of Object.values(s))a instanceof qe&&a.dispose();s.dispose()}})}async function Mn(e,t={}){const o=await le(e);try{return z(o,"gaussianSplat")?await en(o,t):Fe(o,t)}finally{B(o)}}async function An(e,t,o={}){const n=await le(e);try{return _t(n,t,o)}finally{B(n)}}async function en(e,t){const o=T(t.width),n=T(t.height),r=t.background??"neutral",s=R(e,"perspective"),a=D(e,s),i=_(new W({antialias:!1,alpha:!0,preserveDrawingBuffer:!0}));let c=null;try{const l=await We(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3]));c=new l.SparkRenderer({renderer:i,autoUpdate:!1,enableLod:!1}),a.add(c),i.setPixelRatio(1),i.outputColorSpace=V,i.toneMapping=j,i.toneMappingExposure=1,i.setClearColor(U,r==="transparent"?0:1),i.setSize(o,n,!1),q(a,i);const u=[],p=document.createElement("canvas");p.width=o*2,p.height=n*2;const d=p.getContext("2d");if(!d)throw new Error("Unable to create the asset preview contact sheet.");for(const[m,w]of k.entries()){const f=ie(w,R(e,w),o/n);await c.update({scene:a,camera:f}),i.render(a,f),u.push({view:w,base64:C(i.domElement),mimeType:"image/png"});const E=m%2*o,v=Math.floor(m/2)*n;d.drawImage(i.domElement,E,v,o,n),P(d,w==="perspective"?"3/4":w.toUpperCase(),E,v,o,n)}return{width:o,height:n,orientation:ce([0,0,1]),views:u,contactSheet:{width:o*2,height:n*2,base64:C(p),mimeType:"image/png"}}}finally{c?.removeFromParent(),e.removeFromParent(),c?.dispose(),X(i),i.dispose(),i.forceContextLoss()}}async function In(e,t,o={}){const n=await le(e);try{return $e(n,t,o)}finally{B(n)}}export{pn as A,An as B,dn as C,_t as D,xn as E,En as F,Fe as a,$ as b,Mn as c,B as d,bn as e,G as f,vn as g,le as h,he as i,T as j,C as k,Qt as l,R as m,mn as n,gn as o,_e as p,Ae as q,Be as r,fn as s,wn as t,hn as u,yn as v,ft as w,Sn as x,In as y,$e as z};
|
|
2
|
+
import{_ as We}from"./index-BfqJPhFO.js";import{EDITOR_LAYER as ye,isEditorOwnedObject as Ve}from"./editor-layers-k0AjpomL.js";import{m as _}from"./renderer-ownership-BovSEcLv.js";import{i as je}from"./hierarchy-marks-C2temlO0.js";import{l as Ge,g as be,a as q,d as X,S as He}from"./studio-environment-BNM-AjAn.js";import{h as z}from"./user-data-CTT8ZvVB.js";import{W}from"./three.module-BLhyNg0e.js";import{d5 as Ye,fo as b,eW as qe,cm as ee,I as ve,d9 as Xe,cj as O,ev as Ze,bu as Je,co as xe,c0 as Ke,b$ as Qe,bV as et,df as tt,eE as nt,bK as ot,F as rt,bh as Ee,cW as st,ej as V,A as j,n as at,el as it,bj as ct,aE as J,_ as lt}from"./three.core-3arARmh6.js";import{d as P,m as Se}from"./bitmap-label-Ct4k6ehY.js";const pn=["front","side"],Me=1,dn=.55,hn=Me/2,K=128,ut=[24,26,31],pt=[235,137,52],dt=[56,189,248],ht=[236,240,238];function fn(e,t){if(e.length<t*4)throw new Error(`Silhouette mask expected ${t*4} RGBA bytes but received ${e.length}.`);const o=new Uint8Array(t);for(let n=0;n<t;n++){const r=n*4,s=e[r]>=K||e[r+1]>=K||e[r+2]>=K;o[n]=s?1:0}return o}function mn(e,t){if(e.length!==t.length)throw new Error(`Mask IoU requires equal-size masks (${e.length} vs ${t.length}).`);let o=0,n=0,r=0;for(let a=0;a<e.length;a++){const i=e[a]!==0,c=t[a]!==0;i&&n++,c&&r++,i&&c&&o++}const s=n+r-o;return{intersection:o,union:s,aCount:n,bCount:r,iou:s===0?0:o/s}}function gn(e,t){if(e.length!==t.length)throw new Error(`Overlay requires equal-size masks (${e.length} vs ${t.length}).`);const o=new Uint8ClampedArray(e.length*4);for(let n=0;n<e.length;n++){const r=e[n]!==0,s=t[n]!==0,a=r&&s?ht:r?pt:s?dt:ut,i=n*4;o[i]=a[0],o[i+1]=a[1],o[i+2]=a[2],o[i+3]=255}return o}function ft(e){if(!Array.isArray(e)||e.length!==3)return null;const[t,o,n]=e;return typeof t!="number"||typeof o!="number"||typeof n!="number"||!Number.isFinite(t)||!Number.isFinite(o)||!Number.isFinite(n)||Math.hypot(t,n)<1e-6?null:[t,o,n]}function Ae(e){const[t,,o]=e;if(!Number.isFinite(t)||!Number.isFinite(o)||Math.hypot(t,o)<1e-6)throw new Error(`Cannot derive a facing from forward vector [${e.join(", ")}].`);return Math.atan2(t,o)}function wn(e,t,o=Me){const n=t[1]-e[1];if(!Number.isFinite(n)||n<=0)throw new Error(`Compare normalization needs positive model height, got ${n}.`);const r=o/n,s=(e[0]+t[0])/2,a=(e[2]+t[2])/2;return{scale:r,position:[-s*r,-e[1]*r,-a*r]}}const H=1.2,Ie=.001;function te(e){const t=new b(Math.sin(e),0,Math.cos(e)),n=new b(0,1,0).clone().cross(t).normalize(),r=t.clone().cross(n).normalize();return{direction:t,right:n,up:r}}function Ce(){return{minRight:Number.POSITIVE_INFINITY,maxRight:Number.NEGATIVE_INFINITY,minUp:Number.POSITIVE_INFINITY,maxUp:Number.NEGATIVE_INFINITY,minDepth:Number.POSITIVE_INFINITY,maxDepth:Number.NEGATIVE_INFINITY}}function oe(e){return e.maxRight<e.minRight}function mt(e){e.minRight=Number.POSITIVE_INFINITY,e.maxRight=Number.NEGATIVE_INFINITY,e.minUp=Number.POSITIVE_INFINITY,e.maxUp=Number.NEGATIVE_INFINITY,e.minDepth=Number.POSITIVE_INFINITY,e.maxDepth=Number.NEGATIVE_INFINITY}function Te(e,t,o){const n=t.dot(o.right),r=t.dot(o.up),s=t.dot(o.direction);n<e.minRight&&(e.minRight=n),n>e.maxRight&&(e.maxRight=n),r<e.minUp&&(e.minUp=r),r>e.maxUp&&(e.maxUp=r),s<e.minDepth&&(e.minDepth=s),s>e.maxDepth&&(e.maxDepth=s)}function gt(e,t){if(oe(e))throw new Error("Asset preview cannot frame an empty projected span.");return new b().addScaledVector(t.right,(e.minRight+e.maxRight)/2).addScaledVector(t.up,(e.minUp+e.maxUp)/2).addScaledVector(t.direction,(e.minDepth+e.maxDepth)/2)}function Re(e,t,o,n=H){const r=Math.max(t,e/o,Ie)*n;return{halfHeight:r,halfWidth:r*o}}function wt(e,t,o=H){if(oe(e))throw new Error("Asset preview cannot frame an empty projected span.");return Re((e.maxRight-e.minRight)/2,(e.maxUp-e.minUp)/2,t,o)}function yt(e){if(e.length===0)throw new Error("Asset preview cannot union an empty set of frames.");let t=0,o=0;for(const n of e)t=Math.max(t,n.halfWidth),o=Math.max(o,n.halfHeight);return{halfWidth:t,halfHeight:o}}function bt(e,t,o,n,r,s){const a=Math.max(n*r,Ie);let i=a,c=a;const l=new b;for(const u of e)l.copy(u).sub(t),i=Math.max(i,Math.abs(l.dot(o.right))+a),c=Math.max(c,Math.abs(l.dot(o.up))+a);return i=Math.max(i,c*s),c=Math.max(c,i/s),{halfWidth:i,halfHeight:c}}function vt(e){if(e.length===0)throw new Error("Asset preview cannot centre a bone-zoom crop on zero anchors.");const t=new b;for(const o of e)t.add(o);return t.multiplyScalar(1/e.length)}function xt(e,t){const o=e.position.dot(t.right),n=e.position.dot(t.up),r=e.position.dot(t.direction),s=e.zoom||1;return{minRight:o+e.left/s,maxRight:o+e.right/s,minUp:n+e.bottom/s,maxUp:n+e.top/s,minDepth:r-e.far,maxDepth:r-e.near}}function Et(e,t){return oe(e)?!1:e.maxRight>=t.minRight&&e.minRight<=t.maxRight&&e.maxUp>=t.minUp&&e.minUp<=t.maxUp&&e.maxDepth>=t.minDepth&&e.minDepth<=t.maxDepth}function re(e,t,o,n,r){const s=new Ye(-o.halfWidth,o.halfWidth,o.halfHeight,-o.halfHeight,.01,r);return s.position.copy(e).addScaledVector(t.direction,n),s.up.copy(t.up),s.lookAt(e),s.updateProjectionMatrix(),s.updateMatrixWorld(!0),s}const k=["front","right","top","perspective"],ue=24;function Le(e){const t=e;return typeof t=="object"&&t!==null&&typeof t.bone=="string"&&t.bone.length>0&&(t.axis==="x"||t.axis==="y"||t.axis==="z")&&typeof t.radians=="number"&&Number.isFinite(t.radians)}function Ne(e){const t=e;return typeof t=="object"&&t!==null&&typeof t.morph=="string"&&t.morph.length>0&&typeof t.influence=="number"&&Number.isFinite(t.influence)}function Pe(e){const t=e;return typeof t=="object"&&t!==null&&typeof t.bone=="string"&&t.bone.length>0&&(t.axis==="x"||t.axis==="y"||t.axis==="z")&&typeof t.meters=="number"&&Number.isFinite(t.meters)}function St(e){return Le(e)||Ne(e)||Pe(e)}function Mt(e,t){const o=e;if(typeof o!="object"||o===null||typeof o.label!="string"||!/^[a-z0-9][a-z0-9-]*$/i.test(o.label)||o.pose!==void 0&&(typeof o.pose!="string"||!t.has(o.pose)))return!1;if(o.view==="turntable")return typeof o.yaw=="number"&&Number.isFinite(o.yaw);if(o.view==="bone-zoom"){const n=o;return n.yaw!==void 0&&(typeof n.yaw!="number"||!Number.isFinite(n.yaw))?!1:Array.isArray(n.bones)&&n.bones.length>0&&n.bones.every(r=>typeof r=="string"&&r.length>0)&&typeof n.spanFraction=="number"&&Number.isFinite(n.spanFraction)&&n.spanFraction>0&&n.spanFraction<=2}return!1}function yn(e){const t=c=>{throw new Error(`Asset preview shot-set definition is invalid: ${c}`)},o=e;(typeof o!="object"||o===null)&&t("expected an object.");const n=o;(typeof n.name!="string"||!/^[a-z0-9][a-z0-9-]*$/i.test(n.name))&&t("`name` must be a short alphanumeric/dash identifier."),n.requiredBones!==void 0&&(!Array.isArray(n.requiredBones)||n.requiredBones.some(c=>typeof c!="string"||c.length===0))&&t("`requiredBones` must be an array of non-empty bone names."),n.rigRequirementHint!==void 0&&typeof n.rigRequirementHint!="string"&&t("`rigRequirementHint` must be a string.");const r=n.poses??{};(typeof r!="object"||r===null||Array.isArray(r))&&t("`poses` must be an object of named pose-step lists.");for(const[c,l]of Object.entries(r))(!Array.isArray(l)||!l.every(St))&&t(`pose ${JSON.stringify(c)} must be an array of {bone, axis, radians} and/or {morph, influence}.`);const s=new Set(Object.keys(r));(!Array.isArray(n.shots)||n.shots.length===0||n.shots.length>ue)&&t(`\`shots\` must list 1-${ue} shots.`);const a=n.shots,i=new Set;for(const c of a){Mt(c,s)||t('every shot needs a label plus either {view:"turntable", yaw} or {view:"bone-zoom", bones, spanFraction, yaw?}, with every `yaw` a finite number of radians and `pose` naming a declared pose.');const{label:l}=c;i.has(l)&&t(`duplicate shot label ${JSON.stringify(l)}.`),i.add(l)}return n}const At=512,pe=64,de=1024,U=2106410,It=25e3,N=64*1024*1024;function T(e){const t=e??At;if(!Number.isInteger(t)||t<pe||t>de)throw new Error(`Asset preview dimensions must be integers from ${pe} to ${de}.`);return t}function C(e){const t=e.toDataURL("image/png"),o=t.indexOf(",");return o>=0?t.slice(o+1):t}function bn(e){const t=new Set;e.traverse(n=>t.add(n));let o=e;return e.traverse(n=>{const r=n;if(!(!r.isSkinnedMesh||!r.skeleton))for(const s of r.skeleton.bones){if(!s||t.has(s))continue;const a=new Set;for(let c=o;c;c=c.parent)a.add(c);let i=null;for(let c=s;c;c=c.parent)if(a.has(c)){i=c;break}i&&i!==o&&(o=i,o.traverse(c=>t.add(c)))}}),o}function $(e){const t=new Set;e.traverse(a=>{t.add(a)});const o=Tt(e,t),n=Rt(e,o),r=Ct(e);n.matrix.copy(r),n.matrix.decompose(n.position,n.quaternion,n.scale),n.matrixAutoUpdate=!1,n.matrixWorld.copy(r),n.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,n.visible=!0;const s=[];n.traverse(a=>{a!==n&&a.userData.editorHelper&&s.push(a)});for(const a of s)a.parent?.remove(a);return n}function Ct(e){const t=[];let o=e;for(;o;)t.push(o),o=o.parent;const n=t.findIndex(i=>!i.matrixWorldAutoUpdate),r=n>=0?t[n].matrixWorld.clone():new ee,s=new ee,a=n>=0?n-1:t.length-1;for(let i=a;i>=0;i--){const c=t[i];c.matrixAutoUpdate?s.compose(c.position,c.quaternion,c.scale):s.copy(c.matrix),r.multiply(s)}return r}function Tt(e,t){const o=new Map,n=new Map;let r=null;const s=()=>{if(r)return r;const a=new Map;for(const i of t){const c=i;if(!c.isBone||c.name==="")continue;const l=a.get(c.name);l?l.push(c):a.set(c.name,[c])}return r=a,a};if(e.traverse(a=>{const i=a;if(!i.isSkinnedMesh)return;const c=i.name||i.uuid;for(const l of i.skeleton.bones){if(l&&t.has(l)||l&&o.has(l))continue;const u=l?s().get(l.name)??[]:[];if(u.length===1){o.set(l,u[0]);continue}const p=l?.name||"(unnamed bone)";n.set(`${c} -> ${p}`,{mesh:c,bone:p,sameNamed:u.length})}}),n.size>0){const a=[...n.values()].map(({mesh:i,bone:c,sameNamed:l})=>l>1?`${i} -> ${c} (${l} bones inside the selection share that name — which one is meant is ambiguous)`:`${i} -> ${c} (no bone of that name inside the selection)`).join("; ");throw new Error(`Asset preview selection references bones outside its hierarchy that it cannot bind to: ${a}. Select the complete skeleton root — the node that owns both the skinned mesh and its bones.`)}return o}function Rt(e,t=new Map){const o=new Map,n=[],r=a=>{const i=Lt(a);o.set(a,i),Nt(a,i),a.isSkinnedMesh&&n.push([a,i]);const c=a;if(c.isLOD){const l=i,u=c.levels.filter(m=>m.object.visible),p=u.length===1?u[0]:c.levels[0];l.autoUpdate=!1;const d=new Set(c.levels.map(m=>m.object));for(const m of c.levels){if(Q(m.object))continue;const w=r(m.object);w.visible=c.autoUpdate?m===p:m.object.visible,l.addLevel(w,m.distance,m.hysteresis)}for(const m of a.children)!d.has(m)&&!Q(m)&&i.add(r(m))}else for(const l of a.children)Q(l)||i.add(r(l));return i},s=r(e);for(const[a,i]of n){const c=a.skeleton.clone();c.bones=a.skeleton.bones.map(l=>{const u=o.get(t.get(l)??l);if(!u?.isBone)throw new Error(`Asset preview could not map skeleton bone: ${l.name||l.uuid}`);return u}),i.skeleton=c,i.bindMode=a.bindMode,i.bindMatrix.copy(a.bindMatrix),i.bindMatrixInverse.copy(a.bindMatrixInverse)}return s}function Lt(e){const t=e;if(t.isSkinnedMesh)return new Ze(t.geometry,t.material);const o=e;if(o.isInstancedMesh){const i=new Je(o.geometry,o.material,o.count);return i.instanceMatrix.copy(o.instanceMatrix),i.instanceColor=o.instanceColor?o.instanceColor.clone():null,i.morphTexture=o.morphTexture,i}const n=e;if(n.isMesh)return new xe(n.geometry,n.material);const r=e;if(e.isLineSegments)return new Ke(r.geometry,r.material);if(e.isLineLoop)return new Qe(r.geometry,r.material);if(r.isLine)return new et(r.geometry,r.material);const s=e;if(s.isPoints)return new tt(s.geometry,s.material);const a=e;return a.isSprite?new nt(a.material):e.isLOD?new ot:e.isBone?new rt:e.isGroup?new Ee:new st}function Nt(e,t){t.name=e.name,t.up.copy(e.up),t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.copy(e.scale),t.matrix.copy(e.matrix),t.matrixWorld.copy(e.matrixWorld),t.matrixAutoUpdate=e.matrixAutoUpdate,t.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,t.visible=e.visible,t.castShadow=e.castShadow,t.receiveShadow=e.receiveShadow,t.frustumCulled=!1,t.renderOrder=e.renderOrder,t.layers.set(0),t.animations=[...e.animations];const o=e,n=t;o.morphTargetInfluences&&(o.morphTargetDictionary&&(n.morphTargetDictionary={...o.morphTargetDictionary}),n.morphTargetInfluences=[...o.morphTargetInfluences]);const r=e;r.isSprite&&t.center.copy(r.center)}function Q(e){const t=1<<ye;return!!(e.userData.editorHelper||e.userData.editorIcon||(e.layers.mask&t)!==0)}function G(e){const t=new Set;e.traverse(o=>{const n=o;n.isSkinnedMesh&&t.add(n.skeleton);const r=o;if(r.isInstancedMesh){const s=r.morphTexture;r.morphTexture=null,r.dispose(),r.morphTexture=s}});for(const o of t)o.dispose()}function vn(e){const t=e();let o;try{o=$(t.root),o.animations=[...t.animations??t.root.animations]}catch(r){try{t.dispose()}catch(s){throw new AggregateError([r,s],"Object3D preview snapshot creation and source cleanup both failed.")}throw r}let n=!1;return{root:o,dispose(){if(n)return;n=!0;const r=[];try{G(o)}catch(s){r.push(s)}try{t.dispose()}catch(s){r.push(s)}if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Object3D preview snapshot cleanup failed.")}}}function R(e,t="front"){se(e);const o=Pt(e,t);if(o.isEmpty())throw new Error("Asset preview source has no renderable bounds.");const n=o.getCenter(new b),r=o.getSize(new b);return{center:n,size:r,radius:Math.max(r.length()/2,.001)}}function se(e){e.parent?.updateWorldMatrix(!0,!1),e.updateMatrixWorld(!0)}function Pt(e,t){const o=new ve;return ae(e,Z(t),t==="perspective",n=>o.expandByPoint(n)),o}function Ut(e,t){const o=t.map(()=>Ce());return t.length===0||(se(e),ae(e,t[0],!1,n=>{for(let r=0;r<t.length;r++)Te(o[r],n,t[r])})),o}function Bt(e,t){const o=t.map(()=>0);let n=0;if(t.length===0)return{framed:o,total:n};se(e);const r=t.map(()=>Ce());let s=-1;const a=()=>{if(!(s<0)){n++;for(let i=0;i<t.length;i++)Et(r[i],t[i].window)&&o[i]++,mt(r[i])}};return ae(e,t[0].basis,!1,(i,c)=>{c!==s&&(a(),s=c);for(let l=0;l<t.length;l++)Te(r[l],i,t[l].basis)}),a(),{framed:o,total:n}}function ae(e,t,o,n){const r=new ve,s=new b,a=new b,i=new ee;let c=0;const l=u=>{if(!u.visible||u!==e&&je(u))return;if(z(u,"gaussianSplat")){r.copy(u.getBoundingBox()).applyMatrix4(u.matrixWorld);const w=c++;for(const f of[r.min.x,r.max.x])for(const E of[r.min.y,r.max.y])for(const v of[r.min.z,r.max.z])n(s.set(f,E,v),w)}const p=u;if(p.isLOD&&p.levels.length>0){const w=new Set(p.levels.map(f=>f.object));for(const f of p.levels)l(f.object);for(const f of u.children)w.has(f)||l(f);return}const d=u;if(d.isSprite&&d.material.visible){if(o&&!d.material.sizeAttenuation)throw new Error("Asset preview cannot deterministically frame a perspective Sprite with sizeAttenuation disabled.");const w=new b().setFromMatrixPosition(d.matrixWorld),f=new b().setFromMatrixScale(d.matrixWorld),E=Math.cos(d.material.rotation),v=Math.sin(d.material.rotation),x=c++;for(const A of[-d.center.x,1-d.center.x])for(const h of[-d.center.y,1-d.center.y]){const g=A*Math.abs(f.x),y=h*Math.abs(f.y),S=E*g-v*y,M=v*g+E*y;n(w.clone().addScaledVector(t.right,S).addScaledVector(t.up,M),x)}}const m=d.isSprite?void 0:u.geometry;if(m){const w=m.getAttribute("position");if(w){const f=Ft(u,m,w.count),E=Ot(u,f.length),v=Math.ceil(f.length/E),x=u;if(x.isInstancedMesh){const A=new xe(x.geometry,x.material);for(let h=0;h<x.count;h++)x.getMatrixAt(h,i),x.morphTexture&&x.getMorphAt(h,A),f.forEach((g,y)=>{A.getVertexPosition(g,a),a.applyMatrix4(i).applyMatrix4(x.matrixWorld),n(a,c+Math.floor(y/E))}),c+=v}else{const A=u;f.forEach((h,g)=>{A.isMesh?A.getVertexPosition(h,a):$t(u,m,h,a),a.applyMatrix4(u.matrixWorld),n(a,c+Math.floor(g/E))}),c+=v}}}for(const w of u.children)l(w)};l(e)}function Ft(e,t,o){const n=e.material;if(!n)return[];const r=t.index?.count??o,s=Math.max(0,t.drawRange.start),a=Math.min(r,Number.isFinite(t.drawRange.count)?s+t.drawRange.count:r),i=[];if(Array.isArray(n))for(const l of t.groups){const u=l.materialIndex??0;if(!n[u]?.visible)continue;const p=Math.max(s,l.start),d=Math.min(a,l.start+l.count);d>p&&i.push([p,d])}else n.visible&&a>s&&i.push([s,a]);const c=[];for(const[l,u]of i){const p=kt(e,u-l);for(let d=l;d<l+p;d++)c.push(t.index?t.index.getX(d):d)}return c}function Ot(e,t){return e.isMesh?3:e.isLineSegments?2:e.isLine?Math.max(t,1):1}function kt(e,t){return e.isMesh?t-t%3:e.isLineSegments?t-t%2:e.isLine?t>=2?t:0:t}function $t(e,t,o,n){const r=t.getAttribute("position");n.fromBufferAttribute(r,o);const s=t.morphAttributes.position,a=e.morphTargetInfluences;if(!s||!a)return n;const i=n.clone(),c=new b,l=new b;for(let u=0;u<s.length;u++){const p=a[u]??0;p!==0&&(l.fromBufferAttribute(s[u],o),t.morphTargetsRelative||l.sub(i),c.addScaledVector(l,p))}return n.add(c)}function Dt(e,t,o){const{center:n,size:r,radius:s}=t;let a=r.x,i=r.y;const c=Z(e),{direction:l,up:u}=c;e==="right"?a=r.z:e==="top"&&(a=r.x,i=r.z);const p=Re(a/2,i/2,o);return re(n,{direction:l,right:c.right,up:u},p,s*3+1,s*10+10)}function Y(e,t,o,n){const r=new Xe(35,t,.01,e.radius*20+20),s=O.degToRad(r.fov/2),a=Math.atan(Math.tan(s)*t),i=Z("perspective"),c=o?.clone().normalize()??i.direction,l=Math.abs(c.y)>.999?new b(0,0,1):new b(0,1,0),u=o?l.clone().cross(c).normalize():i.right,p=o?c.clone().cross(u).normalize():i.up,d=e.size.clone().multiplyScalar(.5);let m=0;for(const w of[-1,1])for(const f of[-1,1])for(const E of[-1,1]){const v=new b(w*d.x,f*d.y,E*d.z),x=v.dot(c);m=Math.max(m,x+Math.abs(v.dot(u))*H/Math.tan(a),x+Math.abs(v.dot(p))*H/Math.tan(s))}return r.position.copy(e.center).addScaledVector(c,Math.max(n??m,.01)),r.lookAt(e.center),r.updateProjectionMatrix(),r.updateMatrixWorld(!0),r}function Z(e){const t=e==="front"?new b(0,0,1):e==="right"?new b(1,0,0):e==="top"?new b(0,1,0):new b(1,.72,1).normalize(),n=(e==="top"?new b(0,0,-1):new b(0,1,0)).clone().cross(t).normalize(),r=t.clone().cross(n).normalize();return{direction:t,right:n,up:r}}function ie(e,t,o){return e==="perspective"?Y(t,o):Dt(e,t,o)}function he(e,t,o){return Y(e,t,o)}function Ue(e,t,o,n){const r=o.map(te),s=Ut(e,r),a=yt(s.map(c=>wt(c,n))),i=new Map;return o.forEach((c,l)=>{i.set(c,re(gt(s[l],r[l]),r[l],a,t.radius*3+1,t.radius*10+10))}),i}function _t(e,t,o={}){const n=T(o.width),r=T(o.height),s=o.background??"neutral",a=$(e);let i=null;try{const c=R(a,"perspective"),l=D(a,c),u=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));i=u,u.setPixelRatio(1),u.outputColorSpace=V,u.toneMapping=j,u.toneMappingExposure=1,u.setClearColor(U,s==="transparent"?0:1),u.setSize(n,r,!1),q(l,u);const p=Math.atan2(t[0],t[2]),d=n/r,m=y=>new b(Math.sin(y),.72,Math.cos(y)).normalize(),w=[p,p+Math.PI,p-Math.PI/2,p+Math.PI/2],f=Ue(a,c,w,d),E=[{label:"front",camera:f.get(w[0])},{label:"back",camera:f.get(w[1])},{label:"left",camera:f.get(w[2])},{label:"right",camera:f.get(w[3])},{label:"quarter-left",camera:he(c,d,m(p-Math.PI/4))},{label:"quarter-right",camera:he(c,d,m(p+Math.PI/4))}],v=[],x=2,A=3,h=document.createElement("canvas");h.width=n*x,h.height=r*A;const g=h.getContext("2d");if(!g)throw new Error("Unable to create the source-review contact sheet.");return E.forEach(({label:y,camera:S},M)=>{u.render(l,S),v.push({label:y,base64:C(u.domElement),mimeType:"image/png"});const I=M%x*n,F=Math.floor(M/x)*r;g.drawImage(u.domElement,I,F,n,r);const ze=y==="quarter-left"?"3/4-L":y==="quarter-right"?"3/4-R":y.toUpperCase();P(g,ze,I,F,n,r)}),{width:n,height:r,shots:v,contactSheet:{width:n*x,height:r*A,base64:C(h),mimeType:"image/png"}}}finally{i&&X(i),i?.dispose(),i?.forceContextLoss(),G(a)}}function zt(e,t,o,n,r){const s=vt(e),a=bt(e,s,t,o,n,r),i=o*3+1;return re(s,t,a,i,i+o*4+1)}function fe(e,t){const o=new Map;e.traverse(a=>{const i=a;i.isBone&&a.name&&o.set(a.name,i)});const n=t.requiredBones??[],r=n.filter(a=>!o.has(a)),s=t.rigRequirementHint?` (${t.rigRequirementHint})`:"";if(n.length>0&&o.size===0)throw new Error(`Asset preview '--shots ${t.name}' requires a rigged GLB${s}, but this model has no skeleton at all. Required joints: ${n.join(", ")}.`);if(r.length>0)throw new Error(`Asset preview '--shots ${t.name}' requires joints this GLB's skeleton does not have${s}. Missing joint(s): ${r.join(", ")}.`);return o}function Wt(e,t,o){const n=o.filter(Ne);for(const r of o)if(Le(r)){const s=t.get(r.bone);if(!s)continue;r.axis==="x"?s.rotateX(r.radians):r.axis==="y"?s.rotateY(r.radians):s.rotateZ(r.radians)}else if(Pe(r)){const s=t.get(r.bone);if(!s)continue;r.axis==="x"?s.translateX(r.meters):r.axis==="y"?s.translateY(r.meters):s.translateZ(r.meters)}n.length!==0&&e.traverse(r=>{const s=r,a=s.morphTargetDictionary,i=s.morphTargetInfluences;if(!(!a||!i))for(const{morph:c,influence:l}of n){const u=a[c];u!==void 0&&(i[u]=l)}})}function Be(e){let t=null;return e.traverse(o=>{t||(t=ft(o.userData.forward))}),t??[0,0,1]}function ne(e,t){const o=new Ee;return o.rotation.y=Ae(t),o.add(e),o.updateMatrixWorld(!0),o}function D(e,t){const o=new it;o.add(e),o.add(new ct(16777215,3489874,1.8*He));const n=new J(16777215,2.2);n.position.copy(t.center).addScaledVector(new b(1,1.5,1),t.radius*3),o.add(n);const r=new J(12572671,.8);r.position.copy(t.center).addScaledVector(new b(-1,.5,-.7),t.radius*2),o.add(r);const s=new J(16773596,.45);return s.position.copy(t.center).addScaledVector(new b(.3,-1,.4),t.radius*2),o.add(s),o}let L=null;function me(){const e=L;L=null,e&&(X(e),e.dispose(),e.forceContextLoss())}function Vt(){if(L?.getContext().isContextLost()&&me(),!L){const e=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));L=e,e.domElement.addEventListener("webglcontextlost",()=>{L===e&&me()})}return L}function Fe(e,t={}){let o=!1;if(e.traverse(i=>{z(i,"gaussianSplat")&&(o=!0)}),o)throw new Error("Gaussian-splat capture requires the async project-asset capture path so Spark can sort each view.");const n=T(t.width),r=T(t.height),s=t.background??"neutral",a=$(e);try{const i=Be(e);t.pose&&Gt(a,t.pose);const c=ne(a,i),l=ce(i),u=R(c,"perspective"),p=D(c,u),d=Vt();if(d.setPixelRatio(1),d.outputColorSpace=V,d.toneMapping=j,d.toneMappingExposure=1,d.setClearColor(U,s==="transparent"?0:1),q(p,d),t.camera)return Ht(d,p,Y(u,n/r,ge(t.camera),t.camera.distance),n,r,t.camera,l);const m=new Map;for(const f of k)m.set(f,ie(f,R(c,f),n/r));const w=Y(u,n/r,ge({azimuthDegrees:30,elevationDegrees:-60}));return ke(d,p,m,n,r,l,w)}finally{G(a)}}function jt(e,t,o){const n=Oe(t,o.yawDegrees);if(!n)return e;const r=document.createElement("canvas");r.width=e.width,r.height=e.height;const s=r.getContext("2d");if(!s)return e;s.drawImage(e,0,0);const a=Se(n.text,e.width,e.height),i=n.edge==="left"?0:e.width-a.width;return P(s,n.text,i,e.height-a.height,e.width,e.height),r}function ce(e){const t=Ae(e);return{forward:[e[0],e[1],e[2]],yawDegrees:Math.round(O.radToDeg(t))}}function Gt(e,t){if(!Number.isFinite(t.timeSeconds)||t.timeSeconds<0)throw new Error(`Asset preview pose time must be a finite number of seconds >= 0, got ${t.timeSeconds}.`);const o=e.animations??[],n=o.find(s=>s.name===t.clip);if(!n){const s=o.map(a=>`'${a.name}'`).join(", ");throw new Error(`Asset preview pose clip '${t.clip}' not found on the subject. `+(s?`Its clips are: ${s}.`:"The subject carries no animation clips at all — clips live on the model root (GLB animations, or a builder module’s `root.animations`)."))}const r=new at(e);r.clipAction(n).play(),r.update(t.timeSeconds),e.updateMatrixWorld(!0)}function ge(e){const t=O.degToRad(e.azimuthDegrees),o=O.degToRad(e.elevationDegrees);return new b(Math.sin(t)*Math.cos(o),Math.sin(o),Math.cos(t)*Math.cos(o)).normalize()}function Ht(e,t,o,n,r,s,a){e.setSize(n,r,!1),e.render(t,o);const i={view:"perspective",base64:C(e.domElement),mimeType:"image/png"},c=document.createElement("canvas");c.width=n,c.height=r;const l=c.getContext("2d");if(!l)throw new Error("Unable to create the asset preview contact sheet.");l.drawImage(e.domElement,0,0,n,r);const u=`AZ ${Math.round(s.azimuthDegrees)} EL ${Math.round(s.elevationDegrees)}`+(s.distance===void 0?"":` D ${Math.round(s.distance)}`);return P(l,u,0,0,n,r),{width:n,height:r,orientation:a,views:[i],contactSheet:{width:n,height:r,base64:C(c),mimeType:"image/png"}}}function Oe(e,t){if(e==="perspective")return null;const o=O.degToRad(t),n=Z(e).right.applyAxisAngle(new b(0,1,0),-o),r=[["X",new b(1,0,0)],["Y",new b(0,1,0)],["Z",new b(0,0,1)]];for(const[s,a]of r){const i=n.dot(a);if(i>.99)return{text:`+${s}>`,edge:"right"};if(i<-.99)return{text:`<+${s}`,edge:"left"}}return{text:`YAW ${t}`,edge:"left"}}function ke(e,t,o,n,r,s,a){const i=[],c=a?[...k,"below"]:[...k],l=a?3:2,u=n*l,p=r*2,d=document.createElement("canvas");d.width=u,d.height=p;const m=d.getContext("2d");if(!m)throw new Error("Unable to create the asset preview contact sheet.");e.getClearAlpha()>0&&(m.fillStyle=`#${new lt(U).getHexString()}`,m.fillRect(0,0,u,p)),e.setSize(n,r,!1),c.forEach((f,E)=>{const v=f==="below"?a:o.get(f);if(!v)return;e.render(t,v),i.push({view:f,base64:C(f==="below"?e.domElement:jt(e.domElement,f,s)),mimeType:"image/png"});const x=E%l,A=Math.floor(E/l),h=x*n,g=A*r;m.drawImage(e.domElement,h,g,n,r);const y=f==="perspective"?"3/4":f.toUpperCase();if(P(m,y,h,g,n,r),f==="below")return;const S=Oe(f,s.yawDegrees);if(S){const M=Se(S.text,n,r),I=S.edge==="left"?h:h+n-M.width;P(m,S.text,I,g+r-M.height,n,r)}});const w={width:u,height:p,base64:C(d),mimeType:"image/png"};return{width:n,height:r,orientation:s,views:i,contactSheet:w}}function xn(e,t,o={}){let n=!1;if(e.traverse(l=>{z(l,"gaussianSplat")&&(n=!0)}),n)throw new Error("Gaussian-splat capture requires the async project-asset capture path so Spark can sort each view.");const r=T(o.width),s=T(o.height),a=o.background??"neutral",i=[];let c=null;try{t.traverse(p=>{p.visible&&Ve(p)&&(p.visible=!1,i.push(p))});const l=new Map;for(const p of k){const d=ie(p,R(e,p),r/s);d.layers.enableAll(),d.layers.disable(ye),l.set(p,d)}const u=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));return c=u,u.setPixelRatio(1),u.outputColorSpace=V,u.toneMapping=j,u.toneMappingExposure=1,u.setClearColor(U,a==="transparent"?0:1),ke(u,t,l,r,s,ce([0,0,1]))}finally{for(const l of i)l.visible=!0;c?.dispose(),c?.forceContextLoss()}}function Yt(e,t,o){const n=e.pose===void 0?"":` under pose '${e.pose}'`,r=e.view==="bone-zoom"?`bone-zoom on ${e.bones.join(", ")} at yaw ${(e.yaw??0).toFixed(3)}`:`turntable at yaw ${e.yaw.toFixed(3)}`,s=e.view==="bone-zoom"?"Zoom anchors are read from the REST skeleton for every shot, so a pose that MOVES the anchor leaves the crop behind where the joint used to be: re-aim the shot (another joint or yaw), widen its spanFraction, or drop it.":"Check the shot yaw and the pose it renders under.";return{label:e.label,reason:"empty-frame",...e.view==="bone-zoom"?{bones:[...e.bones]}:{},...e.pose===void 0?{}:{pose:e.pose},message:`Asset preview '--shots ${t}' shot ${JSON.stringify(e.label)} (${r}${n}) framed NONE of the subject's ${o} rendered faces: the image is background only and proves nothing about the asset. ${s}`}}function qt(e,t,o){const n=[],r=()=>{for(const s of n)G(s);n.length=0};try{const s=$(e);n.push(s);const a=fe(s,t),i=Be(e),c=ne(s,i),l=R(c,"perspective"),u=D(c,l),p={subject:c,scene:u,framing:l},d=new Map;for(const h of t.shots){if(h.pose===void 0||d.has(h.pose))continue;const g=t.poses?.[h.pose]??[],y=$(e);n.push(y);const S=fe(y,t);Wt(y,S,g),y.updateMatrixWorld(!0);const M=ne(y,i),I=R(M,"perspective");d.set(h.pose,{subject:M,scene:D(M,I),framing:I})}const m=h=>h===void 0?p:d.get(h),w=h=>new b().setFromMatrixPosition(a.get(h).matrixWorld),f=new Map;for(const h of new Set(t.shots.filter(g=>g.view==="turntable").map(g=>g.pose??void 0))){const g=m(h),y=[...new Set(t.shots.filter(S=>S.view==="turntable"&&(S.pose??void 0)===h).map(S=>S.yaw))];f.set(h,Ue(g.subject,g.framing,y,o))}const E=t.shots.map(h=>{const g=m(h.pose);if(h.view==="turntable")return{label:h.label,camera:f.get(h.pose??void 0).get(h.yaw),scene:g.scene,stage:g,basis:te(h.yaw)};const y=h.bones.find(M=>!a.has(M));if(y!==void 0)throw new Error(`Asset preview '--shots ${t.name}' shot ${JSON.stringify(h.label)} zooms on a joint this GLB's skeleton does not have: ${y}. List it in the definition's requiredBones or fix the rig.`);const S=te(h.yaw??0);return{label:h.label,camera:zt(h.bones.map(w),S,l.radius,h.spanFraction,o),scene:g.scene,stage:g,basis:S}}),v=[],x=new Map,A=new Map;E.forEach(({stage:h},g)=>{const y=A.get(h);y?y.push(g):A.set(h,[g])});for(const[h,g]of A){const{framed:y,total:S}=Bt(h.subject,g.map(M=>{const I=E[M];return{basis:I.basis,window:xt(I.camera,I.basis)}}));g.forEach((M,I)=>{if(y[I]!==0)return;const F=Yt(t.shots[M],t.name,S);x.set(M,F),v.push(F)})}return{shots:E.map(({label:h,camera:g,scene:y},S)=>{const M=x.get(S);return{label:h,camera:g,scene:y,...M?{warning:M}:{}}}),warnings:v,dispose:r}}catch(s){throw r(),s}}function $e(e,t,o={}){const n=T(o.width),r=T(o.height),s=o.background??"neutral",a=qt(e,t,n/r);let i=null;try{const c=_(new W({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));i=c,c.setPixelRatio(1),c.outputColorSpace=V,c.toneMapping=j,c.toneMappingExposure=1,c.setClearColor(U,s==="transparent"?0:1),c.setSize(n,r,!1);for(const v of a.shots)q(v.scene,c);const l=[],u=2,p=Math.ceil(a.shots.length/u),d=n*u,m=r*p,w=document.createElement("canvas");w.width=d,w.height=m;const f=w.getContext("2d");if(!f)throw new Error("Unable to create the asset preview contact sheet.");a.shots.forEach(({label:v,camera:x,scene:A,warning:h},g)=>{c.render(A,x),l.push({label:v,base64:C(c.domElement),mimeType:"image/png"});const y=g%u,S=Math.floor(g/u),M=y*n,I=S*r;f.drawImage(c.domElement,M,I,n,r),P(f,h?`${v.toUpperCase()} - EMPTY`:v.toUpperCase(),M,I,n,r,h?"warning":"normal")});const E={width:d,height:m,base64:C(w),mimeType:"image/png"};return{width:n,height:r,shots:l,warnings:a.warnings,contactSheet:E}}finally{i&&X(i),i?.dispose(),i?.forceContextLoss(),a.dispose()}}function Xt(e){const t=e.replace(/^\/?public(\/|$)/,"/");if(!t.startsWith("/")||t.startsWith("//")||t.includes("\\")||t.includes("?")||t.includes("#"))throw new Error("Model asset paths must be the served web path (project-root absolute, with public/ stripped): e.g. /models/generated/hero.glb");let o;try{o=decodeURIComponent(t)}catch{throw new Error("Asset Editor model path contains invalid URL encoding.")}if(o.split("/").some(s=>s==="."||s===".."))throw new Error("Asset Editor model paths cannot traverse outside the project root.");const n=globalThis.location?.origin??"http://localhost",r=new URL(t,n);if(r.origin!==n||!r.pathname.toLowerCase().match(/\.(?:glb|gltf|spz)$/))throw new Error("Asset Editor loads bounded, same-origin project .glb, .gltf, or .spz files only.");return r}async function De(e,t,o=N){const n=await fetch(e,{signal:t});if(!n.ok)throw new Error(`Unable to load project model (${n.status} ${n.statusText}).`);const r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>o)throw new Error(`Asset Editor project models must be ${N/1024/1024} MiB or less.`);if(!n.body){const u=await n.arrayBuffer();if(u.byteLength>o)throw new Error(`Asset Editor project models must be ${N/1024/1024} MiB or less.`);return u}const s=n.body.getReader(),a=[];let i=0;try{for(;;){const{done:u,value:p}=await s.read();if(u)break;if(i+=p.byteLength,i>o)throw await s.cancel(),new Error(`Asset Editor project models must be ${N/1024/1024} MiB or less.`);a.push(p)}}finally{s.releaseLock()}const c=new Uint8Array(i);let l=0;for(const u of a)c.set(u,l),l+=u.byteLength;return c.buffer}function we(e,t,o){return new Promise((n,r)=>{let s=!1;const a=c=>s?!1:(s=!0,o.removeEventListener("abort",i),c(),!0),i=()=>a(()=>r(o.reason));if(o.addEventListener("abort",i,{once:!0}),o.aborted){i();return}be.parse(e,new URL(".",t).href,c=>{c.scene.animations=[...c.animations],a(()=>n(c.scene))||B(c.scene)},c=>a(()=>r(c)))})}function Zt(e,t){if(e.includes("\\")||e.includes("?")||e.includes("#"))throw new Error("Asset Editor .gltf dependencies must be plain same-origin project paths.");const o=new URL(e,t);if(o.origin!==t.origin)throw new Error("Asset Editor .gltf dependencies must stay on the project origin.");return o}function Jt(e,t){if(typeof e.mimeType=="string")return e.mimeType;const o=t.pathname.split(".").pop()?.toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="webp"?"image/webp":"application/octet-stream"}async function Kt(e,t,o){let n;try{n=JSON.parse(new TextDecoder().decode(e))}catch{throw new Error("Asset Editor could not parse the project .gltf JSON document.")}const r=[...Array.isArray(n.buffers)?n.buffers:[],...Array.isArray(n.images)?n.images:[]];let s=e.byteLength;for(const a of r){if(typeof a.uri!="string"||a.uri.startsWith("data:"))continue;const i=Zt(a.uri,t),c=await De(i,o,N-s);s+=c.byteLength;const l=new Uint8Array(c);let u="";for(let p=0;p<l.length;p+=32768)u+=String.fromCharCode(...l.subarray(p,p+32768));a.uri=`data:${Jt(a,i)};base64,${btoa(u)}`}return JSON.stringify(n)}function _e(e,t){let o;try{const n=atob(e);o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)}catch{throw new Error(`${t} is not valid base64.`)}if(o.byteLength===0||o.byteLength>N)throw new Error(`${t} must be non-empty and at most ${N/1024/1024} MiB.`);return new Promise((n,r)=>{be.parse(o.buffer,"",s=>{s.scene.animations=[...s.animations],n(s.scene)},s=>r(s instanceof Error?s:new Error(String(s))))})}async function En(e,t={}){const o=await _e(e,"Asset preview GLB bytes");try{return Fe(o,t)}finally{B(o)}}async function Sn(e,t,o={}){const n=await _e(e,"Asset preview GLB bytes");try{return $e(n,t,o)}finally{B(n)}}async function Qt(e,t){const o=Xt(e),n=new AbortController,r=()=>n.abort(t?.reason);t?.aborted?r():t?.addEventListener("abort",r,{once:!0});const s=globalThis.setTimeout(()=>n.abort(new Error("Asset Editor project model load timed out after 25 seconds.")),It);try{const a=await De(o,n.signal);if(n.signal.throwIfAborted(),o.pathname.toLowerCase().endsWith(".spz"))return{root:await Ge(e,new Uint8Array(a)),sourceBytes:null};if(o.pathname.toLowerCase().endsWith(".glb")){const c=new Uint8Array(a.slice(0));return{root:await we(a,o,n.signal),sourceBytes:c}}const i=await Kt(a,o,n.signal);return{root:await we(i,o,n.signal),sourceBytes:null}}finally{globalThis.clearTimeout(s),t?.removeEventListener("abort",r)}}async function le(e,t){return(await Qt(e,t)).root}function B(e){z(e,"gaussianSplat")&&e.dispose(),G(e),e.traverse(t=>{const o=t;o.isInstancedMesh&&o.morphTexture?.dispose();const n=t;if(n.geometry?.dispose(),!n.material)return;const r=Array.isArray(n.material)?n.material:[n.material];for(const s of r){for(const a of Object.values(s))a instanceof qe&&a.dispose();s.dispose()}})}async function Mn(e,t={}){const o=await le(e);try{return z(o,"gaussianSplat")?await en(o,t):Fe(o,t)}finally{B(o)}}async function An(e,t,o={}){const n=await le(e);try{return _t(n,t,o)}finally{B(n)}}async function en(e,t){const o=T(t.width),n=T(t.height),r=t.background??"neutral",s=R(e,"perspective"),a=D(e,s),i=_(new W({antialias:!1,alpha:!0,preserveDrawingBuffer:!0}));let c=null;try{const l=await We(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3]));c=new l.SparkRenderer({renderer:i,autoUpdate:!1,enableLod:!1}),a.add(c),i.setPixelRatio(1),i.outputColorSpace=V,i.toneMapping=j,i.toneMappingExposure=1,i.setClearColor(U,r==="transparent"?0:1),i.setSize(o,n,!1),q(a,i);const u=[],p=document.createElement("canvas");p.width=o*2,p.height=n*2;const d=p.getContext("2d");if(!d)throw new Error("Unable to create the asset preview contact sheet.");for(const[m,w]of k.entries()){const f=ie(w,R(e,w),o/n);await c.update({scene:a,camera:f}),i.render(a,f),u.push({view:w,base64:C(i.domElement),mimeType:"image/png"});const E=m%2*o,v=Math.floor(m/2)*n;d.drawImage(i.domElement,E,v,o,n),P(d,w==="perspective"?"3/4":w.toUpperCase(),E,v,o,n)}return{width:o,height:n,orientation:ce([0,0,1]),views:u,contactSheet:{width:o*2,height:n*2,base64:C(p),mimeType:"image/png"}}}finally{c?.removeFromParent(),e.removeFromParent(),c?.dispose(),X(i),i.dispose(),i.forceContextLoss()}}async function In(e,t,o={}){const n=await le(e);try{return $e(n,t,o)}finally{B(n)}}export{pn as A,An as B,dn as C,_t as D,xn as E,En as F,Fe as a,$ as b,Mn as c,B as d,bn as e,G as f,vn as g,le as h,he as i,T as j,C as k,Qt as l,R as m,mn as n,gn as o,_e as p,Ae as q,Be as r,fn as s,wn as t,hn as u,yn as v,ft as w,Sn as x,In as y,$e as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-BfqJPhFO.js";import{i as r}from"./pose-guard-CLabLSzf.js";import{i}from"./game-audio-BeCyd0Ha.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.core-3arARmh6.js";let o=!1;function p(){r(t=>{o||(o=!0,e().console.log(`[audio-pose-guard] dropped a Web Audio pose update for a ${t} whose world matrix is not finite — the scene graph is unchanged and the node keeps its last good pose. Reported once; see audioPoseUpdatesDropped() for the running count.`,"authoring"))})}const w="workspace.service";function G(){i(),p()}export{w as point,G as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as v,et as h,al as n,er as i,a6 as y}from"./index-
|
|
1
|
+
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as v,et as h,al as n,er as i,a6 as y}from"./index-BfqJPhFO.js";import{r as u}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{m as S}from"./audio-meter-Cddyq1vI.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";function R(e){return e?{graph:typeof e.graphSnapshot=="function",transport:typeof e.transportState=="function",meters:typeof e.acquireMeters=="function",events:typeof e.audioEvents=="function"}:null}class b{constructor(s=500){this.capacity=s}entries=[];lastSeq=0;paused=!1;pull(s){if(this.paused||!s?.audioEvents)return 0;const a=s.audioEvents(this.lastSeq);if(a.length===0)return 0;for(const r of a)this.entries.push(r),r.seq>this.lastSeq&&(this.lastSeq=r.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),a.length}get all(){return this.entries}clear(){this.entries=[]}}function A(e){const s=Math.max(0,e),a=Math.floor(s/60),r=s-a*60;return`${a}:${r<10?"0":""}${r.toFixed(1)}`}const f={fontFamily:n.typography.mono,fontSize:h.base};function p({children:e,testId:s}){return t.jsx("div",{"data-testid":s,style:{padding:i[4],color:n.content.muted,fontSize:h.base,fontStyle:"italic"},children:e})}function I({adapter:e,onResumed:s}){return e.resume?t.jsx(y,{type:"button",variant:"secondary","data-testid":"audio-resume",onClick:()=>{e.resume?.(),s()},children:"Enable Audio"}):null}const $={started:n.semantic.success,paused:n.semantic.warning,stopped:n.content.muted};function M({adapter:e}){const s=e.transportState?.()??null;return s?t.jsxs("div",{"data-testid":"audio-transport","data-state":s.state,style:{display:"flex",gap:i[6],alignItems:"center",padding:`${i[2]} ${i[4]}`},children:[t.jsxs("span",{style:{color:$[s.state]??n.content.primary},children:["● ",s.state]}),t.jsx("span",{"data-testid":"audio-transport-seconds",style:{...f,color:n.content.primary},children:A(s.seconds)}),s.position!==void 0&&t.jsx("span",{style:{...f,color:n.content.muted},children:s.position}),t.jsxs("span",{style:{fontSize:h.sm,color:n.content.muted},children:["bpm"," ",t.jsx("span",{style:{...f,color:n.content.primary},children:s.bpm.toFixed(0)})]})]}):t.jsx(p,{testId:"audio-transport-none",children:"No musical transport in this world (the game has not bridged Tone onto its audio context)."})}function E({adapter:e}){const[s,a]=u.useState(void 0),r=u.useRef(new Map);return u.useEffect(()=>{const d=e.acquireMeters?.()??null;if(!d){a(null);return}a(d.read());const o=setInterval(()=>{for(const c of d.read()){const m=r.current.get(c.id);m&&(m.style.width=`${S(c.level)}%`,m.dataset.level=c.level.toFixed(4))}},100);return()=>{clearInterval(o),d.dispose()}},[e]),s===void 0?null:s===null?t.jsx(p,{testId:"audio-meters-unavailable",children:"Metering unavailable in this environment (no real audio context)."}):t.jsx("div",{"data-testid":"audio-meters",style:{display:"flex",gap:14,alignItems:"center",padding:`${i[2]} ${i[4]}`},children:s.map(d=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:i[2]},children:[t.jsx("span",{style:{fontSize:h.sm,color:n.content.muted},children:d.label}),t.jsx("div",{style:{width:96,height:8,background:n.surface.inset,borderRadius:n.shape.small,overflow:"hidden"},children:t.jsx("div",{"data-testid":"audio-meter-fill","data-meter-id":d.id,"data-level":"0.0000",ref:o=>{o?r.current.set(d.id,o):r.current.delete(d.id)},style:{width:"0%",height:"100%",background:n.semantic.success,transition:"width 80ms linear"}})})]},d.id))})}function k({node:e}){return t.jsxs("div",{"data-testid":"audio-node-row","data-node-id":e.id,style:{...f,lineHeight:"18px",padding:`0 ${i[4]}`,whiteSpace:"nowrap"},children:[t.jsx("span",{style:{color:n.content.primary},children:e.label??e.id}),t.jsxs("span",{style:{color:n.content.dim},children:[" ",e.type]}),e.state!==void 0&&t.jsxs("span",{style:{color:n.semantic.warning},children:[" [",e.state,"]"]}),e.outputs.length>0&&t.jsxs("span",{style:{color:n.content.muted},children:[" → ",e.outputs.join(", ")]})]})}function q(e){return e==="error"?n.semantic.danger:e==="mute"||e==="unmute"?n.semantic.warning:n.accent.default}function z({event:e}){return t.jsxs("div",{"data-testid":"audio-log-row","data-kind":e.kind,style:{...f,display:"grid",gridTemplateColumns:"64px 1fr",gap:i[2],lineHeight:"17px",padding:`0 ${i[4]}`},children:[t.jsxs("span",{style:{color:n.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsxs("span",{style:{color:q(e.kind)},children:[e.kind,e.detail!==void 0?t.jsxs("span",{style:{color:n.content.muted},children:[" ",e.detail]}):null]})]})}function C(){const[,e]=u.useReducer(l=>l+1,0),s=u.useRef(new b),a=u.useRef(null),[r,d]=u.useState(!1);u.useEffect(()=>{const l=()=>{const g=v().systems.inspectedAudio()??null;return g!==a.current&&(a.current=g,s.current=new b,s.current.paused=r),g},j=()=>{s.current.pull(l()),e()};j();const w=setInterval(j,250);return()=>clearInterval(w)},[r]);const o=a.current??v().systems.inspectedAudio()??null,c=R(o);if(!o||!c)return t.jsxs("div",{"data-testid":"audio-debugger-empty",style:{padding:i[8],color:n.content.muted,fontSize:h.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:n.content.primary,marginBottom:i[2]},children:"Audio is still initializing."}),"The editor registers a first-party ",t.jsx("code",{style:f,children:"AudioAdapter"})," in edit mode; Play temporarily replaces it with the running game's adapter."]});const m=c.graph?o.graphSnapshot?.()??[]:null,x=s.current.all;return t.jsxs("div",{"data-testid":"audio-debugger",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:h.md},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:i[4],alignItems:"center",borderBottom:`1px solid ${n.boundary.default}`},children:[t.jsx(I,{adapter:o,onResumed:e}),t.jsx("span",{"data-testid":"audio-mute-state",style:{padding:`${i[2]} ${i[4]}`,color:o.isMuted()?n.semantic.warning:n.semantic.success},children:o.isMuted()?"muted":"audible"}),c.transport?t.jsx(M,{adapter:o}):t.jsx(p,{testId:"audio-transport-absent",children:"Transport not provided by this adapter."}),c.meters?t.jsx(E,{adapter:o}):t.jsx(p,{testId:"audio-meters-absent",children:"Meters not provided by this adapter."})]}),t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"audio-graph",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${n.boundary.default}`,padding:`${i[2]} 0`},children:m?m.map(l=>t.jsx(k,{node:l},l.id)):t.jsx(p,{testId:"audio-graph-absent",children:"Audio graph not provided by this adapter."})}),t.jsx("div",{"data-testid":"audio-event-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:c.events?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:i[3],alignItems:"center",padding:i[2]},children:[t.jsx(y,{type:"button",variant:"ghost","data-testid":"audio-log-pause",onClick:()=>{const l=!r;s.current.paused=l,d(l)},children:r?"Resume":"Pause"}),t.jsx(y,{type:"button",variant:"ghost","data-testid":"audio-log-clear",onClick:()=>{s.current.clear(),e()},children:"Clear"}),t.jsxs("span",{style:{fontSize:h.sm,color:n.content.muted},children:[x.length," events"]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:x.length===0?t.jsx(p,{children:"No audio events yet."}):x.map(l=>t.jsx(z,{event:l},l.seq))})]}):t.jsx(p,{testId:"audio-log-absent",children:"Event log not provided by this adapter."})})]})]})}const L="workspace.utility",U="Audio",_=26;function G(){return t.jsx(C,{})}export{G as default,_ as order,L as point,U as title};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as i,r as m}from"./index-BfqJPhFO.js";import{e as p}from"./game-network-TjOj3K-Z.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-L_Ofssyj.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BzagDrhV.js";import"./contract-system-adapters-DIpeIRm_.js";import"./game-contract-seams-CuBiefwV.js";import"./seeded-random-C9256-Ag.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-CDRzC_D1.js";import"./capability-coverage-aT7nf05J.js";import"./edit-mode-authoring-DthrLbz-.js";import"./json-history-resource-De8KJl61.js";import"./binding-resolver-CXF3o1ZX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CxfLBQQ9.js";import"./canvas-entry-runtime-nWfnVKYb.js";import"./three-ingest-runtime-QhrURliQ.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-DJ8FmH5M.js";import"./ingest-source-persistence-CrXFBT__.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DmDBAZ8E.js";import"./mounted-authoring-B2dc__pv.js";import"./entity-object-BOLh6DVA.js";import"./user-data-CTT8ZvVB.js";import"./workspace-arrangement-BXM0R-Uu.js";import"./three-contract-Dkt6PmWY.js";import"./three-BvhtsSAr.js";import"./editor-layers-k0AjpomL.js";import"./component-instance-root-QYCCyhxU.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-K8a5THvW.js";import"./source-persistence-backend-CbCbDOjd.js";import"./three-projection-core-C2Zj6hTy.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-EfYECbQc.js";import"./deferred-ingest-play-DMp_yRhc.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-Cf1jv2dl.js";import"./board-guides-BYnclES1.js";import"./relative-import-specifier-J1WeZQaJ.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-UxYR9Ls5.js";import"./inference-diagnostics-NvA3SRR7.js";import"./writer-tw6EcuVO.js";import"./three-state-cYB28OIz.js";import"./editor-shell-store-B3c29A3l.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BBtilr3V.js";import"./game-surface-defaults-D8S4cRxi.js";const Ut="workspace.service";function e(o){p().catch(t=>{m().console.error(`${o}: ${t instanceof Error?t.message:String(t)}`,"play")})}function bt(){let o,t=!1;const r=i(()=>{t||new URLSearchParams(window.location.search).get("play")==="1"&&(t=!0,o=window.setTimeout(()=>e("Could not enter requested Play mode"),0))});return()=>{o!==void 0&&window.clearTimeout(o),r()}}export{Ut as point,bt as start};
|
package/dist/assets/{babylon-authoring-adapter-Bt8B089v.js → babylon-authoring-adapter-BB5HErRG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as g,bS as v,bT as x}from"./index-D9shXtZ9.js";import{J as k,c as j}from"./json-history-resource-B8_YpeAT.js";import{p as y}from"./source-persistence-backend-DsG30XMj.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"./ingest-source-persistence-DH7q9G1S.js";function C(r){return encodeURIComponent(r||"unnamed")}function u(r){try{return r.getClassName?.()||"Node"}catch{return"Node"}}function z(r){try{const e=r.getChildren?.();return Array.isArray(e)?e:[]}catch{return[]}}function m(r){const e=r?.x??0,t=r?.y??0,n=r?.z??0,s=Math.cos(e/2),i=Math.sin(e/2),a=Math.cos(t/2),o=Math.sin(t/2),c=Math.cos(n/2),l=Math.sin(n/2);return{x:i*a*c+s*o*l,y:s*o*c-i*a*l,z:s*a*l+i*o*c,w:s*a*c-i*o*l}}function p([r,e,t,n]){const s=2*(n*r+e*t),i=1-2*(r*r+e*e),a=2*(n*e-t*r),o=2*(n*t+r*e),c=1-2*(e*e+t*t);return{x:Math.atan2(s,i),y:Math.abs(a)>=1?Math.sign(a)*(Math.PI/2):Math.asin(a),z:Math.atan2(o,c)}}function d(r,e){r&&(r.x=e[0]??r.x,r.y=e[1]??r.y,r.z=e[2]??r.z)}function B(r,e){if(!r.rotationQuaternion){d(r.rotation,e);return}const t=m({x:e[0]??0,y:e[1]??0,z:e[2]??0});d(r.rotationQuaternion,[t.x,t.y,t.z]),r.rotationQuaternion.w=t.w}class R{constructor(e,t,n={}){this.engine=e,this.store=t,this.options=n,this.persistenceBackend=n.persistence??null,this.provenance=n.provenance??{source:"foreign",label:"live-only",detail:"Babylon.js scenes and Nodes projected directly — edits apply to native game objects for this session only."};const s=j(),i=this.persistenceBackend;this.persistence=i?{isDirty:()=>!1,save:async()=>{},get destination(){return i.destination()}}:s,i&&i.attach({read:(o,c)=>this.readChannel(o,c),apply:(o,c,l)=>this.applyChannel(o,c,l)});const a=t.shell.projectHistory;if(this.historyResource=i&&a&&n.journal?new k({history:a,kind:"session-state",scope:"session",subject:{...n.journal,id:`${n.journal.id}/live-babylon-edits`},displayName:"Live edits",capture:()=>this.captureHistoryState(),conflictIdentity:o=>o.edits,restore:async o=>{this.restoreHistoryState(o)}}):null,n.canvas&&(this.pickable={pick:(o,c)=>{const l=n.canvas.getBoundingClientRect();for(const h of this.scenes()){const f=h.pick?.(o-l.left,c-l.top),b=f?.hit?f.pickedMesh:null;if(b)return this.reindex(),this.idsByObject.get(b)??null}return null}}),this.truth={resolve:(o,c)=>{const l=this.subjectFor(o,c);return{site:l.anchor,writeAnchorKind:l.anchorKind}}},this.installNativeTools(),n.canvas){const o=()=>{for(const l of this.selection.get())this.transforms.beginEdit(l)},c=()=>{for(const l of this.selection.get())this.transforms.endEdit(l)};n.canvas.addEventListener("pointerdown",o),n.canvas.addEventListener("pointerup",c),this.removeCanvasListeners=()=>{n.canvas.removeEventListener("pointerdown",o),n.canvas.removeEventListener("pointerup",c)}}else this.removeCanvasListeners=null}capabilities={transform:!0,inspectorFields:!0,persist:!1};provenance;persistence;pickable;truth;indexed=new Map;idsByObject=new Map;listeners=new Set;persistenceBackend;baselines=new Map;historyBefore=new Map;historyResource=null;edits=0;gizmos=[];pointerTokens=[];removeCanvasListeners;scenes(){return(this.engine.scenes??[]).filter(e=>{try{return!e.isDisposed?.()}catch{return!0}})}refresh(){this.reindex();let e=0,t=0;for(const n of this.indexed.values())n.kind==="scene"?e++:t++;return{scenes:e,objects:t}}reindex(){this.indexed.clear(),this.idsByObject.clear();const e=new Set;for(const[t,n]of this.scenes().entries()){const s=n.name||`Scene ${t+1}`,i=`babylon:scene:${t}:${C(n.uid||s)}`,a=Array.isArray(n.rootNodes)?n.rootNodes:[],o={id:i,label:s,role:"root",kind:"babylon-scene",typeLabel:"BABYLON.Scene",parentId:null,childIds:[]};this.indexed.set(i,{kind:"scene",scene:n,node:o}),o.childIds=a.map((c,l)=>this.indexNode(c,i,`${t}/${l}`,e))}}indexNode(e,t,n,s){const i=u(e),o=`babylon:node:${typeof e.uniqueId=="number"?String(e.uniqueId):`path:${n}`}`,c={id:o,label:e.name||i,role:"entity",kind:`babylon-${i.toLowerCase()}`,typeLabel:i,parentId:t,childIds:[]};return this.indexed.set(o,{kind:"node",object:e,node:c}),this.idsByObject.set(e,o),s.has(e)||(s.add(e),c.childIds=z(e).map((l,h)=>this.indexNode(l,o,`${n}/${h}`,s))),o}hierarchy={roots:()=>(this.reindex(),[...this.indexed.values()].filter(e=>e.kind==="scene").map(e=>e.node)),node:e=>(this.reindex(),this.indexed.get(e)?.node??null)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:e=>{this.store.shell.selectMultiple(e),this.attachGizmos(e[0]??null),this.notify()}};transforms={dimensions:e=>(this.reindex(),this.indexed.get(e)?.kind==="node"?"3d":null),get:e=>{this.reindex();const t=this.indexed.get(e);if(!t||t.kind!=="node")return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const n=t.object,s=n.rotationQuaternion??m(n.rotation);return{position:[n.position?.x??0,n.position?.y??0,n.position?.z??0],rotation:[s.x,s.y,s.z,s.w],scale:[n.scaling?.x??1,n.scaling?.y??1,n.scaling?.z??1]}},beginEdit:e=>{const t=this.captureChannels(e);t&&this.baselines.set(e,t),this.historyResource&&this.historyBefore.set(e,this.captureHistoryState())},apply:(e,t)=>{this.reindex();const n=this.indexed.get(e);if(!n||n.kind!=="node")return;const s=n.object;if(d(s.position,t.position),d(s.scaling,t.scale),s.rotationQuaternion)d(s.rotationQuaternion,t.rotation),s.rotationQuaternion.w=t.rotation[3];else{const i=p(t.rotation);d(s.rotation,[i.x,i.y,i.z])}this.notify()},endEdit:async e=>{const t=this.baselines.get(e);this.baselines.delete(e);const n=this.historyBefore.get(e);if(this.historyBefore.delete(e),!t||!this.persistenceBackend)return;const s=this.captureChannels(e);if(!s)return;const i=["position","rotation","scale"].filter(o=>JSON.stringify(t[o])!==JSON.stringify(s[o]));if(i.length===0)return;if(i.length>1){const o=`this Babylon gesture changed ${i.length} properties at once (${i.join(", ")})`;return this.persistenceBackend.report(`Transform ${this.labelOf(e)}`,o),{destination:"live-only (not saved)",persisted:!1}}const a=i[0];return y({backend:this.persistenceBackend,subject:()=>this.subjectFor(e,a),baseline:t[a],next:s[a],label:`Transform ${this.labelOf(e)}`,journal:()=>this.recordHistory(`Transform ${this.labelOf(e)}`,n)})}};inspector={properties:e=>{this.reindex();const t=this.indexed.get(e);if(!t)return[];if(t.kind==="scene")return[{path:"name",label:"Scene",type:"string",readonly:!0},{path:"uid",label:"UID",type:"string",readonly:!0}];const n=[{path:"className",label:"Type",type:"string",readonly:!0},{path:"name",label:"Name",type:"string"},{path:"id",label:"ID",type:"string",readonly:!0},{path:"enabled",label:"Enabled",type:"boolean"}];return typeof t.object.isVisible=="boolean"&&n.push({path:"isVisible",label:"Visible",type:"boolean"}),typeof t.object.visibility=="number"&&n.push({path:"visibility",label:"Visibility",type:"number"}),n},get:(e,t)=>{this.reindex();const n=this.indexed.get(e);if(n)return n.kind==="scene"?t==="name"?n.scene.name:t==="uid"?n.scene.uid:void 0:t==="className"?u(n.object):t==="enabled"?n.object.isEnabled?.(!1):n.object[t]},set:async(e,t,n)=>{this.reindex();const s=this.indexed.get(e);if(!s||s.kind!=="node")return;const i=this.readChannel(e,t),a=this.historyResource?this.captureHistoryState():void 0;if(t==="enabled")s.object.setEnabled?.(!!n);else if(t==="name"||t==="isVisible"||t==="visibility")s.object[t]=n;else return;this.notify();const o=this.readChannel(e,t);if(!(!this.persistenceBackend||i===void 0||o===void 0||JSON.stringify(i)===JSON.stringify(o)))return y({backend:this.persistenceBackend,subject:()=>this.subjectFor(e,t==="isVisible"?"visible":t),baseline:i,next:o,label:`Set ${this.labelOf(e)} ${t}`,journal:()=>this.recordHistory(`Set ${this.labelOf(e)} ${t}`,a)})}};subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.removeCanvasListeners?.();for(const{scene:e,token:t}of this.pointerTokens)e.onPointerObservable?.remove(t);for(const e of this.gizmos)e.dispose();this.persistenceBackend?.dispose(),this.listeners.clear(),this.indexed.clear(),this.idsByObject.clear()}labelOf(e){return this.hierarchy.node(e)?.label??"Babylon node"}objectOf(e){this.reindex();const t=this.indexed.get(e);return t?.kind==="node"?t.object:null}readChannel(e,t){const n=this.objectOf(e);if(n){if(t==="position")return[n.position?.x??0,n.position?.y??0,n.position?.z??0];if(t==="rotation"){const s=n.rotationQuaternion,i=s?p([s.x,s.y,s.z,s.w]):n.rotation??{x:0,y:0,z:0};return[i.x,i.y,i.z]}return t==="scale"?[n.scaling?.x??1,n.scaling?.y??1,n.scaling?.z??1]:t==="visible"?n.isVisible:this.inspector.get(e,t)}}applyChannel(e,t,n){const s=this.objectOf(e);s&&(t==="position"&&Array.isArray(n)?d(s.position,n):t==="rotation"&&Array.isArray(n)?B(s,n):t==="scale"&&Array.isArray(n)?d(s.scaling,n):t==="visible"?s.isVisible=!!n:(t==="name"||t==="visibility")&&(s[t]=n),this.notify())}recordHistory(e,t){!this.historyResource||!t||(this.edits+=1,this.historyResource.record(e,t,this.captureHistoryState()).catch(n=>{g.error(`[babylon] failed to journal "${e}" into project history — the edit is applied but has no history entry (it cannot be undone): ${n instanceof Error?n.message:String(n)}`)}))}captureHistoryState(){this.reindex();const e={};for(const[t,n]of this.indexed){if(n.kind!=="node")continue;const s={};for(const i of["position","rotation","scale","visible","name","visibility"]){const a=this.readChannel(t,i);a!=null&&(s[i]=a)}e[t]=s}return{edits:this.edits,nodes:e}}restoreHistoryState(e){this.edits=e.edits;for(const[t,n]of Object.entries(e.nodes))for(const[s,i]of Object.entries(n))this.applyChannel(t,s,i);this.notify()}captureChannels(e){const t=this.readChannel(e,"position"),n=this.readChannel(e,"rotation"),s=this.readChannel(e,"scale");return t&&n&&s?{position:t,rotation:n,scale:s}:null}subjectFor(e,t){const n=this.objectOf(e),s=v(n);return{entityId:e,property:t,surface:"babylon",anchor:s,anchorKind:s.anchored?"construction-literal":"live-only",instances:s.anchored&&s.kind==="source"?x(s):0}}installNativeTools(){const e=this.options.api?.GizmoManager;for(const t of this.scenes()){if(e){const s=new e(t);s.positionGizmoEnabled=!0,s.rotationGizmoEnabled=!0,s.scaleGizmoEnabled=!0,s.usePointerToAttachGizmos=!1,this.gizmos.push(s)}const n=t.onPointerObservable;if(n){const s=n.add(i=>{const a=i.pickInfo?.pickedMesh;if(!a)return;this.reindex();const o=this.idsByObject.get(a);o&&this.selection.set([o])});this.pointerTokens.push({scene:t,token:s})}}}attachGizmos(e){const t=e?this.objectOf(e):null;for(const n of this.gizmos){if(!t){n.attachToMesh(null);continue}try{u(t).includes("Mesh")?n.attachToMesh(t):n.attachToNode?n.attachToNode(t):n.attachToMesh(null)}catch{n.attachToMesh(null)}}}notify(){for(const e of this.listeners)e();this.store.shell.notifyIngestEdit()}}export{R as BabylonAuthoringAdapter};
|
|
1
|
+
import{Z as g,bS as v,bT as x}from"./index-BfqJPhFO.js";import{J as k,c as j}from"./json-history-resource-De8KJl61.js";import{p as y}from"./source-persistence-backend-CbCbDOjd.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"./ingest-source-persistence-CrXFBT__.js";function C(r){return encodeURIComponent(r||"unnamed")}function u(r){try{return r.getClassName?.()||"Node"}catch{return"Node"}}function z(r){try{const e=r.getChildren?.();return Array.isArray(e)?e:[]}catch{return[]}}function m(r){const e=r?.x??0,t=r?.y??0,n=r?.z??0,s=Math.cos(e/2),i=Math.sin(e/2),a=Math.cos(t/2),o=Math.sin(t/2),c=Math.cos(n/2),l=Math.sin(n/2);return{x:i*a*c+s*o*l,y:s*o*c-i*a*l,z:s*a*l+i*o*c,w:s*a*c-i*o*l}}function p([r,e,t,n]){const s=2*(n*r+e*t),i=1-2*(r*r+e*e),a=2*(n*e-t*r),o=2*(n*t+r*e),c=1-2*(e*e+t*t);return{x:Math.atan2(s,i),y:Math.abs(a)>=1?Math.sign(a)*(Math.PI/2):Math.asin(a),z:Math.atan2(o,c)}}function d(r,e){r&&(r.x=e[0]??r.x,r.y=e[1]??r.y,r.z=e[2]??r.z)}function B(r,e){if(!r.rotationQuaternion){d(r.rotation,e);return}const t=m({x:e[0]??0,y:e[1]??0,z:e[2]??0});d(r.rotationQuaternion,[t.x,t.y,t.z]),r.rotationQuaternion.w=t.w}class R{constructor(e,t,n={}){this.engine=e,this.store=t,this.options=n,this.persistenceBackend=n.persistence??null,this.provenance=n.provenance??{source:"foreign",label:"live-only",detail:"Babylon.js scenes and Nodes projected directly — edits apply to native game objects for this session only."};const s=j(),i=this.persistenceBackend;this.persistence=i?{isDirty:()=>!1,save:async()=>{},get destination(){return i.destination()}}:s,i&&i.attach({read:(o,c)=>this.readChannel(o,c),apply:(o,c,l)=>this.applyChannel(o,c,l)});const a=t.shell.projectHistory;if(this.historyResource=i&&a&&n.journal?new k({history:a,kind:"session-state",scope:"session",subject:{...n.journal,id:`${n.journal.id}/live-babylon-edits`},displayName:"Live edits",capture:()=>this.captureHistoryState(),conflictIdentity:o=>o.edits,restore:async o=>{this.restoreHistoryState(o)}}):null,n.canvas&&(this.pickable={pick:(o,c)=>{const l=n.canvas.getBoundingClientRect();for(const h of this.scenes()){const f=h.pick?.(o-l.left,c-l.top),b=f?.hit?f.pickedMesh:null;if(b)return this.reindex(),this.idsByObject.get(b)??null}return null}}),this.truth={resolve:(o,c)=>{const l=this.subjectFor(o,c);return{site:l.anchor,writeAnchorKind:l.anchorKind}}},this.installNativeTools(),n.canvas){const o=()=>{for(const l of this.selection.get())this.transforms.beginEdit(l)},c=()=>{for(const l of this.selection.get())this.transforms.endEdit(l)};n.canvas.addEventListener("pointerdown",o),n.canvas.addEventListener("pointerup",c),this.removeCanvasListeners=()=>{n.canvas.removeEventListener("pointerdown",o),n.canvas.removeEventListener("pointerup",c)}}else this.removeCanvasListeners=null}capabilities={transform:!0,inspectorFields:!0,persist:!1};provenance;persistence;pickable;truth;indexed=new Map;idsByObject=new Map;listeners=new Set;persistenceBackend;baselines=new Map;historyBefore=new Map;historyResource=null;edits=0;gizmos=[];pointerTokens=[];removeCanvasListeners;scenes(){return(this.engine.scenes??[]).filter(e=>{try{return!e.isDisposed?.()}catch{return!0}})}refresh(){this.reindex();let e=0,t=0;for(const n of this.indexed.values())n.kind==="scene"?e++:t++;return{scenes:e,objects:t}}reindex(){this.indexed.clear(),this.idsByObject.clear();const e=new Set;for(const[t,n]of this.scenes().entries()){const s=n.name||`Scene ${t+1}`,i=`babylon:scene:${t}:${C(n.uid||s)}`,a=Array.isArray(n.rootNodes)?n.rootNodes:[],o={id:i,label:s,role:"root",kind:"babylon-scene",typeLabel:"BABYLON.Scene",parentId:null,childIds:[]};this.indexed.set(i,{kind:"scene",scene:n,node:o}),o.childIds=a.map((c,l)=>this.indexNode(c,i,`${t}/${l}`,e))}}indexNode(e,t,n,s){const i=u(e),o=`babylon:node:${typeof e.uniqueId=="number"?String(e.uniqueId):`path:${n}`}`,c={id:o,label:e.name||i,role:"entity",kind:`babylon-${i.toLowerCase()}`,typeLabel:i,parentId:t,childIds:[]};return this.indexed.set(o,{kind:"node",object:e,node:c}),this.idsByObject.set(e,o),s.has(e)||(s.add(e),c.childIds=z(e).map((l,h)=>this.indexNode(l,o,`${n}/${h}`,s))),o}hierarchy={roots:()=>(this.reindex(),[...this.indexed.values()].filter(e=>e.kind==="scene").map(e=>e.node)),node:e=>(this.reindex(),this.indexed.get(e)?.node??null)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:e=>{this.store.shell.selectMultiple(e),this.attachGizmos(e[0]??null),this.notify()}};transforms={dimensions:e=>(this.reindex(),this.indexed.get(e)?.kind==="node"?"3d":null),get:e=>{this.reindex();const t=this.indexed.get(e);if(!t||t.kind!=="node")return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const n=t.object,s=n.rotationQuaternion??m(n.rotation);return{position:[n.position?.x??0,n.position?.y??0,n.position?.z??0],rotation:[s.x,s.y,s.z,s.w],scale:[n.scaling?.x??1,n.scaling?.y??1,n.scaling?.z??1]}},beginEdit:e=>{const t=this.captureChannels(e);t&&this.baselines.set(e,t),this.historyResource&&this.historyBefore.set(e,this.captureHistoryState())},apply:(e,t)=>{this.reindex();const n=this.indexed.get(e);if(!n||n.kind!=="node")return;const s=n.object;if(d(s.position,t.position),d(s.scaling,t.scale),s.rotationQuaternion)d(s.rotationQuaternion,t.rotation),s.rotationQuaternion.w=t.rotation[3];else{const i=p(t.rotation);d(s.rotation,[i.x,i.y,i.z])}this.notify()},endEdit:async e=>{const t=this.baselines.get(e);this.baselines.delete(e);const n=this.historyBefore.get(e);if(this.historyBefore.delete(e),!t||!this.persistenceBackend)return;const s=this.captureChannels(e);if(!s)return;const i=["position","rotation","scale"].filter(o=>JSON.stringify(t[o])!==JSON.stringify(s[o]));if(i.length===0)return;if(i.length>1){const o=`this Babylon gesture changed ${i.length} properties at once (${i.join(", ")})`;return this.persistenceBackend.report(`Transform ${this.labelOf(e)}`,o),{destination:"live-only (not saved)",persisted:!1}}const a=i[0];return y({backend:this.persistenceBackend,subject:()=>this.subjectFor(e,a),baseline:t[a],next:s[a],label:`Transform ${this.labelOf(e)}`,journal:()=>this.recordHistory(`Transform ${this.labelOf(e)}`,n)})}};inspector={properties:e=>{this.reindex();const t=this.indexed.get(e);if(!t)return[];if(t.kind==="scene")return[{path:"name",label:"Scene",type:"string",readonly:!0},{path:"uid",label:"UID",type:"string",readonly:!0}];const n=[{path:"className",label:"Type",type:"string",readonly:!0},{path:"name",label:"Name",type:"string"},{path:"id",label:"ID",type:"string",readonly:!0},{path:"enabled",label:"Enabled",type:"boolean"}];return typeof t.object.isVisible=="boolean"&&n.push({path:"isVisible",label:"Visible",type:"boolean"}),typeof t.object.visibility=="number"&&n.push({path:"visibility",label:"Visibility",type:"number"}),n},get:(e,t)=>{this.reindex();const n=this.indexed.get(e);if(n)return n.kind==="scene"?t==="name"?n.scene.name:t==="uid"?n.scene.uid:void 0:t==="className"?u(n.object):t==="enabled"?n.object.isEnabled?.(!1):n.object[t]},set:async(e,t,n)=>{this.reindex();const s=this.indexed.get(e);if(!s||s.kind!=="node")return;const i=this.readChannel(e,t),a=this.historyResource?this.captureHistoryState():void 0;if(t==="enabled")s.object.setEnabled?.(!!n);else if(t==="name"||t==="isVisible"||t==="visibility")s.object[t]=n;else return;this.notify();const o=this.readChannel(e,t);if(!(!this.persistenceBackend||i===void 0||o===void 0||JSON.stringify(i)===JSON.stringify(o)))return y({backend:this.persistenceBackend,subject:()=>this.subjectFor(e,t==="isVisible"?"visible":t),baseline:i,next:o,label:`Set ${this.labelOf(e)} ${t}`,journal:()=>this.recordHistory(`Set ${this.labelOf(e)} ${t}`,a)})}};subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.removeCanvasListeners?.();for(const{scene:e,token:t}of this.pointerTokens)e.onPointerObservable?.remove(t);for(const e of this.gizmos)e.dispose();this.persistenceBackend?.dispose(),this.listeners.clear(),this.indexed.clear(),this.idsByObject.clear()}labelOf(e){return this.hierarchy.node(e)?.label??"Babylon node"}objectOf(e){this.reindex();const t=this.indexed.get(e);return t?.kind==="node"?t.object:null}readChannel(e,t){const n=this.objectOf(e);if(n){if(t==="position")return[n.position?.x??0,n.position?.y??0,n.position?.z??0];if(t==="rotation"){const s=n.rotationQuaternion,i=s?p([s.x,s.y,s.z,s.w]):n.rotation??{x:0,y:0,z:0};return[i.x,i.y,i.z]}return t==="scale"?[n.scaling?.x??1,n.scaling?.y??1,n.scaling?.z??1]:t==="visible"?n.isVisible:this.inspector.get(e,t)}}applyChannel(e,t,n){const s=this.objectOf(e);s&&(t==="position"&&Array.isArray(n)?d(s.position,n):t==="rotation"&&Array.isArray(n)?B(s,n):t==="scale"&&Array.isArray(n)?d(s.scaling,n):t==="visible"?s.isVisible=!!n:(t==="name"||t==="visibility")&&(s[t]=n),this.notify())}recordHistory(e,t){!this.historyResource||!t||(this.edits+=1,this.historyResource.record(e,t,this.captureHistoryState()).catch(n=>{g.error(`[babylon] failed to journal "${e}" into project history — the edit is applied but has no history entry (it cannot be undone): ${n instanceof Error?n.message:String(n)}`)}))}captureHistoryState(){this.reindex();const e={};for(const[t,n]of this.indexed){if(n.kind!=="node")continue;const s={};for(const i of["position","rotation","scale","visible","name","visibility"]){const a=this.readChannel(t,i);a!=null&&(s[i]=a)}e[t]=s}return{edits:this.edits,nodes:e}}restoreHistoryState(e){this.edits=e.edits;for(const[t,n]of Object.entries(e.nodes))for(const[s,i]of Object.entries(n))this.applyChannel(t,s,i);this.notify()}captureChannels(e){const t=this.readChannel(e,"position"),n=this.readChannel(e,"rotation"),s=this.readChannel(e,"scale");return t&&n&&s?{position:t,rotation:n,scale:s}:null}subjectFor(e,t){const n=this.objectOf(e),s=v(n);return{entityId:e,property:t,surface:"babylon",anchor:s,anchorKind:s.anchored?"construction-literal":"live-only",instances:s.anchored&&s.kind==="source"?x(s):0}}installNativeTools(){const e=this.options.api?.GizmoManager;for(const t of this.scenes()){if(e){const s=new e(t);s.positionGizmoEnabled=!0,s.rotationGizmoEnabled=!0,s.scaleGizmoEnabled=!0,s.usePointerToAttachGizmos=!1,this.gizmos.push(s)}const n=t.onPointerObservable;if(n){const s=n.add(i=>{const a=i.pickInfo?.pickedMesh;if(!a)return;this.reindex();const o=this.idsByObject.get(a);o&&this.selection.set([o])});this.pointerTokens.push({scene:t,token:s})}}}attachGizmos(e){const t=e?this.objectOf(e):null;for(const n of this.gizmos){if(!t){n.attachToMesh(null);continue}try{u(t).includes("Mesh")?n.attachToMesh(t):n.attachToNode?n.attachToNode(t):n.attachToMesh(null)}catch{n.attachToMesh(null)}}}notify(){for(const e of this.listeners)e();this.store.shell.notifyIngestEdit()}}export{R as BabylonAuthoringAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{e2 as P,w as X,c6 as ce,X as ue,h6 as fe,ea as me,_ as pe,dw as he,k_ as ge,ag as we}from"./index-D9shXtZ9.js";import{n as ve,a as ye}from"./native-debug-module-Bh_HQdg_.js";import{assertNever as V}from"./adapter-surface-Y37Nzcyw.js";import{r as x}from"./index-nmcBqr7Y.js";import{h as be}from"./index-DzuOGwVB.js";import{staticBatchSkipReason as Ee,materialMergeSignature as Re}from"./structural-signature-Dc7skRiy.js";import{fd as Me}from"./three.core-3arARmh6.js";import{f as Se,c as Ce,a as Ae,b as _e}from"./webgl-frame-capture-DdJkM2mi.js";import{g as Pe}from"./debug-registry-C7poEnyY.js";import{y as xe,f as Fe,e as Te,n as $e,g as De}from"./events-156d8d12.esm-DmeaOP4r.js";import{a as ke}from"./realm-services-CyeBcuLZ.js";import{r as Ie}from"./relative-path-guard-GiM7Lsz8.js";import{b as je,m as Oe}from"./capability-coverage-DWVel6Wq.js";import{a as Be,b as Le}from"./react-root-BHA-cdrW.js";const ee=40,te=30;function re(e){const t=e;return t.isMesh||t.isSkinnedMesh?t:null}function T(e){const t=e.geometry;if(!t)return 0;const r=t.getIndex?.()??null,n=t.getAttribute?.("position")??null,s=r?r.count:n?.count??0,o=e.isInstancedMesh?e.count??1:1;return Math.round(s/3)*o}function U(e,t){if(!e.visible)return;const r=re(e);r&&t(r);for(const n of e.children)U(n,t)}const R="(unnamed)";function j(e,t="(scene)"){const r=new Map;let n=0,s=0;if(!e.visible)return{root:t,totalMeshes:0,totalTriangles:0,subtreeCount:0,subtrees:[]};const o=(d,u)=>{U(u,f=>{const p=T(f),a=r.get(d)??{meshes:0,triangles:0};a.meshes+=1,a.triangles+=p,r.set(d,a),n+=1,s+=p})},l=re(e);if(l){const d=T(l);r.set(e.name||t,{meshes:1,triangles:d}),n+=1,s+=d}for(const d of e.children)o(d.name||R,d);const i=[...r.entries()].map(([d,u])=>({name:d,meshes:u.meshes,triangles:u.triangles})).sort((d,u)=>u.triangles-d.triangles||u.meshes-d.meshes);return{root:t,totalMeshes:n,totalTriangles:s,subtreeCount:i.length,subtrees:i.slice(0,ee)}}function H(e,t){if(e.name===t)return e;for(const r of e.children){const n=H(r,t);if(n)return n}return null}function Ne(e){const t=new Map;let r=0;U(e,o=>{if(o.isInstancedMesh)return;const l=o.geometry;if(!l)return;const i=o.material,d=Array.isArray(i)?i.map(p=>p.uuid).join("+"):i?.uuid??"none",u=`${l.uuid}/${d}`;r+=1;const f=t.get(u);if(f){f.meshes+=1;return}t.set(u,{meshes:1,triangles:T(o),example:`${o.parent?.name||R}/${o.name||R}`})});const n=[...t.values()].sort((o,l)=>l.meshes-o.meshes),s=n.slice(0,te);return{plainMeshes:r,familyCount:n.length,top:s,meshesInTop:s.reduce((o,l)=>o+l.meshes,0)}}function Y(e){const t=new Map,r={},n=[];let s=0;const o=(a,c)=>{if(!a.visible)return!1;const m=Ee(a);if(m==="opted-out")return r["opted-out"]=(r["opted-out"]??0)+1,!1;if(m===null){const w=a,A=w.material,M=`${Re(A)}|${a.castShadow?1:0}${a.receiveShadow?1:0}`;s+=1,n.push({key:M,subtree:c});const S=t.get(M);S?S.meshes+=1:t.set(M,{meshes:1,triangles:T(w),example:`${a.parent?.name||R}/${a.name||R}`})}else m!=="not-a-mesh"&&(r[m]=(r[m]??0)+1);return!0},l=(a,c)=>{if(o(a,c))for(const m of a.children)l(m,c)};if(o(e,e.name||R))for(const a of e.children)l(a,a.name||R);const i=new Set([...t.entries()].filter(([,a])=>a.meshes>=2).map(([a])=>a)),d=new Map;let u=0;for(const a of n)i.has(a.key)&&(u+=1,d.set(a.subtree,(d.get(a.subtree)??0)+1));const f=[...t.values()].sort((a,c)=>c.meshes-a.meshes),p=f.slice(0,te);return{plainMeshes:s,familyCount:f.length,top:p,meshesInTop:p.reduce((a,c)=>a+c.meshes,0),collapsible:u,skipped:r,bySubtree:[...d.entries()].map(([a,c])=>({name:a,collapsible:c})).sort((a,c)=>c.collapsible-a.collapsible).slice(0,ee)}}const ne="render.submit",We=["input","prePhysics","physics","postPhysics","gameLogic","animation"],He=300,Ve=50,Ue=.05,ze=.1;function Ge(e,t,r){const n=e-t-r;return{totalMs:e,renderMs:t,simMs:r,otherMs:n,text:`${e.toFixed(0)}ms = render ${t.toFixed(0)} + sim ${r.toFixed(0)} + other ${n.toFixed(0)}`}}function Ke(){return{lastFrameId:0,lastPresentAt:null,pendingSimMs:0,frameTimeMs:null,renderCpuMs:null,drawCalls:null,triangles:null,renderPasses:null,worstCurrentMs:0,worstPreviousMs:0,worstWindowFrames:0,lastHitch:null,presentedFrames:0}}function Xe(e,t){let r=0;for(const n of e.phases)t.includes(n.name)&&(r+=n.ms);return r}function Ye(e){for(const t of e.phases)if(t.name===ne)return t.ms;return null}function J(e,t,r){return e===null?t:e*(1-r)+t*r}function Je(e,t){if(t.id<=e.lastFrameId)return!1;e.lastFrameId=t.id,t.render.renderPasses!==null&&(e.drawCalls=t.render.drawCalls,e.triangles=t.render.triangles,e.renderPasses=t.render.renderPasses),e.pendingSimMs+=Xe(t,We);const r=Ye(t);if(r===null)return!1;const n=e.pendingSimMs;e.pendingSimMs=0,e.presentedFrames+=1,e.renderCpuMs=J(e.renderCpuMs,r,ze);const s=e.lastPresentAt;if(e.lastPresentAt=t.timestamp,s===null)return!0;const o=t.timestamp-s;return e.frameTimeMs=J(e.frameTimeMs,o,Ue),o>e.worstCurrentMs&&(e.worstCurrentMs=o),e.worstWindowFrames+=1,e.worstWindowFrames>=He&&(e.worstPreviousMs=e.worstCurrentMs,e.worstCurrentMs=0,e.worstWindowFrames=0),o>=Ve&&(e.lastHitch=Ge(o,r,n)),!0}function F(e,t){if(e===null)return null;const r=10**t;return Math.round(e*r)/r}function Qe(e){const t=F(e.frameTimeMs,2),r=Math.max(e.worstCurrentMs,e.worstPreviousMs);return{frameTimeMs:t,fps:t!==null&&t>0?F(1e3/t,1):null,drawCalls:e.drawCalls,triangles:e.triangles,renderCpuMs:F(e.renderCpuMs,2),renderPasses:e.renderPasses,worstFrameMs:e.frameTimeMs===null?null:F(r,2),lastHitch:e.lastHitch,presentedFrames:e.presentedFrames}}function qe(e){const t=Ke(),r=e.subscribe(()=>{const s=e.getSnapshot().frames.at(-1);s&&Je(t,s)});let n=!1;return{read:()=>Qe(t),dispose(){n||(n=!0,r())}}}const Ze=500,et=.5,tt=.4,rt=120;function O(e){return e.toLocaleString("en-US")}function nt(e){const{drawCalls:t,census:r,structural:n}=e;if(t===null||t<Ze)return null;const{collapsible:s}=n;if(s<t*et)return null;const o=new Set(r.subtrees.map(p=>p.name)),l=n.bySubtree[0],i=l&&l.collapsible>=s*tt&&o.has(l.name)?l.name:null,d=i===null?"<Frozen>":`<Frozen name="${i}">`,u=i===null?"spread across the scene":`mostly under "${i}"`,f=`[static-batch] ${O(t)} draw calls this frame; ~${O(s)} meshes are repeats of ${O(n.familyCount)} structural families, ${u}. If that scenery is mount-static — nothing under it moves, re-colours or unmounts after mount — one wrapper collapses it to a few draws: wrap it in ${d}…</Frozen> (volter-game-editor add static-batch). Reactive scenery goes outside the wrapper, and a subtree that must stay unbatched declares it: userData={{ staticBatch: false }}.`;return{drawCalls:t,collapsible:s,subtree:i,fix:d,message:f}}const se="__volterStaticBatchAdvised";function st(){return globalThis[se]===!0}function ot(e){console.warn(e)}function at(e,t=ot){return st()?!1:(globalThis[se]=!0,t(e.message),!0)}const B="render.vitals",it="render.census",lt="render.families",dt="render.toggle",ct="render.dpr",ut="render.dpr: this world has no WebGL renderer (headless mount), so there is no pixel ratio to change. The other render.* commands still work — they read the scene graph.";function ft(e){const{registry:t,worldId:r,profiler:n,scene:s,renderer:o}=e;if(t.adapter.providers().some(c=>c.name===B))return console.warn(`[render-vitals] world "${r}" did not get the ${B} door: another live world already owns it (the names are fixed, so the first three root to mount wins). Its draws still fold into the readings — the profiler is game-scoped — but render.census/families/toggle address the owning root. If this world IS the current one, the previous mount was torn down AFTER this one seeded and its strip() took the door with it.`),null;const i=qe(n),d=t.forRoot(r);d.registerStateProvider(B,()=>i.read()),d.registerCommand(it,{description:"Visible meshes and triangles per subtree — the address book behind the draw-call reading. Pass a subtree name (as listed by a previous census) to drill into it.",args:P([X().optional()]),locus:"client"},c=>{if(c===void 0||c==="")return j(s);const m=H(s,c);if(!m)throw new Error(`render.census: no node named "${c}" in this world. Run render.census with no argument to list the addressable subtrees.`);return j(m,c)}),d.registerCommand(lt,{description:"Meshes grouped by shared (geometry, material) identity, largest group first — the instancing shortlist for a draw-call diet. `structural` is the same scan keyed by VALUE instead of object identity: what would collapse under a <Frozen> wrapper (volter-game-editor add static-batch) even when every mesh carries its own inline material.",args:P([]),locus:"client"},()=>({...Ne(s),structural:Y(s)})),d.registerCommand(dt,{description:"Show/hide a named subtree (as listed by render.census) and read render.vitals again — the difference is what that subtree costs.",args:P([X()]),locus:"client"},c=>{const m=H(s,c);if(!m)throw new Error(`render.toggle: no node named "${c}" in this world. Run render.census to list the addressable subtrees.`);return m.visible=!m.visible,{name:c,visible:m.visible}}),d.registerCommand(ct,{description:"Set the renderer pixel ratio (retina default is ~2) to probe GPU fill cost — render CPU that does not move when the drawing buffer shrinks was never fill-bound.",args:P([ce().positive().max(8)]),locus:"client"},c=>{if(!o)throw new Error(ut);const m=o.getSize(new Me);return o.setPixelRatio(c),o.setSize(m.x,m.y,!1),{pixelRatio:o.getPixelRatio(),drawingBuffer:{width:o.domElement.width,height:o.domElement.height}}});let u=null,f=!1;const p=()=>{if(f||i.read().presentedFrames<rt)return;f=!0,u?.(),u=null;const c=nt({drawCalls:i.read().drawCalls,census:j(s),structural:Y(s)});c&&at(c)};u=n.subscribe(p);let a=!1;return{vitals:i,dispose(){a||(a=!0,u?.(),u=null,i.dispose())}}}const mt={};function pt(e){return mt?.VITE_VOLTER_DEV_BUILD==="true"}const Q=new WeakMap;function ht(e){const t=Q.get(e.Component);if(t)return t;class r extends e.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(s){this.props.onError(s)}render(){return this.state.failed?null:this.props.children}}return Q.set(e.Component,r),r}function gt(e,t,r){const{createElement:n,Fragment:s,useEffect:o,createRoot:l,extend:i,advance:d,flushSync:u}=r,f=ht(r),p=n(t);return{id:e,async mount(a){i(a.three);const c=a.game?Pe(a.game):null,m=a.surface.canvas,w=l(m);let A;const M=new Promise(h=>{A=h});let S;const ae=new Promise(h=>{S=h});function ie(){return o(S,[]),null}await w.configure({gl:a.renderer,shadows:a.renderer.shadowMap?.enabled??!1,frameloop:"never",size:{width:a.surface.width,height:a.surface.height,top:0,left:0},...a.headless?{}:{events:r.events},onCreated:h=>A(h)});const le=n(r.FiberProvider,null,n(s,null,p,n(ie,{key:"volter-mount-effects-ready"}))),_=await new Promise((h,y)=>{const b=E=>{I(),w.unmount(),c?.strip(e),y(new Error(`three world "${e}": fiber crashed before its first commit — ${E}`))},g=E=>{b(E.message)},k=setTimeout(()=>{I(),w.unmount(),c?.strip(e),y(new Error(`three world "${e}": onCreated did not fire within 10s — the R3F tree never reached its first commit (mount() fails loudly instead of hanging)`))},1e4),I=()=>{clearTimeout(k),typeof window<"u"&&window.removeEventListener("error",g)};typeof window<"u"&&window.addEventListener("error",g),w.render(n(f,{onError:E=>b(E.message)},le)),Promise.all([M,ae]).then(([E])=>{I(),h(E)})});_.clock.autoStart=!1,_.clock.stop();const v=()=>_.get();let $=null;if(!a.headless&&a.game&&pt()){if(a.game.profiler.enabled=!0,!c)throw new Error(`three world "${e}": mounted Game has no debug registry.`);$=ft({registry:c,worldId:e,profiler:a.game.profiler,scene:v().scene,renderer:a.renderer})}const de=typeof a.renderer.getContext=="function"?a.renderer.getContext():void 0,z=Se(a.headless??!1,de),G=z?Ce(z):null,C=G?Ae({capture:G,scene:_.scene,memory:()=>_e(v().scene,a.renderer.info)}):null,K=c?{debug:c.adapter}:{};C&&(K.renderDebug=C.adapter);let D=0;return{kind:"three",get scene(){return v().scene},get camera(){return v().camera},drivesOwnLoop:!1,updateCadence:"display",systems:K,systemScope:v().scene,update(h){D+=h;const y=v();try{C?.beforeRender();const b=a.game?.profiler;if(!b?.enabled){d(D,!0,y);return}const g=a.renderer.info,k=g?.render.frame??0;b.beginPhase();try{d(D,!0,y)}finally{b.endPhase(ne)}g&&b.reportRender({gpuMs:null,drawCalls:g.render.calls,triangles:g.render.triangles,geometries:g.memory.geometries,textures:g.memory.textures,renderPasses:g.render.frame-k})}finally{C?.afterRender()}},resize(h,y){v().setSize(h,y)},dispose(){C?.dispose(),u(()=>w.unmount()),$?.dispose(),$=null,c?.strip(e)}}}}}function q(e,t,r){const n=e;return typeof n?.default=="function"?gt(t,n.default,r):null}const wt={FiberProvider:be,createElement:x.createElement,Fragment:x.Fragment,Component:x.Component,useEffect:x.useEffect,createRoot:Fe,extend:Te,advance:$e,flushSync:xe,events:De};let L=null;const vt=["FiberProvider","createElement","Fragment","Component","useEffect","createR3FRoot","extendThree","advance","flushSync","events"];async function yt(){const e=await import(fe),t=vt.filter(r=>e[r]===void 0);if(t.length>0||typeof e.projectThree!="object"||e.projectThree===null)throw new Error(`The packaged runtime's synthetic R3F module did not export ${[...t,...e.projectThree?[]:["projectThree"]].join(", ")} — see R3F_DOORWAY in vite-plugin-module-doorways.ts.`);return{runtime:{FiberProvider:e.FiberProvider,createElement:e.createElement,Fragment:e.Fragment,Component:e.Component,useEffect:e.useEffect,createRoot:e.createR3FRoot,extend:e.extendThree,advance:e.advance,flushSync:e.flushSync,events:e.events},projectThree:e.projectThree}}function bt(e,t){return{id:e.id,mount(r){return e.mount({...r,three:t})}}}async function Z(e,t){if(!await ue())return q(e,t,wt);L||(L=yt());const{runtime:r,projectThree:n}=await L,s=q(e,t,r);return s?bt(s,n):null}function Et(e){if(e===null||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.mount=="function"}async function Rt(e,t,r){const n=r?.namedExport;if(n!==void 0){const s=e[n];if(typeof s!="function")throw new Error(`three root "${t}": ${r?.entryPath??"the entry module"} has no exported component "${n}" (manifest \`world.export\`) — it exports ${Object.keys(e).join(", ")||"(nothing)"}.`);return Z({default:s},t)}return Et(e.adapter)?e.adapter:Z(e,t)}function Mt(e,t){const r=o=>{throw new Error(`resolveRootBinding: world "${e.id}" declares { module: "${t}" } — ${o} (the module path must be game-folder-relative, normalized, with no \`..\` escape).`)},n=Ie(t);n==="empty"&&r("the module path is empty"),n==="nul"&&r("the module path contains a NUL byte"),n==="absolute"&&r("the module path is absolute, not game-folder-relative"),n==="traversal"&&r("the module path contains a `..` segment and would escape the game folder"),t.includes("\\")&&r("the module path contains a backslash (not POSIX-relative)");const s=t.split("/").filter(o=>o.length>0&&o!==".").join("/");return s===""&&r("the module path resolves to nothing (empty after normalization)"),s}function N(e,t,r){const n=o=>{throw new Error(`resolveRootBinding: world "${e.id}"'s custom adapter module "${t}" ${o} — a { module } adapter must default-export an object shaped like \`RootAdapter\`: \`{ id: string, mount(host): Promise<MountedThreeRoot> }\`.`)};(r===null||typeof r!="object")&&n("has no default export (or it is not an object)");const s=r;(typeof s.id!="string"||s.id.length===0)&&n("default-exports an object with no non-empty string `id`"),typeof s.mount!="function"&&n("default-exports an object with no `mount` function")}const St="this world mounts through the project’s own adapter module, so every capability the editor has here is one that module hands it";function W(e,t){return{id:t.id,async mount(r){const n=await t.mount(r),s=je(e.id,Oe(n),St,n.kind);if(s){const{editorConsole:o}=await pe(async()=>{const{editorConsole:l}=await import("./index-D9shXtZ9.js").then(i=>i.tQ);return{editorConsole:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));o.warn(s,"adapter")}return n}}}async function Ct(e,t,r){const{adapter:n}=e;if(n.type!=="module")throw new Error(`resolveModuleAdapter: world "${e.id}" is not a { module } world.`);const s=Mt(e,n.module),l=await import(me(t,s,r)),i=l.default;switch(e.surface){case"three":return N(e,n.module,i),{resolved:{surface:"three",adapter:W(e,i)},module:l};case"canvas":return N(e,n.module,i),{resolved:{surface:"canvas",adapter:W(e,i)},module:l};case"dom":return N(e,n.module,i),{resolved:{surface:"dom",adapter:W(e,i)},module:l};default:return V(e.surface,"resolveModuleAdapter")}}async function At(e,t,r,n){const{adapter:s,module:o}=await Pt(e,t,n);return{adapter:s,declaration:_t(e,r,o)}}function _t(e,t,r){const n=ve(e.id,r),s=ye(e.id,r,e.surface);return{root:e,definition:t,entry:{reach:"full",module:r},...n?{entryDebug:n}:{},...s?{entrySystems:s}:{}}}async function Pt(e,t,r){const{adapter:n}=e;switch(n.identity){case"three":return xt(e,t,r);case"canvas":return Ft(e,t,r);case"dom":{let s={};return{adapter:{surface:"dom",adapter:await Le(e,t,l=>{s=l})},module:s}}case"module":{const{resolved:s,module:o}=await Ct(e,t.projectRoot,t.epoch);return{adapter:s,module:o}}case"ingest-react":{const{adapter:s,module:o}=await Be(e,t);return{adapter:{surface:"dom",adapter:s},module:o}}case"ingest-pixi":case"ingest-three":return Tt(e);default:{const s=n;throw new Error(`resolveRootBinding: unhandled adapter identity ${JSON.stringify(s)}`)}}}async function xt(e,t,r){if(e.entry===void 0)throw new Error(`resolveRootBinding: world "${e.id}" is a three root with no \`entry\` — this should have been rejected by manifest validation. A three root is authored as a TSX/R3F world module.`);const n=await t.loadEntryModule(e.entry,e.id,"three",r?.selectionOverride),s=await Rt(n,e.id,{entryPath:e.entry});if(!s)throw new Error(`Project script at ${e.entry} neither exports \`adapter\` nor default-exports a React world component — every explicit first-party entry module satisfies one of the two (\`export default function World() { … }\`, or an \`adapter\` export for full control).`);return{adapter:{surface:"three",adapter:s},module:n}}async function Ft(e,t,r){if(e.entry===void 0)throw new Error(`resolveRootBinding: world "${e.id}" is a canvas root with no \`entry\` — this should have been rejected by manifest validation. A canvas root is authored as a TSX world module; point \`entry\` at it.`);const n=await t.loadEntryModule(e.entry,e.id,"canvas",r?.selectionOverride),s=await t.pixiRuntime(n,e.id);if(!s)throw new Error(`Project script at ${e.entry} (canvas root "${e.id}") must default-export a React component (\`export default function World() { … }\`) — or export an \`adapter\` for full control.`);return{adapter:{surface:"canvas",adapter:s},module:n}}function Tt(e){const t=e.adapter.identity==="ingest-pixi"?"resolveIngest2DDescriptor + mountCanvasIngestRootFromManifest":"resolveIngestDescriptor + mountThreeIngestRootFromManifest";throw new Error(`resolveRootBinding: world "${e.id}" (${e.adapter.identity}) is a captured foreign runtime, not a host-mounted RootAdapter; dispatch it through ${t}`)}async function oe(e,t,r){const n=he(),s=await ke(t,n),o=await ge(),l=[];for(const i of we(e)){const d=r?.selectionOverride,u=await At(i,s,o,{...d&&i.id===d.regionId?{selectionOverride:{selection:d.selection,key:d.key}}:{}});l.push({world:i,resolved:u})}return{roots:l,mountId:String(n)}}async function Gt(e,t){const{roots:r}=await oe(e,t),n=[];for(const{world:s,resolved:o}of r){const l={id:s.id,zOrder:s.zOrder,pausable:s.pausable,declaration:o.declaration},i=o.adapter;switch(i.surface){case"canvas":n.push({...l,kind:"canvas",adapter:i.adapter});break;case"dom":n.push({...l,kind:"dom",adapter:i.adapter});break;case"three":n.push({...l,kind:"three",adapter:i.adapter});break;default:V(i,"resolveAllRoots")}}return n}async function Kt(e,t,r){const{roots:n,mountId:s}=await oe(e,t,r),o={};for(const{world:l,resolved:i}of n){const{root:d,...u}=i.declaration,f=i.adapter;switch(f.surface){case"canvas":o[l.id]={kind:"canvas",adapter:f.adapter,declaration:u};break;case"dom":o[l.id]={kind:"dom",adapter:f.adapter,declaration:u};break;case"three":o[l.id]={kind:"three",adapter:f.adapter,declaration:u};break;default:V(f,"resolveAllRootEntries")}}return{entries:o,mountId:s}}export{Rt as a,Kt as b,Gt as r};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BfqJPhFO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e2 as P,w as X,c6 as ce,X as ue,h6 as fe,ea as me,_ as pe,dw as he,k_ as ge,ag as we}from"./index-BfqJPhFO.js";import{n as ve,a as ye}from"./native-debug-module-L_Ofssyj.js";import{assertNever as V}from"./adapter-surface-Y37Nzcyw.js";import{r as x}from"./index-nmcBqr7Y.js";import{h as be}from"./index-DzuOGwVB.js";import{staticBatchSkipReason as Ee,materialMergeSignature as Re}from"./structural-signature-Dc7skRiy.js";import{fd as Me}from"./three.core-3arARmh6.js";import{f as Se,c as Ce,a as Ae,b as _e}from"./webgl-frame-capture-DdJkM2mi.js";import{g as Pe}from"./debug-registry-BzagDrhV.js";import{y as xe,f as Fe,e as Te,n as $e,g as De}from"./events-156d8d12.esm-DmeaOP4r.js";import{a as ke}from"./realm-services-CxfLBQQ9.js";import{r as Ie}from"./relative-path-guard-GiM7Lsz8.js";import{b as je,m as Oe}from"./capability-coverage-aT7nf05J.js";import{a as Be,b as Le}from"./react-root-BHA-cdrW.js";const ee=40,te=30;function re(e){const t=e;return t.isMesh||t.isSkinnedMesh?t:null}function T(e){const t=e.geometry;if(!t)return 0;const r=t.getIndex?.()??null,n=t.getAttribute?.("position")??null,s=r?r.count:n?.count??0,o=e.isInstancedMesh?e.count??1:1;return Math.round(s/3)*o}function U(e,t){if(!e.visible)return;const r=re(e);r&&t(r);for(const n of e.children)U(n,t)}const R="(unnamed)";function j(e,t="(scene)"){const r=new Map;let n=0,s=0;if(!e.visible)return{root:t,totalMeshes:0,totalTriangles:0,subtreeCount:0,subtrees:[]};const o=(d,u)=>{U(u,f=>{const p=T(f),a=r.get(d)??{meshes:0,triangles:0};a.meshes+=1,a.triangles+=p,r.set(d,a),n+=1,s+=p})},l=re(e);if(l){const d=T(l);r.set(e.name||t,{meshes:1,triangles:d}),n+=1,s+=d}for(const d of e.children)o(d.name||R,d);const i=[...r.entries()].map(([d,u])=>({name:d,meshes:u.meshes,triangles:u.triangles})).sort((d,u)=>u.triangles-d.triangles||u.meshes-d.meshes);return{root:t,totalMeshes:n,totalTriangles:s,subtreeCount:i.length,subtrees:i.slice(0,ee)}}function H(e,t){if(e.name===t)return e;for(const r of e.children){const n=H(r,t);if(n)return n}return null}function Ne(e){const t=new Map;let r=0;U(e,o=>{if(o.isInstancedMesh)return;const l=o.geometry;if(!l)return;const i=o.material,d=Array.isArray(i)?i.map(p=>p.uuid).join("+"):i?.uuid??"none",u=`${l.uuid}/${d}`;r+=1;const f=t.get(u);if(f){f.meshes+=1;return}t.set(u,{meshes:1,triangles:T(o),example:`${o.parent?.name||R}/${o.name||R}`})});const n=[...t.values()].sort((o,l)=>l.meshes-o.meshes),s=n.slice(0,te);return{plainMeshes:r,familyCount:n.length,top:s,meshesInTop:s.reduce((o,l)=>o+l.meshes,0)}}function Y(e){const t=new Map,r={},n=[];let s=0;const o=(a,c)=>{if(!a.visible)return!1;const m=Ee(a);if(m==="opted-out")return r["opted-out"]=(r["opted-out"]??0)+1,!1;if(m===null){const w=a,A=w.material,M=`${Re(A)}|${a.castShadow?1:0}${a.receiveShadow?1:0}`;s+=1,n.push({key:M,subtree:c});const S=t.get(M);S?S.meshes+=1:t.set(M,{meshes:1,triangles:T(w),example:`${a.parent?.name||R}/${a.name||R}`})}else m!=="not-a-mesh"&&(r[m]=(r[m]??0)+1);return!0},l=(a,c)=>{if(o(a,c))for(const m of a.children)l(m,c)};if(o(e,e.name||R))for(const a of e.children)l(a,a.name||R);const i=new Set([...t.entries()].filter(([,a])=>a.meshes>=2).map(([a])=>a)),d=new Map;let u=0;for(const a of n)i.has(a.key)&&(u+=1,d.set(a.subtree,(d.get(a.subtree)??0)+1));const f=[...t.values()].sort((a,c)=>c.meshes-a.meshes),p=f.slice(0,te);return{plainMeshes:s,familyCount:f.length,top:p,meshesInTop:p.reduce((a,c)=>a+c.meshes,0),collapsible:u,skipped:r,bySubtree:[...d.entries()].map(([a,c])=>({name:a,collapsible:c})).sort((a,c)=>c.collapsible-a.collapsible).slice(0,ee)}}const ne="render.submit",We=["input","prePhysics","physics","postPhysics","gameLogic","animation"],He=300,Ve=50,Ue=.05,ze=.1;function Ge(e,t,r){const n=e-t-r;return{totalMs:e,renderMs:t,simMs:r,otherMs:n,text:`${e.toFixed(0)}ms = render ${t.toFixed(0)} + sim ${r.toFixed(0)} + other ${n.toFixed(0)}`}}function Ke(){return{lastFrameId:0,lastPresentAt:null,pendingSimMs:0,frameTimeMs:null,renderCpuMs:null,drawCalls:null,triangles:null,renderPasses:null,worstCurrentMs:0,worstPreviousMs:0,worstWindowFrames:0,lastHitch:null,presentedFrames:0}}function Xe(e,t){let r=0;for(const n of e.phases)t.includes(n.name)&&(r+=n.ms);return r}function Ye(e){for(const t of e.phases)if(t.name===ne)return t.ms;return null}function J(e,t,r){return e===null?t:e*(1-r)+t*r}function Je(e,t){if(t.id<=e.lastFrameId)return!1;e.lastFrameId=t.id,t.render.renderPasses!==null&&(e.drawCalls=t.render.drawCalls,e.triangles=t.render.triangles,e.renderPasses=t.render.renderPasses),e.pendingSimMs+=Xe(t,We);const r=Ye(t);if(r===null)return!1;const n=e.pendingSimMs;e.pendingSimMs=0,e.presentedFrames+=1,e.renderCpuMs=J(e.renderCpuMs,r,ze);const s=e.lastPresentAt;if(e.lastPresentAt=t.timestamp,s===null)return!0;const o=t.timestamp-s;return e.frameTimeMs=J(e.frameTimeMs,o,Ue),o>e.worstCurrentMs&&(e.worstCurrentMs=o),e.worstWindowFrames+=1,e.worstWindowFrames>=He&&(e.worstPreviousMs=e.worstCurrentMs,e.worstCurrentMs=0,e.worstWindowFrames=0),o>=Ve&&(e.lastHitch=Ge(o,r,n)),!0}function F(e,t){if(e===null)return null;const r=10**t;return Math.round(e*r)/r}function Qe(e){const t=F(e.frameTimeMs,2),r=Math.max(e.worstCurrentMs,e.worstPreviousMs);return{frameTimeMs:t,fps:t!==null&&t>0?F(1e3/t,1):null,drawCalls:e.drawCalls,triangles:e.triangles,renderCpuMs:F(e.renderCpuMs,2),renderPasses:e.renderPasses,worstFrameMs:e.frameTimeMs===null?null:F(r,2),lastHitch:e.lastHitch,presentedFrames:e.presentedFrames}}function qe(e){const t=Ke(),r=e.subscribe(()=>{const s=e.getSnapshot().frames.at(-1);s&&Je(t,s)});let n=!1;return{read:()=>Qe(t),dispose(){n||(n=!0,r())}}}const Ze=500,et=.5,tt=.4,rt=120;function O(e){return e.toLocaleString("en-US")}function nt(e){const{drawCalls:t,census:r,structural:n}=e;if(t===null||t<Ze)return null;const{collapsible:s}=n;if(s<t*et)return null;const o=new Set(r.subtrees.map(p=>p.name)),l=n.bySubtree[0],i=l&&l.collapsible>=s*tt&&o.has(l.name)?l.name:null,d=i===null?"<Frozen>":`<Frozen name="${i}">`,u=i===null?"spread across the scene":`mostly under "${i}"`,f=`[static-batch] ${O(t)} draw calls this frame; ~${O(s)} meshes are repeats of ${O(n.familyCount)} structural families, ${u}. If that scenery is mount-static — nothing under it moves, re-colours or unmounts after mount — one wrapper collapses it to a few draws: wrap it in ${d}…</Frozen> (volter-game-editor add static-batch). Reactive scenery goes outside the wrapper, and a subtree that must stay unbatched declares it: userData={{ staticBatch: false }}.`;return{drawCalls:t,collapsible:s,subtree:i,fix:d,message:f}}const se="__volterStaticBatchAdvised";function st(){return globalThis[se]===!0}function ot(e){console.warn(e)}function at(e,t=ot){return st()?!1:(globalThis[se]=!0,t(e.message),!0)}const B="render.vitals",it="render.census",lt="render.families",dt="render.toggle",ct="render.dpr",ut="render.dpr: this world has no WebGL renderer (headless mount), so there is no pixel ratio to change. The other render.* commands still work — they read the scene graph.";function ft(e){const{registry:t,worldId:r,profiler:n,scene:s,renderer:o}=e;if(t.adapter.providers().some(c=>c.name===B))return console.warn(`[render-vitals] world "${r}" did not get the ${B} door: another live world already owns it (the names are fixed, so the first three root to mount wins). Its draws still fold into the readings — the profiler is game-scoped — but render.census/families/toggle address the owning root. If this world IS the current one, the previous mount was torn down AFTER this one seeded and its strip() took the door with it.`),null;const i=qe(n),d=t.forRoot(r);d.registerStateProvider(B,()=>i.read()),d.registerCommand(it,{description:"Visible meshes and triangles per subtree — the address book behind the draw-call reading. Pass a subtree name (as listed by a previous census) to drill into it.",args:P([X().optional()]),locus:"client"},c=>{if(c===void 0||c==="")return j(s);const m=H(s,c);if(!m)throw new Error(`render.census: no node named "${c}" in this world. Run render.census with no argument to list the addressable subtrees.`);return j(m,c)}),d.registerCommand(lt,{description:"Meshes grouped by shared (geometry, material) identity, largest group first — the instancing shortlist for a draw-call diet. `structural` is the same scan keyed by VALUE instead of object identity: what would collapse under a <Frozen> wrapper (volter-game-editor add static-batch) even when every mesh carries its own inline material.",args:P([]),locus:"client"},()=>({...Ne(s),structural:Y(s)})),d.registerCommand(dt,{description:"Show/hide a named subtree (as listed by render.census) and read render.vitals again — the difference is what that subtree costs.",args:P([X()]),locus:"client"},c=>{const m=H(s,c);if(!m)throw new Error(`render.toggle: no node named "${c}" in this world. Run render.census to list the addressable subtrees.`);return m.visible=!m.visible,{name:c,visible:m.visible}}),d.registerCommand(ct,{description:"Set the renderer pixel ratio (retina default is ~2) to probe GPU fill cost — render CPU that does not move when the drawing buffer shrinks was never fill-bound.",args:P([ce().positive().max(8)]),locus:"client"},c=>{if(!o)throw new Error(ut);const m=o.getSize(new Me);return o.setPixelRatio(c),o.setSize(m.x,m.y,!1),{pixelRatio:o.getPixelRatio(),drawingBuffer:{width:o.domElement.width,height:o.domElement.height}}});let u=null,f=!1;const p=()=>{if(f||i.read().presentedFrames<rt)return;f=!0,u?.(),u=null;const c=nt({drawCalls:i.read().drawCalls,census:j(s),structural:Y(s)});c&&at(c)};u=n.subscribe(p);let a=!1;return{vitals:i,dispose(){a||(a=!0,u?.(),u=null,i.dispose())}}}const mt={};function pt(e){return mt?.VITE_VOLTER_DEV_BUILD==="true"}const Q=new WeakMap;function ht(e){const t=Q.get(e.Component);if(t)return t;class r extends e.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(s){this.props.onError(s)}render(){return this.state.failed?null:this.props.children}}return Q.set(e.Component,r),r}function gt(e,t,r){const{createElement:n,Fragment:s,useEffect:o,createRoot:l,extend:i,advance:d,flushSync:u}=r,f=ht(r),p=n(t);return{id:e,async mount(a){i(a.three);const c=a.game?Pe(a.game):null,m=a.surface.canvas,w=l(m);let A;const M=new Promise(h=>{A=h});let S;const ae=new Promise(h=>{S=h});function ie(){return o(S,[]),null}await w.configure({gl:a.renderer,shadows:a.renderer.shadowMap?.enabled??!1,frameloop:"never",size:{width:a.surface.width,height:a.surface.height,top:0,left:0},...a.headless?{}:{events:r.events},onCreated:h=>A(h)});const le=n(r.FiberProvider,null,n(s,null,p,n(ie,{key:"volter-mount-effects-ready"}))),_=await new Promise((h,y)=>{const b=E=>{I(),w.unmount(),c?.strip(e),y(new Error(`three world "${e}": fiber crashed before its first commit — ${E}`))},g=E=>{b(E.message)},k=setTimeout(()=>{I(),w.unmount(),c?.strip(e),y(new Error(`three world "${e}": onCreated did not fire within 10s — the R3F tree never reached its first commit (mount() fails loudly instead of hanging)`))},1e4),I=()=>{clearTimeout(k),typeof window<"u"&&window.removeEventListener("error",g)};typeof window<"u"&&window.addEventListener("error",g),w.render(n(f,{onError:E=>b(E.message)},le)),Promise.all([M,ae]).then(([E])=>{I(),h(E)})});_.clock.autoStart=!1,_.clock.stop();const v=()=>_.get();let $=null;if(!a.headless&&a.game&&pt()){if(a.game.profiler.enabled=!0,!c)throw new Error(`three world "${e}": mounted Game has no debug registry.`);$=ft({registry:c,worldId:e,profiler:a.game.profiler,scene:v().scene,renderer:a.renderer})}const de=typeof a.renderer.getContext=="function"?a.renderer.getContext():void 0,z=Se(a.headless??!1,de),G=z?Ce(z):null,C=G?Ae({capture:G,scene:_.scene,memory:()=>_e(v().scene,a.renderer.info)}):null,K=c?{debug:c.adapter}:{};C&&(K.renderDebug=C.adapter);let D=0;return{kind:"three",get scene(){return v().scene},get camera(){return v().camera},drivesOwnLoop:!1,updateCadence:"display",systems:K,systemScope:v().scene,update(h){D+=h;const y=v();try{C?.beforeRender();const b=a.game?.profiler;if(!b?.enabled){d(D,!0,y);return}const g=a.renderer.info,k=g?.render.frame??0;b.beginPhase();try{d(D,!0,y)}finally{b.endPhase(ne)}g&&b.reportRender({gpuMs:null,drawCalls:g.render.calls,triangles:g.render.triangles,geometries:g.memory.geometries,textures:g.memory.textures,renderPasses:g.render.frame-k})}finally{C?.afterRender()}},resize(h,y){v().setSize(h,y)},dispose(){C?.dispose(),u(()=>w.unmount()),$?.dispose(),$=null,c?.strip(e)}}}}}function q(e,t,r){const n=e;return typeof n?.default=="function"?gt(t,n.default,r):null}const wt={FiberProvider:be,createElement:x.createElement,Fragment:x.Fragment,Component:x.Component,useEffect:x.useEffect,createRoot:Fe,extend:Te,advance:$e,flushSync:xe,events:De};let L=null;const vt=["FiberProvider","createElement","Fragment","Component","useEffect","createR3FRoot","extendThree","advance","flushSync","events"];async function yt(){const e=await import(fe),t=vt.filter(r=>e[r]===void 0);if(t.length>0||typeof e.projectThree!="object"||e.projectThree===null)throw new Error(`The packaged runtime's synthetic R3F module did not export ${[...t,...e.projectThree?[]:["projectThree"]].join(", ")} — see R3F_DOORWAY in vite-plugin-module-doorways.ts.`);return{runtime:{FiberProvider:e.FiberProvider,createElement:e.createElement,Fragment:e.Fragment,Component:e.Component,useEffect:e.useEffect,createRoot:e.createR3FRoot,extend:e.extendThree,advance:e.advance,flushSync:e.flushSync,events:e.events},projectThree:e.projectThree}}function bt(e,t){return{id:e.id,mount(r){return e.mount({...r,three:t})}}}async function Z(e,t){if(!await ue())return q(e,t,wt);L||(L=yt());const{runtime:r,projectThree:n}=await L,s=q(e,t,r);return s?bt(s,n):null}function Et(e){if(e===null||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.mount=="function"}async function Rt(e,t,r){const n=r?.namedExport;if(n!==void 0){const s=e[n];if(typeof s!="function")throw new Error(`three root "${t}": ${r?.entryPath??"the entry module"} has no exported component "${n}" (manifest \`world.export\`) — it exports ${Object.keys(e).join(", ")||"(nothing)"}.`);return Z({default:s},t)}return Et(e.adapter)?e.adapter:Z(e,t)}function Mt(e,t){const r=o=>{throw new Error(`resolveRootBinding: world "${e.id}" declares { module: "${t}" } — ${o} (the module path must be game-folder-relative, normalized, with no \`..\` escape).`)},n=Ie(t);n==="empty"&&r("the module path is empty"),n==="nul"&&r("the module path contains a NUL byte"),n==="absolute"&&r("the module path is absolute, not game-folder-relative"),n==="traversal"&&r("the module path contains a `..` segment and would escape the game folder"),t.includes("\\")&&r("the module path contains a backslash (not POSIX-relative)");const s=t.split("/").filter(o=>o.length>0&&o!==".").join("/");return s===""&&r("the module path resolves to nothing (empty after normalization)"),s}function N(e,t,r){const n=o=>{throw new Error(`resolveRootBinding: world "${e.id}"'s custom adapter module "${t}" ${o} — a { module } adapter must default-export an object shaped like \`RootAdapter\`: \`{ id: string, mount(host): Promise<MountedThreeRoot> }\`.`)};(r===null||typeof r!="object")&&n("has no default export (or it is not an object)");const s=r;(typeof s.id!="string"||s.id.length===0)&&n("default-exports an object with no non-empty string `id`"),typeof s.mount!="function"&&n("default-exports an object with no `mount` function")}const St="this world mounts through the project’s own adapter module, so every capability the editor has here is one that module hands it";function W(e,t){return{id:t.id,async mount(r){const n=await t.mount(r),s=je(e.id,Oe(n),St,n.kind);if(s){const{editorConsole:o}=await pe(async()=>{const{editorConsole:l}=await import("./index-BfqJPhFO.js").then(i=>i.tQ);return{editorConsole:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));o.warn(s,"adapter")}return n}}}async function Ct(e,t,r){const{adapter:n}=e;if(n.type!=="module")throw new Error(`resolveModuleAdapter: world "${e.id}" is not a { module } world.`);const s=Mt(e,n.module),l=await import(me(t,s,r)),i=l.default;switch(e.surface){case"three":return N(e,n.module,i),{resolved:{surface:"three",adapter:W(e,i)},module:l};case"canvas":return N(e,n.module,i),{resolved:{surface:"canvas",adapter:W(e,i)},module:l};case"dom":return N(e,n.module,i),{resolved:{surface:"dom",adapter:W(e,i)},module:l};default:return V(e.surface,"resolveModuleAdapter")}}async function At(e,t,r,n){const{adapter:s,module:o}=await Pt(e,t,n);return{adapter:s,declaration:_t(e,r,o)}}function _t(e,t,r){const n=ve(e.id,r),s=ye(e.id,r,e.surface);return{root:e,definition:t,entry:{reach:"full",module:r},...n?{entryDebug:n}:{},...s?{entrySystems:s}:{}}}async function Pt(e,t,r){const{adapter:n}=e;switch(n.identity){case"three":return xt(e,t,r);case"canvas":return Ft(e,t,r);case"dom":{let s={};return{adapter:{surface:"dom",adapter:await Le(e,t,l=>{s=l})},module:s}}case"module":{const{resolved:s,module:o}=await Ct(e,t.projectRoot,t.epoch);return{adapter:s,module:o}}case"ingest-react":{const{adapter:s,module:o}=await Be(e,t);return{adapter:{surface:"dom",adapter:s},module:o}}case"ingest-pixi":case"ingest-three":return Tt(e);default:{const s=n;throw new Error(`resolveRootBinding: unhandled adapter identity ${JSON.stringify(s)}`)}}}async function xt(e,t,r){if(e.entry===void 0)throw new Error(`resolveRootBinding: world "${e.id}" is a three root with no \`entry\` — this should have been rejected by manifest validation. A three root is authored as a TSX/R3F world module.`);const n=await t.loadEntryModule(e.entry,e.id,"three",r?.selectionOverride),s=await Rt(n,e.id,{entryPath:e.entry});if(!s)throw new Error(`Project script at ${e.entry} neither exports \`adapter\` nor default-exports a React world component — every explicit first-party entry module satisfies one of the two (\`export default function World() { … }\`, or an \`adapter\` export for full control).`);return{adapter:{surface:"three",adapter:s},module:n}}async function Ft(e,t,r){if(e.entry===void 0)throw new Error(`resolveRootBinding: world "${e.id}" is a canvas root with no \`entry\` — this should have been rejected by manifest validation. A canvas root is authored as a TSX world module; point \`entry\` at it.`);const n=await t.loadEntryModule(e.entry,e.id,"canvas",r?.selectionOverride),s=await t.pixiRuntime(n,e.id);if(!s)throw new Error(`Project script at ${e.entry} (canvas root "${e.id}") must default-export a React component (\`export default function World() { … }\`) — or export an \`adapter\` for full control.`);return{adapter:{surface:"canvas",adapter:s},module:n}}function Tt(e){const t=e.adapter.identity==="ingest-pixi"?"resolveIngest2DDescriptor + mountCanvasIngestRootFromManifest":"resolveIngestDescriptor + mountThreeIngestRootFromManifest";throw new Error(`resolveRootBinding: world "${e.id}" (${e.adapter.identity}) is a captured foreign runtime, not a host-mounted RootAdapter; dispatch it through ${t}`)}async function oe(e,t,r){const n=he(),s=await ke(t,n),o=await ge(),l=[];for(const i of we(e)){const d=r?.selectionOverride,u=await At(i,s,o,{...d&&i.id===d.regionId?{selectionOverride:{selection:d.selection,key:d.key}}:{}});l.push({world:i,resolved:u})}return{roots:l,mountId:String(n)}}async function Gt(e,t){const{roots:r}=await oe(e,t),n=[];for(const{world:s,resolved:o}of r){const l={id:s.id,zOrder:s.zOrder,pausable:s.pausable,declaration:o.declaration},i=o.adapter;switch(i.surface){case"canvas":n.push({...l,kind:"canvas",adapter:i.adapter});break;case"dom":n.push({...l,kind:"dom",adapter:i.adapter});break;case"three":n.push({...l,kind:"three",adapter:i.adapter});break;default:V(i,"resolveAllRoots")}}return n}async function Kt(e,t,r){const{roots:n,mountId:s}=await oe(e,t,r),o={};for(const{world:l,resolved:i}of n){const{root:d,...u}=i.declaration,f=i.adapter;switch(f.surface){case"canvas":o[l.id]={kind:"canvas",adapter:f.adapter,declaration:u};break;case"dom":o[l.id]={kind:"dom",adapter:f.adapter,declaration:u};break;case"three":o[l.id]={kind:"three",adapter:f.adapter,declaration:u};break;default:V(f,"resolveAllRootEntries")}}return{entries:o,mountId:s}}export{Rt as a,Kt as b,Gt as r};
|