@volter/game-editor 0.5.108 → 0.5.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2173 -2173
  5. package/dist/assets/{AssetBudgetPanel-QorQ6jVY.js → AssetBudgetPanel-CA5WnTKY.js} +3 -3
  6. package/dist/assets/{AudioViewer-Bg1U_na-.js → AudioViewer-D9bHbFfE.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-DdK4TlZF.js → CanvasBoardDocument-C-Rmqno1.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-PImZsSzn.js → CanvasSceneViewport-GPeqRbJF.js} +1 -1
  9. package/dist/assets/{ColorInput-DlZ-RUhX.js → ColorInput-LOPjrHkP.js} +1 -1
  10. package/dist/assets/{ColorPicker-DDjV94Br.js → ColorPicker-CshnU6f7.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-BXWWtzBN.js → EntityModelDocument-Dlp-8g7D.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-C8X9deOy.js → EnvironmentAssetDocument-CgRbt4Jo.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-CcDf30gB.js → GameplaySessionTimeline-E-BE0EU7.js} +1 -1
  14. package/dist/assets/{ImageViewer-DQkqjiV8.js → ImageViewer-DLZttZzB.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-bpSm22I-.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-DGbEShUJ.js → JsonAssetDocument-DIecsd7l.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-CSQEuhox.js → LiveModuleDocument-BOR_N7Na.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-BXW8a6qT.js → LutAssetDocument-Rvj1GVIa.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-CHYL9aG2.js → ModelAssetDocument-l9npox50.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-Bcr-edIN.js → NonThreeAuthoringBootstrap-BSPTW9LM.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-DNxMGImP.js → Object3DDocumentToolbar-DY8a0Occ.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-C7LPv0rT.js +2 -0
  23. package/dist/assets/{Object3DPreview-DnfvoJIJ.js → Object3DPreview-F5H47D4e.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-DuZPhT-L.js → OnlineAssetDetail-DHbh9BHq.js} +1 -1
  25. package/dist/assets/{PlayBar-DCrB4B1r.js → PlayBar-Cp3N-KCf.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-DVun-iiS.js → QuarksAssetDocument-CJ55waf3.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-C6miAF3y.js → ReactCanvasControls-BZIKnBe_.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-Cj_42uH4.js → RootSelectionOverlay-DbREUgIb.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-CLNw98jZ.js → ShaderAssetDocument-C0I3j_bn.js} +1 -1
  30. package/dist/assets/{ShadowEditor-9nnKpjO2.js → ShadowEditor-DQJHrmnw.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-L-bCy9Ex.js → SourceAssetViewer-GaiKwcan.js} +1 -1
  32. package/dist/assets/{StageHost-BStYoTUX.js → StageHost-DooxiRtf.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-BtSW2Lb5.js → StoryPreviewMount-Dn5LTh6d.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-DVZufDXd.js → ThreeBoardDocument-BSveW9kd.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-CA1FHe5l.js → ThreeIsolationSceneContent-VRHOzKbZ.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-BIKclI4p.js → ToolObject3DPreview-bl5ZiSTf.js} +1 -1
  37. package/dist/assets/{Toolbar-BOhrx3BY.js → Toolbar-BthqVrvk.js} +1 -1
  38. package/dist/assets/{TransientHint-BzXrECrw.js → TransientHint-BfLO2bn2.js} +1 -1
  39. package/dist/assets/{VideoViewer-BePNvCo8.js → VideoViewer-CfMklFgO.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-DieQf7SR.js → ViewportShadingMenu-BwML2aq7.js} +1 -1
  41. package/dist/assets/{active-ingest-P-9N-lwD.js → active-ingest-CjTOfvPo.js} +2 -2
  42. package/dist/assets/{animation-clock-DdHfE1_8.js → animation-clock-dqOcJ1jx.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-ChGxps0c.js → animation-mixers.service-Cyr-o0Ys.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-CXN1efiJ.js → animation-timeline.utility-BVVP_uKf.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-LVDzBtTs.js → asset-budget-asset.menu-BBvMPohD.js} +1 -1
  46. package/dist/assets/{asset-budget.action-ChAMAMG2.js → asset-budget.action-C_vm5rI8.js} +1 -1
  47. package/dist/assets/{asset-budget.document-DtKHPjSg.js → asset-budget.document-O0KxG1Xs.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-BVJarp8S.js → asset-budget.menu-DoTOigvn.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-CF8bStFQ.js → asset-editor-persistence-BDtXtYHv.js} +1 -1
  50. package/dist/assets/{asset-loaders-ByDJsV0c.js → asset-loaders-oyqCjokK.js} +1 -1
  51. package/dist/assets/{asset-preview-D_mr_kfU.js → asset-preview-DeoFAm2V.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-CkM-XBlF.js → audio-unlock.service-p06da4Yi.js} +1 -1
  53. package/dist/assets/{audio.utility-YcoHxrkp.js → audio.utility-ChNs1GrX.js} +1 -1
  54. package/dist/assets/autoplay.service-CaAzAiui.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-s9kkPTGQ.js → babylon-authoring-adapter-DitAm5jy.js} +1 -1
  56. package/dist/assets/{binding-resolver-DWeB_XxW.js → binding-resolver-DmISbZ_C.js} +2 -2
  57. package/dist/assets/{blender-emscripten-engine-RAyyfT0y.js → blender-emscripten-engine-DrQ7iKAw.js} +1 -1
  58. package/dist/assets/{blender-node-editor.document-9XIWHDtH.js → blender-node-editor.document-CjFrwIsm.js} +1 -1
  59. package/dist/assets/{blender-properties-tab-B0_Lk021.js → blender-properties-tab-DPfPDJEM.js} +1 -1
  60. package/dist/assets/{blender-runtime-host-DqdHNsyo.js → blender-runtime-host-ujsU3CHo.js} +3 -3
  61. package/dist/assets/{blender-runtime-skin-DKFIhKDc.js → blender-runtime-skin-CwUNCSeX.js} +32 -32
  62. package/dist/assets/{blender-runtime.document-BF7bxi3H.js → blender-runtime.document-DSE6A3hU.js} +1 -1
  63. package/dist/assets/{blender-screenshot.menu-BmIsjB0h.js → blender-screenshot.menu-CGpBxeEq.js} +1 -1
  64. package/dist/assets/{blender-timeline.document-C1kk6l2T.js → blender-timeline.document-BW8pAn48.js} +1 -1
  65. package/dist/assets/{blender-uv-editor.document-P3S825_B.js → blender-uv-editor.document-AVdfD3lL.js} +1 -1
  66. package/dist/assets/{blender-version.status-UlsMYg5E.js → blender-version.status-5pbhDXPd.js} +1 -1
  67. package/dist/assets/{blender-wali-engine-NtBfKpqX.js → blender-wali-engine-DRlkIoxZ.js} +1 -1
  68. package/dist/assets/{blender.command-mif4R2hu.js → blender.command-Tiwc3_Hq.js} +1 -1
  69. package/dist/assets/{board-guides-D-8XTzQj.js → board-guides-siB7DLLo.js} +1 -1
  70. package/dist/assets/{bridge.command-BvcgwKBU.js → bridge.command-Bwvk9KTP.js} +3 -3
  71. package/dist/assets/{browserAll-BJifDlVb.js → browserAll-DatQc6Hg.js} +1 -1
  72. package/dist/assets/{build-player.document-WVBd9FAb.js → build-player.document-5galC35i.js} +1 -1
  73. package/dist/assets/{build-profiles.document-DZq1dZAc.js → build-profiles.document-BtgtKY3e.js} +1 -1
  74. package/dist/assets/{build-progress.status-Cb3NQY_h.js → build-progress.status-CELO9Hk6.js} +1 -1
  75. package/dist/assets/{build-session-ZAJtZEPd.js → build-session-CmSSnwbl.js} +1 -1
  76. package/dist/assets/{build.action-Dkd49KI3.js → build.action-DtWKh5ZO.js} +1 -1
  77. package/dist/assets/{build.command-DcyjEAeB.js → build.command-CPSdPV-6.js} +1 -1
  78. package/dist/assets/{build.header-BBi3L1EG.js → build.header-B_esAQuh.js} +1 -1
  79. package/dist/assets/{build.menu-CrFuKfdU.js → build.menu-Bl9QiO1i.js} +1 -1
  80. package/dist/assets/{build.service-B1DOzaYx.js → build.service-3C_qeoGz.js} +1 -1
  81. package/dist/assets/{camera-ClX7A1rz.js → camera-CvN4e2Zz.js} +1 -1
  82. package/dist/assets/{camera-runtime.inspector-DadF_6Y0.js → camera-runtime.inspector-DSvOIBHY.js} +1 -1
  83. package/dist/assets/{canvas-design-mount-B3NGn7ab.js → canvas-design-mount-DBtUNmrt.js} +3 -3
  84. package/dist/assets/{canvas-entry-runtime-DRbpmRh6.js → canvas-entry-runtime-C2mS5iAy.js} +2 -2
  85. package/dist/assets/{canvas-preview-frames-CbvLKzk1.js → canvas-preview-frames-ciVf8XNo.js} +1 -1
  86. package/dist/assets/{canvas-story-capture.service-DDdCj7eB.js → canvas-story-capture.service-Be2yHqJ5.js} +2 -2
  87. package/dist/assets/{capability-coverage-D9QD-rt7.js → capability-coverage-C4P-DBKm.js} +1 -1
  88. package/dist/assets/{collaboration-presence-DFgm-wIj.js → collaboration-presence-3cLXKw77.js} +1 -1
  89. package/dist/assets/{collider-CV5alY5b.js → collider-DRQ_g1zi.js} +1 -1
  90. package/dist/assets/{component-board.service-DiRsyVPA.js → component-board.service-BuJB7tbp.js} +2 -2
  91. package/dist/assets/{component-board.service-BhGHT7LO.js → component-board.service-D6bAXKxC.js} +2 -2
  92. package/dist/assets/{component-board.service-L78fhiMe.js → component-board.service-DGzNpMjz.js} +2 -2
  93. package/dist/assets/{component-contracts.service-dOZUydlV.js → component-contracts.service-DdihP393.js} +1 -1
  94. package/dist/assets/{component-instance-root-BNDWrUkC.js → component-instance-root-z47Ib-DX.js} +1 -1
  95. package/dist/assets/{component-verbs.command-yidei2PQ.js → component-verbs.command-DE37VF0z.js} +1 -1
  96. package/dist/assets/{component-verbs.service-BWJS8Kyo.js → component-verbs.service-p8nz1DC6.js} +1 -1
  97. package/dist/assets/{config-rJ9cCMiJ.js → config-CdxEVH0n.js} +2 -2
  98. package/dist/assets/{configurations-cHt-z2BW.js → configurations-3ggfkdh8.js} +1 -1
  99. package/dist/assets/{connection.status-D40TvPgq.js → connection.status-L7HOKlna.js} +1 -1
  100. package/dist/assets/{constraints.inspector-BxnP4zez.js → constraints.inspector-BccsKc10.js} +1 -1
  101. package/dist/assets/{content-bounds-CaZcBNYF.js → content-bounds-BzOnMMA9.js} +1 -1
  102. package/dist/assets/{contract-system-adapters-BeyBY6uU.js → contract-system-adapters-DEkFby0m.js} +1 -1
  103. package/dist/assets/{coverage.service-Bkh7Jqi9.js → coverage.service-Dh3aFjA4.js} +1 -1
  104. package/dist/assets/{create-runtime-DEL8IBsg.js → create-runtime-CIgubwcC.js} +1 -1
  105. package/dist/assets/{curve-BQz9RIaA.js → curve-PXFWOu1h.js} +1 -1
  106. package/dist/assets/{data-asset-BoykURl_.js → data-asset-JCTDHYos.js} +1 -1
  107. package/dist/assets/{data-ref-orpnwauu.js → data-ref-D8GloBWb.js} +1 -1
  108. package/dist/assets/{debug-bridge-DpAIxpxr.js → debug-bridge-Bn0fBpNA.js} +1 -1
  109. package/dist/assets/{debug-registry-DKNGAsE6.js → debug-registry-b9SNCcVT.js} +1 -1
  110. package/dist/assets/{deferred-ingest-play-BYWgrVZN.js → deferred-ingest-play-EBHoQATQ.js} +2 -2
  111. package/dist/assets/{design-time-canvas-mount-B-mtCXNZ.js → design-time-canvas-mount-DOnlywHv.js} +2 -2
  112. package/dist/assets/{design-time-layers-BYVCDUHn.js → design-time-layers-Cqjx6T_b.js} +1 -1
  113. package/dist/assets/{design-time-mount.service-3gMHaUOK.js → design-time-mount.service-51cvhzrM.js} +2 -2
  114. package/dist/assets/{design-time-mount.service-Cp4u6NGI.js → design-time-mount.service-CjHEWF1r.js} +2 -2
  115. package/dist/assets/{design-time-react-mount-Dt5hEtwi.js → design-time-react-mount-C4_WfKCT.js} +1 -1
  116. package/dist/assets/{document-preview-three-C86kLB3l.js → document-preview-three-Dph0qWUe.js} +1 -1
  117. package/dist/assets/{dom-authoring-adapter-DdKF8aGL.js → dom-authoring-adapter-CMXOivlg.js} +1 -1
  118. package/dist/assets/{draco3d-CqrYtM39.js → draco3d-wRpcYGCF.js} +1 -1
  119. package/dist/assets/{edit-mode-audio.service-DastYEVQ.js → edit-mode-audio.service-BON9_pwC.js} +1 -1
  120. package/dist/assets/{edit-mode-authoring-BfHszfD3.js → edit-mode-authoring-DsZ-2V4q.js} +1 -1
  121. package/dist/assets/{edit-mode-networking.service-BZ1cEawB.js → edit-mode-networking.service-B1jvzsUe.js} +1 -1
  122. package/dist/assets/{editor-api-CNRvYvra.js → editor-api-BBBw0rAh.js} +1 -1
  123. package/dist/assets/{editor-layers-D-sKmDua.js → editor-layers-wmPhuj0X.js} +1 -1
  124. package/dist/assets/{editor-shell-store-BMZxpcut.js → editor-shell-store-LRVyeXM-.js} +1 -1
  125. package/dist/assets/{entity-object-Ai-uXVow.js → entity-object-DWKBk3rf.js} +1 -1
  126. package/dist/assets/{extend-BUAqlHkG.js → extend-Hb3YZk-l.js} +1 -1
  127. package/dist/assets/{fork-menu-OuLP7Lau.js → fork-menu-Bz8tnAZP.js} +1 -1
  128. package/dist/assets/{frame-debugger-store-B7kEPPwE.js → frame-debugger-store-XDqmRybm.js} +1 -1
  129. package/dist/assets/{game-contract-seams-DOVpGKKj.js → game-contract-seams-Dq1vGRC1.js} +1 -1
  130. package/dist/assets/{game-css-scope-transform-BKtVEQ73.js → game-css-scope-transform-CE-77RAD.js} +1 -1
  131. package/dist/assets/{game-document.service-BVYI1WcU.js → game-document.service-C4GqAnuP.js} +1 -1
  132. package/dist/assets/{game-eval.command-BcF5uF72.js → game-eval.command-S1AUTAe6.js} +1 -1
  133. package/dist/assets/{game-module-access-D4VyMdFg.js → game-module-access-Cpd1pqcr.js} +1 -1
  134. package/dist/assets/{game-network--h-FxD5b.js → game-network-DcXic1hU.js} +3 -3
  135. package/dist/assets/{gameplay-export-CyvkC-oL.js → gameplay-export-CXYuIXwM.js} +1 -1
  136. package/dist/assets/{gameplay-replay-Cple4DnH.js → gameplay-replay-Bn9Tff0H.js} +1 -1
  137. package/dist/assets/{gameplay.command-B-MHvpFd.js → gameplay.command-B9QmrfQx.js} +1 -1
  138. package/dist/assets/{generation-jobs-YJG2Y7kw.js → generation-jobs-DbXxsaSZ.js} +1 -1
  139. package/dist/assets/{generation.service-CeIwfVH5.js → generation.service-CVz0jrH8.js} +1 -1
  140. package/dist/assets/{generations-BpEvY421.js → generations-BuSgXNmm.js} +1 -1
  141. package/dist/assets/{generations.status-FLkppvzr.js → generations.status-DUr_PjwO.js} +1 -1
  142. package/dist/assets/{hierarchy-marks-CyrGt6dv.js → hierarchy-marks-BjIT-DOf.js} +1 -1
  143. package/dist/assets/{hosted-asset-materialization-BBfrvEh8.js → hosted-asset-materialization-rUtmDeMy.js} +1 -1
  144. package/dist/assets/{index-CG_0jl_O.js → index-BB2JZnar.js} +1 -1
  145. package/dist/assets/{index-DbdVWXvM.js → index-BTzFwm1R.js} +2 -2
  146. package/dist/assets/{index-FuK_gLVP.js → index-BYdQuKKk.js} +7 -7
  147. package/dist/assets/{index-BvlsL2ds.js → index-BsyTLFdL.js} +1 -1
  148. package/dist/assets/{index-NJ73w2W0.js → index-C0gUuD--.js} +1 -1
  149. package/dist/assets/{index-IJBqVun0.js → index-CwHA-Zn2.js} +1 -1
  150. package/dist/assets/{index-D6AmWXbZ.js → index-DPXH0DLI.js} +1 -1
  151. package/dist/assets/{index-CzfiOQG9.js → index-Dv6KjGDu.js} +1 -1
  152. package/dist/assets/{index-DqaGRnl8.js → index-yUo6ZJ1K.js} +1 -1
  153. package/dist/assets/{inference-diagnostics-D771II31.js → inference-diagnostics-DylK1Zco.js} +1 -1
  154. package/dist/assets/{ingest-boot-viewport-DrWIqiaT.js → ingest-boot-viewport-CWPpaeQX.js} +1 -1
  155. package/dist/assets/{ingest-siblings-CJcw40b3.js → ingest-siblings-ChSVCnmP.js} +1 -1
  156. package/dist/assets/{ingest-source-persistence-DWpLWVYc.js → ingest-source-persistence-G4DRJGE8.js} +1 -1
  157. package/dist/assets/{ingest.service-CfI2uUJk.js → ingest.service-0fE22SDc.js} +1 -1
  158. package/dist/assets/{inspect-G9yzBKkf.js → inspect-CazPcKcv.js} +1 -1
  159. package/dist/assets/instances.command-Cff8g0Qu.js +1 -0
  160. package/dist/assets/{json-history-resource-Lm6Gsl0p.js → json-history-resource-D-FoaxLT.js} +1 -1
  161. package/dist/assets/{layered-pick-CmpZSo8j.js → layered-pick-C73ZQGcv.js} +1 -1
  162. package/dist/assets/{light-BsEXvLKm.js → light-xGJK3Wlj.js} +1 -1
  163. package/dist/assets/{live-project-verbs-BPAULlyy.js → live-project-verbs-DYPJ4HjP.js} +1 -1
  164. package/dist/assets/{machine.document-BqYyC7-_.js → machine.document-D3px2bzJ.js} +1 -1
  165. package/dist/assets/{machines.finder-iE0GRJmX.js → machines.finder-BebmWb2J.js} +1 -1
  166. package/dist/assets/{material-CmZk61au.js → material-P9SjD3Ot.js} +1 -1
  167. package/dist/assets/{material-factory-CgKRNyTJ.js → material-factory-DZpGzP1J.js} +1 -1
  168. package/dist/assets/{mesh-CFQNtglF.js → mesh-NhmM6AvO.js} +1 -1
  169. package/dist/assets/{model-asset-sections.service-C9aBbNhg.js → model-asset-sections.service-XoDCR7K7.js} +1 -1
  170. package/dist/assets/{model-inspection-CRXVM5Wz.js → model-inspection-CRQL0kkD.js} +1 -1
  171. package/dist/assets/{model-thumbnail-n5yOZ3A6.js → model-thumbnail-BSBXqm11.js} +1 -1
  172. package/dist/assets/{models.finder-Cv0yUUsA.js → models.finder-CyqMFbNG.js} +1 -1
  173. package/dist/assets/{module-mode-D9wou5Sv.js → module-mode-CrdDk1MO.js} +2 -2
  174. package/dist/assets/{mount-canvas-ingest-root-BQBEy7uJ.js → mount-canvas-ingest-root-CNhapYXw.js} +2 -2
  175. package/dist/assets/{mount-dom-ingest-root-B7TIeWwv.js → mount-dom-ingest-root-fz_nUR-I.js} +2 -2
  176. package/dist/assets/{mount-ingest-root-DLk-bjRI.js → mount-ingest-root-CnOI0tzn.js} +2 -2
  177. package/dist/assets/{mount-manifest-BSC4x0OM.js → mount-manifest-DtOieSVW.js} +1 -1
  178. package/dist/assets/{mount-three-ingest-root-IXJdEORK.js → mount-three-ingest-root-B11KDTlC.js} +1 -1
  179. package/dist/assets/{mounted-authoring-BRUN-BOo.js → mounted-authoring-CqEcYmBB.js} +1 -1
  180. package/dist/assets/{mounted-story-viewport-source-CJ9v75Cz.js → mounted-story-viewport-source-ClFcc8ZE.js} +1 -1
  181. package/dist/assets/{native-debug-module-DCjfoqQ_.js → native-debug-module-xmmPMHBo.js} +1 -1
  182. package/dist/assets/{navigation-B4ScoRYf.js → navigation-B5MSEPQo.js} +1 -1
  183. package/dist/assets/{navmesh.menu-DWzhh3-1.js → navmesh.menu-CjCV-1Zk.js} +1 -1
  184. package/dist/assets/{navmesh.service-DfXqZNTC.js → navmesh.service-DJaVLPIT.js} +1 -1
  185. package/dist/assets/network-observer.service-DX1ZcyzF.js +1 -0
  186. package/dist/assets/{network.utility-BbPILdSn.js → network.utility-CHVTUNSl.js} +1 -1
  187. package/dist/assets/{object3d-document-session-registry-yyskXT42.js → object3d-document-session-registry-RFHXjepL.js} +2 -2
  188. package/dist/assets/{oid-transform-B9wsHs5H.js → oid-transform-DOVsETju.js} +1 -1
  189. package/dist/assets/{particles-DGKxyAuH.js → particles-CcUkRyUm.js} +1 -1
  190. package/dist/assets/{pixi-authoring-adapter-DS-A0P3M.js → pixi-authoring-adapter-CDcz5ySv.js} +1 -1
  191. package/dist/assets/{pixi-live-write-target-BjARuRSW.js → pixi-live-write-target-BjlNk1ws.js} +1 -1
  192. package/dist/assets/{play.command-DCc8asMJ.js → play.command-MX_nXHxk.js} +2 -2
  193. package/dist/assets/{presentation-FoTcsbFF.js → presentation-Dy8F-23e.js} +1 -1
  194. package/dist/assets/{product-CxzQQY-2.js → product-DKcPhhH3.js} +1 -1
  195. package/dist/assets/{profiler.action-smxgfcL_.js → profiler.action-CrVcze1d.js} +1 -1
  196. package/dist/assets/{profiler.menu-CPgp7nBA.js → profiler.menu-BT8Gbk-H.js} +1 -1
  197. package/dist/assets/{profiler.utility-BlJIqjBl.js → profiler.utility-BK7-JszO.js} +1 -1
  198. package/dist/assets/{project-authoring-session-D5Hx87VG.js → project-authoring-session-C7hSaUoI.js} +2 -2
  199. package/dist/assets/{properties-bone-constraints.inspector-Dfagnx_P.js → properties-bone-constraints.inspector-DojLcDWI.js} +1 -1
  200. package/dist/assets/{properties-bone.inspector-CcZ9t3x_.js → properties-bone.inspector-BKtnxYej.js} +1 -1
  201. package/dist/assets/{properties-collection.inspector-XJfAy2LF.js → properties-collection.inspector-CJwK055D.js} +1 -1
  202. package/dist/assets/{properties-constraints.inspector-Duy4wn7B.js → properties-constraints.inspector-BMr_2fNW.js} +1 -1
  203. package/dist/assets/{properties-data.inspector-Dtcc2RcP.js → properties-data.inspector-eP5kPx_x.js} +1 -1
  204. package/dist/assets/{properties-material.inspector-BsmleciZ.js → properties-material.inspector-DzcTJXqu.js} +1 -1
  205. package/dist/assets/{properties-modifiers.inspector-BG6NJU2U.js → properties-modifiers.inspector-BPnJY0K9.js} +1 -1
  206. package/dist/assets/{properties-object.inspector-lIRXMKBd.js → properties-object.inspector-CiU_g5eW.js} +1 -1
  207. package/dist/assets/{properties-output.inspector-DFzeIW2j.js → properties-output.inspector-B7-0cxFB.js} +1 -1
  208. package/dist/assets/{properties-particles.inspector-ClVqIBAW.js → properties-particles.inspector-B_dIFFES.js} +1 -1
  209. package/dist/assets/{properties-physics.inspector-JJK-q6VU.js → properties-physics.inspector-BrZZssu5.js} +1 -1
  210. package/dist/assets/{properties-render.inspector-K0TdbYo2.js → properties-render.inspector-Cr3ILbCE.js} +1 -1
  211. package/dist/assets/{properties-scene.inspector-7LMlqHIJ.js → properties-scene.inspector-CCT-Wwlq.js} +1 -1
  212. package/dist/assets/{properties-texture.inspector-DRcLLne7.js → properties-texture.inspector-BbDSLSIf.js} +1 -1
  213. package/dist/assets/{properties-view-layer.inspector-BLbQJdxQ.js → properties-view-layer.inspector-CMFsWlWn.js} +1 -1
  214. package/dist/assets/{properties-world.inspector-pbOvsUWM.js → properties-world.inspector-QOI3frGi.js} +1 -1
  215. package/dist/assets/{r3f-design-session-DtYg0f6U.js → r3f-design-session-DYcgEMWW.js} +2 -2
  216. package/dist/assets/{r3f-physics-binding-Cy9jQdnd.js → r3f-physics-binding-CmlqQXpO.js} +1 -1
  217. package/dist/assets/{r3f-source-authoring-adapter-CGBlpkG7.js → r3f-source-authoring-adapter-DlK-JsAS.js} +1 -1
  218. package/dist/assets/{react-canvas-navigation-CKXOs-Wq.js → react-canvas-navigation-CcPcwMkG.js} +1 -1
  219. package/dist/assets/{react-inspector.service-CsTte-N1.js → react-inspector.service-CXeQPCph.js} +1 -1
  220. package/dist/assets/{react-story-board-DP8miK58.js → react-story-board-JyxJfFaY.js} +1 -1
  221. package/dist/assets/{react-three-rapier.esm-DNUgm9WI.js → react-three-rapier.esm-CUxniyd-.js} +1 -1
  222. package/dist/assets/{react-world-authoring-adapter-DDSKeNtx.js → react-world-authoring-adapter-D9avM44a.js} +1 -1
  223. package/dist/assets/{realm-services-CIoOWxZe.js → realm-services-D8d7aUSw.js} +1 -1
  224. package/dist/assets/{reflection-probe-capture.inspector-YbluVpTC.js → reflection-probe-capture.inspector-BU0Ixoxz.js} +1 -1
  225. package/dist/assets/{registry-D3NMBnZ_.js → registry-BDw0X1Ht.js} +1 -1
  226. package/dist/assets/{relative-import-specifier-BHYY_mHM.js → relative-import-specifier-BGUMwtft.js} +1 -1
  227. package/dist/assets/{render-env-ufPT6kcg.js → render-env-COdmMCld.js} +1 -1
  228. package/dist/assets/{render-features-Dt3ItOxf.js → render-features-B9DvCMxj.js} +1 -1
  229. package/dist/assets/{render-settings-y6lgf9KB.js → render-settings-BZQKFQ-S.js} +1 -1
  230. package/dist/assets/{resolve-three-DPJIomXU.js → resolve-three-CBuaRQ3h.js} +3 -3
  231. package/dist/assets/{root-seam-contract-DjLE5lpJ.js → root-seam-contract-CnveH2Nm.js} +1 -1
  232. package/dist/assets/{run-selection-DkkDSK2k.js → run-selection-CIf2tl8R.js} +1 -1
  233. package/dist/assets/{scene-capture-B9TCnOqE.js → scene-capture-C58hCZOG.js} +1 -1
  234. package/dist/assets/{scene-document.service-BQ4YJ85A.js → scene-document.service-2jk9EV45.js} +2 -2
  235. package/dist/assets/{scene-framing-Rs5Y89nN.js → scene-framing-C0vuzmLH.js} +1 -1
  236. package/dist/assets/{seeded-random-DMenDilU.js → seeded-random-C4zhXjCn.js} +1 -1
  237. package/dist/assets/{session-D32o2Hbx.js → session-BfHWkUIf.js} +81 -1
  238. package/dist/assets/{setup-renderer-FNGzSUCJ.js → setup-renderer-B5wilQJH.js} +1 -1
  239. package/dist/assets/{source-object3d-authoring-adapter-Ckfk03in.js → source-object3d-authoring-adapter-PbUdA5Q2.js} +1 -1
  240. package/dist/assets/{source-persistence-backend-D2wE734G.js → source-persistence-backend-Sj6uuBrM.js} +1 -1
  241. package/dist/assets/{stage-keyboard-BnGgOfba.js → stage-keyboard-9ZzYQNd5.js} +1 -1
  242. package/dist/assets/{stage-overlay-set-Cy_kPcLc.js → stage-overlay-set-CguBU7J4.js} +1 -1
  243. package/dist/assets/{stage-presence-markers-DkQfTXSi.js → stage-presence-markers-DXjy7DL7.js} +1 -1
  244. package/dist/assets/{stage-transform-tools-Z4MP8ho5.js → stage-transform-tools-DiblXG_Z.js} +1 -1
  245. package/dist/assets/{standard-viewport-dressing-wQb-yfhP.js → standard-viewport-dressing-DpCqZowy.js} +1 -1
  246. package/dist/assets/{state-watch.action-C1Sr4Sig.js → state-watch.action-Ct5Wy0zu.js} +1 -1
  247. package/dist/assets/{state-watch.menu-izjaH3rb.js → state-watch.menu-Bf6HJvqy.js} +1 -1
  248. package/dist/assets/{state-watch.utility-DkKZOOWC.js → state-watch.utility-efli4QQe.js} +1 -1
  249. package/dist/assets/{story-capture-DoBmQaJy.js → story-capture-DAzlViX7.js} +1 -1
  250. package/dist/assets/{story-documents-BzadiI5m.js → story-documents-BYIxqRcJ.js} +1 -1
  251. package/dist/assets/{story-documents.service-ClHoqS_S.js → story-documents.service-B7jaECxU.js} +1 -1
  252. package/dist/assets/{story-documents.service-B2XyP9fa.js → story-documents.service-BAoQMTa4.js} +1 -1
  253. package/dist/assets/{story-media-presence-BQezZJvw.js → story-media-presence-B0ccG2oZ.js} +1 -1
  254. package/dist/assets/{story-pixi-preview-CvSUXb1O.js → story-pixi-preview-qNGRD1RG.js} +1 -1
  255. package/dist/assets/{story-presentation-BFgjqHVE.js → story-presentation-B85RFwXM.js} +1 -1
  256. package/dist/assets/{story-three-preview-EJG3Ki2M.js → story-three-preview-C-kpIz3s.js} +2 -2
  257. package/dist/assets/{studio-environment-Bj3Hi-UK.js → studio-environment-BXrrTMN4.js} +1 -1
  258. package/dist/assets/{surface-state-BfErS6v0.js → surface-state-D9U0kgz0.js} +1 -1
  259. package/dist/assets/{syntactic-prop-specs-BD-AJdiW.js → syntactic-prop-specs-Ca4XG7zz.js} +1 -1
  260. package/dist/assets/{team-playtest.service-BHn-MVSU.js → team-playtest.service-BVasG50-.js} +1 -1
  261. package/dist/assets/{three-CQVC3sHg.js → three-D4bun8tv.js} +1 -1
  262. package/dist/assets/{three-authoring-adapter-C5QXFs1Q.js → three-authoring-adapter-VpfMe64G.js} +1 -1
  263. package/dist/assets/three-authoring.service-Dgj0R5Mm.js +2 -0
  264. package/dist/assets/{three-ingest-runtime-ClA0ZFjY.js → three-ingest-runtime-DI_J7mdv.js} +1 -1
  265. package/dist/assets/{three-integration-UeCSuDl8.js → three-integration-BzTWd5jX.js} +2 -2
  266. package/dist/assets/three-integration.service-CHDRTJ4I.js +1 -0
  267. package/dist/assets/{three-projection-core-Ckpx-u5r.js → three-projection-core-DTAhpWX4.js} +1 -1
  268. package/dist/assets/{three-state-DNgFvLbw.js → three-state-ctKrzvps.js} +1 -1
  269. package/dist/assets/{three-story-capture.service-Bh4T4UDu.js → three-story-capture.service-9OfuwiWo.js} +2 -2
  270. package/dist/assets/{three-story-model-z5ueli9r.js → three-story-model-UEeiGz1i.js} +1 -1
  271. package/dist/assets/{three-viewport-presentation-5KZ0zq__.js → three-viewport-presentation-Zf87KDhY.js} +1 -1
  272. package/dist/assets/{transform-mode-request-B6ZoHm8Z.js → transform-mode-request-D9k3BUHW.js} +1 -1
  273. package/dist/assets/{transport-strip-B6uA0CS2.js → transport-strip-CwOW82Og.js} +1 -1
  274. package/dist/assets/transport.header-B4EdCaSb.js +1 -0
  275. package/dist/assets/{tuples-9hzaeddD.js → tuples-B8Z8h1FP.js} +1 -1
  276. package/dist/assets/{ui-board-document-CZR37-MH.js → ui-board-document-B7_C_NlR.js} +2 -2
  277. package/dist/assets/{user-data-thHakLdm.js → user-data-CJW19F-2.js} +1 -1
  278. package/dist/assets/{utility-view-state-mgk7IW1_.js → utility-view-state-D_vE7sm3.js} +1 -1
  279. package/dist/assets/{viewport-door-BfcEF1aj.js → viewport-door-BW0xEXr5.js} +1 -1
  280. package/dist/assets/{viewport-root-presentation-BPc-lH1E.js → viewport-root-presentation-Cy219iw-.js} +1 -1
  281. package/dist/assets/{viewport-surface-status-B-dxhyXW.js → viewport-surface-status-CO8m-4fj.js} +1 -1
  282. package/dist/assets/{webworkerAll-M6nIvbjt.js → webworkerAll-DXnaOz71.js} +1 -1
  283. package/dist/assets/worker-CIByxsbl.js +2 -0
  284. package/dist/assets/{workspace-arrangement-avVz3tND.js → workspace-arrangement-DwFkSdlq.js} +1 -1
  285. package/dist/assets/{world-documents-tYDBGv-F.js → world-documents-DXzZtfR9.js} +1 -1
  286. package/dist/assets/{world-root-stage-binding-5pbD7Ije.js → world-root-stage-binding-C7HH_DuY.js} +1 -1
  287. package/dist/assets/{xstate-animation-binding-Cvl5K9w5.js → xstate-animation-binding-DMnWdBYa.js} +1 -1
  288. package/dist/assets/{xstate-animation-meta-y4vMVZGC.js → xstate-animation-meta-DzRq8jno.js} +1 -1
  289. package/dist-node/cli.js +16 -16
  290. package/package.json +16 -16
  291. package/dist/assets/InspectorObjectPreview-DaEwQeSD.js +0 -1
  292. package/dist/assets/Object3DDocumentViewport-DBReT61I.js +0 -2
  293. package/dist/assets/autoplay.service-D4JLEyog.js +0 -1
  294. package/dist/assets/instances.command-aJdpUuvP.js +0 -1
  295. package/dist/assets/network-observer.service-HeuDmPJy.js +0 -1
  296. package/dist/assets/three-authoring.service-Cns4jd_9.js +0 -2
  297. package/dist/assets/three-integration.service-CLAsbasx.js +0 -1
  298. package/dist/assets/transport.header-CHCQGfOl.js +0 -1
  299. package/dist/assets/worker-Gb6BRf7P.js +0 -2
