@volter/game-editor 0.5.68 → 0.5.70
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 +10941 -5080
- package/LICENSE +9 -10
- package/LICENSE-BLENDER +2 -2
- package/NOTICE +2 -2
- package/additions/canvas/package.json +8 -0
- package/additions/canvas/src/canvas-mount.ts +46 -0
- package/additions/canvas/src/scene2d.tsx +18 -0
- package/catalog/entries/bake.json +1 -1
- package/catalog/entries/blender.json +3 -3
- package/catalog/entries/music.json +5 -5
- package/catalog/project-source/LICENSE +6 -6
- package/catalog/project-source/src/contributions/bake.kind.ts +2 -2
- package/catalog/project-source/src/contributions/builder-document.tsx +1 -1
- package/catalog/project-source/src/contributions/builder-ui.tsx +3 -3
- package/catalog/project-source/src/contributions/module-source.ts +4 -4
- package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +59 -59
- package/catalog/project-source/src/lib/static-batch/Frozen.tsx +1 -1
- package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +1 -1
- package/catalog/project-source/src/tools/bake-preview.tool.ts +9 -9
- package/dist/.vite/manifest.json +4026 -4026
- package/dist/assets/{AssetBudgetPanel-P2PeL_X5.js → AssetBudgetPanel-DpXsaQ6w.js} +4 -4
- package/dist/assets/AudioViewer-BdTHfNhD.js +1 -0
- package/dist/assets/{CanvasBoardDocument-BFJdTVGp.js → CanvasBoardDocument-DY-7zohc.js} +1 -1
- package/dist/assets/CanvasSceneViewport-57CEFqSM.js +1 -0
- package/dist/assets/ColorInput-Co6tCY9p.js +1 -0
- package/dist/assets/{EntityModelDocument-Du8wIbyK.js → EntityModelDocument-C-lhKrxv.js} +1 -1
- package/dist/assets/{EnvironmentAssetDocument-_SttfMY_.js → EnvironmentAssetDocument-BNe6ANTN.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-CWudWnfd.js → GameplaySessionTimeline-CryFYfYN.js} +1 -1
- package/dist/assets/ImageViewer-DiD2yIG4.js +1 -0
- package/dist/assets/{InspectorCanvasPreview-CEr_Kxna.js → InspectorCanvasPreview-BrFjhoiD.js} +1 -1
- package/dist/assets/InspectorObjectPreview-BBVO8bDT.js +1 -0
- package/dist/assets/JsonAssetDocument-xyXetSbl.js +2 -0
- package/dist/assets/{LiveModuleDocument-BWjOzO_6.js → LiveModuleDocument-BiAunjHS.js} +1 -1
- package/dist/assets/{LutAssetDocument-DIc6nsht.js → LutAssetDocument-5sW-5rb0.js} +1 -1
- package/dist/assets/{ModelAssetDocument-_CqTsX_A.js → ModelAssetDocument-Bdy7x47a.js} +1 -1
- package/dist/assets/{NonThreeAuthoringBootstrap-C-V23E1e.js → NonThreeAuthoringBootstrap-BP-1bVEr.js} +1 -1
- package/dist/assets/Object3DDocumentToolbar-CvnSLDPI.js +1 -0
- package/dist/assets/Object3DDocumentViewport-BE_OPc8T.js +2 -0
- package/dist/assets/{Object3DPreview-BPHEr3vI.js → Object3DPreview-D3w_dKrX.js} +1 -1
- package/dist/assets/OnlineAssetDetail-BnT8_p1W.js +1 -0
- package/dist/assets/PlayBar-C8Mn-EI0.js +1 -0
- package/dist/assets/{QuarksAssetDocument-4Dne3EHx.js → QuarksAssetDocument-DLMH5Csk.js} +1 -1
- package/dist/assets/ReactCanvasControls-rNz8syVB.js +1 -0
- package/dist/assets/RootSelectionOverlay-Cn2Rbr1N.js +1 -0
- package/dist/assets/{ShaderAssetDocument-W3ZjLCkt.js → ShaderAssetDocument-CsJCsNfA.js} +4 -4
- package/dist/assets/ShadowEditor-jB05hr1W.js +1 -0
- package/dist/assets/{SourceAssetViewer-BGUeDAEv.js → SourceAssetViewer-D0NgGrER.js} +1 -1
- package/dist/assets/StageHost-B3Yt4I7r.js +2 -0
- package/dist/assets/{StoryPreviewMount-Di8uMovM.js → StoryPreviewMount-CzzRn24c.js} +1 -1
- package/dist/assets/ThreeBoardDocument-BoHTN4Vl.js +2 -0
- package/dist/assets/{ThreeIsolationSceneContent-BAKurKW5.js → ThreeIsolationSceneContent-BM-0S6J5.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-CffvGJ1h.js → ToolObject3DPreview-BeM_kx_u.js} +1 -1
- package/dist/assets/Toolbar-BZyog9MR.js +1 -0
- package/dist/assets/{TransientHint-CgmkrmKF.js → TransientHint-RJEkOJoy.js} +1 -1
- package/dist/assets/VideoViewer-CxajgKrf.js +1 -0
- package/dist/assets/ViewportShadingMenu-S2lADFJg.js +1 -0
- package/dist/assets/active-ingest-CjZtqL7Q.js +3 -0
- package/dist/assets/{animation-clock-fLmY_3--.js → animation-clock-CWVW-mqY.js} +1 -1
- package/dist/assets/animation-mixers.service-CpoYw8cs.js +1 -0
- package/dist/assets/animation-timeline.utility-CEerojaB.js +1 -0
- package/dist/assets/{asset-budget-asset.menu-BDRDWrvx.js → asset-budget-asset.menu-Bk6scVWQ.js} +1 -1
- package/dist/assets/{asset-budget.action-tQmNGQHC.js → asset-budget.action-DtBDSfDj.js} +1 -1
- package/dist/assets/{asset-budget.document-BthgX37Z.js → asset-budget.document-R2zyoJ8E.js} +1 -1
- package/dist/assets/{asset-budget.menu-DfyWVH6p.js → asset-budget.menu-D6jza5Bc.js} +1 -1
- package/dist/assets/asset-editor-persistence-DrgwOZIW.js +1 -0
- package/dist/assets/asset-loaders-CUeYIjeH.js +2 -0
- package/dist/assets/{asset-preview-Cv7tfD98.js → asset-preview-CQfnI2cX.js} +1 -1
- package/dist/assets/{audio-unlock.service-BvHvZjzx.js → audio-unlock.service-W3UBKsw9.js} +1 -1
- package/dist/assets/audio.utility-qrXBdGXg.js +1 -0
- package/dist/assets/autoplay.service-DQD3Swo9.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-Cg5ALSpr.js → babylon-authoring-adapter-CS9LZNmz.js} +1 -1
- package/dist/assets/binding-resolver-B9VI52zt.js +2 -0
- package/dist/assets/blender-emscripten-engine-Cd6az4pU.js +2 -0
- package/dist/assets/{blender-node-editor.document-B92MO51u.js → blender-node-editor.document-BWLFvA2g.js} +1 -1
- package/dist/assets/{blender-properties-tab-CDVyDAbf.js → blender-properties-tab-BSmWG9d0.js} +1 -1
- package/dist/assets/{blender-runtime-host-CuniE0sy.js → blender-runtime-host-Cbkie7m4.js} +2 -2
- package/dist/assets/{blender-runtime-skin-B_tOz5j5.js → blender-runtime-skin-C_ATCb-z.js} +7 -7
- package/dist/assets/{blender-runtime.document-DxUwLiEW.js → blender-runtime.document-P9zdgwMt.js} +7 -7
- package/dist/assets/{blender-timeline.document-BdEEoQbK.js → blender-timeline.document-DRwySEJO.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-EMSUlRh4.js → blender-uv-editor.document-CmLoL2Vo.js} +1 -1
- package/dist/assets/blender-version.status-CP4Jqkry.js +1 -0
- package/dist/assets/blender-wali-engine-CZcS3eAd.js +2 -0
- package/dist/assets/{blender.command-BkBML2SY.js → blender.command-BYGm0Q_s.js} +1 -1
- package/dist/assets/blender.status-BMETIbb2.js +1 -0
- package/dist/assets/board-guides-BG-MHK2G.js +1 -0
- package/dist/assets/body-marks-C1LxJtQb.js +1 -0
- package/dist/assets/{bridge.command-VnplZ81v.js → bridge.command-DpUNErKN.js} +3 -3
- package/dist/assets/{browserAll-BCmkqg8n.js → browserAll-DES3i79H.js} +1 -1
- package/dist/assets/{build-player.document-DV7YcJQt.js → build-player.document-B42HrdSU.js} +1 -1
- package/dist/assets/build-profiles.document-Di5CQoH9.js +2 -0
- package/dist/assets/build-progress.status-B4te7-3j.js +1 -0
- package/dist/assets/{build-session-BGe0eGrQ.js → build-session-Yw4JoE8T.js} +2 -2
- package/dist/assets/{build.action-Bdj4ZEL_.js → build.action-B-DBpUj6.js} +1 -1
- package/dist/assets/{build.command-DAWiYvPa.js → build.command-CfWoHNp0.js} +1 -1
- package/dist/assets/build.header-BaURztYD.js +1 -0
- package/dist/assets/{build.menu-BiRNC_xc.js → build.menu-BFBn-dPJ.js} +1 -1
- package/dist/assets/{build.service-Dw9K6VSF.js → build.service-D8gYWB3n.js} +1 -1
- package/dist/assets/{camera-C-qXzXFf.js → camera-C-uR_xQp.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-BDrwWRlU.js → camera-runtime.inspector-BOGGEqVq.js} +1 -1
- package/dist/assets/{canvas-design-mount-DLn49Zle.js → canvas-design-mount-DamLAaWn.js} +4 -4
- package/dist/assets/canvas-entry-runtime-a6N7Rsrj.js +2 -0
- package/dist/assets/{canvas-preview-frames-B5xFRjhQ.js → canvas-preview-frames-XbrKuyJu.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-DQ_leYyi.js → canvas-story-capture.service-DYRdEzkG.js} +2 -2
- package/dist/assets/capability-coverage-7wKVA3PF.js +7 -0
- package/dist/assets/{collaboration-presence-BOS1t8wI.js → collaboration-presence-DaVKEfxs.js} +1 -1
- package/dist/assets/{collider-Bf4Uk6LW.js → collider-BEwlgkG5.js} +1 -1
- package/dist/assets/component-board.service-BWSBM2Bb.js +2 -0
- package/dist/assets/{component-board.service-DFSSCaCf.js → component-board.service-C9ZouakC.js} +2 -2
- package/dist/assets/{component-board.service-CpVXGhz5.js → component-board.service-D2eGKqHf.js} +2 -2
- package/dist/assets/component-contracts.service-D0uElctD.js +1 -0
- package/dist/assets/component-instance-root-C1Xf4SwR.js +1 -0
- package/dist/assets/{component-verbs.command-DGzZAV_Z.js → component-verbs.command-N-Tj8KOS.js} +1 -1
- package/dist/assets/{component-verbs.service-D1rVRogp.js → component-verbs.service-CWh4mQ7X.js} +1 -1
- package/dist/assets/{config-D-EAAhqP.js → config-hmmj-QHZ.js} +4 -4
- package/dist/assets/{configurations-_HZOWZPy.js → configurations-B9Pi_eRN.js} +1 -1
- package/dist/assets/connection.status-C2HPxoww.js +1 -0
- package/dist/assets/{constraint-5KLYpGm7.js → constraint-Bp1l8hY-.js} +1 -1
- package/dist/assets/constraints.inspector-D-h1f3K2.js +1 -0
- package/dist/assets/{content-bounds-DKBD7nsv.js → content-bounds-7UyI42Vj.js} +1 -1
- package/dist/assets/{contract-system-adapters-h6OUBRYA.js → contract-system-adapters-Bq1LGdjs.js} +1 -1
- package/dist/assets/coverage.service-BiBikIsV.js +3 -0
- package/dist/assets/{create-runtime-Bg2uYMfh.js → create-runtime-Cx-q5z2y.js} +2 -2
- package/dist/assets/curve-Co_mro-I.js +1 -0
- package/dist/assets/{data-asset-7Nfmx-28.js → data-asset-Ckx4D_U_.js} +1 -1
- package/dist/assets/data-check-core-CHqar_E8.js +1 -0
- package/dist/assets/data-ref-70PUrMuT.js +1 -0
- package/dist/assets/debug-bridge-CarsgKpm.js +1 -0
- package/dist/assets/debug-registry-DgYNlhH_.js +1 -0
- package/dist/assets/{deferred-ingest-play-Bej67_y9.js → deferred-ingest-play-Bpdhu2i-.js} +2 -2
- package/dist/assets/{design-time-canvas-mount-CFW9ZWuk.js → design-time-canvas-mount-Ca9Q75Ui.js} +2 -2
- package/dist/assets/design-time-layers-BIb71snu.js +1 -0
- package/dist/assets/{design-time-mount.service-DJeAPUB_.js → design-time-mount.service-DL6ZK2TQ.js} +2 -2
- package/dist/assets/{design-time-mount.service-_R1UDCw3.js → design-time-mount.service-zKUVjKAu.js} +2 -2
- package/dist/assets/design-time-react-mount-NrWimSxY.js +1 -0
- package/dist/assets/{document-preview-three-5cbuuJMH.js → document-preview-three-DoDs6q1q.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-CoESNvrM.js → dom-authoring-adapter-adLQog9l.js} +1 -1
- package/dist/assets/{draco3d-Sk9K4AUT.js → draco3d-aUvQF1Zx.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-CH6J-8N7.js → edit-mode-audio.service-CHZ1ultu.js} +1 -1
- package/dist/assets/edit-mode-authoring-ZQuUwc6e.js +1 -0
- package/dist/assets/{edit-mode-networking.service-C4o2pGHX.js → edit-mode-networking.service-C7fk2fL1.js} +1 -1
- package/dist/assets/editor-api-C8MUOrwt.js +1 -0
- package/dist/assets/{editor-layers-B4oYfpj8.js → editor-layers-CGX7iCSP.js} +1 -1
- package/dist/assets/editor-presentation-activity-CqJH4G9t.js +1 -0
- package/dist/assets/{editor-shell-store-Bh1S7M54.js → editor-shell-store-BRqB1JZO.js} +1 -1
- package/dist/assets/{entity-object-B_5Gc0Ky.js → entity-object--ZpqIat7.js} +1 -1
- package/dist/assets/{extend-DcEyE5jI.js → extend-BZQIQ18F.js} +1 -1
- package/dist/assets/{fork-menu-CKjNh3MO.js → fork-menu-CziehkPx.js} +1 -1
- package/dist/assets/{frame-debugger-store-D5YViF_8.js → frame-debugger-store-BOQjrPsh.js} +1 -1
- package/dist/assets/game-audio-BeCyd0Ha.js +1 -0
- package/dist/assets/{game-contract-seams-C0AVYwvO.js → game-contract-seams-Dgqv6S8X.js} +1 -1
- package/dist/assets/{game-css-scope-transform-8GOvVu1s.js → game-css-scope-transform-anfk8vP_.js} +2 -2
- package/dist/assets/game-document.service-CqmgrRUA.js +1 -0
- package/dist/assets/game-eval.command-CoetFm6_.js +2 -0
- package/dist/assets/game-module-access-Cg1EB8Mx.js +1 -0
- package/dist/assets/game-network-BqI-Ehz0.js +22 -0
- package/dist/assets/{gameplay-export-K5AcStVC.js → gameplay-export-D0hZoeSg.js} +1 -1
- package/dist/assets/gameplay-replay-BHz6VAVa.js +1 -0
- package/dist/assets/{gameplay.command-DoWqBWhH.js → gameplay.command-CPc9GKuW.js} +1 -1
- package/dist/assets/generation-CdOATubd.css +1 -0
- package/dist/assets/{generation-jobs-CiabIfR0.js → generation-jobs-D-zXQNZI.js} +1 -1
- package/dist/assets/generation.service-Bwt9lQEG.js +1 -0
- package/dist/assets/{generations-DU9rCeQR.js → generations-d-U9lCVo.js} +1 -1
- package/dist/assets/generations.status-BQ8xhaLN.js +1 -0
- package/dist/assets/hierarchy-marks-CndAXtie.js +1 -0
- package/dist/assets/hierarchy-marks-CsTaTkc7.js +1 -0
- package/dist/assets/hosted-asset-materialization-r2vKfJGY.js +2 -0
- package/dist/assets/{ibl-override-material-CiKkaOTW.js → ibl-override-material-CMo_a49U.js} +1 -1
- package/dist/assets/index-BMxv2MNV.js +1 -0
- package/dist/assets/index-BPVnvJfX.js +1 -0
- package/dist/assets/{index-C4AUQbmq.js → index-BqzpzjSB.js} +1 -1
- package/dist/assets/{index-CC1puVjo.js → index-CMU7lnXk.js} +1 -1
- package/dist/assets/index-CPiRKiDC.css +1 -0
- package/dist/assets/{index-CaG87ZF-.js → index-Cr9NTnJp.js} +271 -270
- package/dist/assets/index-DSMLYme2.js +1 -0
- package/dist/assets/index-DoGlzvsX.js +1 -0
- package/dist/assets/{index-BsYc2Oyj.js → index-dlvCCB72.js} +1 -1
- package/dist/assets/{index-Kb9_s5aP.js → index-xjc_62Ha.js} +1 -1
- package/dist/assets/{index-C20Flc1s.js → index-z0_InXxO.js} +2 -2
- package/dist/assets/{inference-diagnostics-MGcIHEX6.js → inference-diagnostics-D5jfxI5p.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-D2okO6JI.js → ingest-boot-viewport-Be0v44yf.js} +1 -1
- package/dist/assets/ingest-siblings-BowXSozE.js +1 -0
- package/dist/assets/ingest-source-persistence-BGIvThcv.js +1 -0
- package/dist/assets/ingest.service-wVm-ZcTI.js +1 -0
- package/dist/assets/{inspect-C8RP8G5F.js → inspect-CN92MgRT.js} +1 -1
- package/dist/assets/inspection-D8fZOHCM.js +1 -0
- package/dist/assets/instances.command-B6gJuL1Z.js +1 -0
- package/dist/assets/{json-history-resource-CTXRV4GD.js → json-history-resource-C9G_vCX9.js} +1 -1
- package/dist/assets/{layered-pick-B_-BRrRD.js → layered-pick-D9tIz_m7.js} +1 -1
- package/dist/assets/{light-CskDQ8gF.js → light-BGbl1a8K.js} +1 -1
- package/dist/assets/{live-project-verbs-BOAQN3ME.js → live-project-verbs-p1sdTwhF.js} +1 -1
- package/dist/assets/{machine.document-BxOoCOo9.js → machine.document-C1acXU7l.js} +1 -1
- package/dist/assets/{machines.finder-CqEceWzS.js → machines.finder-sOxNTYPx.js} +1 -1
- package/dist/assets/material-D7289cYI.js +1 -0
- package/dist/assets/{material-factory-qB9pzcQf.js → material-factory-D0T-DH8c.js} +1 -1
- package/dist/assets/{mesh-5--4qA-C.js → mesh-1A-HHxD6.js} +1 -1
- package/dist/assets/model-asset-sections-D1uxOu2v.css +1 -0
- package/dist/assets/model-asset-sections.service-DF-mllTL.js +1 -0
- package/dist/assets/{model-inspection-MrJY0U_-.js → model-inspection-CuVwNVvv.js} +1 -1
- package/dist/assets/{model-thumbnail-uk-2sblh.js → model-thumbnail-xm1Fabi2.js} +1 -1
- package/dist/assets/{models.finder-rk8dhgO8.js → models.finder-DrvU1qGk.js} +1 -1
- package/dist/assets/module-mode-BHOAAbgO.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-aVZkVNh4.js +2 -0
- package/dist/assets/mount-dom-ingest-root-eOOGPaxi.js +2 -0
- package/dist/assets/{mount-ingest-root-BC3-1Cw1.js → mount-ingest-root-BsWbEvr_.js} +2 -2
- package/dist/assets/{mount-manifest-QJOB11Kv.js → mount-manifest-t6ipNsoF.js} +1 -1
- package/dist/assets/mount-readiness-DyAd17pe.js +4 -0
- package/dist/assets/mount-three-ingest-root-DIR0wKrN.js +1 -0
- package/dist/assets/{mounted-authoring-B7RL_V28.js → mounted-authoring-DX3DC9PJ.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-CnYhX3vW.js → mounted-story-viewport-source-D8FqGpci.js} +1 -1
- package/dist/assets/{native-debug-module-B-rWJfWE.js → native-debug-module-CB738yQu.js} +1 -1
- package/dist/assets/{navigation-BVu-aVmF.js → navigation-B9ihB0qU.js} +1 -1
- package/dist/assets/{navmesh.menu-C3M63eR4.js → navmesh.menu-CPxr9LPT.js} +1 -1
- package/dist/assets/{navmesh.service-B0H1fUfn.js → navmesh.service-BAtili_Y.js} +1 -1
- package/dist/assets/network-observer.service-CqTuZNtI.js +1 -0
- package/dist/assets/network.utility-CclYEmfV.js +1 -0
- package/dist/assets/object-marks-BnvSuCTt.js +1 -0
- package/dist/assets/{object3d-authoring-subject-BDrxd1GA.js → object3d-authoring-subject-XccsO0xG.js} +1 -1
- package/dist/assets/{object3d-document-session-registry-OjqzJ86S.js → object3d-document-session-registry-BWeuL0nf.js} +2 -2
- package/dist/assets/{oid-transform-Bzc2ZJSH.js → oid-transform-BYeAsBKI.js} +1 -1
- package/dist/assets/{particles-Be7AvO4c.js → particles-BXiQDiB-.js} +1 -1
- package/dist/assets/{performance-profiler-OwnXQX0M.js → performance-profiler-CMbwGBuk.js} +1 -1
- package/dist/assets/pixi-authoring-adapter-CPsN0Yk7.js +1 -0
- package/dist/assets/pixi-live-write-target-BUbt5ixX.js +1 -0
- package/dist/assets/{play.command-CIGRq8ow.js → play.command-Bz5Ra6Uj.js} +2 -2
- package/dist/assets/pose-guard-CLabLSzf.js +1 -0
- package/dist/assets/presentation-C7ZHYsKF.js +1 -0
- package/dist/assets/{product-BN31wSnB.js → product-MSpbAqgo.js} +1 -1
- package/dist/assets/{profiler.action-D57Kj9ym.js → profiler.action-1Jbc-7Q4.js} +1 -1
- package/dist/assets/{profiler.menu-Dh9Q5DDx.js → profiler.menu-C544DxWZ.js} +1 -1
- package/dist/assets/profiler.utility-QnzedS3X.js +1 -0
- package/dist/assets/{project-authoring-session-LCJAwGrD.js → project-authoring-session-BhNfg7TY.js} +2 -2
- package/dist/assets/project-provenance-BGnJXJwa.js +1 -0
- package/dist/assets/{properties-bone-constraints.inspector-CaIDq5nN.js → properties-bone-constraints.inspector-DRCPfugt.js} +1 -1
- package/dist/assets/{properties-bone.inspector-D2fcQGMF.js → properties-bone.inspector-CYHeZX0p.js} +1 -1
- package/dist/assets/{properties-collection.inspector-CF5AtTAd.js → properties-collection.inspector-DtGhPkiU.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-Bj2itDrS.js → properties-constraints.inspector-TIyIV777.js} +1 -1
- package/dist/assets/{properties-data.inspector-BfRqk0Xo.js → properties-data.inspector-vA0MTaup.js} +1 -1
- package/dist/assets/{properties-material.inspector-Bf8H0mvu.js → properties-material.inspector-C73spBQh.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-BKShc1TH.js → properties-modifiers.inspector-9oyLBBE0.js} +1 -1
- package/dist/assets/{properties-object.inspector-YBh8ABnN.js → properties-object.inspector-7BuiUgbd.js} +1 -1
- package/dist/assets/{properties-output.inspector-CVkzfs-l.js → properties-output.inspector-CjYAggz2.js} +1 -1
- package/dist/assets/{properties-particles.inspector-ChDpAq-2.js → properties-particles.inspector-DpSfjykX.js} +1 -1
- package/dist/assets/{properties-physics.inspector-BLEM7aMj.js → properties-physics.inspector-BUTvmfU9.js} +1 -1
- package/dist/assets/{properties-render.inspector-vU4D9xLL.js → properties-render.inspector-CEdsDqbI.js} +1 -1
- package/dist/assets/{properties-scene.inspector-C-DoN-kL.js → properties-scene.inspector-4kp0sLNw.js} +1 -1
- package/dist/assets/{properties-texture.inspector-DySxy1oU.js → properties-texture.inspector-Ckpqy9eo.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-DEKxMahJ.js → properties-view-layer.inspector-CQIFbY8-.js} +1 -1
- package/dist/assets/{properties-world.inspector-m5qL_TQV.js → properties-world.inspector-xZgNV6rI.js} +1 -1
- package/dist/assets/r3f-design-session-D8VF-hty.js +2 -0
- package/dist/assets/{r3f-physics-binding-Bgzzd4ol.js → r3f-physics-binding-oippu1v_.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-C8oMjdTL.js → r3f-source-authoring-adapter-CZJX6VLM.js} +1 -1
- package/dist/assets/react-canvas-navigation-DuzvnFoN.js +1 -0
- package/dist/assets/react-inspector.service-CV4p6nrb.js +1 -0
- package/dist/assets/react-story-board-mhldts6w.js +1 -0
- package/dist/assets/{react-three-rapier.esm-BR2ttgLS.js → react-three-rapier.esm-Bo9LjrZe.js} +1 -1
- package/dist/assets/react-world-authoring-adapter-CuyruDfq.js +1 -0
- package/dist/assets/{realm-services-DefTrXnY.js → realm-services-BtiLE3a-.js} +1 -1
- package/dist/assets/reflection-probe-capture.inspector-mrrOHs-9.js +1 -0
- package/dist/assets/{reflection-probe-BHNGwVyz.js → reflection-probe-sIto9mh0.js} +1 -1
- package/dist/assets/registry-DpUr2YIM.js +1 -0
- package/dist/assets/{relative-import-specifier-DQzkawgj.js → relative-import-specifier-CyT6yU4l.js} +1 -1
- package/dist/assets/{render-env-BZ7LsGfk.js → render-env-C63BGT5v.js} +1 -1
- package/dist/assets/{render-features-C7QwmhCo.js → render-features-CBl6rom9.js} +1 -1
- package/dist/assets/{render-settings-BBvkacR3.js → render-settings-DjarlnjI.js} +1 -1
- package/dist/assets/resolve-three-OiswFiIS.js +702 -0
- package/dist/assets/root-seam-contract-BYLQx4CQ.js +1 -0
- package/dist/assets/{run-selection-BUeubtHj.js → run-selection-BMu0v3qC.js} +1 -1
- package/dist/assets/scene-capture-BLf3lJ44.js +1 -0
- package/dist/assets/scene-document.service-CjPDph5k.js +2 -0
- package/dist/assets/{scene-framing-PVMqGU8h.js → scene-framing-BhNk0WhI.js} +1 -1
- package/dist/assets/{scene-index--lRWLEmW.js → scene-index-DHeKmalD.js} +1 -1
- package/dist/assets/{scene-query-s1y04OVB.js → scene-query-ByZtXA2m.js} +1 -1
- package/dist/assets/seeded-random-DmdE0u-C.js +1 -0
- package/dist/assets/{session-CTXsU1lK.js → session-CeyQA0Dv.js} +35 -35
- package/dist/assets/{setup-renderer-OOw1SykJ.js → setup-renderer-Bf8g2S0f.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-RmutT5Dt.js → source-object3d-authoring-adapter-IDRws2Nk.js} +1 -1
- package/dist/assets/{source-persistence-backend-HviqjKZ2.js → source-persistence-backend-Dzc6MsmN.js} +1 -1
- package/dist/assets/{spark-renderer-lifecycle-DfYpvEJa.js → spark-renderer-lifecycle-B6Axb6jm.js} +1 -1
- package/dist/assets/{stage-keyboard-DDi7S27C.js → stage-keyboard-CpnIYiph.js} +1 -1
- package/dist/assets/stage-overlay-set-BrJzOTCe.js +1 -0
- package/dist/assets/stage-presence-markers-BFTl9Djp.js +1 -0
- package/dist/assets/stage-transform-tools-QaenmSrC.js +1 -0
- package/dist/assets/standard-viewport-dressing-DuKH01r4.js +24 -0
- package/dist/assets/{state-watch.action-DEdb1mNa.js → state-watch.action-BaRZ6YII.js} +1 -1
- package/dist/assets/{state-watch.menu-jWbUM3kw.js → state-watch.menu-DR2AtQ6r.js} +1 -1
- package/dist/assets/state-watch.utility-VW8H9Fgi.js +1 -0
- package/dist/assets/{story-capture-Dj1xkeKH.js → story-capture-BEVV48wm.js} +1 -1
- package/dist/assets/story-documents-DndjqJ7Y.js +3 -0
- package/dist/assets/{story-documents.service-BzQCuNBu.js → story-documents.service-CPrZ7gRM.js} +1 -1
- package/dist/assets/{story-documents.service-iNP-ORNr.js → story-documents.service-wCVmBPhh.js} +1 -1
- package/dist/assets/{story-media-presence-zTPlU9HR.js → story-media-presence-BSX78yVJ.js} +1 -1
- package/dist/assets/{story-pixi-preview-B7THvSl7.js → story-pixi-preview-D4FuH7lJ.js} +1 -1
- package/dist/assets/{story-presentation-BLXYPadR.js → story-presentation-2AxtnKGb.js} +1 -1
- package/dist/assets/story-three-preview-DjObHSAF.js +2 -0
- package/dist/assets/{structural-ids-Br2zjINh.js → structural-ids-BOo2BRoY.js} +1 -1
- package/dist/assets/studio-environment-B--4k2mN.js +2 -0
- package/dist/assets/{surface-state-D9j6qNu8.js → surface-state-CQHVfsma.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-BTnsMOvH.js → syntactic-prop-specs-CewRyC4c.js} +1 -1
- package/dist/assets/team-playtest.service-B9m6CNk7.js +1 -0
- package/dist/assets/{three-oYrcK5SQ.js → three-B86IzdNg.js} +1 -1
- package/dist/assets/three-authoring-adapter-BD8_MtYK.js +1 -0
- package/dist/assets/three-authoring.service-BjJ9wetk.js +2 -0
- package/dist/assets/{three-ingest-runtime-CXKjNysA.js → three-ingest-runtime-CXySzulx.js} +1 -1
- package/dist/assets/{three-integration-CuAnYaTW.js → three-integration-nl5TC6EF.js} +2 -2
- package/dist/assets/three-integration.service-BEk5QkKM.js +1 -0
- package/dist/assets/three-projection-core-D4m8lsPU.js +1 -0
- package/dist/assets/{three-state-wXRU3rLr.js → three-state-C36FeFK4.js} +1 -1
- package/dist/assets/{three-story-capture.service-DMJRcqjr.js → three-story-capture.service-C0icETyL.js} +2 -2
- package/dist/assets/{three-story-model-DgiAP-oQ.js → three-story-model-CqWu9S2a.js} +1 -1
- package/dist/assets/three-viewport-presentation-CCMgGLI2.js +141 -0
- package/dist/assets/tools-BnE3UWVA.js +1 -0
- package/dist/assets/transform-mode-request-CIgYj1Qb.js +1 -0
- package/dist/assets/transport-strip-B1AJKpn-.js +1 -0
- package/dist/assets/transport.header-D-n6dQ5n.js +1 -0
- package/dist/assets/{trigger-volume-DP0G1VBe.js → trigger-volume-BLkHmfm9.js} +1 -1
- package/dist/assets/tuples-uyiMYXrv.js +1 -0
- package/dist/assets/ui-board-document-6e4w4a8B.js +2 -0
- package/dist/assets/{user-data-CqOoAowZ.js → user-data-BXFD1jg-.js} +1 -1
- package/dist/assets/user-data-CODoGZqA.js +1 -0
- package/dist/assets/{utility-view-state-Db97zwDz.js → utility-view-state-I_o0WThv.js} +1 -1
- package/dist/assets/viewport-door-AsLxGhLN.js +1 -0
- package/dist/assets/{viewport-root-presentation-B35t51xX.js → viewport-root-presentation-B1qtThOB.js} +1 -1
- package/dist/assets/{viewport-surface-status-D5kZtFW5.js → viewport-surface-status-CWmQeKTO.js} +1 -1
- package/dist/assets/{webworkerAll-CfKEb4Ao.js → webworkerAll-DC445ANd.js} +1 -1
- package/dist/assets/worker-jepHAPPr.js +2 -0
- package/dist/assets/workspace-arrangement-dkubzCff.js +1 -0
- package/dist/assets/world-documents-psBK5u_2.js +1 -0
- package/dist/assets/world-root-stage-binding-BrvO8VMz.js +1 -0
- package/dist/assets/{xstate-animation-binding-aQEmNSpm.js → xstate-animation-binding-ChVFHSlM.js} +1 -1
- package/dist/assets/{xstate-animation-meta-CnMX1Sc1.js → xstate-animation-meta-D7xnhyCE.js} +1 -1
- package/dist/volter-shared-react.json +10 -0
- package/dist/volter-shared-three.json +3 -0
- package/dist-node/cli.js +247 -209
- package/dist-node/create.js +90 -74
- package/package.json +20 -19
- package/src/contributions.d.ts +1 -1
- package/src/index.ts +10 -10
- package/starter/cube.py +1 -1
- package/template/.agents/references/project-manual.md +17 -18
- package/template/.agents/skills/editor/SKILL.md +6 -6
- package/template/.agents/skills/editor/agents/openai.yaml +3 -3
- package/template/.agents/skills/editor/references/editor-control.md +62 -62
- package/template/.agents/skills/{vgai-3d-models → volter-3d-models}/SKILL.md +3 -3
- package/template/.agents/skills/{vgai-ingest-existing-game → volter-ingest-existing-game}/SKILL.md +3 -3
- package/template/.agents/skills/{vgai-music → volter-music}/SKILL.md +7 -7
- package/template/{.github/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/SKILL.md +9 -9
- package/template/.agents/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
- package/template/{.claude/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
- package/template/.claude/skills/editor/SKILL.md +6 -6
- package/template/.claude/skills/editor/agents/openai.yaml +3 -3
- package/template/.claude/skills/editor/references/editor-control.md +62 -62
- package/template/{.github/skills/vgai-3d-models → .claude/skills/volter-3d-models}/SKILL.md +3 -3
- package/template/{.github/skills/vgai-ingest-existing-game → .claude/skills/volter-ingest-existing-game}/SKILL.md +3 -3
- package/template/.claude/skills/{vgai-threejs-authoring → volter-threejs-authoring}/SKILL.md +9 -9
- package/template/.claude/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
- package/template/{.agents/skills/vgai-threejs-authoring → .claude/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
- package/template/.github/copilot-instructions.md +1 -1
- package/template/.github/skills/editor/SKILL.md +6 -6
- package/template/.github/skills/editor/agents/openai.yaml +3 -3
- package/template/.github/skills/editor/references/editor-control.md +62 -62
- package/template/{.claude/skills/vgai-3d-models → .github/skills/volter-3d-models}/SKILL.md +3 -3
- package/template/{.claude/skills/vgai-ingest-existing-game → .github/skills/volter-ingest-existing-game}/SKILL.md +3 -3
- package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/SKILL.md +9 -9
- package/template/.github/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.github/skills/{vgai-threejs-authoring → volter-threejs-authoring}/references/helper-catalog.md +1 -1
- package/template/.mcp.json +3 -3
- package/template/AGENTS.md +25 -25
- package/template/DEVLOG.md +1 -1
- package/template/IDIOMS.md +3 -3
- package/template/LICENSE +3 -3
- package/template/README.md +12 -13
- package/template/check-idioms.ts +71 -95
- package/template/manifest-entry-modules-plugin.ts +17 -4
- package/template/package.json +13 -15
- package/template/server/colyseus-setup.ts +1 -9
- package/template/server/main.ts +4 -9
- package/template/server/rooms/arena-room.ts +10 -10
- package/template/server/rooms/game-room.ts +10 -10
- package/template/server/rooms.ts +3 -5
- package/template/src/bot/QaTester.tsx +1 -1
- package/template/src/bot/bot-station.ts +2 -2
- package/template/src/bot/tester-station.ts +1 -1
- package/template/src/contributions/README.md +1 -1
- package/template/src/contributions/analytics.analytics.tsx +1 -1
- package/template/src/contributions/data.document.tsx +2 -2
- package/template/src/contributions/pages.finder.ts +1 -1
- package/template/src/contributions/tester.inspector.tsx +2 -2
- package/template/src/contributions/use-game-modules.ts +1 -1
- package/template/src/input.ts +1 -1
- package/template/src/lib/reflections/volume-reflection-material.ts +59 -59
- package/template/src/lib/static-batch/Frozen.tsx +1 -1
- package/template/src/lib/static-batch/mutation-watch.ts +1 -1
- package/template/src/main.ts +19 -38
- package/template/src/manifest-entry-modules.d.ts +12 -1
- package/template/src/net/NetworkedPlayers.tsx +3 -3
- package/template/src/prefabs/HeroBox.stories.tsx +1 -1
- package/template/src/world.tsx +1 -1
- package/template/tsconfig.json +1 -1
- package/template/validate-manifest.ts +3 -3
- package/template/vite.config.ts +12 -12
- package/template/{vgai.adapter.ts → volter.adapter.ts} +1 -1
- package/template/{vgai.project.json → volter.project.json} +2 -2
- package/template-dotfiles/gitignore +27 -27
- package/workbench/src/media/game-cover.css +11 -11
- package/workbench/src/product.contribution.ts +28 -28
- package/workbench/src/{vgaiGameSkew.ts → volterGameSkew.ts} +16 -16
- package/dist/assets/AudioViewer-xFb5Wv7A.js +0 -1
- package/dist/assets/CanvasSceneViewport-vqBlOz8P.js +0 -1
- package/dist/assets/ColorInput-CX1UZjYO.js +0 -1
- package/dist/assets/ImageViewer-shZzMd91.js +0 -1
- package/dist/assets/InspectorObjectPreview-BMOvJaOw.js +0 -1
- package/dist/assets/JsonAssetDocument-D_HXneWE.js +0 -2
- package/dist/assets/Object3DDocumentToolbar-BfPH9jz5.js +0 -1
- package/dist/assets/Object3DDocumentViewport-BaXWtATg.js +0 -2
- package/dist/assets/OnlineAssetDetail-BxibUH6K.js +0 -1
- package/dist/assets/PlayBar-DRANyO01.js +0 -1
- package/dist/assets/ReactCanvasControls-K98jOX9b.js +0 -1
- package/dist/assets/RootSelectionOverlay-BQC12Gdd.js +0 -1
- package/dist/assets/ShadowEditor-DP1LWynl.js +0 -1
- package/dist/assets/StageHost-V_0opXFt.js +0 -2
- package/dist/assets/ThreeBoardDocument-tgcaZDqQ.js +0 -2
- package/dist/assets/Toolbar-uLgsrB2z.js +0 -1
- package/dist/assets/VideoViewer-ClUJ6_uy.js +0 -1
- package/dist/assets/ViewportShadingMenu-Bdkc6jcd.js +0 -1
- package/dist/assets/active-ingest-CnAeQcuQ.js +0 -3
- package/dist/assets/animation-mixers.service-DiecMX_A.js +0 -1
- package/dist/assets/animation-timeline.utility-C71vPJgs.js +0 -1
- package/dist/assets/asset-editor-persistence-BQgjOCrm.js +0 -1
- package/dist/assets/asset-loaders-5PIUVvmH.js +0 -2
- package/dist/assets/audio.utility-D9Vk_WYS.js +0 -1
- package/dist/assets/autoplay.service-CFJoLPLw.js +0 -1
- package/dist/assets/binding-resolver-C_9MBSMa.js +0 -2
- package/dist/assets/blender-emscripten-engine-BeWFjMn-.js +0 -2
- package/dist/assets/blender-version.status-DtfwUahB.js +0 -1
- package/dist/assets/blender-wali-engine-da698rDf.js +0 -2
- package/dist/assets/blender.status-ujwGU6dU.js +0 -1
- package/dist/assets/board-guides-_3R1t_-2.js +0 -1
- package/dist/assets/body-marks-RKb_LTwL.js +0 -1
- package/dist/assets/build-profiles.document-CZxDuhzz.js +0 -2
- package/dist/assets/build-progress.status-Dk5u3C67.js +0 -1
- package/dist/assets/build.header--xqH6uTP.js +0 -1
- package/dist/assets/canvas-entry-runtime-DVeh71nC.js +0 -2
- package/dist/assets/capability-coverage-DQgg6UJe.js +0 -7
- package/dist/assets/component-board.service-DgujG90T.js +0 -2
- package/dist/assets/component-contracts.service-Bc_2Xxh_.js +0 -1
- package/dist/assets/component-instance-root-df4ofoOR.js +0 -1
- package/dist/assets/connection.status-CCX-mgmr.js +0 -1
- package/dist/assets/constraints.inspector-CwEEREsf.js +0 -1
- package/dist/assets/coverage.service-CV7b5Sqn.js +0 -3
- package/dist/assets/curve-BKuiAPpj.js +0 -1
- package/dist/assets/data-check-core-CQEjuFyt.js +0 -1
- package/dist/assets/data-ref-DyFQqqX6.js +0 -1
- package/dist/assets/debug-bridge-CESAxmlz.js +0 -1
- package/dist/assets/debug-registry-l7k5Hjc8.js +0 -1
- package/dist/assets/design-time-layers-CQgnmqc8.js +0 -1
- package/dist/assets/design-time-react-mount-CFvIk_rV.js +0 -1
- package/dist/assets/edit-mode-authoring-DBjaBTxM.js +0 -1
- package/dist/assets/editor-api-D2azVray.js +0 -1
- package/dist/assets/editor-presentation-activity-C7SNSmTd.js +0 -1
- package/dist/assets/game-audio-CaGKzia4.js +0 -1
- package/dist/assets/game-document.service-FdG_gFPU.js +0 -1
- package/dist/assets/game-eval.command-4wa9vqWE.js +0 -2
- package/dist/assets/game-module-access-DulnT3NH.js +0 -1
- package/dist/assets/game-network-Bo_nlDR5.js +0 -22
- package/dist/assets/gameplay-replay-CnWnlogY.js +0 -1
- package/dist/assets/generation-DhwCUHPf.css +0 -1
- package/dist/assets/generation.service-D2yeZaJu.js +0 -1
- package/dist/assets/generations.status-3CrPw_n5.js +0 -1
- package/dist/assets/hierarchy-marks-BLPfSIym.js +0 -1
- package/dist/assets/hierarchy-marks-C25dY2fR.js +0 -1
- package/dist/assets/hosted-asset-materialization-DYdcFlDf.js +0 -2
- package/dist/assets/index-B5WjeCHm.css +0 -1
- package/dist/assets/index-BcH5GC3b.js +0 -1
- package/dist/assets/index-CwCDkEl1.js +0 -1
- package/dist/assets/index-n3QdTv-T.js +0 -1
- package/dist/assets/index.module-Ycad3DJq.js +0 -1
- package/dist/assets/ingest-siblings-CkxW__go.js +0 -1
- package/dist/assets/ingest-source-persistence-6peGfPAS.js +0 -1
- package/dist/assets/ingest.service-Cc73WMIW.js +0 -1
- package/dist/assets/inspection-CObLhnrs.js +0 -1
- package/dist/assets/instances.command-CxKGnrNl.js +0 -1
- package/dist/assets/material-BwFzKPi0.js +0 -1
- package/dist/assets/model-asset-sections-CFvvihfx.css +0 -1
- package/dist/assets/model-asset-sections.service-TZ2SaBmH.js +0 -1
- package/dist/assets/module-mode-B79jV5tQ.js +0 -2
- package/dist/assets/mount-canvas-ingest-root-BhaYNuhY.js +0 -2
- package/dist/assets/mount-dom-ingest-root-BQb1u0LX.js +0 -2
- package/dist/assets/mount-readiness-Ds0HvvLH.js +0 -4
- package/dist/assets/mount-three-ingest-root-DIDBfvIH.js +0 -1
- package/dist/assets/network-observer.service-CiR4Q9Q0.js +0 -1
- package/dist/assets/network.utility-CNG3eJ0E.js +0 -1
- package/dist/assets/object-marks-DwvIEBOK.js +0 -1
- package/dist/assets/pixi-authoring-adapter-B42K4md-.js +0 -1
- package/dist/assets/pixi-live-write-target-D56tQEe_.js +0 -1
- package/dist/assets/pose-guard-DILO6gGq.js +0 -1
- package/dist/assets/presentation-DGBuGP6i.js +0 -1
- package/dist/assets/profiler.utility-DLNySW3w.js +0 -1
- package/dist/assets/project-provenance-4ldz-EOG.js +0 -1
- package/dist/assets/r3f-design-session-C0DPEChS.js +0 -2
- package/dist/assets/react-canvas-navigation-Jowa_lJq.js +0 -1
- package/dist/assets/react-inspector.service-TfTdj_Qk.js +0 -1
- package/dist/assets/react-story-board-Bx7qYytV.js +0 -1
- package/dist/assets/react-world-authoring-adapter-C1jPW_cN.js +0 -1
- package/dist/assets/reflection-probe-capture.inspector-C-6zrzZb.js +0 -1
- package/dist/assets/registry-Z28XSZHF.js +0 -1
- package/dist/assets/resolve-three-C7zDbK29.js +0 -702
- package/dist/assets/root-seam-contract-rGNbiX6q.js +0 -1
- package/dist/assets/scene-capture-BTWgUzhI.js +0 -1
- package/dist/assets/scene-document.service-DJJp-la1.js +0 -2
- package/dist/assets/seeded-random-38To73fI.js +0 -1
- package/dist/assets/stage-overlay-set-olkNSZmq.js +0 -1
- package/dist/assets/stage-presence-markers-cznMN_qq.js +0 -1
- package/dist/assets/stage-transform-tools-BDUZqRIR.js +0 -1
- package/dist/assets/standard-viewport-dressing-BZyuxyVl.js +0 -24
- package/dist/assets/state-watch.utility-DDmn3G25.js +0 -1
- package/dist/assets/story-documents-8ehMyYHo.js +0 -3
- package/dist/assets/story-three-preview-B1nNiPwP.js +0 -2
- package/dist/assets/studio-environment-yaKaHPxH.js +0 -2
- package/dist/assets/team-playtest.service-Ds9tkO4q.js +0 -1
- package/dist/assets/three-authoring-adapter-BrkGH4cd.js +0 -1
- package/dist/assets/three-authoring.service-DoamZDMx.js +0 -2
- package/dist/assets/three-integration.service-Db-VabIm.js +0 -1
- package/dist/assets/three-projection-core-jBJVt6O0.js +0 -1
- package/dist/assets/three-viewport-presentation-CgO3eWJ-.js +0 -141
- package/dist/assets/tools-B_NJsk05.js +0 -1
- package/dist/assets/transform-mode-request-BnKpgRUW.js +0 -1
- package/dist/assets/transport-strip-a9yLoPsI.js +0 -1
- package/dist/assets/transport.header-CpfoppXc.js +0 -1
- package/dist/assets/tuples-CKsHOV9T.js +0 -1
- package/dist/assets/ui-board-document-DtTR_mBr.js +0 -2
- package/dist/assets/user-data-dHvLdpwM.js +0 -1
- package/dist/assets/viewport-door-DVkMQazS.js +0 -1
- package/dist/assets/worker-CC9Ug5Ei.js +0 -2
- package/dist/assets/workspace-arrangement-DIMM7ska.js +0 -1
- package/dist/assets/world-documents-C4t3iOD-.js +0 -1
- package/dist/assets/world-root-stage-binding-ydl3JN1a.js +0 -1
- package/dist/vgai-shared-react.json +0 -10
- package/dist/vgai-shared-three.json +0 -3
- package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
- package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
- package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
- package/template/server/loopback.ts +0 -76
- /package/dist/assets/{vgai-shared-fontawesome-CU65D4Ij.js → volter-shared-fontawesome-CU65D4Ij.js} +0 -0
- /package/dist/assets/{vgai-shared-jsx-dev-runtime-DFDKL7fx.js → volter-shared-jsx-dev-runtime-DFDKL7fx.js} +0 -0
- /package/dist/assets/{vgai-shared-jsx-runtime-DIqBpTut.js → volter-shared-jsx-runtime-DIqBpTut.js} +0 -0
- /package/dist/assets/{vgai-shared-react-BT7rMc2H.js → volter-shared-react-BT7rMc2H.js} +0 -0
- /package/dist/assets/{vgai-shared-react-dom-DFajMqMT.js → volter-shared-react-dom-DFajMqMT.js} +0 -0
- /package/dist/assets/{vgai-shared-react-dom-client-S0ozfl6_.js → volter-shared-react-dom-client-S0ozfl6_.js} +0 -0
- /package/dist/assets/{vgai-shared-three-DH4yxKwt.js → volter-shared-three-DH4yxKwt.js} +0 -0
- /package/template/{.vgai → .volter}/assets.json +0 -0
- /package/template/{.vgai → .volter}/provenance.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as Ge}from"./index-CaG87ZF-.js";import"./three.module-BLhyNg0e.js";import{cW as ke,N as Ve,cp as We,co as j,M as ie,fo as Ye,_ as Qe,cm as ne,bu as Xe}from"./three.core-3arARmh6.js";import{DEFAULTS as le}from"./defaults-DKiBJCPN.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 $e=["Recast","Detour","DetourNavMeshBuilder","DetourTileCacheBuilder","NavMeshImporter","NavMeshExporter","CrowdUtils","ChunkyTriMeshUtils","RecastDebugDraw","DetourDebugDraw"],qe=["rcConfig","rcContext","dtNavMeshParams","dtNavMeshCreateParams","RecastLinearAllocator","RecastFastLZCompressor","rcChunkyTriMesh","dtTileCacheParams","dtTileCacheLayerHeader","Vec3","BoolRef","IntRef","UnsignedIntRef","UnsignedCharRef","UnsignedShortRef","FloatRef","IntArray","UnsignedIntArray","UnsignedCharArray","UnsignedShortArray","FloatArray"],s={isNull:a=>s.Module.getPointer(a)===0,destroy:a=>{s.Module.destroy(a)}},g={},f={},Ke=async a=>{if(s.Module===void 0){{const e=(await Ge(async()=>{const{default:t}=await import("./recast-navigation.wasm-compat-Dsoa_MD-.js");return{default:t}},[])).default;s.Module=await e()}for(const e of $e)s[e]=new s.Module[e];for(const e of qe)s[e]=s.Module[e];g.RC_BORDER_REG=s.Recast.BORDER_REG,g.RC_MULTIPLE_REGS=s.Recast.MULTIPLE_REGS,g.RC_BORDER_VERTEX=s.Recast.BORDER_VERTEX,g.RC_AREA_BORDER=s.Recast.AREA_BORDER,g.RC_CONTOUR_REG_MASK=s.Recast.CONTOUR_REG_MASK,g.RC_MESH_NULL_IDX=s.Recast.MESH_NULL_IDX,g.RC_NULL_AREA=s.Recast.NULL_AREA,g.RC_WALKABLE_AREA=s.Recast.WALKABLE_AREA,g.RC_NOT_CONNECTED=s.Recast.NOT_CONNECTED,g.RC_CONTOUR_TESS_WALL_EDGES=s.Module.RC_CONTOUR_TESS_WALL_EDGES,g.RC_CONTOUR_TESS_AREA_EDGES=s.Module.RC_CONTOUR_TESS_AREA_EDGES,g.RC_LOG_PROGRESS=s.Module.RC_LOG_PROGRESS,g.RC_LOG_WARNING=s.Module.RC_LOG_WARNING,g.RC_LOG_ERROR=s.Module.RC_LOG_ERROR,g.RC_TIMER_TOTAL=s.Module.RC_TIMER_TOTAL,g.RC_TIMER_TEMP=s.Module.RC_TIMER_TEMP,g.RC_TIMER_RASTERIZE_TRIANGLES=s.Module.RC_TIMER_RASTERIZE_TRIANGLES,g.RC_TIMER_BUILD_COMPACTHEIGHTFIELD=s.Module.RC_TIMER_BUILD_COMPACTHEIGHTFIELD,g.RC_TIMER_BUILD_CONTOURS=s.Module.RC_TIMER_BUILD_CONTOURS,g.RC_TIMER_BUILD_CONTOURS_TRACE=s.Module.RC_TIMER_BUILD_CONTOURS_TRACE,g.RC_TIMER_BUILD_CONTOURS_SIMPLIFY=s.Module.RC_TIMER_BUILD_CONTOURS_SIMPLIFY,g.RC_TIMER_FILTER_BORDER=s.Module.RC_TIMER_FILTER_BORDER,g.RC_TIMER_FILTER_WALKABLE=s.Module.RC_TIMER_FILTER_WALKABLE,g.RC_TIMER_MEDIAN_AREA=s.Module.RC_TIMER_MEDIAN_AREA,g.RC_TIMER_FILTER_LOW_OBSTACLES=s.Module.RC_TIMER_FILTER_LOW_OBSTACLES,g.RC_TIMER_BUILD_POLYMESH=s.Module.RC_TIMER_BUILD_POLYMESH,g.RC_TIMER_MERGE_POLYMESH=s.Module.RC_TIMER_MERGE_POLYMESH,g.RC_TIMER_ERODE_AREA=s.Module.RC_TIMER_ERODE_AREA,g.RC_TIMER_MARK_BOX_AREA=s.Module.RC_TIMER_MARK_BOX_AREA,g.RC_TIMER_MARK_CYLINDER_AREA=s.Module.RC_TIMER_MARK_CYLINDER_AREA,g.RC_TIMER_MARK_CONVEXPOLY_AREA=s.Module.RC_TIMER_MARK_CONVEXPOLY_AREA,g.RC_TIMER_BUILD_DISTANCEFIELD=s.Module.RC_TIMER_BUILD_DISTANCEFIELD,g.RC_TIMER_BUILD_DISTANCEFIELD_DIST=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_DIST,g.RC_TIMER_BUILD_DISTANCEFIELD_BLUR=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_BLUR,g.RC_TIMER_BUILD_REGIONS=s.Module.RC_TIMER_BUILD_REGIONS,g.RC_TIMER_BUILD_REGIONS_WATERSHED=s.Module.RC_TIMER_BUILD_REGIONS_WATERSHED,g.RC_TIMER_BUILD_REGIONS_EXPAND=s.Module.RC_TIMER_BUILD_REGIONS_EXPAND,g.RC_TIMER_BUILD_REGIONS_FLOOD=s.Module.RC_TIMER_BUILD_REGIONS_FLOOD,g.RC_TIMER_BUILD_REGIONS_FILTER=s.Module.RC_TIMER_BUILD_REGIONS_FILTER,g.RC_TIMER_BUILD_LAYERS=s.Module.RC_TIMER_BUILD_LAYERS,g.RC_TIMER_BUILD_POLYMESHDETAIL=s.Module.RC_TIMER_BUILD_POLYMESHDETAIL,g.RC_TIMER_MERGE_POLYMESHDETAIL=s.Module.RC_TIMER_MERGE_POLYMESHDETAIL,g.RC_MAX_TIMERS=s.Module.RC_MAX_TIMERS,f.DT_FAILURE=s.Detour.FAILURE,f.DT_SUCCESS=s.Detour.SUCCESS,f.DT_IN_PROGRESS=s.Detour.IN_PROGRESS,f.DT_STATUS_DETAIL_MASK=s.Detour.STATUS_DETAIL_MASK,f.DT_WRONG_MAGIC=s.Detour.WRONG_MAGIC,f.DT_WRONG_VERSION=s.Detour.WRONG_VERSION,f.DT_OUT_OF_MEMORY=s.Detour.OUT_OF_MEMORY,f.DT_INVALID_PARAM=s.Detour.INVALID_PARAM,f.DT_BUFFER_TOO_SMALL=s.Detour.BUFFER_TOO_SMALL,f.DT_OUT_OF_NODES=s.Detour.OUT_OF_NODES,f.DT_PARTIAL_RESULT=s.Detour.PARTIAL_RESULT,f.DT_ALREADY_OCCUPIED=s.Detour.ALREADY_OCCUPIED,f.DT_VERTS_PER_POLYGON=s.Detour.VERTS_PER_POLYGON,f.DT_NAVMESH_MAGIC=s.Detour.NAVMESH_MAGIC,f.DT_NAVMESH_VERSION=s.Detour.NAVMESH_VERSION,f.DT_NAVMESH_STATE_MAGIC=s.Detour.NAVMESH_STATE_MAGIC,f.DT_NAVMESH_STATE_VERSION=s.Detour.NAVMESH_STATE_VERSION,f.DT_TILECACHE_MAGIC=s.Detour.TILECACHE_MAGIC,f.DT_TILECACHE_VERSION=s.Detour.TILECACHE_VERSION,f.DT_TILECACHE_NULL_AREA=s.Detour.TILECACHE_NULL_AREA,f.DT_TILECACHE_WALKABLE_AREA=s.Detour.TILECACHE_WALKABLE_AREA,f.DT_TILECACHE_NULL_IDX=s.Detour.TILECACHE_NULL_IDX,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_EXT_LINK=s.Detour.EXT_LINK,f.DT_OFFMESH_CON_BIDIR=s.Detour.OFFMESH_CON_BIDIR,f.DT_STRAIGHTPATH_START=s.Module.DT_STRAIGHTPATH_START,f.DT_STRAIGHTPATH_END=s.Module.DT_STRAIGHTPATH_END,f.DT_STRAIGHTPATH_OFFMESH_CONNECTION=s.Module.DT_STRAIGHTPATH_OFFMESH_CONNECTION,f.DT_STRAIGHTPATH_AREA_CROSSINGS=s.Module.DT_STRAIGHTPATH_AREA_CROSSINGS,f.DT_STRAIGHTPATH_ALL_CROSSINGS=s.Module.DT_STRAIGHTPATH_ALL_CROSSINGS,f.DT_FINDPATH_ANY_ANGLE=s.Module.DT_FINDPATH_ANY_ANGLE,f.DT_RAYCAST_USE_COSTS=s.Module.DT_RAYCAST_USE_COSTS,f.DT_CROWDAGENT_STATE_INVALID=s.Module.DT_CROWDAGENT_STATE_INVALID,f.DT_CROWDAGENT_STATE_WALKING=s.Module.DT_CROWDAGENT_STATE_WALKING,f.DT_CROWDAGENT_STATE_OFFMESH=s.Module.DT_CROWDAGENT_STATE_OFFMESH,f.DT_CROWDAGENT_TARGET_NONE=s.Module.DT_CROWDAGENT_TARGET_NONE,f.DT_CROWDAGENT_TARGET_FAILED=s.Module.DT_CROWDAGENT_TARGET_FAILED,f.DT_CROWDAGENT_TARGET_VALID=s.Module.DT_CROWDAGENT_TARGET_VALID,f.DT_CROWDAGENT_TARGET_REQUESTING=s.Module.DT_CROWDAGENT_TARGET_REQUESTING,f.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,f.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,f.DT_CROWDAGENT_TARGET_VELOCITY=s.Module.DT_CROWDAGENT_TARGET_VELOCITY,f.DT_COMPRESSEDTILE_FREE_DATA=s.Module.DT_COMPRESSEDTILE_FREE_DATA,f.DT_TILE_FREE_DATA=s.Module.DT_TILE_FREE_DATA}};class K{get size(){return this.raw.size}constructor(e){this.raw=e}get(e){return this.raw.get(e)}set(e,t){this.raw.set(e,t)}resize(e){this.raw.resize(e)}copy(e){this.raw.resize(e.length),this.getHeapView().set(e)}destroy(){s.destroy(this.raw)}getHeapView(){const e=this.getHeap();return new this.ArrayConstructor(e.buffer,this.raw.getDataPointer(),this.size)}toTypedArray(){const e=this.getHeapView(),t=new this.ArrayConstructor(new ArrayBuffer(this.size*e.BYTES_PER_ELEMENT),0,this.size);return t.set(e),t}}class W extends K{ArrayConstructor=Int32Array;constructor(e){super(e??new s.Module.IntArray)}getHeap(){return s.Module.HEAP32}static fromRaw(e){return new W(e)}}class z extends K{ArrayConstructor=Uint32Array;constructor(e){super(e??new s.Module.UnsignedIntArray)}getHeap(){return s.Module.HEAPU32}static fromRaw(e){return new z(e)}}class Y extends K{ArrayConstructor=Uint8Array;constructor(e){super(e??new s.Module.UnsignedCharArray)}getHeap(){return s.Module.HEAPU8}static fromRaw(e){return new Y(e)}}class k extends K{ArrayConstructor=Float32Array;constructor(e){super(e??new s.Module.FloatArray)}getHeap(){return s.Module.HEAPF32}static fromRaw(e){return new k(e)}}const ue=k,ce=W,Z=Y,je=W,m={toRaw:({x:a,y:e,z:t},r)=>r?(r.x=a,r.y=e,r.z=t,r):new s.Module.Vec3(a,e,t),fromRaw:a=>{const{x:e,y:t,z:r}=a;return{x:e,y:t,z:r}},fromArray:([a,e,t])=>({x:a,y:e,z:t}),toArray:({x:a,y:e,z:t})=>[a,e,t],lerp:(a,e,t,r={x:0,y:0,z:0})=>{r.x=a.x+(e.x-a.x)*t,r.y=a.y+(e.y-a.y)*t,r.z=a.z+(e.z-a.z)*t},copy:(a,e={x:0,y:0,z:0})=>{e.x=a.x,e.y=a.y,e.z=a.z}},v=(a,e)=>{const t=[];for(let r=0;r<e;r++)t.push(a(r));return t},L=a=>s.Detour.statusSucceed(a),Ze=a=>s.Detour.statusFailed(a),Je=a=>{if(s.Detour.statusSucceed(a))return"success";if(s.Detour.statusInProgress(a))return"in progress";if(s.Detour.statusFailed(a)){let e;const t={DT_WRONG_MAGIC:f.DT_WRONG_MAGIC,DT_WRONG_VERSION:f.DT_WRONG_VERSION,DT_OUT_OF_MEMORY:f.DT_OUT_OF_MEMORY,DT_INVALID_PARAM:f.DT_INVALID_PARAM,DT_BUFFER_TOO_SMALL:f.DT_BUFFER_TOO_SMALL,DT_OUT_OF_NODES:f.DT_OUT_OF_NODES,DT_PARTIAL_RESULT:f.DT_PARTIAL_RESULT,DT_ALREADY_OCCUPIED:f.DT_ALREADY_OCCUPIED};for(const[r,i]of Object.entries(t))if(s.Detour.statusDetail(a,i)){e=r;break}return e?`failed - ${e}`:"failed - unknown"}return"unknown"};class et{constructor(e){this.raw=e}vertBase(){return this.raw.vertBase}triBase(){return this.raw.triBase}vertCount(){return this.raw.vertCount}triCount(){return this.raw.triCount}}class tt{constructor(e){this.raw=e}ref(){return this.raw.ref}next(){return this.raw.next}edge(){return this.raw.edge}side(){return this.raw.side}bmin(){return this.raw.bmin}bmax(){return this.raw.bmax}}class rt{constructor(e){this.raw=e}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}i(){return this.raw.i}}class he{constructor(e){this.raw=e}pos(e){return this.raw.get_pos(e)}rad(){return this.raw.rad}poly(){return this.raw.poly}flags(){return this.raw.flags}side(){return this.raw.side}userId(){return this.raw.userId}}class st{constructor(e){this.raw=e}magic(){return this.raw.magic}version(){return this.raw.version}x(){return this.raw.x}y(){return this.raw.y}layer(){return this.raw.layer}userId(){return this.raw.userId}polyCount(){return this.raw.polyCount}vertCount(){return this.raw.vertCount}maxLinkCount(){return this.raw.maxLinkCount}detailMeshCount(){return this.raw.detailMeshCount}detailVertCount(){return this.raw.detailVertCount}detailTriCount(){return this.raw.detailTriCount}bvNodeCount(){return this.raw.bvNodeCount}offMeshConCount(){return this.raw.offMeshConCount}offMeshBase(){return this.raw.offMeshBase}walkableHeight(){return this.raw.walkableHeight}walkableRadius(){return this.raw.walkableRadius}walkableClimb(){return this.raw.walkableClimb}bmin(e){return this.raw.get_bmin(e)}bmax(e){return this.raw.get_bmax(e)}bvQuantFactor(){return this.raw.bvQuantFactor}}class J{constructor(e){this.raw=e}firstLink(){return this.raw.firstLink}verts(e){return this.raw.get_verts(e)}neis(e){return this.raw.get_neis(e)}flags(){return this.raw.flags}vertCount(){return this.raw.vertCount}areaAndType(){return this.raw.get_areaAndtype()}getType(){return this.raw.getType()}}class B{constructor(e){this.raw=e}salt(){return this.raw.salt}linksFreeList(){return this.raw.linksFreeList}header(){return s.isNull(this.raw.header)?null:new st(this.raw.header)}polys(e){return new J(this.raw.get_polys(e))}verts(e){return this.raw.get_verts(e)}links(e){return new tt(this.raw.get_links(e))}detailMeshes(e){return new et(this.raw.get_detailMeshes(e))}detailVerts(e){return this.raw.get_detailVerts(e)}detailTris(e){return this.raw.get_detailTris(e)}bvTree(e){return new rt(this.raw.get_bvTree(e))}offMeshCons(e){return new he(this.raw.get_offMeshCons(e))}data(e){return this.raw.get_data(e)}dataSize(){return this.raw.dataSize}flags(){return this.raw.flags}next(){return new B(this.raw.next)}}const de=a=>{const e=s.DetourNavMeshBuilder.createNavMeshData(a.raw);return{success:e.success,navMeshData:Y.fromRaw(e.navMeshData)}};class we{constructor(e){this.raw=e??new s.Module.dtNavMeshCreateParams}setPolyMeshCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshCreateParams(this.raw,e.raw)}setPolyMeshDetailCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshDetailCreateParams(this.raw,e.raw)}setOffMeshConnections(e){if(e.length<=0)return;const t=[],r=[],i=[],o=[],l=[],n=[];for(let u=0;u<e.length;u++){const d=e[u];t.push(d.startPosition.x,d.startPosition.y,d.startPosition.z),t.push(d.endPosition.x,d.endPosition.y,d.endPosition.z),r.push(d.radius),i.push(d.bidirectional?1:0),o.push(d.area??0),l.push(d.flags??1),n.push(d.userId??1e3+u)}s.DetourNavMeshBuilder.setOffMeshConnections(this.raw,e.length,t,r,i,o,l,n)}verts(e){return this.raw.get_verts(e)}setVerts(e,t){this.raw.set_verts(e,t)}vertCount(){return this.raw.vertCount}polys(e){return this.raw.get_polys(e)}setPolys(e,t){this.raw.set_polys(e,t)}polyAreas(e){return this.raw.get_polyAreas(e)}setPolyAreas(e,t){this.raw.set_polyAreas(e,t)}polyFlags(e){return this.raw.get_polyFlags(e)}setPolyFlags(e,t){this.raw.set_polyFlags(e,t)}polyCount(){return this.raw.polyCount}nvp(){return this.raw.nvp}setNvp(e){this.raw.nvp=e}detailMeshes(e){return this.raw.get_detailMeshes(e)}setDetailMeshes(e,t){this.raw.set_detailMeshes(e,t)}detailVerts(e){return this.raw.get_detailVerts(e)}setDetailVerts(e,t){this.raw.set_detailVerts(e,t)}detailVertsCount(){return this.raw.detailVertsCount}detailTris(e){return this.raw.get_detailTris(e)}setDetailTris(e,t){this.raw.set_detailTris(e,t)}detailTriCount(){return this.raw.detailTriCount}offMeshConVerts(e){return this.raw.get_offMeshConVerts(e)}offMeshConRad(e){return this.raw.get_offMeshConRad(e)}offMeshConDir(e){return this.raw.get_offMeshConDir(e)}offMeshConAreas(e){return this.raw.get_offMeshConAreas(e)}offMeshConFlags(e){return this.raw.get_offMeshConFlags(e)}offMeshConUserID(e){return this.raw.get_offMeshConUserID(e)}offMeshConCount(){return this.raw.offMeshConCount}userId(){return this.raw.userId}tileX(){return this.raw.tileX}setTileX(e){this.raw.tileX=e}tileY(){return this.raw.tileY}setTileY(e){this.raw.tileY=e}tileLayer(){return this.raw.tileLayer}setTileLayer(e){this.raw.tileLayer=e}boundsMin(){return v(e=>this.raw.get_bmin(e),3)}setBoundsMin(e){this.raw.set_bmin(0,e[0]),this.raw.set_bmin(1,e[1]),this.raw.set_bmin(2,e[2])}boundsMax(){return v(e=>this.raw.get_bmax(e),3)}setBoundsMax(e){this.raw.set_bmax(0,e[0]),this.raw.set_bmax(1,e[1]),this.raw.set_bmax(2,e[2])}walkableHeight(){return this.raw.walkableHeight}setWalkableHeight(e){this.raw.walkableHeight=e}walkableRadius(){return this.raw.walkableRadius}setWalkableRadius(e){this.raw.walkableRadius=e}walkableClimb(){return this.raw.walkableClimb}setWalkableClimb(e){this.raw.walkableClimb=e}cellSize(){return this.raw.cs}setCellSize(e){this.raw.cs=e}cellHeight(){return this.raw.ch}setCellHeight(e){this.raw.ch=e}buildBvTree(){return this.raw.buildBvTree}setBuildBvTree(e){this.raw.buildBvTree=e}}class ge{get includeFlags(){return this.raw.getIncludeFlags()}set includeFlags(e){this.raw.setIncludeFlags(e)}get excludeFlags(){return this.raw.getExcludeFlags()}set excludeFlags(e){this.raw.setExcludeFlags(e)}constructor(e){this.raw=e??new s.Module.dtQueryFilter}getAreaCost(e){return this.raw.getAreaCost(e)}setAreaCost(e,t){this.raw.setAreaCost(e,t)}}class ee{defaultQueryHalfExtents={x:1,y:1,z:1};constructor(e,t){e instanceof s.Module.NavMeshQuery?this.raw=e:(this.raw=new s.Module.NavMeshQuery,this.raw.init(e.raw,t?.maxNodes??2048)),t?.defaultQueryFilter?this.defaultFilter=t.defaultQueryFilter:(this.defaultFilter=new ge,this.defaultFilter.includeFlags=65535,this.defaultFilter.excludeFlags=0)}findNearestPoly(e,t){const r=new s.UnsignedIntRef,i=new s.Vec3,o=new s.BoolRef,l=this.raw.findNearestPoly(m.toArray(e),m.toArray(t?.halfExtents??this.defaultQueryHalfExtents),t?.filter?.raw??this.defaultFilter.raw,r,i,o),n=m.fromRaw(i);s.destroy(i);const u=r.value;s.destroy(r);const d=o.value;return s.destroy(o),{success:L(l),status:l,nearestRef:u,nearestPoint:n,isOverPoly:d}}findPolysAroundCircle(e,t,r,i){const o=i?.filter??this.defaultFilter,l=i?.maxPolys??256,n=new z,u=new z,d=new k;n.resize(l),u.resize(l),d.resize(l);const _=new s.IntRef,c=this.raw.findPolysAroundCircle(e,m.toArray(t),r,o.raw,n.raw,u.raw,d.raw,_,l),y=[...n.getHeapView()];n.destroy();const M=[...u.getHeapView()];u.destroy();const p=[...d.getHeapView()];d.destroy();const C=_.value;return s.destroy(_),{success:L(c),status:c,resultRefs:y,resultParents:M,resultCost:p,resultCount:C}}queryPolygons(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.maxPolys??256,l=new z;l.resize(o);const n=new s.IntRef,u=this.raw.queryPolygons(m.toArray(e),m.toArray(t),i.raw,l.raw,n,o),d=n.value;s.destroy(n);const _=[...l.getHeapView()].slice(0,d);return l.destroy(),{success:L(u),status:u,polyRefs:_}}closestPointOnPoly(e,t){const r=new s.Vec3,i=new s.BoolRef,o=this.raw.closestPointOnPoly(e,m.toArray(t),r,i),l=m.fromRaw(r);s.destroy(r);const n=i.value;return s.destroy(i),{success:L(o),status:o,closestPoint:l,isPointOverPoly:n}}findClosestPoint(e,t){const r=t?.filter??this.defaultFilter,i=t?.halfExtents??this.defaultQueryHalfExtents,o=new s.UnsignedIntRef,l=new s.Vec3,n=new s.BoolRef,u=this.raw.findClosestPoint(m.toArray(e),m.toArray(i),r.raw,o,l,n),d=o.value;s.destroy(o);const _=m.fromRaw(l);s.destroy(l);const c=n.value;return s.destroy(n),{success:L(u),status:u,polyRef:d,point:_,isPointOverPoly:c}}findRandomPointAroundCircle(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents;let l;if(r?.startRef)l=r.startRef;else{const y=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!y.success)return{success:!1,status:y.status,randomPolyRef:0,randomPoint:{x:0,y:0,z:0}};l=y.nearestRef}const n=new s.UnsignedIntRef,u=new s.Vec3,d=this.raw.findRandomPointAroundCircle(l,m.toArray(e),t,i.raw,n,u),_=n.value;s.destroy(n);const c=m.fromRaw(u);return s.destroy(u),{success:L(d),status:d,randomPolyRef:_,randomPoint:c}}moveAlongSurface(e,t,r,i){const o=i?.maxVisitedSize??256,l=new s.Vec3,n=new z,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.moveAlongSurface(e,m.toArray(t),m.toArray(r),u,l,n.raw,o),_=m.fromRaw(l);s.destroy(l);const c=[...n.getHeapView()];return n.destroy(),{success:L(d),status:d,resultPosition:_,visited:c}}findRandomPoint(e){const t=new s.UnsignedIntRef,r=new s.Vec3,i=this.raw.findRandomPoint(e?.filter?.raw??this.defaultFilter.raw,t,r),o=t.value;s.destroy(t);const l=m.fromRaw(r);return s.destroy(r),{success:L(i),status:i,randomPolyRef:o,randomPoint:l}}getPolyHeight(e,t){const r=new s.FloatRef,i=this.raw.getPolyHeight(e,m.toArray(t),r),o=r.value;return s.destroy(r),{success:L(i),status:i,height:o}}computePath(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents,l=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!l.success)return{success:!1,error:{name:"findNearestPoly for start position failed",status:l.status},path:[]};const n=this.findNearestPoly(t,{filter:i,halfExtents:o});if(!n.success)return{success:!1,error:{name:"findNearestPoly for end position failed",status:n.status},path:[]};const u=l.nearestRef,d=n.nearestRef,_=r?.maxPathPolys??256,c=this.findPath(u,d,e,t,{filter:i,maxPathPolys:_});if(!c.success)return{success:!1,error:{name:"findPath unsuccessful",status:c.status},path:[]};if(c.polys.size<=0)return{success:!1,error:{name:"no polygon path found"},path:[]};const y=c.polys.get(c.polys.size-1);let M={x:t.x,y:t.y,z:t.z};if(y!==d){const A=this.closestPointOnPoly(y,t);if(!A.success)return{success:!1,error:{name:"no closest point on last polygon found",status:A.status},path:[]};M=A.closestPoint}const p=r?.maxStraightPathPoints,C=this.findStraightPath(e,M,c.polys,{maxStraightPathPoints:p});if(!C.success)return{success:!1,error:{name:"findStraightPath unsuccessful",status:C.status},path:[]};const{straightPath:I,straightPathCount:w}=C,P=[];for(let A=0;A<w;A++)P.push({x:I.get(A*3),y:I.get(A*3+1),z:I.get(A*3+2)});return c.polys.destroy(),C.straightPath.destroy(),C.straightPathFlags.destroy(),C.straightPathRefs.destroy(),{success:!0,path:P}}findPath(e,t,r,i,o){const l=o?.filter??this.defaultFilter,n=o?.maxPathPolys??256,u=new z;u.resize(n);const d=this.raw.findPath(e,t,m.toArray(r),m.toArray(i),l.raw,u.raw,n);return{success:L(d),status:d,polys:u}}findStraightPath(e,t,r,i){const o=i?.maxStraightPathPoints??256,l=i?.straightPathOptions??0;let n;Array.isArray(r)?(n=new z,n.copy(r)):n=r;const u=new k;u.resize(o*3);const d=new Y;d.resize(o);const _=new z;_.resize(o);const c=new s.IntRef,y=this.raw.findStraightPath(m.toArray(e),m.toArray(t),n.raw,u.raw,d.raw,_.raw,c,o,l),M=c.value;return s.destroy(c),Array.isArray(r)&&n.destroy(),{success:L(y),status:y,straightPath:u,straightPathFlags:d,straightPathRefs:_,straightPathCount:M}}raycast(e,t,r,i){const o=new s.Module.dtRaycastHit,l=i?.raycastOptions??0,n=i?.prevRef??0,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.raycast(e,m.toArray(t),m.toArray(r),u,l,o,n),_={success:L(d),status:d,t:o.t,hitNormal:m.fromArray(v(c=>o.get_hitNormal(c),3)),hitEdgeIndex:o.hitEdgeIndex,path:v(c=>o.get_path(c),o.pathCount),maxPath:o.maxPath,pathCost:o.pathCost};return s.destroy(o),_}destroy(){this.raw.destroy()}}const _e={radius:.5,height:1,maxAcceleration:20,maxSpeed:6,collisionQueryRange:2.5,pathOptimizationRange:0,separationWeight:0,updateFlags:7,obstacleAvoidanceType:0,queryFilterType:0,userData:0};class at{get radius(){return this.raw.params.radius}set radius(e){this.raw.params.radius=e}get height(){return this.raw.params.height}set height(e){this.raw.params.height=e}get maxAcceleration(){return this.raw.params.maxAcceleration}set maxAcceleration(e){this.raw.params.maxAcceleration=e}get maxSpeed(){return this.raw.params.maxSpeed}set maxSpeed(e){this.raw.params.maxSpeed=e}get collisionQueryRange(){return this.raw.params.collisionQueryRange}set collisionQueryRange(e){this.raw.params.collisionQueryRange=e}get pathOptimizationRange(){return this.raw.params.pathOptimizationRange}set pathOptimizationRange(e){this.raw.params.pathOptimizationRange=e}get separationWeight(){return this.raw.params.separationWeight}set separationWeight(e){this.raw.params.separationWeight=e}get updateFlags(){return this.raw.params.updateFlags}set updateFlags(e){this.raw.params.updateFlags=e}get obstacleAvoidanceType(){return this.raw.params.obstacleAvoidanceType}set obstacleAvoidanceType(e){this.raw.params.obstacleAvoidanceType=e}get queryFilterType(){return this.raw.params.queryFilterType}set queryFilterType(e){this.raw.params.queryFilterType=e}get userData(){return this.raw.params.userData}set userData(e){this.raw.params.userData=e}interpolatedPosition={x:0,y:0,z:0};constructor(e,t){this.crowd=e,this.agentIndex=t,this.raw=e.raw.getEditableAgent(t),this.interpolatedPosition=this.position()}requestMoveTarget(e){const{nearestPoint:t,nearestRef:r}=this.crowd.navMeshQuery.findNearestPoly(e,{halfExtents:this.crowd.navMeshQuery.defaultQueryHalfExtents,filter:this.crowd.navMeshQuery.defaultFilter});return this.crowd.raw.requestMoveTarget(this.agentIndex,r,m.toArray(t))}requestMoveVelocity(e){return this.crowd.raw.requestMoveVelocity(this.agentIndex,m.toArray(e))}resetMoveTarget(){this.crowd.raw.resetMoveTarget(this.agentIndex)}teleport(e){s.CrowdUtils.agentTeleport(this.crowd.raw,this.agentIndex,m.toArray(e),m.toArray(this.crowd.navMeshQuery.defaultQueryHalfExtents),this.crowd.navMeshQuery.defaultFilter.raw),m.copy(e,this.interpolatedPosition)}position(){return{x:this.raw.get_npos(0),y:this.raw.get_npos(1),z:this.raw.get_npos(2)}}velocity(){return{x:this.raw.get_vel(0),y:this.raw.get_vel(1),z:this.raw.get_vel(2)}}desiredVelocity(){return{x:this.raw.get_dvel(0),y:this.raw.get_dvel(1),z:this.raw.get_dvel(2)}}desiredVelocityObstacleAdjusted(){return{x:this.raw.get_nvel(0),y:this.raw.get_nvel(1),z:this.raw.get_nvel(2)}}state(){return this.raw.state}target(){return{x:this.raw.get_targetPos(0),y:this.raw.get_targetPos(1),z:this.raw.get_targetPos(2)}}nextTargetInPath(){return{x:this.raw.get_cornerVerts(0),y:this.raw.get_cornerVerts(1),z:this.raw.get_cornerVerts(2)}}corners(){const e=[];for(let t=0;t<this.raw.ncorners;t++)e.push({x:this.raw.get_cornerVerts(t*3),y:this.raw.get_cornerVerts(t*3+1),z:this.raw.get_cornerVerts(t*3+2)});return e}parameters(){const{params:e}=this.raw;return{radius:e.radius,height:e.height,maxAcceleration:e.maxAcceleration,maxSpeed:e.maxSpeed,collisionQueryRange:e.collisionQueryRange,pathOptimizationRange:e.pathOptimizationRange,separationWeight:e.separationWeight,updateFlags:e.updateFlags,obstacleAvoidanceType:e.obstacleAvoidanceType,queryFilterType:e.queryFilterType,userData:e.userData}}updateParameters(e){const t={...this.parameters(),...e};this.setParameters(t)}setParameters(e){const t={..._e,...e},r=new s.Module.dtCrowdAgentParams;r.radius=t.radius,r.height=t.height,r.maxAcceleration=t.maxAcceleration,r.maxSpeed=t.maxSpeed,r.collisionQueryRange=t.collisionQueryRange,r.pathOptimizationRange=t.pathOptimizationRange,r.separationWeight=t.separationWeight,r.updateFlags=t.updateFlags,r.obstacleAvoidanceType=t.obstacleAvoidanceType,r.queryFilterType=t.queryFilterType,r.userData=t.userData,this.crowd.raw.updateAgentParameters(this.agentIndex,r)}overOffMeshConnection(){return s.CrowdUtils.overOffMeshConnection(this.crowd.raw,this.agentIndex)}}class it{agents={};accumulator=0;constructor(e,{maxAgents:t,maxAgentRadius:r}){this.navMesh=e,this.raw=s.Detour.allocCrowd(),this.raw.init(t,r,e.raw.getNavMesh()),this.navMeshQuery=new ee(new s.Module.NavMeshQuery(this.raw.getNavMeshQuery()))}update(e,t,r=10){if(t===void 0)this.raw.update(e,void 0);else{this.accumulator+=t;let i=0;for(;this.accumulator>=e&&i<r;)this.raw.update(e,void 0),this.accumulator-=e,i++;const o=this.accumulator%e/e,l=this.getAgents();for(const n of l)m.lerp(n.interpolatedPosition,n.position(),o,n.interpolatedPosition)}}addAgent(e,t){const r={..._e,...t},i=new s.Module.dtCrowdAgentParams;i.radius=r.radius,i.height=r.height,i.maxAcceleration=r.maxAcceleration,i.maxSpeed=r.maxSpeed,i.collisionQueryRange=r.collisionQueryRange,i.pathOptimizationRange=r.pathOptimizationRange,i.separationWeight=r.separationWeight,i.updateFlags=r.updateFlags,i.obstacleAvoidanceType=r.obstacleAvoidanceType,i.queryFilterType=r.queryFilterType,i.userData=r.userData;const o=this.raw.addAgent(m.toArray(e),i),l=new at(this,o);return this.agents[o]=l,l}getAgent(e){const t=this.agents[e];return t||null}removeAgent(e){const t=typeof e=="number"?e:e.agentIndex;this.raw.removeAgent(t),delete this.agents[t]}getAgentCount(){return this.raw.getAgentCount()}getActiveAgentCount(){return s.CrowdUtils.getActiveAgentCount(this.raw)}getAgents(){return Object.values(this.agents)}getFilter(e){return new ge(this.raw.getEditableFilter(e))}destroy(){s.Detour.freeCrowd(this.raw)}}class nt{constructor(e){this.raw=e}tiles(e){return new B(this.raw.get_tiles(e))}tileCount(){return this.raw.tileCount}}class ot{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class lt{constructor(e){this.raw=e}tileX(){return this.raw.tileX}tileY(){return this.raw.tileY}}class ut{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class Q{constructor(e){this.raw=e}static create(e){const t=new s.Module.dtNavMeshParams;return t.set_orig(0,e.orig.x),t.set_orig(1,e.orig.y),t.set_orig(2,e.orig.z),t.tileWidth=e.tileWidth,t.tileHeight=e.tileHeight,t.maxTiles=e.maxTiles,t.maxPolys=e.maxPolys,new Q(t)}clone(){return Q.create({orig:{x:this.raw.get_orig(0),y:this.raw.get_orig(1),z:this.raw.get_orig(2)},tileWidth:this.raw.tileWidth,tileHeight:this.raw.tileHeight,maxTiles:this.raw.maxTiles,maxPolys:this.raw.maxPolys})}}class te{constructor(e){this.raw=e??new s.Module.NavMesh}initSolo(e){return this.raw.initSolo(e.raw)}initTiled(e){return this.raw.initTiled(e.raw)}addTile(e,t,r){const i=new s.UnsignedIntRef,o=this.raw.addTile(e.raw,t,r,i),l=i.value;return s.destroy(i),{status:o,tileRef:l}}decodePolyId(e){const t=new s.UnsignedIntRef,r=new s.UnsignedIntRef,i=new s.UnsignedIntRef;this.raw.decodePolyId(e,t,r,i);const o=t.value;s.destroy(t);const l=r.value;s.destroy(r);const n=i.value;return s.destroy(i),{tileSalt:o,tileIndex:l,tilePolygonIndex:n}}encodePolyId(e,t,r){return this.raw.encodePolyId(e,t,r)}removeTile(e){return new ot(this.raw.removeTile(e))}calcTileLoc(e){return new lt(this.raw.calcTileLoc(m.toArray(e)))}getTileAt(e,t,r){const i=this.raw.getTileAt(e,t,r);return s.isNull(i)?null:new B(i)}getTilesAt(e,t,r){return new nt(this.raw.getTilesAt(e,t,r))}getTileRefAt(e,t,r){return this.raw.getTileRefAt(e,t,r)}getTileRef(e){return this.raw.getTileRef(e.raw)}getTileByRef(e){const t=this.raw.getTileByRef(e);return s.isNull(t)?null:new B(t)}getMaxTiles(){return this.raw.getMaxTiles()}getTile(e){return new B(this.raw.getTile(e))}getTileAndPolyByRef(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{success:L(t.status),status:t.status,tile:r,poly:i}}getTileAndPolyByRefUnsafe(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{tile:r,poly:i}}isValidPolyRef(e){return this.raw.isValidPolyRef(e)}getPolyRefBase(e){return this.raw.getPolyRefBase(e.raw)}getOffMeshConnectionPolyEndPoints(e,t){const r=new s.Vec3,i=new s.Vec3,o=this.raw.getOffMeshConnectionPolyEndPoints(e,t,r,i),l=m.fromRaw(r);s.destroy(r);const n=m.fromRaw(i);return s.destroy(i),{success:L(o),status:o,start:l,end:n}}getOffMeshConnectionByRef(e){return new he(this.raw.getOffMeshConnectionByRef(e))}setPolyFlags(e,t){return this.raw.setPolyFlags(e,t)}getPolyFlags(e){const t=new s.UnsignedShortRef,r=this.raw.getPolyFlags(e,t),i=t.value;return s.destroy(t),{status:r,flags:i}}setPolyArea(e,t){return this.raw.setPolyArea(e,t)}getPolyArea(e){const t=new s.UnsignedCharRef,r=this.raw.getPolyArea(e,t),i=t.value;return s.destroy(t),{status:r,area:i}}getTileStateSize(e){return this.raw.getTileStateSize(e.raw)}storeTileState(e,t){return new ut(this.raw.storeTileState(e.raw,t))}restoreTileState(e,t,r){return this.raw.restoreTileState(e.raw,t,r)}destroy(){this.raw.destroy(),s.Module.destroy(this.raw)}}const ct=(a,e)=>{const t=[],r=[];let i=0;const o=a.getMaxTiles();for(let l=0;l<o;l++){const n=a.getTile(l),u=n.header();if(!u)continue;const d=u.polyCount();for(let _=0;_<d;++_){const c=n.polys(_);if(c.getType()===1)continue;const y=c.vertCount(),M=n.detailMeshes(_),p=M.triBase(),C=M.triCount();for(let I=0;I<C;++I){const w=(p+I)*4;for(let P=0;P<3;++P){if(n.detailTris(w+P)<y){const A=c.verts(n.detailTris(w+P))*3;t.push(n.verts(A),n.verts(A+1),n.verts(A+2))}else{const A=(M.vertBase()+n.detailTris(w+P)-c.vertCount())*3;t.push(n.detailVerts(A),n.detailVerts(A+1),n.detailVerts(A+2))}r.push(i++)}}}}return[t,r]},re={borderSize:0,tileSize:0,cs:.2,ch:.2,walkableSlopeAngle:60,walkableHeight:2,walkableClimb:2,walkableRadius:.5,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1},fe=a=>{const e={...re,...a},t=new s.Module.rcConfig;return t.borderSize=e.borderSize,t.tileSize=e.tileSize,t.cs=e.cs,t.ch=e.ch,t.walkableSlopeAngle=e.walkableSlopeAngle,t.walkableHeight=e.walkableHeight,t.walkableClimb=e.walkableClimb,t.walkableRadius=e.walkableRadius,t.maxEdgeLen=e.maxEdgeLen,t.maxSimplificationError=e.maxSimplificationError,t.minRegionArea=e.minRegionArea,t.mergeRegionArea=e.mergeRegionArea,t.maxVertsPerPoly=e.maxVertsPerPoly,t.detailSampleDist=e.detailSampleDist,t.detailSampleMaxError=e.detailSampleMaxError,t},ht=a=>{const e=new s.Module.rcConfig;return e.set_bmin(0,a.get_bmin(0)),e.set_bmin(1,a.get_bmin(1)),e.set_bmin(2,a.get_bmin(2)),e.set_bmax(0,a.get_bmax(0)),e.set_bmax(1,a.get_bmax(1)),e.set_bmax(2,a.get_bmax(2)),e.width=a.width,e.height=a.height,e.borderSize=a.borderSize,e.tileSize=a.tileSize,e.cs=a.cs,e.ch=a.ch,e.walkableSlopeAngle=a.walkableSlopeAngle,e.walkableHeight=a.walkableHeight,e.walkableClimb=a.walkableClimb,e.walkableRadius=a.walkableRadius,e.maxEdgeLen=a.maxEdgeLen,e.maxSimplificationError=a.maxSimplificationError,e.minRegionArea=a.minRegionArea,e.mergeRegionArea=a.mergeRegionArea,e.maxVertsPerPoly=a.maxVertsPerPoly,e.detailSampleDist=a.detailSampleDist,e.detailSampleMaxError=a.detailSampleMaxError,e};class se{logs=[];startTimes={};accumulatedTimes={};constructor(e=!0){const t=new s.Module.RecastBuildContextJsImpl;t.log=(r,i,o)=>{if(!this.raw.logEnabled())return;const l=i,n=new Uint8Array(s.Module.HEAPU8.buffer,l,o),u=new Uint8Array(o);u.set(n);const d=new TextDecoder().decode(u);this.log(r,d)},t.resetLog=()=>{this.resetLog()},t.startTimer=r=>{this.raw.timerEnabled()&&this.startTimer(r)},t.stopTimer=r=>{this.raw.timerEnabled()&&this.stopTimer(r)},t.getAccumulatedTime=r=>this.raw.timerEnabled()?this.getAccumulatedTime(r):-1,t.resetTimers=()=>{this.raw.timerEnabled()&&(this.startTimes={},this.accumulatedTimes={})},this.raw=new s.Module.RecastBuildContext(t),this.raw.enableTimer(e),this.raw.enableLog(e),this.resetTimers()}log(e,t){this.logs.push({category:e,msg:t})}resetLog(){this.logs=[]}startTimer(e){this.startTimes[e]=performance.now()}stopTimer(e){const r=performance.now()-this.startTimes[e];this.accumulatedTimes[e]===-1?this.accumulatedTimes[e]=r:this.accumulatedTimes[e]+=r}getAccumulatedTime(e){return this.accumulatedTimes[e]}resetTimers(){for(let e=0;e<g.RC_MAX_TIMERS;e++)this.startTimes[e]=-1,this.accumulatedTimes[e]=-1}}class dt{constructor(e){this.raw=e??new s.rcChunkyTriMesh}init(e,t,r,i){return s.ChunkyTriMeshUtils.createChunkyTriMesh(e.raw,t.raw,r,i,this.raw)}getChunksOverlappingRect(e,t,r,i){return s.ChunkyTriMeshUtils.getChunksOverlappingRect(this.raw,e,t,r.raw,i)}getNodeTris(e){return W.fromRaw(s.ChunkyTriMeshUtils.getChunkyTriMeshNodeTris(this.raw,e))}nodes(e){return this.raw.get_nodes(e)}maxTrisPerChunk(){return this.raw.maxTrisPerChunk}}class V{constructor(e){this.raw=e}smin(){return this.raw.smin}smax(){return this.raw.smax}area(){return this.raw.area}next(){return s.isNull(this.raw.next)?null:new V(this.raw.next)}}class ae{constructor(e){this.raw=e}next(){return s.isNull(this.raw.next)?null:new ae(this.raw.next)}items(e){return new V(this.raw.get_items(e))}}class wt{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}spans(e){return new V(this.raw.get_spans(e))}pools(e){return new ae(this.raw.get_pools(e))}freelist(e){return new V(this.raw.get_freelist(e))}}class gt{constructor(e){this.raw=e}index(){return this.raw.get_index()}count(){return this.raw.get_count()}}class _t{constructor(e){this.raw=e}y(){return this.raw.get_y()}reg(){return this.raw.get_reg()}con(){return this.raw.get_con()}h(){return this.raw.get_h()}}class ft{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}spanCount(){return this.raw.spanCount}walkableHeight(){return this.raw.walkableHeight}walkableClimb(){return this.raw.walkableClimb}borderSize(){return this.raw.borderSize}maxDistance(){return this.raw.maxDistance}maxRegions(){return this.raw.maxRegions}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}cells(e){return new gt(this.raw.get_cells(e))}spans(e){return new _t(this.raw.get_spans(e))}dist(e){return this.raw.get_dist(e)}areas(e){return this.raw.get_areas(e)}}class Rt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}nverts(){return this.raw.nverts}rverts(e){return this.raw.get_rverts(e)}nrverts(){return this.raw.nrverts}reg(){return this.raw.reg}area(){return this.raw.area}}class Tt{constructor(e){this.raw=e}conts(e){return new Rt(this.raw.get_conts(e))}nconts(){return this.raw.nconts}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}width(){return this.raw.width}height(){return this.raw.height}borderSize(){return this.raw.borderSize}maxError(){return this.raw.maxError}}class mt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}polys(e){return this.raw.get_polys(e)}regs(e){return this.raw.get_regs(e)}flags(e){return this.raw.get_flags(e)}setFlags(e,t){this.raw.set_flags(e,t)}areas(e){return this.raw.get_areas(e)}setAreas(e,t){this.raw.set_areas(e,t)}nverts(){return this.raw.nverts}npolys(){return this.raw.npolys}maxpolys(){return this.raw.maxpolys}nvp(){return this.raw.nvp}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}borderSize(){return this.raw.borderSize}maxEdgeError(){return this.raw.maxEdgeError}}class yt{constructor(e){this.raw=e}meshes(e){return this.raw.get_meshes(e)}verts(e){return this.raw.get_verts(e)}tris(e){return this.raw.get_tris(e)}nmeshes(){return this.raw.nmeshes}nverts(){return this.raw.nverts}ntris(){return this.raw.ntris}}const Re=(a,e,t)=>s.Recast.calcGridSize(a,e,t),Te=(a,e,t,r,i,o,l,n)=>s.Recast.createHeightfield(a.raw,e.raw,t,r,i,o,l,n),me=(a,e,t,r,i,o,l)=>s.Recast.markWalkableTriangles(a.raw,e,t.raw,r,i.raw,o,l.raw),ye=(a,e,t,r,i,o,l,n=1)=>s.Recast.rasterizeTriangles(a.raw,e.raw,t,r.raw,i.raw,o,l.raw,n),Ae=(a,e,t)=>s.Recast.filterLowHangingWalkableObstacles(a.raw,e,t.raw),Me=(a,e,t,r)=>s.Recast.filterLedgeSpans(a.raw,e,t,r.raw),Ee=(a,e,t)=>s.Recast.filterWalkableLowHeightSpans(a.raw,e,t.raw),pe=(a,e,t,r,i)=>s.Recast.buildCompactHeightfield(a.raw,e,t,r.raw,i.raw),Ce=(a,e,t)=>s.Recast.erodeWalkableArea(a.raw,e,t.raw),Se=(a,e)=>s.Recast.buildDistanceField(a.raw,e.raw),Ie=(a,e,t,r,i)=>s.Recast.buildRegions(a.raw,e.raw,t,r,i),De=(a,e,t,r,i,o=g.RC_CONTOUR_TESS_WALL_EDGES)=>s.Recast.buildContours(a.raw,e.raw,t,r,i.raw,o),be=(a,e,t,r)=>s.Recast.buildPolyMesh(a.raw,e.raw,t,r.raw),Pe=(a,e,t,r,i,o)=>s.Recast.buildPolyMeshDetail(a.raw,e.raw,t.raw,r,i,o.raw),xe=()=>new wt(s.Recast.allocHeightfield()),X=a=>s.Recast.freeHeightfield(a.raw),ve=()=>new ft(s.Recast.allocCompactHeightfield()),$=a=>s.Recast.freeCompactHeightfield(a.raw),Ne=()=>new Tt(s.Recast.allocContourSet()),q=a=>s.Recast.freeContourSet(a.raw),Oe=()=>new mt(s.Recast.allocPolyMesh()),Le=a=>s.Recast.freePolyMesh(a.raw),Fe=()=>new yt(s.Recast.allocPolyMeshDetail()),He=a=>s.Recast.freePolyMeshDetail(a.raw),At=(a,e)=>{const t=s.NavMeshExporter.exportNavMesh(a.raw,e?.raw),r=new Uint8Array(s.Module.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(r),s.NavMeshExporter.freeNavMeshExport(t),i},Mt=a=>At(a),Et=a=>{const e=a.length*a.BYTES_PER_ELEMENT,t=s.Module._malloc(e),r=new Uint8Array(s.Module.HEAPU8.buffer,t,e);r.set(a);const i=new s.Module.NavMeshExport;return i.dataPointer=r.byteOffset,i.size=a.length,{navMeshExport:i,dataHeap:r}},pt=a=>{const{navMeshExport:e,dataHeap:t}=Et(a),r=s.NavMeshImporter.importNavMesh(e,void 0);return s.Module._free(t.byteOffset),{navMesh:new te(r.navMesh)}},ze=(a,e)=>{const t={x:1/0,y:1/0,z:1/0},r={x:-1/0,y:-1/0,z:-1/0};for(let i=0;i<e.length;i++){const o=e[i],l=a[o*3],n=a[o*3+1],u=a[o*3+2];t.x=Math.min(t.x,l),t.y=Math.min(t.y,n),t.z=Math.min(t.z,u),r.x=Math.max(r.x,l),r.y=Math.max(r.y,n),r.z=Math.max(r.z,u)}return{bbMin:m.toArray(t),bbMax:m.toArray(r)}},Ct=a=>{let e=0,t=0;return e=+(a>65535)<<4,a>>=e,t=+(a>255)<<3,a>>=t,e|=t,t=+(a>15)<<2,a>>=t,e|=t,t=+(a>3)<<1,a>>=t,e|=t,e|=a>>1,e},St=a=>(a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a),It={...re,buildBvTree:!0},Dt=(a,e,t={},r=!1)=>{const i=new se,o={type:"solo",buildContext:i},l=()=>{r||(o.heightfield&&(X(o.heightfield),o.heightfield=void 0),o.compactHeightfield&&($(o.compactHeightfield),o.compactHeightfield=void 0),o.contourSet&&(q(o.contourSet),o.contourSet=void 0),o.polyMesh&&(Le(o.polyMesh),o.polyMesh=void 0),o.polyMeshDetail&&(He(o.polyMeshDetail),o.polyMeshDetail=void 0))},n=T=>(l(),{navMeshData:void 0,success:!1,intermediates:o,error:T}),u=a,d=e.length,_=new ue;_.copy(u);const c=e,y=e.length/3,M=new ce;M.copy(c);let p,C;if(t.bounds)p=t.bounds[0],C=t.bounds[1];else{const T=ze(a,e);p=T.bbMin,C=T.bbMax}const I={...It,...t},w=fe(I);w.minRegionArea=w.minRegionArea*w.minRegionArea,w.mergeRegionArea=w.mergeRegionArea*w.mergeRegionArea,w.detailSampleDist=w.detailSampleDist<.9?0:w.cs*w.detailSampleDist,w.detailSampleMaxError=w.ch*w.detailSampleMaxError;const P=Re(p,C,w.cs);w.width=P.width,w.height=P.height;const A=xe();if(o.heightfield=A,!Te(i,A,w.width,w.height,p,C,w.cs,w.ch))return n("Could not create heightfield");const E=new Z;if(E.resize(y),me(i,w.walkableSlopeAngle,_,d,M,y,E),!ye(i,_,d,M,E,y,A,w.walkableClimb))return n("Could not rasterize triangles");E.destroy(),_.destroy(),M.destroy(),Ae(i,w.walkableClimb,A),Me(i,w.walkableHeight,w.walkableClimb,A),Ee(i,w.walkableHeight,A);const D=ve();if(o.compactHeightfield=D,!pe(i,w.walkableHeight,w.walkableClimb,A,D))return n("Failed to build compact data");if(r||(X(A),o.heightfield=void 0),!Ce(i,w.walkableRadius,D))return n("Failed to erode walkable area");if(!Se(i,D))return n("Failed to build distance field");if(!Ie(i,D,w.borderSize,w.minRegionArea,w.mergeRegionArea))return n("Failed to build regions");const b=Ne();if(o.contourSet=b,!De(i,D,w.maxSimplificationError,w.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return n("Failed to create contours");const S=Oe();if(o.polyMesh=S,!be(i,b,w.maxVertsPerPoly,S))return n("Failed to triangulate contours");const N=Fe();if(o.polyMeshDetail=N,!Pe(i,S,D,w.detailSampleDist,w.detailSampleMaxError,N))return n("Failed to build detail mesh");r||($(D),o.compactHeightfield=void 0,q(b),o.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(w.walkableHeight*w.ch),h.setWalkableRadius(w.walkableRadius*w.cs),h.setWalkableClimb(w.walkableClimb*w.ch),h.setCellSize(w.cs),h.setCellHeight(w.ch),h.setBuildBvTree(I.buildBvTree),t.offMeshConnections&&h.setOffMeshConnections(t.offMeshConnections);const R=de(h);return R.success?(l(),{navMeshData:R.navMeshData,success:!0,intermediates:o}):n("Failed to create Detour navmesh data")},bt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=Dt(a,e,t,r);if(!i.success)return{navMesh:void 0,success:!1,intermediates:i.intermediates,error:i.error};const{navMeshData:o}=i,l=new te;return l.initSolo(o)?{success:!0,navMesh:l,intermediates:i.intermediates}:(o.destroy(),{navMesh:void 0,success:!1,intermediates:i.intermediates,error:"Failed to initialize solo NavMesh"})},Pt=({recastConfig:a,navMeshBounds:[e,t]})=>{const r=fe(a),i=Re(e,t,r.cs);r.width=i.width,r.height=i.height,r.minRegionArea=r.minRegionArea*r.minRegionArea,r.mergeRegionArea=r.mergeRegionArea*r.mergeRegionArea,r.tileSize=Math.floor(r.tileSize),r.borderSize=r.walkableRadius+3,r.width=r.tileSize+r.borderSize*2,r.height=r.tileSize+r.borderSize*2,r.detailSampleDist=r.detailSampleDist<.9?0:r.cs*r.detailSampleDist,r.detailSampleMaxError=r.ch*r.detailSampleMaxError;const o=Math.floor(r.tileSize),l=Math.floor((i.width+o-1)/o),n=Math.floor((i.height+o-1)/o),u=r.tileSize*r.cs,d=m.fromArray(e);let _=Math.min(Math.floor(Ct(St(l*n))),14);_>14&&(_=14);const c=22-_,y=1<<_,M=1<<c;return{config:r,gridSize:i,tileSize:o,tileWidth:l,tileHeight:n,tcs:u,orig:d,maxTiles:y,maxPolysPerTile:M}},Be={...re,chunkyTriMeshTrisPerChunk:256,buildBvTree:!0},xt=(a,e,t,r,i,o={},l=!1,n=new se)=>{const u={x:i.x,y:i.y},d=()=>{l||(u.compactHeightfield&&($(u.compactHeightfield),u.compactHeightfield=void 0),u.heightfield&&(X(u.heightfield),u.heightfield=void 0),u.contourSet&&(q(u.contourSet),u.contourSet=void 0),u.polyMesh&&(Le(u.polyMesh),u.polyMesh=void 0),u.polyMeshDetail&&(He(u.polyMeshDetail),u.polyMeshDetail=void 0))},_=T=>(n.log(g.RC_LOG_ERROR,T),d(),{success:!1,error:T,intermediates:u}),c=ht(t),y=[...i.bmin],M=[...i.bmax];y[0]-=c.borderSize*c.cs,y[2]-=c.borderSize*c.cs,M[0]+=c.borderSize*c.cs,M[2]+=c.borderSize*c.cs,c.set_bmin(0,y[0]),c.set_bmin(1,y[1]),c.set_bmin(2,y[2]),c.set_bmax(0,M[0]),c.set_bmax(1,M[1]),c.set_bmax(2,M[2]),n.resetTimers(),n.startTimer(g.RC_TIMER_TOTAL),n.log(g.RC_LOG_PROGRESS,`Building tile at x: ${i.x}, y: ${i.y}`),n.log(g.RC_LOG_PROGRESS,` - ${c.width} x ${c.height} cells`),n.log(g.RC_LOG_PROGRESS,` - ${a.size/3/1e3}K verts, ${e.size/3/1e3}K tris`);const p=xe();if(u.heightfield=p,!Te(n,p,c.width,c.height,y,M,c.cs,c.ch))return _("Could not create heightfield");new Z().resize(r.maxTrisPerChunk());const I=[y[0],y[2]],w=[M[0],M[2]],P=512,A=new je;A.resize(P);const E=r.getChunksOverlappingRect(I,w,A,P);if(E===0)return{success:!0,intermediates:u};for(let T=0;T<E;++T){const x=A.get(T),H=r.nodes(x).n,U=r.getNodeTris(x),F=new Z;F.resize(H),me(n,c.walkableSlopeAngle,a,e.size,U,H,F);const G=ye(n,a,e.size,U,F,H,p,c.walkableClimb);if(F.destroy(),!G)return _("Could not rasterize triangles")}Ae(n,c.walkableClimb,p),Me(n,c.walkableHeight,c.walkableClimb,p),Ee(n,c.walkableHeight,p);const D=ve();if(u.compactHeightfield=D,!pe(n,c.walkableHeight,c.walkableClimb,p,D))return _("Could not build compact heightfield");if(l||(X(u.heightfield),u.heightfield=void 0),!Ce(n,c.walkableRadius,D))return _("Could not erode walkable area");if(!Se(n,D))return _("Failed to build distance field");if(!Ie(n,D,c.borderSize,c.minRegionArea,c.mergeRegionArea))return _("Failed to build regions");const b=Ne();if(u.contourSet=b,!De(n,D,c.maxSimplificationError,c.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return _("Failed to create contours");const S=Oe();if(u.polyMesh=S,!be(n,b,c.maxVertsPerPoly,S))return _("Failed to triangulate contours");const N=Fe();if(u.polyMeshDetail=N,!Pe(n,S,D,c.detailSampleDist,c.detailSampleMaxError,N))return _("Failed to build detail mesh");l||($(D),u.compactHeightfield=void 0,q(b),u.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(c.walkableHeight*c.ch),h.setWalkableRadius(c.walkableRadius*c.cs),h.setWalkableClimb(c.walkableClimb*c.ch),h.setCellSize(c.cs),h.setCellHeight(c.ch),h.setBuildBvTree(o.buildBvTree??Be.buildBvTree),o.offMeshConnections&&h.setOffMeshConnections(o.offMeshConnections),h.setTileX(i.x),h.setTileY(i.y);const R=de(h);return R.success?(n.log(g.RC_LOG_PROGRESS,`>> Polymesh: ${S.nverts()} vertices ${S.npolys()} polygons`),{success:!0,data:R.navMeshData,intermediates:u}):_("Failed to create Detour navmesh data")},vt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=new se,o={type:"tiled",buildContext:i,chunkyTriMesh:void 0,tileIntermediates:[]},l=new te,n=a,u=new ue;u.copy(n);const d=e,_=e.length/3,c=new ce;c.copy(d);const y=()=>{u.destroy(),c.destroy(),!r&&o.chunkyTriMesh&&(o.chunkyTriMesh=void 0)},M=x=>(y(),l.destroy(),{success:!1,navMesh:void 0,intermediates:o,error:x}),p={...Be,...t};let C,I;if(t.bounds)C=t.bounds[0],I=t.bounds[1];else{const x=ze(a,e);C=x.bbMin,I=x.bbMax}const{config:w,tileWidth:P,tileHeight:A,tcs:E,orig:D,maxTiles:b,maxPolysPerTile:S}=Pt({recastConfig:p,navMeshBounds:[C,I]}),N=Q.create({orig:D,tileWidth:p.tileSize*p.cs,tileHeight:p.tileSize*p.cs,maxTiles:b,maxPolys:S});if(!l.initTiled(N))return M("Could not init nav mesh for tiled use");const h=new dt;if(o.chunkyTriMesh=h,!h.init(u,c,_,p.chunkyTriMeshTrisPerChunk))return M("Failed to build chunky triangle mesh");i.startTimer(g.RC_TIMER_TEMP);const R=[0,0,0],T=[0,0,0];for(let x=0;x<A;x++)for(let O=0;O<P;O++){R[0]=C[0]+O*E,R[1]=C[1],R[2]=C[2]+x*E,T[0]=C[0]+(O+1)*E,T[1]=I[1],T[2]=C[2]+(x+1)*E;const H={x:O,y:x,bmin:R,bmax:T},U={offMeshConnections:p.offMeshConnections,buildBvTree:p.buildBvTree},F=xt(u,c,w,h,H,U,r,i);if(o.tileIntermediates.push(F.intermediates),F.success&&F.data){l.removeTile(l.getTileRefAt(O,x,0));const G=l.addTile(F.data,f.DT_TILE_FREE_DATA,0);Ze(G.status)&&(i.log(g.RC_LOG_WARNING,`Failed to add tile to nav mesh tx: ${O}, ty: ${x}, status: ${Je(G.status)} (${G.status})`),F.data.destroy())}}return i.stopTimer(g.RC_TIMER_TEMP),r||y(),{success:!0,navMesh:l,intermediates:o}},Nt=a=>{const e=[],t=[],r={};let i=0;for(const{positions:o,indices:l}of a)for(let n=0;n<l.length;n++){const u=l[n]*3,d=o[u],_=o[u+1],c=o[u+2],y=`${d}_${_}_${c}`;let M=r[y];M||(r[y]=M=i,e.push(d,_,c),i++),t.push(M)}return[Float32Array.from(e),Uint32Array.from(t)]};new Qe;class Ot extends ke{constructor(e,t){super(),this.navMesh=e,this.navMeshGeometry=new Ve,this.navMeshMaterial=t?.navMeshMaterial?t.navMeshMaterial:new We({color:"orange",transparent:!0,opacity:.7,depthWrite:!1}),this.update(),this.mesh=new j(this.navMeshGeometry,this.navMeshMaterial),this.add(this.mesh)}update(){const[e,t]=ct(this.navMesh);this.navMeshGeometry.setAttribute("position",new ie(Float32Array.from(e),3)),this.navMeshGeometry.setIndex(new ie(Uint32Array.from(t),1)),this.navMeshGeometry.computeVertexNormals()}}const Lt=new Ye,Ue=a=>{const e=[];for(const t of a){const r=t.geometry.attributes.position;if(!r||r.itemSize!==3)continue;t.updateMatrixWorld();const i=new Float32Array(r.array);for(let l=0;l<i.length;l+=3){const n=Lt.set(i[l],i[l+1],i[l+2]);t.localToWorld(n),i[l]=n.x,i[l+1]=n.y,i[l+2]=n.z}let o=t.geometry.getIndex()?.array;if(o===void 0){const l=[];for(let n=0;n<r.count;n++)l.push(n);o=l}e.push({positions:i,indices:o})}return Nt(e)},Ft=(a,e={},t=!1)=>{const[r,i]=Ue(a);return bt(r,i,e,t)},Ht=(a,e={},t=!1)=>{const[r,i]=Ue(a);return vt(r,i,e,t)},zt=["invalid","walking","offmesh"];let oe=!1;async function nr(){oe||(await Ke(),oe=!0)}function Bt(a){const e=a.getIndex();if(e===null){const t=a.getAttribute("position").clone();for(let r=0;r+2<t.count;r+=3)for(let i=0;i<t.itemSize;i+=1){const o=t.getComponent(r+1,i);t.setComponent(r+1,i,t.getComponent(r+2,i)),t.setComponent(r+2,i,o)}a.setAttribute("position",t);return}for(let t=0;t+2<e.count;t+=3){const r=e.getX(t+1);e.setX(t+1,e.getX(t+2)),e.setX(t+2,r)}e.needsUpdate=!0}function Ut(a){const e=a.getAttribute("position"),t=a.getIndex(),r=l=>t?.getX(l)??l;let i=0;const o=t?.count??e.count;for(let l=0;l+2<o;l+=3){const n=r(l),u=r(l+1),d=r(l+2),_=e.getX(u)-e.getX(n),c=e.getZ(u)-e.getZ(n),y=e.getX(d)-e.getX(n),M=e.getZ(d)-e.getZ(n);i+=c*y-_*M}return i}function Gt(a){const e=[],t=(l,n)=>{if(n.determinant()<0){const d=l.clone().applyMatrix4(n);return Ut(d)<0&&Bt(d),e.push(d),new j(d)}const u=new j(l);return u.matrixAutoUpdate=!1,u.matrix.copy(n),u.matrixWorldNeedsUpdate=!0,u},r=[],i=new ne,o=new ne;for(const l of a){if(l.updateWorldMatrix(!0,!1),l instanceof Xe){for(let n=0;n<l.count;n+=1)l.getMatrixAt(n,i),o.multiplyMatrices(l.matrixWorld,i),r.push(t(l.geometry,o));continue}r.push(l.matrixWorld.determinant()>=0?l:t(l.geometry,l.matrixWorld))}return{meshes:r,temporaryGeometries:e}}const kt=1297302868,Vt=1,Wt=1145979222,Yt=7;function Qt(a){let e=1;for(;e<a;)e*=2;return e}function Xt(a,e){const t=a.vertices.length,r=a.polygons.length;if(t===0||r===0)throw new Error("NavMeshManager.buildFromPolygons: vertices and polygons must be non-empty");if(t>65535)throw new Error(`NavMeshManager.buildFromPolygons: ${t} vertices exceed Detour's uint16 tile index`);if(a.detailMeshes.length!==r)throw new Error(`NavMeshManager.buildFromPolygons: ${r} polygons require the same number of detail rows`);const i=a.polygons.map(h=>h.vertices.map(()=>0)),o=new Map;let l=0;for(let h=0;h<r;h+=1){const R=a.polygons[h];if(R.vertices.length<3||R.vertices.length>6)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has ${R.vertices.length} vertices; Detour permits 3..6`);l+=R.vertices.length;for(let T=0;T<R.vertices.length;T+=1){const x=R.vertices[T],O=R.vertices[(T+1)%R.vertices.length];if(!Number.isInteger(x)||!Number.isInteger(O)||x<0||O<0||x>=t||O>=t)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} references an invalid vertex`);const H=`${x},${O}`;if(o.has(H))throw new Error(`NavMeshManager.buildFromPolygons: directed edge ${H} occurs more than once`);const U=o.get(`${O},${x}`);if(U===void 0)o.set(H,[h,T]);else{const[F,G]=U;i[h][T]=F+1,i[F][G]=h+1}}}for(let h=0;h<r;h+=1){const R=a.detailMeshes[h];if(R.vertexBase<0||R.vertexCount<0||R.vertexBase+R.vertexCount>a.detailVertices.length||R.triangleBase<0||R.triangleCount<0||R.triangleBase+R.triangleCount>a.detailTriangles.length||R.vertexCount>255||R.triangleCount>255)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has an invalid detail row`)}for(const h of a.detailTriangles)if(h.some(R=>!Number.isInteger(R)||R<0||R>255))throw new Error("NavMeshManager.buildFromPolygons: detail triangles must contain uint8 values");const n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const h of[...a.vertices,...a.detailVertices])for(let R=0;R<3;R+=1){const T=h[R];if(!Number.isFinite(T))throw new Error("NavMeshManager.buildFromPolygons: every vertex component must be finite");n[R]=Math.min(n[R],T),u[R]=Math.max(u[R],T)}const d=100,_=32,c=12,p=d+t*12+r*_+l*c+r*12+a.detailVertices.length*12+a.detailTriangles.length*4,C=new Uint8Array(48+p),I=new DataView(C.buffer);let w=0;const P=h=>{I.setUint8(w,h),w+=1},A=h=>{I.setUint16(w,h,!0),w+=2},E=h=>{I.setUint32(w,h,!0),w+=4},D=h=>{I.setInt32(w,h,!0),w+=4},b=h=>{I.setFloat32(w,h,!0),w+=4},S=Qt(r);E(kt),E(Vt),E(1);for(const h of n)b(h);b(Math.max(u[0]-n[0],Number.EPSILON)),b(Math.max(u[2]-n[2],Number.EPSILON)),E(1),E(S),E(S),E(p),E(Wt),E(Yt),D(0),D(0),D(0),E(0),E(r),E(t),E(l),E(r),E(a.detailVertices.length),E(a.detailTriangles.length),E(0),E(0),E(r);const N=le.navigation;b(e?.walkableHeight??N.walkableHeight),b(e?.walkableRadius??N.walkableRadius),b(e?.walkableClimb??N.walkableClimb);for(const h of n)b(h);for(const h of u)b(h);b(1/(e?.cellSize??N.cellSize));for(const h of a.vertices)for(const R of h)b(R);for(let h=0;h<r;h+=1){const R=a.polygons[h];E(4294967295);for(let T=0;T<6;T+=1)A(R.vertices[T]??0);for(let T=0;T<6;T+=1)A(i[h]?.[T]??0);A(R.flags??1),P(R.vertices.length),P((R.area??0)&63)}w+=l*c;for(const h of a.detailMeshes)E(h.vertexBase),E(h.triangleBase),P(h.vertexCount),P(h.triangleCount),A(0);for(const h of a.detailVertices)for(const R of h)b(R);for(const h of a.detailTriangles)for(const R of h)P(R);if(w!==C.length)throw new Error(`NavMeshManager.buildFromPolygons: encoded ${w} bytes into a ${C.length}-byte allocation`);return C}class or{navMesh=null;query=null;crowd=null;helper=null;buildFromMeshes(e,t){const r=le.navigation,i=Gt(e),o=i.meshes.reduce((u,d)=>{const _=d.geometry.getIndex(),c=d.geometry.getAttribute("position").count;return u+Math.floor((_?.count??c)/3)},0),l={cs:t?.cellSize??r.cellSize,ch:t?.cellHeight??r.cellHeight,walkableSlopeAngle:t?.walkableSlopeAngle??r.walkableSlopeAngle,walkableHeight:t?.walkableHeight??r.walkableHeight,walkableClimb:t?.walkableClimb??r.walkableClimb,walkableRadius:t?.walkableRadius??r.walkableRadius,maxEdgeLen:t?.maxEdgeLen??r.maxEdgeLen,maxSimplificationError:t?.maxSimplificationError??r.maxSimplificationError,minRegionArea:t?.minRegionArea??r.minRegionArea,mergeRegionArea:t?.mergeRegionArea??r.mergeRegionArea,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};let n;try{n=t?.tiled===!0||i.meshes.length>256||o>1e4?Ht(i.meshes,{...l,tileSize:t?.tileSize??256}):Ft(i.meshes,l)}finally{for(const u of i.temporaryGeometries)u.dispose()}return!n.success||!n.navMesh?!1:(this.destroyRecast(),this.navMesh=n.navMesh,this.query=new ee(this.navMesh),!0)}buildFromPolygons(e,t){try{return this.loadFromData(Xt(e,t)),!0}catch{return!1}}destroyRecast(){this.helper&&(this.helper.parent?.remove(this.helper),this.helper.dispose?.(),this.helper=null),this.crowd&&(this.crowd.destroy(),this.crowd=null),this.query&&(this.query.destroy(),this.query=null),this.navMesh&&(this.navMesh.destroy(),this.navMesh=null)}hasNavMesh(){return this.navMesh!==null}findPath(e,t){if(!this.query)throw new Error("NavMeshManager.findPath: no navmesh has been built, so no path can be queried. Build one first (buildFromMeshes/importNavMesh) — gate on hasNavMesh() if the caller can run before a bake.");const r=this.query.computePath(e,t);if(!r.success&&r.error)throw new Error(`NavMeshManager.findPath: recast could not complete the query (${r.error.name}${r.error.status===void 0?"":`, status ${r.error.status}`}).`);return r.path}createCrowd(e){if(!this.navMesh)throw new Error("Build navmesh first");return this.crowd=new it(this.navMesh,{maxAgents:e,maxAgentRadius:.6}),this.crowd}updateCrowd(e){this.crowd?.update(e)}getCrowdAgents(){return this.crowd?this.crowd.getAgents().map(e=>{const t=e.interpolatedPosition,r=e.velocity(),i=e.target(),o=zt[e.state()]??"invalid",l=o==="invalid"?[]:e.corners().map(n=>({x:n.x,y:n.y,z:n.z}));return{position:{x:t.x,y:t.y,z:t.z},velocity:{x:r.x,y:r.y,z:r.z},radius:e.radius,height:e.height,state:o,target:{x:i.x,y:i.y,z:i.z},corners:l}}):[]}getDebugMesh(e){return this.navMesh?(this.helper||(this.helper=new Ot(this.navMesh),e.add(this.helper)),this.helper):null}exportData(){if(!this.navMesh)throw new Error("No navmesh to export");return Mt(this.navMesh)}loadFromData(e){const{navMesh:t}=pt(e);this.destroyRecast(),this.navMesh=t,this.query=new ee(this.navMesh)}dispose(e){this.helper&&e.remove(this.helper),this.destroyRecast()}}export{or as NavMeshManager,nr as initNavigation};
|
|
1
|
+
import{_ as Ge}from"./index-Cr9NTnJp.js";import"./three.module-BLhyNg0e.js";import{cW as ke,N as Ve,cp as We,co as j,M as ie,fo as Ye,_ as Qe,cm as ne,bu as Xe}from"./three.core-3arARmh6.js";import{DEFAULTS as le}from"./defaults-DKiBJCPN.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 $e=["Recast","Detour","DetourNavMeshBuilder","DetourTileCacheBuilder","NavMeshImporter","NavMeshExporter","CrowdUtils","ChunkyTriMeshUtils","RecastDebugDraw","DetourDebugDraw"],qe=["rcConfig","rcContext","dtNavMeshParams","dtNavMeshCreateParams","RecastLinearAllocator","RecastFastLZCompressor","rcChunkyTriMesh","dtTileCacheParams","dtTileCacheLayerHeader","Vec3","BoolRef","IntRef","UnsignedIntRef","UnsignedCharRef","UnsignedShortRef","FloatRef","IntArray","UnsignedIntArray","UnsignedCharArray","UnsignedShortArray","FloatArray"],s={isNull:a=>s.Module.getPointer(a)===0,destroy:a=>{s.Module.destroy(a)}},g={},f={},Ke=async a=>{if(s.Module===void 0){{const e=(await Ge(async()=>{const{default:t}=await import("./recast-navigation.wasm-compat-Dsoa_MD-.js");return{default:t}},[])).default;s.Module=await e()}for(const e of $e)s[e]=new s.Module[e];for(const e of qe)s[e]=s.Module[e];g.RC_BORDER_REG=s.Recast.BORDER_REG,g.RC_MULTIPLE_REGS=s.Recast.MULTIPLE_REGS,g.RC_BORDER_VERTEX=s.Recast.BORDER_VERTEX,g.RC_AREA_BORDER=s.Recast.AREA_BORDER,g.RC_CONTOUR_REG_MASK=s.Recast.CONTOUR_REG_MASK,g.RC_MESH_NULL_IDX=s.Recast.MESH_NULL_IDX,g.RC_NULL_AREA=s.Recast.NULL_AREA,g.RC_WALKABLE_AREA=s.Recast.WALKABLE_AREA,g.RC_NOT_CONNECTED=s.Recast.NOT_CONNECTED,g.RC_CONTOUR_TESS_WALL_EDGES=s.Module.RC_CONTOUR_TESS_WALL_EDGES,g.RC_CONTOUR_TESS_AREA_EDGES=s.Module.RC_CONTOUR_TESS_AREA_EDGES,g.RC_LOG_PROGRESS=s.Module.RC_LOG_PROGRESS,g.RC_LOG_WARNING=s.Module.RC_LOG_WARNING,g.RC_LOG_ERROR=s.Module.RC_LOG_ERROR,g.RC_TIMER_TOTAL=s.Module.RC_TIMER_TOTAL,g.RC_TIMER_TEMP=s.Module.RC_TIMER_TEMP,g.RC_TIMER_RASTERIZE_TRIANGLES=s.Module.RC_TIMER_RASTERIZE_TRIANGLES,g.RC_TIMER_BUILD_COMPACTHEIGHTFIELD=s.Module.RC_TIMER_BUILD_COMPACTHEIGHTFIELD,g.RC_TIMER_BUILD_CONTOURS=s.Module.RC_TIMER_BUILD_CONTOURS,g.RC_TIMER_BUILD_CONTOURS_TRACE=s.Module.RC_TIMER_BUILD_CONTOURS_TRACE,g.RC_TIMER_BUILD_CONTOURS_SIMPLIFY=s.Module.RC_TIMER_BUILD_CONTOURS_SIMPLIFY,g.RC_TIMER_FILTER_BORDER=s.Module.RC_TIMER_FILTER_BORDER,g.RC_TIMER_FILTER_WALKABLE=s.Module.RC_TIMER_FILTER_WALKABLE,g.RC_TIMER_MEDIAN_AREA=s.Module.RC_TIMER_MEDIAN_AREA,g.RC_TIMER_FILTER_LOW_OBSTACLES=s.Module.RC_TIMER_FILTER_LOW_OBSTACLES,g.RC_TIMER_BUILD_POLYMESH=s.Module.RC_TIMER_BUILD_POLYMESH,g.RC_TIMER_MERGE_POLYMESH=s.Module.RC_TIMER_MERGE_POLYMESH,g.RC_TIMER_ERODE_AREA=s.Module.RC_TIMER_ERODE_AREA,g.RC_TIMER_MARK_BOX_AREA=s.Module.RC_TIMER_MARK_BOX_AREA,g.RC_TIMER_MARK_CYLINDER_AREA=s.Module.RC_TIMER_MARK_CYLINDER_AREA,g.RC_TIMER_MARK_CONVEXPOLY_AREA=s.Module.RC_TIMER_MARK_CONVEXPOLY_AREA,g.RC_TIMER_BUILD_DISTANCEFIELD=s.Module.RC_TIMER_BUILD_DISTANCEFIELD,g.RC_TIMER_BUILD_DISTANCEFIELD_DIST=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_DIST,g.RC_TIMER_BUILD_DISTANCEFIELD_BLUR=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_BLUR,g.RC_TIMER_BUILD_REGIONS=s.Module.RC_TIMER_BUILD_REGIONS,g.RC_TIMER_BUILD_REGIONS_WATERSHED=s.Module.RC_TIMER_BUILD_REGIONS_WATERSHED,g.RC_TIMER_BUILD_REGIONS_EXPAND=s.Module.RC_TIMER_BUILD_REGIONS_EXPAND,g.RC_TIMER_BUILD_REGIONS_FLOOD=s.Module.RC_TIMER_BUILD_REGIONS_FLOOD,g.RC_TIMER_BUILD_REGIONS_FILTER=s.Module.RC_TIMER_BUILD_REGIONS_FILTER,g.RC_TIMER_BUILD_LAYERS=s.Module.RC_TIMER_BUILD_LAYERS,g.RC_TIMER_BUILD_POLYMESHDETAIL=s.Module.RC_TIMER_BUILD_POLYMESHDETAIL,g.RC_TIMER_MERGE_POLYMESHDETAIL=s.Module.RC_TIMER_MERGE_POLYMESHDETAIL,g.RC_MAX_TIMERS=s.Module.RC_MAX_TIMERS,f.DT_FAILURE=s.Detour.FAILURE,f.DT_SUCCESS=s.Detour.SUCCESS,f.DT_IN_PROGRESS=s.Detour.IN_PROGRESS,f.DT_STATUS_DETAIL_MASK=s.Detour.STATUS_DETAIL_MASK,f.DT_WRONG_MAGIC=s.Detour.WRONG_MAGIC,f.DT_WRONG_VERSION=s.Detour.WRONG_VERSION,f.DT_OUT_OF_MEMORY=s.Detour.OUT_OF_MEMORY,f.DT_INVALID_PARAM=s.Detour.INVALID_PARAM,f.DT_BUFFER_TOO_SMALL=s.Detour.BUFFER_TOO_SMALL,f.DT_OUT_OF_NODES=s.Detour.OUT_OF_NODES,f.DT_PARTIAL_RESULT=s.Detour.PARTIAL_RESULT,f.DT_ALREADY_OCCUPIED=s.Detour.ALREADY_OCCUPIED,f.DT_VERTS_PER_POLYGON=s.Detour.VERTS_PER_POLYGON,f.DT_NAVMESH_MAGIC=s.Detour.NAVMESH_MAGIC,f.DT_NAVMESH_VERSION=s.Detour.NAVMESH_VERSION,f.DT_NAVMESH_STATE_MAGIC=s.Detour.NAVMESH_STATE_MAGIC,f.DT_NAVMESH_STATE_VERSION=s.Detour.NAVMESH_STATE_VERSION,f.DT_TILECACHE_MAGIC=s.Detour.TILECACHE_MAGIC,f.DT_TILECACHE_VERSION=s.Detour.TILECACHE_VERSION,f.DT_TILECACHE_NULL_AREA=s.Detour.TILECACHE_NULL_AREA,f.DT_TILECACHE_WALKABLE_AREA=s.Detour.TILECACHE_WALKABLE_AREA,f.DT_TILECACHE_NULL_IDX=s.Detour.TILECACHE_NULL_IDX,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_EXT_LINK=s.Detour.EXT_LINK,f.DT_OFFMESH_CON_BIDIR=s.Detour.OFFMESH_CON_BIDIR,f.DT_STRAIGHTPATH_START=s.Module.DT_STRAIGHTPATH_START,f.DT_STRAIGHTPATH_END=s.Module.DT_STRAIGHTPATH_END,f.DT_STRAIGHTPATH_OFFMESH_CONNECTION=s.Module.DT_STRAIGHTPATH_OFFMESH_CONNECTION,f.DT_STRAIGHTPATH_AREA_CROSSINGS=s.Module.DT_STRAIGHTPATH_AREA_CROSSINGS,f.DT_STRAIGHTPATH_ALL_CROSSINGS=s.Module.DT_STRAIGHTPATH_ALL_CROSSINGS,f.DT_FINDPATH_ANY_ANGLE=s.Module.DT_FINDPATH_ANY_ANGLE,f.DT_RAYCAST_USE_COSTS=s.Module.DT_RAYCAST_USE_COSTS,f.DT_CROWDAGENT_STATE_INVALID=s.Module.DT_CROWDAGENT_STATE_INVALID,f.DT_CROWDAGENT_STATE_WALKING=s.Module.DT_CROWDAGENT_STATE_WALKING,f.DT_CROWDAGENT_STATE_OFFMESH=s.Module.DT_CROWDAGENT_STATE_OFFMESH,f.DT_CROWDAGENT_TARGET_NONE=s.Module.DT_CROWDAGENT_TARGET_NONE,f.DT_CROWDAGENT_TARGET_FAILED=s.Module.DT_CROWDAGENT_TARGET_FAILED,f.DT_CROWDAGENT_TARGET_VALID=s.Module.DT_CROWDAGENT_TARGET_VALID,f.DT_CROWDAGENT_TARGET_REQUESTING=s.Module.DT_CROWDAGENT_TARGET_REQUESTING,f.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,f.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,f.DT_CROWDAGENT_TARGET_VELOCITY=s.Module.DT_CROWDAGENT_TARGET_VELOCITY,f.DT_COMPRESSEDTILE_FREE_DATA=s.Module.DT_COMPRESSEDTILE_FREE_DATA,f.DT_TILE_FREE_DATA=s.Module.DT_TILE_FREE_DATA}};class K{get size(){return this.raw.size}constructor(e){this.raw=e}get(e){return this.raw.get(e)}set(e,t){this.raw.set(e,t)}resize(e){this.raw.resize(e)}copy(e){this.raw.resize(e.length),this.getHeapView().set(e)}destroy(){s.destroy(this.raw)}getHeapView(){const e=this.getHeap();return new this.ArrayConstructor(e.buffer,this.raw.getDataPointer(),this.size)}toTypedArray(){const e=this.getHeapView(),t=new this.ArrayConstructor(new ArrayBuffer(this.size*e.BYTES_PER_ELEMENT),0,this.size);return t.set(e),t}}class W extends K{ArrayConstructor=Int32Array;constructor(e){super(e??new s.Module.IntArray)}getHeap(){return s.Module.HEAP32}static fromRaw(e){return new W(e)}}class z extends K{ArrayConstructor=Uint32Array;constructor(e){super(e??new s.Module.UnsignedIntArray)}getHeap(){return s.Module.HEAPU32}static fromRaw(e){return new z(e)}}class Y extends K{ArrayConstructor=Uint8Array;constructor(e){super(e??new s.Module.UnsignedCharArray)}getHeap(){return s.Module.HEAPU8}static fromRaw(e){return new Y(e)}}class k extends K{ArrayConstructor=Float32Array;constructor(e){super(e??new s.Module.FloatArray)}getHeap(){return s.Module.HEAPF32}static fromRaw(e){return new k(e)}}const ue=k,ce=W,Z=Y,je=W,m={toRaw:({x:a,y:e,z:t},r)=>r?(r.x=a,r.y=e,r.z=t,r):new s.Module.Vec3(a,e,t),fromRaw:a=>{const{x:e,y:t,z:r}=a;return{x:e,y:t,z:r}},fromArray:([a,e,t])=>({x:a,y:e,z:t}),toArray:({x:a,y:e,z:t})=>[a,e,t],lerp:(a,e,t,r={x:0,y:0,z:0})=>{r.x=a.x+(e.x-a.x)*t,r.y=a.y+(e.y-a.y)*t,r.z=a.z+(e.z-a.z)*t},copy:(a,e={x:0,y:0,z:0})=>{e.x=a.x,e.y=a.y,e.z=a.z}},v=(a,e)=>{const t=[];for(let r=0;r<e;r++)t.push(a(r));return t},L=a=>s.Detour.statusSucceed(a),Ze=a=>s.Detour.statusFailed(a),Je=a=>{if(s.Detour.statusSucceed(a))return"success";if(s.Detour.statusInProgress(a))return"in progress";if(s.Detour.statusFailed(a)){let e;const t={DT_WRONG_MAGIC:f.DT_WRONG_MAGIC,DT_WRONG_VERSION:f.DT_WRONG_VERSION,DT_OUT_OF_MEMORY:f.DT_OUT_OF_MEMORY,DT_INVALID_PARAM:f.DT_INVALID_PARAM,DT_BUFFER_TOO_SMALL:f.DT_BUFFER_TOO_SMALL,DT_OUT_OF_NODES:f.DT_OUT_OF_NODES,DT_PARTIAL_RESULT:f.DT_PARTIAL_RESULT,DT_ALREADY_OCCUPIED:f.DT_ALREADY_OCCUPIED};for(const[r,i]of Object.entries(t))if(s.Detour.statusDetail(a,i)){e=r;break}return e?`failed - ${e}`:"failed - unknown"}return"unknown"};class et{constructor(e){this.raw=e}vertBase(){return this.raw.vertBase}triBase(){return this.raw.triBase}vertCount(){return this.raw.vertCount}triCount(){return this.raw.triCount}}class tt{constructor(e){this.raw=e}ref(){return this.raw.ref}next(){return this.raw.next}edge(){return this.raw.edge}side(){return this.raw.side}bmin(){return this.raw.bmin}bmax(){return this.raw.bmax}}class rt{constructor(e){this.raw=e}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}i(){return this.raw.i}}class he{constructor(e){this.raw=e}pos(e){return this.raw.get_pos(e)}rad(){return this.raw.rad}poly(){return this.raw.poly}flags(){return this.raw.flags}side(){return this.raw.side}userId(){return this.raw.userId}}class st{constructor(e){this.raw=e}magic(){return this.raw.magic}version(){return this.raw.version}x(){return this.raw.x}y(){return this.raw.y}layer(){return this.raw.layer}userId(){return this.raw.userId}polyCount(){return this.raw.polyCount}vertCount(){return this.raw.vertCount}maxLinkCount(){return this.raw.maxLinkCount}detailMeshCount(){return this.raw.detailMeshCount}detailVertCount(){return this.raw.detailVertCount}detailTriCount(){return this.raw.detailTriCount}bvNodeCount(){return this.raw.bvNodeCount}offMeshConCount(){return this.raw.offMeshConCount}offMeshBase(){return this.raw.offMeshBase}walkableHeight(){return this.raw.walkableHeight}walkableRadius(){return this.raw.walkableRadius}walkableClimb(){return this.raw.walkableClimb}bmin(e){return this.raw.get_bmin(e)}bmax(e){return this.raw.get_bmax(e)}bvQuantFactor(){return this.raw.bvQuantFactor}}class J{constructor(e){this.raw=e}firstLink(){return this.raw.firstLink}verts(e){return this.raw.get_verts(e)}neis(e){return this.raw.get_neis(e)}flags(){return this.raw.flags}vertCount(){return this.raw.vertCount}areaAndType(){return this.raw.get_areaAndtype()}getType(){return this.raw.getType()}}class B{constructor(e){this.raw=e}salt(){return this.raw.salt}linksFreeList(){return this.raw.linksFreeList}header(){return s.isNull(this.raw.header)?null:new st(this.raw.header)}polys(e){return new J(this.raw.get_polys(e))}verts(e){return this.raw.get_verts(e)}links(e){return new tt(this.raw.get_links(e))}detailMeshes(e){return new et(this.raw.get_detailMeshes(e))}detailVerts(e){return this.raw.get_detailVerts(e)}detailTris(e){return this.raw.get_detailTris(e)}bvTree(e){return new rt(this.raw.get_bvTree(e))}offMeshCons(e){return new he(this.raw.get_offMeshCons(e))}data(e){return this.raw.get_data(e)}dataSize(){return this.raw.dataSize}flags(){return this.raw.flags}next(){return new B(this.raw.next)}}const de=a=>{const e=s.DetourNavMeshBuilder.createNavMeshData(a.raw);return{success:e.success,navMeshData:Y.fromRaw(e.navMeshData)}};class we{constructor(e){this.raw=e??new s.Module.dtNavMeshCreateParams}setPolyMeshCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshCreateParams(this.raw,e.raw)}setPolyMeshDetailCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshDetailCreateParams(this.raw,e.raw)}setOffMeshConnections(e){if(e.length<=0)return;const t=[],r=[],i=[],o=[],l=[],n=[];for(let u=0;u<e.length;u++){const d=e[u];t.push(d.startPosition.x,d.startPosition.y,d.startPosition.z),t.push(d.endPosition.x,d.endPosition.y,d.endPosition.z),r.push(d.radius),i.push(d.bidirectional?1:0),o.push(d.area??0),l.push(d.flags??1),n.push(d.userId??1e3+u)}s.DetourNavMeshBuilder.setOffMeshConnections(this.raw,e.length,t,r,i,o,l,n)}verts(e){return this.raw.get_verts(e)}setVerts(e,t){this.raw.set_verts(e,t)}vertCount(){return this.raw.vertCount}polys(e){return this.raw.get_polys(e)}setPolys(e,t){this.raw.set_polys(e,t)}polyAreas(e){return this.raw.get_polyAreas(e)}setPolyAreas(e,t){this.raw.set_polyAreas(e,t)}polyFlags(e){return this.raw.get_polyFlags(e)}setPolyFlags(e,t){this.raw.set_polyFlags(e,t)}polyCount(){return this.raw.polyCount}nvp(){return this.raw.nvp}setNvp(e){this.raw.nvp=e}detailMeshes(e){return this.raw.get_detailMeshes(e)}setDetailMeshes(e,t){this.raw.set_detailMeshes(e,t)}detailVerts(e){return this.raw.get_detailVerts(e)}setDetailVerts(e,t){this.raw.set_detailVerts(e,t)}detailVertsCount(){return this.raw.detailVertsCount}detailTris(e){return this.raw.get_detailTris(e)}setDetailTris(e,t){this.raw.set_detailTris(e,t)}detailTriCount(){return this.raw.detailTriCount}offMeshConVerts(e){return this.raw.get_offMeshConVerts(e)}offMeshConRad(e){return this.raw.get_offMeshConRad(e)}offMeshConDir(e){return this.raw.get_offMeshConDir(e)}offMeshConAreas(e){return this.raw.get_offMeshConAreas(e)}offMeshConFlags(e){return this.raw.get_offMeshConFlags(e)}offMeshConUserID(e){return this.raw.get_offMeshConUserID(e)}offMeshConCount(){return this.raw.offMeshConCount}userId(){return this.raw.userId}tileX(){return this.raw.tileX}setTileX(e){this.raw.tileX=e}tileY(){return this.raw.tileY}setTileY(e){this.raw.tileY=e}tileLayer(){return this.raw.tileLayer}setTileLayer(e){this.raw.tileLayer=e}boundsMin(){return v(e=>this.raw.get_bmin(e),3)}setBoundsMin(e){this.raw.set_bmin(0,e[0]),this.raw.set_bmin(1,e[1]),this.raw.set_bmin(2,e[2])}boundsMax(){return v(e=>this.raw.get_bmax(e),3)}setBoundsMax(e){this.raw.set_bmax(0,e[0]),this.raw.set_bmax(1,e[1]),this.raw.set_bmax(2,e[2])}walkableHeight(){return this.raw.walkableHeight}setWalkableHeight(e){this.raw.walkableHeight=e}walkableRadius(){return this.raw.walkableRadius}setWalkableRadius(e){this.raw.walkableRadius=e}walkableClimb(){return this.raw.walkableClimb}setWalkableClimb(e){this.raw.walkableClimb=e}cellSize(){return this.raw.cs}setCellSize(e){this.raw.cs=e}cellHeight(){return this.raw.ch}setCellHeight(e){this.raw.ch=e}buildBvTree(){return this.raw.buildBvTree}setBuildBvTree(e){this.raw.buildBvTree=e}}class ge{get includeFlags(){return this.raw.getIncludeFlags()}set includeFlags(e){this.raw.setIncludeFlags(e)}get excludeFlags(){return this.raw.getExcludeFlags()}set excludeFlags(e){this.raw.setExcludeFlags(e)}constructor(e){this.raw=e??new s.Module.dtQueryFilter}getAreaCost(e){return this.raw.getAreaCost(e)}setAreaCost(e,t){this.raw.setAreaCost(e,t)}}class ee{defaultQueryHalfExtents={x:1,y:1,z:1};constructor(e,t){e instanceof s.Module.NavMeshQuery?this.raw=e:(this.raw=new s.Module.NavMeshQuery,this.raw.init(e.raw,t?.maxNodes??2048)),t?.defaultQueryFilter?this.defaultFilter=t.defaultQueryFilter:(this.defaultFilter=new ge,this.defaultFilter.includeFlags=65535,this.defaultFilter.excludeFlags=0)}findNearestPoly(e,t){const r=new s.UnsignedIntRef,i=new s.Vec3,o=new s.BoolRef,l=this.raw.findNearestPoly(m.toArray(e),m.toArray(t?.halfExtents??this.defaultQueryHalfExtents),t?.filter?.raw??this.defaultFilter.raw,r,i,o),n=m.fromRaw(i);s.destroy(i);const u=r.value;s.destroy(r);const d=o.value;return s.destroy(o),{success:L(l),status:l,nearestRef:u,nearestPoint:n,isOverPoly:d}}findPolysAroundCircle(e,t,r,i){const o=i?.filter??this.defaultFilter,l=i?.maxPolys??256,n=new z,u=new z,d=new k;n.resize(l),u.resize(l),d.resize(l);const _=new s.IntRef,c=this.raw.findPolysAroundCircle(e,m.toArray(t),r,o.raw,n.raw,u.raw,d.raw,_,l),y=[...n.getHeapView()];n.destroy();const M=[...u.getHeapView()];u.destroy();const p=[...d.getHeapView()];d.destroy();const C=_.value;return s.destroy(_),{success:L(c),status:c,resultRefs:y,resultParents:M,resultCost:p,resultCount:C}}queryPolygons(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.maxPolys??256,l=new z;l.resize(o);const n=new s.IntRef,u=this.raw.queryPolygons(m.toArray(e),m.toArray(t),i.raw,l.raw,n,o),d=n.value;s.destroy(n);const _=[...l.getHeapView()].slice(0,d);return l.destroy(),{success:L(u),status:u,polyRefs:_}}closestPointOnPoly(e,t){const r=new s.Vec3,i=new s.BoolRef,o=this.raw.closestPointOnPoly(e,m.toArray(t),r,i),l=m.fromRaw(r);s.destroy(r);const n=i.value;return s.destroy(i),{success:L(o),status:o,closestPoint:l,isPointOverPoly:n}}findClosestPoint(e,t){const r=t?.filter??this.defaultFilter,i=t?.halfExtents??this.defaultQueryHalfExtents,o=new s.UnsignedIntRef,l=new s.Vec3,n=new s.BoolRef,u=this.raw.findClosestPoint(m.toArray(e),m.toArray(i),r.raw,o,l,n),d=o.value;s.destroy(o);const _=m.fromRaw(l);s.destroy(l);const c=n.value;return s.destroy(n),{success:L(u),status:u,polyRef:d,point:_,isPointOverPoly:c}}findRandomPointAroundCircle(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents;let l;if(r?.startRef)l=r.startRef;else{const y=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!y.success)return{success:!1,status:y.status,randomPolyRef:0,randomPoint:{x:0,y:0,z:0}};l=y.nearestRef}const n=new s.UnsignedIntRef,u=new s.Vec3,d=this.raw.findRandomPointAroundCircle(l,m.toArray(e),t,i.raw,n,u),_=n.value;s.destroy(n);const c=m.fromRaw(u);return s.destroy(u),{success:L(d),status:d,randomPolyRef:_,randomPoint:c}}moveAlongSurface(e,t,r,i){const o=i?.maxVisitedSize??256,l=new s.Vec3,n=new z,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.moveAlongSurface(e,m.toArray(t),m.toArray(r),u,l,n.raw,o),_=m.fromRaw(l);s.destroy(l);const c=[...n.getHeapView()];return n.destroy(),{success:L(d),status:d,resultPosition:_,visited:c}}findRandomPoint(e){const t=new s.UnsignedIntRef,r=new s.Vec3,i=this.raw.findRandomPoint(e?.filter?.raw??this.defaultFilter.raw,t,r),o=t.value;s.destroy(t);const l=m.fromRaw(r);return s.destroy(r),{success:L(i),status:i,randomPolyRef:o,randomPoint:l}}getPolyHeight(e,t){const r=new s.FloatRef,i=this.raw.getPolyHeight(e,m.toArray(t),r),o=r.value;return s.destroy(r),{success:L(i),status:i,height:o}}computePath(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents,l=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!l.success)return{success:!1,error:{name:"findNearestPoly for start position failed",status:l.status},path:[]};const n=this.findNearestPoly(t,{filter:i,halfExtents:o});if(!n.success)return{success:!1,error:{name:"findNearestPoly for end position failed",status:n.status},path:[]};const u=l.nearestRef,d=n.nearestRef,_=r?.maxPathPolys??256,c=this.findPath(u,d,e,t,{filter:i,maxPathPolys:_});if(!c.success)return{success:!1,error:{name:"findPath unsuccessful",status:c.status},path:[]};if(c.polys.size<=0)return{success:!1,error:{name:"no polygon path found"},path:[]};const y=c.polys.get(c.polys.size-1);let M={x:t.x,y:t.y,z:t.z};if(y!==d){const A=this.closestPointOnPoly(y,t);if(!A.success)return{success:!1,error:{name:"no closest point on last polygon found",status:A.status},path:[]};M=A.closestPoint}const p=r?.maxStraightPathPoints,C=this.findStraightPath(e,M,c.polys,{maxStraightPathPoints:p});if(!C.success)return{success:!1,error:{name:"findStraightPath unsuccessful",status:C.status},path:[]};const{straightPath:I,straightPathCount:w}=C,P=[];for(let A=0;A<w;A++)P.push({x:I.get(A*3),y:I.get(A*3+1),z:I.get(A*3+2)});return c.polys.destroy(),C.straightPath.destroy(),C.straightPathFlags.destroy(),C.straightPathRefs.destroy(),{success:!0,path:P}}findPath(e,t,r,i,o){const l=o?.filter??this.defaultFilter,n=o?.maxPathPolys??256,u=new z;u.resize(n);const d=this.raw.findPath(e,t,m.toArray(r),m.toArray(i),l.raw,u.raw,n);return{success:L(d),status:d,polys:u}}findStraightPath(e,t,r,i){const o=i?.maxStraightPathPoints??256,l=i?.straightPathOptions??0;let n;Array.isArray(r)?(n=new z,n.copy(r)):n=r;const u=new k;u.resize(o*3);const d=new Y;d.resize(o);const _=new z;_.resize(o);const c=new s.IntRef,y=this.raw.findStraightPath(m.toArray(e),m.toArray(t),n.raw,u.raw,d.raw,_.raw,c,o,l),M=c.value;return s.destroy(c),Array.isArray(r)&&n.destroy(),{success:L(y),status:y,straightPath:u,straightPathFlags:d,straightPathRefs:_,straightPathCount:M}}raycast(e,t,r,i){const o=new s.Module.dtRaycastHit,l=i?.raycastOptions??0,n=i?.prevRef??0,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.raycast(e,m.toArray(t),m.toArray(r),u,l,o,n),_={success:L(d),status:d,t:o.t,hitNormal:m.fromArray(v(c=>o.get_hitNormal(c),3)),hitEdgeIndex:o.hitEdgeIndex,path:v(c=>o.get_path(c),o.pathCount),maxPath:o.maxPath,pathCost:o.pathCost};return s.destroy(o),_}destroy(){this.raw.destroy()}}const _e={radius:.5,height:1,maxAcceleration:20,maxSpeed:6,collisionQueryRange:2.5,pathOptimizationRange:0,separationWeight:0,updateFlags:7,obstacleAvoidanceType:0,queryFilterType:0,userData:0};class at{get radius(){return this.raw.params.radius}set radius(e){this.raw.params.radius=e}get height(){return this.raw.params.height}set height(e){this.raw.params.height=e}get maxAcceleration(){return this.raw.params.maxAcceleration}set maxAcceleration(e){this.raw.params.maxAcceleration=e}get maxSpeed(){return this.raw.params.maxSpeed}set maxSpeed(e){this.raw.params.maxSpeed=e}get collisionQueryRange(){return this.raw.params.collisionQueryRange}set collisionQueryRange(e){this.raw.params.collisionQueryRange=e}get pathOptimizationRange(){return this.raw.params.pathOptimizationRange}set pathOptimizationRange(e){this.raw.params.pathOptimizationRange=e}get separationWeight(){return this.raw.params.separationWeight}set separationWeight(e){this.raw.params.separationWeight=e}get updateFlags(){return this.raw.params.updateFlags}set updateFlags(e){this.raw.params.updateFlags=e}get obstacleAvoidanceType(){return this.raw.params.obstacleAvoidanceType}set obstacleAvoidanceType(e){this.raw.params.obstacleAvoidanceType=e}get queryFilterType(){return this.raw.params.queryFilterType}set queryFilterType(e){this.raw.params.queryFilterType=e}get userData(){return this.raw.params.userData}set userData(e){this.raw.params.userData=e}interpolatedPosition={x:0,y:0,z:0};constructor(e,t){this.crowd=e,this.agentIndex=t,this.raw=e.raw.getEditableAgent(t),this.interpolatedPosition=this.position()}requestMoveTarget(e){const{nearestPoint:t,nearestRef:r}=this.crowd.navMeshQuery.findNearestPoly(e,{halfExtents:this.crowd.navMeshQuery.defaultQueryHalfExtents,filter:this.crowd.navMeshQuery.defaultFilter});return this.crowd.raw.requestMoveTarget(this.agentIndex,r,m.toArray(t))}requestMoveVelocity(e){return this.crowd.raw.requestMoveVelocity(this.agentIndex,m.toArray(e))}resetMoveTarget(){this.crowd.raw.resetMoveTarget(this.agentIndex)}teleport(e){s.CrowdUtils.agentTeleport(this.crowd.raw,this.agentIndex,m.toArray(e),m.toArray(this.crowd.navMeshQuery.defaultQueryHalfExtents),this.crowd.navMeshQuery.defaultFilter.raw),m.copy(e,this.interpolatedPosition)}position(){return{x:this.raw.get_npos(0),y:this.raw.get_npos(1),z:this.raw.get_npos(2)}}velocity(){return{x:this.raw.get_vel(0),y:this.raw.get_vel(1),z:this.raw.get_vel(2)}}desiredVelocity(){return{x:this.raw.get_dvel(0),y:this.raw.get_dvel(1),z:this.raw.get_dvel(2)}}desiredVelocityObstacleAdjusted(){return{x:this.raw.get_nvel(0),y:this.raw.get_nvel(1),z:this.raw.get_nvel(2)}}state(){return this.raw.state}target(){return{x:this.raw.get_targetPos(0),y:this.raw.get_targetPos(1),z:this.raw.get_targetPos(2)}}nextTargetInPath(){return{x:this.raw.get_cornerVerts(0),y:this.raw.get_cornerVerts(1),z:this.raw.get_cornerVerts(2)}}corners(){const e=[];for(let t=0;t<this.raw.ncorners;t++)e.push({x:this.raw.get_cornerVerts(t*3),y:this.raw.get_cornerVerts(t*3+1),z:this.raw.get_cornerVerts(t*3+2)});return e}parameters(){const{params:e}=this.raw;return{radius:e.radius,height:e.height,maxAcceleration:e.maxAcceleration,maxSpeed:e.maxSpeed,collisionQueryRange:e.collisionQueryRange,pathOptimizationRange:e.pathOptimizationRange,separationWeight:e.separationWeight,updateFlags:e.updateFlags,obstacleAvoidanceType:e.obstacleAvoidanceType,queryFilterType:e.queryFilterType,userData:e.userData}}updateParameters(e){const t={...this.parameters(),...e};this.setParameters(t)}setParameters(e){const t={..._e,...e},r=new s.Module.dtCrowdAgentParams;r.radius=t.radius,r.height=t.height,r.maxAcceleration=t.maxAcceleration,r.maxSpeed=t.maxSpeed,r.collisionQueryRange=t.collisionQueryRange,r.pathOptimizationRange=t.pathOptimizationRange,r.separationWeight=t.separationWeight,r.updateFlags=t.updateFlags,r.obstacleAvoidanceType=t.obstacleAvoidanceType,r.queryFilterType=t.queryFilterType,r.userData=t.userData,this.crowd.raw.updateAgentParameters(this.agentIndex,r)}overOffMeshConnection(){return s.CrowdUtils.overOffMeshConnection(this.crowd.raw,this.agentIndex)}}class it{agents={};accumulator=0;constructor(e,{maxAgents:t,maxAgentRadius:r}){this.navMesh=e,this.raw=s.Detour.allocCrowd(),this.raw.init(t,r,e.raw.getNavMesh()),this.navMeshQuery=new ee(new s.Module.NavMeshQuery(this.raw.getNavMeshQuery()))}update(e,t,r=10){if(t===void 0)this.raw.update(e,void 0);else{this.accumulator+=t;let i=0;for(;this.accumulator>=e&&i<r;)this.raw.update(e,void 0),this.accumulator-=e,i++;const o=this.accumulator%e/e,l=this.getAgents();for(const n of l)m.lerp(n.interpolatedPosition,n.position(),o,n.interpolatedPosition)}}addAgent(e,t){const r={..._e,...t},i=new s.Module.dtCrowdAgentParams;i.radius=r.radius,i.height=r.height,i.maxAcceleration=r.maxAcceleration,i.maxSpeed=r.maxSpeed,i.collisionQueryRange=r.collisionQueryRange,i.pathOptimizationRange=r.pathOptimizationRange,i.separationWeight=r.separationWeight,i.updateFlags=r.updateFlags,i.obstacleAvoidanceType=r.obstacleAvoidanceType,i.queryFilterType=r.queryFilterType,i.userData=r.userData;const o=this.raw.addAgent(m.toArray(e),i),l=new at(this,o);return this.agents[o]=l,l}getAgent(e){const t=this.agents[e];return t||null}removeAgent(e){const t=typeof e=="number"?e:e.agentIndex;this.raw.removeAgent(t),delete this.agents[t]}getAgentCount(){return this.raw.getAgentCount()}getActiveAgentCount(){return s.CrowdUtils.getActiveAgentCount(this.raw)}getAgents(){return Object.values(this.agents)}getFilter(e){return new ge(this.raw.getEditableFilter(e))}destroy(){s.Detour.freeCrowd(this.raw)}}class nt{constructor(e){this.raw=e}tiles(e){return new B(this.raw.get_tiles(e))}tileCount(){return this.raw.tileCount}}class ot{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class lt{constructor(e){this.raw=e}tileX(){return this.raw.tileX}tileY(){return this.raw.tileY}}class ut{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class Q{constructor(e){this.raw=e}static create(e){const t=new s.Module.dtNavMeshParams;return t.set_orig(0,e.orig.x),t.set_orig(1,e.orig.y),t.set_orig(2,e.orig.z),t.tileWidth=e.tileWidth,t.tileHeight=e.tileHeight,t.maxTiles=e.maxTiles,t.maxPolys=e.maxPolys,new Q(t)}clone(){return Q.create({orig:{x:this.raw.get_orig(0),y:this.raw.get_orig(1),z:this.raw.get_orig(2)},tileWidth:this.raw.tileWidth,tileHeight:this.raw.tileHeight,maxTiles:this.raw.maxTiles,maxPolys:this.raw.maxPolys})}}class te{constructor(e){this.raw=e??new s.Module.NavMesh}initSolo(e){return this.raw.initSolo(e.raw)}initTiled(e){return this.raw.initTiled(e.raw)}addTile(e,t,r){const i=new s.UnsignedIntRef,o=this.raw.addTile(e.raw,t,r,i),l=i.value;return s.destroy(i),{status:o,tileRef:l}}decodePolyId(e){const t=new s.UnsignedIntRef,r=new s.UnsignedIntRef,i=new s.UnsignedIntRef;this.raw.decodePolyId(e,t,r,i);const o=t.value;s.destroy(t);const l=r.value;s.destroy(r);const n=i.value;return s.destroy(i),{tileSalt:o,tileIndex:l,tilePolygonIndex:n}}encodePolyId(e,t,r){return this.raw.encodePolyId(e,t,r)}removeTile(e){return new ot(this.raw.removeTile(e))}calcTileLoc(e){return new lt(this.raw.calcTileLoc(m.toArray(e)))}getTileAt(e,t,r){const i=this.raw.getTileAt(e,t,r);return s.isNull(i)?null:new B(i)}getTilesAt(e,t,r){return new nt(this.raw.getTilesAt(e,t,r))}getTileRefAt(e,t,r){return this.raw.getTileRefAt(e,t,r)}getTileRef(e){return this.raw.getTileRef(e.raw)}getTileByRef(e){const t=this.raw.getTileByRef(e);return s.isNull(t)?null:new B(t)}getMaxTiles(){return this.raw.getMaxTiles()}getTile(e){return new B(this.raw.getTile(e))}getTileAndPolyByRef(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{success:L(t.status),status:t.status,tile:r,poly:i}}getTileAndPolyByRefUnsafe(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{tile:r,poly:i}}isValidPolyRef(e){return this.raw.isValidPolyRef(e)}getPolyRefBase(e){return this.raw.getPolyRefBase(e.raw)}getOffMeshConnectionPolyEndPoints(e,t){const r=new s.Vec3,i=new s.Vec3,o=this.raw.getOffMeshConnectionPolyEndPoints(e,t,r,i),l=m.fromRaw(r);s.destroy(r);const n=m.fromRaw(i);return s.destroy(i),{success:L(o),status:o,start:l,end:n}}getOffMeshConnectionByRef(e){return new he(this.raw.getOffMeshConnectionByRef(e))}setPolyFlags(e,t){return this.raw.setPolyFlags(e,t)}getPolyFlags(e){const t=new s.UnsignedShortRef,r=this.raw.getPolyFlags(e,t),i=t.value;return s.destroy(t),{status:r,flags:i}}setPolyArea(e,t){return this.raw.setPolyArea(e,t)}getPolyArea(e){const t=new s.UnsignedCharRef,r=this.raw.getPolyArea(e,t),i=t.value;return s.destroy(t),{status:r,area:i}}getTileStateSize(e){return this.raw.getTileStateSize(e.raw)}storeTileState(e,t){return new ut(this.raw.storeTileState(e.raw,t))}restoreTileState(e,t,r){return this.raw.restoreTileState(e.raw,t,r)}destroy(){this.raw.destroy(),s.Module.destroy(this.raw)}}const ct=(a,e)=>{const t=[],r=[];let i=0;const o=a.getMaxTiles();for(let l=0;l<o;l++){const n=a.getTile(l),u=n.header();if(!u)continue;const d=u.polyCount();for(let _=0;_<d;++_){const c=n.polys(_);if(c.getType()===1)continue;const y=c.vertCount(),M=n.detailMeshes(_),p=M.triBase(),C=M.triCount();for(let I=0;I<C;++I){const w=(p+I)*4;for(let P=0;P<3;++P){if(n.detailTris(w+P)<y){const A=c.verts(n.detailTris(w+P))*3;t.push(n.verts(A),n.verts(A+1),n.verts(A+2))}else{const A=(M.vertBase()+n.detailTris(w+P)-c.vertCount())*3;t.push(n.detailVerts(A),n.detailVerts(A+1),n.detailVerts(A+2))}r.push(i++)}}}}return[t,r]},re={borderSize:0,tileSize:0,cs:.2,ch:.2,walkableSlopeAngle:60,walkableHeight:2,walkableClimb:2,walkableRadius:.5,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1},fe=a=>{const e={...re,...a},t=new s.Module.rcConfig;return t.borderSize=e.borderSize,t.tileSize=e.tileSize,t.cs=e.cs,t.ch=e.ch,t.walkableSlopeAngle=e.walkableSlopeAngle,t.walkableHeight=e.walkableHeight,t.walkableClimb=e.walkableClimb,t.walkableRadius=e.walkableRadius,t.maxEdgeLen=e.maxEdgeLen,t.maxSimplificationError=e.maxSimplificationError,t.minRegionArea=e.minRegionArea,t.mergeRegionArea=e.mergeRegionArea,t.maxVertsPerPoly=e.maxVertsPerPoly,t.detailSampleDist=e.detailSampleDist,t.detailSampleMaxError=e.detailSampleMaxError,t},ht=a=>{const e=new s.Module.rcConfig;return e.set_bmin(0,a.get_bmin(0)),e.set_bmin(1,a.get_bmin(1)),e.set_bmin(2,a.get_bmin(2)),e.set_bmax(0,a.get_bmax(0)),e.set_bmax(1,a.get_bmax(1)),e.set_bmax(2,a.get_bmax(2)),e.width=a.width,e.height=a.height,e.borderSize=a.borderSize,e.tileSize=a.tileSize,e.cs=a.cs,e.ch=a.ch,e.walkableSlopeAngle=a.walkableSlopeAngle,e.walkableHeight=a.walkableHeight,e.walkableClimb=a.walkableClimb,e.walkableRadius=a.walkableRadius,e.maxEdgeLen=a.maxEdgeLen,e.maxSimplificationError=a.maxSimplificationError,e.minRegionArea=a.minRegionArea,e.mergeRegionArea=a.mergeRegionArea,e.maxVertsPerPoly=a.maxVertsPerPoly,e.detailSampleDist=a.detailSampleDist,e.detailSampleMaxError=a.detailSampleMaxError,e};class se{logs=[];startTimes={};accumulatedTimes={};constructor(e=!0){const t=new s.Module.RecastBuildContextJsImpl;t.log=(r,i,o)=>{if(!this.raw.logEnabled())return;const l=i,n=new Uint8Array(s.Module.HEAPU8.buffer,l,o),u=new Uint8Array(o);u.set(n);const d=new TextDecoder().decode(u);this.log(r,d)},t.resetLog=()=>{this.resetLog()},t.startTimer=r=>{this.raw.timerEnabled()&&this.startTimer(r)},t.stopTimer=r=>{this.raw.timerEnabled()&&this.stopTimer(r)},t.getAccumulatedTime=r=>this.raw.timerEnabled()?this.getAccumulatedTime(r):-1,t.resetTimers=()=>{this.raw.timerEnabled()&&(this.startTimes={},this.accumulatedTimes={})},this.raw=new s.Module.RecastBuildContext(t),this.raw.enableTimer(e),this.raw.enableLog(e),this.resetTimers()}log(e,t){this.logs.push({category:e,msg:t})}resetLog(){this.logs=[]}startTimer(e){this.startTimes[e]=performance.now()}stopTimer(e){const r=performance.now()-this.startTimes[e];this.accumulatedTimes[e]===-1?this.accumulatedTimes[e]=r:this.accumulatedTimes[e]+=r}getAccumulatedTime(e){return this.accumulatedTimes[e]}resetTimers(){for(let e=0;e<g.RC_MAX_TIMERS;e++)this.startTimes[e]=-1,this.accumulatedTimes[e]=-1}}class dt{constructor(e){this.raw=e??new s.rcChunkyTriMesh}init(e,t,r,i){return s.ChunkyTriMeshUtils.createChunkyTriMesh(e.raw,t.raw,r,i,this.raw)}getChunksOverlappingRect(e,t,r,i){return s.ChunkyTriMeshUtils.getChunksOverlappingRect(this.raw,e,t,r.raw,i)}getNodeTris(e){return W.fromRaw(s.ChunkyTriMeshUtils.getChunkyTriMeshNodeTris(this.raw,e))}nodes(e){return this.raw.get_nodes(e)}maxTrisPerChunk(){return this.raw.maxTrisPerChunk}}class V{constructor(e){this.raw=e}smin(){return this.raw.smin}smax(){return this.raw.smax}area(){return this.raw.area}next(){return s.isNull(this.raw.next)?null:new V(this.raw.next)}}class ae{constructor(e){this.raw=e}next(){return s.isNull(this.raw.next)?null:new ae(this.raw.next)}items(e){return new V(this.raw.get_items(e))}}class wt{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}spans(e){return new V(this.raw.get_spans(e))}pools(e){return new ae(this.raw.get_pools(e))}freelist(e){return new V(this.raw.get_freelist(e))}}class gt{constructor(e){this.raw=e}index(){return this.raw.get_index()}count(){return this.raw.get_count()}}class _t{constructor(e){this.raw=e}y(){return this.raw.get_y()}reg(){return this.raw.get_reg()}con(){return this.raw.get_con()}h(){return this.raw.get_h()}}class ft{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}spanCount(){return this.raw.spanCount}walkableHeight(){return this.raw.walkableHeight}walkableClimb(){return this.raw.walkableClimb}borderSize(){return this.raw.borderSize}maxDistance(){return this.raw.maxDistance}maxRegions(){return this.raw.maxRegions}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}cells(e){return new gt(this.raw.get_cells(e))}spans(e){return new _t(this.raw.get_spans(e))}dist(e){return this.raw.get_dist(e)}areas(e){return this.raw.get_areas(e)}}class Rt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}nverts(){return this.raw.nverts}rverts(e){return this.raw.get_rverts(e)}nrverts(){return this.raw.nrverts}reg(){return this.raw.reg}area(){return this.raw.area}}class Tt{constructor(e){this.raw=e}conts(e){return new Rt(this.raw.get_conts(e))}nconts(){return this.raw.nconts}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}width(){return this.raw.width}height(){return this.raw.height}borderSize(){return this.raw.borderSize}maxError(){return this.raw.maxError}}class mt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}polys(e){return this.raw.get_polys(e)}regs(e){return this.raw.get_regs(e)}flags(e){return this.raw.get_flags(e)}setFlags(e,t){this.raw.set_flags(e,t)}areas(e){return this.raw.get_areas(e)}setAreas(e,t){this.raw.set_areas(e,t)}nverts(){return this.raw.nverts}npolys(){return this.raw.npolys}maxpolys(){return this.raw.maxpolys}nvp(){return this.raw.nvp}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}borderSize(){return this.raw.borderSize}maxEdgeError(){return this.raw.maxEdgeError}}class yt{constructor(e){this.raw=e}meshes(e){return this.raw.get_meshes(e)}verts(e){return this.raw.get_verts(e)}tris(e){return this.raw.get_tris(e)}nmeshes(){return this.raw.nmeshes}nverts(){return this.raw.nverts}ntris(){return this.raw.ntris}}const Re=(a,e,t)=>s.Recast.calcGridSize(a,e,t),Te=(a,e,t,r,i,o,l,n)=>s.Recast.createHeightfield(a.raw,e.raw,t,r,i,o,l,n),me=(a,e,t,r,i,o,l)=>s.Recast.markWalkableTriangles(a.raw,e,t.raw,r,i.raw,o,l.raw),ye=(a,e,t,r,i,o,l,n=1)=>s.Recast.rasterizeTriangles(a.raw,e.raw,t,r.raw,i.raw,o,l.raw,n),Ae=(a,e,t)=>s.Recast.filterLowHangingWalkableObstacles(a.raw,e,t.raw),Me=(a,e,t,r)=>s.Recast.filterLedgeSpans(a.raw,e,t,r.raw),Ee=(a,e,t)=>s.Recast.filterWalkableLowHeightSpans(a.raw,e,t.raw),pe=(a,e,t,r,i)=>s.Recast.buildCompactHeightfield(a.raw,e,t,r.raw,i.raw),Ce=(a,e,t)=>s.Recast.erodeWalkableArea(a.raw,e,t.raw),Se=(a,e)=>s.Recast.buildDistanceField(a.raw,e.raw),Ie=(a,e,t,r,i)=>s.Recast.buildRegions(a.raw,e.raw,t,r,i),De=(a,e,t,r,i,o=g.RC_CONTOUR_TESS_WALL_EDGES)=>s.Recast.buildContours(a.raw,e.raw,t,r,i.raw,o),be=(a,e,t,r)=>s.Recast.buildPolyMesh(a.raw,e.raw,t,r.raw),Pe=(a,e,t,r,i,o)=>s.Recast.buildPolyMeshDetail(a.raw,e.raw,t.raw,r,i,o.raw),xe=()=>new wt(s.Recast.allocHeightfield()),X=a=>s.Recast.freeHeightfield(a.raw),ve=()=>new ft(s.Recast.allocCompactHeightfield()),$=a=>s.Recast.freeCompactHeightfield(a.raw),Ne=()=>new Tt(s.Recast.allocContourSet()),q=a=>s.Recast.freeContourSet(a.raw),Oe=()=>new mt(s.Recast.allocPolyMesh()),Le=a=>s.Recast.freePolyMesh(a.raw),Fe=()=>new yt(s.Recast.allocPolyMeshDetail()),He=a=>s.Recast.freePolyMeshDetail(a.raw),At=(a,e)=>{const t=s.NavMeshExporter.exportNavMesh(a.raw,e?.raw),r=new Uint8Array(s.Module.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(r),s.NavMeshExporter.freeNavMeshExport(t),i},Mt=a=>At(a),Et=a=>{const e=a.length*a.BYTES_PER_ELEMENT,t=s.Module._malloc(e),r=new Uint8Array(s.Module.HEAPU8.buffer,t,e);r.set(a);const i=new s.Module.NavMeshExport;return i.dataPointer=r.byteOffset,i.size=a.length,{navMeshExport:i,dataHeap:r}},pt=a=>{const{navMeshExport:e,dataHeap:t}=Et(a),r=s.NavMeshImporter.importNavMesh(e,void 0);return s.Module._free(t.byteOffset),{navMesh:new te(r.navMesh)}},ze=(a,e)=>{const t={x:1/0,y:1/0,z:1/0},r={x:-1/0,y:-1/0,z:-1/0};for(let i=0;i<e.length;i++){const o=e[i],l=a[o*3],n=a[o*3+1],u=a[o*3+2];t.x=Math.min(t.x,l),t.y=Math.min(t.y,n),t.z=Math.min(t.z,u),r.x=Math.max(r.x,l),r.y=Math.max(r.y,n),r.z=Math.max(r.z,u)}return{bbMin:m.toArray(t),bbMax:m.toArray(r)}},Ct=a=>{let e=0,t=0;return e=+(a>65535)<<4,a>>=e,t=+(a>255)<<3,a>>=t,e|=t,t=+(a>15)<<2,a>>=t,e|=t,t=+(a>3)<<1,a>>=t,e|=t,e|=a>>1,e},St=a=>(a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a),It={...re,buildBvTree:!0},Dt=(a,e,t={},r=!1)=>{const i=new se,o={type:"solo",buildContext:i},l=()=>{r||(o.heightfield&&(X(o.heightfield),o.heightfield=void 0),o.compactHeightfield&&($(o.compactHeightfield),o.compactHeightfield=void 0),o.contourSet&&(q(o.contourSet),o.contourSet=void 0),o.polyMesh&&(Le(o.polyMesh),o.polyMesh=void 0),o.polyMeshDetail&&(He(o.polyMeshDetail),o.polyMeshDetail=void 0))},n=T=>(l(),{navMeshData:void 0,success:!1,intermediates:o,error:T}),u=a,d=e.length,_=new ue;_.copy(u);const c=e,y=e.length/3,M=new ce;M.copy(c);let p,C;if(t.bounds)p=t.bounds[0],C=t.bounds[1];else{const T=ze(a,e);p=T.bbMin,C=T.bbMax}const I={...It,...t},w=fe(I);w.minRegionArea=w.minRegionArea*w.minRegionArea,w.mergeRegionArea=w.mergeRegionArea*w.mergeRegionArea,w.detailSampleDist=w.detailSampleDist<.9?0:w.cs*w.detailSampleDist,w.detailSampleMaxError=w.ch*w.detailSampleMaxError;const P=Re(p,C,w.cs);w.width=P.width,w.height=P.height;const A=xe();if(o.heightfield=A,!Te(i,A,w.width,w.height,p,C,w.cs,w.ch))return n("Could not create heightfield");const E=new Z;if(E.resize(y),me(i,w.walkableSlopeAngle,_,d,M,y,E),!ye(i,_,d,M,E,y,A,w.walkableClimb))return n("Could not rasterize triangles");E.destroy(),_.destroy(),M.destroy(),Ae(i,w.walkableClimb,A),Me(i,w.walkableHeight,w.walkableClimb,A),Ee(i,w.walkableHeight,A);const D=ve();if(o.compactHeightfield=D,!pe(i,w.walkableHeight,w.walkableClimb,A,D))return n("Failed to build compact data");if(r||(X(A),o.heightfield=void 0),!Ce(i,w.walkableRadius,D))return n("Failed to erode walkable area");if(!Se(i,D))return n("Failed to build distance field");if(!Ie(i,D,w.borderSize,w.minRegionArea,w.mergeRegionArea))return n("Failed to build regions");const b=Ne();if(o.contourSet=b,!De(i,D,w.maxSimplificationError,w.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return n("Failed to create contours");const S=Oe();if(o.polyMesh=S,!be(i,b,w.maxVertsPerPoly,S))return n("Failed to triangulate contours");const N=Fe();if(o.polyMeshDetail=N,!Pe(i,S,D,w.detailSampleDist,w.detailSampleMaxError,N))return n("Failed to build detail mesh");r||($(D),o.compactHeightfield=void 0,q(b),o.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(w.walkableHeight*w.ch),h.setWalkableRadius(w.walkableRadius*w.cs),h.setWalkableClimb(w.walkableClimb*w.ch),h.setCellSize(w.cs),h.setCellHeight(w.ch),h.setBuildBvTree(I.buildBvTree),t.offMeshConnections&&h.setOffMeshConnections(t.offMeshConnections);const R=de(h);return R.success?(l(),{navMeshData:R.navMeshData,success:!0,intermediates:o}):n("Failed to create Detour navmesh data")},bt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=Dt(a,e,t,r);if(!i.success)return{navMesh:void 0,success:!1,intermediates:i.intermediates,error:i.error};const{navMeshData:o}=i,l=new te;return l.initSolo(o)?{success:!0,navMesh:l,intermediates:i.intermediates}:(o.destroy(),{navMesh:void 0,success:!1,intermediates:i.intermediates,error:"Failed to initialize solo NavMesh"})},Pt=({recastConfig:a,navMeshBounds:[e,t]})=>{const r=fe(a),i=Re(e,t,r.cs);r.width=i.width,r.height=i.height,r.minRegionArea=r.minRegionArea*r.minRegionArea,r.mergeRegionArea=r.mergeRegionArea*r.mergeRegionArea,r.tileSize=Math.floor(r.tileSize),r.borderSize=r.walkableRadius+3,r.width=r.tileSize+r.borderSize*2,r.height=r.tileSize+r.borderSize*2,r.detailSampleDist=r.detailSampleDist<.9?0:r.cs*r.detailSampleDist,r.detailSampleMaxError=r.ch*r.detailSampleMaxError;const o=Math.floor(r.tileSize),l=Math.floor((i.width+o-1)/o),n=Math.floor((i.height+o-1)/o),u=r.tileSize*r.cs,d=m.fromArray(e);let _=Math.min(Math.floor(Ct(St(l*n))),14);_>14&&(_=14);const c=22-_,y=1<<_,M=1<<c;return{config:r,gridSize:i,tileSize:o,tileWidth:l,tileHeight:n,tcs:u,orig:d,maxTiles:y,maxPolysPerTile:M}},Be={...re,chunkyTriMeshTrisPerChunk:256,buildBvTree:!0},xt=(a,e,t,r,i,o={},l=!1,n=new se)=>{const u={x:i.x,y:i.y},d=()=>{l||(u.compactHeightfield&&($(u.compactHeightfield),u.compactHeightfield=void 0),u.heightfield&&(X(u.heightfield),u.heightfield=void 0),u.contourSet&&(q(u.contourSet),u.contourSet=void 0),u.polyMesh&&(Le(u.polyMesh),u.polyMesh=void 0),u.polyMeshDetail&&(He(u.polyMeshDetail),u.polyMeshDetail=void 0))},_=T=>(n.log(g.RC_LOG_ERROR,T),d(),{success:!1,error:T,intermediates:u}),c=ht(t),y=[...i.bmin],M=[...i.bmax];y[0]-=c.borderSize*c.cs,y[2]-=c.borderSize*c.cs,M[0]+=c.borderSize*c.cs,M[2]+=c.borderSize*c.cs,c.set_bmin(0,y[0]),c.set_bmin(1,y[1]),c.set_bmin(2,y[2]),c.set_bmax(0,M[0]),c.set_bmax(1,M[1]),c.set_bmax(2,M[2]),n.resetTimers(),n.startTimer(g.RC_TIMER_TOTAL),n.log(g.RC_LOG_PROGRESS,`Building tile at x: ${i.x}, y: ${i.y}`),n.log(g.RC_LOG_PROGRESS,` - ${c.width} x ${c.height} cells`),n.log(g.RC_LOG_PROGRESS,` - ${a.size/3/1e3}K verts, ${e.size/3/1e3}K tris`);const p=xe();if(u.heightfield=p,!Te(n,p,c.width,c.height,y,M,c.cs,c.ch))return _("Could not create heightfield");new Z().resize(r.maxTrisPerChunk());const I=[y[0],y[2]],w=[M[0],M[2]],P=512,A=new je;A.resize(P);const E=r.getChunksOverlappingRect(I,w,A,P);if(E===0)return{success:!0,intermediates:u};for(let T=0;T<E;++T){const x=A.get(T),H=r.nodes(x).n,U=r.getNodeTris(x),F=new Z;F.resize(H),me(n,c.walkableSlopeAngle,a,e.size,U,H,F);const G=ye(n,a,e.size,U,F,H,p,c.walkableClimb);if(F.destroy(),!G)return _("Could not rasterize triangles")}Ae(n,c.walkableClimb,p),Me(n,c.walkableHeight,c.walkableClimb,p),Ee(n,c.walkableHeight,p);const D=ve();if(u.compactHeightfield=D,!pe(n,c.walkableHeight,c.walkableClimb,p,D))return _("Could not build compact heightfield");if(l||(X(u.heightfield),u.heightfield=void 0),!Ce(n,c.walkableRadius,D))return _("Could not erode walkable area");if(!Se(n,D))return _("Failed to build distance field");if(!Ie(n,D,c.borderSize,c.minRegionArea,c.mergeRegionArea))return _("Failed to build regions");const b=Ne();if(u.contourSet=b,!De(n,D,c.maxSimplificationError,c.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return _("Failed to create contours");const S=Oe();if(u.polyMesh=S,!be(n,b,c.maxVertsPerPoly,S))return _("Failed to triangulate contours");const N=Fe();if(u.polyMeshDetail=N,!Pe(n,S,D,c.detailSampleDist,c.detailSampleMaxError,N))return _("Failed to build detail mesh");l||($(D),u.compactHeightfield=void 0,q(b),u.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(c.walkableHeight*c.ch),h.setWalkableRadius(c.walkableRadius*c.cs),h.setWalkableClimb(c.walkableClimb*c.ch),h.setCellSize(c.cs),h.setCellHeight(c.ch),h.setBuildBvTree(o.buildBvTree??Be.buildBvTree),o.offMeshConnections&&h.setOffMeshConnections(o.offMeshConnections),h.setTileX(i.x),h.setTileY(i.y);const R=de(h);return R.success?(n.log(g.RC_LOG_PROGRESS,`>> Polymesh: ${S.nverts()} vertices ${S.npolys()} polygons`),{success:!0,data:R.navMeshData,intermediates:u}):_("Failed to create Detour navmesh data")},vt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=new se,o={type:"tiled",buildContext:i,chunkyTriMesh:void 0,tileIntermediates:[]},l=new te,n=a,u=new ue;u.copy(n);const d=e,_=e.length/3,c=new ce;c.copy(d);const y=()=>{u.destroy(),c.destroy(),!r&&o.chunkyTriMesh&&(o.chunkyTriMesh=void 0)},M=x=>(y(),l.destroy(),{success:!1,navMesh:void 0,intermediates:o,error:x}),p={...Be,...t};let C,I;if(t.bounds)C=t.bounds[0],I=t.bounds[1];else{const x=ze(a,e);C=x.bbMin,I=x.bbMax}const{config:w,tileWidth:P,tileHeight:A,tcs:E,orig:D,maxTiles:b,maxPolysPerTile:S}=Pt({recastConfig:p,navMeshBounds:[C,I]}),N=Q.create({orig:D,tileWidth:p.tileSize*p.cs,tileHeight:p.tileSize*p.cs,maxTiles:b,maxPolys:S});if(!l.initTiled(N))return M("Could not init nav mesh for tiled use");const h=new dt;if(o.chunkyTriMesh=h,!h.init(u,c,_,p.chunkyTriMeshTrisPerChunk))return M("Failed to build chunky triangle mesh");i.startTimer(g.RC_TIMER_TEMP);const R=[0,0,0],T=[0,0,0];for(let x=0;x<A;x++)for(let O=0;O<P;O++){R[0]=C[0]+O*E,R[1]=C[1],R[2]=C[2]+x*E,T[0]=C[0]+(O+1)*E,T[1]=I[1],T[2]=C[2]+(x+1)*E;const H={x:O,y:x,bmin:R,bmax:T},U={offMeshConnections:p.offMeshConnections,buildBvTree:p.buildBvTree},F=xt(u,c,w,h,H,U,r,i);if(o.tileIntermediates.push(F.intermediates),F.success&&F.data){l.removeTile(l.getTileRefAt(O,x,0));const G=l.addTile(F.data,f.DT_TILE_FREE_DATA,0);Ze(G.status)&&(i.log(g.RC_LOG_WARNING,`Failed to add tile to nav mesh tx: ${O}, ty: ${x}, status: ${Je(G.status)} (${G.status})`),F.data.destroy())}}return i.stopTimer(g.RC_TIMER_TEMP),r||y(),{success:!0,navMesh:l,intermediates:o}},Nt=a=>{const e=[],t=[],r={};let i=0;for(const{positions:o,indices:l}of a)for(let n=0;n<l.length;n++){const u=l[n]*3,d=o[u],_=o[u+1],c=o[u+2],y=`${d}_${_}_${c}`;let M=r[y];M||(r[y]=M=i,e.push(d,_,c),i++),t.push(M)}return[Float32Array.from(e),Uint32Array.from(t)]};new Qe;class Ot extends ke{constructor(e,t){super(),this.navMesh=e,this.navMeshGeometry=new Ve,this.navMeshMaterial=t?.navMeshMaterial?t.navMeshMaterial:new We({color:"orange",transparent:!0,opacity:.7,depthWrite:!1}),this.update(),this.mesh=new j(this.navMeshGeometry,this.navMeshMaterial),this.add(this.mesh)}update(){const[e,t]=ct(this.navMesh);this.navMeshGeometry.setAttribute("position",new ie(Float32Array.from(e),3)),this.navMeshGeometry.setIndex(new ie(Uint32Array.from(t),1)),this.navMeshGeometry.computeVertexNormals()}}const Lt=new Ye,Ue=a=>{const e=[];for(const t of a){const r=t.geometry.attributes.position;if(!r||r.itemSize!==3)continue;t.updateMatrixWorld();const i=new Float32Array(r.array);for(let l=0;l<i.length;l+=3){const n=Lt.set(i[l],i[l+1],i[l+2]);t.localToWorld(n),i[l]=n.x,i[l+1]=n.y,i[l+2]=n.z}let o=t.geometry.getIndex()?.array;if(o===void 0){const l=[];for(let n=0;n<r.count;n++)l.push(n);o=l}e.push({positions:i,indices:o})}return Nt(e)},Ft=(a,e={},t=!1)=>{const[r,i]=Ue(a);return bt(r,i,e,t)},Ht=(a,e={},t=!1)=>{const[r,i]=Ue(a);return vt(r,i,e,t)},zt=["invalid","walking","offmesh"];let oe=!1;async function nr(){oe||(await Ke(),oe=!0)}function Bt(a){const e=a.getIndex();if(e===null){const t=a.getAttribute("position").clone();for(let r=0;r+2<t.count;r+=3)for(let i=0;i<t.itemSize;i+=1){const o=t.getComponent(r+1,i);t.setComponent(r+1,i,t.getComponent(r+2,i)),t.setComponent(r+2,i,o)}a.setAttribute("position",t);return}for(let t=0;t+2<e.count;t+=3){const r=e.getX(t+1);e.setX(t+1,e.getX(t+2)),e.setX(t+2,r)}e.needsUpdate=!0}function Ut(a){const e=a.getAttribute("position"),t=a.getIndex(),r=l=>t?.getX(l)??l;let i=0;const o=t?.count??e.count;for(let l=0;l+2<o;l+=3){const n=r(l),u=r(l+1),d=r(l+2),_=e.getX(u)-e.getX(n),c=e.getZ(u)-e.getZ(n),y=e.getX(d)-e.getX(n),M=e.getZ(d)-e.getZ(n);i+=c*y-_*M}return i}function Gt(a){const e=[],t=(l,n)=>{if(n.determinant()<0){const d=l.clone().applyMatrix4(n);return Ut(d)<0&&Bt(d),e.push(d),new j(d)}const u=new j(l);return u.matrixAutoUpdate=!1,u.matrix.copy(n),u.matrixWorldNeedsUpdate=!0,u},r=[],i=new ne,o=new ne;for(const l of a){if(l.updateWorldMatrix(!0,!1),l instanceof Xe){for(let n=0;n<l.count;n+=1)l.getMatrixAt(n,i),o.multiplyMatrices(l.matrixWorld,i),r.push(t(l.geometry,o));continue}r.push(l.matrixWorld.determinant()>=0?l:t(l.geometry,l.matrixWorld))}return{meshes:r,temporaryGeometries:e}}const kt=1297302868,Vt=1,Wt=1145979222,Yt=7;function Qt(a){let e=1;for(;e<a;)e*=2;return e}function Xt(a,e){const t=a.vertices.length,r=a.polygons.length;if(t===0||r===0)throw new Error("NavMeshManager.buildFromPolygons: vertices and polygons must be non-empty");if(t>65535)throw new Error(`NavMeshManager.buildFromPolygons: ${t} vertices exceed Detour's uint16 tile index`);if(a.detailMeshes.length!==r)throw new Error(`NavMeshManager.buildFromPolygons: ${r} polygons require the same number of detail rows`);const i=a.polygons.map(h=>h.vertices.map(()=>0)),o=new Map;let l=0;for(let h=0;h<r;h+=1){const R=a.polygons[h];if(R.vertices.length<3||R.vertices.length>6)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has ${R.vertices.length} vertices; Detour permits 3..6`);l+=R.vertices.length;for(let T=0;T<R.vertices.length;T+=1){const x=R.vertices[T],O=R.vertices[(T+1)%R.vertices.length];if(!Number.isInteger(x)||!Number.isInteger(O)||x<0||O<0||x>=t||O>=t)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} references an invalid vertex`);const H=`${x},${O}`;if(o.has(H))throw new Error(`NavMeshManager.buildFromPolygons: directed edge ${H} occurs more than once`);const U=o.get(`${O},${x}`);if(U===void 0)o.set(H,[h,T]);else{const[F,G]=U;i[h][T]=F+1,i[F][G]=h+1}}}for(let h=0;h<r;h+=1){const R=a.detailMeshes[h];if(R.vertexBase<0||R.vertexCount<0||R.vertexBase+R.vertexCount>a.detailVertices.length||R.triangleBase<0||R.triangleCount<0||R.triangleBase+R.triangleCount>a.detailTriangles.length||R.vertexCount>255||R.triangleCount>255)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has an invalid detail row`)}for(const h of a.detailTriangles)if(h.some(R=>!Number.isInteger(R)||R<0||R>255))throw new Error("NavMeshManager.buildFromPolygons: detail triangles must contain uint8 values");const n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const h of[...a.vertices,...a.detailVertices])for(let R=0;R<3;R+=1){const T=h[R];if(!Number.isFinite(T))throw new Error("NavMeshManager.buildFromPolygons: every vertex component must be finite");n[R]=Math.min(n[R],T),u[R]=Math.max(u[R],T)}const d=100,_=32,c=12,p=d+t*12+r*_+l*c+r*12+a.detailVertices.length*12+a.detailTriangles.length*4,C=new Uint8Array(48+p),I=new DataView(C.buffer);let w=0;const P=h=>{I.setUint8(w,h),w+=1},A=h=>{I.setUint16(w,h,!0),w+=2},E=h=>{I.setUint32(w,h,!0),w+=4},D=h=>{I.setInt32(w,h,!0),w+=4},b=h=>{I.setFloat32(w,h,!0),w+=4},S=Qt(r);E(kt),E(Vt),E(1);for(const h of n)b(h);b(Math.max(u[0]-n[0],Number.EPSILON)),b(Math.max(u[2]-n[2],Number.EPSILON)),E(1),E(S),E(S),E(p),E(Wt),E(Yt),D(0),D(0),D(0),E(0),E(r),E(t),E(l),E(r),E(a.detailVertices.length),E(a.detailTriangles.length),E(0),E(0),E(r);const N=le.navigation;b(e?.walkableHeight??N.walkableHeight),b(e?.walkableRadius??N.walkableRadius),b(e?.walkableClimb??N.walkableClimb);for(const h of n)b(h);for(const h of u)b(h);b(1/(e?.cellSize??N.cellSize));for(const h of a.vertices)for(const R of h)b(R);for(let h=0;h<r;h+=1){const R=a.polygons[h];E(4294967295);for(let T=0;T<6;T+=1)A(R.vertices[T]??0);for(let T=0;T<6;T+=1)A(i[h]?.[T]??0);A(R.flags??1),P(R.vertices.length),P((R.area??0)&63)}w+=l*c;for(const h of a.detailMeshes)E(h.vertexBase),E(h.triangleBase),P(h.vertexCount),P(h.triangleCount),A(0);for(const h of a.detailVertices)for(const R of h)b(R);for(const h of a.detailTriangles)for(const R of h)P(R);if(w!==C.length)throw new Error(`NavMeshManager.buildFromPolygons: encoded ${w} bytes into a ${C.length}-byte allocation`);return C}class or{navMesh=null;query=null;crowd=null;helper=null;buildFromMeshes(e,t){const r=le.navigation,i=Gt(e),o=i.meshes.reduce((u,d)=>{const _=d.geometry.getIndex(),c=d.geometry.getAttribute("position").count;return u+Math.floor((_?.count??c)/3)},0),l={cs:t?.cellSize??r.cellSize,ch:t?.cellHeight??r.cellHeight,walkableSlopeAngle:t?.walkableSlopeAngle??r.walkableSlopeAngle,walkableHeight:t?.walkableHeight??r.walkableHeight,walkableClimb:t?.walkableClimb??r.walkableClimb,walkableRadius:t?.walkableRadius??r.walkableRadius,maxEdgeLen:t?.maxEdgeLen??r.maxEdgeLen,maxSimplificationError:t?.maxSimplificationError??r.maxSimplificationError,minRegionArea:t?.minRegionArea??r.minRegionArea,mergeRegionArea:t?.mergeRegionArea??r.mergeRegionArea,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};let n;try{n=t?.tiled===!0||i.meshes.length>256||o>1e4?Ht(i.meshes,{...l,tileSize:t?.tileSize??256}):Ft(i.meshes,l)}finally{for(const u of i.temporaryGeometries)u.dispose()}return!n.success||!n.navMesh?!1:(this.destroyRecast(),this.navMesh=n.navMesh,this.query=new ee(this.navMesh),!0)}buildFromPolygons(e,t){try{return this.loadFromData(Xt(e,t)),!0}catch{return!1}}destroyRecast(){this.helper&&(this.helper.parent?.remove(this.helper),this.helper.dispose?.(),this.helper=null),this.crowd&&(this.crowd.destroy(),this.crowd=null),this.query&&(this.query.destroy(),this.query=null),this.navMesh&&(this.navMesh.destroy(),this.navMesh=null)}hasNavMesh(){return this.navMesh!==null}findPath(e,t){if(!this.query)throw new Error("NavMeshManager.findPath: no navmesh has been built, so no path can be queried. Build one first (buildFromMeshes/importNavMesh) — gate on hasNavMesh() if the caller can run before a bake.");const r=this.query.computePath(e,t);if(!r.success&&r.error)throw new Error(`NavMeshManager.findPath: recast could not complete the query (${r.error.name}${r.error.status===void 0?"":`, status ${r.error.status}`}).`);return r.path}createCrowd(e){if(!this.navMesh)throw new Error("Build navmesh first");return this.crowd=new it(this.navMesh,{maxAgents:e,maxAgentRadius:.6}),this.crowd}updateCrowd(e){this.crowd?.update(e)}getCrowdAgents(){return this.crowd?this.crowd.getAgents().map(e=>{const t=e.interpolatedPosition,r=e.velocity(),i=e.target(),o=zt[e.state()]??"invalid",l=o==="invalid"?[]:e.corners().map(n=>({x:n.x,y:n.y,z:n.z}));return{position:{x:t.x,y:t.y,z:t.z},velocity:{x:r.x,y:r.y,z:r.z},radius:e.radius,height:e.height,state:o,target:{x:i.x,y:i.y,z:i.z},corners:l}}):[]}getDebugMesh(e){return this.navMesh?(this.helper||(this.helper=new Ot(this.navMesh),e.add(this.helper)),this.helper):null}exportData(){if(!this.navMesh)throw new Error("No navmesh to export");return Mt(this.navMesh)}loadFromData(e){const{navMesh:t}=pt(e);this.destroyRecast(),this.navMesh=t,this.query=new ee(this.navMesh)}dispose(e){this.helper&&e.remove(this.helper),this.destroyRecast()}}export{or as NavMeshManager,nr as initNavigation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a5 as e}from"./index-Cr9NTnJp.js";import{d as t,a as i,n as a,b as s}from"./navmesh-workflow-store-Cmnm57TB.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 b="workspace.menu",k={menu:"debug",items:[{id:"navmesh-bake",label:()=>s()?"Rebake NavMesh":"Bake NavMesh",testId:"navmesh-bake",disabled:()=>a()||!e().navigation?.bake,execute:t},{id:"navmesh-clear",label:"Clear NavMesh",testId:"navmesh-clear",disabled:()=>a()||!s()||!e().navigation?.clear,execute:i}]};export{k as menu,b as point};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as n,a5 as u}from"./index-Cr9NTnJp.js";import{getUserData as H}from"./user-data-CODoGZqA.js";import{N as B,c as A,e as $,f as s,m as L,r as f,n as S}from"./navmesh-workflow-store-Cmnm57TB.js";import{b as h}from"./three-contract-Dkt6PmWY.js";import{h as T}from"./host-hierarchy-objects-BV3WqU2w.js";import{a as m,s as g}from"./viewport-door-AsLxGhLN.js";import{cp as V,el as R}from"./three.core-3arARmh6.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./object-marks-BnvSuCTt.js";function _(){let l=null;const p=new V({color:3900150,transparent:!0,opacity:.5,depthWrite:!1});function b(a){a.traverse(e=>{e.isMesh&&(e.material=p)})}function w(a){const e=new Set;for(const[o,r]of T()?.objects()??new Map)H(r,"navRole")===a&&e.add(o);return e}function v(){g("navmesh",null)}function k(){const a=u().navigation,e=a?h(a):null;if(e!==l&&(l=e,v()),!e){f();return}let o=!1;try{o=e.hasNavMesh()}catch(c){n().console.error(`Navigation adapter failed to report its state: ${c}`,"navigation")}if(!o){f();return}L();const r=m()?.scene;if(!r)return;let i=null;try{i=e.debugMesh(r)}catch(c){n().console.error(`Navigation adapter failed to create its debug mesh: ${c}`,"navigation")}i&&(b(i),g("navmesh",i))}const N=async()=>{if(S())return;$(),await new Promise(t=>requestAnimationFrame(()=>t(null)));const a=u().navigation,e=a?h(a):void 0;if(!e){const t="The mounted game has no NavigationAdapter";n().console.warn(`${t} — nothing can be baked`,"navigation"),s(t);return}if(!e.bake){const t="The mounted NavigationAdapter is inspect-only and does not support baking";n().console.warn(t,"navigation"),s(t);return}const o=w("walkable");if(o.size===0){n().console.warn("No walkable meshes found — give the floors `userData={{ navRole: 'walkable' }}` (and blockers `'obstacle'`) where they are written","navigation"),s("No walkable-tagged entities in the scene");return}const r=[];for(const t of[...o,...w("obstacle")]){const y=(T()?.objects()??new Map).get(t);y&&y.traverse(E=>{E.isMesh&&r.push(E)})}if(r.length===0){n().console.error("NavMesh bake failed: the walkable-tagged entities have no meshes","navigation"),s("Walkable entities have no meshes");return}let i=!1;try{i=e.bake(r)}catch(t){n().console.error(`NavMesh bake failed: ${t}`,"navigation"),s(`Bake failed: ${t}`);return}if(!i){n().console.error("NavMesh bake failed","navigation"),s("Bake failed (recast rejected the input geometry)");return}l=e;const c=m()?.scene,d=c?e.debugMesh(c):null;d&&(b(d),g("navmesh",d)),s(null)},M=()=>{const a=u().navigation,e=a?h(a):void 0;if(!e){n().console.warn("The mounted game has no NavigationAdapter to clear","navigation");return}if(!e.clear){n().console.warn("The mounted NavigationAdapter is inspect-only and does not support clearing","navigation");return}try{e.clear(m()?.scene??new R)}catch(o){n().console.error(`NavMesh clear failed: ${o}`,"navigation");return}v(),f()};window.addEventListener(B,N),window.addEventListener(A,M);const j=n().systems.subscribe(k);return k(),()=>{window.removeEventListener(B,N),window.removeEventListener(A,M),j(),v(),p.dispose()}}const Y="workspace.service";function Z(){return _()}export{Y as point,Z as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t}from"./game-network-BqI-Ehz0.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-Cr9NTnJp.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-CB738yQu.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DgYNlhH_.js";import"./contract-system-adapters-Bq1LGdjs.js";import"./game-contract-seams-Dgqv6S8X.js";import"./seeded-random-DmdE0u-C.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-p1sdTwhF.js";import"./capability-coverage-7wKVA3PF.js";import"./edit-mode-authoring-ZQuUwc6e.js";import"./json-history-resource-C9G_vCX9.js";import"./binding-resolver-B9VI52zt.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-BtiLE3a-.js";import"./canvas-entry-runtime-a6N7Rsrj.js";import"./three-ingest-runtime-CXySzulx.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-CjZtqL7Q.js";import"./ingest-source-persistence-BGIvThcv.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-B1qtThOB.js";import"./mounted-authoring-DX3DC9PJ.js";import"./entity-object--ZpqIat7.js";import"./user-data-BXFD1jg-.js";import"./workspace-arrangement-dkubzCff.js";import"./three-contract-Dkt6PmWY.js";import"./three-B86IzdNg.js";import"./editor-layers-CGX7iCSP.js";import"./component-instance-root-C1Xf4SwR.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BD8_MtYK.js";import"./source-persistence-backend-Dzc6MsmN.js";import"./three-projection-core-D4m8lsPU.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-oippu1v_.js";import"./deferred-ingest-play-Bpdhu2i-.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CuyruDfq.js";import"./board-guides-BG-MHK2G.js";import"./relative-import-specifier-CyT6yU4l.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CN92MgRT.js";import"./inference-diagnostics-D5jfxI5p.js";import"./writer-tw6EcuVO.js";import"./three-state-C36FeFK4.js";import"./editor-shell-store-BRqB1JZO.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-AsLxGhLN.js";const yt="workspace.service";function zt(){t()}export{yt as point,zt as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as B,ep as C,af as o,en as c,a0 as k,aR as Q,aM as O,dy as D,eF as Z,eY as tt}from"./index-Cr9NTnJp.js";import{N as et}from"./game-network-BqI-Ehz0.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-CB738yQu.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DgYNlhH_.js";import"./contract-system-adapters-Bq1LGdjs.js";import"./game-contract-seams-Dgqv6S8X.js";import"./seeded-random-DmdE0u-C.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-p1sdTwhF.js";import"./capability-coverage-7wKVA3PF.js";import"./edit-mode-authoring-ZQuUwc6e.js";import"./json-history-resource-C9G_vCX9.js";import"./binding-resolver-B9VI52zt.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-BtiLE3a-.js";import"./canvas-entry-runtime-a6N7Rsrj.js";import"./three-ingest-runtime-CXySzulx.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-CjZtqL7Q.js";import"./ingest-source-persistence-BGIvThcv.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-B1qtThOB.js";import"./mounted-authoring-DX3DC9PJ.js";import"./entity-object--ZpqIat7.js";import"./user-data-BXFD1jg-.js";import"./workspace-arrangement-dkubzCff.js";import"./three-contract-Dkt6PmWY.js";import"./three-B86IzdNg.js";import"./editor-layers-CGX7iCSP.js";import"./component-instance-root-C1Xf4SwR.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BD8_MtYK.js";import"./source-persistence-backend-Dzc6MsmN.js";import"./three-projection-core-D4m8lsPU.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-oippu1v_.js";import"./deferred-ingest-play-Bpdhu2i-.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CuyruDfq.js";import"./board-guides-BG-MHK2G.js";import"./relative-import-specifier-CyT6yU4l.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CN92MgRT.js";import"./inference-diagnostics-D5jfxI5p.js";import"./writer-tw6EcuVO.js";import"./three-state-C36FeFK4.js";import"./editor-shell-store-BRqB1JZO.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-AsLxGhLN.js";function nt(e){return e?{connectionState:e.getConnectionState?.(),roomInfo:e.getRoomInfo?.(),stats:e.getReplicationStats?.()}:null}function st(e){return e?{stateTree:typeof e.getStateSnapshot=="function",messageLog:typeof e.messageEvents=="function",rates:typeof e.getRates=="function",conditioning:typeof e.getConditioning=="function"&&typeof e.setConditioning=="function",connection:typeof e.getConnectionState=="function",room:typeof e.getRoomInfo=="function",stats:typeof e.getReplicationStats=="function",identity:typeof e.getPlayerIdentity=="function",identitySettable:typeof e.setPlayerIdentity=="function",traffic:typeof e.getTrafficByType=="function",send:typeof e.sendMessage=="function",ping:typeof e.ping=="function",server:typeof e.inspectServer=="function",entityTraffic:typeof e.getTrafficByEntity=="function",recording:typeof e.isRecording=="function"&&typeof e.setRecording=="function"}:null}class _{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const s=n.messageEvents(this.lastSeq);if(s.length===0)return 0;for(const i of s)this.entries.push(i),i.seq>this.lastSeq&&(this.lastSeq=i.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),s.length}get all(){return this.entries}clear(){this.entries=[]}}function it(e,n){const s=n.trim().toLowerCase();return s?e.filter(i=>i.type.toLowerCase().includes(s)):[...e]}class P{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class V{msgsIn=new P;msgsOut=new P;bytesIn=new P;bytesOut=new P;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function ot(e,n,s,i=1){if(e.length<2)return"";const a=Math.max(1,...e),l=s-i*2,u=n/(e.length-1);return e.map((y,S)=>{const v=S*u,h=i+l*(1-y/a);return`${v.toFixed(1)},${h.toFixed(1)}`}).join(" ")}const rt={disconnected:o.content.muted,connecting:o.semantic.warning,connected:o.semantic.success,error:o.semantic.danger},R={fontFamily:o.typography.mono,fontSize:C.base};function T({children:e,testId:n}){return t.jsx("div",{"data-testid":n,style:{padding:c[4],color:o.content.muted,fontSize:C.base,fontStyle:"italic"},children:e})}function lt(e){return e!==null&&typeof e=="object"}function at(e){return typeof e=="string"?`"${e}"`:typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(3):String(e)}function K({type:e}){return e?t.jsx("span",{"data-testid":"net-tree-type",style:{color:o.content.dim,marginLeft:6},children:e}):null}function H({name:e,value:n,depth:s,path:i=[],edit:a,remove:l,typeOf:u}){const[y,S]=f.useState(s===0),[v,h]=f.useState(null),[x,m]=f.useState(null),d={...R,paddingLeft:8+s*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!lt(n)){const j=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),$=p=>{h(null),a?.(i,p).then(()=>m(null),I=>m(I instanceof Error?I.message:String(I)))},E=p=>{if(typeof n=="number"){const I=Number(p);return Number.isFinite(I)?I:n}return p};return t.jsxs("div",{style:d,"data-testid":"net-tree-leaf","data-path":i.join("."),children:[t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsx("span",{style:{color:o.content.muted},children:": "}),v!==null?t.jsx(O,{"data-testid":"net-tree-edit",autoFocus:!0,value:v,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&$(E(v)),p.key==="Escape"&&h(null)},onBlur:()=>h(null),style:{width:120}}):t.jsx("span",{"data-testid":j?"net-tree-value":void 0,title:j?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:o.content.primary,cursor:j?"text":void 0},onClick:j?()=>typeof n=="boolean"?$(!n):h(String(n)):void 0,children:at(n)}),t.jsx(K,{type:i.length>0?u?.(i):null}),l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:()=>l(i).then(()=>m(null),p=>m(p instanceof Error?p.message:String(p))),style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null,x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null]})}const g=Object.entries(n);return t.jsxs("div",{children:[t.jsxs("div",{style:{...d,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":y||void 0,onClick:()=>S(j=>!j),children:[t.jsx("span",{style:{color:o.content.muted,display:"inline-block",width:12},children:t.jsx(Z,{direction:y?"down":"right"})}),t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsxs("span",{style:{color:o.content.dim},children:[" ",Array.isArray(n)?`[${g.length}]`:`{${g.length}}`]}),t.jsx(K,{type:i.length>0?u?.(i):null}),x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null,l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:j=>{j.stopPropagation(),l(i).then(()=>m(null),$=>m($ instanceof Error?$.message:String($)))},style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null]}),y&&g.map(([j,$])=>t.jsx(H,{name:j,value:$,depth:s+1,path:s===0?[j]:[...i,j],edit:a,remove:l,typeOf:u},j))]})}const U=96,G=22,dt=f.memo(function({points:n,color:s}){return t.jsx("svg",{width:U,height:G,style:{display:"block",background:o.surface.inset,borderRadius:o.shape.small},role:"img","aria-label":"rate sparkline",children:n&&t.jsx("polyline",{points:n,fill:"none",stroke:s,strokeWidth:1.2})})});function F({label:e,series:n,unit:s,color:i,testId:a}){const l=n.latest;return t.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsxs("div",{style:{fontSize:C.sm,color:o.content.muted},children:[e," ",t.jsx("span",{style:{color:o.content.primary,fontFamily:o.typography.mono},children:l===null?"n/a":`${l}${s}`})]}),t.jsx(dt,{points:ot(n.data,U,G),color:i})]})}function ct({event:e}){const n=e.direction==="in"?o.semantic.success:o.accent.default;return t.jsxs("div",{"data-testid":"net-log-row","data-direction":e.direction,style:{...R,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:c[2],lineHeight:"17px",padding:`0 ${c[4]}`,opacity:e.dropped?.55:1},children:[t.jsxs("span",{style:{color:o.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsx("span",{style:{color:n},children:e.direction==="in"?"↓in":"↑out"}),t.jsxs("span",{style:{color:o.content.primary,textDecoration:e.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[e.type,e.dropped?" (dropped)":""]}),t.jsx("span",{style:{color:o.content.muted,textAlign:"right"},children:e.size!==void 0?`${e.size} B`:"—"})]})}function pt({adapter:e}){const[n,s]=f.useState(()=>e.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),i=e.getConditioningLimits?.()??{},a=l=>{s(l),e.setConditioning?.(l)};return t.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Conditioner"}),t.jsx(D,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:l=>a({...n,latencyMs:Math.max(0,l)})}),t.jsx(D,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:l=>a({...n,jitterMs:Math.max(0,l)})}),i.packetLoss?t.jsx("span",{"data-testid":"net-cond-loss-absent",title:i.packetLoss,style:{fontSize:C.sm,color:o.content.muted},children:"loss: not simulated"}):t.jsx(D,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:l=>a({...n,packetLoss:Math.min(1,Math.max(0,l/100))})})]})}function ut({adapter:e,settable:n}){const[s,i]=f.useState(()=>e.getPlayerIdentity?.()?.name??""),a=()=>{const l=s.trim();l&&e.setPlayerIdentity?.({name:l})};return t.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Player name"}),n?t.jsx(O,{"data-testid":"net-identity-name",value:s,onChange:l=>i(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):t.jsx("span",{"data-testid":"net-identity-name",style:{...R,color:o.content.primary},children:s||"—"})]})}function yt({view:e,caps:n,rates:s}){return t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:c[6],alignItems:"center",padding:`${c[2]} ${c[4]}`,borderBottom:`1px solid ${o.boundary.default}`},children:[e.connectionState!==void 0?t.jsxs("span",{"data-testid":"net-connection-state",style:{color:rt[e.connectionState]},children:["● ",e.connectionState]}):t.jsx(T,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),e.roomInfo===void 0?t.jsx(T,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):e.roomInfo?t.jsxs("span",{style:{...R,color:o.content.primary},children:[e.roomInfo.roomName," · ",e.roomInfo.roomId," · session ",e.roomInfo.sessionId]}):t.jsx("span",{style:{color:o.content.muted},children:"no room"}),e.stats?t.jsxs("span",{style:{color:o.content.muted},children:["entities ",t.jsx("span",{style:{color:o.content.primary},children:e.stats.entities})]}):t.jsx(T,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?t.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:c[5]},children:[t.jsx(F,{label:"msgs in",unit:"/s",series:s.msgsIn,color:o.semantic.success,testId:"net-rate-msgs-in"}),t.jsx(F,{label:"msgs out",unit:"/s",series:s.msgsOut,color:o.accent.default,testId:"net-rate-msgs-out"}),t.jsx(F,{label:"bytes in",unit:" B/s",series:s.bytesIn,color:o.semantic.success,testId:"net-rate-bytes-in"}),t.jsx(F,{label:"bytes out",unit:" B/s",series:s.bytesOut,color:o.accent.default,testId:"net-rate-bytes-out"})]}):t.jsx(T,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}const W=et,J="networkMessageDraft";function mt(){const[,e]=f.useReducer(p=>p+1,0),n=f.useRef(new _),s=f.useRef(new V),i=f.useRef(null),[a,l]=f.useState(!1),[u,y]=f.useState(""),[S,v]=f.useState(()=>B().projectLocalState.read(W)??!1),[h,x]=f.useState(()=>B().projectLocalState.read(J)??{type:"message_type",payload:"{}"}),m=p=>{B().projectLocalState.write(J,p),x(p)};f.useEffect(()=>{const p=()=>{const M=B().systems.inspectedNetworking()??null;return M!==i.current&&(i.current=M,n.current=new _,n.current.paused=a,s.current=new V),M},I=()=>{const M=p();n.current.pull(M),e()};I();const L=setInterval(I,250),w=setInterval(()=>{const r=p()?.getRates?.();r&&s.current.sample(r)},1e3),N=B().systems.inspectedNetworking()?.subscribe(()=>e());return()=>{clearInterval(L),clearInterval(w),N?.()}},[a]);const d=i.current??B().systems.inspectedNetworking()??null,g=st(d);if(!d||!g)return t.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:c[8],color:o.content.muted,fontSize:C.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:o.content.primary,marginBottom:c[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",t.jsx("code",{style:R,children:"NetworkingAdapter"})," during setup:"," ",t.jsx("code",{style:R,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const j=nt(d),$=g.stateTree?d.getStateSnapshot?.():void 0,E=it(n.current.all,u);return t.jsxs("div",{"data-testid":"network-inspector",className:"volter-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:C.md},children:[t.jsx(yt,{view:j,caps:g,rates:s.current}),g.identity?t.jsx(ut,{adapter:d,settable:g.identitySettable},d.getPlayerIdentity?.()?.name??""):null,g.conditioning?t.jsx(pt,{adapter:d}):t.jsx(T,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),g.server?t.jsx(vt,{adapter:d,ownSession:j.roomInfo?.sessionId??null,ownRoom:j.roomInfo?.roomId??null,draft:h,setDraft:m}):null,g.recording||g.traffic?t.jsxs("div",{"data-testid":"net-profiler-bar",style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2],borderBottom:`1px solid ${o.boundary.default}`},children:[g.recording?t.jsx(t.Fragment,{children:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-recording","aria-pressed":d.isRecording?.()===!0,onClick:()=>{d.setRecording?.(!d.isRecording?.()),e()},children:d.isRecording?.()?"Stop":"Start"})}):null,t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),d.clearTraffic?.(),e()},children:"Clear"}),g.recording?t.jsxs("label",{style:{display:"flex",gap:c[1],alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Q,{"data-testid":"net-autostart",checked:S,onChange:p=>{const I=p.currentTarget.checked;B().projectLocalState.write(W,I),v(I)}}),"Autostart"]}):null]}):null,g.traffic?t.jsx(bt,{rows:d.getTrafficByType?.()??[]}):null,g.entityTraffic?t.jsx(ht,{rows:d.getTrafficByEntity?.()??[]}):null,g.send?t.jsx(St,{adapter:d,ping:g.ping,draft:h,setDraft:m}):null,t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${o.boundary.default}`,padding:`${c[2]} 0`},children:g.stateTree?$!=null?t.jsx(H,{name:"state",value:$,depth:0,edit:d.editServerState?(p,I)=>d.editServerState(p,I):void 0,remove:d.deleteServerState?p=>d.deleteServerState(p):void 0,typeOf:d.stateFieldType?p=>d.stateFieldType(p):void 0}):t.jsx(T,{children:"Not connected — no replicated state to show."}):t.jsx(T,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),t.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.messageLog?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2]},children:[g.recording?null:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const p=!a;n.current.paused=p,l(p)},children:a?"Resume":"Pause"}),t.jsx(O,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:u,onChange:p=>y(p.target.value),style:{flex:1,minWidth:60}}),t.jsxs("span",{style:{fontSize:C.sm,color:o.content.muted},children:[E.length,"/",n.current.all.length]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:E.length===0?t.jsx(T,{children:"No messages captured yet."}):E.map(p=>t.jsx(ct,{event:p},p.seq))})]}):t.jsx(T,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ht({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"};return t.jsx("div",{"data-testid":"net-entity-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No state patches yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Entity"}),t.jsx("th",{style:n,title:"Syncs in - out, as Godot pairs them: the state patches that changed it, and none out, because a Colyseus client sends no state",children:"Count"}),t.jsx("th",{style:n,title:"Field changes those patches carried",children:"Changes"}),t.jsx("th",{style:n,title:"Size in - out: the size range of the patches that carried it (they carried other entities too), and none out",children:"Size"})]})}),t.jsx("tbody",{children:e.map(s=>t.jsxs("tr",{"data-testid":"net-entity-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:s.path}),t.jsx("td",{style:n,children:`${s.syncs} - 0`}),t.jsx("td",{style:n,children:s.changes}),t.jsx("td",{style:n,children:`${s.patchBytesMin===s.patchBytesMax?`${s.patchBytesMin} B`:`${s.patchBytesMin}…${s.patchBytesMax} B`} - 0 B`})]},s.path))})]})})}function gt(e){try{return JSON.parse(e)}catch{return e}}function xt({text:e,onChange:n}){const[s,i]=f.useState("tree");let a;try{a=e.trim()===""?{}:JSON.parse(e)}catch{a=void 0}const l=u=>n(JSON.stringify(u));return t.jsxs("div",{"data-testid":"net-payload-editor",style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("div",{style:{display:"flex",gap:c[1]},children:["tree","text"].map(u=>t.jsx(k,{type:"button",variant:"ghost","aria-pressed":s===u,"data-testid":`net-payload-view-${u}`,onClick:()=>i(u),children:u==="tree"?"Tree":"Text"},u))}),s==="text"||a===void 0?t.jsxs(t.Fragment,{children:[t.jsx(tt,{"data-testid":"net-send-dialog-payload",rows:6,value:e,onChange:u=>n(u.target.value),style:R}),a===void 0?t.jsx("span",{style:{color:o.content.muted},children:"Not JSON yet, so the tree cannot show it."}):null]}):t.jsx("div",{style:{...R,fontSize:C.sm},children:t.jsx(X,{value:a,onChange:l,depth:0})})]})}function X({value:e,onChange:n,depth:s}){const[i,a]=f.useState(""),[l,u]=f.useState(""),y={paddingLeft:s*12};if(e!==null&&typeof e=="object"){const S=Array.isArray(e),v=S?e.map((m,d)=>[String(d),m]):Object.entries(e),h=(m,d)=>{n(S?e.map((g,j)=>String(j)===m?d:g):{...e,[m]:d})},x=m=>{n(S?e.filter((d,g)=>String(g)!==m):Object.fromEntries(Object.entries(e).filter(([d])=>d!==m)))};return t.jsxs("div",{"data-testid":"net-payload-branch",children:[v.map(([m,d])=>t.jsxs("div",{style:y,children:[t.jsxs("span",{style:{color:o.content.muted},children:[m,": "]}),d!==null&&typeof d=="object"?t.jsx("span",{style:{color:o.content.muted},children:Array.isArray(d)?"[":"{"}):null,t.jsx("button",{type:"button","data-testid":"net-payload-remove",title:`Remove ${m}`,onClick:()=>x(m),style:{background:"none",border:0,color:o.content.muted,cursor:"pointer"},children:"×"}),d!==null&&typeof d=="object"?t.jsx(X,{value:d,onChange:g=>h(m,g),depth:s+1}):t.jsx(q,{value:d,onChange:g=>h(m,g)})]},m)),t.jsxs("div",{style:{...y,display:"flex",gap:c[1]},children:[S?null:t.jsx(O,{"data-testid":"net-payload-new-key",placeholder:"key",value:i,onChange:m=>a(m.target.value),style:{width:90}}),t.jsx(O,{"data-testid":"net-payload-new-value",placeholder:"value",value:l,onChange:m=>u(m.target.value),style:{width:110}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-payload-add",disabled:!S&&i.trim()==="",onClick:()=>{const m=gt(l);n(S?[...e,m]:{...e,[i.trim()]:m}),a(""),u("")},children:"Add"})]})]})}return t.jsx(q,{value:e,onChange:n})}function q({value:e,onChange:n}){const s=e===null?"null":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",i=s==="string"?String(e):JSON.stringify(e),[a,l]=f.useState(i);f.useEffect(()=>l(i),[i]);const u=(y,S)=>{if(y==="null")return null;if(y==="boolean")return S.trim()==="true";if(y==="number"){const v=Number(S);return Number.isFinite(v)?v:0}return S};return t.jsxs("span",{style:{display:"inline-flex",gap:4},children:[s==="boolean"?t.jsx("input",{type:"checkbox","data-testid":"net-payload-leaf-boolean",checked:e===!0,onChange:y=>n(y.currentTarget.checked)}):s==="null"?t.jsx("span",{style:{color:o.content.muted},children:"null"}):t.jsx(O,{"data-testid":"net-payload-leaf",value:a,onChange:y=>l(y.target.value),onBlur:()=>n(u(s,a)),onKeyDown:y=>{y.key==="Enter"&&n(u(s,a))},style:{width:120}}),t.jsx("select",{"data-testid":"net-payload-leaf-type","aria-label":"Value type",value:s,onChange:y=>n(u(y.currentTarget.value,a)),children:["string","number","boolean","null"].map(y=>t.jsx("option",{value:y,children:y},y))})]})}const ft=[["name","Name"],["roomId","Room"],["clients","Clients"],["locked","Locked"],["elapsedMs","Elapsed"]];function jt(e,n){const s=i=>{const a=i[n.key];return typeof a=="number"?a:typeof a=="boolean"?Number(a):String(a)};return[...e].sort((i,a)=>{const l=s(i),u=s(a),y=l<u?-1:l>u?1:0;return n.descending?-y:y})}function bt({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"},s=i=>i>=1024?`${(i/1024).toFixed(1)} KiB`:`${i} B`;return t.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No traffic yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),t.jsx("th",{style:n,children:"In"}),t.jsx("th",{style:n,children:"Bytes in"}),t.jsx("th",{style:n,children:"Out"}),t.jsx("th",{style:n,children:"Bytes out"})]})}),t.jsx("tbody",{children:e.map(i=>t.jsxs("tr",{"data-testid":"net-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:i.type}),t.jsx("td",{style:n,children:i.countIn||"-"}),t.jsx("td",{style:n,children:i.countIn?s(i.bytesIn):"-"}),t.jsx("td",{style:n,children:i.countOut||"-"}),t.jsx("td",{style:n,children:i.countOut?s(i.bytesOut):"-"})]},i.type))})]})})}function Y(e){if(e.type.trim()==="")throw new Error("Name the message type first.");return{type:e.type,payload:e.payload.trim()===""?void 0:JSON.parse(e.payload)}}function St({adapter:e,ping:n,draft:s,setDraft:i}){const[a,l]=f.useState(null),u=()=>{l("…"),e.ping?.().then(h=>l(`${h} ms`),h=>l(h instanceof Error?h.message:String(h)))},[y,S]=f.useState(null),v=()=>{try{const h=Y(s);e.sendMessage?.(h.type,h.payload),S(null)}catch(h){S(h instanceof Error?h.message:String(h))}};return t.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:c[2],alignItems:"center",padding:c[2]},children:[t.jsx(O,{"data-testid":"net-send-type",placeholder:"Message type",value:s.type,onChange:h=>i({...s,type:h.target.value}),style:{width:140}}),t.jsx(O,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:s.payload,onChange:h=>i({...s,payload:h.target.value}),style:{flex:1,minWidth:80}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:s.type.trim()==="",onClick:v,children:"Send as this client"}),n?t.jsxs(t.Fragment,{children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:u,children:"Ping"}),a?t.jsx("span",{"data-testid":"net-rtt",style:{fontSize:C.sm,...R},children:a}):null]}):null,y?t.jsx("span",{"data-testid":"net-send-error",style:{color:o.semantic.danger,fontSize:C.sm},children:y}):null]})}function vt({adapter:e,ownSession:n,ownRoom:s,draft:i,setDraft:a}){const[l,u]=f.useState(null),[y,S]=f.useState(null),[v,h]=f.useState("clients"),[x,m]=f.useState(void 0),[d,g]=f.useState(void 0),[j,$]=f.useState({key:"elapsedMs",descending:!0}),[E,p]=f.useState(null);f.useEffect(()=>{let r=!0;const b=()=>{e.inspectServer?.(d).then(A=>{r&&m(A)},A=>{r&&p(A instanceof Error?A.message:String(A))})};b();const z=setInterval(b,2e3);return()=>{r=!1,clearInterval(z)}},[e,d]);const I=r=>{try{r()?.then(()=>p(null),b=>p(b instanceof Error?b.message:String(b)))}catch(b){p(b instanceof Error?b.message:String(b))}},L=r=>`${Math.round(r/1e3)} s`,w={padding:`0 ${c[3]}`,whiteSpace:"nowrap"};if(x===void 0)return null;if(x===null)return t.jsx(T,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VOLTER_ROOM_MONITOR=1)."});const N=x.room?.roomId,M=(r,b,z)=>t.jsx(k,{type:"button",variant:"ghost","data-testid":r,onClick:()=>I(z),children:b});return t.jsxs("div",{"data-testid":"net-server",style:{padding:`${c[2]} 0`,borderBottom:`1px solid ${o.boundary.default}`,fontSize:C.sm},children:[t.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${c[3]}`,color:o.content.muted},children:["Server · ",x.rooms.length," room",x.rooms.length===1?"":"s"," · ",x.connections," ","connection",x.connections===1?"":"s",x.cpuPercent!==null?` · CPU ${x.cpuPercent.toFixed(0)}%`:"",x.memory?` · memory ${Math.round(x.memory.usedMb)} / ${Math.round(x.memory.totalMb)} MB`:"",x.room?` · state ${x.room.stateBytes} B`:""]}),t.jsxs("table",{style:{borderCollapse:"collapse",...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[ft.map(([r,b])=>t.jsxs("th",{"data-testid":`net-server-sort-${r}`,"aria-sort":j.key===r?j.descending?"descending":"ascending":"none",style:{...w,textAlign:"left",cursor:"pointer",fontWeight:"normal"},onClick:()=>$({key:r,descending:j.key===r?!j.descending:!1}),children:[b,j.key===r?j.descending?" ▾":" ▴":""]},r)),t.jsx("th",{style:w})]})}),t.jsx("tbody",{children:jt(x.rooms,j).map(r=>t.jsxs("tr",{"data-testid":"net-server-room","data-inspected":r.roomId===N||void 0,children:[t.jsx("td",{style:w,children:r.name}),t.jsx("td",{style:w,children:r.roomId}),t.jsxs("td",{style:w,children:[r.clients,r.maxClients!==null?` / ${r.maxClients}`:""," clients"]}),t.jsx("td",{style:w,children:r.locked?"locked":"open"}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,children:[r.roomId===N?t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-broadcast",onClick:()=>{S(null),u({sessionId:null})},children:"Broadcast"}):t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>g(r.roomId),children:"Inspect"}),M("net-server-dispose","Dispose",()=>e.disposeRoom?.(r.roomId))]})]},r.roomId))})]}),l?t.jsxs("div",{"data-testid":"net-send-dialog",role:"group","aria-labelledby":"net-send-dialog-title",style:{margin:c[2],padding:c[3],border:`1px solid ${o.boundary.default}`,borderRadius:4},children:[t.jsx("div",{id:"net-send-dialog-title",style:{color:o.content.primary,marginBottom:c[2]},children:l.sessionId?`Send message to client (${l.sessionId})`:"Broadcast message to all clients"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:c[2]},children:[t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message type"}),t.jsx(O,{"data-testid":"net-send-dialog-type",value:i.type,onChange:r=>a({...i,type:r.target.value})})]}),t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message payload (JSON)"}),t.jsx(xt,{text:i.payload,onChange:r=>a({...i,payload:r})})]}),y?t.jsx("span",{"data-testid":"net-send-dialog-error",children:y}):null]}),t.jsxs("div",{style:{display:"flex",gap:c[2],justifyContent:"flex-end",marginTop:c[2]},children:[t.jsx(k,{type:"button",variant:"ghost",onClick:()=>u(null),children:"Cancel"}),t.jsx(k,{type:"button","data-testid":"net-send-dialog-send",onClick:()=>{const r=l;(async()=>{try{const b=Y(i);await(r.sessionId?e.sendToClient?.(r.sessionId,b.type,b.payload,N):e.broadcast?.(b.type,b.payload,N)),S(null),u(null)}catch(b){S(b instanceof Error?b.message:String(b))}})()},children:"Send"})]})]}):null,x.room?t.jsxs("div",{"data-testid":"net-server-room-view",style:{padding:`${c[2]} 0`},children:[t.jsx("div",{role:"tablist",style:{display:"flex",gap:c[2],padding:`0 ${c[3]}`},children:[["clients",`Clients (${x.room.clients.length})`],["state","State"]].map(([r,b])=>t.jsx(k,{type:"button",variant:"ghost",role:"tab","aria-selected":v===r,"data-testid":`net-server-tab-${r}`,onClick:()=>h(r),children:b},r))}),v==="clients"?t.jsx("table",{style:{borderCollapse:"collapse",...R},children:t.jsx("tbody",{children:x.room.clients.map(r=>t.jsxs("tr",{"data-testid":"net-server-client",children:[t.jsx("td",{style:w,children:"client"}),t.jsxs("td",{style:w,children:[r.sessionId,r.sessionId===n?" (this client)":""]}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,colSpan:3,children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-send",onClick:()=>{S(null),u({sessionId:r.sessionId})},children:"Send"}),M("net-server-disconnect","Disconnect",()=>e.disconnectClient?.(r.sessionId,N))]})]},r.sessionId))})}):x.room.state!==void 0?t.jsx("div",{"data-testid":"net-server-room-state",children:t.jsx(H,{name:`room ${x.room.roomId}${x.room.roomId===s?" (this client’s room)":""}`,value:x.room.state,depth:0,edit:e.editServerState?(r,b)=>e.editServerState(r,b,N):void 0,remove:e.deleteServerState?r=>e.deleteServerState(r,N):void 0})}):t.jsx(T,{children:"The server sent no state for this room."})]}):null,E?t.jsx(T,{children:E}):null]})}const Ue="workspace.utility",Ge="Network",Xe=25,Ye=()=>B().systems.inspectedNetworking()!==null;function Qe(){return t.jsx(mt,{})}export{Ye as available,Qe as default,Xe as order,Ue as point,Ge as title};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",volterComponentRoot:"volterComponentRoot",volterBuiltInternal:"volterBuiltInternal"};function r(e,t){return e?e.userData[n[t]]:void 0}function l(e,t,o){e.userData[n[t]]=o}export{n as ObjectMarkKeys,r as getObjectMark,l as setObjectMark};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getUserData as r,deleteUserData as n,setUserData as o}from"./user-data-
|
|
1
|
+
import{getUserData as r,deleteUserData as n,setUserData as o}from"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";function i(e){const t=r(e,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function a(e,t){o(e,"authoringSubject",t)}function b(e){n(e,"authoringSubject")}export{b as clearObject3DAuthoringSubject,i as object3DAuthoringSubjectOf,a as setObject3DAuthoringSubject};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-CvnSLDPI.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-Cr9NTnJp.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/asset-preview-CQfnI2cX.js","assets/editor-layers-CGX7iCSP.js","assets/workspace-arrangement-dkubzCff.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-CndAXtie.js","assets/studio-environment-B--4k2mN.js","assets/user-data-BXFD1jg-.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-CuVwNVvv.js","assets/viewport-door-AsLxGhLN.js","assets/ViewportShadingMenu-S2lADFJg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as f,aG as p,aH as l,aI as m,aJ as D,_ as g}from"./index-Cr9NTnJp.js";import{r as b}from"./index-nmcBqr7Y.js";const v=b.lazy(()=>g(()=>import("./Object3DDocumentToolbar-CvnSLDPI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])).then(e=>({default:e.Object3DDocumentToolbar}))),o=new Map,a=new Map;let s=0;const c=new Set;function i(){s++;for(const e of c)e()}function O(e,t={}){o.set(e.documentId,e);const r=f(e),n=p(e.documentId,{...w(e),...t});return i(),()=>{n(),r(),o.get(e.documentId)===e&&(o.delete(e.documentId),i())}}const d=([e,t,r])=>({x:e,y:t,z:r});function w(e){return{read:()=>{const t=e.cameraPose(),r=e.presentation();return{camera:{position:d(t.position),target:d(t.target),...t.fov?{fov:t.fov}:{}},diagnostic:r.skeleton?"skeleton":r.mode,grid:D(e.documentId)}},setDiagnostic:t=>{if(t==="preview"||t==="rendered"){const r=l(e.documentId)?.stageKind;if(!r||m(r)?.modes?.[t]?.lighting===void 0)return!1}return e.setSkeleton(t==="skeleton"),e.setBounds(t==="bounds"),e.setMode(t==="skeleton"||t==="bounds"?"solid":t),!0},setCamera:t=>(typeof t!="string"?e.setCameraPose(t.position,t.target,t.fov):t==="perspective"?(e.setProjection("perspective"),e.frame()):e.setViewPreset(t),!0),frame:t=>t==="selection"?e.frameSelection():(e.frame(),!0),selection:{read:()=>e.selection(),apply:t=>e.select(t)},idsNamed:t=>{const r=[];return e.root.traverse(n=>{if(n.name!==t)return;const u=e.idForObject(n);u&&r.push(u)}),r},setTransformMode:t=>e.viewport.setTransformMode(t),capture:t=>e.captureImage(t??512),prepare:()=>S(e.documentId),HeaderControls:v}}function P(e){return o.get(e)??null}function I(e,t){return a.set(e,t),()=>{a.get(e)===t&&a.delete(e)}}async function S(e){await a.get(e)?.()}function V(){return[...o.values()]}function _(e){return c.add(e),()=>c.delete(e)}function k(){return s}export{P as a,V as b,O as c,k as o,I as r,_ as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ay as i}from"./index-Cr9NTnJp.js";import"./writer-tw6EcuVO.js";import{p as h,a as M,r as $}from"./r3f-physics-binding-oippu1v_.js";const x=["position","rotation","scale"],O={"@react-three/rapier":{RigidBody:{root:"single",rootTag:"group",transformProps:[...x]}}},z={"@react-three/rapier":{RigidBodyProps:"group"}};function _(t){const n=new Map;for(const r of t.statements){if(!i.isImportDeclaration(r)||!i.isStringLiteral(r.moduleSpecifier))continue;const e=z[r.moduleSpecifier.text],o=r.importClause?.namedBindings;if(!(!e||!o||!i.isNamedImports(o)))for(const s of o.elements){const a=s.propertyName?.text??s.name.text,l=e[a];l&&n.set(s.name.text,l)}}return n}function D(t){return t?Object.values(O).some(n=>Object.values(n).includes(t)):!1}function j(t,n){return O[t]?.[n]}function Z(t){const n=new Map;if(!i.isStringLiteral(t.moduleSpecifier))return n;const r=t.importClause?.namedBindings;if(!r||!i.isNamedImports(r))return n;for(const e of r.elements){const o=j(t.moduleSpecifier.text,e.propertyName?.text??e.name.text);o&&n.set(e.name.text,o)}return n}function ct(t,n){const r=h(n,t),e=new Map;for(const o of r.statements)if(i.isImportDeclaration(o))for(const[s,a]of Z(o))e.set(s,a);return e}function P(t){let n=t;for(;i.isParenthesizedExpression(n)||i.isAsExpression(n)||i.isSatisfiesExpression(n);)n=n.expression;return n}function k(t){if(!i.isBlock(t))return P(t);const n=t.statements.filter(i.isReturnStatement);if(!(n.length!==1||!n[0]?.expression))return P(n[0].expression)}function K(t,n,r){for(const[e,o]of r)if(o===n&&new RegExp(`\\b${e}\\b`).test(t))return!0;return!1}function b(t,n,r,e,o,s=new Set){if(!t)return!1;const a=t.getText(r),l=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\bThreeElements\\s*\\[\\s*['"]${l}['"]\\s*\\]`).test(a)||K(a,n,o))return!0;if(i.isTypeReferenceNode(t)&&i.isIdentifier(t.typeName)){const u=t.typeName.text;if(s.has(u))return!1;const f=e.get(u);return f?(s.add(u),b(f.type,n,f.sf,e,o,s)):!1}for(const[u,f]of e){if(s.has(u)||!new RegExp(`\\b${u}\\b`).test(a))continue;const p=new Set(s).add(u);if(b(f.type,n,f.sf,e,o,p))return!0}return!1}function L(t){if(i.isJsxSelfClosingElement(t))return t;if(i.isJsxElement(t))return t.openingElement}function U(t,n){return t==="multiple"||n==="multiple"?"multiple":t==="unknown"||n==="unknown"?"unknown":t+n>=2?"multiple":t+n}function I(t,n,r){const o=(i.isJsxElement(t)?t.openingElement:t).tagName.getText(n);if(!/^[A-Z]/.test(o))return B(o)?0:1;const s=r.get(o);return!s||s.root==="unknown"?"unknown":s.root==="non-spatial"?0:s.root==="multiple"?"multiple":1}function V(t,n,r){if(!i.isPropertyAccessExpression(t.expression)||t.expression.name.text!=="map")return;const e=t.arguments[0];if(!e||!i.isArrowFunction(e)&&!i.isFunctionExpression(e))return"unknown";const o=k(e.body);if(!o)return"unknown";const s=v(o,n,r);return s===0?0:s==="unknown"?"unknown":"multiple"}function v(t,n,r){const e=P(t);return e.kind===i.SyntaxKind.NullKeyword||e.kind===i.SyntaxKind.FalseKeyword?0:i.isJsxFragment(e)?y(e,n,r):i.isJsxElement(e)||i.isJsxSelfClosingElement(e)?I(e,n,r):i.isCallExpression(e)?V(e,n,r)??"unknown":"unknown"}function W(t,n,r){return i.isJsxText(t)?t.text.trim()===""?0:"unknown":i.isJsxExpression(t)?t.expression?v(t.expression,n,r):0:i.isJsxElement(t)||i.isJsxSelfClosingElement(t)?I(t,n,r):i.isJsxFragment(t)?y(t,n,r):"unknown"}function y(t,n,r){let e=0;for(const o of t.children)e=U(e,W(o,n,r));return e}function q(t,n,r){const e=y(t,n,r);return e===0?{root:"non-spatial",transformProps:[]}:e==="multiple"?{root:"multiple",transformProps:[]}:{root:"unknown",transformProps:[]}}function B(t){return/^[A-Z]/.test(t)?!1:/(Material|Geometry|Attribute)$/.test(t)||t==="fog"||t==="fogExp2"||t==="color"}function G(t){return x.includes(t)}function F(t){return G(t)||t==="visible"}function Y(t,n,r,e,o){const s={standardRootProps:b(t?.type,n,r,e,o),localBindingByProp:new Map};if(!t)return s;if(i.isIdentifier(t.name))return s.wholePropsName=t.name.text,s;if(!i.isObjectBindingPattern(t.name))return s;for(const a of t.name.elements){if(a.dotDotDotToken&&i.isIdentifier(a.name)){s.restPropsName=a.name.text;continue}if(!i.isIdentifier(a.name))continue;const l=a.propertyName?.getText(r)??a.name.text;F(l)&&s.localBindingByProp.set(l,a.name.text)}return s}function H(t,n,r){if(!t)return!1;const e=t.getText(r).replace(/\s+/g,""),o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^(React\\.)?(Parameters<typeof${o}>\\[0\\]|ComponentProps(WithoutRef|WithRef)?<typeof${o}>)`).test(e)}function Q(t,n){return!n.standardRootProps||!i.isIdentifier(t.expression)?!1:t.expression.text===n.wholePropsName||t.expression.text===n.restPropsName}function X(t,n,r){const e=t.name.getText(r);if(!F(e)||!t.initializer||!i.isJsxExpression(t.initializer))return;const o=t.initializer.expression;if(!o)return;const s=n.localBindingByProp.get(e);if(s&&i.isIdentifier(o)&&o.text===s||n.wholePropsName&&i.isPropertyAccessExpression(o)&&i.isIdentifier(o.expression)&&o.expression.text===n.wholePropsName&&o.name.text===e)return e}function tt(t,n,r){const e=new Set;for(const s of t.attributes.properties){if(i.isJsxSpreadAttribute(s)){if(Q(s,n)){for(const l of x)e.add(l);e.add("visible")}continue}const a=X(s,n,r);a&&e.add(a)}return[...x,"visible"].filter(s=>e.has(s))}const nt=/\b([A-Za-z_$][\w$]*)\.current\??\.(?:position|rotation|quaternion|scale)(?:\??\.[xyzw]+)?\s*(?:[+\-*/]?=|\??\.(?:set|setScalar|copy|add|sub|multiply|lerp|slerp|fromArray)\s*\()/g;function et(t,n){const r=new Set,e=o=>{if(i.isCallExpression(o)&&/(^|\.)useFrame$/.test(o.expression.getText(n)))for(const s of o.getText(n).matchAll(nt))r.add(s[1]);i.forEachChild(o,e)};return e(t),r}function rt(t,n,r){if(n.length>0)return{};const e=$(t);return e&&r.has(e)?{simulationOwnedTransform:!0}:{}}function ot(t,n,r,e,o,s,a,l){const u=k(n);if(!u)return{root:"unknown",transformProps:[]};if(u.kind===i.SyntaxKind.NullKeyword)return{root:"non-spatial",transformProps:[]};if(i.isJsxFragment(u))return q(u,r,s);if(!i.isJsxElement(u)&&!i.isJsxSelfClosingElement(u))return{root:"unknown",transformProps:[]};const f=L(u);if(!f)return{root:"unknown",transformProps:[]};const p=f.tagName.getText(r);if(B(p))return{root:"non-spatial",transformProps:[]};const c=/^[A-Z]/.test(p)?s.get(p):void 0;if(/^[A-Z]/.test(p)&&!c)return{root:"unknown",transformProps:[]};if(c&&c.root!=="single")return c;const d=c?.rootTag??p,g=l.get(f),E=g?.apiDriven??[],T=(g?.forwarded??[]).filter(m=>!E.includes(m)),R=Y(t[0],d,r,e,o),A=!R.standardRootProps&&c&&H(t[0]?.type,p,r)?{...R,standardRootProps:!0}:R,N=tt(f,A,r),S=x.filter(m=>N.includes(m)||T.includes(m)),w=c?S.filter(m=>c.transformProps.includes(m)):S,J=N.includes("visible")&&(!c||c.visibleProp===!0);if(D(c)&&w.length===0)return{root:"unknown",transformProps:[]};const C=w.filter(m=>T.includes(m));return{root:"single",rootTag:d,transformProps:w,...C.length>0?{bodyForwarded:C}:{},...J?{visibleProp:!0}:{},...rt(f,w,a),...E.length>0?{simulationOwnedTransform:!0}:{}}}function it(t){return i.isFunctionDeclaration(t)&&t.name&&t.body?/^[A-Z]/.test(t.name.text)?[{name:t.name.text,parameters:t.parameters,body:t.body}]:[]:i.isVariableStatement(t)?t.declarationList.declarations.flatMap(n=>!i.isIdentifier(n.name)||!/^[A-Z]/.test(n.name.text)||!n.initializer||!i.isArrowFunction(n.initializer)&&!i.isFunctionExpression(n.initializer)?[]:[{name:n.name.text,parameters:n.initializer.parameters,body:n.initializer.body}]):[]}function st(t,n=new Map,r=new Map){const e=new Map(r);for(const f of t.statements)i.isTypeAliasDeclaration(f)&&e.set(f.name.text,{type:f.type,sf:t});const o=_(t),s=t.statements.flatMap(it),a=et(t,t),l=M(t),u=new Map(n);for(let f=0;f<=s.length;f+=1){let p=!1;for(const c of s){const d=ot(c.parameters,c.body,t,e,o,u,a,l),g=u.get(c.name);JSON.stringify(g)!==JSON.stringify(d)&&(u.set(c.name,d),p=!0)}if(!p)break}return u}function lt(t,n,r=new Map,e=new Map){const o=h(n,t);return st(o,r,e)}function pt(t,n,r){let e=0,o=1;for(;o<n;){const s=t.indexOf(`
|
|
2
2
|
`,e);if(s===-1)return t.length;e=s+1,o+=1}return e+r}export{lt as a,ct as b,pt as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Vec3Schema as a}from"./tuples-
|
|
1
|
+
import{Vec3Schema as a}from"./tuples-uyiMYXrv.js";import{dY as c,t as i,bA as e,bz as o,u as n,by as s,w as t,v as p}from"./index-Cr9NTnJp.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 b=i({type:t("ConstantValue"),value:e()}),h=i({type:t("IntervalValue"),a:e(),b:e()}),u=i({p0:e(),p1:e(),p2:e(),p3:e()}),f=i({type:t("PiecewiseBezier"),functions:n(i({function:u,start:e()}))}),r=c("type",[b,h,f]).describe("Numeric value: constant, random interval, or bezier curve"),l=i({r:e(),g:e(),b:e(),a:e()}),v=i({r:e(),g:e(),b:e()}),y=i({type:t("CLinearFunction"),subType:t("Color"),keys:n(i({value:v,pos:e()}))}),S=i({type:t("CLinearFunction"),subType:t("Number"),keys:n(i({value:e(),pos:e()}))}),g=i({type:t("ConstantColor"),color:l}),C=i({type:t("ColorRange"),a:l,b:l}),d=i({type:t("Gradient"),color:y,alpha:S}),w=i({type:t("RandomColorBetweenGradient"),gradient1:d,gradient2:d}),m=c("type",[g,C,d,w]).describe("Color generator: constant, range, gradient, or random between gradients"),B=i({type:t("point")}),L=i({type:t("sphere"),radius:e().optional().describe("Sphere radius"),arc:e().optional().describe("Arc angle in radians (2π = full sphere)"),thickness:e().optional().describe("Shell thickness 0–1 (1 = solid, 0 = surface only)")}),O=i({type:t("hemisphere"),radius:e().optional().describe("Hemisphere radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1")}),x=i({type:t("cone"),radius:e().optional().describe("Cone base radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1"),angle:e().optional().describe("Cone opening angle in radians")}),F=i({type:t("circle"),radius:e().optional().describe("Circle radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1")}),P=i({type:t("donut"),radius:e().optional().describe("Donut major radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1"),donutRadius:e().optional().describe("Donut tube (minor) radius")}),R=i({type:t("rectangle"),width:e().optional().describe("Rectangle width"),height:e().optional().describe("Rectangle height"),thickness:e().optional().describe("Extrusion depth 0–1")}),T=i({type:t("grid"),width:e().optional().describe("Grid total width"),height:e().optional().describe("Grid total height"),column:e().int().optional().describe("Number of columns"),row:e().int().optional().describe("Number of rows")}),G=c("type",[B,L,O,x,F,P,R,T]).describe("Particle emitter shape"),k=i({type:t("ApplyForce"),direction:a.describe("Force direction vector"),magnitude:r.describe("Force magnitude")}),z=i({type:t("ColorOverLife"),color:m.describe("Color curve over particle lifetime")}),E=i({type:t("SizeOverLife"),size:r.describe("Size curve over particle lifetime")}),A=i({type:t("SpeedOverLife"),speed:r.describe("Speed multiplier curve over lifetime")}),N=i({type:t("RotationOverLife"),angularVelocity:r.describe("Angular velocity in radians/sec")}),D=i({type:t("ForceOverLife"),x:r.describe("Force along X axis over lifetime"),y:r.describe("Force along Y axis over lifetime"),z:r.describe("Force along Z axis over lifetime")}),I=i({type:t("OrbitOverLife"),orbitSpeed:r.describe("Orbit speed over lifetime"),axis:a.optional().describe("Orbit axis. Defaults to [0, 1, 0]")}),V=i({type:t("Noise"),frequency:r.describe("Noise frequency"),power:r.describe("Noise amplitude"),positionAmount:r.optional().describe("Position displacement amount"),rotationAmount:r.optional().describe("Rotation displacement amount")}),H=i({type:t("TurbulenceField"),scale:a.describe("Turbulence field scale"),octaves:e().int().describe("Noise octave count"),velocityMultiplier:a.describe("Velocity multiplier per axis"),timeScale:a.describe("Time scale per axis")}),M=i({type:t("FrameOverLife"),frame:r.describe("Sprite sheet frame index over lifetime")}),W=i({type:t("LimitSpeedOverLife"),speed:r.describe("Maximum speed over lifetime"),dampen:e().describe("Damping factor when speed exceeds limit (0–1)")}),j=i({type:t("ChangeEmitDirection"),angle:r.describe("Angle deviation from original emit direction")}),q=i({type:t("GravityForce"),center:a.describe("Gravity center point"),magnitude:e().describe("Gravity force strength")}),U=i({type:t("WidthOverLength"),width:r.describe("Trail width over trail length")}),Y=c("type",[k,z,E,A,N,D,I,V,H,M,W,j,q,U]).describe("Particle behavior applied over lifetime"),X=s(["billboard","stretchedBillboard","mesh","trail","horizontalBillboard","verticalBillboard"]).describe("How particles are rendered"),Z=i({wrap:s(["clamp","repeat","mirror"]).optional().describe("How UVs outside [0,1] address the sprite image (three wrapS/wrapT)"),filter:s(["linear","nearest"]).optional().describe("Texel interpolation — nearest keeps a pixel-art sprite crisp"),mipmaps:o().optional().describe("Generate and sample a mip chain"),anisotropy:e().optional().describe("Anisotropic filtering samples, for sprites viewed at grazing angles")}).describe("Sprite texture sampler state"),_=i({type:s(["basic","standard"]).optional().describe("Particle material shading model"),color:p().optional().describe("Particle color as CSS hex string"),map:p().optional().describe("Path to particle sprite texture"),mapSampler:Z.optional().describe("Sampler state applied to the sprite texture named by `map`"),blending:s(["normal","additive"]).optional().describe("Blending mode (additive for glowing/fire effects)"),transparent:o().optional().describe("Enable transparency"),depthWrite:o().optional().describe("Write to depth buffer (disable for additive effects)"),side:s(["front","back","double"]).optional().describe("Which face sides to render")}).describe("Particle material settings"),J=i({time:e().describe("Time offset in seconds within the emission cycle"),count:r.describe("Number of particles to emit"),cycle:e().optional().describe("Burst repeat interval in seconds"),interval:e().optional().describe("Delay between burst repetitions"),probability:e().optional().describe("Chance of burst firing (0–1)")}).describe("Timed particle burst"),ne=i({autoDestroy:o().optional().describe("Destroy the particle system when all particles have died"),looping:o().optional().describe("Continuously emit particles"),prewarm:o().optional().describe("Simulate one full cycle on start so particles appear immediately"),duration:e().optional().describe("Total emission duration in seconds"),shape:G.optional().describe("Emitter shape that defines where particles spawn"),startLife:r.optional().describe("Initial particle lifetime in seconds"),startSpeed:r.optional().describe("Initial particle speed"),startSize:r.optional().describe("Initial particle size"),startRotation:r.optional().describe("Initial particle rotation in radians"),startColor:m.optional().describe("Initial particle color"),startLength:r.optional().describe("Initial trail length (trail render mode only)"),startTileIndex:r.optional().describe("Initial sprite sheet tile index"),emissionOverTime:r.optional().describe("Particles emitted per second"),emissionOverDistance:r.optional().describe("Particles emitted per unit of emitter movement"),emissionBursts:n(J).optional().describe("Timed burst emissions"),behaviors:n(Y).optional().describe("Behaviors applied to particles over their lifetime"),renderMode:X.optional().describe("How particles are rendered (billboard, trail, mesh, etc.)"),worldSpace:o().optional().describe("Simulate particles in world space instead of local space"),renderOrder:e().optional().describe("Render order for sorting (higher = rendered later)"),uTileCount:e().int().optional().describe("Horizontal tile count in sprite sheet"),vTileCount:e().int().optional().describe("Vertical tile count in sprite sheet"),blendTiles:o().optional().describe("Blend between sprite sheet tiles for smooth animation"),softParticles:o().optional().describe("Enable soft particle depth fading"),softFarFade:e().optional().describe("Far fade distance for soft particles"),softNearFade:e().optional().describe("Near fade distance for soft particles"),material:_.describe("Particle material settings")}).describe("Particle system configuration");export{Y as BehaviorSchema,m as ColorGeneratorSchema,G as EmitterShapeSchema,ne as ParticlesDescriptorSchema,X as RenderModeSchema,r as ValueGeneratorSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const u=()=>globalThis.performance?.now()??Date.now();function O(f,h){return f.length===0?0:f[Math.min(f.length-1,Math.floor((f.length-1)*h))]??0}function $(f=!1){const h=new Set,i=[],M=new Map,S=new Map,b=new Map;let P=[],C=[],s=f,m=!1,c=!1,I=0,p=0,g=0;const v=[];let w=0,y=0,l={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},x={enabled:s,recording:c,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:l};function d(){const e=i.at(-1),r=i.slice();let a;const o=t=>(a??=r.map(n=>n.intervalMs).filter(n=>n>0).sort((n,F)=>n-F),O(a,t));x={enabled:s,recording:c,fps:e?.intervalMs?1e3/e.intervalMs:0,cpuMs:e?.cpuMs??0,get p95Ms(){return o(.95)},get p99Ms(){return o(.99)},frames:r,phases:e?.phases??[],systems:[...S].map(([t,n])=>({name:t,ms:n})).sort((t,n)=>n.ms-t.ms),components:[...b].map(([t,n])=>({name:t,ms:n})).sort((t,n)=>n.ms-t.ms),render:l};for(const t of h)t()}return{get enabled(){return s},set enabled(e){s!==e&&(s=e,e&&!m&&(g=0),d())},get telemetryEnabled(){return m},set telemetryEnabled(e){if(m===e)return;const r=!s&&!m;m=e,e&&r&&(g=0),d()},get recording(){return c},startRecording(){const e=!s&&!m;s=!0,e&&(g=0),c=!0,i.length=0,d()},stopRecording(){c=!1,d()},clear(){i.length=0,d()},beginFrame(){!s&&!m||(M.clear(),S.clear(),b.clear(),P=[],C=[],v.length=0,l={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},p=u())},beginPhase(){s&&v.push(u())},endPhase(e){if(!s)return;const r=v.pop()??p,a=u()-r,o=M.get(e);M.set(e,{ms:(o?.ms??0)+a,startMs:o?.startMs??r-p}),c&&performance.measure(`
|
|
1
|
+
const u=()=>globalThis.performance?.now()??Date.now();function O(f,h){return f.length===0?0:f[Math.min(f.length-1,Math.floor((f.length-1)*h))]??0}function $(f=!1){const h=new Set,i=[],M=new Map,S=new Map,b=new Map;let P=[],C=[],s=f,m=!1,c=!1,I=0,p=0,g=0;const v=[];let w=0,y=0,l={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},x={enabled:s,recording:c,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:l};function d(){const e=i.at(-1),r=i.slice();let a;const o=t=>(a??=r.map(n=>n.intervalMs).filter(n=>n>0).sort((n,F)=>n-F),O(a,t));x={enabled:s,recording:c,fps:e?.intervalMs?1e3/e.intervalMs:0,cpuMs:e?.cpuMs??0,get p95Ms(){return o(.95)},get p99Ms(){return o(.99)},frames:r,phases:e?.phases??[],systems:[...S].map(([t,n])=>({name:t,ms:n})).sort((t,n)=>n.ms-t.ms),components:[...b].map(([t,n])=>({name:t,ms:n})).sort((t,n)=>n.ms-t.ms),render:l};for(const t of h)t()}return{get enabled(){return s},set enabled(e){s!==e&&(s=e,e&&!m&&(g=0),d())},get telemetryEnabled(){return m},set telemetryEnabled(e){if(m===e)return;const r=!s&&!m;m=e,e&&r&&(g=0),d()},get recording(){return c},startRecording(){const e=!s&&!m;s=!0,e&&(g=0),c=!0,i.length=0,d()},stopRecording(){c=!1,d()},clear(){i.length=0,d()},beginFrame(){!s&&!m||(M.clear(),S.clear(),b.clear(),P=[],C=[],v.length=0,l={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},p=u())},beginPhase(){s&&v.push(u())},endPhase(e){if(!s)return;const r=v.pop()??p,a=u()-r,o=M.get(e);M.set(e,{ms:(o?.ms??0)+a,startMs:o?.startMs??r-p}),c&&performance.measure(`volter.phase.${e}`,{start:r,duration:a})},systemObserver:{beginSystem(){s&&(w=u())},endSystem(e,r,a){if(!s)return;const o=u(),t=`${e} / ${r} / ${a}`;S.set(t,(S.get(t)??0)+o-w),P.push({name:t,phase:r,startMs:w-p,ms:o-w})}},beginComponent(){c&&(y=u())},endComponent(e,r=""){if(!c)return;const a=u();b.set(e,(b.get(e)??0)+a-y),C.push({name:e,phase:r,startMs:y-p,ms:a-y})},reportRender(e){s&&(l={gpuMs:e.gpuMs??l.gpuMs,drawCalls:l.drawCalls+e.drawCalls,triangles:l.triangles+e.triangles,geometries:l.geometries+e.geometries,textures:l.textures+e.textures,renderPasses:e.renderPasses===void 0?l.renderPasses:(l.renderPasses??0)+e.renderPasses})},endFrame(){if(!s&&!m)return;const e=u(),r=g===0?0:p-g;g=p;const a={id:++I,timestamp:e,intervalMs:r,cpuMs:e-p,phases:[...M].map(([o,{ms:t,startMs:n}])=>({name:o,ms:t,startMs:n})).sort((o,t)=>t.ms-o.ms),systems:P.slice(),components:C.slice(),render:{...l}};i.push(a),i.length>600&&i.splice(0,i.length-600),c&&performance.measure("volter.frame",{start:p,duration:a.cpuMs}),d()},subscribe(e){return h.add(e),()=>{h.delete(e)}},getSnapshot(){return x},exportJSON(){return JSON.stringify({version:2,capturedAt:new Date().toISOString(),frames:i},null,2)}}}export{$ as c};
|