@volter/game-editor 0.5.77 → 0.5.79
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 +2108 -2108
- package/dist/assets/{AssetBudgetPanel-Dwpm-iyO.js → AssetBudgetPanel-oKdjrwih.js} +3 -3
- package/dist/assets/{AudioViewer-CN_WyuPP.js → AudioViewer-B1k9_wIO.js} +1 -1
- package/dist/assets/{CanvasBoardDocument--eRnJA3d.js → CanvasBoardDocument-CidIZfJc.js} +1 -1
- package/dist/assets/{CanvasSceneViewport-BwwYOosQ.js → CanvasSceneViewport-D-a2OjoE.js} +1 -1
- package/dist/assets/{ColorInput-fP6gD8GQ.js → ColorInput-CsU6nBCb.js} +1 -1
- package/dist/assets/{EntityModelDocument--Mnf5gfu.js → EntityModelDocument-BGtt8kn8.js} +1 -1
- package/dist/assets/{EnvironmentAssetDocument-JioL9Pmv.js → EnvironmentAssetDocument-Cv_9BvF0.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-BRl0PIim.js → GameplaySessionTimeline-c77A4RAA.js} +1 -1
- package/dist/assets/{ImageViewer-ET4Bwjzp.js → ImageViewer-BpjPWpIS.js} +1 -1
- package/dist/assets/InspectorObjectPreview-DA4bXZQD.js +1 -0
- package/dist/assets/{JsonAssetDocument-CVkHqdUd.js → JsonAssetDocument-BPN3E7Ai.js} +1 -1
- package/dist/assets/{LiveModuleDocument-DLwna0kt.js → LiveModuleDocument-CqN29siR.js} +1 -1
- package/dist/assets/{LutAssetDocument-BdG_i8hr.js → LutAssetDocument-BV6N2-qQ.js} +1 -1
- package/dist/assets/{ModelAssetDocument-DTxbDhA6.js → ModelAssetDocument-Bf5JZ8TF.js} +1 -1
- package/dist/assets/{NonThreeAuthoringBootstrap-BZ4A6rPs.js → NonThreeAuthoringBootstrap-CZvbouNB.js} +1 -1
- package/dist/assets/{Object3DDocumentToolbar-COuKq3sB.js → Object3DDocumentToolbar-Cm4ma8tv.js} +1 -1
- package/dist/assets/Object3DDocumentViewport-BydKspxr.js +2 -0
- package/dist/assets/{Object3DPreview-D_1vkB4L.js → Object3DPreview-BlzCte35.js} +1 -1
- package/dist/assets/{OnlineAssetDetail-DvKNu8aC.js → OnlineAssetDetail-DaIvao3s.js} +1 -1
- package/dist/assets/{PlayBar-DknzqPEC.js → PlayBar-DJ1LfrgS.js} +1 -1
- package/dist/assets/{QuarksAssetDocument-Dc5JDyxV.js → QuarksAssetDocument-DcjHKYru.js} +1 -1
- package/dist/assets/{ReactCanvasControls-DircULTK.js → ReactCanvasControls-DSwW_3qn.js} +1 -1
- package/dist/assets/{RootSelectionOverlay-D--07KbL.js → RootSelectionOverlay-QJRz70Z_.js} +1 -1
- package/dist/assets/{ShaderAssetDocument-D05qJkAZ.js → ShaderAssetDocument-BCAyVHUs.js} +1 -1
- package/dist/assets/{ShadowEditor-BQ_4yLgQ.js → ShadowEditor-ChBlM7up.js} +1 -1
- package/dist/assets/{SourceAssetViewer-ubsXVAPL.js → SourceAssetViewer-t8M_wt4P.js} +1 -1
- package/dist/assets/{StageHost-eSViLdbz.js → StageHost-BToQY05P.js} +2 -2
- package/dist/assets/{StoryPreviewMount-Befs2jpi.js → StoryPreviewMount-DQQUiOyt.js} +1 -1
- package/dist/assets/{ThreeBoardDocument-5MeNfCGF.js → ThreeBoardDocument-B0E8STg7.js} +2 -2
- package/dist/assets/{ThreeIsolationSceneContent-B1xdrbgO.js → ThreeIsolationSceneContent-C5fELwmY.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-D3D8hMNA.js → ToolObject3DPreview-COEdg5Yk.js} +1 -1
- package/dist/assets/{Toolbar-BTun9j-K.js → Toolbar-Dc2590c_.js} +1 -1
- package/dist/assets/{TransientHint-BjG5QZ7w.js → TransientHint-Ck6-tCTl.js} +1 -1
- package/dist/assets/{VideoViewer-CbsogTc0.js → VideoViewer-Ceo0o85u.js} +1 -1
- package/dist/assets/{ViewportShadingMenu-DXfHXJZb.js → ViewportShadingMenu-pE6Hv73N.js} +1 -1
- package/dist/assets/{active-ingest-B0RHbDkD.js → active-ingest-DIgBJBWV.js} +2 -2
- package/dist/assets/{animation-clock-Dkfj-UNQ.js → animation-clock-BsTiJqzv.js} +1 -1
- package/dist/assets/{animation-mixers.service-BTbinFit.js → animation-mixers.service-DZMXEUKZ.js} +1 -1
- package/dist/assets/{animation-timeline.utility-BKZvFUv7.js → animation-timeline.utility-C1kYhS_b.js} +1 -1
- package/dist/assets/{asset-budget-asset.menu-CPLl16u9.js → asset-budget-asset.menu-CgLl0jxU.js} +1 -1
- package/dist/assets/{asset-budget.action-BDDyOQkl.js → asset-budget.action-BM9nPYFm.js} +1 -1
- package/dist/assets/{asset-budget.document-CX7bz50G.js → asset-budget.document-CIBwqW8O.js} +1 -1
- package/dist/assets/{asset-budget.menu-5S1Zzll8.js → asset-budget.menu-CIYQlzVL.js} +1 -1
- package/dist/assets/{asset-editor-persistence-AKvUtcfg.js → asset-editor-persistence-FoI6VqbB.js} +1 -1
- package/dist/assets/{asset-loaders-BoVVLGeW.js → asset-loaders-DIhOedSj.js} +1 -1
- package/dist/assets/{asset-preview-C-SzfMmZ.js → asset-preview-J56EM7ai.js} +1 -1
- package/dist/assets/{audio-unlock.service-Cu-KaqcU.js → audio-unlock.service-CQhkc6fU.js} +1 -1
- package/dist/assets/{audio.utility-BdMr9Tg8.js → audio.utility-ZTVc6wlz.js} +1 -1
- package/dist/assets/autoplay.service-CFbSU6Np.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-qNNPjc8Z.js → babylon-authoring-adapter-qU-GP8QL.js} +1 -1
- package/dist/assets/{binding-resolver-CGsJLZOI.js → binding-resolver-iMKdp_Dm.js} +2 -2
- package/dist/assets/blender-emscripten-engine-CieQeF-r.js +2 -0
- package/dist/assets/{blender-node-editor.document-BdR4Vvi3.js → blender-node-editor.document-BktVlaBT.js} +1 -1
- package/dist/assets/{blender-properties-tab-CCNa2VxG.js → blender-properties-tab-Bi7EkqZ4.js} +1 -1
- package/dist/assets/{blender-runtime-host-D_r3dBBg.js → blender-runtime-host-Bw37aE1K.js} +2 -2
- package/dist/assets/{blender-runtime-skin-CbrjFtVl.js → blender-runtime-skin-DGPSGVTB.js} +1 -1
- package/dist/assets/{blender-runtime.document-BeQ1ylTU.js → blender-runtime.document-DwlgMMor.js} +1 -1
- package/dist/assets/{blender-timeline.document-BQ6r2Eit.js → blender-timeline.document-BdKv86rL.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-CP9yR9fd.js → blender-uv-editor.document-B8KDPYF0.js} +1 -1
- package/dist/assets/{blender-version.status-Bu35OikW.js → blender-version.status-Tujyesw9.js} +1 -1
- package/dist/assets/blender-wali-engine-KWIxfB_o.js +2 -0
- package/dist/assets/{blender.command-ClhAHbhS.js → blender.command-0Er75bJF.js} +1 -1
- package/dist/assets/{board-guides-DUTllrm6.js → board-guides-BvzDdD2y.js} +1 -1
- package/dist/assets/{bridge.command-CFCb73nA.js → bridge.command-CRyms6ax.js} +3 -3
- package/dist/assets/{browserAll-CcEbt8pP.js → browserAll-DUlxC8yY.js} +1 -1
- package/dist/assets/{build-player.document-CHNcytS3.js → build-player.document-BuFNx_-Q.js} +1 -1
- package/dist/assets/{build-profiles.document-CfftHZEt.js → build-profiles.document-xu8oCc9h.js} +1 -1
- package/dist/assets/{build-progress.status-Ba7TtK8C.js → build-progress.status-BPDoYt8o.js} +1 -1
- package/dist/assets/{build-session-BVAVoaAo.js → build-session-BrAG7tBV.js} +1 -1
- package/dist/assets/{build.action-C4v62OGp.js → build.action-CCppyLBx.js} +1 -1
- package/dist/assets/{build.command-DiOf0gsd.js → build.command-Inptj7R-.js} +1 -1
- package/dist/assets/{build.header-Cc9F3_tw.js → build.header-DXGyFt56.js} +1 -1
- package/dist/assets/{build.menu-C6m7wAB0.js → build.menu-8VNdh6Kh.js} +1 -1
- package/dist/assets/{build.service-BD9CuqZ1.js → build.service-B98j6yu1.js} +1 -1
- package/dist/assets/{camera-QoF2qQn9.js → camera-PuR5cfKw.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-BPmJd9CX.js → camera-runtime.inspector-DuLoTNGH.js} +1 -1
- package/dist/assets/{canvas-design-mount-QoLQihbE.js → canvas-design-mount-DFvmQJTh.js} +3 -3
- package/dist/assets/{canvas-entry-runtime-cJsqLXEp.js → canvas-entry-runtime-BVnhMBaW.js} +2 -2
- package/dist/assets/{canvas-preview-frames-CxHRaajp.js → canvas-preview-frames-C-dFTVWu.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-DUSsBMnw.js → canvas-story-capture.service-Bg4fphDj.js} +2 -2
- package/dist/assets/{capability-coverage-DiBzUjdM.js → capability-coverage-B0oT2N3Z.js} +1 -1
- package/dist/assets/{collaboration-presence-Bj9ev5mU.js → collaboration-presence-CP5gEnxY.js} +1 -1
- package/dist/assets/{collider-CE-VI_rc.js → collider-DrfGXvUO.js} +1 -1
- package/dist/assets/{component-board.service-CzROar7A.js → component-board.service-CvEW_Te9.js} +2 -2
- package/dist/assets/{component-board.service-Bi8VA3L0.js → component-board.service-MhNc_Ru3.js} +2 -2
- package/dist/assets/{component-board.service-Hbl9EZl9.js → component-board.service-mzEFwa--.js} +2 -2
- package/dist/assets/{component-contracts.service-CCaAPGw2.js → component-contracts.service-zrpqDXgQ.js} +1 -1
- package/dist/assets/{component-instance-root-BZXekKMG.js → component-instance-root-BpMFxtbQ.js} +1 -1
- package/dist/assets/{component-verbs.command-Db0sUk65.js → component-verbs.command-8Kl0HNWX.js} +1 -1
- package/dist/assets/{component-verbs.service-DuEY_Ofq.js → component-verbs.service-CxZFYomt.js} +1 -1
- package/dist/assets/{config-DApMxCjE.js → config-BKyBW2FV.js} +2 -2
- package/dist/assets/{configurations-B4fNBX4_.js → configurations-B391DE84.js} +1 -1
- package/dist/assets/{connection.status-D7URFwNX.js → connection.status-CDK2Dxmh.js} +1 -1
- package/dist/assets/{constraints.inspector-C-rz7qm2.js → constraints.inspector-BvDktIDy.js} +1 -1
- package/dist/assets/{content-bounds-IMXYkN3x.js → content-bounds-BM2BJV41.js} +1 -1
- package/dist/assets/{contract-system-adapters-DAgN02qJ.js → contract-system-adapters-Dv5mUMr_.js} +1 -1
- package/dist/assets/{coverage.service-BWYLFkJZ.js → coverage.service-BLbBH9i2.js} +1 -1
- package/dist/assets/{create-runtime-B4VUkWmh.js → create-runtime-BvzMRqkg.js} +1 -1
- package/dist/assets/{curve-nsmv7c1I.js → curve-BbX4M8ka.js} +1 -1
- package/dist/assets/{data-asset-BQCPKu13.js → data-asset-DEfrCU5L.js} +1 -1
- package/dist/assets/{data-ref-CeTcnM3h.js → data-ref-CwypqVYb.js} +1 -1
- package/dist/assets/{debug-bridge-Cjo3HKqn.js → debug-bridge-B3ag_ARb.js} +1 -1
- package/dist/assets/{debug-registry-D4XNZdHk.js → debug-registry-DlrL6r1z.js} +1 -1
- package/dist/assets/{deferred-ingest-play-CrBHt1VV.js → deferred-ingest-play-tx7qVcg3.js} +2 -2
- package/dist/assets/{design-time-canvas-mount-Dzu7gMRL.js → design-time-canvas-mount-L1S8lY0u.js} +2 -2
- package/dist/assets/{design-time-layers-BJZJy_6E.js → design-time-layers-DxZgHWM2.js} +1 -1
- package/dist/assets/{design-time-mount.service-Bzs3PQ3q.js → design-time-mount.service-Bo9K8hZb.js} +2 -2
- package/dist/assets/{design-time-mount.service-BZMMh_B1.js → design-time-mount.service-DVYJJr4l.js} +2 -2
- package/dist/assets/{design-time-react-mount-C2ychNs2.js → design-time-react-mount-Cw_YU4iA.js} +1 -1
- package/dist/assets/{document-preview-three-BxNY0561.js → document-preview-three-BS7op9Kh.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-BZtIjxmP.js → dom-authoring-adapter-DeVD6HLk.js} +1 -1
- package/dist/assets/{draco3d-j0uDqveB.js → draco3d-_8eRv2Qk.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-cDUTJL37.js → edit-mode-audio.service-BO6CbCXN.js} +1 -1
- package/dist/assets/{edit-mode-authoring-BGGW26LN.js → edit-mode-authoring-RAf4S6PI.js} +1 -1
- package/dist/assets/{edit-mode-networking.service-DBB67UkE.js → edit-mode-networking.service-QiUNWbxh.js} +1 -1
- package/dist/assets/{editor-api-NUTZNRyn.js → editor-api-B_UrHHhL.js} +1 -1
- package/dist/assets/{editor-layers-BpAhxn0P.js → editor-layers-C47WUNtv.js} +1 -1
- package/dist/assets/{editor-shell-store-C04XLLU-.js → editor-shell-store-B-64vpgA.js} +1 -1
- package/dist/assets/{entity-object-DsAYI3gJ.js → entity-object-DBXB7ABG.js} +1 -1
- package/dist/assets/{extend-BvNGT6qQ.js → extend-hLINO4Zy.js} +1 -1
- package/dist/assets/{fork-menu-B3qakgix.js → fork-menu-BWis777M.js} +1 -1
- package/dist/assets/{frame-debugger-store-BQ7OaD2z.js → frame-debugger-store-CiuSELDU.js} +1 -1
- package/dist/assets/{game-contract-seams-Kcb8YGio.js → game-contract-seams-D4x_QFfy.js} +1 -1
- package/dist/assets/{game-css-scope-transform-CHdOIM_x.js → game-css-scope-transform-BFCy45PO.js} +1 -1
- package/dist/assets/{game-document.service-CAx5m7Ne.js → game-document.service-LgRTA5er.js} +1 -1
- package/dist/assets/{game-eval.command-CHg0bsCV.js → game-eval.command-i4tbTEzA.js} +1 -1
- package/dist/assets/{game-module-access-zqg58xYk.js → game-module-access-CmfN4vfG.js} +1 -1
- package/dist/assets/{game-network-C3D1ib_r.js → game-network-Bs_aLrfo.js} +3 -3
- package/dist/assets/{gameplay-export-DiUUF7OL.js → gameplay-export-DMycxmRI.js} +1 -1
- package/dist/assets/{gameplay-replay-BOpWtguL.js → gameplay-replay-CQwJHBcQ.js} +1 -1
- package/dist/assets/{gameplay.command-eG5IvOZD.js → gameplay.command-DwbIk4qS.js} +1 -1
- package/dist/assets/{generation-jobs-DCZm-7-c.js → generation-jobs-DHR06-Ow.js} +1 -1
- package/dist/assets/{generation.service-DcF_tuiA.js → generation.service-C3sjmS56.js} +1 -1
- package/dist/assets/{generations-Cij1e8K5.js → generations-QDWWr3sT.js} +1 -1
- package/dist/assets/{generations.status-D6Xkxwnu.js → generations.status-8UpzzSN6.js} +1 -1
- package/dist/assets/{hierarchy-marks-MeNgbwiP.js → hierarchy-marks-DDRF3quV.js} +1 -1
- package/dist/assets/{hosted-asset-materialization-PWF6teYQ.js → hosted-asset-materialization-DFetjs7r.js} +1 -1
- package/dist/assets/{index-BV0Qqo83.js → index-BlOoiZ_I.js} +1 -1
- package/dist/assets/{index-GyJvVDDT.js → index-CUyoEnie.js} +1 -1
- package/dist/assets/{index-C2Ir9SpE.js → index-Cdjg29qG.js} +1 -1
- package/dist/assets/{index-DvO8W-nn.js → index-CkpBXMDJ.js} +1 -1
- package/dist/assets/{index-s_IF6Bxe.js → index-DGgVCKlK.js} +1 -1
- package/dist/assets/{index-i3_nCWlL.js → index-DL3yQMTk.js} +2 -2
- package/dist/assets/{index-BFwx6NRh.js → index-DZg4GXi0.js} +1 -1
- package/dist/assets/{index-2B6cj0iP.js → index-DxV6Akny.js} +1 -1
- package/dist/assets/{index-GOaZz_UJ.js → index-JjEYIC4G.js} +7 -7
- package/dist/assets/{inference-diagnostics-DH6OpJZI.js → inference-diagnostics-kHRsQw1P.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-BnE3u7YT.js → ingest-boot-viewport-BO7yl504.js} +1 -1
- package/dist/assets/{ingest-siblings-B_5SsNEz.js → ingest-siblings-C-RhYsUb.js} +1 -1
- package/dist/assets/{ingest-source-persistence-DM9T5S4m.js → ingest-source-persistence-B52PvpPx.js} +1 -1
- package/dist/assets/{ingest.service-COWbKrQI.js → ingest.service-CXx-aW-5.js} +1 -1
- package/dist/assets/{inspect-CD61yjth.js → inspect-KwcXV5-u.js} +1 -1
- package/dist/assets/instances.command--PqjYvLl.js +1 -0
- package/dist/assets/{json-history-resource-Cby5jKsw.js → json-history-resource-B0kkSep8.js} +1 -1
- package/dist/assets/{layered-pick-B3AjYd-G.js → layered-pick-ClYksj6v.js} +1 -1
- package/dist/assets/{light-B7BXFfR-.js → light-C33qOzVd.js} +1 -1
- package/dist/assets/{live-project-verbs-DR_q7RK-.js → live-project-verbs-CIlCfET4.js} +1 -1
- package/dist/assets/{machine.document-DPYrwmW6.js → machine.document-KKGimt_o.js} +1 -1
- package/dist/assets/{machines.finder-CwpvHTlH.js → machines.finder-DA-qVsE-.js} +1 -1
- package/dist/assets/{material-XjlLI_f7.js → material-BPlHfj-y.js} +1 -1
- package/dist/assets/{material-factory-CsiepVqC.js → material-factory-DIU9do_v.js} +1 -1
- package/dist/assets/{mesh-2zwQAuCC.js → mesh-D3gE3KD_.js} +1 -1
- package/dist/assets/{model-asset-sections.service-9-sm-NaU.js → model-asset-sections.service-HoRKwaP6.js} +1 -1
- package/dist/assets/{model-inspection-B0GymTL8.js → model-inspection-BMy0MuzJ.js} +1 -1
- package/dist/assets/{model-thumbnail-C6xWKVgL.js → model-thumbnail-ICdHSiW1.js} +1 -1
- package/dist/assets/{models.finder-4xaZ_CWd.js → models.finder-DvULfruZ.js} +1 -1
- package/dist/assets/{module-mode-QCybxWRW.js → module-mode-BTXto0oj.js} +2 -2
- package/dist/assets/{mount-canvas-ingest-root-C4nQ82CG.js → mount-canvas-ingest-root-BFQfgTuE.js} +2 -2
- package/dist/assets/{mount-dom-ingest-root-CyJlqUpj.js → mount-dom-ingest-root-C4Deoodh.js} +2 -2
- package/dist/assets/{mount-ingest-root-C8dDNkUg.js → mount-ingest-root-BnX5FYpQ.js} +2 -2
- package/dist/assets/{mount-manifest-z3xK0qgx.js → mount-manifest-CK1RiS8E.js} +1 -1
- package/dist/assets/{mount-three-ingest-root-CHZLDOUt.js → mount-three-ingest-root-C6pYTH-h.js} +1 -1
- package/dist/assets/{mounted-authoring-CZw66UYV.js → mounted-authoring-BRmJcses.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-DP4yrSoT.js → mounted-story-viewport-source-DghPnLY9.js} +1 -1
- package/dist/assets/{native-debug-module-qMZlzFCw.js → native-debug-module-ojTkP52T.js} +1 -1
- package/dist/assets/{navigation-BneGZzZt.js → navigation-CTZYysxE.js} +1 -1
- package/dist/assets/{navmesh.menu-Bh4FuG-U.js → navmesh.menu-COJ77FTK.js} +1 -1
- package/dist/assets/{navmesh.service-BB71x7KW.js → navmesh.service-tVf8xf8f.js} +1 -1
- package/dist/assets/network-observer.service-DZtz0Y5F.js +1 -0
- package/dist/assets/{network.utility-DBva0eo8.js → network.utility-DNmrBkHK.js} +1 -1
- package/dist/assets/{object3d-document-session-registry-q7c_gezv.js → object3d-document-session-registry-CIdYrDwO.js} +2 -2
- package/dist/assets/{oid-transform-tKqLhlWg.js → oid-transform-BMGB2u8Z.js} +1 -1
- package/dist/assets/{particles-gUgFtSRY.js → particles-CmcHZZqz.js} +1 -1
- package/dist/assets/{pixi-authoring-adapter-Cd5O2LTH.js → pixi-authoring-adapter-BLptyAwL.js} +1 -1
- package/dist/assets/{pixi-live-write-target-DHzgc22z.js → pixi-live-write-target-DMGlsQdL.js} +1 -1
- package/dist/assets/{play.command-BxgvkWfL.js → play.command-D0aUzhnI.js} +2 -2
- package/dist/assets/{presentation-C5hzwpZR.js → presentation-BOKcaCle.js} +1 -1
- package/dist/assets/{product-CKGKSgsU.js → product-DBhE7XzM.js} +1 -1
- package/dist/assets/{profiler.action-S08Up0JS.js → profiler.action-DFPR0GaW.js} +1 -1
- package/dist/assets/{profiler.menu-Dy4i7lwO.js → profiler.menu-Cjq4IMjK.js} +1 -1
- package/dist/assets/{profiler.utility-CC8CJLy8.js → profiler.utility-O_BbyzQ6.js} +1 -1
- package/dist/assets/{project-authoring-session-BXLqBDUm.js → project-authoring-session-Fg6BVKiU.js} +2 -2
- package/dist/assets/{properties-bone-constraints.inspector-BX2GxZq2.js → properties-bone-constraints.inspector-Df8r9rGo.js} +1 -1
- package/dist/assets/{properties-bone.inspector-CCLVVUtG.js → properties-bone.inspector-BHOmG-w_.js} +1 -1
- package/dist/assets/{properties-collection.inspector-CKbzSvCC.js → properties-collection.inspector-COUpmMSs.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-DV1P6hUd.js → properties-constraints.inspector-DSDh4Uba.js} +1 -1
- package/dist/assets/{properties-data.inspector-BMaGtE_w.js → properties-data.inspector-DjjFOVxW.js} +1 -1
- package/dist/assets/{properties-material.inspector-BtesjppG.js → properties-material.inspector-DPKY8b2v.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-MiHOsiuf.js → properties-modifiers.inspector-BtNVTrKN.js} +1 -1
- package/dist/assets/{properties-object.inspector-Ct8masbP.js → properties-object.inspector-DYNpha7x.js} +1 -1
- package/dist/assets/{properties-output.inspector-CVNr0tSt.js → properties-output.inspector-CBzwfSQQ.js} +1 -1
- package/dist/assets/{properties-particles.inspector-EMFa11PY.js → properties-particles.inspector-5DlYLg0u.js} +1 -1
- package/dist/assets/{properties-physics.inspector-CACxDEwm.js → properties-physics.inspector-D__Z169g.js} +1 -1
- package/dist/assets/{properties-render.inspector-CtijIdsj.js → properties-render.inspector-Dvnehd8j.js} +1 -1
- package/dist/assets/{properties-scene.inspector-oEdDyqg4.js → properties-scene.inspector-DxGBiL_G.js} +1 -1
- package/dist/assets/{properties-texture.inspector-C_gpMJPm.js → properties-texture.inspector-5qsUhAvc.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-iXXhbErN.js → properties-view-layer.inspector-BHv0B73V.js} +1 -1
- package/dist/assets/{properties-world.inspector-BTG_6enJ.js → properties-world.inspector-D53Cc2Fs.js} +1 -1
- package/dist/assets/{r3f-design-session-BpFmOBy3.js → r3f-design-session-BhddL1e6.js} +2 -2
- package/dist/assets/{r3f-physics-binding-Dc4KkqeK.js → r3f-physics-binding-D41qQnHD.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-Bqqwlt5P.js → r3f-source-authoring-adapter-ZnrWHj5Z.js} +1 -1
- package/dist/assets/{react-canvas-navigation-CHqEpva-.js → react-canvas-navigation-DFspvY8K.js} +1 -1
- package/dist/assets/{react-inspector.service-BofSBcrA.js → react-inspector.service-Co5AHjHR.js} +1 -1
- package/dist/assets/{react-story-board-DA2YLI8m.js → react-story-board--jvx8x-C.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-CQZa_73g.js → react-three-rapier.esm-BS-6eWKp.js} +1 -1
- package/dist/assets/{react-world-authoring-adapter-4sStON8E.js → react-world-authoring-adapter-CKQ-MAMv.js} +1 -1
- package/dist/assets/{realm-services-DbZYHQSf.js → realm-services-DUEIrJNn.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-DNvA6bnY.js → reflection-probe-capture.inspector-gO0DwTZj.js} +1 -1
- package/dist/assets/{registry-DBlUxvdQ.js → registry-ofLrf5fa.js} +1 -1
- package/dist/assets/{relative-import-specifier-B0yhWWcj.js → relative-import-specifier-B_Awfdrr.js} +1 -1
- package/dist/assets/{render-env-DdFrpGB_.js → render-env-a1pPDP-U.js} +1 -1
- package/dist/assets/{render-features-B35P-in2.js → render-features-CY3KFNVc.js} +1 -1
- package/dist/assets/{render-settings-C81L61oc.js → render-settings-DgCYPHgH.js} +1 -1
- package/dist/assets/{resolve-three-CM8Cg4vF.js → resolve-three-fhgJb0Jd.js} +3 -3
- package/dist/assets/{root-seam-contract-BUz-MUf1.js → root-seam-contract-D3r4vEIL.js} +1 -1
- package/dist/assets/{run-selection-BdiLPzVf.js → run-selection-DVvs9B9T.js} +1 -1
- package/dist/assets/{scene-capture-Diz1G192.js → scene-capture-CCy--ncb.js} +1 -1
- package/dist/assets/{scene-document.service-DfXZsaKM.js → scene-document.service-BCliVABQ.js} +2 -2
- package/dist/assets/{scene-framing-B5dto0bO.js → scene-framing-B1butaCp.js} +1 -1
- package/dist/assets/{seeded-random-WDTtjPze.js → seeded-random-J_tZuhc3.js} +1 -1
- package/dist/assets/{session-CeyQA0Dv.js → session-BMie6EFt.js} +19 -2
- package/dist/assets/{setup-renderer-D9SD_Wht.js → setup-renderer-DroW21zu.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-D6uGhge2.js → source-object3d-authoring-adapter-Bansi23s.js} +1 -1
- package/dist/assets/{source-persistence-backend-CxVBXGoQ.js → source-persistence-backend-B7_XGPrd.js} +1 -1
- package/dist/assets/{stage-keyboard-BPb1swaM.js → stage-keyboard-Cj5wm_J_.js} +1 -1
- package/dist/assets/{stage-overlay-set-DRa6xB93.js → stage-overlay-set-CddoR5WV.js} +1 -1
- package/dist/assets/{stage-presence-markers-CGxHoE5g.js → stage-presence-markers-B7ikfK7I.js} +1 -1
- package/dist/assets/{stage-transform-tools-CQuG66LW.js → stage-transform-tools-C9-7W51Q.js} +1 -1
- package/dist/assets/{standard-viewport-dressing-D4bfoK0I.js → standard-viewport-dressing-BYqJ1RDj.js} +1 -1
- package/dist/assets/{state-watch.action-DPVKmPwL.js → state-watch.action-Ckl-KiOu.js} +1 -1
- package/dist/assets/{state-watch.menu-DpISV21j.js → state-watch.menu-Bua5sNDD.js} +1 -1
- package/dist/assets/{state-watch.utility-DwKoTnVp.js → state-watch.utility-LIkpnIYo.js} +1 -1
- package/dist/assets/{story-capture-Bzwbk_mv.js → story-capture-DRezN8hO.js} +1 -1
- package/dist/assets/{story-documents-De1zQ6Qz.js → story-documents-QsOjjFN1.js} +1 -1
- package/dist/assets/{story-documents.service-8XTTuO7s.js → story-documents.service-BBcpnJqG.js} +1 -1
- package/dist/assets/{story-documents.service-6eOlV6NP.js → story-documents.service-s45WvtSH.js} +1 -1
- package/dist/assets/{story-media-presence-DpEeszWv.js → story-media-presence-D3jBkjoV.js} +1 -1
- package/dist/assets/{story-pixi-preview-BEyaPLy0.js → story-pixi-preview-DR9Z3mjx.js} +1 -1
- package/dist/assets/{story-presentation-CjTxyaxs.js → story-presentation-BanrEcxs.js} +1 -1
- package/dist/assets/{story-three-preview-abAavxSh.js → story-three-preview-Cc12jMw-.js} +2 -2
- package/dist/assets/{studio-environment-BiC6OVkT.js → studio-environment-D3HaysRE.js} +1 -1
- package/dist/assets/{surface-state-CUfqJeMb.js → surface-state-DgY1sYF4.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-DTioDasF.js → syntactic-prop-specs-CBGAFjrQ.js} +1 -1
- package/dist/assets/{team-playtest.service-GRj4yKy4.js → team-playtest.service-z2r_7CUE.js} +1 -1
- package/dist/assets/{three-CQcV_QdT.js → three-CqcAlmZt.js} +1 -1
- package/dist/assets/{three-authoring-adapter-D3qfWIRk.js → three-authoring-adapter-D-dP-DRa.js} +1 -1
- package/dist/assets/three-authoring.service-BPzGC8dd.js +2 -0
- package/dist/assets/{three-ingest-runtime-E3dJH9KF.js → three-ingest-runtime-BOYUnvJa.js} +1 -1
- package/dist/assets/{three-integration-BjEyDiTB.js → three-integration-BKGFte0g.js} +2 -2
- package/dist/assets/three-integration.service-InYYMues.js +1 -0
- package/dist/assets/{three-projection-core-CkmVzWhv.js → three-projection-core-CMYaSPZP.js} +1 -1
- package/dist/assets/{three-state-CzjS3Z7g.js → three-state-Bs6NttX2.js} +1 -1
- package/dist/assets/{three-story-capture.service-D-1pij9x.js → three-story-capture.service-CV7CaGFK.js} +2 -2
- package/dist/assets/{three-story-model-B1sz0NKf.js → three-story-model-DMsHWVLi.js} +1 -1
- package/dist/assets/{three-viewport-presentation-OxBEdgIP.js → three-viewport-presentation-D8F-c141.js} +1 -1
- package/dist/assets/{transform-mode-request-DO67Jvcm.js → transform-mode-request-nAOkjL7J.js} +1 -1
- package/dist/assets/{transport-strip-D55r6FTk.js → transport-strip-Do5Y5zz_.js} +1 -1
- package/dist/assets/transport.header-BhBKpJ9P.js +1 -0
- package/dist/assets/{tuples-CJ18T3dX.js → tuples-T3njUS_v.js} +1 -1
- package/dist/assets/{ui-board-document-DEx342dp.js → ui-board-document-Dix9rYE-.js} +2 -2
- package/dist/assets/{user-data-BDBZj06-.js → user-data-DcUoY-0j.js} +1 -1
- package/dist/assets/{utility-view-state-B7prGtP-.js → utility-view-state-BUR2tvAo.js} +1 -1
- package/dist/assets/{viewport-door-Slxb_SvE.js → viewport-door-Ct3Jwvkd.js} +1 -1
- package/dist/assets/{viewport-root-presentation-B6vzusDX.js → viewport-root-presentation-CM-p4xLg.js} +1 -1
- package/dist/assets/{viewport-surface-status-C4UZ_Uq4.js → viewport-surface-status-BlPwrnIq.js} +1 -1
- package/dist/assets/{webworkerAll-DO15AziI.js → webworkerAll-BbcMGhdJ.js} +1 -1
- package/dist/assets/worker-Gtu-EAm9.js +2 -0
- package/dist/assets/{workspace-arrangement-BjHQJUoD.js → workspace-arrangement-D7VBwv9F.js} +1 -1
- package/dist/assets/{world-documents-CuBxaDZx.js → world-documents-g6lvzHMh.js} +1 -1
- package/dist/assets/{world-root-stage-binding-Bn0b7XsL.js → world-root-stage-binding-DugyiNfT.js} +1 -1
- package/dist/assets/{xstate-animation-binding-I-GEhYkk.js → xstate-animation-binding-Qdxeavj_.js} +1 -1
- package/dist/assets/{xstate-animation-meta-Io__GNze.js → xstate-animation-meta-CtUROKFq.js} +1 -1
- package/dist-node/cli.js +18 -18
- package/dist-node/create.js +1 -1
- package/package.json +17 -17
- package/template/.volter/tracker/validation/.preset.base.mts +3 -3
- package/template/.volter/tracker/validation/preset.mts +3 -3
- package/template/.volter/tracker/visualizer/.extension.base.tsx +2 -2
- package/template/.volter/tracker/visualizer/extension.tsx +2 -2
- package/template/package.json +1 -1
- package/dist/assets/InspectorObjectPreview-BvYcwQTS.js +0 -1
- package/dist/assets/Object3DDocumentViewport-DcX529Vg.js +0 -2
- package/dist/assets/autoplay.service-CclAhFII.js +0 -1
- package/dist/assets/blender-emscripten-engine-Cd6az4pU.js +0 -2
- package/dist/assets/blender-wali-engine-CZcS3eAd.js +0 -2
- package/dist/assets/instances.command-CxgGOKUm.js +0 -1
- package/dist/assets/network-observer.service-BKOQ_E--.js +0 -1
- package/dist/assets/three-authoring.service-C2oNRt7a.js +0 -2
- package/dist/assets/three-integration.service-n5uKl57k.js +0 -1
- package/dist/assets/transport.header-hkELPlfF.js +0 -1
- package/dist/assets/worker-jepHAPPr.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-three-preview-
|
|
2
|
-
import{fo as i,_ as n,fp as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-three-preview-Cc12jMw-.js","assets/index-JjEYIC4G.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/asset-preview-J56EM7ai.js","assets/editor-layers-C47WUNtv.js","assets/workspace-arrangement-D7VBwv9F.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-DDRF3quV.js","assets/studio-environment-D3HaysRE.js","assets/user-data-DcUoY-0j.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/crash-null-boundary-v3a0uEgw.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/story-mount-turn-DFRTj5hi.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{fo as i,_ as n,fp as a}from"./index-JjEYIC4G.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function s(){return typeof WebGLRenderingContext<"u"&&typeof navigator<"u"&&!navigator.userAgent.toLowerCase().includes("jsdom")}function p(){return s()?i("three",async(e,o)=>{const t=await n(()=>import("./story-three-preview-Cc12jMw-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));try{return await t.captureStoryComponentThumbnail(e,o)}catch(r){throw t.isStoryThreeClassificationRefusal(r)?new a("This story is not a three.js story."):r}}):()=>{}}const C="workspace.service";function T(){return p()}export{C as point,T as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as d,aq as a,ap as m}from"./index-
|
|
1
|
+
import{ao as d,aq as a,ap as m}from"./index-JjEYIC4G.js";function u(o){return o.children.length>0}function c(o){const n=m(),t=[];for(const e of o){const r=d({modulePath:e.modulePath,regions:n});if(r.medium==="dom"){t.push(e);continue}r.via==="undeclared"&&e.modulePath&&a(e.modulePath,r.reason)}return t}export{c as d,u as m};
|
|
@@ -1,5 +1,5 @@
|
|
|
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{kH as Oi,kO as ht,lb as De,lc as Re,ld as je,kG as ki,le as Di,lf as Fe,cB as Ri,lg as Z,eU as Lt,d4 as V,O as It,lh as te,aB as ji,fw as Fi,dG as Gi,kJ as Ge,kK as Be,kL as Ve,c_ as We,af as Ot,li as Bi,lj as Vi,lk as Xe,jL as Ne,dI as Wi,_ as Xi}from"./index-GOaZz_UJ.js";import{a as Ni,i as st}from"./standard-viewport-dressing-D4bfoK0I.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as Ye,a as qe,f as Yi}from"./clip-planes-CnAI6DZn.js";import{b as qi,a as Vt,C as Qe,e as Qi,d as Zi}from"./content-bounds-IMXYkN3x.js";import{EDITOR_LAYER as P,isInEditorOwnedSubtree as J,EDITOR_SELECTION_LAYER as _e,isEditorOwnedObject as Ui}from"./editor-layers-BpAhxn0P.js";import{e as ge,r as Wt,f as Ze}from"./three-CQcV_QdT.js";import{g as tt,s as W}from"./user-data-BDBZj06-.js";import{d as Ki,s as $i,a as Ji}from"./model-thumbnail-C6xWKVgL.js";import{d as Ue,e as ts}from"./model-inspection-B0GymTL8.js";import{OrbitControls as es}from"./OrbitControls-B13MKuwC.js";import"./three.module-BLhyNg0e.js";import{a8 as is,fo as p,dp as L,e6 as nt,cW as qt,cp as R,bX as lt,aq as O,K as I,N as mt,a$ as Mt,co as y,cZ as at,bV as Y,e$ as yt,ey as U,aV as bi,cm as ft,db as xi,aI as Qt,bh as K,eV as ss,_ as C,cj as j,aO as Si,c0 as Zt,b_ as Ci,I as xt,cP as os,c8 as ns,e as rs,ap as as,A as ls,c7 as Ee,b$ as cs,da as Ke,fd as et,el as hs,d9 as ds,d5 as $e,j as ps,aE as us,eg as fs,cg as dt,fA as ms,aF as _s,de as gs,eD as ys,bk as vs,S as ws,ex as bs,a5 as xs,ej as it,eE as Je,eF as ti,em as Ss,T as Mi,c1 as Ai}from"./three.core-3arARmh6.js";import{L as ye,a as ve,b as we}from"./LineSegments2-DN9pUfWA.js";import{B as Cs}from"./three.quarks.esm-C_HmSKXo.js";import{b as Ms,e as As}from"./live-gesture-lock-DJbrjOqf.js";import{f as Ps}from"./editor-shell-store-C04XLLU-.js";import{a as Hs,e as Es}from"./entity-object-DsAYI3gJ.js";import{e as Ts,v as kt,i as zs,d as Ls}from"./three-integration-BjEyDiTB.js";import{f as ei,v as Is,s as Os}from"./scene-framing-B5dto0bO.js";import{a as ks}from"./live-mixers-B-bwLZ7c.js";function be(c){const t=tt(c,"triggerVolume");if(!t||typeof t!="object")return null;const{radius:e}=t;return typeof e=="number"&&Number.isFinite(e)&&e>0?{radius:e}:null}const ot=new nt,k=new p,$=new p,T=new L,ii={X:new p(1,0,0),Y:new p(0,1,0),Z:new p(0,0,1)},ee={type:"change"},si={type:"mouseDown",mode:null},oi={type:"mouseUp",mode:null},ni={type:"objectChange"};class ie extends is{constructor(t,e=null){super(void 0,e);const i=new Bs(this);this._root=i;const s=new Vs;this._gizmo=s,i.add(s);const o=new Ws;this._plane=o,i.add(o);const n=this;function r(w,S){let z=S;Object.defineProperty(n,w,{get:function(){return z!==void 0?z:S},set:function(x){z!==x&&(z=x,o[w]=x,s[w]=x,n.dispatchEvent({type:w+"-changed",value:x}),n.dispatchEvent(ee))}}),n[w]=S,o[w]=S,s[w]=S}r("camera",t),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const l=new p,a=new p,h=new L,d=new L,f=new p,u=new L,m=new p,_=new p,g=new p,v=0,b=new p;r("worldPosition",l),r("worldPositionStart",a),r("worldQuaternion",h),r("worldQuaternionStart",d),r("cameraPosition",f),r("cameraQuaternion",u),r("pointStart",m),r("pointEnd",_),r("rotationAxis",g),r("rotationAngle",v),r("eye",b),this._offset=new p,this._startNorm=new p,this._endNorm=new p,this._cameraScale=new p,this._parentPosition=new p,this._parentQuaternion=new L,this._parentQuaternionInv=new L,this._parentScale=new p,this._worldScaleStart=new p,this._worldQuaternionInv=new L,this._worldScale=new p,this._positionStart=new p,this._quaternionStart=new L,this._scaleStart=new p,this._getPointer=Ds.bind(this),this._onPointerDown=js.bind(this),this._onPointerHover=Rs.bind(this),this._onPointerMove=Fs.bind(this),this._onPointerUp=Gs.bind(this),e!==null&&this.connect(e)}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._gizmo.picker[this.mode],ot);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._plane,ot,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,si.mode=this.mode,this.dispatchEvent(si)}}pointerMove(t){const e=this.axis,i=this.mode,s=this.object;let o=this.space;if(i==="scale"?o="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(o="world"),s===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&ot.setFromCamera(t,this.camera);const n=se(this._plane,ot,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(s.position.applyQuaternion(T.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),o==="world"&&(s.parent&&s.position.add(k.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(k.setFromMatrixPosition(s.parent.matrixWorld)))),s.position.x=Math.max(this.minX,Math.min(this.maxX,s.position.x)),s.position.y=Math.max(this.minY,Math.min(this.maxY,s.position.y)),s.position.z=Math.max(this.minZ,Math.min(this.maxZ,s.position.z));else if(i==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),$.set(r,r,r)}else k.copy(this.pointStart),$.copy(this.pointEnd),k.applyQuaternion(this._worldQuaternionInv),$.applyQuaternion(this._worldQuaternionInv),$.divide(k),e.search("X")===-1&&($.x=1),e.search("Y")===-1&&($.y=1),e.search("Z")===-1&&($.z=1);s.scale.copy(this._scaleStart).multiply($),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(k.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(k.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(ii[e]),k.copy(ii[e]),o==="local"&&k.applyQuaternion(this.worldQuaternion),k.cross(this.eye),k.length()===0?l=!0:this.rotationAngle=this._offset.dot(k.normalize())*r),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(ee),this.dispatchEvent(ni)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(oi.mode=this.mode,this.dispatchEvent(oi)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(ee),this.dispatchEvent(ni),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ot}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}setColors(t,e,i,s){const o=this._gizmo.materialLib;o.xAxis.color.set(t),o.yAxis.color.set(e),o.zAxis.color.set(i),o.active.color.set(s),o.xAxisTransparent.color.set(t),o.yAxisTransparent.color.set(e),o.zAxisTransparent.color.set(i),o.activeTransparent.color.set(s),o.xAxis._color&&o.xAxis._color.set(t),o.yAxis._color&&o.yAxis._color.set(e),o.zAxis._color&&o.zAxis._color.set(i),o.active._color&&o.active._color.set(s),o.xAxisTransparent._color&&o.xAxisTransparent._color.set(t),o.yAxisTransparent._color&&o.yAxisTransparent._color.set(e),o.zAxisTransparent._color&&o.zAxisTransparent._color.set(i),o.activeTransparent._color&&o.activeTransparent._color.set(s)}}function Ds(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Rs(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function js(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function Fs(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Gs(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function se(c,t,e){const i=t.intersectObject(c,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||e)return i[s];return!1}const Dt=new bi,H=new p(0,1,0),ri=new p(0,0,0),ai=new ft,Rt=new L,Xt=new L,N=new p,li=new ft,St=new p(1,0,0),rt=new p(0,1,0),Ct=new p(0,0,1),jt=new p,vt=new p,wt=new p;class Bs extends qt{constructor(t){super(),this.isTransformControlsRoot=!0,this.controls=t,this.visible=!1}updateMatrixWorld(t){const e=this.controls;e.object!==void 0&&(e.object.updateMatrixWorld(),e.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):e.object.parent.matrixWorld.decompose(e._parentPosition,e._parentQuaternion,e._parentScale),e.object.matrixWorld.decompose(e.worldPosition,e.worldQuaternion,e._worldScale),e._parentQuaternionInv.copy(e._parentQuaternion).invert(),e._worldQuaternionInv.copy(e.worldQuaternion).invert()),e.camera.updateMatrixWorld(),e.camera.matrixWorld.decompose(e.cameraPosition,e.cameraQuaternion,e._cameraScale),e.camera.isOrthographicCamera?e.camera.getWorldDirection(e.eye).negate():e.eye.copy(e.cameraPosition).sub(e.worldPosition).normalize(),super.updateMatrixWorld(t)}dispose(){this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}}class Vs extends qt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const t=new R({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new lt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=t.clone();i.opacity=.15;const s=e.clone();s.opacity=.5;const o=t.clone();o.color.setHex(16711680);const n=t.clone();n.color.setHex(65280);const r=t.clone();r.color.setHex(255);const l=t.clone();l.color.setHex(16711680),l.opacity=.5;const a=t.clone();a.color.setHex(65280),a.opacity=.5;const h=t.clone();h.color.setHex(255),h.opacity=.5;const d=t.clone();d.opacity=.25;const f=t.clone();f.color.setHex(16776960),f.opacity=.25;const u=t.clone();u.color.setHex(16776960);const m=t.clone();m.color.setHex(7895160),this.materialLib={xAxis:o,yAxis:n,zAxis:r,active:u,xAxisTransparent:l,yAxisTransparent:a,zAxisTransparent:h,activeTransparent:f};const _=new O(0,.04,.1,12);_.translate(0,.05,0);const g=new I(.08,.08,.08);g.translate(0,.04,0);const v=new mt;v.setAttribute("position",new Mt([0,0,0,1,0,0],3));const b=new O(.0075,.0075,.5,3);b.translate(0,.25,0);function w(F,Ht){const B=new yt(F,.0075,3,64,Ht*Math.PI*2);return B.rotateY(Math.PI/2),B.rotateX(Math.PI/2),B}function S(){const F=new mt;return F.setAttribute("position",new Mt([0,0,0,1,1,1],3)),F}const z={X:[[new y(_,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(_,o),[-.5,0,0],[0,0,Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new y(_,n),[0,.5,0]],[new y(_,n),[0,-.5,0],[Math.PI,0,0]],[new y(b,n)]],Z:[[new y(_,r),[0,0,.5],[Math.PI/2,0,0]],[new y(_,r),[0,0,-.5],[-Math.PI/2,0,0]],[new y(b,r),null,[Math.PI/2,0,0]]],XYZ:[[new y(new at(.1,0),d),[0,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new y(new at(.2,0),i)]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},A={START:[[new y(new at(.01,2),s),null,null,null,"helper"]],END:[[new y(new at(.01,2),s),null,null,null,"helper"]],DELTA:[[new Y(S(),s),null,null,null,"helper"]],X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new y(w(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new y(w(.5,.5),o)]],Y:[[new y(w(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new y(w(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new y(w(.75,1),f),null,[0,Math.PI/2,0]]]},E={AXIS:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]]},G={XYZE:[[new y(new U(.25,10,8),i)]],X:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new y(new yt(.75,.1,2,24),i)]]},$t={X:[[new y(g,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]],[new y(g,o),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new y(g,n),[0,.5,0]],[new y(b,n)],[new y(g,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new y(g,r),[0,0,.5],[Math.PI/2,0,0]],[new y(b,r),[0,0,0],[Math.PI/2,0,0]],[new y(g,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.1,.1,.1),d)]]},Pt={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.2,.2,.2),i),[0,0,0]]]},Jt={X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Q(F){const Ht=new qt;for(const B in F)for(let ct=F[B].length;ct--;){const D=F[B][ct][0].clone(),Et=F[B][ct][1],Tt=F[B][ct][2],zt=F[B][ct][3],Ii=F[B][ct][4];D.name=B,D.tag=Ii,Et&&D.position.set(Et[0],Et[1],Et[2]),Tt&&D.rotation.set(Tt[0],Tt[1],Tt[2]),zt&&D.scale.set(zt[0],zt[1],zt[2]),D.updateMatrix();const ke=D.geometry.clone();ke.applyMatrix4(D.matrix),D.geometry=ke,D.renderOrder=1/0,D.position.set(0,0,0),D.rotation.set(0,0,0),D.scale.set(1,1,1),Ht.add(D)}return Ht}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Q(z)),this.add(this.gizmo.rotate=Q(M)),this.add(this.gizmo.scale=Q($t)),this.add(this.picker.translate=Q(x)),this.add(this.picker.rotate=Q(G)),this.add(this.picker.scale=Q(Pt)),this.add(this.helper.translate=Q(A)),this.add(this.helper.rotate=Q(E)),this.add(this.helper.scale=Q(Jt)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const i=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Xt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let o=0;o<s.length;o++){const n=s[o];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(r*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(T.setFromEuler(Dt.set(0,0,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(T.setFromEuler(Dt.set(0,0,Math.PI/2)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(ai.lookAt(ri,H,rt)),n.quaternion.multiply(T),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),k.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),k.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(k),n.visible=this.dragging):(n.quaternion.copy(i),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Rt.copy(i),H.copy(this.eye).applyQuaternion(T.copy(i).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(ai.lookAt(this.eye,ri,rt)),n.name==="X"&&(T.setFromAxisAngle(St,Math.atan2(-H.y,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Y"&&(T.setFromAxisAngle(rt,Math.atan2(H.x,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Z"&&(T.setFromAxisAngle(Ct,Math.atan2(H.y,H.x)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis?(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1):this.axis.split("").some(function(l){return n.name===l})&&(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1))}super.updateMatrixWorld(t)}}class Ws extends y{constructor(){super(new xi(1e5,1e5,2,2),new R({visible:!1,wireframe:!0,side:Qt,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),jt.copy(St).applyQuaternion(e==="local"?this.worldQuaternion:Xt),vt.copy(rt).applyQuaternion(e==="local"?this.worldQuaternion:Xt),wt.copy(Ct).applyQuaternion(e==="local"?this.worldQuaternion:Xt),H.copy(vt),this.mode){case"translate":case"scale":switch(this.axis){case"X":H.copy(this.eye).cross(jt),N.copy(jt).cross(H);break;case"Y":H.copy(this.eye).cross(vt),N.copy(vt).cross(H);break;case"Z":H.copy(this.eye).cross(wt),N.copy(wt).cross(H);break;case"XY":N.copy(wt);break;case"YZ":N.copy(jt);break;case"XZ":H.copy(wt),N.copy(vt);break;case"XYZ":case"E":N.set(0,0,0);break}break;case"rotate":default:N.set(0,0,0)}N.length()===0?this.quaternion.copy(this.cameraQuaternion):(li.lookAt(k.set(0,0,0),N,H),this.quaternion.setFromRotationMatrix(li)),super.updateMatrixWorld(t)}}const oe=new C(4441855),Ft=new C(16758858),Gt=new C(14185983),Xs=new C(16731496),ci=new C(16777215);function ne(c){return new Y(new mt,new lt({color:c,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function re(c,t){return new y(c,new R({color:t,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function ae(c,t){if(c.visible=t.length>1,!c.visible)return;let e=c.geometry.getAttribute("position");(!e||e.count!==t.length)&&(e=new Mt(t.length*3,3),c.geometry.setAttribute("position",e));for(let i=0;i<t.length;i++)e.setXYZ(i,t[i].x,t[i].y,t[i].z);e.needsUpdate=!0,c.geometry.computeBoundingSphere()}class Ns extends K{constructor(t){super(),this.source=t,this.name="Constraint Helper",this.renderOrder=999,W(this,"editorHelper",!0),W(this,"editorHelperType","constraints"),this.layers.set(P),this.refreshStructure()}selected=!1;hoveredControl=null;selectedObjects=new Set;visuals=[];setSelected(t){this.selected=t}setSelectedObjects(t){this.selectedObjects=t}controlMeshes(){return this.visuals.flatMap(t=>[t.targetHit,t.poleHit].filter(e=>e.visible))}presents(t){return t===this.source?!0:this.visuals.some(e=>{const i=e.mark.getSnapshot();return t===i.target||t===i.pole})}controlFor(t){for(const e of this.visuals){const i=e.mark.getSnapshot();if((t===e.target||t===e.targetHit)&&i.target)return{kind:"target",label:i.target.name||`${e.mark.config.label} target`,object:i.target,mesh:e.target};if((t===e.pole||t===e.poleHit)&&i.pole)return{kind:"pole",label:i.pole.name||`${e.mark.config.label} pole`,object:i.pole,mesh:e.pole}}return null}setHoveredControl(t){this.hoveredControl=t}update(t){this.refreshStructure();for(const e of this.visuals)this.updateVisual(e,t)}dispose(){this.clearVisuals(),this.removeFromParent()}refreshStructure(){const t=ge(this.source);t.length===this.visuals.length&&t.every((i,s)=>{const o=i.getSnapshot(),n=o.chain.length>0?o.chain.length:o.constrained?1:0;return this.visuals[s]?.mark===i&&this.visuals[s]?.positions.length===n})||(this.clearVisuals(),this.visuals=t.map(i=>this.makeVisual(i)))}makeVisual(t){const e=t.getSnapshot(),i=e.chain.length>0?e.chain:e.constrained?[e.constrained]:[],s=ne(oe),o=ne(Ft),n=ne(Gt),r=i.map(()=>re(new U(.035,10,7),oe)),l=re(new at(.085),Ft),a=re(new ss(.075),Gt),h=new R({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,colorWrite:!1}),d=new y(new U(.16,10,7),h),f=new y(new U(.15,10,7),h.clone());for(const u of[s,o,n,...r,l,a,d,f])u.renderOrder=this.renderOrder,u.layers.set(P),this.add(u);return{mark:t,chain:s,targetLine:o,poleLine:n,joints:r,target:l,pole:a,targetHit:d,poleHit:f,positions:i.map(()=>new p),targetPosition:new p,polePosition:new p}}updateVisual(t,e){const i=t.mark.getSnapshot(),s=i.chain.length>0?i.chain:i.constrained?[i.constrained]:[];for(let f=0;f<s.length;f++)s[f].getWorldPosition(t.positions[f]);ae(t.chain,t.positions);for(let f=0;f<t.joints.length;f++){const u=t.joints[f],m=t.positions[f];u.visible=!!m,m&&(u.position.copy(m),u.scale.setScalar(this.handleScale(e,m)))}const o=t.positions.at(-1),n=i.target?.getWorldPosition(t.targetPosition)??null,r=i.pole?.getWorldPosition(t.polePosition)??null;ae(t.targetLine,o&&n?[o,n]:[]),ae(t.poleLine,t.positions[0]&&r?[t.positions[0],r]:[]),t.target.visible=n!==null,n&&(t.target.position.copy(n),t.target.scale.setScalar(this.handleScale(e,n)*(this.hoveredControl===t.target?1.22:1))),t.targetHit.visible=n!==null,n&&(t.targetHit.position.copy(n),t.targetHit.scale.copy(t.target.scale)),t.pole.visible=r!==null,r&&(t.pole.position.copy(r),t.pole.scale.setScalar(this.handleScale(e,r)*(this.hoveredControl===t.pole?1.22:1))),t.poleHit.visible=r!==null,r&&(t.poleHit.position.copy(r),t.poleHit.scale.copy(t.pole.scale));const l=i.status==="error"||i.status==="unresolved",a=this.selected?1:.52;for(const f of[t.chain,...t.joints]){const u=f.material;u.color.copy(l?Xs:oe),u.opacity=a}const h=this.hoveredControl===t.target||i.target!==null&&this.selectedObjects.has(i.target),d=this.hoveredControl===t.pole||i.pole!==null&&this.selectedObjects.has(i.pole);t.target.material.color.copy(h?ci:Ft),t.pole.material.color.copy(d?ci:Gt),t.targetLine.material.color.copy(Ft),t.poleLine.material.color.copy(Gt),t.targetLine.material.opacity=a,t.poleLine.material.opacity=a,t.target.material.opacity=h?1:a,t.pole.material.opacity=d?1:a}handleScale(t,e){return j.clamp(t.position.distanceTo(e)/8,.65,4)}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s.dispose()}this.visuals=[],this.hoveredControl=null}}const Ys=new C(4892927),qs=new C(7718143),Qs=new C(16758858),Zs=new C(16777215);class Us extends K{constructor(t){super(),this.source=t,this.name="Reflection Probe Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","reflection-probes"),this.layers.set(P),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=Wt(this.source);if(!e)return;const i=e.config,s=JSON.stringify(i);if(!t&&s===this.signature)return;this.signature=s,this.clearVisuals();const o=this.selected?qs:Ys,n=this.selected?1:.62,r=Math.max(0,i.blendDistance);if(i.shape==="sphere"){const a=Math.max(.01,i.radius);this.addWire(new U(a,24,16),o,n),r>0&&a-r>.01&&this.addWire(new U(a-r,20,12),o,this.selected?.55:.28)}else{const[a,h,d]=i.size.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),o,n);const f=[a-r*2,h-r*2,d-r*2];r>0&&f.every(u=>u>.01)&&this.addWire(new I(f[0],f[1],f[2]),o,this.selected?.55:.28)}if(i.parallaxProjection){const[a,h,d]=i.parallaxSize.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),Qs,this.selected?.9:.45).position.fromArray(i.parallaxOffset)}this.addWire(new at(this.selected?.16:.11),Zs,this.selected?1:.72).position.fromArray(i.captureOffset),this.traverse(a=>a.layers.set(P))}addWire(t,e,i){const s=new Si(t);t.dispose();const o=new lt({color:e,depthTest:!1,transparent:!0,opacity:i,toneMapped:!1}),n=new Zt(s,o);return n.renderOrder=this.renderOrder,this.add(n),n}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s?.dispose()}}}const Te=new WeakMap,Pi=new U(1,12,8);function _t(c){return new p(c[0],c[1],c[2])}function At(c){const t={color:c.color,transparent:!0,opacity:c.opacity??.68,depthTest:!1};return c.dashed?new Ci({...t,dashSize:.18,gapSize:.12}):new lt(t)}function X(c,t,e,i=!1){const s=i&&t.length>0?[...t,t[0]]:[...t],o=new Y(new mt().setFromPoints(s),e);o.renderOrder=997,o.layers.set(P),e instanceof Ci&&o.computeLineDistances(),c.add(o)}function Nt(c,t,e,i,s=64){const o=[];for(let n=0;n<s;n++){const r=n/s*Math.PI*2;o.push(c.clone().addScaledVector(e,Math.cos(r)*t).addScaledVector(i,Math.sin(r)*t))}return o}function Ks(c){const t=new K,e=_t(c.center),i=At(c);return X(t,Nt(e,c.radius,new p(1,0,0),new p(0,1,0)),i,!0),X(t,Nt(e,c.radius,new p(1,0,0),new p(0,0,1)),i,!0),X(t,Nt(e,c.radius,new p(0,1,0),new p(0,0,1)),i,!0),t}function $s(c){const t=new K;return X(t,c.points.map(_t),At(c)),t}function Js(c){const t=new K,e=_t(c.origin),i=_t(c.direction).normalize(),s=Math.abs(i.y)<.9?new p(0,1,0):new p(1,0,0),o=new p().crossVectors(s,i).normalize(),n=new p().crossVectors(i,o).normalize(),r=j.degToRad(Math.max(0,Math.min(360,c.angle))/2),l=At(c),a=[];for(let h=0;h<64;h++){const d=h/64*Math.PI*2,f=o.clone().multiplyScalar(Math.cos(d)).addScaledVector(n,Math.sin(d));a.push(e.clone().addScaledVector(i,Math.cos(r)*c.length).addScaledVector(f,Math.sin(r)*c.length))}X(t,a,l,!0);for(const h of[0,16,32,48])X(t,[e,a[h]],l);return t}function to(c,t,e){return c.applyQuaternion(new L(...e)).add(new p(...t))}function eo(c){const t=new K,e=At(c),[i,s,o]=c.halfExtents,n=[[-i,-s,-o],[i,-s,-o],[i,s,-o],[-i,s,-o],[-i,-s,o],[i,-s,o],[i,s,o],[-i,s,o]].map(([r,l,a])=>to(new p(r,l,a),c.center,c.rotation));for(const[r,l]of[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]])X(t,[n[r],n[l]],e);return t}function io(c){const t=new K,e=At(c),i=new L(...c.rotation),s=_t(c.center),o=r=>r.applyQuaternion(i).add(s),n=(r,l,a)=>Nt(new p(0,r,0),c.radius,l,a).map(o);X(t,n(c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0),X(t,n(-c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0);for(const[r,l]of[[c.radius,0],[-c.radius,0],[0,c.radius],[0,-c.radius]])X(t,[o(new p(r,-c.halfHeight,l)),o(new p(r,c.halfHeight,l))],e);for(const r of["x","z"]){const l=[];for(let a=0;a<=32;a++){const h=a/32*Math.PI,d=new p(0,c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}for(let a=0;a<=32;a++){const h=Math.PI+a/32*Math.PI,d=new p(0,-c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}X(t,l,e)}return t}function so(c){const t=c.kind==="line"?$s(c):c.kind==="sphere"?Ks(c):c.kind==="cone"?Js(c):c.kind==="box"?eo(c):io(c);return t.layers.set(P),t.traverse(e=>e.layers.set(P)),t}function oo(c,t){const e=new R({color:t.color,depthTest:!1,transparent:!0,opacity:t.writable?.92:.35}),i=new y(Pi,e);return Object.defineProperty(i,"isSpatialHandleMesh",{value:!0}),i.position.copy(_t(t.position)),i.renderOrder=998,i.layers.set(P),Te.set(i,{nodeId:c,handle:t}),i}function no(c,t){const e=[],i=[];for(const s of t){for(const o of s.guides)e.push(so(o));for(const o of s.handles){const n=oo(c,o);e.push(n),i.push(n)}}return{roots:e,handles:i}}function hi(c){return Te.get(c)??null}function le(c,t){const e=Te.get(c);c.material.color.set(t&&e?.handle.writable?"#ffffff":e?.handle.color??"#ffffff")}function di(c,t){const e=c.position.distanceTo(t.position);c.scale.setScalar(Math.max(.025,e*.012))}function ro(c,t,e){const i=c,s=i.geometry;s&&s!==Pi&&!t.has(s)&&(s.dispose(),t.add(s));const o=Array.isArray(i.material)?i.material:i.material?[i.material]:[];for(const n of o)e.has(n)||(n.dispose(),e.add(n))}function pi(c){const t=new Set,e=new Set;for(const i of c)i.removeFromParent(),i.traverse(s=>ro(s,t,e))}function ce(c,t,e,i=1.15){if(c.isEmpty())return 3;const s=e.clone().normalize(),o=Math.abs(s.dot(t.up))>.999?new p(0,0,1):t.up,n=new p().crossVectors(o,s).normalize(),r=new p().crossVectors(s,n).normalize(),l=c.getCenter(new p);let a=0,h=0,d=0;for(const _ of[c.min.x,c.max.x])for(const g of[c.min.y,c.max.y])for(const v of[c.min.z,c.max.z]){const b=new p(_,g,v).sub(l);d=Math.max(d,Math.abs(b.dot(n))),h=Math.max(h,Math.abs(b.dot(r))),a=Math.max(a,Math.abs(b.dot(s)))}const f=j.degToRad(t.fov*.5),u=Math.atan(Math.tan(f)*Math.max(t.aspect,.01)),m=Math.max(h/Math.tan(f),d/Math.tan(u));return Math.max(m*i+a,t.near*4,.01)}const ao=3,lo=.05,co=.03,ho=.6,po=.15,uo=.08,fo=3,mo=.45,Hi=.001,_o=24,go=6,yo=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]];function vo(c){const t=j.clamp(c*po,uo,fo);return Math.max(Math.min(t,c*mo),Hi)}function he(c){return j.clamp(c*lo,co,ho)}function wo(c,t,e=!1){const{min:i,max:s}=c,o=h=>e?Math.max(h/2,Hi):vo(h),n=o(s.x-i.x),r=o(s.y-i.y),l=o(s.z-i.z);let a=0;for(const[h,d,f]of yo){const u=h===0?i.x:s.x,m=d===0?i.y:s.y,_=f===0?i.z:s.z,g=h===0?n:-n,v=d===0?r:-r,b=f===0?l:-l;t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u+g,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m+v,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_+b}}class de extends ye{entityObject;_fixedSize;_edges;_objectFrame;_toObject=new ft;_point=new p;_axisX=new p;_axisY=new p;_axisZ=new p;_scale=new p;_positions=new Float32Array(_o*go);_box=new xt;_worldPos=new p;_fixedExtent=new p;_standoff=new p;_lastRootMatrix=new Float32Array(16);_requiresContinuousBounds;constructor(t,e){const i=new ve,s=new we({color:e.color,linewidth:e.lineWidth??ao,worldUnits:!1,alphaToCoverage:!0,toneMapped:!1,depthTest:!1,depthWrite:!1});super(i,s),this.entityObject=t,this._fixedSize=e.fixedSize,this._edges=e.edges===!0,this._objectFrame=e.frame==="object";let o=!1;t.traverse(n=>{const r=n;(n.isSkinnedMesh||Array.isArray(r.morphTargetInfluences)&&r.morphTargetInfluences.length>0||ks(n)!==null)&&(o=!0)}),this._requiresContinuousBounds=o,this.renderOrder=1,this.frustumCulled=!1,i.setPositions(this._positions),this.update()}setColor(t){this.material.color.setHex(t)}updateIfNeeded(){this.entityObject.updateWorldMatrix(!0,!1);const t=this.entityObject.matrixWorld.elements;let e=!1;for(let i=0;i<t.length;i++)if(t[i]!==this._lastRootMatrix[i]){e=!0;break}(e||this._requiresContinuousBounds)&&this.update()}update(){this.entityObject.updateWorldMatrix(!0,!1);const t=this._objectFrame&&this._fixedSize===void 0&&Math.abs(this.entityObject.matrixWorld.determinant())>1e-30;this.entityObject.matrixWorld.extractBasis(this._axisX,this._axisY,this._axisZ);const e=t?this._scale.set(this._axisX.length(),this._axisY.length(),this._axisZ.length()):this._scale.set(1,1,1);if(this._fixedSize!==void 0)this.entityObject.getWorldPosition(this._worldPos),this._fixedExtent.setScalar(this._fixedSize),this._box.setFromCenterAndSize(this._worldPos,this._fixedExtent);else if(t?(this._toObject.copy(this.entityObject.matrixWorld).invert(),qi(this.entityObject,this._toObject,this._box)):Vt(this.entityObject,this._box),this._box.isEmpty())return;if(this._box.getSize(this._standoff).multiply(e),this._standoff.set(he(this._standoff.x),he(this._standoff.y),he(this._standoff.z)).divide(e),this._box.expandByVector(this._standoff),wo(this._box,this._positions,this._edges),t){const s=this.entityObject.matrixWorld;for(let o=0;o<this._positions.length;o+=3)this._point.set(this._positions[o],this._positions[o+1],this._positions[o+2]).applyMatrix4(s),this._positions[o]=this._point.x,this._positions[o+1]=this._point.y,this._positions[o+2]=this._point.z}const i=this.geometry.getAttribute("instanceStart");i&&(i.data.needsUpdate=!0),this._lastRootMatrix.set(this.entityObject.matrixWorld.elements)}dispose(){this.geometry.dispose(),this.material.dispose()}}function bo({BlendFunction:c,KernelSize:t,OutlineEffect:e},i,s,o){const n=new e(i,s,{blendFunction:c.ALPHA,visibleEdgeColor:o.visible,hiddenEdgeColor:o.hidden,edgeStrength:5,pulseSpeed:0,blur:!0,kernelSize:t.MEDIUM,resolutionScale:.5,xRay:!0});n.selectionLayer=_e,s.layers.disable(_e);const r=n.getFragmentShader(),l="vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;",a="edge*=(edgeStrength*mask.x*pulse);";r.includes(l)&&r.includes(a)&&(n.setFragmentShader(r.replace("uniform float edgeStrength;","uniform float edgeStrength;uniform float volterCrisp;").replace(a,"edge*=(edgeStrength*(volterCrisp>0.5?1.0:mask.x)*pulse);").replace(l,`${l}if(volterCrisp>0.5){float volterSum=edge.x+edge.y;if(volterSum>0.0)color/=volterSum;edge=min(edge,vec2(1.0));}`)),n.uniforms.set("volterCrisp",{value:0}));const h=n.update.bind(n);return n.update=(d,f,u)=>{const m=n.camera,_=m.layers.isEnabled(P);m.layers.disable(P);try{h(d,f,u)}finally{_&&m.layers.enable(P)}},gt.set(n,{colors:o,roots:0}),Kt(n),n}const xe=new WeakMap;function An(c,t,e,i,s){const o=xe.get(t)?.pop();return o?(o.mainScene=e,o.mainCamera=i,i.layers.disable(_e),gt.set(o,{colors:s,roots:0}),Kt(o),o):bo(c,e,i,s)}function Pn(c,t,e){t.selection.clear(),e?.setEffects([]);const i=xe.get(c)??[];i.includes(t)||i.push(t),xe.set(c,i)}const xo=`uniform lowp sampler2D inputBuffer;uniform vec2 texelSize;uniform float volterReach;
|
|
2
|
+
import{kH as Oi,kO as ht,lb as De,lc as Re,ld as je,kG as ki,le as Di,lf as Fe,cB as Ri,lg as Z,eU as Lt,d4 as V,O as It,lh as te,aB as ji,fw as Fi,dG as Gi,kJ as Ge,kK as Be,kL as Ve,c_ as We,af as Ot,li as Bi,lj as Vi,lk as Xe,jL as Ne,dI as Wi,_ as Xi}from"./index-JjEYIC4G.js";import{a as Ni,i as st}from"./standard-viewport-dressing-BYqJ1RDj.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as Ye,a as qe,f as Yi}from"./clip-planes-CnAI6DZn.js";import{b as qi,a as Vt,C as Qe,e as Qi,d as Zi}from"./content-bounds-BM2BJV41.js";import{EDITOR_LAYER as P,isInEditorOwnedSubtree as J,EDITOR_SELECTION_LAYER as _e,isEditorOwnedObject as Ui}from"./editor-layers-C47WUNtv.js";import{e as ge,r as Wt,f as Ze}from"./three-CqcAlmZt.js";import{g as tt,s as W}from"./user-data-DcUoY-0j.js";import{d as Ki,s as $i,a as Ji}from"./model-thumbnail-ICdHSiW1.js";import{d as Ue,e as ts}from"./model-inspection-BMy0MuzJ.js";import{OrbitControls as es}from"./OrbitControls-B13MKuwC.js";import"./three.module-BLhyNg0e.js";import{a8 as is,fo as p,dp as L,e6 as nt,cW as qt,cp as R,bX as lt,aq as O,K as I,N as mt,a$ as Mt,co as y,cZ as at,bV as Y,e$ as yt,ey as U,aV as bi,cm as ft,db as xi,aI as Qt,bh as K,eV as ss,_ as C,cj as j,aO as Si,c0 as Zt,b_ as Ci,I as xt,cP as os,c8 as ns,e as rs,ap as as,A as ls,c7 as Ee,b$ as cs,da as Ke,fd as et,el as hs,d9 as ds,d5 as $e,j as ps,aE as us,eg as fs,cg as dt,fA as ms,aF as _s,de as gs,eD as ys,bk as vs,S as ws,ex as bs,a5 as xs,ej as it,eE as Je,eF as ti,em as Ss,T as Mi,c1 as Ai}from"./three.core-3arARmh6.js";import{L as ye,a as ve,b as we}from"./LineSegments2-DN9pUfWA.js";import{B as Cs}from"./three.quarks.esm-C_HmSKXo.js";import{b as Ms,e as As}from"./live-gesture-lock-DJbrjOqf.js";import{f as Ps}from"./editor-shell-store-B-64vpgA.js";import{a as Hs,e as Es}from"./entity-object-DBXB7ABG.js";import{e as Ts,v as kt,i as zs,d as Ls}from"./three-integration-BKGFte0g.js";import{f as ei,v as Is,s as Os}from"./scene-framing-B1butaCp.js";import{a as ks}from"./live-mixers-B-bwLZ7c.js";function be(c){const t=tt(c,"triggerVolume");if(!t||typeof t!="object")return null;const{radius:e}=t;return typeof e=="number"&&Number.isFinite(e)&&e>0?{radius:e}:null}const ot=new nt,k=new p,$=new p,T=new L,ii={X:new p(1,0,0),Y:new p(0,1,0),Z:new p(0,0,1)},ee={type:"change"},si={type:"mouseDown",mode:null},oi={type:"mouseUp",mode:null},ni={type:"objectChange"};class ie extends is{constructor(t,e=null){super(void 0,e);const i=new Bs(this);this._root=i;const s=new Vs;this._gizmo=s,i.add(s);const o=new Ws;this._plane=o,i.add(o);const n=this;function r(w,S){let z=S;Object.defineProperty(n,w,{get:function(){return z!==void 0?z:S},set:function(x){z!==x&&(z=x,o[w]=x,s[w]=x,n.dispatchEvent({type:w+"-changed",value:x}),n.dispatchEvent(ee))}}),n[w]=S,o[w]=S,s[w]=S}r("camera",t),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const l=new p,a=new p,h=new L,d=new L,f=new p,u=new L,m=new p,_=new p,g=new p,v=0,b=new p;r("worldPosition",l),r("worldPositionStart",a),r("worldQuaternion",h),r("worldQuaternionStart",d),r("cameraPosition",f),r("cameraQuaternion",u),r("pointStart",m),r("pointEnd",_),r("rotationAxis",g),r("rotationAngle",v),r("eye",b),this._offset=new p,this._startNorm=new p,this._endNorm=new p,this._cameraScale=new p,this._parentPosition=new p,this._parentQuaternion=new L,this._parentQuaternionInv=new L,this._parentScale=new p,this._worldScaleStart=new p,this._worldQuaternionInv=new L,this._worldScale=new p,this._positionStart=new p,this._quaternionStart=new L,this._scaleStart=new p,this._getPointer=Ds.bind(this),this._onPointerDown=js.bind(this),this._onPointerHover=Rs.bind(this),this._onPointerMove=Fs.bind(this),this._onPointerUp=Gs.bind(this),e!==null&&this.connect(e)}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._gizmo.picker[this.mode],ot);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._plane,ot,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,si.mode=this.mode,this.dispatchEvent(si)}}pointerMove(t){const e=this.axis,i=this.mode,s=this.object;let o=this.space;if(i==="scale"?o="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(o="world"),s===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&ot.setFromCamera(t,this.camera);const n=se(this._plane,ot,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(s.position.applyQuaternion(T.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),o==="world"&&(s.parent&&s.position.add(k.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(k.setFromMatrixPosition(s.parent.matrixWorld)))),s.position.x=Math.max(this.minX,Math.min(this.maxX,s.position.x)),s.position.y=Math.max(this.minY,Math.min(this.maxY,s.position.y)),s.position.z=Math.max(this.minZ,Math.min(this.maxZ,s.position.z));else if(i==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),$.set(r,r,r)}else k.copy(this.pointStart),$.copy(this.pointEnd),k.applyQuaternion(this._worldQuaternionInv),$.applyQuaternion(this._worldQuaternionInv),$.divide(k),e.search("X")===-1&&($.x=1),e.search("Y")===-1&&($.y=1),e.search("Z")===-1&&($.z=1);s.scale.copy(this._scaleStart).multiply($),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(k.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(k.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(ii[e]),k.copy(ii[e]),o==="local"&&k.applyQuaternion(this.worldQuaternion),k.cross(this.eye),k.length()===0?l=!0:this.rotationAngle=this._offset.dot(k.normalize())*r),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(ee),this.dispatchEvent(ni)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(oi.mode=this.mode,this.dispatchEvent(oi)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(ee),this.dispatchEvent(ni),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ot}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}setColors(t,e,i,s){const o=this._gizmo.materialLib;o.xAxis.color.set(t),o.yAxis.color.set(e),o.zAxis.color.set(i),o.active.color.set(s),o.xAxisTransparent.color.set(t),o.yAxisTransparent.color.set(e),o.zAxisTransparent.color.set(i),o.activeTransparent.color.set(s),o.xAxis._color&&o.xAxis._color.set(t),o.yAxis._color&&o.yAxis._color.set(e),o.zAxis._color&&o.zAxis._color.set(i),o.active._color&&o.active._color.set(s),o.xAxisTransparent._color&&o.xAxisTransparent._color.set(t),o.yAxisTransparent._color&&o.yAxisTransparent._color.set(e),o.zAxisTransparent._color&&o.zAxisTransparent._color.set(i),o.activeTransparent._color&&o.activeTransparent._color.set(s)}}function Ds(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Rs(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function js(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function Fs(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Gs(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function se(c,t,e){const i=t.intersectObject(c,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||e)return i[s];return!1}const Dt=new bi,H=new p(0,1,0),ri=new p(0,0,0),ai=new ft,Rt=new L,Xt=new L,N=new p,li=new ft,St=new p(1,0,0),rt=new p(0,1,0),Ct=new p(0,0,1),jt=new p,vt=new p,wt=new p;class Bs extends qt{constructor(t){super(),this.isTransformControlsRoot=!0,this.controls=t,this.visible=!1}updateMatrixWorld(t){const e=this.controls;e.object!==void 0&&(e.object.updateMatrixWorld(),e.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):e.object.parent.matrixWorld.decompose(e._parentPosition,e._parentQuaternion,e._parentScale),e.object.matrixWorld.decompose(e.worldPosition,e.worldQuaternion,e._worldScale),e._parentQuaternionInv.copy(e._parentQuaternion).invert(),e._worldQuaternionInv.copy(e.worldQuaternion).invert()),e.camera.updateMatrixWorld(),e.camera.matrixWorld.decompose(e.cameraPosition,e.cameraQuaternion,e._cameraScale),e.camera.isOrthographicCamera?e.camera.getWorldDirection(e.eye).negate():e.eye.copy(e.cameraPosition).sub(e.worldPosition).normalize(),super.updateMatrixWorld(t)}dispose(){this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}}class Vs extends qt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const t=new R({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new lt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=t.clone();i.opacity=.15;const s=e.clone();s.opacity=.5;const o=t.clone();o.color.setHex(16711680);const n=t.clone();n.color.setHex(65280);const r=t.clone();r.color.setHex(255);const l=t.clone();l.color.setHex(16711680),l.opacity=.5;const a=t.clone();a.color.setHex(65280),a.opacity=.5;const h=t.clone();h.color.setHex(255),h.opacity=.5;const d=t.clone();d.opacity=.25;const f=t.clone();f.color.setHex(16776960),f.opacity=.25;const u=t.clone();u.color.setHex(16776960);const m=t.clone();m.color.setHex(7895160),this.materialLib={xAxis:o,yAxis:n,zAxis:r,active:u,xAxisTransparent:l,yAxisTransparent:a,zAxisTransparent:h,activeTransparent:f};const _=new O(0,.04,.1,12);_.translate(0,.05,0);const g=new I(.08,.08,.08);g.translate(0,.04,0);const v=new mt;v.setAttribute("position",new Mt([0,0,0,1,0,0],3));const b=new O(.0075,.0075,.5,3);b.translate(0,.25,0);function w(F,Ht){const B=new yt(F,.0075,3,64,Ht*Math.PI*2);return B.rotateY(Math.PI/2),B.rotateX(Math.PI/2),B}function S(){const F=new mt;return F.setAttribute("position",new Mt([0,0,0,1,1,1],3)),F}const z={X:[[new y(_,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(_,o),[-.5,0,0],[0,0,Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new y(_,n),[0,.5,0]],[new y(_,n),[0,-.5,0],[Math.PI,0,0]],[new y(b,n)]],Z:[[new y(_,r),[0,0,.5],[Math.PI/2,0,0]],[new y(_,r),[0,0,-.5],[-Math.PI/2,0,0]],[new y(b,r),null,[Math.PI/2,0,0]]],XYZ:[[new y(new at(.1,0),d),[0,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new y(new at(.2,0),i)]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},A={START:[[new y(new at(.01,2),s),null,null,null,"helper"]],END:[[new y(new at(.01,2),s),null,null,null,"helper"]],DELTA:[[new Y(S(),s),null,null,null,"helper"]],X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new y(w(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new y(w(.5,.5),o)]],Y:[[new y(w(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new y(w(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new y(w(.75,1),f),null,[0,Math.PI/2,0]]]},E={AXIS:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]]},G={XYZE:[[new y(new U(.25,10,8),i)]],X:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new y(new yt(.75,.1,2,24),i)]]},$t={X:[[new y(g,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]],[new y(g,o),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new y(g,n),[0,.5,0]],[new y(b,n)],[new y(g,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new y(g,r),[0,0,.5],[Math.PI/2,0,0]],[new y(b,r),[0,0,0],[Math.PI/2,0,0]],[new y(g,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.1,.1,.1),d)]]},Pt={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.2,.2,.2),i),[0,0,0]]]},Jt={X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Q(F){const Ht=new qt;for(const B in F)for(let ct=F[B].length;ct--;){const D=F[B][ct][0].clone(),Et=F[B][ct][1],Tt=F[B][ct][2],zt=F[B][ct][3],Ii=F[B][ct][4];D.name=B,D.tag=Ii,Et&&D.position.set(Et[0],Et[1],Et[2]),Tt&&D.rotation.set(Tt[0],Tt[1],Tt[2]),zt&&D.scale.set(zt[0],zt[1],zt[2]),D.updateMatrix();const ke=D.geometry.clone();ke.applyMatrix4(D.matrix),D.geometry=ke,D.renderOrder=1/0,D.position.set(0,0,0),D.rotation.set(0,0,0),D.scale.set(1,1,1),Ht.add(D)}return Ht}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Q(z)),this.add(this.gizmo.rotate=Q(M)),this.add(this.gizmo.scale=Q($t)),this.add(this.picker.translate=Q(x)),this.add(this.picker.rotate=Q(G)),this.add(this.picker.scale=Q(Pt)),this.add(this.helper.translate=Q(A)),this.add(this.helper.rotate=Q(E)),this.add(this.helper.scale=Q(Jt)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const i=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Xt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let o=0;o<s.length;o++){const n=s[o];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(r*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(T.setFromEuler(Dt.set(0,0,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(T.setFromEuler(Dt.set(0,0,Math.PI/2)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(ai.lookAt(ri,H,rt)),n.quaternion.multiply(T),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),k.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),k.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(k),n.visible=this.dragging):(n.quaternion.copy(i),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Rt.copy(i),H.copy(this.eye).applyQuaternion(T.copy(i).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(ai.lookAt(this.eye,ri,rt)),n.name==="X"&&(T.setFromAxisAngle(St,Math.atan2(-H.y,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Y"&&(T.setFromAxisAngle(rt,Math.atan2(H.x,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Z"&&(T.setFromAxisAngle(Ct,Math.atan2(H.y,H.x)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis?(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1):this.axis.split("").some(function(l){return n.name===l})&&(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1))}super.updateMatrixWorld(t)}}class Ws extends y{constructor(){super(new xi(1e5,1e5,2,2),new R({visible:!1,wireframe:!0,side:Qt,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),jt.copy(St).applyQuaternion(e==="local"?this.worldQuaternion:Xt),vt.copy(rt).applyQuaternion(e==="local"?this.worldQuaternion:Xt),wt.copy(Ct).applyQuaternion(e==="local"?this.worldQuaternion:Xt),H.copy(vt),this.mode){case"translate":case"scale":switch(this.axis){case"X":H.copy(this.eye).cross(jt),N.copy(jt).cross(H);break;case"Y":H.copy(this.eye).cross(vt),N.copy(vt).cross(H);break;case"Z":H.copy(this.eye).cross(wt),N.copy(wt).cross(H);break;case"XY":N.copy(wt);break;case"YZ":N.copy(jt);break;case"XZ":H.copy(wt),N.copy(vt);break;case"XYZ":case"E":N.set(0,0,0);break}break;case"rotate":default:N.set(0,0,0)}N.length()===0?this.quaternion.copy(this.cameraQuaternion):(li.lookAt(k.set(0,0,0),N,H),this.quaternion.setFromRotationMatrix(li)),super.updateMatrixWorld(t)}}const oe=new C(4441855),Ft=new C(16758858),Gt=new C(14185983),Xs=new C(16731496),ci=new C(16777215);function ne(c){return new Y(new mt,new lt({color:c,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function re(c,t){return new y(c,new R({color:t,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function ae(c,t){if(c.visible=t.length>1,!c.visible)return;let e=c.geometry.getAttribute("position");(!e||e.count!==t.length)&&(e=new Mt(t.length*3,3),c.geometry.setAttribute("position",e));for(let i=0;i<t.length;i++)e.setXYZ(i,t[i].x,t[i].y,t[i].z);e.needsUpdate=!0,c.geometry.computeBoundingSphere()}class Ns extends K{constructor(t){super(),this.source=t,this.name="Constraint Helper",this.renderOrder=999,W(this,"editorHelper",!0),W(this,"editorHelperType","constraints"),this.layers.set(P),this.refreshStructure()}selected=!1;hoveredControl=null;selectedObjects=new Set;visuals=[];setSelected(t){this.selected=t}setSelectedObjects(t){this.selectedObjects=t}controlMeshes(){return this.visuals.flatMap(t=>[t.targetHit,t.poleHit].filter(e=>e.visible))}presents(t){return t===this.source?!0:this.visuals.some(e=>{const i=e.mark.getSnapshot();return t===i.target||t===i.pole})}controlFor(t){for(const e of this.visuals){const i=e.mark.getSnapshot();if((t===e.target||t===e.targetHit)&&i.target)return{kind:"target",label:i.target.name||`${e.mark.config.label} target`,object:i.target,mesh:e.target};if((t===e.pole||t===e.poleHit)&&i.pole)return{kind:"pole",label:i.pole.name||`${e.mark.config.label} pole`,object:i.pole,mesh:e.pole}}return null}setHoveredControl(t){this.hoveredControl=t}update(t){this.refreshStructure();for(const e of this.visuals)this.updateVisual(e,t)}dispose(){this.clearVisuals(),this.removeFromParent()}refreshStructure(){const t=ge(this.source);t.length===this.visuals.length&&t.every((i,s)=>{const o=i.getSnapshot(),n=o.chain.length>0?o.chain.length:o.constrained?1:0;return this.visuals[s]?.mark===i&&this.visuals[s]?.positions.length===n})||(this.clearVisuals(),this.visuals=t.map(i=>this.makeVisual(i)))}makeVisual(t){const e=t.getSnapshot(),i=e.chain.length>0?e.chain:e.constrained?[e.constrained]:[],s=ne(oe),o=ne(Ft),n=ne(Gt),r=i.map(()=>re(new U(.035,10,7),oe)),l=re(new at(.085),Ft),a=re(new ss(.075),Gt),h=new R({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,colorWrite:!1}),d=new y(new U(.16,10,7),h),f=new y(new U(.15,10,7),h.clone());for(const u of[s,o,n,...r,l,a,d,f])u.renderOrder=this.renderOrder,u.layers.set(P),this.add(u);return{mark:t,chain:s,targetLine:o,poleLine:n,joints:r,target:l,pole:a,targetHit:d,poleHit:f,positions:i.map(()=>new p),targetPosition:new p,polePosition:new p}}updateVisual(t,e){const i=t.mark.getSnapshot(),s=i.chain.length>0?i.chain:i.constrained?[i.constrained]:[];for(let f=0;f<s.length;f++)s[f].getWorldPosition(t.positions[f]);ae(t.chain,t.positions);for(let f=0;f<t.joints.length;f++){const u=t.joints[f],m=t.positions[f];u.visible=!!m,m&&(u.position.copy(m),u.scale.setScalar(this.handleScale(e,m)))}const o=t.positions.at(-1),n=i.target?.getWorldPosition(t.targetPosition)??null,r=i.pole?.getWorldPosition(t.polePosition)??null;ae(t.targetLine,o&&n?[o,n]:[]),ae(t.poleLine,t.positions[0]&&r?[t.positions[0],r]:[]),t.target.visible=n!==null,n&&(t.target.position.copy(n),t.target.scale.setScalar(this.handleScale(e,n)*(this.hoveredControl===t.target?1.22:1))),t.targetHit.visible=n!==null,n&&(t.targetHit.position.copy(n),t.targetHit.scale.copy(t.target.scale)),t.pole.visible=r!==null,r&&(t.pole.position.copy(r),t.pole.scale.setScalar(this.handleScale(e,r)*(this.hoveredControl===t.pole?1.22:1))),t.poleHit.visible=r!==null,r&&(t.poleHit.position.copy(r),t.poleHit.scale.copy(t.pole.scale));const l=i.status==="error"||i.status==="unresolved",a=this.selected?1:.52;for(const f of[t.chain,...t.joints]){const u=f.material;u.color.copy(l?Xs:oe),u.opacity=a}const h=this.hoveredControl===t.target||i.target!==null&&this.selectedObjects.has(i.target),d=this.hoveredControl===t.pole||i.pole!==null&&this.selectedObjects.has(i.pole);t.target.material.color.copy(h?ci:Ft),t.pole.material.color.copy(d?ci:Gt),t.targetLine.material.color.copy(Ft),t.poleLine.material.color.copy(Gt),t.targetLine.material.opacity=a,t.poleLine.material.opacity=a,t.target.material.opacity=h?1:a,t.pole.material.opacity=d?1:a}handleScale(t,e){return j.clamp(t.position.distanceTo(e)/8,.65,4)}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s.dispose()}this.visuals=[],this.hoveredControl=null}}const Ys=new C(4892927),qs=new C(7718143),Qs=new C(16758858),Zs=new C(16777215);class Us extends K{constructor(t){super(),this.source=t,this.name="Reflection Probe Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","reflection-probes"),this.layers.set(P),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=Wt(this.source);if(!e)return;const i=e.config,s=JSON.stringify(i);if(!t&&s===this.signature)return;this.signature=s,this.clearVisuals();const o=this.selected?qs:Ys,n=this.selected?1:.62,r=Math.max(0,i.blendDistance);if(i.shape==="sphere"){const a=Math.max(.01,i.radius);this.addWire(new U(a,24,16),o,n),r>0&&a-r>.01&&this.addWire(new U(a-r,20,12),o,this.selected?.55:.28)}else{const[a,h,d]=i.size.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),o,n);const f=[a-r*2,h-r*2,d-r*2];r>0&&f.every(u=>u>.01)&&this.addWire(new I(f[0],f[1],f[2]),o,this.selected?.55:.28)}if(i.parallaxProjection){const[a,h,d]=i.parallaxSize.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),Qs,this.selected?.9:.45).position.fromArray(i.parallaxOffset)}this.addWire(new at(this.selected?.16:.11),Zs,this.selected?1:.72).position.fromArray(i.captureOffset),this.traverse(a=>a.layers.set(P))}addWire(t,e,i){const s=new Si(t);t.dispose();const o=new lt({color:e,depthTest:!1,transparent:!0,opacity:i,toneMapped:!1}),n=new Zt(s,o);return n.renderOrder=this.renderOrder,this.add(n),n}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s?.dispose()}}}const Te=new WeakMap,Pi=new U(1,12,8);function _t(c){return new p(c[0],c[1],c[2])}function At(c){const t={color:c.color,transparent:!0,opacity:c.opacity??.68,depthTest:!1};return c.dashed?new Ci({...t,dashSize:.18,gapSize:.12}):new lt(t)}function X(c,t,e,i=!1){const s=i&&t.length>0?[...t,t[0]]:[...t],o=new Y(new mt().setFromPoints(s),e);o.renderOrder=997,o.layers.set(P),e instanceof Ci&&o.computeLineDistances(),c.add(o)}function Nt(c,t,e,i,s=64){const o=[];for(let n=0;n<s;n++){const r=n/s*Math.PI*2;o.push(c.clone().addScaledVector(e,Math.cos(r)*t).addScaledVector(i,Math.sin(r)*t))}return o}function Ks(c){const t=new K,e=_t(c.center),i=At(c);return X(t,Nt(e,c.radius,new p(1,0,0),new p(0,1,0)),i,!0),X(t,Nt(e,c.radius,new p(1,0,0),new p(0,0,1)),i,!0),X(t,Nt(e,c.radius,new p(0,1,0),new p(0,0,1)),i,!0),t}function $s(c){const t=new K;return X(t,c.points.map(_t),At(c)),t}function Js(c){const t=new K,e=_t(c.origin),i=_t(c.direction).normalize(),s=Math.abs(i.y)<.9?new p(0,1,0):new p(1,0,0),o=new p().crossVectors(s,i).normalize(),n=new p().crossVectors(i,o).normalize(),r=j.degToRad(Math.max(0,Math.min(360,c.angle))/2),l=At(c),a=[];for(let h=0;h<64;h++){const d=h/64*Math.PI*2,f=o.clone().multiplyScalar(Math.cos(d)).addScaledVector(n,Math.sin(d));a.push(e.clone().addScaledVector(i,Math.cos(r)*c.length).addScaledVector(f,Math.sin(r)*c.length))}X(t,a,l,!0);for(const h of[0,16,32,48])X(t,[e,a[h]],l);return t}function to(c,t,e){return c.applyQuaternion(new L(...e)).add(new p(...t))}function eo(c){const t=new K,e=At(c),[i,s,o]=c.halfExtents,n=[[-i,-s,-o],[i,-s,-o],[i,s,-o],[-i,s,-o],[-i,-s,o],[i,-s,o],[i,s,o],[-i,s,o]].map(([r,l,a])=>to(new p(r,l,a),c.center,c.rotation));for(const[r,l]of[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]])X(t,[n[r],n[l]],e);return t}function io(c){const t=new K,e=At(c),i=new L(...c.rotation),s=_t(c.center),o=r=>r.applyQuaternion(i).add(s),n=(r,l,a)=>Nt(new p(0,r,0),c.radius,l,a).map(o);X(t,n(c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0),X(t,n(-c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0);for(const[r,l]of[[c.radius,0],[-c.radius,0],[0,c.radius],[0,-c.radius]])X(t,[o(new p(r,-c.halfHeight,l)),o(new p(r,c.halfHeight,l))],e);for(const r of["x","z"]){const l=[];for(let a=0;a<=32;a++){const h=a/32*Math.PI,d=new p(0,c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}for(let a=0;a<=32;a++){const h=Math.PI+a/32*Math.PI,d=new p(0,-c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}X(t,l,e)}return t}function so(c){const t=c.kind==="line"?$s(c):c.kind==="sphere"?Ks(c):c.kind==="cone"?Js(c):c.kind==="box"?eo(c):io(c);return t.layers.set(P),t.traverse(e=>e.layers.set(P)),t}function oo(c,t){const e=new R({color:t.color,depthTest:!1,transparent:!0,opacity:t.writable?.92:.35}),i=new y(Pi,e);return Object.defineProperty(i,"isSpatialHandleMesh",{value:!0}),i.position.copy(_t(t.position)),i.renderOrder=998,i.layers.set(P),Te.set(i,{nodeId:c,handle:t}),i}function no(c,t){const e=[],i=[];for(const s of t){for(const o of s.guides)e.push(so(o));for(const o of s.handles){const n=oo(c,o);e.push(n),i.push(n)}}return{roots:e,handles:i}}function hi(c){return Te.get(c)??null}function le(c,t){const e=Te.get(c);c.material.color.set(t&&e?.handle.writable?"#ffffff":e?.handle.color??"#ffffff")}function di(c,t){const e=c.position.distanceTo(t.position);c.scale.setScalar(Math.max(.025,e*.012))}function ro(c,t,e){const i=c,s=i.geometry;s&&s!==Pi&&!t.has(s)&&(s.dispose(),t.add(s));const o=Array.isArray(i.material)?i.material:i.material?[i.material]:[];for(const n of o)e.has(n)||(n.dispose(),e.add(n))}function pi(c){const t=new Set,e=new Set;for(const i of c)i.removeFromParent(),i.traverse(s=>ro(s,t,e))}function ce(c,t,e,i=1.15){if(c.isEmpty())return 3;const s=e.clone().normalize(),o=Math.abs(s.dot(t.up))>.999?new p(0,0,1):t.up,n=new p().crossVectors(o,s).normalize(),r=new p().crossVectors(s,n).normalize(),l=c.getCenter(new p);let a=0,h=0,d=0;for(const _ of[c.min.x,c.max.x])for(const g of[c.min.y,c.max.y])for(const v of[c.min.z,c.max.z]){const b=new p(_,g,v).sub(l);d=Math.max(d,Math.abs(b.dot(n))),h=Math.max(h,Math.abs(b.dot(r))),a=Math.max(a,Math.abs(b.dot(s)))}const f=j.degToRad(t.fov*.5),u=Math.atan(Math.tan(f)*Math.max(t.aspect,.01)),m=Math.max(h/Math.tan(f),d/Math.tan(u));return Math.max(m*i+a,t.near*4,.01)}const ao=3,lo=.05,co=.03,ho=.6,po=.15,uo=.08,fo=3,mo=.45,Hi=.001,_o=24,go=6,yo=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]];function vo(c){const t=j.clamp(c*po,uo,fo);return Math.max(Math.min(t,c*mo),Hi)}function he(c){return j.clamp(c*lo,co,ho)}function wo(c,t,e=!1){const{min:i,max:s}=c,o=h=>e?Math.max(h/2,Hi):vo(h),n=o(s.x-i.x),r=o(s.y-i.y),l=o(s.z-i.z);let a=0;for(const[h,d,f]of yo){const u=h===0?i.x:s.x,m=d===0?i.y:s.y,_=f===0?i.z:s.z,g=h===0?n:-n,v=d===0?r:-r,b=f===0?l:-l;t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u+g,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m+v,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_+b}}class de extends ye{entityObject;_fixedSize;_edges;_objectFrame;_toObject=new ft;_point=new p;_axisX=new p;_axisY=new p;_axisZ=new p;_scale=new p;_positions=new Float32Array(_o*go);_box=new xt;_worldPos=new p;_fixedExtent=new p;_standoff=new p;_lastRootMatrix=new Float32Array(16);_requiresContinuousBounds;constructor(t,e){const i=new ve,s=new we({color:e.color,linewidth:e.lineWidth??ao,worldUnits:!1,alphaToCoverage:!0,toneMapped:!1,depthTest:!1,depthWrite:!1});super(i,s),this.entityObject=t,this._fixedSize=e.fixedSize,this._edges=e.edges===!0,this._objectFrame=e.frame==="object";let o=!1;t.traverse(n=>{const r=n;(n.isSkinnedMesh||Array.isArray(r.morphTargetInfluences)&&r.morphTargetInfluences.length>0||ks(n)!==null)&&(o=!0)}),this._requiresContinuousBounds=o,this.renderOrder=1,this.frustumCulled=!1,i.setPositions(this._positions),this.update()}setColor(t){this.material.color.setHex(t)}updateIfNeeded(){this.entityObject.updateWorldMatrix(!0,!1);const t=this.entityObject.matrixWorld.elements;let e=!1;for(let i=0;i<t.length;i++)if(t[i]!==this._lastRootMatrix[i]){e=!0;break}(e||this._requiresContinuousBounds)&&this.update()}update(){this.entityObject.updateWorldMatrix(!0,!1);const t=this._objectFrame&&this._fixedSize===void 0&&Math.abs(this.entityObject.matrixWorld.determinant())>1e-30;this.entityObject.matrixWorld.extractBasis(this._axisX,this._axisY,this._axisZ);const e=t?this._scale.set(this._axisX.length(),this._axisY.length(),this._axisZ.length()):this._scale.set(1,1,1);if(this._fixedSize!==void 0)this.entityObject.getWorldPosition(this._worldPos),this._fixedExtent.setScalar(this._fixedSize),this._box.setFromCenterAndSize(this._worldPos,this._fixedExtent);else if(t?(this._toObject.copy(this.entityObject.matrixWorld).invert(),qi(this.entityObject,this._toObject,this._box)):Vt(this.entityObject,this._box),this._box.isEmpty())return;if(this._box.getSize(this._standoff).multiply(e),this._standoff.set(he(this._standoff.x),he(this._standoff.y),he(this._standoff.z)).divide(e),this._box.expandByVector(this._standoff),wo(this._box,this._positions,this._edges),t){const s=this.entityObject.matrixWorld;for(let o=0;o<this._positions.length;o+=3)this._point.set(this._positions[o],this._positions[o+1],this._positions[o+2]).applyMatrix4(s),this._positions[o]=this._point.x,this._positions[o+1]=this._point.y,this._positions[o+2]=this._point.z}const i=this.geometry.getAttribute("instanceStart");i&&(i.data.needsUpdate=!0),this._lastRootMatrix.set(this.entityObject.matrixWorld.elements)}dispose(){this.geometry.dispose(),this.material.dispose()}}function bo({BlendFunction:c,KernelSize:t,OutlineEffect:e},i,s,o){const n=new e(i,s,{blendFunction:c.ALPHA,visibleEdgeColor:o.visible,hiddenEdgeColor:o.hidden,edgeStrength:5,pulseSpeed:0,blur:!0,kernelSize:t.MEDIUM,resolutionScale:.5,xRay:!0});n.selectionLayer=_e,s.layers.disable(_e);const r=n.getFragmentShader(),l="vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;",a="edge*=(edgeStrength*mask.x*pulse);";r.includes(l)&&r.includes(a)&&(n.setFragmentShader(r.replace("uniform float edgeStrength;","uniform float edgeStrength;uniform float volterCrisp;").replace(a,"edge*=(edgeStrength*(volterCrisp>0.5?1.0:mask.x)*pulse);").replace(l,`${l}if(volterCrisp>0.5){float volterSum=edge.x+edge.y;if(volterSum>0.0)color/=volterSum;edge=min(edge,vec2(1.0));}`)),n.uniforms.set("volterCrisp",{value:0}));const h=n.update.bind(n);return n.update=(d,f,u)=>{const m=n.camera,_=m.layers.isEnabled(P);m.layers.disable(P);try{h(d,f,u)}finally{_&&m.layers.enable(P)}},gt.set(n,{colors:o,roots:0}),Kt(n),n}const xe=new WeakMap;function An(c,t,e,i,s){const o=xe.get(t)?.pop();return o?(o.mainScene=e,o.mainCamera=i,i.layers.disable(_e),gt.set(o,{colors:s,roots:0}),Kt(o),o):bo(c,e,i,s)}function Pn(c,t,e){t.selection.clear(),e?.setEffects([]);const i=xe.get(c)??[];i.includes(t)||i.push(t),xe.set(c,i)}const xo=`uniform lowp sampler2D inputBuffer;uniform vec2 texelSize;uniform float volterReach;
|
|
3
3
|
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;
|
|
4
4
|
void main(){
|
|
5
5
|
vec2 uv=(vUv0+vUv1)*0.5;
|
package/dist/assets/{transform-mode-request-DO67Jvcm.js → transform-mode-request-nAOkjL7J.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d0 as c,d1 as l,d2 as u,d3 as f,d4 as m}from"./index-
|
|
1
|
+
import{d0 as c,d1 as l,d2 as u,d3 as f,d4 as m}from"./index-JjEYIC4G.js";function g(t,n){if(t.setTransformMode(n),n==="select")return;const r=[...t.selectedEntityIds];if(r.length===0)return;const a=c(t),s=((a===null?null:l(a)?.adapter)??u(t).adapter).transforms?.editability;if(!s)return;let e;for(const i of r){const o=f(d=>s(i,d));if(!o.locked)return;e??=o.reason}e&&m(e)}export{g as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"./jsx-runtime-DPjLkJKQ.js";import{r as c}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{af as b,aL as v,a1 as x,a2 as r,aM as j,aK as i}from"./index-
|
|
1
|
+
import{a as l}from"./jsx-runtime-DPjLkJKQ.js";import{r as c}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{af as b,aL as v,a1 as x,a2 as r,aM as j,aK as i}from"./index-JjEYIC4G.js";const S=[.25,.5,1,2];function f(a,s){const t=Math.round(a*s);return`${a.toFixed(2)}s · f${t}`}function E({transport:a}){const s=c.useSyncExternalStore(c.useCallback(e=>a?a.subscribe(e):()=>{},[a]),c.useCallback(()=>a?.snapshot()??null,[a]));if(!a||!s||s.activeSubject===null)return null;const t=s.driver==="world",n=s.playbackState==="playing",{start:h,end:m,fps:o,loop:g}=s.range,d=s.subjects.find(e=>e.id===s.activeSubject),p=s.subjects.length>1?s.subjects:null,u=a.activeClips();return l.jsxs("section",{"aria-label":"Transport","data-testid":"stage-transport-strip",style:{display:"flex",alignItems:"center",gap:"var(--volter-space-2)",padding:"var(--volter-space-1) var(--volter-space-3)",borderTop:`var(--volter-stroke-resting) solid ${b.boundary.default}`,background:b.surface.raised},children:[l.jsx(v,{size:"compact","aria-label":n?"Pause":"Play",disabled:t,onClick:()=>n?a.pause():a.play(),children:l.jsx(x,{icon:n?r.transport.pause:r.transport.play})}),l.jsx(v,{size:"compact","aria-label":"Stop",disabled:t,onClick:()=>a.stop(),children:l.jsx(x,{icon:r.transport.stop})}),l.jsx(j,{"aria-label":"Playhead",type:"range",min:h,max:m,step:1/o,value:s.time,disabled:t,onChange:e=>a.seek(Number(e.target.value)),style:{flex:1}}),l.jsx(i,{as:"span",variant:"caption",children:f(s.time,o)}),p?l.jsx("select",{"aria-label":"Subject",value:s.activeSubject,disabled:t,onChange:e=>a.setActiveSubject(e.target.value),children:p.map(e=>l.jsx("option",{value:e.id,children:e.label},e.id))}):null,u?l.jsx("select",{"aria-label":"Clip",disabled:t,onChange:e=>a.setActiveClip(e.target.value),children:u.map(e=>l.jsx("option",{value:e.id,children:e.label},e.id))}):null,l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--volter-space-1)"},children:[l.jsx("input",{type:"checkbox",checked:g,disabled:t,onChange:e=>a.setLoop(e.target.checked)}),l.jsx(i,{as:"span",variant:"caption",children:"Loop"})]}),l.jsx("select",{"aria-label":"Speed",value:String(s.timeScale),disabled:t,onChange:e=>a.setTimeScale(Number(e.target.value)),children:S.map(e=>l.jsxs("option",{value:String(e),children:[e,"×"]},e))}),t?l.jsx(i,{as:"span",variant:"caption",children:"The world is driving time (Play); pause the game to scrub"}):d?l.jsx(i,{as:"span",variant:"caption",children:d.label}):null]})}export{E as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as t}from"./index-JjEYIC4G.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-DJ1LfrgS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./configurations-B391DE84.js";import"./run-selection-DVvs9B9T.js";import"./game-network-Bs_aLrfo.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-ojTkP52T.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DlrL6r1z.js";import"./contract-system-adapters-Dv5mUMr_.js";import"./game-contract-seams-D4x_QFfy.js";import"./seeded-random-J_tZuhc3.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CIlCfET4.js";import"./capability-coverage-B0oT2N3Z.js";import"./edit-mode-authoring-RAf4S6PI.js";import"./json-history-resource-B0kkSep8.js";import"./binding-resolver-iMKdp_Dm.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DUEIrJNn.js";import"./canvas-entry-runtime-BVnhMBaW.js";import"./three-ingest-runtime-BOYUnvJa.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-DIgBJBWV.js";import"./ingest-source-persistence-B52PvpPx.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CM-p4xLg.js";import"./mounted-authoring-BRmJcses.js";import"./entity-object-DBXB7ABG.js";import"./user-data-DcUoY-0j.js";import"./workspace-arrangement-D7VBwv9F.js";import"./three-contract-Dkt6PmWY.js";import"./three-CqcAlmZt.js";import"./editor-layers-C47WUNtv.js";import"./component-instance-root-BpMFxtbQ.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-D-dP-DRa.js";import"./source-persistence-backend-B7_XGPrd.js";import"./three-projection-core-CMYaSPZP.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-D41qQnHD.js";import"./deferred-ingest-play-tx7qVcg3.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CKQ-MAMv.js";import"./board-guides-BvzDdD2y.js";import"./relative-import-specifier-B_Awfdrr.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-KwcXV5-u.js";import"./inference-diagnostics-kHRsQw1P.js";import"./writer-tw6EcuVO.js";import"./three-state-Bs6NttX2.js";import"./editor-shell-store-B-64vpgA.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-Ct3Jwvkd.js";import"./game-surface-defaults-D8S4cRxi.js";const Dr="workspace.header",Fr=0;function Gr(){const{project:r}=t();return m.useSyncExternalStore(r.subscribe,r.mounts,r.mounts)?o.jsx(p,{}):null}export{Gr as default,Fr as order,Dr as point};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e1 as e,bA as o,t as r}from"./index-
|
|
1
|
+
import{e1 as e,bA as o,t as r}from"./index-JjEYIC4G.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const t=e([o(),o(),o()]).describe("3D vector as [x, y, z]"),i=e([o(),o(),o(),o()]).describe("Quaternion as [x, y, z, w]"),x=r({position:t.optional().describe("World-space position [x, y, z]"),rotation:i.optional().describe("Rotation quaternion [x, y, z, w]"),scale:t.optional().describe("Scale factor per axis [x, y, z]. Defaults to [1, 1, 1]")}).describe("Local transform relative to parent entity");export{i as QuatSchema,x as TransformSchema,t as Vec3Schema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-
|
|
2
|
-
import{dm as m,am as s,dn as a,aw as n,_ as c,b9 as d}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-DRezN8hO.js","assets/react-story-board--jvx8x-C.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-JjEYIC4G.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/bitmap-label-Ct4k6ehY.js","assets/StoryPreviewMount-DQQUiOyt.js","assets/story-presentation-BanrEcxs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{dm as m,am as s,dn as a,aw as n,_ as c,b9 as d}from"./index-JjEYIC4G.js";import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{d as l,p as v,r as P}from"./design-time-layers-DxZgHWM2.js";import{RootDocumentContent as w}from"./world-documents-g6lvzHMh.js";import{U as _}from"./component-board.service-CvEW_Te9.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-RAf4S6PI.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./react-story-board--jvx8x-C.js";import"./game-surface-defaults-D8S4cRxi.js";import"./react-canvas-navigation-DFspvY8K.js";import"./component-board-registry-DrIa2csL.js";import"./surface-state-DgY1sYF4.js";import"./board-guides-BvzDdD2y.js";import"./CanvasSceneViewport-D-a2OjoE.js";import"./RootSelectionOverlay-QJRz70Z_.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-ClYksj6v.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-KwcXV5-u.js";import"./inference-diagnostics-kHRsQw1P.js";import"./Toolbar-Dc2590c_.js";import"./transform-mode-request-nAOkjL7J.js";import"./TransientHint-Ck6-tCTl.js";import"./ReactCanvasControls-DSwW_3qn.js";import"./story-media-presence-D3jBkjoV.js";const y={revision:()=>JSON.stringify(d().map(({id:i,modulePath:t})=>[i,t])),subscribe:s,capture:async({width:i,height:t})=>{const{captureDomStoryBoardPreview:o}=await c(async()=>{const{captureDomStoryBoardPreview:e}=await import("./story-capture-DRezN8hO.js");return{captureDomStoryBoardPreview:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]));return o(i,t)}};function Z({store:i,composite:t}){const o=l(t).find(r=>r.kind==="dom")??v(),e=r=>u.jsx(w,{...r,composite:t,descriptor:o,store:i});m({id:a,title:_,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:o.worldId,...o.path?{sourcePath:o.path}:{}},Content:e,preview:y,presentation:()=>{const r=n()?.rootPath,p=r?P(r,o.worldId):void 0;return{kind:"workspace",id:a,...p?{story:p}:{}}}},{category:"canvas",default:!t.childAdapters().some(r=>r.kind==="three"||r.kind==="canvas")})}export{Z as installUiBoard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as n}from"./workspace-arrangement-
|
|
1
|
+
import{O as n}from"./workspace-arrangement-D7VBwv9F.js";const r={...n,entityId:"entityId",forward:"forward",tags:"tags",attributes:"attributes",navRole:"navRole",pivot:"pivot",splineCurve:"splineCurve",splineControlPoint:"splineControlPoint",_camera:"_camera",_particleSystem:"_particleSystem",gaussianSplat:"gaussianSplat",__sharedGeometry:"__sharedGeometry",__shadeOrig:"__shadeOrig",__shadeUnlit:"__shadeUnlit",__ingest:"__ingest",__ingestNextId:"__ingestNextId",authoringRoot:"authoringRoot",authoringInstance:"authoringInstance",authoringLabel:"authoringLabel",authoringComponent:"authoringComponent",authoringDocument:"authoringDocument",authoringHierarchyId:"authoringHierarchyId",authoringHierarchyParentId:"authoringHierarchyParentId",authoringHierarchyOrder:"authoringHierarchyOrder",editorIcon:"editorIcon",envObject:"envObject",constraints:"constraints",authoringSubject:"authoringSubject",reflectionProbe:"reflectionProbe",triggerVolume:"triggerVolume",vcDirIdx:"vcDirIdx"};function o(t,e){return t?t.userData[r[e]]:void 0}function s(t,e,a){t.userData[r[e]]=a}function u(t,e){return t?t.userData[r[e]]!==void 0:!1}export{o as g,u as h,s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a4 as l}from"./index-
|
|
1
|
+
import{a4 as l}from"./index-JjEYIC4G.js";function f(c,i){let t=i,s=0;const r=new Set,o=()=>{s++;for(const e of r)e()},n=e=>{t!==e&&(t=e,o())};return{subscribe(e){return r.add(e),()=>{r.delete(e)}},version:()=>s,active:()=>t,select:n,open(e){n(e),l(c)},notify:o,reset(){t=i,o()}}}const p=f("tool:profiler.utility","profiler");export{p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as w}from"./index-
|
|
1
|
+
import{x as w}from"./index-JjEYIC4G.js";const s=new Map,f=new Map;function g(e){let t=f.get(e);return t||(t={frameListeners:new Set,helpers:new Map},f.set(e,t)),t}const l=new Set,c=new Set;function i(){for(const t of s.values())if(t.presenting)return t;const e=w();if(e!==null){const t=s.get(e);if(t)return t}return s.values().next().value??null}let a=null;function p(){a=null;const e=v();for(const t of c)t(e)}function h(e,t){const n=g(e);return{documentId:e,rig:()=>s.get(e)?.rig??t,setHelper:(r,o)=>{n.helpers.set(r,o),s.get(e)?.setHelper(r,o)},onFrame:r=>(n.frameListeners.add(r),()=>{n.frameListeners.delete(r)})}}function S(e,t,n,r){const o=g(r.documentId),u={documentId:r.documentId,rig:e,present:t,setHelper:n,frameListeners:o.frameListeners,helpers:o.helpers,presenting:!1};s.set(r.documentId,u);for(const[d,m]of u.helpers)n(d,m);return p(),()=>{s.get(r.documentId)===u&&(s.delete(r.documentId),p())}}function I(e,t){const n=i();n&&(n.helpers.set(e,t),n.setHelper(e,t))}function V(){return i()?.rig??null}function F(e){const t=i();if(!t)return null;const n=t.present(e);if(!n)return null;t.presenting=!0;let r=!1;return{worldId:n.worldId,dispose:()=>{r||(r=!0,t.presenting=!1),n.dispose()}}}function x(e){return l.add(e),()=>{l.delete(e)}}function v(){return a||(a=[...s.values()].map(e=>h(e.documentId,e.rig))),a}function y(e){const t=f.get(e);return t?[...t.helpers].filter(([,n])=>n!==null).map(([n])=>n):[]}function H(e){return c.add(e),()=>{c.delete(e)}}function b(e,t){const n=s.get(e);if(n){for(const r of n.frameListeners)r(t);if(i()===n)for(const r of l)r(t)}}export{V as a,v as b,x as c,S as d,H as o,F as p,b as r,I as s,y as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s}from"./mounted-authoring-
|
|
1
|
+
import{s}from"./mounted-authoring-BRmJcses.js";import{s as u}from"./three-CqcAlmZt.js";import{t as m}from"./three-contract-Dkt6PmWY.js";function c(t,d){const e=d.find(i=>i.mounted.kind==="three");if(!e||e.mounted.kind!=="three")return null;const n=m(e.mounted).scene,o=e.mounted.authoring;o&&s(n,o),u(n,a(e.id)),t.enterPlayScene(n,e.mounted.rendererConfig);let r=!1;return{worldId:e.id,dispose(){r||(r=!0,t.releaseAdoptedScene(n))}}}function a(t){return t??"main"}export{a as l,c as p};
|
package/dist/assets/{viewport-surface-status-C4UZ_Uq4.js → viewport-surface-status-BlPwrnIq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{af as i}from"./index-
|
|
1
|
+
import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{af as i}from"./index-JjEYIC4G.js";const m="Preparing the viewport…",n="Preparing 3D component previews…";function c(e){return!Number.isFinite(e)||e<1?n:e===1?"Preparing 1 component preview…":`Preparing ${e} component previews…`}function u({testId:e,children:t}){return r.jsx("div",{"data-testid":e,style:{position:"absolute",inset:0,padding:16,fontSize:12,color:i.content.muted,pointerEvents:"none"},children:t})}export{m as O,u as V,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as t,d as i,f as r,g as m}from"./index-
|
|
1
|
+
import{e as t,d as i,f as r,g as m}from"./index-DL3yQMTk.js";import"./index-JjEYIC4G.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";t.add(i,r);t.add(m);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const d="/work/.volter-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],P="/__editor/blender-wasm";function D(e){return new URL(`${P}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${P}/status answered ${e.status}`]}}async function J(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine-KWIxfB_o.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-CieQeF-r.js");return r(e,t)}function U(e){return e<200?1:e<5e3?5:25}const C=e=>new Promise(t=>setTimeout(t,e)),B=new TextDecoder;function ie(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(w=>w.endsWith(".done")));await s(l);for(const w of l){const h=w.slice(0,-5);if(Number(h)<=a)continue;a=Number(h);const $=JSON.parse(B.decode(await e.readFile(`${d}/ask/${h}.json`)));let p;try{p=await t.ask($)}catch(S){p={error:S instanceof Error?S.message:String(S)}}await Promise.all([e.writeFile(`${d}/reply/${h}.json`,JSON.stringify(p??null)),e.writeFile(`${d}/reply/${h}.done`,"1")]),o.add(h)}}async function c(u){const l=String(++n);await Promise.all([e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),e.writeFile(`${d}/in/${l}.done`,"1")]);const w=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const p=JSON.parse(B.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),p.error)throw new Error(p.error);return p.result}const h=r?.();if(h)throw new Error(`Blender is gone, so this call will never be answered: ${h}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const $=U(performance.now()-w);await(e.changed?e.changed($):C($))}}return{request:c}}const L=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",W={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=W[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function H(e,t){const r=(n,a)=>{if(L(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function V(e,t){const r=async(n,a)=>{if(L(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(w=>w.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const m=e=>self.postMessage(e),k=(e,t)=>m({op:"log",level:e,text:t});let b=null,v=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,E=null,T=!1,A=Promise.resolve();function Q(e){const t=A.then(e);return A=t.catch(()=>{}),t}function N(e){T=e,m({op:"document-dirty",dirty:e})}async function R(){if(!f||E===null)return;const e=E;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}N(!1),k("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await J({project:e,log:k,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&E!==null&&N(!0);const c=await r.engine.readArena(),u=await V(c,o),l=await K(H(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await _(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&(E=t),b={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(b)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return v=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function O(e){x.has(e)||(x.add(e),k("error",e))}async function ee(e){const t=s=>(O(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&O(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function _(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){O(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function F(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!b||!v||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return T?(await R(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await _(t,v);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return b.sceneInfo();case"object-info":return b.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await b.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&m({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){F(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await F(e);T&&await R(),await I(),m({id:e.id,result:t})}catch(t){let r=g(t);try{await I()}catch(n){r+=`
|
|
2
|
+
Unable to deliver Blender history: ${g(n)}`}m({id:e.id,error:r})}re()}async function I(){if(!f||!b)return;const e=await f.request({op:"history-events"});e.length&&m({op:"history",entries:e})}export{P as A,se as P,d as S,D as a,ae as b,ie as o,C as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tr as n,ts as l,tt as a,tu as _,tv as i,tw as s,tx as d,ty as u,tz as c,tA as b,tB as p}from"./index-
|
|
1
|
+
import{tr as n,ts as l,tt as a,tu as _,tv as i,tw as s,tx as d,ty as u,tz as c,tA as b,tB as p}from"./index-JjEYIC4G.js";const f=Object.freeze(Object.defineProperty({__proto__:null,EDITOR_VIEW_BUILT_IN_UTILITY_IDS:n,EDITOR_VIEW_DOCUMENT_KINDS:l,EDITOR_VIEW_KEYS:a,EDITOR_VIEW_TOOL_UTILITY_PREFIX:_,EDITOR_VIEW_WORKSPACE_DOCUMENT_IDS:i,EditorClient:s,EditorCommandError:d,editorViewFromUrl:u,editorViewUrl:c,isEditorViewDocumentKind:b,isEditorViewUtility:p},Symbol.toStringTag,{value:"Module"})),o={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",volterComponentRoot:"volterComponentRoot",volterBuiltInternal:"volterBuiltInternal"};function y(e,t){return e?e.userData[o[t]]:void 0}function g(e,t,r){e.userData[o[t]]=r}const S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),m=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),I=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),V=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{o as O,m as a,P as b,E as c,S as d,j as e,T as f,y as g,I as h,f as i,z as j,D as k,v as p,M as r,g as s,R as t,V as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{da as L,db as X,eS as j,fl as H,aE as C,fU as $,fV as K,cx as A,fW as q,cy as M,eB as P,dm as Z,x as J,fX as Q,aP as ee,fY as te,fZ as oe,f_ as ne,f$ as re,g0 as se,g1 as ae,fR as ie,cA as ce,g2 as le,ax as de,g3 as N,g4 as ue,dk as pe}from"./index-GOaZz_UJ.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as fe,m as me}from"./design-time-layers-BJZJy_6E.js";import{I as xe,B as be}from"./edit-mode-authoring-BGGW26LN.js";import{b as he,i as ve}from"./react-canvas-navigation-CHqEpva-.js";import{R as z,i as ge}from"./react-story-board-DA2YLI8m.js";import{s as ye,c as we,a as Se,b as ke}from"./component-board-registry-DrIa2csL.js";import{e as Re,S as Ee}from"./surface-state-CUfqJeMb.js";import"./index-CtzuWnCS.js";import{c as Ie,d as Ce,r as F,e as G,f as Ae,m as O,b as De,a as je,s as Be}from"./board-guides-DUTllrm6.js";import{C as V,a as $e,b as Me}from"./CanvasSceneViewport-BwwYOosQ.js";import{R as _e}from"./ReactCanvasControls-DircULTK.js";import{R as ze}from"./RootSelectionOverlay-D--07KbL.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./root-stacking-BEd9ZvxC.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./Toolbar-BTun9j-K.js";import"./transform-mode-request-DO67Jvcm.js";import"./TransientHint-BjG5QZ7w.js";import"./layered-pick-B3AjYd-G.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-CD61yjth.js";import"./inference-diagnostics-DH6OpJZI.js";const y=16,_="rgba(255, 82, 82, 0.9)",U="rgba(18, 22, 26, 0.92)",D="rgba(255, 255, 255, 0.28)";function Te(s){return[10,25,50,100,250,500,1e3,2500,5e3].find(n=>n*s>=60)??1e4}function W(s){return Math.abs(s)>=1e3?`${s/1e3}k`:String(s)}function Pe({docId:s,containerRef:l}){const n=p.useSyncExternalStore(L,X),b=p.useSyncExternalStore(Ie,()=>Ce(s)),[r,d]=p.useState(null),g=p.useRef(null);p.useEffect(()=>{const t=l.current;if(!t)return;const o=t.getBoundingClientRect();return F(s,{originX:o.left,originY:o.top,panX:n.x,panY:n.y,zoom:n.zoom}),()=>F(s,null)},[s,l,n.x,n.y,n.zoom]);const f=(t,o)=>Math.round((t-(o==="x"?n.x:n.y))/n.zoom),u=(t,o)=>(o==="x"?n.x:n.y)+t*n.zoom,m=t=>{const o=l.current?.getBoundingClientRect();return o?{x:t.clientX-o.left,y:t.clientY-o.top}:{x:0,y:0}},k=t=>o=>{o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"place",axis:t,id:null,at:t==="x"?e.x:e.y})},S=t=>o=>{o.preventDefault(),o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"move",axis:t.axis,id:t.id,at:t.axis==="x"?e.x:e.y})},R=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y;d({...r,at:e}),r.kind==="move"&&r.id&&O(s,r.id,f(e,r.axis))},E=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y,i=e<=y;r.kind==="place"?i||Ae(s,r.axis,f(e,r.axis)):r.id&&(i?G(s,r.id):O(s,r.id,f(e,r.axis))),d(null)},a=t=>{const o=l.current,e=o?t==="x"?o.clientWidth:o.clientHeight:0,i=Te(n.zoom),v=Math.ceil(f(y,t)/i)*i,w=f(e,t),x=[];for(let I=v;I<=w&&x.length<200;I+=i)x.push(I);return x},h={position:"absolute",background:U,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return c.jsxs("div",{ref:g,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:E,children:[b.map(t=>{const o=u(t.value,t.axis),e=t.axis==="x";return c.jsx("div",{"data-testid":`board-guide-${t.axis}-${t.value}`,title:`${t.axis} = ${t.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:S(t),onPointerMove:R,onPointerUp:E,onDoubleClick:()=>G(s,t.id),style:{position:"absolute",pointerEvents:"auto",cursor:e?"col-resize":"row-resize",zIndex:60,...e?{left:o-2,top:0,bottom:0,width:5}:{top:o-2,left:0,right:0,height:5}},children:c.jsx("div",{style:{position:"absolute",background:_,...e?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},t.id)}),r&&c.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...r.axis==="x"?{left:r.at,top:0,bottom:0,width:1}:{top:r.at,left:0,right:0,height:1}},children:c.jsx("span",{style:{position:"absolute",...r.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:U,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:f(r.at,r.axis)})}),c.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...h,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:a("x").map(t=>c.jsx("span",{style:{position:"absolute",left:u(t,"x"),bottom:0,borderLeft:`1px solid ${D}`,height:5},children:c.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace"},children:W(t)})},t))}),c.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...h,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:a("y").map(t=>c.jsx("span",{style:{position:"absolute",top:u(t,"y"),right:0,borderTop:`1px solid ${D}`,width:5},children:c.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:W(t)})},t))}),c.jsx(Ne,{}),c.jsx("div",{style:{...h,top:0,left:0,width:y,height:y,borderRight:`1px solid ${j.border}`,borderBottom:`1px solid ${j.border}`}})]})}function Ne(){const s=p.useSyncExternalStore(De,je);return s?c.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Be(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:j.accent,border:`1px solid ${j.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",s," · editing this breakpoint — click to clear"]}):null}const Fe="Scene";function Ge({active:s,composite:l,descriptor:n,documentId:b,store:r}){const d=p.useRef(null),g=p.useRef(null),[f]=p.useState(oe),u=n.kind==="canvas",m=u?f:ce;p.useSyncExternalStore(r.subscribe,r.getSnapshot);const k=p.useSyncExternalStore(ne,re),S=p.useSyncExternalStore(se,ae),[R,E]=p.useState(null),a=l.childAdapters().find(x=>x.worldId===n.worldId)?.adapter??R??void 0,h=u&&a?.provenance?.label==="babylon",t=a?.hierarchy.roots()??[],o=new Set(a?.rects?.emptyContainers?.().map(x=>x.id)??[]),e=t.some(x=>!o.has(x.id)),i=Re({surface:u?"Scene":n.kind==="dom"?"UI":"World",rootIds:[n.worldId],playSuspended:r.playState!=="stopped"&&(!a||a.provenance?.source==="boundary"),phase:!a||a.provenance?.source==="boundary"?"loading":"ready",content:!a||a.provenance?.source==="boundary"?"unknown":e?"present":"empty",readiness:k,failures:S,disclosure:a instanceof be?a.disclosure:null});p.useEffect(()=>{if(a)return ie(b,()=>({adapter:a,nodeId:[...r.selectedEntityIds].find(x=>a.hierarchy.node(x))??null}))},[l,a,b,r]),p.useEffect(()=>{const x=d.current;if(x&&!h)return u?he(x,m):ve(x,m)},[m,h,u]),p.useEffect(()=>{if(!s)return;if(!!!g.current&&d.current){g.current=me(d.current,l,r,[n],(Ve,Y)=>E(Y),u?{canvasSceneView:f}:void 0,b);return}let I=0,B=0;const T=()=>{if(I+=1,I<2){B=requestAnimationFrame(T);return}pe(b)};return B=requestAnimationFrame(T),()=>cancelAnimationFrame(B)},[s,f,l,n,b,u,r]),p.useEffect(()=>()=>{g.current?.(),g.current=null},[]);const v=le(de(r),r.selectedEntityIds),w=v?.worldId===n.worldId?v:a?.rects?{worldId:n.worldId,kind:"dom",adapter:a}:null;return c.jsxs("div",{ref:d,"data-testid":`world-document:${n.worldId}`,"data-volter-backdrop-color":s?h?"#111827":u?V:z:void 0,"data-volter-backdrop-policy":s?"dark-frost":void 0,onPointerDown:()=>ue("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:h?"#111827":u?V:z,touchAction:"none"},children:[h?null:u?c.jsx($e,{view:f,documentId:b}):c.jsx(Oe,{}),c.jsx(ze,{...a?{adapter:a}:{},...u&&!h?{view:f,transformModeAware:!0,presentationId:b}:{}},`selection:${N(a)}`),c.jsx(Ee,{explanation:i,testId:`world-surface-status:${n.worldId}`,style:{zIndex:20}}),h?null:u?c.jsx(Me,{active:s,...a?{adapter:a}:{},containerRef:d,view:f,documentId:b},`controls:${N(a)}`):c.jsxs(c.Fragment,{children:[c.jsx(Pe,{docId:n.worldId,containerRef:d}),c.jsx(_e,{containerRef:d,context:w})]})]})}function Oe(){const s=p.useSyncExternalStore(L,X),l=Math.max(8,24*s.zoom),n=Math.max(.7,Math.min(1.4,s.zoom));return c.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:z,backgroundImage:`radial-gradient(circle, ${ge} ${n}px, transparent ${n}px)`,backgroundPosition:`${s.x}px ${s.y}px`,backgroundSize:`${l}px ${l}px`}})}function gt(s,l){const n=J(),b=l.childAdapters().some(e=>e.role==="world"&&e.kind==="three"),r=l.childAdapters().some(e=>e.kind===xe);!b&&!r&&H(C,{discardDirty:!0});const d=new Set,g=[];let f=!1;for(const e of l.childAdapters())e.role==="world"&&e.kind==="three"&&g.push($(e.worldId,C));const u=fe(l),m=u.find(e=>e.kind==="canvas");m&&g.push($(m.worldId,A));const k=new Set([...l.childAdapters().filter(e=>e.role==="world"&&e.kind==="three"),...m?[m]:[]].map(e=>e.worldId)),S=new Map;function R(){for(const e of u){if(k.has(e.worldId)||S.has(e.worldId))continue;const i=Se(e.kind);if(!i)continue;const v=$(e.worldId,i.documentId),w=Q(e.worldId,()=>i.presence()==="absent"?`Root "${e.worldId}" has no document of its own: its design surface is the project's ${i.title} board (${i.documentId}). ${i.absentReason()}`:null);S.set(e.worldId,()=>{w(),v()})}}g.push(K(e=>{const i=ee();if(i.some(w=>w.descriptor.id===e))return null;const v=ke(e);return v?v.presence()==="absent"?v.absentReason():null:`No workspace document is named "${e}". Open in this session: ${i.map(w=>w.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function E(e){const i=v=>c.jsx(Ge,{...v,composite:l,descriptor:e,store:s});Z({id:A,title:Fe,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:e.worldId,...e.path?{sourcePath:e.path}:{}},Content:i,presentation:()=>({kind:"world",id:e.worldId})},{category:"scene",default:!b,rootId:e.worldId})}function a(e){d.add(e.documentId);const i=()=>{d.delete(e.documentId)};try{Promise.resolve(e.install({store:s,composite:l})).catch(i)}catch{i()}}function h(){if(!f){R();for(const e of we()){const i=e.presence();if(i===null)continue;const v=d.has(e.documentId);i==="present"!==v&&(i==="present"?a(e):(P(e.documentId),d.delete(e.documentId)))}}}m&&(E(m),d.add(A)),h();const t=ye(h),o=m?A:[...d][0];return te()||(!b&&o!==void 0&&(n===null||n===C||n===q)?M(o):n?M(n):b&&M(C)),()=>{f=!0,t();for(const e of g)e();for(const e of S.values())e();S.clear();for(const e of d)P(e)}}export{Ge as RootDocumentContent,gt as installRootDocuments};
|
|
1
|
+
import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{da as L,db as X,eS as j,fl as H,aE as C,fU as $,fV as K,cx as A,fW as q,cy as M,eB as P,dm as Z,x as J,fX as Q,aP as ee,fY as te,fZ as oe,f_ as ne,f$ as re,g0 as se,g1 as ae,fR as ie,cA as ce,g2 as le,ax as de,g3 as N,g4 as ue,dk as pe}from"./index-JjEYIC4G.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as fe,m as me}from"./design-time-layers-DxZgHWM2.js";import{I as xe,B as be}from"./edit-mode-authoring-RAf4S6PI.js";import{b as he,i as ve}from"./react-canvas-navigation-DFspvY8K.js";import{R as z,i as ge}from"./react-story-board--jvx8x-C.js";import{s as ye,c as we,a as Se,b as ke}from"./component-board-registry-DrIa2csL.js";import{e as Re,S as Ee}from"./surface-state-DgY1sYF4.js";import"./index-CtzuWnCS.js";import{c as Ie,d as Ce,r as F,e as G,f as Ae,m as O,b as De,a as je,s as Be}from"./board-guides-BvzDdD2y.js";import{C as V,a as $e,b as Me}from"./CanvasSceneViewport-D-a2OjoE.js";import{R as _e}from"./ReactCanvasControls-DSwW_3qn.js";import{R as ze}from"./RootSelectionOverlay-QJRz70Z_.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./root-stacking-BEd9ZvxC.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./Toolbar-Dc2590c_.js";import"./transform-mode-request-nAOkjL7J.js";import"./TransientHint-Ck6-tCTl.js";import"./layered-pick-ClYksj6v.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-KwcXV5-u.js";import"./inference-diagnostics-kHRsQw1P.js";const y=16,_="rgba(255, 82, 82, 0.9)",U="rgba(18, 22, 26, 0.92)",D="rgba(255, 255, 255, 0.28)";function Te(s){return[10,25,50,100,250,500,1e3,2500,5e3].find(n=>n*s>=60)??1e4}function W(s){return Math.abs(s)>=1e3?`${s/1e3}k`:String(s)}function Pe({docId:s,containerRef:l}){const n=p.useSyncExternalStore(L,X),b=p.useSyncExternalStore(Ie,()=>Ce(s)),[r,d]=p.useState(null),g=p.useRef(null);p.useEffect(()=>{const t=l.current;if(!t)return;const o=t.getBoundingClientRect();return F(s,{originX:o.left,originY:o.top,panX:n.x,panY:n.y,zoom:n.zoom}),()=>F(s,null)},[s,l,n.x,n.y,n.zoom]);const f=(t,o)=>Math.round((t-(o==="x"?n.x:n.y))/n.zoom),u=(t,o)=>(o==="x"?n.x:n.y)+t*n.zoom,m=t=>{const o=l.current?.getBoundingClientRect();return o?{x:t.clientX-o.left,y:t.clientY-o.top}:{x:0,y:0}},k=t=>o=>{o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"place",axis:t,id:null,at:t==="x"?e.x:e.y})},S=t=>o=>{o.preventDefault(),o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"move",axis:t.axis,id:t.id,at:t.axis==="x"?e.x:e.y})},R=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y;d({...r,at:e}),r.kind==="move"&&r.id&&O(s,r.id,f(e,r.axis))},E=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y,i=e<=y;r.kind==="place"?i||Ae(s,r.axis,f(e,r.axis)):r.id&&(i?G(s,r.id):O(s,r.id,f(e,r.axis))),d(null)},a=t=>{const o=l.current,e=o?t==="x"?o.clientWidth:o.clientHeight:0,i=Te(n.zoom),v=Math.ceil(f(y,t)/i)*i,w=f(e,t),x=[];for(let I=v;I<=w&&x.length<200;I+=i)x.push(I);return x},h={position:"absolute",background:U,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return c.jsxs("div",{ref:g,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:E,children:[b.map(t=>{const o=u(t.value,t.axis),e=t.axis==="x";return c.jsx("div",{"data-testid":`board-guide-${t.axis}-${t.value}`,title:`${t.axis} = ${t.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:S(t),onPointerMove:R,onPointerUp:E,onDoubleClick:()=>G(s,t.id),style:{position:"absolute",pointerEvents:"auto",cursor:e?"col-resize":"row-resize",zIndex:60,...e?{left:o-2,top:0,bottom:0,width:5}:{top:o-2,left:0,right:0,height:5}},children:c.jsx("div",{style:{position:"absolute",background:_,...e?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},t.id)}),r&&c.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...r.axis==="x"?{left:r.at,top:0,bottom:0,width:1}:{top:r.at,left:0,right:0,height:1}},children:c.jsx("span",{style:{position:"absolute",...r.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:U,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:f(r.at,r.axis)})}),c.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...h,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:a("x").map(t=>c.jsx("span",{style:{position:"absolute",left:u(t,"x"),bottom:0,borderLeft:`1px solid ${D}`,height:5},children:c.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace"},children:W(t)})},t))}),c.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...h,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:a("y").map(t=>c.jsx("span",{style:{position:"absolute",top:u(t,"y"),right:0,borderTop:`1px solid ${D}`,width:5},children:c.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:W(t)})},t))}),c.jsx(Ne,{}),c.jsx("div",{style:{...h,top:0,left:0,width:y,height:y,borderRight:`1px solid ${j.border}`,borderBottom:`1px solid ${j.border}`}})]})}function Ne(){const s=p.useSyncExternalStore(De,je);return s?c.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Be(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:j.accent,border:`1px solid ${j.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",s," · editing this breakpoint — click to clear"]}):null}const Fe="Scene";function Ge({active:s,composite:l,descriptor:n,documentId:b,store:r}){const d=p.useRef(null),g=p.useRef(null),[f]=p.useState(oe),u=n.kind==="canvas",m=u?f:ce;p.useSyncExternalStore(r.subscribe,r.getSnapshot);const k=p.useSyncExternalStore(ne,re),S=p.useSyncExternalStore(se,ae),[R,E]=p.useState(null),a=l.childAdapters().find(x=>x.worldId===n.worldId)?.adapter??R??void 0,h=u&&a?.provenance?.label==="babylon",t=a?.hierarchy.roots()??[],o=new Set(a?.rects?.emptyContainers?.().map(x=>x.id)??[]),e=t.some(x=>!o.has(x.id)),i=Re({surface:u?"Scene":n.kind==="dom"?"UI":"World",rootIds:[n.worldId],playSuspended:r.playState!=="stopped"&&(!a||a.provenance?.source==="boundary"),phase:!a||a.provenance?.source==="boundary"?"loading":"ready",content:!a||a.provenance?.source==="boundary"?"unknown":e?"present":"empty",readiness:k,failures:S,disclosure:a instanceof be?a.disclosure:null});p.useEffect(()=>{if(a)return ie(b,()=>({adapter:a,nodeId:[...r.selectedEntityIds].find(x=>a.hierarchy.node(x))??null}))},[l,a,b,r]),p.useEffect(()=>{const x=d.current;if(x&&!h)return u?he(x,m):ve(x,m)},[m,h,u]),p.useEffect(()=>{if(!s)return;if(!!!g.current&&d.current){g.current=me(d.current,l,r,[n],(Ve,Y)=>E(Y),u?{canvasSceneView:f}:void 0,b);return}let I=0,B=0;const T=()=>{if(I+=1,I<2){B=requestAnimationFrame(T);return}pe(b)};return B=requestAnimationFrame(T),()=>cancelAnimationFrame(B)},[s,f,l,n,b,u,r]),p.useEffect(()=>()=>{g.current?.(),g.current=null},[]);const v=le(de(r),r.selectedEntityIds),w=v?.worldId===n.worldId?v:a?.rects?{worldId:n.worldId,kind:"dom",adapter:a}:null;return c.jsxs("div",{ref:d,"data-testid":`world-document:${n.worldId}`,"data-volter-backdrop-color":s?h?"#111827":u?V:z:void 0,"data-volter-backdrop-policy":s?"dark-frost":void 0,onPointerDown:()=>ue("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:h?"#111827":u?V:z,touchAction:"none"},children:[h?null:u?c.jsx($e,{view:f,documentId:b}):c.jsx(Oe,{}),c.jsx(ze,{...a?{adapter:a}:{},...u&&!h?{view:f,transformModeAware:!0,presentationId:b}:{}},`selection:${N(a)}`),c.jsx(Ee,{explanation:i,testId:`world-surface-status:${n.worldId}`,style:{zIndex:20}}),h?null:u?c.jsx(Me,{active:s,...a?{adapter:a}:{},containerRef:d,view:f,documentId:b},`controls:${N(a)}`):c.jsxs(c.Fragment,{children:[c.jsx(Pe,{docId:n.worldId,containerRef:d}),c.jsx(_e,{containerRef:d,context:w})]})]})}function Oe(){const s=p.useSyncExternalStore(L,X),l=Math.max(8,24*s.zoom),n=Math.max(.7,Math.min(1.4,s.zoom));return c.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:z,backgroundImage:`radial-gradient(circle, ${ge} ${n}px, transparent ${n}px)`,backgroundPosition:`${s.x}px ${s.y}px`,backgroundSize:`${l}px ${l}px`}})}function gt(s,l){const n=J(),b=l.childAdapters().some(e=>e.role==="world"&&e.kind==="three"),r=l.childAdapters().some(e=>e.kind===xe);!b&&!r&&H(C,{discardDirty:!0});const d=new Set,g=[];let f=!1;for(const e of l.childAdapters())e.role==="world"&&e.kind==="three"&&g.push($(e.worldId,C));const u=fe(l),m=u.find(e=>e.kind==="canvas");m&&g.push($(m.worldId,A));const k=new Set([...l.childAdapters().filter(e=>e.role==="world"&&e.kind==="three"),...m?[m]:[]].map(e=>e.worldId)),S=new Map;function R(){for(const e of u){if(k.has(e.worldId)||S.has(e.worldId))continue;const i=Se(e.kind);if(!i)continue;const v=$(e.worldId,i.documentId),w=Q(e.worldId,()=>i.presence()==="absent"?`Root "${e.worldId}" has no document of its own: its design surface is the project's ${i.title} board (${i.documentId}). ${i.absentReason()}`:null);S.set(e.worldId,()=>{w(),v()})}}g.push(K(e=>{const i=ee();if(i.some(w=>w.descriptor.id===e))return null;const v=ke(e);return v?v.presence()==="absent"?v.absentReason():null:`No workspace document is named "${e}". Open in this session: ${i.map(w=>w.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function E(e){const i=v=>c.jsx(Ge,{...v,composite:l,descriptor:e,store:s});Z({id:A,title:Fe,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:e.worldId,...e.path?{sourcePath:e.path}:{}},Content:i,presentation:()=>({kind:"world",id:e.worldId})},{category:"scene",default:!b,rootId:e.worldId})}function a(e){d.add(e.documentId);const i=()=>{d.delete(e.documentId)};try{Promise.resolve(e.install({store:s,composite:l})).catch(i)}catch{i()}}function h(){if(!f){R();for(const e of we()){const i=e.presence();if(i===null)continue;const v=d.has(e.documentId);i==="present"!==v&&(i==="present"?a(e):(P(e.documentId),d.delete(e.documentId)))}}}m&&(E(m),d.add(A)),h();const t=ye(h),o=m?A:[...d][0];return te()||(!b&&o!==void 0&&(n===null||n===C||n===q)?M(o):n?M(n):b&&M(C)),()=>{f=!0,t();for(const e of g)e();for(const e of S.values())e();S.clear();for(const e of d)P(e)}}export{Ge as RootDocumentContent,gt as installRootDocuments};
|
package/dist/assets/{world-root-stage-binding-Bn0b7XsL.js → world-root-stage-binding-DugyiNfT.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Xe}from"./editor-layers-BpAhxn0P.js";import{cM as Oe,a1 as V,dT as Je,aK as te,cE as G,aL as Q,kA as Ye,dS as Ze,cK as et,a0 as $,g_ as tt,hG as rt,jS as nt,kB as ot,O as j,B as st,bM as at,kC as Se,b$ as it,kD as ct,kE as lt,kF as ut,kG as Ce,kH as xe,ax as x,cm as dt,kI as mt,bU as pt,bZ as ft,kJ as Pe,kK as Ee,kL as je,kM as ht,af as gt,kN as bt,kO as ke,dk as vt,kP as wt,kQ as yt,hd as St,iV as Ct,iW as xt,gJ as Pt,gK as Et,j1 as jt,f_ as kt,f$ as Tt,g0 as At,g1 as Rt}from"./index-GOaZz_UJ.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-q7c_gezv.js";import{R as Ot}from"./RootSelectionOverlay-D--07KbL.js";import{e as Lt,S as Ft}from"./surface-state-CUfqJeMb.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as B,t as Wt,p as Le,v as Ae,b as _t,e as Dt,l as Nt,i as $t}from"./camera-authoring-DYjhU5Zp.js";import{c as Gt}from"./performance-profiler-CMbwGBuk.js";import{m as Qt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Bt}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Ht}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ut}from"./render-settings-C81L61oc.js";import{createSoftParticleDepthPass as Kt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as qt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Xt,applySceneRenderPipeline as Jt}from"./setup-renderer-D9SD_Wht.js";import{EffectComposer as Yt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-BXLqBDUm.js";import"./three-integration-BjEyDiTB.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-CxHRaajp.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-OxBEdgIP.js";import{a as Z}from"./entity-object-DsAYI3gJ.js";import{w as vr}from"./editor-shell-store-C04XLLU-.js";import{p as wr}from"./viewport-root-presentation-B6vzusDX.js";import{d as yr}from"./asset-editor-persistence-AKvUtcfg.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-CGxHoE5g.js";import{el as Cr,_ as ee,fo as N,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-BjHQJUoD.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-B3AjYd-G.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-DA2YLI8m.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-CD61yjth.js";import"./inference-diagnostics-DH6OpJZI.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-B35P-in2.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-BGGW26LN.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-BDBZj06-.js";import"./model-thumbnail-C6xWKVgL.js";import"./studio-environment-BiC6OVkT.js";import"./three-state-CzjS3Z7g.js";import"./hierarchy-marks-MeNgbwiP.js";import"./component-instance-root-BZXekKMG.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-Slxb_SvE.js";import"./content-bounds-IMXYkN3x.js";import"./asset-preview-C-SzfMmZ.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-i3_nCWlL.js";import"./standard-viewport-dressing-D4bfoK0I.js";import"./clip-planes-CnAI6DZn.js";import"./three-CQcV_QdT.js";import"./model-inspection-B0GymTL8.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-B5dto0bO.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-CZw66UYV.js";import"./collaboration-presence-Bj9ev5mU.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=B(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Je,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx(G,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(Q,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Ye,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx(G,{text:"Camera actions",children:i.jsx(Q,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx($,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx($,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx($,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),_t(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=B();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx(G,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(Q,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:Dt,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx($,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx(G,{text:"Exit camera view",children:i.jsx(Q,{"aria-label":"Exit camera view",size:"compact",onClick:Nt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Qt(new nr({canvas:o,antialias:!!Ut(void 0).antialias,powerPreference:"high-performance"}));return Xt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Ht(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function _r(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function Dr(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Nr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function $r(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=_r(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:Dr(c),...Nr(r,s)}:null}function Gr(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Qr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Yt(a),E=Kt(),O=new qt,g=Gt(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,_e=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let H=Ce(c).background??re;b.background=new ee(H);const De=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===H&&(b.background=new ee(t)),H=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),Ne=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const U=new N,F=new N,ne=new N,oe=()=>{const t=n.renderCamera;t.getWorldPosition(U),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(U).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:U,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",K=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},$e=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),K?.(),K=null,h&&gr(a,h,S),h=null,S=null,I=null,Jt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:Gr(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(K=Bt(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},Ge=dr(ce);ce();const q=t=>$r(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=B().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=q(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Qe=$t({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?q(t):null},resolve:q,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new N),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Be=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const X=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{X.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const He=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,X.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),_=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,B().preview?.camera??null,r.cameraPreview())})})}const Ue=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),J=()=>wt(e.shell)===e.shell;function Ke(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,_=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;J()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),X.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),J()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),_&&be&&(_=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;J()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let Y,D;async function qe(t){if(P)return;r.onMountStatus("mounting"),D?.(),D=void 0,Y=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||Y!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||Y!==t){p();return}D=p,P||r.onMountStatus("ready")}const we=ar(e.shell,qe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,_=!0}),{scene:b,viewport:n,frame:Ke,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,_e(),Ue(),ge.disconnect(),Be(),He(),Qe(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),D?.(),k.dispose(),O.dispose(),L.dispose(),Ge(),$e(),De(),Ne(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Br({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Xe})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Hr({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Br,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Qr,Overlays:Hr};export{ko as worldRootStageBinding};
|
|
1
|
+
import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Xe}from"./editor-layers-C47WUNtv.js";import{cM as Oe,a1 as V,dT as Je,aK as te,cE as G,aL as Q,kA as Ye,dS as Ze,cK as et,a0 as $,g_ as tt,hG as rt,jS as nt,kB as ot,O as j,B as st,bM as at,kC as Se,b$ as it,kD as ct,kE as lt,kF as ut,kG as Ce,kH as xe,ax as x,cm as dt,kI as mt,bU as pt,bZ as ft,kJ as Pe,kK as Ee,kL as je,kM as ht,af as gt,kN as bt,kO as ke,dk as vt,kP as wt,kQ as yt,hd as St,iV as Ct,iW as xt,gJ as Pt,gK as Et,j1 as jt,f_ as kt,f$ as Tt,g0 as At,g1 as Rt}from"./index-JjEYIC4G.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-CIdYrDwO.js";import{R as Ot}from"./RootSelectionOverlay-QJRz70Z_.js";import{e as Lt,S as Ft}from"./surface-state-DgY1sYF4.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as B,t as Wt,p as Le,v as Ae,b as _t,e as Dt,l as Nt,i as $t}from"./camera-authoring-DYjhU5Zp.js";import{c as Gt}from"./performance-profiler-CMbwGBuk.js";import{m as Qt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Bt}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Ht}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ut}from"./render-settings-DgCYPHgH.js";import{createSoftParticleDepthPass as Kt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as qt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Xt,applySceneRenderPipeline as Jt}from"./setup-renderer-DroW21zu.js";import{EffectComposer as Yt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-Fg6BVKiU.js";import"./three-integration-BKGFte0g.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-C-dFTVWu.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-D8F-c141.js";import{a as Z}from"./entity-object-DBXB7ABG.js";import{w as vr}from"./editor-shell-store-B-64vpgA.js";import{p as wr}from"./viewport-root-presentation-CM-p4xLg.js";import{d as yr}from"./asset-editor-persistence-FoI6VqbB.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-B7ikfK7I.js";import{el as Cr,_ as ee,fo as N,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-D7VBwv9F.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-ClYksj6v.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board--jvx8x-C.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-KwcXV5-u.js";import"./inference-diagnostics-kHRsQw1P.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-CY3KFNVc.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-RAf4S6PI.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-DcUoY-0j.js";import"./model-thumbnail-ICdHSiW1.js";import"./studio-environment-D3HaysRE.js";import"./three-state-Bs6NttX2.js";import"./hierarchy-marks-DDRF3quV.js";import"./component-instance-root-BpMFxtbQ.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-Ct3Jwvkd.js";import"./content-bounds-BM2BJV41.js";import"./asset-preview-J56EM7ai.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-DL3yQMTk.js";import"./standard-viewport-dressing-BYqJ1RDj.js";import"./clip-planes-CnAI6DZn.js";import"./three-CqcAlmZt.js";import"./model-inspection-BMy0MuzJ.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-B1butaCp.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-BRmJcses.js";import"./collaboration-presence-CP5gEnxY.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=B(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Je,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx(G,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(Q,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Ye,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx(G,{text:"Camera actions",children:i.jsx(Q,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx($,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx($,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx($,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),_t(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=B();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx(G,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(Q,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:Dt,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx($,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx(G,{text:"Exit camera view",children:i.jsx(Q,{"aria-label":"Exit camera view",size:"compact",onClick:Nt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Qt(new nr({canvas:o,antialias:!!Ut(void 0).antialias,powerPreference:"high-performance"}));return Xt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Ht(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function _r(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function Dr(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Nr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function $r(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=_r(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:Dr(c),...Nr(r,s)}:null}function Gr(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Qr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Yt(a),E=Kt(),O=new qt,g=Gt(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,_e=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let H=Ce(c).background??re;b.background=new ee(H);const De=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===H&&(b.background=new ee(t)),H=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),Ne=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const U=new N,F=new N,ne=new N,oe=()=>{const t=n.renderCamera;t.getWorldPosition(U),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(U).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:U,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",K=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},$e=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),K?.(),K=null,h&&gr(a,h,S),h=null,S=null,I=null,Jt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:Gr(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(K=Bt(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},Ge=dr(ce);ce();const q=t=>$r(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=B().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=q(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Qe=$t({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?q(t):null},resolve:q,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new N),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Be=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const X=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{X.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const He=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,X.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),_=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,B().preview?.camera??null,r.cameraPreview())})})}const Ue=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),J=()=>wt(e.shell)===e.shell;function Ke(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,_=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;J()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),X.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),J()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),_&&be&&(_=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;J()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let Y,D;async function qe(t){if(P)return;r.onMountStatus("mounting"),D?.(),D=void 0,Y=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||Y!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||Y!==t){p();return}D=p,P||r.onMountStatus("ready")}const we=ar(e.shell,qe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,_=!0}),{scene:b,viewport:n,frame:Ke,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,_e(),Ue(),ge.disconnect(),Be(),He(),Qe(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),D?.(),k.dispose(),O.dispose(),L.dispose(),Ge(),$e(),De(),Ne(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Br({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Xe})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Hr({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Br,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Qr,Overlays:Hr};export{ko as worldRootStageBinding};
|