@@ -143,6 +143,25 @@ REPLY = os.path.join(ROOT, "reply")
143
143
  # (\`blender-wali-engine.mts\`), where the file is not a fallback but the
144
144
  # native door onto the same bytes.
145
145
  EXPORT_BUFFER_PATH = os.environ.get("VOLTER_EXPORT_BUFFER_PATH", "")
146
+
147
+ # WHERE THE ENGINE'S HEAP WENT, stage by stage: the heap only grows, so its size after a stage says
148
+ # nothing about the stage before it; this records \`_blender_web.memory()\` at each, in MB
149
+ # ([label, heap, mallocInUse, mallocFree, guarded, guardedPeak]), and a script reads \`MEMORY_MARKS\`
150
+ # (the last 64) to say which stage raised the high-water mark. MEASURED 2026-09-29 on the
151
+ # Stoneguard file: the first export's door call took the heap from 1,442 to 3,644 MB while in-use
152
+ # rose 28 MB and the guarded peak did not move -- OpenSubdiv's limit-surface evaluator for one
153
+ # head (quality 3), which native Blender pays too (+1.2 GB peak RSS there).
154
+ MEMORY_MARKS = []
155
+
156
+
157
+ def _mark(label):
158
+ try:
159
+ reading = _blender_web.memory()
160
+ except Exception: # noqa: BLE001 -- an engine without the door records nothing
161
+ return
162
+ MEMORY_MARKS.append([label] + [round(reading.get(key, 0) / 1048576)
163
+ for key in ("heap", "mallocInUse", "mallocFree", "guarded", "guardedPeak")])
164
+ del MEMORY_MARKS[:-64]
146
165
  _real_stderr = sys.stderr
147
166
 
148
167
 
@@ -1358,6 +1377,7 @@ class Session:
1358
1377
  """
1359
1378
  scene = bpy.context.scene
1360
1379
  graphs = material_graphs(scene)
1380
+ _mark("export:graphs")
1361
1381
  # An IMAGE EMPTY's picture travels with the graphs' images: the overlay draws it
1362
1382
  # (\`overlay_empty.hh\` \`image_sync\`).
1363
1383
  empty_images = {obj.data.name for obj in scene.objects
@@ -1378,7 +1398,13 @@ class Session:
1378
1398
  # An engine without the pull door ships them all in this call, as before.
1379
1399
  if hasattr(_blender_web, "export_mesh"):
1380
1400
  options["defer"] = True
1381
- frame = json.loads(_blender_web.export_frame(json.dumps(options)))
1401
+ if hasattr(_blender_web, "memory_reset_peak"):
1402
+ _blender_web.memory_reset_peak()
1403
+ exported = _blender_web.export_frame(json.dumps(options))
1404
+ _mark("export:door")
1405
+ frame = json.loads(exported)
1406
+ del exported
1407
+ _mark("export:parsed")
1382
1408
  error = frame.get("error")
1383
1409
  if error:
1384
1410
  raise RuntimeError("Blender export door: %s" % error)
@@ -1507,8 +1533,11 @@ class Session:
1507
1533
 
1508
1534
  def _present(self, capture=None):
1509
1535
  known = dict(self._known)
1536
+ _mark("present:before")
1510
1537
  frame = self._export()
1538
+ _mark("present:exported")
1511
1539
  pulled = self._pull(frame)
1540
+ _mark("present:pulled")
1512
1541
  self._drop_unreachable_textures(frame)
1513
1542
  # WHAT THIS FRAME SHIPPED, for the session's own accounting: the ids
1514
1543
  # whose columns crossed, and the ids that went as a reference. The
@@ -1587,6 +1616,8 @@ class Session:
1587
1616
  for kind, keys, door in (("mesh", meshes, _blender_web.export_mesh),
1588
1617
  ("image", images, _blender_web.export_image)):
1589
1618
  for key in keys:
1619
+ if kind == "image" and self._send_encoded_image(key, frame["images"][key]):
1620
+ continue
1590
1621
  options["key"] = key
1591
1622
  piece = json.loads(door(json.dumps(options)))
1592
1623
  if piece.get("error"):
@@ -1598,6 +1629,53 @@ class Session:
1598
1629
  ask({kind: key, "piece": piece[kind]})
1599
1630
  return True
1600
1631
 
1632
+ def _send_encoded_image(self, key, deferred):
1633
+ """A PICTURE AS ITS FILE'S OWN BYTES, when that is exactly what the frame would carry.
1634
+
1635
+ A modelling program keeps a picture compressed as its file and lets the GPU hold the
1636
+ decoded texture; only this side's raster door decoded every picture into RGBA and shipped
1637
+ that. MEASURED 2026-09-29 on the Stoneguard bridge: its 84 material pictures are 171 MB as
1638
+ their packed files and 1,343 MB as RGBA, and the hosted tab's renderer passed 10 GB while
1639
+ it opened. So a picture whose texels ARE its file -- a plain file or packed PNG or JPEG,
1640
+ not edited in this session -- is written to the engine's filesystem as those bytes and
1641
+ crosses as they are (\`worker.ts\`), decoded by the browser. The rest keep the raster door:
1642
+ a key with \`@\` (a roughness remap bakes new texels), a picture painted here (\`is_dirty\`),
1643
+ a UDIM or generated one, or bytes neither decoder reads.
1644
+
1645
+ Answers whether it was sent."""
1646
+ if "@" in key:
1647
+ return False
1648
+ image = bpy.data.images.get(key)
1649
+ if image is None or image.source != "FILE" or image.is_dirty:
1650
+ return False
1651
+ try:
1652
+ if image.packed_file is not None:
1653
+ data = bytes(image.packed_file.data)
1654
+ else:
1655
+ with open(bpy.path.abspath(image.filepath), "rb") as fh:
1656
+ data = fh.read()
1657
+ except (OSError, TypeError, ValueError):
1658
+ return False
1659
+ if data[:8] == b"\\x89PNG\\r\\n\\x1a\\n":
1660
+ mime = "image/png"
1661
+ elif data[:3] == b"\\xff\\xd8\\xff":
1662
+ mime = "image/jpeg"
1663
+ else:
1664
+ return False
1665
+ path = os.path.join(ROOT, "encoded-image.bin")
1666
+ with open(path, "wb") as fh:
1667
+ fh.write(data)
1668
+ try:
1669
+ ask({"image": key, "piece": {
1670
+ "revision": deferred["revision"],
1671
+ "mime": mime,
1672
+ "colorspace": "sRGB" if image.colorspace_settings.name == "sRGB" else "data",
1673
+ "encodedPath": path,
1674
+ }})
1675
+ finally:
1676
+ os.remove(path)
1677
+ return True
1678
+
1601
1679
  def _drop_unreachable_textures(self, frame):
1602
1680
  """A picture the export could not read is a WARNING, not a refusal.
1603
1681
 
@@ -1767,7 +1845,9 @@ class Session:
1767
1845
  self.document = os.path.join(self.project, relative_path)
1768
1846
  if not os.path.exists(self.document):
1769
1847
  return {"document": relative_path, "opened": False}
1848
+ _mark("open:before")
1770
1849
  bpy.ops.wm.open_mainfile(filepath=self.document)
1850
+ _mark("open:after")
1771
1851
  size = os.path.getsize(self.document)
1772
1852
  # THE STAGED COPY GOES ONCE BLENDER HAS READ IT. It sits in the engine's heap (WasmFS keeps
1773
1853
  # file data in linear memory) and nothing reads it again: the load took everything into
@@ -1,4 +1,4 @@
1
- import{S as O,a as q,W as st}from"./three.module-BLhyNg0e.js";import{Pass as H,Effect as ue,Selection as ot,RenderPass as re,NormalPass as We,EffectPass as nt,SMAAPreset as ie,SMAAEffect as lt,SSAOEffect as ct,BloomEffect as ut,DepthOfFieldEffect as ft,TiltShiftEffect as dt,GodRaysEffect as ht,OutlineEffect as pt,ChromaticAberrationEffect as mt,LensDistortionEffect as vt,ShockWaveEffect as gt,BrightnessContrastEffect as xt,HueSaturationEffect as Tt,SepiaEffect as St,ColorDepthEffect as bt,NoiseEffect as Dt,ScanlineEffect as yt,DotScreenEffect as wt,GridEffect as Mt,PixelationEffect as Pt,GlitchEffect as Rt,VignetteEffect as Ct}from"./index-DHhMOs_s.js";import{_ as N,cm as h,em as C,fx as z,dw as B,c1 as x,bi as V,au as J,cO as fe,ed as j,cE as b,fd as m,e8 as pe,b0 as E,aC as Te,fj as Nt,fo as U,co as Qe,d5 as Lt,N as It,ex as zt,M as Ce,du as Et,d9 as Ke,ff as Ye,b3 as At,fb as u,cP as Xe,ej as Ge,c3 as ce,eX as Se,b9 as _,fe as se,cl as Ze,eW as Ft,cN as ne,Y as Ne,aT as Ut,dv as me,C as Vt,cq as Bt,eU as Ot,Z as jt,dp as kt,ew as Ht,B as Wt,e as Qt,A as be,W as Kt,ea as Yt,c8 as Xt,d7 as Gt,df as Zt}from"./three.core-3arARmh6.js";import{DEFAULTS as ae}from"./defaults-DKiBJCPN.js";import{detectKtx2Support as qt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as De}from"./render-settings-y6lgf9KB.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-Dt3ItOxf.js";import"./index-FuK_gLVP.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";class Jt extends It{boundingSphere=new zt;constructor(){super(),this.setAttribute("position",new Ce(new Float32Array([-1,-1,3,-1,-1,3]),2)),this.setAttribute("uv",new Ce(new Float32Array([0,0,2,0,0,2]),2))}computeBoundingSphere(){}}const _t=new Jt,$t=new Lt;class W{constructor(e){this._mesh=new Qe(_t,e),this._mesh.frustumCulled=!1}render(e){e.render(this._mesh,$t)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}dispose(){this._mesh.material.dispose(),this._mesh.geometry.dispose()}}const ei={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},sceneNormal:{value:null},projMat:{value:new h},viewMat:{value:new h},projViewMat:{value:new h},projectionMatrixInv:{value:new h},viewMatrixInv:{value:new h},cameraPos:{value:new U},resolution:{value:new m},biasAdjustment:{value:new m},time:{value:0},samples:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},ortho:{value:!1},screenSpaceRadius:{value:!1},frame:{value:0}},depthWrite:!1,depthTest:!1,vertexShader:`
1
+ import{S as O,a as q,W as st}from"./three.module-BLhyNg0e.js";import{Pass as H,Effect as ue,Selection as ot,RenderPass as re,NormalPass as We,EffectPass as nt,SMAAPreset as ie,SMAAEffect as lt,SSAOEffect as ct,BloomEffect as ut,DepthOfFieldEffect as ft,TiltShiftEffect as dt,GodRaysEffect as ht,OutlineEffect as pt,ChromaticAberrationEffect as mt,LensDistortionEffect as vt,ShockWaveEffect as gt,BrightnessContrastEffect as xt,HueSaturationEffect as Tt,SepiaEffect as St,ColorDepthEffect as bt,NoiseEffect as Dt,ScanlineEffect as yt,DotScreenEffect as wt,GridEffect as Mt,PixelationEffect as Pt,GlitchEffect as Rt,VignetteEffect as Ct}from"./index-DHhMOs_s.js";import{_ as N,cm as h,em as C,fx as z,dw as B,c1 as x,bi as V,au as J,cO as fe,ed as j,cE as b,fd as m,e8 as pe,b0 as E,aC as Te,fj as Nt,fo as U,co as Qe,d5 as Lt,N as It,ex as zt,M as Ce,du as Et,d9 as Ke,ff as Ye,b3 as At,fb as u,cP as Xe,ej as Ge,c3 as ce,eX as Se,b9 as _,fe as se,cl as Ze,eW as Ft,cN as ne,Y as Ne,aT as Ut,dv as me,C as Vt,cq as Bt,eU as Ot,Z as jt,dp as kt,ew as Ht,B as Wt,e as Qt,A as be,W as Kt,ea as Yt,c8 as Xt,d7 as Gt,df as Zt}from"./three.core-3arARmh6.js";import{DEFAULTS as ae}from"./defaults-DKiBJCPN.js";import{detectKtx2Support as qt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as De}from"./render-settings-BZQKFQ-S.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-B9DvCMxj.js";import"./index-BYdQuKKk.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";class Jt extends It{boundingSphere=new zt;constructor(){super(),this.setAttribute("position",new Ce(new Float32Array([-1,-1,3,-1,-1,3]),2)),this.setAttribute("uv",new Ce(new Float32Array([0,0,2,0,0,2]),2))}computeBoundingSphere(){}}const _t=new Jt,$t=new Lt;class W{constructor(e){this._mesh=new Qe(_t,e),this._mesh.frustumCulled=!1}render(e){e.render(this._mesh,$t)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}dispose(){this._mesh.material.dispose(),this._mesh.geometry.dispose()}}const ei={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},sceneNormal:{value:null},projMat:{value:new h},viewMat:{value:new h},projViewMat:{value:new h},projectionMatrixInv:{value:new h},viewMatrixInv:{value:new h},cameraPos:{value:new U},resolution:{value:new m},biasAdjustment:{value:new m},time:{value:0},samples:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},ortho:{value:!1},screenSpaceRadius:{value:!1},frame:{value:0}},depthWrite:!1,depthTest:!1,vertexShader:`
2
2
  varying vec2 vUv;
3
3
  void main() {
4
4
  vUv = uv;
@@ -1 +1 @@
1
- import{isEditorOwnedObject as f}from"./editor-layers-D-sKmDua.js";import{T as y,d as b,o as a}from"./three-CQVC3sHg.js";import{g}from"./user-data-thHakLdm.js";import{i as S,a as v,c as I}from"./model-inspection-CRXVM5Wz.js";import{C as j,S as w,r as R}from"./three-projection-core-Ckpx-u5r.js";const u=new WeakMap;function E(d){let t=!1;if(d.traverse(s=>{g(s,"gaussianSplat")&&(t=!0)}),t)return"Gaussian splat";const r=S(d),e=v(d);return{static:"Static model",animated:"Animated model",rigged:"Rigged model",skinned:"Skinned model"}[I(r,e)]}function h(d){const t=d.material;return Array.isArray(t)?t[0]??null:t??null}function l(d){return d?.color??null}class p{constructor(t,r,e){if(this.store=t,this.scene=r,this.options=e,this.provenance=e.provenance??(e.documentKind==="asset"?{source:"document",label:"derived asset",detail:"Loaded from an ordinary project asset. Edit its source or import recipe."}:{source:"source-code",label:"source",detail:"Instantiated from project TypeScript. Edit source or exposed parameters, then rebuild."}),this.documentNodeId=`object3d-document:${e.documentId}`,this.projector=new y(b(e.documentId)),this.indexGraph(),e.hierarchyRoots&&new Set(e.hierarchyRoots).size!==e.hierarchyRoots.length)throw new Error(`Object3D document "${e.title}" declared the same hierarchy root twice.`);const s=new Set(e.hierarchyRoots??[]);for(const o of s){let i=o.parent;for(;i&&i!==r;){if(s.has(i))throw new Error(`Object3D document "${e.title}" declared nested hierarchy roots; roots must be non-overlapping.`);i=i.parent}}this.hierarchyRootIds=e.hierarchyRoots?e.hierarchyRoots.map(o=>{const i=this.idByObject.get(o);if(!i)throw new Error(`Object3D document "${e.title}" declared a hierarchy root outside its native graph.`);return i}):[...this.projector.rootIds],this.view=new j({projector:this.projector,scene:r,documentNodeId:this.documentNodeId,rootIds:this.hierarchyRootIds}),this.selectionState=new w({store:t.shell,owns:o=>this.byId.has(o),initial:[this.documentNodeId],onChange:o=>this.syncMarkedSelection(o)})}documentNodeId;projector;hierarchyRootIds;view;selectionState;markedSelection=new Set;capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance;disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;onStructureChanged=t=>{f(t.child)||this.scheduleStructureReindex()};indexGraph(){this.projector.project(this.scene),this.watchStructure()}watchStructure(){const t=e=>e;for(const e of this.watchedForStructure)t(e).removeEventListener("childadded",this.onStructureChanged),t(e).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const r=e=>{t(e).addEventListener("childadded",this.onStructureChanged),t(e).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(e)};r(this.scene);for(const[,e]of this.byId)r(e)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed||(this.indexGraph(),this.store.scene!==this.scene))return;const t=this.store.objectMap;t.clear();for(const[e,s]of this.byId)t.set(e,s);const r=[...this.store.shell.selectedEntityIds].filter(e=>e===this.documentNodeId||this.byId.has(e));r.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(r),this.store.notifyIngestObjectMapEdit()}))}get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}documentTypeLabel(){if(this.options.documentKind!=="asset")return;const t=this.scene.children.find(s=>this.idByObject.has(s))??null;if(!t)return;const r=u.get(t);if(r!==void 0)return r;const e=E(t);return u.set(t,e),e}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:t=>{if(t===this.documentNodeId){const e=this.documentTypeLabel();return{id:t,label:this.options.title,secondaryLabel:this.options.sourcePath,role:"document",kind:this.options.documentKind==="asset"?"model-asset":"three-source",...e?{typeLabel:e}:{},parentId:null,childIds:this.view.rootIds()}}const r=this.byId.get(t);return r?this.view.node(r):null},object3D:t=>this.byId.get(t)??null,idForObject3D:t=>this.idByObject.get(t)??null};selection={get:()=>this.selectionState.current(),set:t=>this.selectionState.publish(t.filter(r=>r===this.documentNodeId||this.byId.has(r)))};static READ_ONLY_REASON="This document shows what the module builds; its properties are read-only here. Edit the module.";readOnly=()=>({writable:!1,reason:p.READ_ONLY_REASON});transforms={get:t=>R(this.byId.get(t)??null),beginEdit:()=>{},apply:()=>{},endEdit:()=>{}};inspector={properties:t=>{if(t===this.documentNodeId)return this.options.audit===!1?[]:[{path:"name",label:"Name",type:"string",readonly:!0},{path:"source.path",label:"Source",type:"string",readonly:!0}];const r=this.byId.get(t);if(!r)return[];const e=a(r);if(e?.fields)return e.fields().map(({value:n,...m})=>m);const s=[{path:"name",label:"Name",type:"string",readonly:!0},{path:"visible",label:"Visible",type:"boolean",readonly:!0},{path:"object.type",label:"Native type",type:"string",readonly:!0}],o=r;if(o.isMesh&&o.geometry){const n=o.geometry.getAttribute("position");s.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0,group:"Mesh"}),n&&s.push({path:"mesh.triangles",label:"Triangles",type:"number",readonly:!0,group:"Mesh"})}const i=h(r);i&&(s.push({path:"material.type",label:"Material",type:"string",readonly:!0,group:"Material"}),l(i)&&s.push({path:"material.color",label:"Color",type:"color",readonly:!0,group:"Material"}));const c=r;return c.isSkinnedMesh&&c.skeleton&&s.push({path:"skin.bones",label:"Bones",type:"number",readonly:!0,group:"Skin"}),s},get:(t,r)=>{if(t===this.documentNodeId)return r==="name"?this.options.title:r==="source.path"?this.options.sourcePath:void 0;const e=this.byId.get(t);if(!e)return;const o=a(e)?.fields?.().find(n=>n.path===r);if(o)return o.value();if(r==="name")return e.name||e.type;if(r==="visible")return e.visible;if(r==="object.type")return e.type;const i=e;if(r==="mesh.vertices")return i.geometry?.getAttribute("position")?.count??0;if(r==="mesh.triangles"){const n=i.geometry;return(n?.index?.count??n?.getAttribute("position")?.count??0)/3}const c=h(e);if(r==="material.type")return c?.type;if(r==="material.color"){const n=l(c);return n?`#${n.getHexString()}`:void 0}if(r==="skin.bones")return e.skeleton?.bones.length??0},set:()=>{},editability:()=>this.readOnly()};subscribe(t){return this.store.shell.subscribe(t)}get documentId(){return this.documentNodeId}get documentRootObject(){const t=this.hierarchy.node(this.documentNodeId)?.childIds[0];return t?this.byId.get(t)??null:null}syncMarkedSelection(t){const r=new Set(t.map(e=>this.byId.get(e)??null).filter(e=>e!==null).filter(e=>a(e)?.selectionChanged!==void 0));for(const e of this.markedSelection)r.has(e)||a(e)?.selectionChanged?.(!1);for(const e of r)this.markedSelection.has(e)||a(e)?.selectionChanged?.(!0);this.markedSelection=r}}export{p as S};
1
+ import{isEditorOwnedObject as f}from"./editor-layers-wmPhuj0X.js";import{T as y,d as b,o as a}from"./three-D4bun8tv.js";import{g}from"./user-data-CJW19F-2.js";import{i as S,a as v,c as I}from"./model-inspection-CRQL0kkD.js";import{C as j,S as w,r as R}from"./three-projection-core-DTAhpWX4.js";const u=new WeakMap;function E(d){let t=!1;if(d.traverse(s=>{g(s,"gaussianSplat")&&(t=!0)}),t)return"Gaussian splat";const r=S(d),e=v(d);return{static:"Static model",animated:"Animated model",rigged:"Rigged model",skinned:"Skinned model"}[I(r,e)]}function h(d){const t=d.material;return Array.isArray(t)?t[0]??null:t??null}function l(d){return d?.color??null}class p{constructor(t,r,e){if(this.store=t,this.scene=r,this.options=e,this.provenance=e.provenance??(e.documentKind==="asset"?{source:"document",label:"derived asset",detail:"Loaded from an ordinary project asset. Edit its source or import recipe."}:{source:"source-code",label:"source",detail:"Instantiated from project TypeScript. Edit source or exposed parameters, then rebuild."}),this.documentNodeId=`object3d-document:${e.documentId}`,this.projector=new y(b(e.documentId)),this.indexGraph(),e.hierarchyRoots&&new Set(e.hierarchyRoots).size!==e.hierarchyRoots.length)throw new Error(`Object3D document "${e.title}" declared the same hierarchy root twice.`);const s=new Set(e.hierarchyRoots??[]);for(const o of s){let i=o.parent;for(;i&&i!==r;){if(s.has(i))throw new Error(`Object3D document "${e.title}" declared nested hierarchy roots; roots must be non-overlapping.`);i=i.parent}}this.hierarchyRootIds=e.hierarchyRoots?e.hierarchyRoots.map(o=>{const i=this.idByObject.get(o);if(!i)throw new Error(`Object3D document "${e.title}" declared a hierarchy root outside its native graph.`);return i}):[...this.projector.rootIds],this.view=new j({projector:this.projector,scene:r,documentNodeId:this.documentNodeId,rootIds:this.hierarchyRootIds}),this.selectionState=new w({store:t.shell,owns:o=>this.byId.has(o),initial:[this.documentNodeId],onChange:o=>this.syncMarkedSelection(o)})}documentNodeId;projector;hierarchyRootIds;view;selectionState;markedSelection=new Set;capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance;disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;onStructureChanged=t=>{f(t.child)||this.scheduleStructureReindex()};indexGraph(){this.projector.project(this.scene),this.watchStructure()}watchStructure(){const t=e=>e;for(const e of this.watchedForStructure)t(e).removeEventListener("childadded",this.onStructureChanged),t(e).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const r=e=>{t(e).addEventListener("childadded",this.onStructureChanged),t(e).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(e)};r(this.scene);for(const[,e]of this.byId)r(e)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed||(this.indexGraph(),this.store.scene!==this.scene))return;const t=this.store.objectMap;t.clear();for(const[e,s]of this.byId)t.set(e,s);const r=[...this.store.shell.selectedEntityIds].filter(e=>e===this.documentNodeId||this.byId.has(e));r.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(r),this.store.notifyIngestObjectMapEdit()}))}get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}documentTypeLabel(){if(this.options.documentKind!=="asset")return;const t=this.scene.children.find(s=>this.idByObject.has(s))??null;if(!t)return;const r=u.get(t);if(r!==void 0)return r;const e=E(t);return u.set(t,e),e}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:t=>{if(t===this.documentNodeId){const e=this.documentTypeLabel();return{id:t,label:this.options.title,secondaryLabel:this.options.sourcePath,role:"document",kind:this.options.documentKind==="asset"?"model-asset":"three-source",...e?{typeLabel:e}:{},parentId:null,childIds:this.view.rootIds()}}const r=this.byId.get(t);return r?this.view.node(r):null},object3D:t=>this.byId.get(t)??null,idForObject3D:t=>this.idByObject.get(t)??null};selection={get:()=>this.selectionState.current(),set:t=>this.selectionState.publish(t.filter(r=>r===this.documentNodeId||this.byId.has(r)))};static READ_ONLY_REASON="This document shows what the module builds; its properties are read-only here. Edit the module.";readOnly=()=>({writable:!1,reason:p.READ_ONLY_REASON});transforms={get:t=>R(this.byId.get(t)??null),beginEdit:()=>{},apply:()=>{},endEdit:()=>{}};inspector={properties:t=>{if(t===this.documentNodeId)return this.options.audit===!1?[]:[{path:"name",label:"Name",type:"string",readonly:!0},{path:"source.path",label:"Source",type:"string",readonly:!0}];const r=this.byId.get(t);if(!r)return[];const e=a(r);if(e?.fields)return e.fields().map(({value:n,...m})=>m);const s=[{path:"name",label:"Name",type:"string",readonly:!0},{path:"visible",label:"Visible",type:"boolean",readonly:!0},{path:"object.type",label:"Native type",type:"string",readonly:!0}],o=r;if(o.isMesh&&o.geometry){const n=o.geometry.getAttribute("position");s.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0,group:"Mesh"}),n&&s.push({path:"mesh.triangles",label:"Triangles",type:"number",readonly:!0,group:"Mesh"})}const i=h(r);i&&(s.push({path:"material.type",label:"Material",type:"string",readonly:!0,group:"Material"}),l(i)&&s.push({path:"material.color",label:"Color",type:"color",readonly:!0,group:"Material"}));const c=r;return c.isSkinnedMesh&&c.skeleton&&s.push({path:"skin.bones",label:"Bones",type:"number",readonly:!0,group:"Skin"}),s},get:(t,r)=>{if(t===this.documentNodeId)return r==="name"?this.options.title:r==="source.path"?this.options.sourcePath:void 0;const e=this.byId.get(t);if(!e)return;const o=a(e)?.fields?.().find(n=>n.path===r);if(o)return o.value();if(r==="name")return e.name||e.type;if(r==="visible")return e.visible;if(r==="object.type")return e.type;const i=e;if(r==="mesh.vertices")return i.geometry?.getAttribute("position")?.count??0;if(r==="mesh.triangles"){const n=i.geometry;return(n?.index?.count??n?.getAttribute("position")?.count??0)/3}const c=h(e);if(r==="material.type")return c?.type;if(r==="material.color"){const n=l(c);return n?`#${n.getHexString()}`:void 0}if(r==="skin.bones")return e.skeleton?.bones.length??0},set:()=>{},editability:()=>this.readOnly()};subscribe(t){return this.store.shell.subscribe(t)}get documentId(){return this.documentNodeId}get documentRootObject(){const t=this.hierarchy.node(this.documentNodeId)?.childIds[0];return t?this.byId.get(t)??null:null}syncMarkedSelection(t){const r=new Set(t.map(e=>this.byId.get(e)??null).filter(e=>e!==null).filter(e=>a(e)?.selectionChanged!==void 0));for(const e of this.markedSelection)r.has(e)||a(e)?.selectionChanged?.(!1);for(const e of r)this.markedSelection.has(e)||a(e)?.selectionChanged?.(!0);this.markedSelection=r}}export{p as S};
@@ -1 +1 @@
1
- import{gF as d,dv as u,bU as f,bV as a,ay as p,eb as l,Z as c,gG as g}from"./index-FuK_gLVP.js";import{r as s,I as h,i as w}from"./ingest-source-persistence-DWpLWVYc.js";function y(n){const t={sourceLocation:e=>{const r=n(e);if(!(!r.anchored||r.kind!=="source"))return{file:r.file,line:r.line}}};return{links:e=>{const r=n(e);return!r.anchored||r.kind!=="source"?[]:[{id:`creation-site:${r.file}:${r.line}:${r.col}`,title:`Constructed at ${r.display}`,open:()=>{d(t,e,"callsite").then(u)}}]}}}function v(n){return`this gesture changed ${n.length} properties at once (${n.join(", ")}), and creation-site write-back plans one property per gesture`}function $(n){const{backend:t,label:e}=n;return f({resolve:()=>{const r=n.subject(),i=t.gate(r);if(!i.ok)return a(i.reason);const o=r.anchorKind;return o==="live-only"?a(t.describe(r)):{reaches:"writer",anchorKind:o,destination:t.destination(),write:()=>t.write({...r,baseline:n.baseline,next:n.next,label:e})}},record:r=>{r||n.journal()},report:r=>{t.armed()&&t.report(e,r)}})}function S(n){let t=null;return{attach(e){t=n.writer??(g("An ingest root’s source persistence")?new h({history:n.history,live:e}):null)},describe({anchor:e,instances:r,property:i,writeScope:o}){return t?t.describe(e,r,i,o):e.anchored?e.kind==="data"?`Live-only edit — this object is ${e.display}.`:`Live-only edit — this object is created at ${e.display}.`:`Live-only edit — ${e.reason}.`},gate({anchor:e,instances:r,property:i,writeScope:o}){return t?t.gate(e,r,i,o):{ok:!1,reason:"this editor tier cannot write project source"}},armed:()=>t!==null&&l(),readSiteLiterals:e=>t?t.inspect(e):Promise.resolve({}),report:(e,r)=>s(e,r),async write(e){if(!t)return!1;try{const r=await t.persist(e);return r.persisted?(c.log(`[ingest] ${e.label} written to the game's own source — ${r.detail}`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the write failed: ${r instanceof Error?r.message:String(r)}`),!1}},removal:{available(e){return t?t.gate(e.anchor,e.instances,e.property,e.writeScope).ok:!1},async perform(e){if(!t)return!1;try{const r=await t.remove({property:e.property,surface:e.surface,anchor:e.anchor,instances:e.instances,writeScope:e.writeScope,label:e.label});return r.persisted?(c.log(`[ingest] ${e.label} — dropped from the game's own source (${r.detail})`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the removal failed: ${r instanceof Error?r.message:String(r)}`),!1}}},destination(){const e=w();return l()&&e?.writable&&t?"the game's own source (creation-site write-back)":p},dispose(){t?.dispose(),t=null}}}export{S as a,y as c,v as m,$ as p};
1
+ import{gF as d,dv as u,bU as f,bV as a,ay as p,eb as l,Z as c,gG as g}from"./index-BYdQuKKk.js";import{r as s,I as h,i as w}from"./ingest-source-persistence-G4DRJGE8.js";function y(n){const t={sourceLocation:e=>{const r=n(e);if(!(!r.anchored||r.kind!=="source"))return{file:r.file,line:r.line}}};return{links:e=>{const r=n(e);return!r.anchored||r.kind!=="source"?[]:[{id:`creation-site:${r.file}:${r.line}:${r.col}`,title:`Constructed at ${r.display}`,open:()=>{d(t,e,"callsite").then(u)}}]}}}function v(n){return`this gesture changed ${n.length} properties at once (${n.join(", ")}), and creation-site write-back plans one property per gesture`}function $(n){const{backend:t,label:e}=n;return f({resolve:()=>{const r=n.subject(),i=t.gate(r);if(!i.ok)return a(i.reason);const o=r.anchorKind;return o==="live-only"?a(t.describe(r)):{reaches:"writer",anchorKind:o,destination:t.destination(),write:()=>t.write({...r,baseline:n.baseline,next:n.next,label:e})}},record:r=>{r||n.journal()},report:r=>{t.armed()&&t.report(e,r)}})}function S(n){let t=null;return{attach(e){t=n.writer??(g("An ingest root’s source persistence")?new h({history:n.history,live:e}):null)},describe({anchor:e,instances:r,property:i,writeScope:o}){return t?t.describe(e,r,i,o):e.anchored?e.kind==="data"?`Live-only edit — this object is ${e.display}.`:`Live-only edit — this object is created at ${e.display}.`:`Live-only edit — ${e.reason}.`},gate({anchor:e,instances:r,property:i,writeScope:o}){return t?t.gate(e,r,i,o):{ok:!1,reason:"this editor tier cannot write project source"}},armed:()=>t!==null&&l(),readSiteLiterals:e=>t?t.inspect(e):Promise.resolve({}),report:(e,r)=>s(e,r),async write(e){if(!t)return!1;try{const r=await t.persist(e);return r.persisted?(c.log(`[ingest] ${e.label} written to the game's own source — ${r.detail}`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the write failed: ${r instanceof Error?r.message:String(r)}`),!1}},removal:{available(e){return t?t.gate(e.anchor,e.instances,e.property,e.writeScope).ok:!1},async perform(e){if(!t)return!1;try{const r=await t.remove({property:e.property,surface:e.surface,anchor:e.anchor,instances:e.instances,writeScope:e.writeScope,label:e.label});return r.persisted?(c.log(`[ingest] ${e.label} — dropped from the game's own source (${r.detail})`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the removal failed: ${r instanceof Error?r.message:String(r)}`),!1}}},destination(){const e=w();return l()&&e?.writable&&t?"the game's own source (creation-site write-back)":p},dispose(){t?.dispose(),t=null}}}export{S as a,y as c,v as m,$ as p};
@@ -1 +1 @@
1
- import{r as h}from"./index-nmcBqr7Y.js";import{s as b,c as f,l as V,a as x,t as S,v as P,p as T,b as y}from"./camera-authoring-DYjhU5Zp.js";import{ha as L,E as A,bL as C,G as k,y as g,r as O,dv as E,hb as M,ga as R,hc as z}from"./index-FuK_gLVP.js";import{a as D}from"./object3d-document-session-registry-yyskXT42.js";import{r as s}from"./transform-mode-request-B6ZoHm8Z.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function j(){const e=f();if(e.view)return[{id:"camera.exitView",label:"Exit Camera View",execute:V}];const i=x();return i?[{id:"camera.viewThrough",label:`View Through ${i.name}`,execute:()=>P(i)},...i.canAuthorPose?[{id:"camera.pilot",label:`Pilot ${i.name}`,execute:()=>T(i)},{id:"camera.alignToView",label:`Align ${i.name} to Current View`,execute:()=>y(i)}]:[],{id:"camera.pinPreview",label:e.previewPinned?"Unpin Camera Preview":"Pin Camera Preview",execute:S}]:[]}function H(){const e=g();return e?D(e):null}function a(e,i){const o=H();o?o.setMode(i):e.setShadingMode(i)}function $(e){const i=[{id:"mode.select",label:"Select Tool (no gizmo)",shortcut:"transform.select",execute:()=>s(e.shell,"select")},{id:"mode.combined",label:"Transform Mode (all handles)",shortcut:"transform.combined",execute:()=>s(e.shell,"combined")},{id:"mode.translate",label:"Translate Mode",shortcut:"transform.translate",execute:()=>s(e.shell,"translate")},{id:"mode.rotate",label:"Rotate Mode",shortcut:"transform.rotate",execute:()=>s(e.shell,"rotate")},{id:"mode.scale",label:"Scale Mode",shortcut:"transform.scale",execute:()=>s(e.shell,"scale")},{id:"mode.world",label:"World Space",execute:()=>e.shell.setTransformSpace("world")},{id:"mode.local",label:"Local Space",execute:()=>e.shell.setTransformSpace("local")},{id:"toggle.grid",label:"Toggle Grid",execute:()=>{const l=g();l&&A(l)&&C(l,!k(l))}},{id:"toggle.helpers",label:"Toggle Helpers",execute:()=>e.shell.toggleHelpers()},{id:"toggle.stats",label:"Toggle Stats Overlay",execute:()=>e.toggleStats()},{id:"toggle.snap",label:"Toggle Snap",shortcut:"viewport.toggleSnap",execute:()=>e.shell.toggleSnap()},{id:"toggle.surface-snap",label:"Toggle Surface Snap",execute:()=>e.shell.toggleSnapToSurface()},{id:"shading.solid",label:"Material Shading",execute:()=>a(e,"solid")},{id:"shading.clay",label:"Solid Shading",execute:()=>a(e,"clay")},{id:"shading.wireframe",label:"Wireframe Shading",execute:()=>a(e,"wireframe")},{id:"shading.unlit",label:"Unlit Shading",execute:()=>a(e,"unlit")},{id:"shading.normals",label:"Normal Shading",execute:()=>a(e,"normals")},{id:"shading.overdraw",label:"Overdraw Shading",execute:()=>a(e,"overdraw")},{id:"view.top",label:"Top View",shortcut:"view.top",execute:()=>e.shell.setViewPreset("top")},{id:"view.front",label:"Front View",shortcut:"view.front",execute:()=>e.shell.setViewPreset("front")},{id:"view.right",label:"Right View",shortcut:"view.right",execute:()=>e.shell.setViewPreset("right")},{id:"view.bottom",label:"Bottom View",shortcut:"view.bottom",execute:()=>e.shell.setViewPreset("bottom")},{id:"view.back",label:"Back View",shortcut:"view.back",execute:()=>e.shell.setViewPreset("back")},{id:"view.left",label:"Left View",shortcut:"view.left",execute:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",label:"Orbit Left",shortcut:"view.orbitLeft",execute:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",label:"Orbit Right",shortcut:"view.orbitRight",execute:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",label:"Orbit Up",shortcut:"view.orbitUp",execute:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",label:"Orbit Down",shortcut:"view.orbitDown",execute:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",label:"Opposite View",shortcut:"view.opposite",execute:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",label:"Roll Left",shortcut:"view.rollLeft",execute:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",label:"Roll Right",shortcut:"view.rollRight",execute:()=>e.shell.stepView("roll-right")},{id:"view.all",label:"Frame All",shortcut:"view.all",execute:()=>e.shell.frameAll()},{id:"view.zoomIn",label:"Zoom In",shortcut:"view.zoomIn",execute:()=>e.shell.zoomView(1)},{id:"view.zoomOut",label:"Zoom Out",shortcut:"view.zoomOut",execute:()=>e.shell.zoomView(-1)},{id:"view.perspective",label:"Perspective View",shortcut:"view.perspective",execute:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",label:"Perspective/Orthographic",shortcut:"view.projection",execute:()=>e.shell.toggleProjection()},{id:"view.camera",label:"Camera View",shortcut:"view.camera",execute:()=>e.shell.toggleCameraView()},{id:"focus.selected",label:"Focus Selected",shortcut:"viewport.frameSelection",execute:()=>e.shell.focusOnSelection()}];return L({actions:()=>[...i,...j()],subscribe:b})}function F(e,i,o){const{keyboard:l}=O(),r=t=>()=>{i.isFlying||s(e.shell,t)},v=l.bindActions([{id:"transform.select",scope:"stage",run:r("select")},{id:"transform.combined",scope:"stage",run:r("combined")},{id:"transform.translate",scope:"stage",run:r("translate")},{id:"transform.rotate",scope:"stage",run:r("rotate")},{id:"transform.scale",scope:"stage",run:r("scale")},{id:"viewport.toggleSnap",scope:"stage",run:()=>{e.shell.toggleSnap();const{translate:t,rotate:n,scale:m}=e.shell.snapValues,p=`${l.shortcutFor("viewport.toggleSnap")??""} toggles; hold Ctrl while dragging to snap once`;E(e.shell.snapEnabled?`Snap on — ${t} units, ${n}°, ×${m} (${p})`:`Snap off (${p})`)}},{id:"viewport.frameSelection",scope:"stage",run:()=>e.shell.focusOnSelection()},{id:"viewport.cyclePivot",scope:"stage",run:()=>{const t=["active-element","median-point","individual-origins"],n=t.indexOf(e.shell.pivotMode);e.shell.setPivotMode(t[(n+1)%t.length])}},{id:"view.top",scope:"stage",run:()=>e.shell.setViewPreset("top")},{id:"view.front",scope:"stage",run:()=>e.shell.setViewPreset("front")},{id:"view.right",scope:"stage",run:()=>e.shell.setViewPreset("right")},{id:"view.bottom",scope:"stage",run:()=>e.shell.setViewPreset("bottom")},{id:"view.back",scope:"stage",run:()=>e.shell.setViewPreset("back")},{id:"view.left",scope:"stage",run:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",scope:"stage",run:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",scope:"stage",run:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",scope:"stage",run:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",scope:"stage",run:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",scope:"stage",run:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",scope:"stage",run:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",scope:"stage",run:()=>e.shell.stepView("roll-right")},{id:"view.all",scope:"stage",run:()=>e.shell.frameAll()},{id:"view.zoomIn",scope:"stage",run:()=>e.shell.zoomView(1)},{id:"view.zoomOut",scope:"stage",run:()=>e.shell.zoomView(-1)},{id:"view.perspective",scope:"stage",run:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",scope:"stage",run:()=>e.shell.toggleProjection()},{id:"view.camera",scope:"stage",run:()=>e.shell.toggleCameraView()},{id:"viewport.snapToFloor",scope:"stage",run:()=>i.snapSelectionToFloor()}]),c=()=>R("viewport");o.addEventListener("pointerdown",c),M();const d=t=>l.chordsFor("viewport.vertexSnapHold").some(n=>n.key===t.key.toLowerCase()),u=t=>{if(d(t)&&!t.metaKey&&!t.ctrlKey&&!t.repeat){if(z()!=="viewport"||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement)return;e.setVertexSnapActive(!0),i.activateVertexSnap()}},w=t=>{d(t)&&!t.metaKey&&!t.ctrlKey&&(e.setVertexSnapActive(!1),i.deactivateVertexSnap())};return window.addEventListener("keydown",u),window.addEventListener("keyup",w),()=>{v(),o.removeEventListener("pointerdown",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",w)}}function Y({stage:e}){return h.useEffect(()=>F(e.store,e.viewport,e.canvas),[e.store,e.viewport,e.canvas]),h.useEffect(()=>$(e.store),[e.store]),null}export{Y as StageKeyboardBinding};
1
+ import{r as h}from"./index-nmcBqr7Y.js";import{s as b,c as f,l as V,a as x,t as S,v as P,p as T,b as y}from"./camera-authoring-DYjhU5Zp.js";import{ha as L,E as A,bL as C,G as k,y as g,r as O,dv as E,hb as M,ga as R,hc as z}from"./index-BYdQuKKk.js";import{a as D}from"./object3d-document-session-registry-RFHXjepL.js";import{r as s}from"./transform-mode-request-D9k3BUHW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function j(){const e=f();if(e.view)return[{id:"camera.exitView",label:"Exit Camera View",execute:V}];const i=x();return i?[{id:"camera.viewThrough",label:`View Through ${i.name}`,execute:()=>P(i)},...i.canAuthorPose?[{id:"camera.pilot",label:`Pilot ${i.name}`,execute:()=>T(i)},{id:"camera.alignToView",label:`Align ${i.name} to Current View`,execute:()=>y(i)}]:[],{id:"camera.pinPreview",label:e.previewPinned?"Unpin Camera Preview":"Pin Camera Preview",execute:S}]:[]}function H(){const e=g();return e?D(e):null}function a(e,i){const o=H();o?o.setMode(i):e.setShadingMode(i)}function $(e){const i=[{id:"mode.select",label:"Select Tool (no gizmo)",shortcut:"transform.select",execute:()=>s(e.shell,"select")},{id:"mode.combined",label:"Transform Mode (all handles)",shortcut:"transform.combined",execute:()=>s(e.shell,"combined")},{id:"mode.translate",label:"Translate Mode",shortcut:"transform.translate",execute:()=>s(e.shell,"translate")},{id:"mode.rotate",label:"Rotate Mode",shortcut:"transform.rotate",execute:()=>s(e.shell,"rotate")},{id:"mode.scale",label:"Scale Mode",shortcut:"transform.scale",execute:()=>s(e.shell,"scale")},{id:"mode.world",label:"World Space",execute:()=>e.shell.setTransformSpace("world")},{id:"mode.local",label:"Local Space",execute:()=>e.shell.setTransformSpace("local")},{id:"toggle.grid",label:"Toggle Grid",execute:()=>{const l=g();l&&A(l)&&C(l,!k(l))}},{id:"toggle.helpers",label:"Toggle Helpers",execute:()=>e.shell.toggleHelpers()},{id:"toggle.stats",label:"Toggle Stats Overlay",execute:()=>e.toggleStats()},{id:"toggle.snap",label:"Toggle Snap",shortcut:"viewport.toggleSnap",execute:()=>e.shell.toggleSnap()},{id:"toggle.surface-snap",label:"Toggle Surface Snap",execute:()=>e.shell.toggleSnapToSurface()},{id:"shading.solid",label:"Material Shading",execute:()=>a(e,"solid")},{id:"shading.clay",label:"Solid Shading",execute:()=>a(e,"clay")},{id:"shading.wireframe",label:"Wireframe Shading",execute:()=>a(e,"wireframe")},{id:"shading.unlit",label:"Unlit Shading",execute:()=>a(e,"unlit")},{id:"shading.normals",label:"Normal Shading",execute:()=>a(e,"normals")},{id:"shading.overdraw",label:"Overdraw Shading",execute:()=>a(e,"overdraw")},{id:"view.top",label:"Top View",shortcut:"view.top",execute:()=>e.shell.setViewPreset("top")},{id:"view.front",label:"Front View",shortcut:"view.front",execute:()=>e.shell.setViewPreset("front")},{id:"view.right",label:"Right View",shortcut:"view.right",execute:()=>e.shell.setViewPreset("right")},{id:"view.bottom",label:"Bottom View",shortcut:"view.bottom",execute:()=>e.shell.setViewPreset("bottom")},{id:"view.back",label:"Back View",shortcut:"view.back",execute:()=>e.shell.setViewPreset("back")},{id:"view.left",label:"Left View",shortcut:"view.left",execute:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",label:"Orbit Left",shortcut:"view.orbitLeft",execute:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",label:"Orbit Right",shortcut:"view.orbitRight",execute:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",label:"Orbit Up",shortcut:"view.orbitUp",execute:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",label:"Orbit Down",shortcut:"view.orbitDown",execute:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",label:"Opposite View",shortcut:"view.opposite",execute:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",label:"Roll Left",shortcut:"view.rollLeft",execute:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",label:"Roll Right",shortcut:"view.rollRight",execute:()=>e.shell.stepView("roll-right")},{id:"view.all",label:"Frame All",shortcut:"view.all",execute:()=>e.shell.frameAll()},{id:"view.zoomIn",label:"Zoom In",shortcut:"view.zoomIn",execute:()=>e.shell.zoomView(1)},{id:"view.zoomOut",label:"Zoom Out",shortcut:"view.zoomOut",execute:()=>e.shell.zoomView(-1)},{id:"view.perspective",label:"Perspective View",shortcut:"view.perspective",execute:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",label:"Perspective/Orthographic",shortcut:"view.projection",execute:()=>e.shell.toggleProjection()},{id:"view.camera",label:"Camera View",shortcut:"view.camera",execute:()=>e.shell.toggleCameraView()},{id:"focus.selected",label:"Focus Selected",shortcut:"viewport.frameSelection",execute:()=>e.shell.focusOnSelection()}];return L({actions:()=>[...i,...j()],subscribe:b})}function F(e,i,o){const{keyboard:l}=O(),r=t=>()=>{i.isFlying||s(e.shell,t)},v=l.bindActions([{id:"transform.select",scope:"stage",run:r("select")},{id:"transform.combined",scope:"stage",run:r("combined")},{id:"transform.translate",scope:"stage",run:r("translate")},{id:"transform.rotate",scope:"stage",run:r("rotate")},{id:"transform.scale",scope:"stage",run:r("scale")},{id:"viewport.toggleSnap",scope:"stage",run:()=>{e.shell.toggleSnap();const{translate:t,rotate:n,scale:m}=e.shell.snapValues,p=`${l.shortcutFor("viewport.toggleSnap")??""} toggles; hold Ctrl while dragging to snap once`;E(e.shell.snapEnabled?`Snap on — ${t} units, ${n}°, ×${m} (${p})`:`Snap off (${p})`)}},{id:"viewport.frameSelection",scope:"stage",run:()=>e.shell.focusOnSelection()},{id:"viewport.cyclePivot",scope:"stage",run:()=>{const t=["active-element","median-point","individual-origins"],n=t.indexOf(e.shell.pivotMode);e.shell.setPivotMode(t[(n+1)%t.length])}},{id:"view.top",scope:"stage",run:()=>e.shell.setViewPreset("top")},{id:"view.front",scope:"stage",run:()=>e.shell.setViewPreset("front")},{id:"view.right",scope:"stage",run:()=>e.shell.setViewPreset("right")},{id:"view.bottom",scope:"stage",run:()=>e.shell.setViewPreset("bottom")},{id:"view.back",scope:"stage",run:()=>e.shell.setViewPreset("back")},{id:"view.left",scope:"stage",run:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",scope:"stage",run:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",scope:"stage",run:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",scope:"stage",run:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",scope:"stage",run:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",scope:"stage",run:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",scope:"stage",run:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",scope:"stage",run:()=>e.shell.stepView("roll-right")},{id:"view.all",scope:"stage",run:()=>e.shell.frameAll()},{id:"view.zoomIn",scope:"stage",run:()=>e.shell.zoomView(1)},{id:"view.zoomOut",scope:"stage",run:()=>e.shell.zoomView(-1)},{id:"view.perspective",scope:"stage",run:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",scope:"stage",run:()=>e.shell.toggleProjection()},{id:"view.camera",scope:"stage",run:()=>e.shell.toggleCameraView()},{id:"viewport.snapToFloor",scope:"stage",run:()=>i.snapSelectionToFloor()}]),c=()=>R("viewport");o.addEventListener("pointerdown",c),M();const d=t=>l.chordsFor("viewport.vertexSnapHold").some(n=>n.key===t.key.toLowerCase()),u=t=>{if(d(t)&&!t.metaKey&&!t.ctrlKey&&!t.repeat){if(z()!=="viewport"||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement)return;e.setVertexSnapActive(!0),i.activateVertexSnap()}},w=t=>{d(t)&&!t.metaKey&&!t.ctrlKey&&(e.setVertexSnapActive(!1),i.deactivateVertexSnap())};return window.addEventListener("keydown",u),window.addEventListener("keyup",w),()=>{v(),o.removeEventListener("pointerdown",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",w)}}function Y({stage:e}){return h.useEffect(()=>F(e.store,e.viewport,e.canvas),[e.store,e.viewport,e.canvas]),h.useEffect(()=>$(e.store),[e.store]),null}export{Y as StageKeyboardBinding};
@@ -1 +1 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import{iT as w,h1 as P,df as R,aL as f,al as v,iU as A,gM as E,gN as k,iV as V,iW as T,dt as D,bq as M,br as b,G as N,iX as H,iY as U,d9 as $,bw as C,aM as z,a7 as F,iZ as I,bL as W,i_ as G,i$ as _,aa as q,j0 as Z,j1 as J,j2 as K,bs as X}from"./index-FuK_gLVP.js";import{s as B,o as O,a as Y}from"./object3d-document-session-registry-yyskXT42.js";import{r as Q}from"./index-CtzuWnCS.js";import{T as ee}from"./TransientHint-BzXrECrw.js";import{d as te,b as se}from"./ViewportShadingMenu-DieQf7SR.js";import{V as j,s as oe}from"./StageHost-BStYoTUX.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./three-state-DNgFvLbw.js";import"./editor-shell-store-BMZxpcut.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-D-sKmDua.js";import"./workspace-arrangement-avVz3tND.js";import"./user-data-thHakLdm.js";import"./entity-object-Ai-uXVow.js";import"./three-contract-Dkt6PmWY.js";import"./standard-viewport-dressing-wQb-yfhP.js";import"./content-bounds-CaZcBNYF.js";import"./hierarchy-marks-CyrGt6dv.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./three-integration-UeCSuDl8.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-CmpZSo8j.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-n5yOZ3A6.js";import"./studio-environment-Bj3Hi-UK.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./component-instance-root-BNDWrUkC.js";import"./viewport-door-BfcEF1aj.js";import"./asset-preview-D_mr_kfU.js";import"./bitmap-label-Ct4k6ehY.js";import"./model-inspection-CRXVM5Wz.js";import"./three-viewport-presentation-5KZ0zq__.js";import"./clip-planes-CnAI6DZn.js";import"./three-CQVC3sHg.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-Rs5Y89nN.js";import"./source-object3d-authoring-adapter-Ckfk03in.js";import"./three-projection-core-Ckpx-u5r.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-B6uA0CS2.js";import"./viewport-surface-status-B-dxhyXW.js";function h(t){return t.toFixed(2)}function re(){const t=w(),[o,r]=s.useState({x:0,y:0,z:0}),[i,n]=s.useState({x:0,y:0,z:0}),a=s.useRef(0);return s.useEffect(()=>{function u(){const m=t.cameraPosition,p=t.cameraTarget;r(l=>l.x!==m.x||l.y!==m.y||l.z!==m.z?{x:m.x,y:m.y,z:m.z}:l),n(l=>l.x!==p.x||l.y!==p.y||l.z!==p.z?{x:p.x,y:p.y,z:p.z}:l),a.current=requestAnimationFrame(u)}return a.current=requestAnimationFrame(u),()=>cancelAnimationFrame(a.current)},[t]),e.jsx(P,{variant:"overlay",border:!0,className:"volter-camera-info volter-chrome-island volter-glass-island","data-island-scale":"compact",children:e.jsxs(R,{gap:8,align:"center",style:{whiteSpace:"nowrap"},children:[e.jsxs(f,{variant:"code",children:["Pos ",h(o.x)," ",h(o.y)," ",h(o.z)]}),e.jsxs(f,{variant:"code",children:["Target ",h(i.x)," ",h(i.y)," ",h(i.z)]})]})})}function ie(){const t=w(),[,o]=s.useState(0),r=A();return s.useEffect(()=>{const i=setInterval(()=>o(n=>n+1),200);return()=>clearInterval(i)},[]),e.jsxs("div",{className:"volter-hud-overlay volter-chrome-island volter-glass-island","data-island-scale":"compact","data-hud-border":"strong",style:{position:"absolute",top:"var(--volter-viewport-overlay-hud-top, 48px)",right:8,padding:"6px 10px",pointerEvents:"auto",fontSize:"var(--volter-font-base)",color:v.content.primary,fontFamily:v.typography.mono,lineHeight:"16px"},children:[e.jsxs("div",{children:["FPS: ",t.fps.toFixed(0)]}),e.jsxs("div",{children:["Draw: ",t.drawCalls]}),e.jsxs("div",{children:["Tris: ",t.triangles.toLocaleString()]}),e.jsxs("div",{children:["Frame: ",t.frameTime.toFixed(1),"ms"]}),r!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Heap: ",r.heapUsedMB===null?"n/a":`${r.heapUsedMB.toFixed(0)}MB`,r.heapLimitMB===null?"":` / ${r.heapLimitMB.toFixed(0)}MB`]}),e.jsxs("div",{children:["Mount epochs: ",r.mountEpochs]}),e.jsxs("div",{children:["Canvas: ",r.canvasMB.toFixed(1),"MB ×",r.canvases]}),r.textures!==void 0&&e.jsxs("div",{children:["GPU: ",r.textures," tex, ",r.geometries??0," geo",r.programs===void 0?"":`, ${r.programs} prog`]})]})]})}function ae({store:t,documentId:o}){s.useSyncExternalStore(t.shell.subscribe,t.shell.getSnapshot),s.useSyncExternalStore(E,k),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O);const{adapter:r}=D(t.shell),i=Y(o);s.useSyncExternalStore(i?.subscribe??le,i?.getSnapshot??ce),s.useSyncExternalStore(M,b);const n=N(o),a=H(),u=U(),m=a.viewName==="bar"||a.viewName==="menu",[p,l]=s.useState(null),y=()=>p?.closest(".volter-dock-document-content")?.querySelector(':scope > .volter-stage-bar [data-stage-bar-slot="display"]')??null,x=s.useId(),g=y(),d=g&&(g.dataset.owner===void 0||g.dataset.owner===x)?g:null,[,L]=s.useReducer(c=>c+1,0);s.useEffect(()=>{const c=y();c&&c.dataset.owner===void 0&&(c.dataset.owner=x),(c&&c.dataset.owner===x?c:null)!==d&&L()}),s.useEffect(()=>()=>{d?.dataset.owner===x&&delete d.dataset.owner},[d,x]);const S=e.jsxs($,{label:"Viewport display",className:"volter-viewport-toolbar volter-viewport-toolbar-right volter-stage-display",children:[a.viewName==="bar"&&i?e.jsx(j,{shell:t.shell,documentId:o,label:oe(i.viewport,i.projection(),"long")}):null,e.jsx(C,{text:`Grid: ${n?"On":"Off"}`,children:e.jsx(z,{"aria-label":"Toggle grid","aria-pressed":n,size:"comfortable",onClick:()=>W(o,!n),children:e.jsx(F,{icon:I,size:"md"})})}),e.jsx(pe,{store:t,word:u.helpers}),e.jsx(te,{mode:ne(i)??t.shadingMode,onChange:c=>i?i.setMode(c):t.setShadingMode(c),words:u.shading}),m?null:e.jsx(j,{shell:t.shell,documentId:o}),e.jsx(me,{adapter:r,store:t})]});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:l,hidden:!0}),d?Q.createPortal(S,d):S]})}function ne(t){return t?.presentation().mode??null}const le=()=>()=>{},ce=()=>0,me=s.memo(function({adapter:o,store:r}){const[,i]=s.useReducer(a=>a+1,0);s.useEffect(()=>o.subscribe?.(i),[o]);const n=s.useMemo(()=>G(o),[o,r.shell.contentVersion]);return n===0?null:e.jsx(C,{text:`Open Light Explorer · ${n} ${n===1?"light":"lights"}`,children:e.jsx(z,{"aria-label":"Open Light Explorer",size:"comfortable",onClick:()=>q(Z.lightExplorer.id),children:e.jsx(F,{icon:_,size:"md"})})})});function pe({store:t,word:o}){const r=[{key:"bounds",label:"Bounds"},{key:"lights",label:"Lights"},{key:"cameras",label:"Cameras"},{key:"colliders",label:"Colliders"},{key:"joints",label:"Joints"},{key:"particles",label:"Particle Emitters"},{key:"lod",label:"LOD"},{key:"audio",label:"Audio"},{key:"splines",label:"Splines"},{key:"navmesh",label:"NavMesh"},{key:"constraints",label:"Constraints"},{key:"reflectionProbes",label:"Reflection Probes"},{key:"triggerVolumes",label:"Trigger Volumes"},{key:"skeletons",label:"Skeletons"},{key:"weights",label:"Weights"},{key:"cursor",label:"3D Cursor"},{key:"empties",label:"Empties"}];return e.jsx(se,{label:"Helpers",...o!==void 0?{word:o}:{},master:{enabled:t.shell.showHelpers,onToggle:()=>t.shell.toggleHelpers()},choices:r.map(i=>({id:i.key,label:i.label,enabled:t.shell.helperVisibility[i.key],onToggle:()=>t.shell.toggleHelperType(i.key)}))})}function vt({store:t,documentId:o,stage:r,active:i,chrome:n}){const a=r?.store??t;s.useSyncExternalStore(t.shell.subscribe,t.shell.getShellSnapshot??t.shell.getSnapshot),s.useSyncExternalStore(a.shell.subscribe,a.shell.getShellSnapshot??a.shell.getSnapshot),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O),s.useSyncExternalStore(E,k);const u=J(t.shell,o,n),m=K(u);s.useSyncExternalStore(M,b,b);const p=X(o).overlays.cameraReadout;return e.jsxs(e.Fragment,{children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ae,{store:a,documentId:o}),p?e.jsx(re,{}):null]}):null,u.surface==="three"&&a.showStats&&e.jsx(ie,{}),i?e.jsx(ee,{}):null]})}export{vt as StageOverlaySet};
1
+ import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import{iT as w,h1 as P,df as R,aL as f,al as v,iU as A,gM as E,gN as k,iV as V,iW as T,dt as D,bq as M,br as b,G as N,iX as H,iY as U,d9 as $,bw as C,aM as z,a7 as F,iZ as I,bL as W,i_ as G,i$ as _,aa as q,j0 as Z,j1 as J,j2 as K,bs as X}from"./index-BYdQuKKk.js";import{s as B,o as O,a as Y}from"./object3d-document-session-registry-RFHXjepL.js";import{r as Q}from"./index-CtzuWnCS.js";import{T as ee}from"./TransientHint-BfLO2bn2.js";import{d as te,b as se}from"./ViewportShadingMenu-BwML2aq7.js";import{V as j,s as oe}from"./StageHost-DooxiRtf.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./three-state-ctKrzvps.js";import"./editor-shell-store-LRVyeXM-.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-wmPhuj0X.js";import"./workspace-arrangement-DwFkSdlq.js";import"./user-data-CJW19F-2.js";import"./entity-object-DWKBk3rf.js";import"./three-contract-Dkt6PmWY.js";import"./standard-viewport-dressing-DpCqZowy.js";import"./content-bounds-BzOnMMA9.js";import"./hierarchy-marks-BjIT-DOf.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./three-integration-BzTWd5jX.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-C73ZQGcv.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-BSBXqm11.js";import"./studio-environment-BXrrTMN4.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./component-instance-root-z47Ib-DX.js";import"./viewport-door-BW0xEXr5.js";import"./asset-preview-DeoFAm2V.js";import"./bitmap-label-Ct4k6ehY.js";import"./model-inspection-CRQL0kkD.js";import"./three-viewport-presentation-Zf87KDhY.js";import"./clip-planes-CnAI6DZn.js";import"./three-D4bun8tv.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-C0vuzmLH.js";import"./source-object3d-authoring-adapter-PbUdA5Q2.js";import"./three-projection-core-DTAhpWX4.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-CwOW82Og.js";import"./viewport-surface-status-CO8m-4fj.js";function h(t){return t.toFixed(2)}function re(){const t=w(),[o,r]=s.useState({x:0,y:0,z:0}),[i,n]=s.useState({x:0,y:0,z:0}),a=s.useRef(0);return s.useEffect(()=>{function u(){const m=t.cameraPosition,p=t.cameraTarget;r(l=>l.x!==m.x||l.y!==m.y||l.z!==m.z?{x:m.x,y:m.y,z:m.z}:l),n(l=>l.x!==p.x||l.y!==p.y||l.z!==p.z?{x:p.x,y:p.y,z:p.z}:l),a.current=requestAnimationFrame(u)}return a.current=requestAnimationFrame(u),()=>cancelAnimationFrame(a.current)},[t]),e.jsx(P,{variant:"overlay",border:!0,className:"volter-camera-info volter-chrome-island volter-glass-island","data-island-scale":"compact",children:e.jsxs(R,{gap:8,align:"center",style:{whiteSpace:"nowrap"},children:[e.jsxs(f,{variant:"code",children:["Pos ",h(o.x)," ",h(o.y)," ",h(o.z)]}),e.jsxs(f,{variant:"code",children:["Target ",h(i.x)," ",h(i.y)," ",h(i.z)]})]})})}function ie(){const t=w(),[,o]=s.useState(0),r=A();return s.useEffect(()=>{const i=setInterval(()=>o(n=>n+1),200);return()=>clearInterval(i)},[]),e.jsxs("div",{className:"volter-hud-overlay volter-chrome-island volter-glass-island","data-island-scale":"compact","data-hud-border":"strong",style:{position:"absolute",top:"var(--volter-viewport-overlay-hud-top, 48px)",right:8,padding:"6px 10px",pointerEvents:"auto",fontSize:"var(--volter-font-base)",color:v.content.primary,fontFamily:v.typography.mono,lineHeight:"16px"},children:[e.jsxs("div",{children:["FPS: ",t.fps.toFixed(0)]}),e.jsxs("div",{children:["Draw: ",t.drawCalls]}),e.jsxs("div",{children:["Tris: ",t.triangles.toLocaleString()]}),e.jsxs("div",{children:["Frame: ",t.frameTime.toFixed(1),"ms"]}),r!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Heap: ",r.heapUsedMB===null?"n/a":`${r.heapUsedMB.toFixed(0)}MB`,r.heapLimitMB===null?"":` / ${r.heapLimitMB.toFixed(0)}MB`]}),e.jsxs("div",{children:["Mount epochs: ",r.mountEpochs]}),e.jsxs("div",{children:["Canvas: ",r.canvasMB.toFixed(1),"MB ×",r.canvases]}),r.textures!==void 0&&e.jsxs("div",{children:["GPU: ",r.textures," tex, ",r.geometries??0," geo",r.programs===void 0?"":`, ${r.programs} prog`]})]})]})}function ae({store:t,documentId:o}){s.useSyncExternalStore(t.shell.subscribe,t.shell.getSnapshot),s.useSyncExternalStore(E,k),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O);const{adapter:r}=D(t.shell),i=Y(o);s.useSyncExternalStore(i?.subscribe??le,i?.getSnapshot??ce),s.useSyncExternalStore(M,b);const n=N(o),a=H(),u=U(),m=a.viewName==="bar"||a.viewName==="menu",[p,l]=s.useState(null),y=()=>p?.closest(".volter-dock-document-content")?.querySelector(':scope > .volter-stage-bar [data-stage-bar-slot="display"]')??null,x=s.useId(),g=y(),d=g&&(g.dataset.owner===void 0||g.dataset.owner===x)?g:null,[,L]=s.useReducer(c=>c+1,0);s.useEffect(()=>{const c=y();c&&c.dataset.owner===void 0&&(c.dataset.owner=x),(c&&c.dataset.owner===x?c:null)!==d&&L()}),s.useEffect(()=>()=>{d?.dataset.owner===x&&delete d.dataset.owner},[d,x]);const S=e.jsxs($,{label:"Viewport display",className:"volter-viewport-toolbar volter-viewport-toolbar-right volter-stage-display",children:[a.viewName==="bar"&&i?e.jsx(j,{shell:t.shell,documentId:o,label:oe(i.viewport,i.projection(),"long")}):null,e.jsx(C,{text:`Grid: ${n?"On":"Off"}`,children:e.jsx(z,{"aria-label":"Toggle grid","aria-pressed":n,size:"comfortable",onClick:()=>W(o,!n),children:e.jsx(F,{icon:I,size:"md"})})}),e.jsx(pe,{store:t,word:u.helpers}),e.jsx(te,{mode:ne(i)??t.shadingMode,onChange:c=>i?i.setMode(c):t.setShadingMode(c),words:u.shading}),m?null:e.jsx(j,{shell:t.shell,documentId:o}),e.jsx(me,{adapter:r,store:t})]});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:l,hidden:!0}),d?Q.createPortal(S,d):S]})}function ne(t){return t?.presentation().mode??null}const le=()=>()=>{},ce=()=>0,me=s.memo(function({adapter:o,store:r}){const[,i]=s.useReducer(a=>a+1,0);s.useEffect(()=>o.subscribe?.(i),[o]);const n=s.useMemo(()=>G(o),[o,r.shell.contentVersion]);return n===0?null:e.jsx(C,{text:`Open Light Explorer · ${n} ${n===1?"light":"lights"}`,children:e.jsx(z,{"aria-label":"Open Light Explorer",size:"comfortable",onClick:()=>q(Z.lightExplorer.id),children:e.jsx(F,{icon:_,size:"md"})})})});function pe({store:t,word:o}){const r=[{key:"bounds",label:"Bounds"},{key:"lights",label:"Lights"},{key:"cameras",label:"Cameras"},{key:"colliders",label:"Colliders"},{key:"joints",label:"Joints"},{key:"particles",label:"Particle Emitters"},{key:"lod",label:"LOD"},{key:"audio",label:"Audio"},{key:"splines",label:"Splines"},{key:"navmesh",label:"NavMesh"},{key:"constraints",label:"Constraints"},{key:"reflectionProbes",label:"Reflection Probes"},{key:"triggerVolumes",label:"Trigger Volumes"},{key:"skeletons",label:"Skeletons"},{key:"weights",label:"Weights"},{key:"cursor",label:"3D Cursor"},{key:"empties",label:"Empties"}];return e.jsx(se,{label:"Helpers",...o!==void 0?{word:o}:{},master:{enabled:t.shell.showHelpers,onToggle:()=>t.shell.toggleHelpers()},choices:r.map(i=>({id:i.key,label:i.label,enabled:t.shell.helperVisibility[i.key],onToggle:()=>t.shell.toggleHelperType(i.key)}))})}function vt({store:t,documentId:o,stage:r,active:i,chrome:n}){const a=r?.store??t;s.useSyncExternalStore(t.shell.subscribe,t.shell.getShellSnapshot??t.shell.getSnapshot),s.useSyncExternalStore(a.shell.subscribe,a.shell.getShellSnapshot??a.shell.getSnapshot),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O),s.useSyncExternalStore(E,k);const u=J(t.shell,o,n),m=K(u);s.useSyncExternalStore(M,b,b);const p=X(o).overlays.cameraReadout;return e.jsxs(e.Fragment,{children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ae,{store:a,documentId:o}),p?e.jsx(re,{}):null]}):null,u.surface==="three"&&a.showStats&&e.jsx(ie,{}),i?e.jsx(ee,{}):null]})}export{vt as StageOverlaySet};
@@ -1 +1 @@
1
- import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{dy as A,ap as j,y as Q,dz as V,dA as _}from"./index-FuK_gLVP.js";import{a as O}from"./content-bounds-CaZcBNYF.js";import{r as w}from"./collaboration-presence-DFgm-wIj.js";import{e6 as G,fd as W,d9 as H,S as U,_ as M,T as k,ej as J,eE as K,eF as ee,dp as te,fo as x,cW as oe,J as ne,a$ as re,N as ie,bX as ae,bV as se}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./hierarchy-marks-CyrGt6dv.js";import"./workspace-arrangement-avVz3tND.js";function ce(){const e=document.querySelector(`.${V}`);return(e?getComputedStyle(e).getPropertyValue("--volter-content-on-accent").trim():"")||_.color.content.onAccent}function Z(e,r){const o=e.image,n=o.getContext("2d");if(!n)return;n.clearRect(0,0,o.width,o.height),n.fillStyle=r.color,n.beginPath(),n.roundRect(2,2,o.width-4,o.height-4,16),n.fill(),n.fillStyle=ce(),n.font="600 22px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle";const c=r.kind==="agent"?" · AI":"";n.fillText(`${r.displayName}${c}`,o.width/2,o.height/2,238),e.needsUpdate=!0}function le(e){const r=new H(50,1,.2,1.4),o=new U(r),n=new M(e.color);o.setColors(n,n,n,n,n),o.name=`Collaboration camera: ${e.displayName}`,o.userData.editorOnly=!0;const c=document.createElement("canvas");c.width=256,c.height=64;const p=new k(c);p.colorSpace=J;const d=new K(new ee({map:p,depthTest:!1,transparent:!0}));return d.name=`Collaboration label: ${e.displayName}`,d.userData.editorOnly=!0,d.scale.set(1.8,.45,1),d.renderOrder=1e4,Z(p,e),{camera:r,helper:o,label:d,texture:p,signature:"",targetPosition:new x,targetQuaternion:new te,targetFov:50,initialized:!1}}function de(e,r){const o=r.presence.camera;if(!o)return;e.targetPosition.set(o.x,o.y,o.z);const n=new oe;n.position.copy(e.targetPosition),n.lookAt(o.targetX,o.targetY,o.targetZ),e.targetQuaternion.copy(n.quaternion),e.targetFov=o.fov,e.initialized||(e.initialized=!0,e.camera.position.copy(e.targetPosition),e.camera.quaternion.copy(e.targetQuaternion),e.camera.fov=e.targetFov);const c=`${r.displayName}|${r.kind}|${r.color}|${r.status}`;c!==e.signature&&(e.signature=c,Z(e.texture,r))}function pe(e,r){const o=1-Math.exp(-12*Math.max(0,r));e.camera.position.lerp(e.targetPosition,o),e.camera.quaternion.slerp(e.targetQuaternion,o),e.camera.fov+=(e.targetFov-e.camera.fov)*o,e.camera.updateProjectionMatrix(),e.camera.updateMatrixWorld(!0),e.helper.update(),e.label.position.copy(e.camera.position),e.label.position.y+=.55}function Y(e){e.helper.removeFromParent(),e.label.removeFromParent(),e.helper.dispose(),e.texture.dispose(),e.label.material.dispose()}function ue(e,r){const o=O(e),n=new ne(o,new M(r));return n.name=`Collaboration selection: ${e.name||e.uuid}`,n.userData.editorOnly=!0,n.renderOrder=9999,n.material.depthTest=!1,{object:e,box:o,helper:n}}function b(e){e.helper.removeFromParent(),e.helper.geometry.dispose(),e.helper.material.dispose()}function me(e){if(!e||e.type!=="pointer-ray"||!["originX","originY","originZ","directionX","directionY","directionZ","length"].every(p=>typeof e[p]=="number"&&Number.isFinite(e[p])))return null;const o=new x(e.originX,e.originY,e.originZ),n=new x(e.directionX,e.directionY,e.directionZ),c=Math.min(1e3,Math.max(.1,e.length));return n.lengthSq()<1e-6?null:{origin:o,end:o.clone().add(n.normalize().multiplyScalar(c))}}function Le(e){const{scene:r,store:o,documentId:n,container:c,canvas:p,viewport:d,readVisibleCameraPose:R}=e,y=()=>Q()===n,v=()=>{if(!y())return;const i=R();w({camera:{x:i.position.x,y:i.position.y,z:i.position.z,targetX:i.target.x,targetY:i.target.y,targetZ:i.target.z,fov:i.fov}})};d.orbitControls.addEventListener("change",v);let C=!1;const I=i=>{const s=i.value===!0;C=s,y()&&w({gesture:s?{type:"transform",selection:[...o.shell.selectedEntityIds]}:null})};d.transformControls.addEventListener("dragging-changed",I);const S=new G,P=new W,z=i=>{if(C||i.buttons!==0||!y())return;const s=p.getBoundingClientRect();if(s.width<=0||s.height<=0)return;P.set((i.clientX-s.left)/s.width*2-1,-((i.clientY-s.top)/s.height)*2+1),S.setFromCamera(P,d.renderCamera);const l=S.ray,g=R();w({gesture:{type:"pointer-ray",originX:l.origin.x,originY:l.origin.y,originZ:l.origin.z,directionX:l.direction.x,directionY:l.direction.y,directionZ:l.direction.z,length:Math.max(2,g.position.distanceTo(g.target))}})},E=()=>{!C&&y()&&w({gesture:null})};c.addEventListener("pointermove",z),c.addEventListener("pointerleave",E),v();const m=new Map,u=new Map,f=new Map;let L=-1;const q=()=>{const i=A();if(!i||i.sequence===L)return;L=i.sequence;const s=i.participants.filter(t=>t.participantId!==j&&t.presence.document===n),l=s.filter(t=>t.presence.camera),g=new Set(l.map(t=>t.participantId));for(const[t,a]of m)g.has(t)||(Y(a),m.delete(t));for(const t of l){let a=m.get(t.participantId);a||(a=le(t),m.set(t.participantId,a),r.add(a.helper,a.label)),de(a,t)}const F=s.flatMap(t=>t.presence.selection.slice(0,20).map(a=>({key:`${t.participantId}:${a}`,objectId:a,color:t.color}))),B=new Set(F.map(t=>t.key));for(const[t,a]of u)B.has(t)||(b(a),u.delete(t));for(const t of F){const a=o.objectMap.get(t.objectId),h=u.get(t.key);if(!a){h&&(b(h),u.delete(t.key));continue}if(h?.object===a)continue;h&&b(h);const $=ue(a,t.color);u.set(t.key,$),r.add($.helper)}const X=s.flatMap(t=>{const a=me(t.presence.gesture);return a?[{participantId:t.participantId,color:t.color,ray:a}]:[]}),N=new Set(X.map(t=>t.participantId));for(const[t,a]of f)N.has(t)||(D(a),f.delete(t));for(const t of X){let a=f.get(t.participantId);a||(a=fe(t.color),f.set(t.participantId,a),r.add(a.line)),ge(a,t.ray)}},T=i=>{if(!y())return;const s=i.detail?.participantId;if(typeof s!="string")return;const l=A()?.participants.find(g=>g.participantId===s)?.presence.camera;l&&o.shell.setCameraPose({x:l.x,y:l.y,z:l.z},{x:l.targetX,y:l.targetY,z:l.targetZ},l.fov)};return window.addEventListener("editor:collaboration-join",T),{reportCamera:v,syncMarkers:i=>{q();for(const s of m.values())pe(s,i);for(const s of u.values())O(s.object,s.box)},live:()=>m.size+u.size+f.size>0,dispose:()=>{d.orbitControls.removeEventListener("change",v),d.transformControls.removeEventListener("dragging-changed",I),c.removeEventListener("pointermove",z),c.removeEventListener("pointerleave",E),window.removeEventListener("editor:collaboration-join",T);for(const i of m.values())Y(i);m.clear();for(const i of u.values())b(i);u.clear();for(const i of f.values())D(i);f.clear()}}}function fe(e){const r=new re(new Float32Array(6),3),o=new ie;o.setAttribute("position",r);const n=new ae({color:new M(e),depthTest:!1,transparent:!0,opacity:.9}),c=new se(o,n);return c.name="Collaboration pointer ray",c.userData.editorOnly=!0,c.renderOrder=10001,{line:c,positions:r}}function ge(e,r){e.positions.setXYZ(0,r.origin.x,r.origin.y,r.origin.z),e.positions.setXYZ(1,r.end.x,r.end.y,r.end.z),e.positions.needsUpdate=!0,e.line.geometry.computeBoundingSphere()}function D(e){e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()}export{Le as bindStagePresenceMarkers};
1
+ import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{dy as A,ap as j,y as Q,dz as V,dA as _}from"./index-BYdQuKKk.js";import{a as O}from"./content-bounds-BzOnMMA9.js";import{r as w}from"./collaboration-presence-3cLXKw77.js";import{e6 as G,fd as W,d9 as H,S as U,_ as M,T as k,ej as J,eE as K,eF as ee,dp as te,fo as x,cW as oe,J as ne,a$ as re,N as ie,bX as ae,bV as se}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./hierarchy-marks-BjIT-DOf.js";import"./workspace-arrangement-DwFkSdlq.js";function ce(){const e=document.querySelector(`.${V}`);return(e?getComputedStyle(e).getPropertyValue("--volter-content-on-accent").trim():"")||_.color.content.onAccent}function Z(e,r){const o=e.image,n=o.getContext("2d");if(!n)return;n.clearRect(0,0,o.width,o.height),n.fillStyle=r.color,n.beginPath(),n.roundRect(2,2,o.width-4,o.height-4,16),n.fill(),n.fillStyle=ce(),n.font="600 22px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle";const c=r.kind==="agent"?" · AI":"";n.fillText(`${r.displayName}${c}`,o.width/2,o.height/2,238),e.needsUpdate=!0}function le(e){const r=new H(50,1,.2,1.4),o=new U(r),n=new M(e.color);o.setColors(n,n,n,n,n),o.name=`Collaboration camera: ${e.displayName}`,o.userData.editorOnly=!0;const c=document.createElement("canvas");c.width=256,c.height=64;const p=new k(c);p.colorSpace=J;const d=new K(new ee({map:p,depthTest:!1,transparent:!0}));return d.name=`Collaboration label: ${e.displayName}`,d.userData.editorOnly=!0,d.scale.set(1.8,.45,1),d.renderOrder=1e4,Z(p,e),{camera:r,helper:o,label:d,texture:p,signature:"",targetPosition:new x,targetQuaternion:new te,targetFov:50,initialized:!1}}function de(e,r){const o=r.presence.camera;if(!o)return;e.targetPosition.set(o.x,o.y,o.z);const n=new oe;n.position.copy(e.targetPosition),n.lookAt(o.targetX,o.targetY,o.targetZ),e.targetQuaternion.copy(n.quaternion),e.targetFov=o.fov,e.initialized||(e.initialized=!0,e.camera.position.copy(e.targetPosition),e.camera.quaternion.copy(e.targetQuaternion),e.camera.fov=e.targetFov);const c=`${r.displayName}|${r.kind}|${r.color}|${r.status}`;c!==e.signature&&(e.signature=c,Z(e.texture,r))}function pe(e,r){const o=1-Math.exp(-12*Math.max(0,r));e.camera.position.lerp(e.targetPosition,o),e.camera.quaternion.slerp(e.targetQuaternion,o),e.camera.fov+=(e.targetFov-e.camera.fov)*o,e.camera.updateProjectionMatrix(),e.camera.updateMatrixWorld(!0),e.helper.update(),e.label.position.copy(e.camera.position),e.label.position.y+=.55}function Y(e){e.helper.removeFromParent(),e.label.removeFromParent(),e.helper.dispose(),e.texture.dispose(),e.label.material.dispose()}function ue(e,r){const o=O(e),n=new ne(o,new M(r));return n.name=`Collaboration selection: ${e.name||e.uuid}`,n.userData.editorOnly=!0,n.renderOrder=9999,n.material.depthTest=!1,{object:e,box:o,helper:n}}function b(e){e.helper.removeFromParent(),e.helper.geometry.dispose(),e.helper.material.dispose()}function me(e){if(!e||e.type!=="pointer-ray"||!["originX","originY","originZ","directionX","directionY","directionZ","length"].every(p=>typeof e[p]=="number"&&Number.isFinite(e[p])))return null;const o=new x(e.originX,e.originY,e.originZ),n=new x(e.directionX,e.directionY,e.directionZ),c=Math.min(1e3,Math.max(.1,e.length));return n.lengthSq()<1e-6?null:{origin:o,end:o.clone().add(n.normalize().multiplyScalar(c))}}function Le(e){const{scene:r,store:o,documentId:n,container:c,canvas:p,viewport:d,readVisibleCameraPose:R}=e,y=()=>Q()===n,v=()=>{if(!y())return;const i=R();w({camera:{x:i.position.x,y:i.position.y,z:i.position.z,targetX:i.target.x,targetY:i.target.y,targetZ:i.target.z,fov:i.fov}})};d.orbitControls.addEventListener("change",v);let C=!1;const I=i=>{const s=i.value===!0;C=s,y()&&w({gesture:s?{type:"transform",selection:[...o.shell.selectedEntityIds]}:null})};d.transformControls.addEventListener("dragging-changed",I);const S=new G,P=new W,z=i=>{if(C||i.buttons!==0||!y())return;const s=p.getBoundingClientRect();if(s.width<=0||s.height<=0)return;P.set((i.clientX-s.left)/s.width*2-1,-((i.clientY-s.top)/s.height)*2+1),S.setFromCamera(P,d.renderCamera);const l=S.ray,g=R();w({gesture:{type:"pointer-ray",originX:l.origin.x,originY:l.origin.y,originZ:l.origin.z,directionX:l.direction.x,directionY:l.direction.y,directionZ:l.direction.z,length:Math.max(2,g.position.distanceTo(g.target))}})},E=()=>{!C&&y()&&w({gesture:null})};c.addEventListener("pointermove",z),c.addEventListener("pointerleave",E),v();const m=new Map,u=new Map,f=new Map;let L=-1;const q=()=>{const i=A();if(!i||i.sequence===L)return;L=i.sequence;const s=i.participants.filter(t=>t.participantId!==j&&t.presence.document===n),l=s.filter(t=>t.presence.camera),g=new Set(l.map(t=>t.participantId));for(const[t,a]of m)g.has(t)||(Y(a),m.delete(t));for(const t of l){let a=m.get(t.participantId);a||(a=le(t),m.set(t.participantId,a),r.add(a.helper,a.label)),de(a,t)}const F=s.flatMap(t=>t.presence.selection.slice(0,20).map(a=>({key:`${t.participantId}:${a}`,objectId:a,color:t.color}))),B=new Set(F.map(t=>t.key));for(const[t,a]of u)B.has(t)||(b(a),u.delete(t));for(const t of F){const a=o.objectMap.get(t.objectId),h=u.get(t.key);if(!a){h&&(b(h),u.delete(t.key));continue}if(h?.object===a)continue;h&&b(h);const $=ue(a,t.color);u.set(t.key,$),r.add($.helper)}const X=s.flatMap(t=>{const a=me(t.presence.gesture);return a?[{participantId:t.participantId,color:t.color,ray:a}]:[]}),N=new Set(X.map(t=>t.participantId));for(const[t,a]of f)N.has(t)||(D(a),f.delete(t));for(const t of X){let a=f.get(t.participantId);a||(a=fe(t.color),f.set(t.participantId,a),r.add(a.line)),ge(a,t.ray)}},T=i=>{if(!y())return;const s=i.detail?.participantId;if(typeof s!="string")return;const l=A()?.participants.find(g=>g.participantId===s)?.presence.camera;l&&o.shell.setCameraPose({x:l.x,y:l.y,z:l.z},{x:l.targetX,y:l.targetY,z:l.targetZ},l.fov)};return window.addEventListener("editor:collaboration-join",T),{reportCamera:v,syncMarkers:i=>{q();for(const s of m.values())pe(s,i);for(const s of u.values())O(s.object,s.box)},live:()=>m.size+u.size+f.size>0,dispose:()=>{d.orbitControls.removeEventListener("change",v),d.transformControls.removeEventListener("dragging-changed",I),c.removeEventListener("pointermove",z),c.removeEventListener("pointerleave",E),window.removeEventListener("editor:collaboration-join",T);for(const i of m.values())Y(i);m.clear();for(const i of u.values())b(i);u.clear();for(const i of f.values())D(i);f.clear()}}}function fe(e){const r=new re(new Float32Array(6),3),o=new ie;o.setAttribute("position",r);const n=new ae({color:new M(e),depthTest:!1,transparent:!0,opacity:.9}),c=new se(o,n);return c.name="Collaboration pointer ray",c.userData.editorOnly=!0,c.renderOrder=10001,{line:c,positions:r}}function ge(e,r){e.positions.setXYZ(0,r.origin.x,r.origin.y,r.origin.z),e.positions.setXYZ(1,r.end.x,r.end.y,r.end.z),e.positions.needsUpdate=!0,e.line.geometry.computeBoundingSphere()}function D(e){e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()}export{Le as bindStagePresenceMarkers};
@@ -1 +1 @@
1
- import{a}from"./jsx-runtime-DPjLkJKQ.js";import{bn as n,bo as m,U as l,bp as f,e3 as c,bs as S}from"./index-FuK_gLVP.js";import{r as e}from"./index-nmcBqr7Y.js";import{t as T}from"./StageHost-BStYoTUX.js";import{t as u}from"./editor-shell-store-BMZxpcut.js";import{T as h,a as g}from"./Toolbar-BOhrx3BY.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three-state-DNgFvLbw.js";import"./standard-viewport-dressing-wQb-yfhP.js";import"./content-bounds-CaZcBNYF.js";import"./hierarchy-marks-CyrGt6dv.js";import"./workspace-arrangement-avVz3tND.js";import"./three.core-3arARmh6.js";import"./editor-layers-D-sKmDua.js";import"./environment-Dg-YaLsA.js";import"./three.module-BLhyNg0e.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-thHakLdm.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./three-integration-UeCSuDl8.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-CmpZSo8j.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-n5yOZ3A6.js";import"./studio-environment-Bj3Hi-UK.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-yyskXT42.js";import"./entity-object-Ai-uXVow.js";import"./three-contract-Dkt6PmWY.js";import"./component-instance-root-BNDWrUkC.js";import"./viewport-door-BfcEF1aj.js";import"./asset-preview-D_mr_kfU.js";import"./bitmap-label-Ct4k6ehY.js";import"./model-inspection-CRXVM5Wz.js";import"./three-viewport-presentation-5KZ0zq__.js";import"./clip-planes-CnAI6DZn.js";import"./three-CQVC3sHg.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-Rs5Y89nN.js";import"./source-object3d-authoring-adapter-Ckfk03in.js";import"./three-projection-core-Ckpx-u5r.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-B6uA0CS2.js";import"./viewport-surface-status-B-dxhyXW.js";import"./transform-mode-request-B6ZoHm8Z.js";const s=new WeakMap;function b(r,t){if(r===null)return;const o=s.get(r)??new Set;if(s.set(r,o),o.has(t))return;o.add(t);const i={select:"select",transform:"combined",move:"translate",rotate:"rotate",scale:"scale"};r.shell.setTransformMode(i[S(t).interaction.bootTool])}function Mr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l(),o=T(r),i=f(r);if(e.useEffect(()=>{o==="gizmo"&&b(i&&u(i),r)},[o,i,r]),o==="none")return null;const p=o==="modal"?c(r):null;return a.jsx(g,{store:i??t,...p?{door:p}:{}})}function Or({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l();return a.jsx(h,{store:f(r)??t})}export{Or as ThreeStageTransformControls,Mr as ThreeStageTransformTools};
1
+ import{a}from"./jsx-runtime-DPjLkJKQ.js";import{bn as n,bo as m,U as l,bp as f,e3 as c,bs as S}from"./index-BYdQuKKk.js";import{r as e}from"./index-nmcBqr7Y.js";import{t as T}from"./StageHost-DooxiRtf.js";import{t as u}from"./editor-shell-store-LRVyeXM-.js";import{T as h,a as g}from"./Toolbar-BthqVrvk.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three-state-ctKrzvps.js";import"./standard-viewport-dressing-DpCqZowy.js";import"./content-bounds-BzOnMMA9.js";import"./hierarchy-marks-BjIT-DOf.js";import"./workspace-arrangement-DwFkSdlq.js";import"./three.core-3arARmh6.js";import"./editor-layers-wmPhuj0X.js";import"./environment-Dg-YaLsA.js";import"./three.module-BLhyNg0e.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-CJW19F-2.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./three-integration-BzTWd5jX.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-C73ZQGcv.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-BSBXqm11.js";import"./studio-environment-BXrrTMN4.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-RFHXjepL.js";import"./entity-object-DWKBk3rf.js";import"./three-contract-Dkt6PmWY.js";import"./component-instance-root-z47Ib-DX.js";import"./viewport-door-BW0xEXr5.js";import"./asset-preview-DeoFAm2V.js";import"./bitmap-label-Ct4k6ehY.js";import"./model-inspection-CRQL0kkD.js";import"./three-viewport-presentation-Zf87KDhY.js";import"./clip-planes-CnAI6DZn.js";import"./three-D4bun8tv.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-C0vuzmLH.js";import"./source-object3d-authoring-adapter-PbUdA5Q2.js";import"./three-projection-core-DTAhpWX4.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-CwOW82Og.js";import"./viewport-surface-status-CO8m-4fj.js";import"./transform-mode-request-D9k3BUHW.js";const s=new WeakMap;function b(r,t){if(r===null)return;const o=s.get(r)??new Set;if(s.set(r,o),o.has(t))return;o.add(t);const i={select:"select",transform:"combined",move:"translate",rotate:"rotate",scale:"scale"};r.shell.setTransformMode(i[S(t).interaction.bootTool])}function Mr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l(),o=T(r),i=f(r);if(e.useEffect(()=>{o==="gizmo"&&b(i&&u(i),r)},[o,i,r]),o==="none")return null;const p=o==="modal"?c(r):null;return a.jsx(g,{store:i??t,...p?{door:p}:{}})}function Or({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l();return a.jsx(h,{store:f(r)??t})}export{Or as ThreeStageTransformControls,Mr as ThreeStageTransformTools};
@@ -1,4 +1,4 @@
1
- import{a as nt}from"./content-bounds-CaZcBNYF.js";import{EDITOR_LAYER as bt}from"./editor-layers-D-sKmDua.js";import{loadEnvironmentImage as St}from"./environment-Dg-YaLsA.js";import{s as Y}from"./user-data-thHakLdm.js";import{P as Z,S as J}from"./three.module-BLhyNg0e.js";import{fp as xt,fq as kt,Z as It}from"./index-FuK_gLVP.js";import{aE as q,bh as tt,j as Ft,I as Pt,co as Ct,db as Gt,fo as et,ap as Tt,e as Et,A as Rt,cP as _t,cj as d,_ as f,au as it,dw as rt,bi as Dt,aT as $t,c7 as Ot,c1 as z,ej as st,bg as At,aw as Bt,cx as Lt}from"./three.core-3arARmh6.js";let at=0;function zt(){at++}function se(){return at}const Ht=[.8,.5,-1],N=new f(1975600),U=new f(5004144);function lt(){const i=typeof document>"u"?null:document.querySelector("[data-volter-palette]");if(!i)return{bottom:N.clone(),top:U.clone()};const t=getComputedStyle(i),o=document.createElement("canvas");o.width=o.height=1;const e=o.getContext("2d"),r=(s,u)=>{const p=t.getPropertyValue(s).trim();if(!e||!p||!CSS.supports("color",p))return u.clone();e.fillStyle=u.getStyle(),e.fillRect(0,0,1,1),e.fillStyle=t.getPropertyValue("--volter-surface-shell").trim(),e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);const[y,l,M]=e.getImageData(0,0,1,1).data;return new f().setRGB(y/255,l/255,M/255,st)},n=r("--volter-surface-panel",N),a=r("--volter-surface-raised",U),h=n.lerp(N,.25).lerp(new f(16777215),.03),c=a.lerp(U,.25).lerp(new f(16777215),.04);return{bottom:h,top:c}}function Nt(i){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-volter-palette]");if(!t)return()=>{};const o=new MutationObserver(()=>{i(),zt()});return o.observe(t,{attributes:!0,attributeFilter:["data-volter-palette","data-volter-material"]}),()=>o.disconnect()}function ct(i=lt()){const o=new Uint8Array(512),e=new f;for(let n=0;n<128;n++)e.copy(i.bottom).lerp(i.top,n/127).convertLinearToSRGB(),o[n*4]=Math.round(e.r*255),o[n*4+1]=Math.round(e.g*255),o[n*4+2]=Math.round(e.b*255),o[n*4+3]=255;const r=new it(o,1,128,rt);return r.colorSpace=st,r.magFilter=z,r.minFilter=z,r.needsUpdate=!0,r}function Ut(i){const t=nt(i);if(t.isEmpty())return{size:50,centre:[0,0]};const o=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(o/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function Wt(i){for(const t of[1,2,5,10])if(i/t<=60)return Math.round(i/t);return Math.round(i/10)}function ut(i,t){const o=t/2,e=o*.55,r=o;i.onBeforeCompile=n=>{n.uniforms.uGridFadeStart={value:e},n.uniforms.uGridFadeEnd={value:r},n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
1
+ import{a as nt}from"./content-bounds-BzOnMMA9.js";import{EDITOR_LAYER as bt}from"./editor-layers-wmPhuj0X.js";import{loadEnvironmentImage as St}from"./environment-Dg-YaLsA.js";import{s as Y}from"./user-data-CJW19F-2.js";import{P as Z,S as J}from"./three.module-BLhyNg0e.js";import{fp as xt,fq as kt,Z as It}from"./index-BYdQuKKk.js";import{aE as q,bh as tt,j as Ft,I as Pt,co as Ct,db as Gt,fo as et,ap as Tt,e as Et,A as Rt,cP as _t,cj as d,_ as f,au as it,dw as rt,bi as Dt,aT as $t,c7 as Ot,c1 as z,ej as st,bg as At,aw as Bt,cx as Lt}from"./three.core-3arARmh6.js";let at=0;function zt(){at++}function se(){return at}const Ht=[.8,.5,-1],N=new f(1975600),U=new f(5004144);function lt(){const i=typeof document>"u"?null:document.querySelector("[data-volter-palette]");if(!i)return{bottom:N.clone(),top:U.clone()};const t=getComputedStyle(i),o=document.createElement("canvas");o.width=o.height=1;const e=o.getContext("2d"),r=(s,u)=>{const p=t.getPropertyValue(s).trim();if(!e||!p||!CSS.supports("color",p))return u.clone();e.fillStyle=u.getStyle(),e.fillRect(0,0,1,1),e.fillStyle=t.getPropertyValue("--volter-surface-shell").trim(),e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);const[y,l,M]=e.getImageData(0,0,1,1).data;return new f().setRGB(y/255,l/255,M/255,st)},n=r("--volter-surface-panel",N),a=r("--volter-surface-raised",U),h=n.lerp(N,.25).lerp(new f(16777215),.03),c=a.lerp(U,.25).lerp(new f(16777215),.04);return{bottom:h,top:c}}function Nt(i){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-volter-palette]");if(!t)return()=>{};const o=new MutationObserver(()=>{i(),zt()});return o.observe(t,{attributes:!0,attributeFilter:["data-volter-palette","data-volter-material"]}),()=>o.disconnect()}function ct(i=lt()){const o=new Uint8Array(512),e=new f;for(let n=0;n<128;n++)e.copy(i.bottom).lerp(i.top,n/127).convertLinearToSRGB(),o[n*4]=Math.round(e.r*255),o[n*4+1]=Math.round(e.g*255),o[n*4+2]=Math.round(e.b*255),o[n*4+3]=255;const r=new it(o,1,128,rt);return r.colorSpace=st,r.magFilter=z,r.minFilter=z,r.needsUpdate=!0,r}function Ut(i){const t=nt(i);if(t.isEmpty())return{size:50,centre:[0,0]};const o=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(o/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function Wt(i){for(const t of[1,2,5,10])if(i/t<=60)return Math.round(i/t);return Math.round(i/10)}function ut(i,t){const o=t/2,e=o*.55,r=o;i.onBeforeCompile=n=>{n.uniforms.uGridFadeStart={value:e},n.uniforms.uGridFadeEnd={value:r},n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
2
2
  varying vec2 vGridPlanePosition;`).replace("#include <begin_vertex>",`#include <begin_vertex>
3
3
  vGridPlanePosition = position.xz;`),n.fragmentShader=n.fragmentShader.replace("#include <common>",`#include <common>
4
4
  varying vec2 vGridPlanePosition;
@@ -1 +1 @@
1
- import{r as t}from"./index-FuK_gLVP.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const n="workspace.action",l=[{id:"state-watch",label:"Open State Watch",execute:()=>t().workspace.showUtility("tool:state-watch.utility")}];export{l as actions,n as point};
1
+ import{r as t}from"./index-BYdQuKKk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const n="workspace.action",l=[{id:"state-watch",label:"Open State Watch",execute:()=>t().workspace.showUtility("tool:state-watch.utility")}];export{l as actions,n as point};
@@ -1 +1 @@
1
- import{r as t,am as e}from"./index-FuK_gLVP.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 l="workspace.menu",n={menu:"debug",items:[{id:"state-watch",label:"State Watch",testId:"menu-state-watch",disabled:()=>e()==null,execute:()=>t().workspace.showUtility("tool:state-watch.utility")}]};export{n as menu,l as point};
1
+ import{r as t,am as e}from"./index-BYdQuKKk.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 l="workspace.menu",n={menu:"debug",items:[{id:"state-watch",label:"State Watch",testId:"menu-state-watch",disabled:()=>e()==null,execute:()=>t().workspace.showUtility("tool:state-watch.utility")}]};export{n as menu,l as point};
@@ -1 +1 @@
1
- import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{am as S,al as o,aN as B,a6 as L,r as A,eJ as H}from"./index-FuK_gLVP.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const F=250,M=200,P=500,z="stateWatchPins";function x(e){return JSON.stringify([e.provider,...e.path])}function y(e){return[e.provider,...e.path].join(".")}function N(){return A().projectLocalState.projectRootPath()??"__unscoped__"}function k(e){const t=A().projectLocalState.read(z);return Array.isArray(t)?t.filter(r=>typeof r?.provider=="string"&&Array.isArray(r.path)&&r.path.every(s=>typeof s=="string")):[]}function D(e,t){A().projectLocalState.write(z,t.map(r=>({provider:r.provider,path:[...r.path]})))}function j(e){return e!==null&&typeof e=="object"}function O(e){if(typeof e=="string")return`“${e}”`;if(typeof e=="number")return Number.isInteger(e)?String(e):e.toFixed(3);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="bigint")return`${e}n`;if(typeof e=="function")return"[Function]";if(j(e))try{return Array.isArray(e)?`Array(${e.length})`:`Object(${Object.keys(e).length})`}catch{return"[Unreadable object]"}return String(e)}function _(e){try{return Object.entries(e)}catch{return[]}}function V(e,t){try{if(!Object.hasOwn(e,t.provider))return{available:!1,value:void 0};let r=e[t.provider];for(const s of t.path){if(!j(r)||!Object.hasOwn(r,s))return{available:!1,value:void 0};r=r[s]}return{available:!0,value:r}}catch{return{available:!1,value:void 0}}}function R(e,t,r,s,l,c){if(l.length>=P)return;const g=j(t)&&c.includes(t);if(!j(t)||g){const a={provider:e,path:r,value:g?"[Circular]":t};(y(a).toLowerCase().includes(s)||O(a.value).toLowerCase().includes(s))&&l.push(a);return}const p=[...c,t],m=_(t);if(m.length===0){const a={provider:e,path:r,value:t};y(a).toLowerCase().includes(s)&&l.push(a);return}for(const[a,v]of m)if(R(e,v,[...r,a],s,l,p),l.length>=P)return}const C={fontFamily:o.typography.mono,fontSize:11};function T({leaf:e,pinned:t,onTogglePin:r,depth:s=0}){const l=e.path.at(-1)??e.provider;return n.jsxs("div",{style:{...C,minHeight:22,display:"grid",gridTemplateColumns:"minmax(100px, 0.65fr) minmax(120px, 1fr) auto",alignItems:"center",gap:8,paddingLeft:8+s*14,paddingRight:8,borderBottom:`1px solid ${o.boundary.default}`},title:y(e),children:[n.jsx("span",{style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:l}),n.jsx("span",{style:{color:o.content.muted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O(e.value)}),n.jsx(L,{type:"button",size:"compact",variant:t?"primary":"secondary","aria-pressed":t,title:t?`Remove ${y(e)} from watches`:`Watch ${y(e)}`,onClick:()=>r(e),children:t?"Pinned":"Pin"})]})}function W({provider:e,name:t,value:r,path:s,depth:l,ancestors:c,pinnedKeys:g,onTogglePin:p}){const m=j(r)&&c.includes(r),[a,v]=d.useState(l===0);if(!j(r)||m){const f={provider:e,path:s,value:m?"[Circular]":r};return n.jsx(T,{leaf:f,depth:l,pinned:g.has(x(f)),onTogglePin:p})}const h=_(r),b=h.slice(0,M);return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>v(f=>!f),style:{...C,width:"100%",minHeight:22,display:"flex",alignItems:"center",gap:4,padding:`0 8px 0 ${8+l*14}px`,color:o.content.primary,background:"transparent",border:0,borderBottom:`1px solid ${o.boundary.default}`,textAlign:"left",cursor:"pointer"},children:[n.jsx("span",{style:{width:12,color:o.content.muted},children:n.jsx(H,{direction:a?"down":"right"})}),n.jsx("span",{children:t}),n.jsx("span",{style:{color:o.content.dim},children:Array.isArray(r)?`[${h.length}]`:`{${h.length}}`})]}),a&&b.map(([f,i])=>n.jsx(W,{provider:e,name:f,value:i,path:[...s,f],depth:l+1,ancestors:[...c,r],pinnedKeys:g,onTogglePin:p},f)),a&&h.length>b.length&&n.jsxs("div",{style:{...C,padding:`3px 8px 3px ${8+(l+1)*14}px`,color:o.content.dim},children:[h.length-b.length," more values — narrow with search"]})]})}function E(e){if(!e)return{providers:[],state:{},error:null};let t;try{t=e.providers()}catch(r){return{providers:[],state:{},error:r instanceof Error?r.message:String(r)}}try{return{providers:t,state:e.stateAll(),error:null}}catch(r){return{providers:t,state:{},error:r instanceof Error?r.message:String(r)}}}function J(){const e=N(),[t,r]=d.useState(()=>E(S())),[s,l]=d.useState(!1),[c,g]=d.useState(""),[p,m]=d.useState(()=>k());d.useEffect(()=>m(k()),[e]);const a=d.useCallback(()=>r(E(S())),[]);d.useEffect(()=>{if(a(),s)return;const i=window.setInterval(a,F);return()=>window.clearInterval(i)},[s,a]);const v=d.useMemo(()=>new Set(p.map(x)),[p]),h=d.useCallback(i=>{m(u=>{const w=x(i),I=u.some($=>x($)===w)?u.filter($=>x($)!==w):[...u,{provider:i.provider,path:[...i.path]}];return D(e,I),I})},[e]),b=d.useMemo(()=>{const i=c.trim().toLowerCase();if(!i)return[];const u=[];for(const w of t.providers)R(w.name,t.state[w.name],[],i,u,[]);return u},[c,t]);return S()?n.jsxs("div",{style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:{minHeight:34,display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx(B,{value:c,onChange:i=>g(i.target.value),placeholder:"Filter state paths or values…","aria-label":"Filter state watches",style:{width:240}}),n.jsx(L,{type:"button",size:"compact",onClick:()=>l(i=>!i),children:s?"Resume":"Pause"}),n.jsx(L,{type:"button",size:"compact",disabled:!s,onClick:a,children:"Refresh"}),n.jsxs("span",{style:{color:o.content.dim,fontSize:10},children:[t.providers.length," provider",t.providers.length===1?"":"s"," ·"," ",p.length," pinned",s?" · paused":""]}),t.error&&n.jsx("span",{style:{color:o.semantic.danger,fontSize:10},children:t.error})]}),n.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"minmax(280px, 1fr) minmax(240px, 0.65fr)"},children:[n.jsxs("section",{"aria-label":"Live state",style:{minWidth:0,overflow:"auto"},children:[c.trim()?b.length>0?b.map(i=>n.jsx(T,{leaf:i,pinned:v.has(x(i)),onTogglePin:h},x(i))):n.jsxs("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:["No state values match “",c.trim(),"”."]}):t.providers.map(i=>n.jsx(W,{provider:i.name,name:`${i.name} · ${i.tier}`,value:t.state[i.name],path:[],depth:0,ancestors:[],pinnedKeys:v,onTogglePin:h},i.name)),t.providers.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"The running game has not registered any state providers."})]}),n.jsxs("aside",{"aria-label":"Pinned watches",style:{minWidth:0,overflow:"auto",borderLeft:`1px solid ${o.boundary.default}`},children:[n.jsx("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 8px",color:o.content.muted,background:o.surface.panel,borderBottom:`1px solid ${o.boundary.default}`,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Watches"}),p.map(i=>{const u=V(t.state,i);return n.jsxs("div",{style:{...C,display:"grid",gridTemplateColumns:"minmax(130px, 1fr) minmax(100px, 0.7fr) auto",alignItems:"center",gap:8,minHeight:24,padding:"2px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx("span",{title:y(i),style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:y(i)}),n.jsx("span",{style:{color:u.available?o.content.muted:o.content.dim,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.available?O(u.value):"unavailable"}),n.jsx(L,{type:"button",size:"compact",onClick:()=>h(i),children:"Remove"})]},x(i))}),p.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"Pin values from the live tree to keep them visible while you inspect the game."})]})]})]}):n.jsx("div",{style:{padding:12,color:o.content.muted,fontSize:11},children:"State Watch is available while a game with debug providers is running."})}const te="workspace.utility",re="State Watch",ne=19,ie=()=>S()!=null;function oe(){return n.jsx(J,{})}export{ie as available,oe as default,ne as order,te as point,re as title};
1
+ import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{am as S,al as o,aN as B,a6 as L,r as A,eJ as H}from"./index-BYdQuKKk.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const F=250,M=200,P=500,z="stateWatchPins";function x(e){return JSON.stringify([e.provider,...e.path])}function y(e){return[e.provider,...e.path].join(".")}function N(){return A().projectLocalState.projectRootPath()??"__unscoped__"}function k(e){const t=A().projectLocalState.read(z);return Array.isArray(t)?t.filter(r=>typeof r?.provider=="string"&&Array.isArray(r.path)&&r.path.every(s=>typeof s=="string")):[]}function D(e,t){A().projectLocalState.write(z,t.map(r=>({provider:r.provider,path:[...r.path]})))}function j(e){return e!==null&&typeof e=="object"}function O(e){if(typeof e=="string")return`“${e}”`;if(typeof e=="number")return Number.isInteger(e)?String(e):e.toFixed(3);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="bigint")return`${e}n`;if(typeof e=="function")return"[Function]";if(j(e))try{return Array.isArray(e)?`Array(${e.length})`:`Object(${Object.keys(e).length})`}catch{return"[Unreadable object]"}return String(e)}function _(e){try{return Object.entries(e)}catch{return[]}}function V(e,t){try{if(!Object.hasOwn(e,t.provider))return{available:!1,value:void 0};let r=e[t.provider];for(const s of t.path){if(!j(r)||!Object.hasOwn(r,s))return{available:!1,value:void 0};r=r[s]}return{available:!0,value:r}}catch{return{available:!1,value:void 0}}}function R(e,t,r,s,l,c){if(l.length>=P)return;const g=j(t)&&c.includes(t);if(!j(t)||g){const a={provider:e,path:r,value:g?"[Circular]":t};(y(a).toLowerCase().includes(s)||O(a.value).toLowerCase().includes(s))&&l.push(a);return}const p=[...c,t],m=_(t);if(m.length===0){const a={provider:e,path:r,value:t};y(a).toLowerCase().includes(s)&&l.push(a);return}for(const[a,v]of m)if(R(e,v,[...r,a],s,l,p),l.length>=P)return}const C={fontFamily:o.typography.mono,fontSize:11};function T({leaf:e,pinned:t,onTogglePin:r,depth:s=0}){const l=e.path.at(-1)??e.provider;return n.jsxs("div",{style:{...C,minHeight:22,display:"grid",gridTemplateColumns:"minmax(100px, 0.65fr) minmax(120px, 1fr) auto",alignItems:"center",gap:8,paddingLeft:8+s*14,paddingRight:8,borderBottom:`1px solid ${o.boundary.default}`},title:y(e),children:[n.jsx("span",{style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:l}),n.jsx("span",{style:{color:o.content.muted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O(e.value)}),n.jsx(L,{type:"button",size:"compact",variant:t?"primary":"secondary","aria-pressed":t,title:t?`Remove ${y(e)} from watches`:`Watch ${y(e)}`,onClick:()=>r(e),children:t?"Pinned":"Pin"})]})}function W({provider:e,name:t,value:r,path:s,depth:l,ancestors:c,pinnedKeys:g,onTogglePin:p}){const m=j(r)&&c.includes(r),[a,v]=d.useState(l===0);if(!j(r)||m){const f={provider:e,path:s,value:m?"[Circular]":r};return n.jsx(T,{leaf:f,depth:l,pinned:g.has(x(f)),onTogglePin:p})}const h=_(r),b=h.slice(0,M);return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>v(f=>!f),style:{...C,width:"100%",minHeight:22,display:"flex",alignItems:"center",gap:4,padding:`0 8px 0 ${8+l*14}px`,color:o.content.primary,background:"transparent",border:0,borderBottom:`1px solid ${o.boundary.default}`,textAlign:"left",cursor:"pointer"},children:[n.jsx("span",{style:{width:12,color:o.content.muted},children:n.jsx(H,{direction:a?"down":"right"})}),n.jsx("span",{children:t}),n.jsx("span",{style:{color:o.content.dim},children:Array.isArray(r)?`[${h.length}]`:`{${h.length}}`})]}),a&&b.map(([f,i])=>n.jsx(W,{provider:e,name:f,value:i,path:[...s,f],depth:l+1,ancestors:[...c,r],pinnedKeys:g,onTogglePin:p},f)),a&&h.length>b.length&&n.jsxs("div",{style:{...C,padding:`3px 8px 3px ${8+(l+1)*14}px`,color:o.content.dim},children:[h.length-b.length," more values — narrow with search"]})]})}function E(e){if(!e)return{providers:[],state:{},error:null};let t;try{t=e.providers()}catch(r){return{providers:[],state:{},error:r instanceof Error?r.message:String(r)}}try{return{providers:t,state:e.stateAll(),error:null}}catch(r){return{providers:t,state:{},error:r instanceof Error?r.message:String(r)}}}function J(){const e=N(),[t,r]=d.useState(()=>E(S())),[s,l]=d.useState(!1),[c,g]=d.useState(""),[p,m]=d.useState(()=>k());d.useEffect(()=>m(k()),[e]);const a=d.useCallback(()=>r(E(S())),[]);d.useEffect(()=>{if(a(),s)return;const i=window.setInterval(a,F);return()=>window.clearInterval(i)},[s,a]);const v=d.useMemo(()=>new Set(p.map(x)),[p]),h=d.useCallback(i=>{m(u=>{const w=x(i),I=u.some($=>x($)===w)?u.filter($=>x($)!==w):[...u,{provider:i.provider,path:[...i.path]}];return D(e,I),I})},[e]),b=d.useMemo(()=>{const i=c.trim().toLowerCase();if(!i)return[];const u=[];for(const w of t.providers)R(w.name,t.state[w.name],[],i,u,[]);return u},[c,t]);return S()?n.jsxs("div",{style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:{minHeight:34,display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx(B,{value:c,onChange:i=>g(i.target.value),placeholder:"Filter state paths or values…","aria-label":"Filter state watches",style:{width:240}}),n.jsx(L,{type:"button",size:"compact",onClick:()=>l(i=>!i),children:s?"Resume":"Pause"}),n.jsx(L,{type:"button",size:"compact",disabled:!s,onClick:a,children:"Refresh"}),n.jsxs("span",{style:{color:o.content.dim,fontSize:10},children:[t.providers.length," provider",t.providers.length===1?"":"s"," ·"," ",p.length," pinned",s?" · paused":""]}),t.error&&n.jsx("span",{style:{color:o.semantic.danger,fontSize:10},children:t.error})]}),n.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"minmax(280px, 1fr) minmax(240px, 0.65fr)"},children:[n.jsxs("section",{"aria-label":"Live state",style:{minWidth:0,overflow:"auto"},children:[c.trim()?b.length>0?b.map(i=>n.jsx(T,{leaf:i,pinned:v.has(x(i)),onTogglePin:h},x(i))):n.jsxs("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:["No state values match “",c.trim(),"”."]}):t.providers.map(i=>n.jsx(W,{provider:i.name,name:`${i.name} · ${i.tier}`,value:t.state[i.name],path:[],depth:0,ancestors:[],pinnedKeys:v,onTogglePin:h},i.name)),t.providers.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"The running game has not registered any state providers."})]}),n.jsxs("aside",{"aria-label":"Pinned watches",style:{minWidth:0,overflow:"auto",borderLeft:`1px solid ${o.boundary.default}`},children:[n.jsx("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 8px",color:o.content.muted,background:o.surface.panel,borderBottom:`1px solid ${o.boundary.default}`,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Watches"}),p.map(i=>{const u=V(t.state,i);return n.jsxs("div",{style:{...C,display:"grid",gridTemplateColumns:"minmax(130px, 1fr) minmax(100px, 0.7fr) auto",alignItems:"center",gap:8,minHeight:24,padding:"2px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx("span",{title:y(i),style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:y(i)}),n.jsx("span",{style:{color:u.available?o.content.muted:o.content.dim,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.available?O(u.value):"unavailable"}),n.jsx(L,{type:"button",size:"compact",onClick:()=>h(i),children:"Remove"})]},x(i))}),p.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"Pin values from the live tree to keep them visible while you inspect the game."})]})]})]}):n.jsx("div",{style:{padding:12,color:o.content.muted,fontSize:11},children:"State Watch is available while a game with debug providers is running."})}const te="workspace.utility",re="State Watch",ne=19,ie=()=>S()!=null;function oe(){return n.jsx(J,{})}export{ie as available,oe as default,ne as order,te as point,re as title};
@@ -1 +1 @@
1
- import{r as T}from"./react-story-board-DP8miK58.js";import{d as P}from"./bitmap-label-Ct4k6ehY.js";import{b9 as S,ba as M,au as C,bb as $,bc as E,bd as j,be as I,a0 as v,bf as D,bg as R,bh as O,aC as L,av as U}from"./index-FuK_gLVP.js";import{m as k}from"./StoryPreviewMount-BtSW2Lb5.js";import{s as B}from"./story-presentation-BFgjqHVE.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";async function ae(s,o){await S();const r=U(),c=M().filter(e=>C({modulePath:e.modulePath,regions:r}).medium==="dom"),t=document.createElement("canvas");t.width=s,t.height=o;const l=t.getContext("2d");if(!l)throw new Error("UI Canvas preview could not create a 2D output context.");if(c.length===0)return t.toDataURL("image/png");const m=B(c),d=L()?.config.resolution,u={width:d?.width??640,height:d?.height??400},h=new Map,f=new Map;for(const e of c){const n=m.resolve(e,u),[y]=await x(e.modulePath,[e],{width:n.width,height:n.height,capture:v,cropToContent:n.layout!=="fullscreen",layout:n.layout,transparent:!0});if(!y)throw new Error(`No preview rendered for ${e.id}.`);const g=new Image;g.src=`data:${y.mimeType};base64,${y.base64}`,await g.decode(),h.set(e.id,g),f.set(e.id,{width:g.naturalWidth,height:g.naturalHeight})}const i=T(c,m.index,e=>f.get(e.id)),a=Math.min(s/i.width,o/i.height),p=(s-i.width*a)/2,w=(o-i.height*a)/2;for(const[e,n]of i.layouts)l.drawImage(h.get(e),p+n.x*a,w+n.y*a,n.width*a,n.height*a);return t.toDataURL("image/png")}const A="#ffffff",H="#14171c";async function oe(s,o){const{modulePath:r,width:c,height:t}=o;if(!s)throw new Error(`No project is open, so '${r}' cannot be loaded. Open the project first.`);const l=await $(s),m=l.find(e=>e.modulePath===r);if(!m)throw new Error(`'${r}' is not a story file of this project. `+(l.length===0?"This project has no *.stories.tsx / *.stories.ts under src/.":`This project's story files are: ${l.map(e=>e.modulePath).join(", ")}.`));await E(await j(s));let d;try{d=await m.load()}catch(e){throw new Error(`'${r}' failed to import — ${e instanceof Error?e.message:String(e)}`)}const u=await I(r,d);if(!u.ok)throw new Error(u.error);const h=N(r,u.stories,o.story),f=o.capture??v,i=D("three"),a=o.captureThree??(i?(e,n)=>i(e,{...n,...o.camera===void 0?{}:{camera:o.camera},...o.pose===void 0?{}:{pose:o.pose}}):void 0);if((o.camera||o.pose)&&!a)throw new Error(`'${r}': camera/clip parameters need the three capture leg, which this environment cannot provide (no WebGL).`);const p=await x(r,h,{width:c,height:t,capture:f,...a?{captureThree:a}:{},requireThree:!!(o.camera||o.pose)}),w=await _(p,c,t);return{modulePath:r,width:c,height:t,variants:p,contactSheet:w}}function N(s,o,r){if(r===void 0)return o;const c=o.find(t=>t.name===r);if(!c)throw new Error(`'${s}' exports no story named '${r}'. It exports: ${o.map(t=>t.name).join(", ")}.`);return[c]}async function x(s,o,r){const{width:c,height:t,capture:l,captureThree:m,requireThree:d,cropToContent:u=!0}=r,h=document.createElement("div");h.setAttribute("style",`position:fixed;left:-20000px;top:0;width:${c}px;height:${t}px;overflow:hidden;contain:strict;pointer-events:none;background:${r.transparent?"transparent":A};`),document.body.appendChild(h);const f=[];try{for(const i of o){if(m){const e=await m(i.Component,{width:c,height:t}).catch(n=>(R(n)||console.warn(`[story-capture] three mount for '${i.name}' failed — falling back to the DOM leg:`,n instanceof Error?n.stack??n.message:String(n)),null));if(e===null&&d)throw new Error(`story '${i.name}' did not render on the three leg — --azimuth/--elevation/--distance/--clip/--time apply to three (R3F) stories only, and falling back to the DOM leg would silently ignore them. Narrow to a three story with --story <export>, or drop the camera/clip flags.`);if(e!==null){const n=e.indexOf(",");f.push({name:i.name,label:i.label,base64:n>=0?e.slice(n+1):e,mimeType:"image/png"});continue}}const a=document.createElement("div");a.setAttribute("style",`position:relative;width:${c}px;height:${t}px;overflow:hidden;`),r.layout==="padded"&&(a.style.padding="16px"),r.layout==="centered"&&(a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center"),a.style.boxSizing="border-box",h.replaceChildren(a);const p=await O(async()=>{const e=await k(a,s,i.name,i.Component);return await W(a),e});await p.settled();const w=p.result;try{const e=await l(h,{canvasFrame:p.frame,cropToContent:u,...r.transparent?{allowTransparent:!0}:{}});f.push({name:i.name,label:i.label,base64:e.base64,mimeType:"image/png"})}finally{w?.unmount(),await new Promise(e=>setTimeout(e,0)),a.remove()}}}finally{h.remove()}return f}async function W(s,o=10){for(let t=0;t<o&&!(s.childNodes.length>0);t++)await new Promise(l=>setTimeout(l,0));if(s.childNodes.length===0)return;const r=200,c=5e3;await new Promise(t=>{let l=null,m=!1;const d=new MutationObserver(()=>{l!==null&&clearTimeout(l),l=setTimeout(h,r)}),u=setTimeout(h,c);function h(){m||(m=!0,d.disconnect(),l!==null&&clearTimeout(l),clearTimeout(u),t())}d.observe(s,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),l=setTimeout(h,r)})}async function _(s,o,r,c={}){const t=Math.min(Math.max(1,s.length),Math.max(1,Math.floor(c.columns??2))),l=Math.max(1,Math.ceil(s.length/t)),m=[];for(const e of s){const n=new Image;n.src=`data:${e.mimeType};base64,${e.base64}`,await n.decode(),m.push(n)}const d=Math.max(1,...m.map(e=>e.naturalWidth),m.length?0:o),u=Math.max(1,...m.map(e=>e.naturalHeight),m.length?0:r),h=d*t,f=u*l,i=document.createElement("canvas");i.width=h,i.height=f;const a=i.getContext("2d");if(!a)throw new Error("Unable to create the story variant sheet.");a.fillStyle=H,a.fillRect(0,0,h,f);for(const[e,n]of s.entries()){const y=e%t*d,g=Math.floor(e/t)*u,b=m[e];a.drawImage(b,y+Math.floor((d-b.naturalWidth)/2),g+Math.floor((u-b.naturalHeight)/2)),c.labels!==!1&&P(a,n.name.toUpperCase(),y,g,d,u)}const p=i.toDataURL("image/png"),w=p.indexOf(",");return{width:h,height:f,base64:w>=0?p.slice(w+1):p,mimeType:"image/png"}}export{ae as captureDomStoryBoardPreview,oe as captureProjectStoryVariants,_ as composeVariantSheet,x as renderStoryVariants};
1
+ import{r as T}from"./react-story-board-JyxJfFaY.js";import{d as P}from"./bitmap-label-Ct4k6ehY.js";import{b9 as S,ba as M,au as C,bb as $,bc as E,bd as j,be as I,a0 as v,bf as D,bg as R,bh as O,aC as L,av as U}from"./index-BYdQuKKk.js";import{m as k}from"./StoryPreviewMount-Dn5LTh6d.js";import{s as B}from"./story-presentation-B85RFwXM.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";async function ae(s,o){await S();const r=U(),c=M().filter(e=>C({modulePath:e.modulePath,regions:r}).medium==="dom"),t=document.createElement("canvas");t.width=s,t.height=o;const l=t.getContext("2d");if(!l)throw new Error("UI Canvas preview could not create a 2D output context.");if(c.length===0)return t.toDataURL("image/png");const m=B(c),d=L()?.config.resolution,u={width:d?.width??640,height:d?.height??400},h=new Map,f=new Map;for(const e of c){const n=m.resolve(e,u),[y]=await x(e.modulePath,[e],{width:n.width,height:n.height,capture:v,cropToContent:n.layout!=="fullscreen",layout:n.layout,transparent:!0});if(!y)throw new Error(`No preview rendered for ${e.id}.`);const g=new Image;g.src=`data:${y.mimeType};base64,${y.base64}`,await g.decode(),h.set(e.id,g),f.set(e.id,{width:g.naturalWidth,height:g.naturalHeight})}const i=T(c,m.index,e=>f.get(e.id)),a=Math.min(s/i.width,o/i.height),p=(s-i.width*a)/2,w=(o-i.height*a)/2;for(const[e,n]of i.layouts)l.drawImage(h.get(e),p+n.x*a,w+n.y*a,n.width*a,n.height*a);return t.toDataURL("image/png")}const A="#ffffff",H="#14171c";async function oe(s,o){const{modulePath:r,width:c,height:t}=o;if(!s)throw new Error(`No project is open, so '${r}' cannot be loaded. Open the project first.`);const l=await $(s),m=l.find(e=>e.modulePath===r);if(!m)throw new Error(`'${r}' is not a story file of this project. `+(l.length===0?"This project has no *.stories.tsx / *.stories.ts under src/.":`This project's story files are: ${l.map(e=>e.modulePath).join(", ")}.`));await E(await j(s));let d;try{d=await m.load()}catch(e){throw new Error(`'${r}' failed to import — ${e instanceof Error?e.message:String(e)}`)}const u=await I(r,d);if(!u.ok)throw new Error(u.error);const h=N(r,u.stories,o.story),f=o.capture??v,i=D("three"),a=o.captureThree??(i?(e,n)=>i(e,{...n,...o.camera===void 0?{}:{camera:o.camera},...o.pose===void 0?{}:{pose:o.pose}}):void 0);if((o.camera||o.pose)&&!a)throw new Error(`'${r}': camera/clip parameters need the three capture leg, which this environment cannot provide (no WebGL).`);const p=await x(r,h,{width:c,height:t,capture:f,...a?{captureThree:a}:{},requireThree:!!(o.camera||o.pose)}),w=await _(p,c,t);return{modulePath:r,width:c,height:t,variants:p,contactSheet:w}}function N(s,o,r){if(r===void 0)return o;const c=o.find(t=>t.name===r);if(!c)throw new Error(`'${s}' exports no story named '${r}'. It exports: ${o.map(t=>t.name).join(", ")}.`);return[c]}async function x(s,o,r){const{width:c,height:t,capture:l,captureThree:m,requireThree:d,cropToContent:u=!0}=r,h=document.createElement("div");h.setAttribute("style",`position:fixed;left:-20000px;top:0;width:${c}px;height:${t}px;overflow:hidden;contain:strict;pointer-events:none;background:${r.transparent?"transparent":A};`),document.body.appendChild(h);const f=[];try{for(const i of o){if(m){const e=await m(i.Component,{width:c,height:t}).catch(n=>(R(n)||console.warn(`[story-capture] three mount for '${i.name}' failed — falling back to the DOM leg:`,n instanceof Error?n.stack??n.message:String(n)),null));if(e===null&&d)throw new Error(`story '${i.name}' did not render on the three leg — --azimuth/--elevation/--distance/--clip/--time apply to three (R3F) stories only, and falling back to the DOM leg would silently ignore them. Narrow to a three story with --story <export>, or drop the camera/clip flags.`);if(e!==null){const n=e.indexOf(",");f.push({name:i.name,label:i.label,base64:n>=0?e.slice(n+1):e,mimeType:"image/png"});continue}}const a=document.createElement("div");a.setAttribute("style",`position:relative;width:${c}px;height:${t}px;overflow:hidden;`),r.layout==="padded"&&(a.style.padding="16px"),r.layout==="centered"&&(a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center"),a.style.boxSizing="border-box",h.replaceChildren(a);const p=await O(async()=>{const e=await k(a,s,i.name,i.Component);return await W(a),e});await p.settled();const w=p.result;try{const e=await l(h,{canvasFrame:p.frame,cropToContent:u,...r.transparent?{allowTransparent:!0}:{}});f.push({name:i.name,label:i.label,base64:e.base64,mimeType:"image/png"})}finally{w?.unmount(),await new Promise(e=>setTimeout(e,0)),a.remove()}}}finally{h.remove()}return f}async function W(s,o=10){for(let t=0;t<o&&!(s.childNodes.length>0);t++)await new Promise(l=>setTimeout(l,0));if(s.childNodes.length===0)return;const r=200,c=5e3;await new Promise(t=>{let l=null,m=!1;const d=new MutationObserver(()=>{l!==null&&clearTimeout(l),l=setTimeout(h,r)}),u=setTimeout(h,c);function h(){m||(m=!0,d.disconnect(),l!==null&&clearTimeout(l),clearTimeout(u),t())}d.observe(s,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),l=setTimeout(h,r)})}async function _(s,o,r,c={}){const t=Math.min(Math.max(1,s.length),Math.max(1,Math.floor(c.columns??2))),l=Math.max(1,Math.ceil(s.length/t)),m=[];for(const e of s){const n=new Image;n.src=`data:${e.mimeType};base64,${e.base64}`,await n.decode(),m.push(n)}const d=Math.max(1,...m.map(e=>e.naturalWidth),m.length?0:o),u=Math.max(1,...m.map(e=>e.naturalHeight),m.length?0:r),h=d*t,f=u*l,i=document.createElement("canvas");i.width=h,i.height=f;const a=i.getContext("2d");if(!a)throw new Error("Unable to create the story variant sheet.");a.fillStyle=H,a.fillRect(0,0,h,f);for(const[e,n]of s.entries()){const y=e%t*d,g=Math.floor(e/t)*u,b=m[e];a.drawImage(b,y+Math.floor((d-b.naturalWidth)/2),g+Math.floor((u-b.naturalHeight)/2)),c.labels!==!1&&P(a,n.name.toUpperCase(),y,g,d,u)}const p=i.toDataURL("image/png"),w=p.indexOf(",");return{width:h,height:f,base64:w>=0?p.slice(w+1):p,mimeType:"image/png"}}export{ae as captureDomStoryBoardPreview,oe as captureProjectStoryVariants,_ as composeVariantSheet,x as renderStoryVariants};
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/axe-LkjAB6Lv.js","assets/_commonjsHelpers-D6-XlEtG.js"])))=>i.map(i=>d[i]);
2
- import{f2 as se,eM as ie,dT as ae,f3 as ce,f4 as le,f5 as K,f6 as H,ad as U,eO as de,as as L,at as D,al as s,er as u,et as d,a6 as A,ew as ue,aS as ye,aN as V,_ as pe,f7 as fe,au as me,av as he,f8 as Q,f9 as ve,fa as ge,fb as xe,b9 as J,fc as X,aC as Se}from"./index-FuK_gLVP.js";import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{R as we,f as be}from"./presentation-FoTcsbFF.js";import{e as Z,S as q}from"./surface-state-BfErS6v0.js";import{m as ee,r as je}from"./StoryPreviewMount-BtSW2Lb5.js";import{d as te}from"./surface-content-Dg9Kkazf.js";const Re=se,y=new Map;let oe=0;const M=new Set;function m(){oe++;for(const t of M)t()}function E(t){return M.add(t),()=>{M.delete(t)}}function O(){return oe}function Ee(t,e){return`story:${t}#${e}`}function Oe(t,e){return`story-docs:${t}#${e}`}function $(){const t=K();if(!t||t.descriptor.kind!=="story")return null;const e=y.get(t.descriptor.id);return e?.mode==="preview"?{...e,id:t.descriptor.id}:null}function F(t,e,o){const n=y.get(t);if(n){if(o===void 0){const i={...n.argOverrides};delete i[e],n.argOverrides=i}else n.argOverrides={...n.argOverrides,[e]:o};m()}}function Ce(t,e,o){const n=y.get(t);n&&(n.actionLog=[...n.actionLog,{name:e,args:o,time:Date.now()}].slice(-200),m())}function Ne(t){const e=y.get(t);!e||e.actionLog.length===0||(e.actionLog=[],m())}function re(t,e,o,n={}){Ue();const i=Ee(e,o);y.has(i)||(y.set(i,{modulePath:e,storyName:o,mode:"preview",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m());const a=n.activate===void 0?{}:{activate:n.activate};return X({id:i,title:n.title??o,kind:"story",workspaceRole:"authored-subject",provenance:{sourcePath:e},Content:De,Toolbar:$e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"preview"}),persist:()=>({modulePath:e,storyName:o}),onDispose:p=>{y.delete(p)&&m()}},a)}function Y(t,e,o){const n=Oe(e,o);return y.has(n)||(y.set(n,{modulePath:e,storyName:o,mode:"docs",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m()),X({id:n,title:`${o} — Docs`,kind:"story",workspaceRole:"workspace-reference",provenance:{sourcePath:e},Content:_e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"docs"}),persist:()=>({modulePath:e,storyName:o,view:"docs"}),onDispose:i=>{y.delete(i)&&m()}})}function ke(){const t=Se();return t?xe(t).then(J,J):Promise.resolve()}fe({kind:"story",owner:"story-documents",prepare:ke,restore:({state:t,store:e})=>{const o=t,n=typeof o?.modulePath=="string"?o.modulePath:null,i=typeof o?.storyName=="string"?o.storyName:null;if(!n||!i)return!1;const a=D().find(c=>c.modulePath===n);if(!a?.ok||!a.stories.some(c=>c.name===i))return!1;if(o?.view==="docs")return Y(e,n,i),!0;const{medium:p}=me({modulePath:n,regions:he()});return p!=="dom"&&p!=="canvas"?!1:(re(e,n,i),!0)}});Q({id:ve,owner:"story-documents",open:(t,e)=>re(t,e.modulePath,e.storyName,{...e.title===void 0?{}:{title:e.title},...e.activate===void 0?{}:{activate:e.activate}})});Q({id:ge,owner:"story-documents",open:(t,e)=>Y(t,e.modulePath,e.storyName)});function W(t,e){const o=D().find(n=>n.modulePath===t);return o?o.ok?{story:o.stories.find(n=>n.name===e),moduleError:void 0}:{story:void 0,moduleError:o.error}:{story:void 0,moduleError:void 0}}function ne(t){const e=t.Component.args;return e&&typeof e=="object"?e:{}}function Te(t,e){const o=y.get(t),n={};for(const[i,a]of Object.entries(ne(e)))typeof a=="function"&&(n[i]=(...p)=>(Ce(t,i,p),a(...p)));return{...n,...o?.argOverrides??{}}}function De({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const e=y.get(t),o=l.useRef(null),n=l.useRef(null),[i,a]=l.useState(!1),[p,c]=l.useState("unknown"),[g,w]=l.useState(null),[z,P]=l.useState({width:0,height:0}),{story:b,moduleError:x}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0},h=e?JSON.stringify(e.argOverrides):"";l.useEffect(()=>{const f=o.current;if(!f)return;if(typeof ResizeObserver>"u"){P({width:f.clientWidth,height:f.clientHeight});return}const j=new ResizeObserver(([R])=>{if(!R)return;const{width:_,height:k}=R.contentRect;P(T=>T.width===_&&T.height===k?T:{width:_,height:k})});return j.observe(f),()=>j.disconnect()},[]),l.useEffect(()=>{const f=n.current;if(!f||!e)return;e.container!==f&&(e.container=f,m());const j=e.previewRevision+1;if(e.previewRevision=j,e.previewReady=!1,e.playResult=null,e.accessibility={status:"idle",violations:[]},m(),c("unknown"),w(null),!b){a(!1),c("empty");return}let R=!1,_,k;const T=()=>{R||c(te(f)?"present":"empty")},G=new MutationObserver(T);return G.observe(f,{childList:!0,subtree:!0,characterData:!0}),a(!0),ee(f,e.modulePath,e.storyName,b.Component,Te(t,b)).then(S=>{if(R){S?.unmount();return}if(!S){y.get(t)?.previewRevision===j&&(a(!1),c("empty"));return}const B=y.get(t);if(!B||B.previewRevision!==j){S.unmount();return}_=S.unmount,B.previewReady=!0,a(!1),k=setTimeout(T,0),m()},S=>{R||y.get(t)?.previewRevision!==j||(a(!1),w(S instanceof Error?S.message:String(S)),c("empty"))}),()=>{R=!0,G.disconnect(),k!==void 0&&clearTimeout(k),_?.()}},[t,e,b,h]);const C=e?.resolution.width===null,v=!e||C?1:be(z,{width:e.resolution.width,height:e.resolution.height}).scale;if(l.useEffect(()=>{!e||!Number.isFinite(v)||v<=0||e.scale===v||(e.scale=v,m())},[v,e]),!e)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.muted,pointerEvents:"auto"},children:"This story document is no longer available."});const N=`${e.modulePath}#${e.storyName}`,I=b?g?{tone:"error",title:`Story ${N} failed`,description:g}:Z({surface:"Story",rootIds:[N],phase:i?"loading":"ready",content:p}):{tone:"error",title:`Story ${N} is unavailable`,description:x??`No story export named “${e.storyName}” exists in ${e.modulePath}; it may have been renamed or removed.`};return r.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",pointerEvents:"auto"},children:r.jsx("div",{ref:o,style:{position:"relative",flex:1,minHeight:0,overflow:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsxs("div",{style:C?{position:"absolute",inset:0}:{position:"relative",width:e.resolution.width*v,height:e.resolution.height*v,flex:"0 0 auto"},children:[r.jsx("div",{"data-testid":"story-preview-root",ref:n,style:{position:"absolute",inset:0,isolation:"isolate",contain:"layout paint",overflow:"auto",background:s.surface.inset,...C?{}:{width:e.resolution.width,height:e.resolution.height,transform:`scale(${v})`,transformOrigin:"top left"}}}),r.jsx(q,{explanation:I,testId:"story-surface-status"})]})})})}function Pe(t){const e=t.parameters.docs;if(!e||typeof e!="object")return{};const o=e.description;if(typeof o=="string")return{story:o};if(!o||typeof o!="object")return{};const n=o;return{...typeof n.component=="string"?{component:n.component}:{},...typeof n.story=="string"?{story:n.story}:{}}}function _e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const e=y.get(t),o=l.useRef(null),[n,i]=l.useState("unknown"),[a,p]=l.useState(null),{story:c,moduleError:g}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0};if(l.useEffect(()=>{const x=o.current;if(!x||!e||!c)return;let h=!1,C=null,v;i("unknown"),p(null);const N=()=>{h||i(te(x)?"present":"empty")},I=new MutationObserver(N);return I.observe(x,{childList:!0,subtree:!0,characterData:!0}),ee(x,e.modulePath,e.storyName,c.Component).then(f=>{if(!f){h||i("empty");return}h?f.unmount():(C=f.unmount,v=setTimeout(N,0))},f=>{h||(p(f instanceof Error?f.message:String(f)),i("empty"))}),()=>{h=!0,I.disconnect(),v!==void 0&&clearTimeout(v),C?.()}},[e,c]),!e||!c)return r.jsx("div",{style:{padding:u[8],color:s.semantic.danger,fontSize:d.md},children:g??"This Storybook Docs document is no longer available."});const w=Pe(c),z=c.args,P=`${e.modulePath}#${e.storyName}`,b=a?{tone:"error",title:`Story ${P} failed`,description:a}:Z({surface:"Story",rootIds:[P],phase:n==="unknown"?"loading":"ready",content:n});return r.jsx("article",{"data-testid":"story-docs-document",className:"volter-content-frost",style:{flex:1,minHeight:0,overflow:"auto",pointerEvents:"auto",padding:"24px clamp(18px, 5vw, 64px)"},children:r.jsxs("div",{style:{maxWidth:920,margin:"0 auto",display:"flex",flexDirection:"column",gap:22},children:[r.jsxs("header",{children:[r.jsx("div",{style:{color:s.content.dim,fontSize:d.base,marginBottom:5},children:c.title??e.modulePath}),r.jsx("h1",{style:{color:s.content.primary,fontSize:d.heading,margin:0},children:c.label}),(w.story??w.component)&&r.jsx("p",{style:{color:s.content.primary,lineHeight:1.6,maxWidth:760,whiteSpace:"pre-wrap"},children:w.story??w.component})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:s.content.primary,fontSize:d.xl},children:"Canvas"}),r.jsxs("div",{style:{position:"relative",minHeight:180},children:[r.jsx("div",{ref:o,"data-testid":"story-docs-canvas",style:{position:"relative",isolation:"isolate",contain:"layout paint",minHeight:180,padding:18,overflow:"auto",background:s.surface.inset,border:`1px solid ${s.boundary.default}`,borderRadius:s.shape.medium}}),r.jsx(q,{explanation:b,testId:"story-docs-surface-status"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:s.content.primary,fontSize:d.xl},children:"Args"}),r.jsxs("div",{style:{border:`1px solid ${s.boundary.default}`,borderRadius:s.shape.medium,overflow:"hidden"},children:[Object.entries(z).map(([x,h])=>r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(120px, .4fr) minmax(140px, .6fr) 1fr",gap:u[6],padding:`${u[4]} ${u[5]}`,borderBottom:`1px solid ${s.boundary.default}`,fontSize:d.base},children:[r.jsx("code",{style:{color:s.accent.default},children:x}),r.jsx("span",{style:{color:s.content.muted},children:Array.isArray(h)?"array":typeof h}),r.jsx("code",{style:{color:s.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:typeof h=="function"?"function":JSON.stringify(h)})]},x)),Object.keys(z).length===0&&r.jsx("div",{style:{padding:u[5],color:s.content.dim,fontSize:d.base},children:"This story declares no args."})]})]}),r.jsxs("footer",{style:{color:s.content.dim,fontSize:d.sm},children:[e.modulePath," · ",e.storyName]})]})})}function $e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const e=y.get(t);if(!e)return null;const{story:o}=W(e.modulePath,e.storyName),n=typeof o?.Component.play=="function",i=e.playResult;return r.jsxs("div",{"data-testid":"story-document-toolbar",style:{display:"flex",alignItems:"center",gap:u[4],padding:"3px 10px",fontSize:d.sm,color:s.content.muted,borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsxs("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:[e.modulePath," —"," ",r.jsx("code",{style:{color:s.accent.default},children:e.storyName})]}),r.jsx(we,{resolution:e.resolution,scale:e.scale,onResolutionChange:a=>{e.resolution=a,m()}}),r.jsx(A,{size:"compact","data-testid":"story-open-docs",onClick:()=>Y(e.store,e.modulePath,e.storyName),style:{flexShrink:0},children:"Docs"}),n&&o&&r.jsx(A,{variant:"outline",size:"compact","data-testid":"story-run-play",onClick:async()=>{if(!e.container||!e.previewReady)return;const a=e.previewRevision,p=await je(e.modulePath,e.storyName,o.Component,e.container),c=y.get(t);c?.previewReady&&c.previewRevision===a&&(c.playResult=p,m())},disabled:!e.previewReady,style:{flexShrink:0},children:"Run play()"}),i?.ran&&!i.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:s.semantic.success,fontWeight:600},children:"play() ran"}),i?.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:s.semantic.danger},children:i.error})]})}function ze({id:t,name:e,value:o}){return r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:u[3],padding:"3px 0"},children:[r.jsx("span",{style:{width:90,flexShrink:0,fontSize:d.base,color:s.content.muted,overflow:"hidden",textOverflow:"ellipsis"},title:e,children:e}),typeof o=="boolean"?r.jsx(ye,{className:"volter-checkbox","data-testid":`story-arg-${e}`,checked:o,onChange:n=>F(t,e,n.target.checked)}):typeof o=="number"?r.jsx(V,{type:"number",className:"volter-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>{const i=n.target.value,a=Number.parseFloat(i);F(t,e,i===""||Number.isNaN(a)?void 0:a)},style:{width:80}}):typeof o=="string"?r.jsx(V,{type:"text",className:"volter-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>F(t,e,n.target.value),style:{flex:1,minWidth:0}}):r.jsx("span",{style:{fontSize:d.base,color:s.content.dim},"data-testid":`story-arg-${e}`,children:typeof o=="function"?"fn (logged to Actions)":JSON.stringify(o)})]})}function Ie(){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const t=$();if(!t)return null;const{story:e}=W(t.modulePath,t.storyName),o=e?{...ne(e),...t.argOverrides}:{},n=Object.keys(o);return r.jsxs("div",{"data-testid":"inspector-story-args",style:{pointerEvents:"auto",padding:u[4],borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsx("div",{style:{fontSize:d.base,color:s.content.dim,textTransform:"uppercase",marginBottom:u[2]},children:"Story Args"}),r.jsx("div",{style:{fontSize:d.base,color:s.content.primary,fontWeight:600,marginBottom:u[2]},children:t.storyName}),n.length===0&&r.jsx("div",{style:{fontSize:d.base,color:s.content.dim},children:e?"This story declares no args.":"Story source unavailable."}),n.map(i=>r.jsx(ze,{id:t.id,name:i,value:o[i]},i))]})}function Ae(){l.useSyncExternalStore(E,O);const t=$();return t?r.jsxs("div",{"data-testid":"story-actions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[4],fontSize:d.base},children:[r.jsx(A,{size:"compact",style:{marginBottom:u[3]},onClick:()=>Ne(t.id),children:"Clear"}),t.actionLog.length===0?r.jsx("div",{style:{color:s.content.dim},children:"No actions logged — function-valued args are wrapped with logging spies; interact with the story preview to see calls here."}):t.actionLog.map((e,o)=>r.jsxs("div",{style:{padding:`${u[1]} 0`,borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsx("code",{style:{color:s.accent.default},children:e.name})," ",r.jsxs("span",{style:{color:s.content.muted},children:["(",e.args.map(n=>{try{return typeof n=="object"?JSON.stringify(n)?.slice(0,80):String(n)}catch{return String(n)}}).join(", "),")"]})]},o))]}):r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."})}function Le(){l.useSyncExternalStore(E,O);const t=$();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."});const e=t.playResult;return r.jsxs("div",{"data-testid":"story-interactions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[6],fontSize:d.md},children:[!e&&r.jsx("div",{style:{color:s.content.dim},children:"No interaction run yet — use the story document's “Run play()”."}),e&&!e.ran&&r.jsx("div",{style:{color:s.content.dim},children:"This story declares no play() function."}),e?.ran&&!e.error&&r.jsx("div",{style:{color:s.semantic.success,fontWeight:600},children:"play() ran without errors."}),e?.error&&r.jsx("div",{style:{color:s.semantic.danger,whiteSpace:"pre-wrap"},children:e.error})]})}async function We(t){const e=y.get(t);if(!e?.container||!e.previewReady)return;const o=e.container,n=e.previewRevision;e.accessibility={status:"running",violations:[]},m();try{const a=await(await pe(async()=>{const{default:c}=await import("./axe-LkjAB6Lv.js").then(g=>g.a);return{default:c}},__vite__mapDeps([0,1]))).default.run(o),p=y.get(t);if(!p?.previewReady||p.previewRevision!==n||p.container!==o)return;p.accessibility={status:"complete",violations:a.violations.map(c=>({id:c.id,impact:c.impact??null,help:c.help,helpUrl:c.helpUrl,nodes:c.nodes.map(g=>({html:g.html,target:g.target.map(String)}))}))},m()}catch(i){const a=y.get(t);if(!a?.previewReady||a.previewRevision!==n||a.container!==o)return;a.accessibility={status:"error",violations:[],error:i instanceof Error?i.message:String(i)},m()}}function Be(){l.useSyncExternalStore(E,O);const t=$();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."});const e=t.accessibility;return r.jsxs("div",{"data-testid":"story-accessibility-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[5],fontSize:d.base},children:[r.jsx(A,{variant:"outline",size:"compact",disabled:!t.container||!t.previewReady||e.status==="running",onClick:()=>void We(t.id),style:{marginBottom:u[4]},children:e.status==="running"?"Checking…":"Run accessibility check"}),e.status==="idle"&&r.jsx("div",{style:{color:s.content.dim},children:"Run axe against the mounted story preview."}),e.status==="error"&&r.jsx("div",{style:{color:s.semantic.danger},children:e.error}),e.status==="complete"&&e.violations.length===0&&r.jsx("div",{style:{color:s.semantic.success,fontWeight:600},children:"No accessibility violations found."}),e.violations.map(o=>r.jsxs("details",{style:{borderBottom:`1px solid ${s.boundary.default}`,padding:`${u[3]} 0`},children:[r.jsxs("summary",{style:{color:o.impact==="critical"||o.impact==="serious"?s.semantic.danger:s.content.primary,cursor:"pointer"},children:[o.help," · ",o.nodes.length," node",o.nodes.length===1?"":"s"]}),r.jsx("a",{href:o.helpUrl,target:"_blank",rel:"noreferrer",style:{color:s.accent.default,display:"inline-block",margin:"5px 0"},children:"How to fix"}),o.nodes.map((n,i)=>r.jsxs("pre",{style:{color:s.content.muted,fontFamily:ue,fontSize:d.sm,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:[n.target.join(" "),`
2
+ import{f2 as se,eM as ie,dT as ae,f3 as ce,f4 as le,f5 as K,f6 as H,ad as U,eO as de,as as L,at as D,al as s,er as u,et as d,a6 as A,ew as ue,aS as ye,aN as V,_ as pe,f7 as fe,au as me,av as he,f8 as Q,f9 as ve,fa as ge,fb as xe,b9 as J,fc as X,aC as Se}from"./index-BYdQuKKk.js";import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{R as we,f as be}from"./presentation-Dy8F-23e.js";import{e as Z,S as q}from"./surface-state-D9U0kgz0.js";import{m as ee,r as je}from"./StoryPreviewMount-Dn5LTh6d.js";import{d as te}from"./surface-content-Dg9Kkazf.js";const Re=se,y=new Map;let oe=0;const M=new Set;function m(){oe++;for(const t of M)t()}function E(t){return M.add(t),()=>{M.delete(t)}}function O(){return oe}function Ee(t,e){return`story:${t}#${e}`}function Oe(t,e){return`story-docs:${t}#${e}`}function $(){const t=K();if(!t||t.descriptor.kind!=="story")return null;const e=y.get(t.descriptor.id);return e?.mode==="preview"?{...e,id:t.descriptor.id}:null}function F(t,e,o){const n=y.get(t);if(n){if(o===void 0){const i={...n.argOverrides};delete i[e],n.argOverrides=i}else n.argOverrides={...n.argOverrides,[e]:o};m()}}function Ce(t,e,o){const n=y.get(t);n&&(n.actionLog=[...n.actionLog,{name:e,args:o,time:Date.now()}].slice(-200),m())}function Ne(t){const e=y.get(t);!e||e.actionLog.length===0||(e.actionLog=[],m())}function re(t,e,o,n={}){Ue();const i=Ee(e,o);y.has(i)||(y.set(i,{modulePath:e,storyName:o,mode:"preview",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m());const a=n.activate===void 0?{}:{activate:n.activate};return X({id:i,title:n.title??o,kind:"story",workspaceRole:"authored-subject",provenance:{sourcePath:e},Content:De,Toolbar:$e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"preview"}),persist:()=>({modulePath:e,storyName:o}),onDispose:p=>{y.delete(p)&&m()}},a)}function Y(t,e,o){const n=Oe(e,o);return y.has(n)||(y.set(n,{modulePath:e,storyName:o,mode:"docs",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m()),X({id:n,title:`${o} — Docs`,kind:"story",workspaceRole:"workspace-reference",provenance:{sourcePath:e},Content:_e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"docs"}),persist:()=>({modulePath:e,storyName:o,view:"docs"}),onDispose:i=>{y.delete(i)&&m()}})}function ke(){const t=Se();return t?xe(t).then(J,J):Promise.resolve()}fe({kind:"story",owner:"story-documents",prepare:ke,restore:({state:t,store:e})=>{const o=t,n=typeof o?.modulePath=="string"?o.modulePath:null,i=typeof o?.storyName=="string"?o.storyName:null;if(!n||!i)return!1;const a=D().find(c=>c.modulePath===n);if(!a?.ok||!a.stories.some(c=>c.name===i))return!1;if(o?.view==="docs")return Y(e,n,i),!0;const{medium:p}=me({modulePath:n,regions:he()});return p!=="dom"&&p!=="canvas"?!1:(re(e,n,i),!0)}});Q({id:ve,owner:"story-documents",open:(t,e)=>re(t,e.modulePath,e.storyName,{...e.title===void 0?{}:{title:e.title},...e.activate===void 0?{}:{activate:e.activate}})});Q({id:ge,owner:"story-documents",open:(t,e)=>Y(t,e.modulePath,e.storyName)});function W(t,e){const o=D().find(n=>n.modulePath===t);return o?o.ok?{story:o.stories.find(n=>n.name===e),moduleError:void 0}:{story:void 0,moduleError:o.error}:{story:void 0,moduleError:void 0}}function ne(t){const e=t.Component.args;return e&&typeof e=="object"?e:{}}function Te(t,e){const o=y.get(t),n={};for(const[i,a]of Object.entries(ne(e)))typeof a=="function"&&(n[i]=(...p)=>(Ce(t,i,p),a(...p)));return{...n,...o?.argOverrides??{}}}function De({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const e=y.get(t),o=l.useRef(null),n=l.useRef(null),[i,a]=l.useState(!1),[p,c]=l.useState("unknown"),[g,w]=l.useState(null),[z,P]=l.useState({width:0,height:0}),{story:b,moduleError:x}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0},h=e?JSON.stringify(e.argOverrides):"";l.useEffect(()=>{const f=o.current;if(!f)return;if(typeof ResizeObserver>"u"){P({width:f.clientWidth,height:f.clientHeight});return}const j=new ResizeObserver(([R])=>{if(!R)return;const{width:_,height:k}=R.contentRect;P(T=>T.width===_&&T.height===k?T:{width:_,height:k})});return j.observe(f),()=>j.disconnect()},[]),l.useEffect(()=>{const f=n.current;if(!f||!e)return;e.container!==f&&(e.container=f,m());const j=e.previewRevision+1;if(e.previewRevision=j,e.previewReady=!1,e.playResult=null,e.accessibility={status:"idle",violations:[]},m(),c("unknown"),w(null),!b){a(!1),c("empty");return}let R=!1,_,k;const T=()=>{R||c(te(f)?"present":"empty")},G=new MutationObserver(T);return G.observe(f,{childList:!0,subtree:!0,characterData:!0}),a(!0),ee(f,e.modulePath,e.storyName,b.Component,Te(t,b)).then(S=>{if(R){S?.unmount();return}if(!S){y.get(t)?.previewRevision===j&&(a(!1),c("empty"));return}const B=y.get(t);if(!B||B.previewRevision!==j){S.unmount();return}_=S.unmount,B.previewReady=!0,a(!1),k=setTimeout(T,0),m()},S=>{R||y.get(t)?.previewRevision!==j||(a(!1),w(S instanceof Error?S.message:String(S)),c("empty"))}),()=>{R=!0,G.disconnect(),k!==void 0&&clearTimeout(k),_?.()}},[t,e,b,h]);const C=e?.resolution.width===null,v=!e||C?1:be(z,{width:e.resolution.width,height:e.resolution.height}).scale;if(l.useEffect(()=>{!e||!Number.isFinite(v)||v<=0||e.scale===v||(e.scale=v,m())},[v,e]),!e)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.muted,pointerEvents:"auto"},children:"This story document is no longer available."});const N=`${e.modulePath}#${e.storyName}`,I=b?g?{tone:"error",title:`Story ${N} failed`,description:g}:Z({surface:"Story",rootIds:[N],phase:i?"loading":"ready",content:p}):{tone:"error",title:`Story ${N} is unavailable`,description:x??`No story export named “${e.storyName}” exists in ${e.modulePath}; it may have been renamed or removed.`};return r.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",pointerEvents:"auto"},children:r.jsx("div",{ref:o,style:{position:"relative",flex:1,minHeight:0,overflow:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsxs("div",{style:C?{position:"absolute",inset:0}:{position:"relative",width:e.resolution.width*v,height:e.resolution.height*v,flex:"0 0 auto"},children:[r.jsx("div",{"data-testid":"story-preview-root",ref:n,style:{position:"absolute",inset:0,isolation:"isolate",contain:"layout paint",overflow:"auto",background:s.surface.inset,...C?{}:{width:e.resolution.width,height:e.resolution.height,transform:`scale(${v})`,transformOrigin:"top left"}}}),r.jsx(q,{explanation:I,testId:"story-surface-status"})]})})})}function Pe(t){const e=t.parameters.docs;if(!e||typeof e!="object")return{};const o=e.description;if(typeof o=="string")return{story:o};if(!o||typeof o!="object")return{};const n=o;return{...typeof n.component=="string"?{component:n.component}:{},...typeof n.story=="string"?{story:n.story}:{}}}function _e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const e=y.get(t),o=l.useRef(null),[n,i]=l.useState("unknown"),[a,p]=l.useState(null),{story:c,moduleError:g}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0};if(l.useEffect(()=>{const x=o.current;if(!x||!e||!c)return;let h=!1,C=null,v;i("unknown"),p(null);const N=()=>{h||i(te(x)?"present":"empty")},I=new MutationObserver(N);return I.observe(x,{childList:!0,subtree:!0,characterData:!0}),ee(x,e.modulePath,e.storyName,c.Component).then(f=>{if(!f){h||i("empty");return}h?f.unmount():(C=f.unmount,v=setTimeout(N,0))},f=>{h||(p(f instanceof Error?f.message:String(f)),i("empty"))}),()=>{h=!0,I.disconnect(),v!==void 0&&clearTimeout(v),C?.()}},[e,c]),!e||!c)return r.jsx("div",{style:{padding:u[8],color:s.semantic.danger,fontSize:d.md},children:g??"This Storybook Docs document is no longer available."});const w=Pe(c),z=c.args,P=`${e.modulePath}#${e.storyName}`,b=a?{tone:"error",title:`Story ${P} failed`,description:a}:Z({surface:"Story",rootIds:[P],phase:n==="unknown"?"loading":"ready",content:n});return r.jsx("article",{"data-testid":"story-docs-document",className:"volter-content-frost",style:{flex:1,minHeight:0,overflow:"auto",pointerEvents:"auto",padding:"24px clamp(18px, 5vw, 64px)"},children:r.jsxs("div",{style:{maxWidth:920,margin:"0 auto",display:"flex",flexDirection:"column",gap:22},children:[r.jsxs("header",{children:[r.jsx("div",{style:{color:s.content.dim,fontSize:d.base,marginBottom:5},children:c.title??e.modulePath}),r.jsx("h1",{style:{color:s.content.primary,fontSize:d.heading,margin:0},children:c.label}),(w.story??w.component)&&r.jsx("p",{style:{color:s.content.primary,lineHeight:1.6,maxWidth:760,whiteSpace:"pre-wrap"},children:w.story??w.component})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:s.content.primary,fontSize:d.xl},children:"Canvas"}),r.jsxs("div",{style:{position:"relative",minHeight:180},children:[r.jsx("div",{ref:o,"data-testid":"story-docs-canvas",style:{position:"relative",isolation:"isolate",contain:"layout paint",minHeight:180,padding:18,overflow:"auto",background:s.surface.inset,border:`1px solid ${s.boundary.default}`,borderRadius:s.shape.medium}}),r.jsx(q,{explanation:b,testId:"story-docs-surface-status"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:s.content.primary,fontSize:d.xl},children:"Args"}),r.jsxs("div",{style:{border:`1px solid ${s.boundary.default}`,borderRadius:s.shape.medium,overflow:"hidden"},children:[Object.entries(z).map(([x,h])=>r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(120px, .4fr) minmax(140px, .6fr) 1fr",gap:u[6],padding:`${u[4]} ${u[5]}`,borderBottom:`1px solid ${s.boundary.default}`,fontSize:d.base},children:[r.jsx("code",{style:{color:s.accent.default},children:x}),r.jsx("span",{style:{color:s.content.muted},children:Array.isArray(h)?"array":typeof h}),r.jsx("code",{style:{color:s.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:typeof h=="function"?"function":JSON.stringify(h)})]},x)),Object.keys(z).length===0&&r.jsx("div",{style:{padding:u[5],color:s.content.dim,fontSize:d.base},children:"This story declares no args."})]})]}),r.jsxs("footer",{style:{color:s.content.dim,fontSize:d.sm},children:[e.modulePath," · ",e.storyName]})]})})}function $e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const e=y.get(t);if(!e)return null;const{story:o}=W(e.modulePath,e.storyName),n=typeof o?.Component.play=="function",i=e.playResult;return r.jsxs("div",{"data-testid":"story-document-toolbar",style:{display:"flex",alignItems:"center",gap:u[4],padding:"3px 10px",fontSize:d.sm,color:s.content.muted,borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsxs("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:[e.modulePath," —"," ",r.jsx("code",{style:{color:s.accent.default},children:e.storyName})]}),r.jsx(we,{resolution:e.resolution,scale:e.scale,onResolutionChange:a=>{e.resolution=a,m()}}),r.jsx(A,{size:"compact","data-testid":"story-open-docs",onClick:()=>Y(e.store,e.modulePath,e.storyName),style:{flexShrink:0},children:"Docs"}),n&&o&&r.jsx(A,{variant:"outline",size:"compact","data-testid":"story-run-play",onClick:async()=>{if(!e.container||!e.previewReady)return;const a=e.previewRevision,p=await je(e.modulePath,e.storyName,o.Component,e.container),c=y.get(t);c?.previewReady&&c.previewRevision===a&&(c.playResult=p,m())},disabled:!e.previewReady,style:{flexShrink:0},children:"Run play()"}),i?.ran&&!i.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:s.semantic.success,fontWeight:600},children:"play() ran"}),i?.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:s.semantic.danger},children:i.error})]})}function ze({id:t,name:e,value:o}){return r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:u[3],padding:"3px 0"},children:[r.jsx("span",{style:{width:90,flexShrink:0,fontSize:d.base,color:s.content.muted,overflow:"hidden",textOverflow:"ellipsis"},title:e,children:e}),typeof o=="boolean"?r.jsx(ye,{className:"volter-checkbox","data-testid":`story-arg-${e}`,checked:o,onChange:n=>F(t,e,n.target.checked)}):typeof o=="number"?r.jsx(V,{type:"number",className:"volter-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>{const i=n.target.value,a=Number.parseFloat(i);F(t,e,i===""||Number.isNaN(a)?void 0:a)},style:{width:80}}):typeof o=="string"?r.jsx(V,{type:"text",className:"volter-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>F(t,e,n.target.value),style:{flex:1,minWidth:0}}):r.jsx("span",{style:{fontSize:d.base,color:s.content.dim},"data-testid":`story-arg-${e}`,children:typeof o=="function"?"fn (logged to Actions)":JSON.stringify(o)})]})}function Ie(){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>D());const t=$();if(!t)return null;const{story:e}=W(t.modulePath,t.storyName),o=e?{...ne(e),...t.argOverrides}:{},n=Object.keys(o);return r.jsxs("div",{"data-testid":"inspector-story-args",style:{pointerEvents:"auto",padding:u[4],borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsx("div",{style:{fontSize:d.base,color:s.content.dim,textTransform:"uppercase",marginBottom:u[2]},children:"Story Args"}),r.jsx("div",{style:{fontSize:d.base,color:s.content.primary,fontWeight:600,marginBottom:u[2]},children:t.storyName}),n.length===0&&r.jsx("div",{style:{fontSize:d.base,color:s.content.dim},children:e?"This story declares no args.":"Story source unavailable."}),n.map(i=>r.jsx(ze,{id:t.id,name:i,value:o[i]},i))]})}function Ae(){l.useSyncExternalStore(E,O);const t=$();return t?r.jsxs("div",{"data-testid":"story-actions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[4],fontSize:d.base},children:[r.jsx(A,{size:"compact",style:{marginBottom:u[3]},onClick:()=>Ne(t.id),children:"Clear"}),t.actionLog.length===0?r.jsx("div",{style:{color:s.content.dim},children:"No actions logged — function-valued args are wrapped with logging spies; interact with the story preview to see calls here."}):t.actionLog.map((e,o)=>r.jsxs("div",{style:{padding:`${u[1]} 0`,borderBottom:`1px solid ${s.boundary.default}`},children:[r.jsx("code",{style:{color:s.accent.default},children:e.name})," ",r.jsxs("span",{style:{color:s.content.muted},children:["(",e.args.map(n=>{try{return typeof n=="object"?JSON.stringify(n)?.slice(0,80):String(n)}catch{return String(n)}}).join(", "),")"]})]},o))]}):r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."})}function Le(){l.useSyncExternalStore(E,O);const t=$();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."});const e=t.playResult;return r.jsxs("div",{"data-testid":"story-interactions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[6],fontSize:d.md},children:[!e&&r.jsx("div",{style:{color:s.content.dim},children:"No interaction run yet — use the story document's “Run play()”."}),e&&!e.ran&&r.jsx("div",{style:{color:s.content.dim},children:"This story declares no play() function."}),e?.ran&&!e.error&&r.jsx("div",{style:{color:s.semantic.success,fontWeight:600},children:"play() ran without errors."}),e?.error&&r.jsx("div",{style:{color:s.semantic.danger,whiteSpace:"pre-wrap"},children:e.error})]})}async function We(t){const e=y.get(t);if(!e?.container||!e.previewReady)return;const o=e.container,n=e.previewRevision;e.accessibility={status:"running",violations:[]},m();try{const a=await(await pe(async()=>{const{default:c}=await import("./axe-LkjAB6Lv.js").then(g=>g.a);return{default:c}},__vite__mapDeps([0,1]))).default.run(o),p=y.get(t);if(!p?.previewReady||p.previewRevision!==n||p.container!==o)return;p.accessibility={status:"complete",violations:a.violations.map(c=>({id:c.id,impact:c.impact??null,help:c.help,helpUrl:c.helpUrl,nodes:c.nodes.map(g=>({html:g.html,target:g.target.map(String)}))}))},m()}catch(i){const a=y.get(t);if(!a?.previewReady||a.previewRevision!==n||a.container!==o)return;a.accessibility={status:"error",violations:[],error:i instanceof Error?i.message:String(i)},m()}}function Be(){l.useSyncExternalStore(E,O);const t=$();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:s.content.dim},children:"No active story."});const e=t.accessibility;return r.jsxs("div",{"data-testid":"story-accessibility-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[5],fontSize:d.base},children:[r.jsx(A,{variant:"outline",size:"compact",disabled:!t.container||!t.previewReady||e.status==="running",onClick:()=>void We(t.id),style:{marginBottom:u[4]},children:e.status==="running"?"Checking…":"Run accessibility check"}),e.status==="idle"&&r.jsx("div",{style:{color:s.content.dim},children:"Run axe against the mounted story preview."}),e.status==="error"&&r.jsx("div",{style:{color:s.semantic.danger},children:e.error}),e.status==="complete"&&e.violations.length===0&&r.jsx("div",{style:{color:s.semantic.success,fontWeight:600},children:"No accessibility violations found."}),e.violations.map(o=>r.jsxs("details",{style:{borderBottom:`1px solid ${s.boundary.default}`,padding:`${u[3]} 0`},children:[r.jsxs("summary",{style:{color:o.impact==="critical"||o.impact==="serious"?s.semantic.danger:s.content.primary,cursor:"pointer"},children:[o.help," · ",o.nodes.length," node",o.nodes.length===1?"":"s"]}),r.jsx("a",{href:o.helpUrl,target:"_blank",rel:"noreferrer",style:{color:s.accent.default,display:"inline-block",margin:"5px 0"},children:"How to fix"}),o.nodes.map((n,i)=>r.jsxs("pre",{style:{color:s.content.muted,fontFamily:ue,fontSize:d.sm,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:[n.target.join(" "),`
3
3
  `,n.html]},`${o.id}:${i}`))]},o.id))]})}const He=de();function Ue(){He.ensure(t=>{t(ie({match:()=>K()?.descriptor.kind==="story",id:le,title:ce,icon:Re,order:ae,Section:Ie}));const e=()=>$()!==null;t(H({...U.storyActions,Content:Ae,available:e})),t(H({...U.storyInteractions,Content:Le,available:e})),t(H({...U.storyAccessibility,Content:Be,available:e}))})}export{Re as S,Ue as e,ke as p,Ee as s};