@galacean/cli 2.0.0-alpha.16 → 2.0.0-alpha.17

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 (92) hide show
  1. package/dist/cli.bundle.cjs +1 -1
  2. package/dist/viewport-client/_static/{Accordion-8e8abfeb.js → Accordion-4581466b.js} +1 -1
  3. package/dist/viewport-client/_static/{AmbientLightAsset-20ad0c84.js → AmbientLightAsset-52dfaaf8.js} +1 -1
  4. package/dist/viewport-client/_static/{AnimationClipAsset-fc42dad4.js → AnimationClipAsset-a5adbe0b.js} +1 -1
  5. package/dist/viewport-client/_static/{AnimatorControllerAsset-2d28e356.js → AnimatorControllerAsset-1b29c766.js} +1 -1
  6. package/dist/viewport-client/_static/{AnimatorStore-41d7a260.js → AnimatorStore-2bd92a36.js} +1 -1
  7. package/dist/viewport-client/_static/{AssetViewer-ee5df0a5.js → AssetViewer-a2f4ee75.js} +1 -1
  8. package/dist/viewport-client/_static/{AudioAsset-4a8dee15.js → AudioAsset-f206da55.js} +1 -1
  9. package/dist/viewport-client/_static/{AudioComponent-b49da961.js → AudioComponent-a1e6e156.js} +1 -1
  10. package/dist/viewport-client/_static/{Callout-5731416b.js → Callout-a96a8430.js} +1 -1
  11. package/dist/viewport-client/_static/{CameraComponent-d400a082.js → CameraComponent-850a5d98.js} +1 -1
  12. package/dist/viewport-client/_static/{Component-49fa7a68.js → Component-964374b8.js} +1 -1
  13. package/dist/viewport-client/_static/{DirectLight-33282025.js → DirectLight-8734007f.js} +1 -1
  14. package/dist/viewport-client/_static/{FontAsset-68e03b27.js → FontAsset-29ed97fd.js} +1 -1
  15. package/dist/viewport-client/_static/{FormItemArray-1eb0a655.js → FormItemArray-536e9ade.js} +1 -1
  16. package/dist/viewport-client/_static/{GlTFAsset-f105daea.js → GlTFAsset-84f09723.js} +1 -1
  17. package/dist/viewport-client/_static/{IconEdit-e6cba426.js → IconEdit-493cbbb3.js} +1 -1
  18. package/dist/viewport-client/_static/{IconPointFilled-7903ac4b.js → IconPointFilled-71525313.js} +1 -1
  19. package/dist/viewport-client/_static/{LightBaseComponent-64fe62fe.js → LightBaseComponent-14ad9432.js} +1 -1
  20. package/dist/viewport-client/_static/{LottieAnimationComponent-5a53d9a8.js → LottieAnimationComponent-163b16fe.js} +1 -1
  21. package/dist/viewport-client/_static/{LottieAsset-4be66309.js → LottieAsset-898108e3.js} +1 -1
  22. package/dist/viewport-client/_static/{MarkdownAsset-b5fb62bf.js → MarkdownAsset-707897f5.js} +1 -1
  23. package/dist/viewport-client/_static/{MaterialAsset-1b309564.js → MaterialAsset-088e8e0a.js} +1 -1
  24. package/dist/viewport-client/_static/{MaterialInspector-0f1fa214.js → MaterialInspector-93a0838d.js} +1 -1
  25. package/dist/viewport-client/_static/{Menu-4b6f69f6.js → Menu-d694f08a.js} +1 -1
  26. package/dist/viewport-client/_static/{MeshAsset-4c7358f8.js → MeshAsset-ff94b6a7.js} +1 -1
  27. package/dist/viewport-client/_static/{MeshRendererBaseComponent-7d9673f0.js → MeshRendererBaseComponent-b7db519d.js} +1 -1
  28. package/dist/viewport-client/_static/{MeshRendererComponent-ac7bf46b.js → MeshRendererComponent-7f29ba50.js} +1 -1
  29. package/dist/viewport-client/_static/{MeshThumbnail-e9c08166.js → MeshThumbnail-768ca939.js} +1 -1
  30. package/dist/viewport-client/_static/{ParticleRendererComponent-34dd0c15.js → ParticleRendererComponent-9bcd1886.js} +1 -1
  31. package/dist/viewport-client/_static/{PhysicsMaterialAsset-af1ebf10.js → PhysicsMaterialAsset-291fc997.js} +1 -1
  32. package/dist/viewport-client/_static/{PhysicsStore-e7d36c5c.js → PhysicsStore-50022658.js} +1 -1
  33. package/dist/viewport-client/_static/{PointLight-651ea32e.js → PointLight-248fb1a9.js} +1 -1
  34. package/dist/viewport-client/_static/{PostProcessComponent-fc2f6f21.js → PostProcessComponent-cd6546b3.js} +1 -1
  35. package/dist/viewport-client/_static/{PrefabAsset-a6b88bbd.js → PrefabAsset-0afc28fa.js} +1 -1
  36. package/dist/viewport-client/_static/{PrimitiveMesh-dc3ad0fa.js → PrimitiveMesh-10b1161f.js} +1 -1
  37. package/dist/viewport-client/_static/{ProxyConfigs-85431ba7.js → ProxyConfigs-d85202ac.js} +1 -1
  38. package/dist/viewport-client/_static/{ReferencedMaterial-b96134c1.js → ReferencedMaterial-659bf0ee.js} +1 -1
  39. package/dist/viewport-client/_static/{RenderTargetAsset-fab94566.js → RenderTargetAsset-248f1eb5.js} +1 -1
  40. package/dist/viewport-client/_static/{SceneAsset-7e22b810.js → SceneAsset-c2a6f842.js} +1 -1
  41. package/dist/viewport-client/_static/{ShaderAsset-c9f375b5.js → ShaderAsset-d1e99a96.js} +1 -1
  42. package/dist/viewport-client/_static/{ShaderChunkAsset-e6717d7f.js → ShaderChunkAsset-6fc715c5.js} +1 -1
  43. package/dist/viewport-client/_static/{ShaderUIScriptAsset-259555e9.js → ShaderUIScriptAsset-aa3adb43.js} +1 -1
  44. package/dist/viewport-client/_static/{SkinnedMeshRendererComponent-d64b225e.js → SkinnedMeshRendererComponent-4a77c8d9.js} +1 -1
  45. package/dist/viewport-client/_static/{SpineAnimationComponent-ba68382f.js → SpineAnimationComponent-b5de1844.js} +1 -1
  46. package/dist/viewport-client/_static/{SpineSkeletonDataAsset-8ea5b7b8.js → SpineSkeletonDataAsset-cddcc22b.js} +1 -1
  47. package/dist/viewport-client/_static/{SpotLight-18d73c78.js → SpotLight-3bb8f39e.js} +1 -1
  48. package/dist/viewport-client/_static/{SpriteAsset-0c49dc5d.js → SpriteAsset-9b36d0ae.js} +1 -1
  49. package/dist/viewport-client/_static/{SpriteAtlasAsset-6461f25f.js → SpriteAtlasAsset-3f3112ca.js} +1 -1
  50. package/dist/viewport-client/_static/{SpriteBaseComponent-f1a5422d.js → SpriteBaseComponent-ab727e8e.js} +1 -1
  51. package/dist/viewport-client/_static/{SpriteMaskComponent-b2cd1787.js → SpriteMaskComponent-ed64e403.js} +1 -1
  52. package/dist/viewport-client/_static/{SpriteRendererComponent-503d7e55.js → SpriteRendererComponent-8afb7837.js} +1 -1
  53. package/dist/viewport-client/_static/{TextBaseComponent-186ad55d.js → TextBaseComponent-13689460.js} +1 -1
  54. package/dist/viewport-client/_static/{TextRendererComponent-cffe7c03.js → TextRendererComponent-8eb60833.js} +1 -1
  55. package/dist/viewport-client/_static/{TextureAsset-be48e190.js → TextureAsset-77e6000d.js} +2 -2
  56. package/dist/viewport-client/_static/{Tooltip-01dd51dc.js → Tooltip-c35612f0.js} +1 -1
  57. package/dist/viewport-client/_static/{TrailRendererComponent-2bbe404b.js → TrailRendererComponent-cabae051.js} +1 -1
  58. package/dist/viewport-client/_static/{TransformBaseComponent-4fd596d1.js → TransformBaseComponent-c0a6a3c8.js} +1 -1
  59. package/dist/viewport-client/_static/{TransformComponent-540cfdc3.js → TransformComponent-d6649e8f.js} +1 -1
  60. package/dist/viewport-client/_static/{XRReferenceImageAsset-b3c01eec.js → XRReferenceImageAsset-b786aca3.js} +1 -1
  61. package/dist/viewport-client/_static/{audio-4bf84573.js → audio-7c0ae7d6.js} +1 -1
  62. package/dist/viewport-client/_static/{index-7e3053d3.js → index-0487cdcf.js} +1 -1
  63. package/dist/viewport-client/_static/index-06fc94fa.js +1 -0
  64. package/dist/viewport-client/_static/{index-a6b152de.js → index-24bc6a91.js} +1 -1
  65. package/dist/viewport-client/_static/{index-adfb8156.js → index-48d557b0.js} +1 -1
  66. package/dist/viewport-client/_static/{index-07686e59.js → index-6087df7e.js} +1 -1
  67. package/dist/viewport-client/_static/index-6798427d.js +1 -0
  68. package/dist/viewport-client/_static/{index-07b22cd4.js → index-7abbe07f.js} +1 -1
  69. package/dist/viewport-client/_static/index-7b81c737.js +1 -0
  70. package/dist/viewport-client/_static/{index-f3f5cf05.js → index-8800c7e6.js} +1 -1
  71. package/dist/viewport-client/_static/index-8b6ebbf6.js +1 -0
  72. package/dist/viewport-client/_static/index-8b6efd6a.js +1 -0
  73. package/dist/viewport-client/_static/{index-1844727f.js → index-906d9f78.js} +1 -1
  74. package/dist/viewport-client/_static/{index-d7bb5fc3.js → index-b731a7fe.js} +1 -1
  75. package/dist/viewport-client/_static/index-bd2b1247.js +1 -0
  76. package/dist/viewport-client/_static/{index-3c825346.js → index-ca459192.js} +1 -1
  77. package/dist/viewport-client/_static/{index-c91bca3c.js → index-d07818b5.js} +3 -3
  78. package/dist/viewport-client/_static/{index-af55ef2b.js → index-fd599472.js} +1 -1
  79. package/dist/viewport-client/_static/{ktx2-encoder-486056b9.js → ktx2-encoder-5413e034.js} +1 -1
  80. package/dist/viewport-client/_static/{module-a20a329a.js → module-4879e776.js} +1 -1
  81. package/dist/viewport-client/_static/{module-ea41b53d.js → module-7c8b159f.js} +1 -1
  82. package/dist/viewport-client/_static/{module-b106d3a2.js → module-b565f34f.js} +1 -1
  83. package/dist/viewport-client/_static/postmen-e6429bad.js +1 -0
  84. package/dist/viewport-client/index.html +1 -1
  85. package/package.json +24 -29
  86. package/dist/viewport-client/_static/index-05673ab3.js +0 -1
  87. package/dist/viewport-client/_static/index-1aa955ce.js +0 -1
  88. package/dist/viewport-client/_static/index-39c4a09f.js +0 -1
  89. package/dist/viewport-client/_static/index-a44cbb78.js +0 -1
  90. package/dist/viewport-client/_static/index-a5d368cf.js +0 -1
  91. package/dist/viewport-client/_static/index-ad26cc11.js +0 -1
  92. package/dist/viewport-client/_static/postmen-c85935a0.js +0 -1
@@ -1,4 +1,4 @@
1
- var yo=Object.defineProperty;var bo=(nt,_e,tt)=>_e in nt?yo(nt,_e,{enumerable:!0,configurable:!0,writable:!0,value:tt}):nt[_e]=tt;var wt=(nt,_e,tt)=>(bo(nt,typeof _e!="symbol"?_e+"":_e,tt),tt);function _mergeNamespaces(nt,_e){for(var tt=0;tt<_e.length;tt++){const et=_e[tt];if(typeof et!="string"&&!Array.isArray(et)){for(const rt in et)if(rt!=="default"&&!(rt in nt)){const it=Object.getOwnPropertyDescriptor(et,rt);it&&Object.defineProperty(nt,rt,it.get?it:{enumerable:!0,get:()=>et[rt]})}}}return Object.freeze(Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}))}(function(){const _e=document.createElement("link").relList;if(_e&&_e.supports&&_e.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))et(rt);new MutationObserver(rt=>{for(const it of rt)if(it.type==="childList")for(const ot of it.addedNodes)ot.tagName==="LINK"&&ot.rel==="modulepreload"&&et(ot)}).observe(document,{childList:!0,subtree:!0});function tt(rt){const it={};return rt.integrity&&(it.integrity=rt.integrity),rt.referrerPolicy&&(it.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?it.credentials="include":rt.crossOrigin==="anonymous"?it.credentials="omit":it.credentials="same-origin",it}function et(rt){if(rt.ep)return;rt.ep=!0;const it=tt(rt);fetch(rt.href,it)}})();const CLI_VIEWPORT_READY_MESSAGE="render path prototype";function createDefaultViewportReadyStatus(){return`viewport initialized (${CLI_VIEWPORT_READY_MESSAGE})`}function createViewportReadyStatus(nt){return`viewport initialized in ${nt} (${CLI_VIEWPORT_READY_MESSAGE})`}const stageLabels={"boot-runtime":"booting runtime modules","register-assets":"registering asset types","register-components":"registering components","init-gltf-io":"initializing gltf io","resolve-project-id":"resolving project id","query-project":"querying project","init-project":"initializing project","init-engine":"creating engine","init-assets":"loading assets","init-scene":"loading scene","run-engine":"starting viewport","replay-bindings":"replaying bindings","resume-history":"finalizing runtime"};function createStartupStatusReporter(nt){const _e=nt.now??defaultNow,tt=_e();let et=createDefaultViewportReadyStatus();return{reportStage:ot=>{nt.setStatus(`${stageLabels[ot]}... ${formatElapsed(_e()-tt)}`,"busy")},finish:()=>{et=createViewportReadyStatus(formatElapsed(_e()-tt)),nt.setStatus(et,"idle")},getReadyStatus:()=>et}}function defaultNow(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function formatElapsed(nt){const _e=Math.max(nt,0);return _e>=1e3?`${(_e/1e3).toFixed(1)}s`:`${_e.toFixed(0)}ms`}const scriptRel="modulepreload",assetsURL=function(nt){return"/"+nt},seen={},__vitePreload=function(_e,tt,et){if(!tt||tt.length===0)return _e();const rt=document.getElementsByTagName("link");return Promise.all(tt.map(it=>{if(it=assetsURL(it),it in seen)return;seen[it]=!0;const ot=it.endsWith(".css"),at=ot?'[rel="stylesheet"]':"";if(!!et)for(let ut=rt.length-1;ut>=0;ut--){const dt=rt[ut];if(dt.href===it&&(!ot||dt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${at}`))return;const ct=document.createElement("link");if(ct.rel=ot?"stylesheet":scriptRel,ot||(ct.as="script",ct.crossOrigin=""),ct.href=it,document.head.appendChild(ct),ot)return new Promise((ut,dt)=>{ct.addEventListener("load",ut),ct.addEventListener("error",()=>dt(new Error(`Unable to preload CSS for ${it}`)))})})).then(()=>_e()).catch(it=>{const ot=new Event("vite:preloadError",{cancelable:!0});if(ot.payload=it,window.dispatchEvent(ot),!ot.defaultPrevented)throw it})},FULL_ASSET_MODULE_KEYS=["all-assets"],FULL_COMPONENT_MODULE_KEYS=["all-components"],NON_RUNTIME_ASSET_TYPES=new Set(["Folder"]),ASSET_MODULE_KEYS_BY_TYPE={AmbientLight:"ambient-light",AnimationClip:"animation-clip",AnimatorController:"animator-controller",Audio:"audio",Font:"font",glTF:"gltf",Lottie:"lottie",LottieClip:"lottie",Markdown:"markdown",Material:"material",Mesh:"mesh",PhysicsMaterial:"physics-material",Prefab:"prefab",PrimitiveMesh:"primitive-mesh",RenderTarget:"render-target",Scene:"scene",script:"script",Shader:"shader",ShaderChunk:"shader",Spine:"spine",SpineAtlas:"spine",SpineSkeletonData:"spine",SpriteAtlas:"sprite-atlas",sprite:"sprite",StateMachineScript:"script",Texture:"texture",XRReferenceImage:"xr-reference-image"},COMPONENT_MODULE_KEYS_BY_TYPE={Animator:"animator",Audio:"audio-listener",AudioSource:"audio-source",Button:"ui",Camera:"camera",CharacterController:"physics",DirectLight:"direct-light",DynamicCollider:"physics",FixedJoint:"physics",HingeJoint:"physics",Image:"ui",LottieAnimation:"lottie-animation",MeshRenderer:"mesh-renderer",ParticleRenderer:"particle-renderer",PointLight:"point-light",PostProcess:"post-process",Script:"script",SkinnedMeshRenderer:"skinned-mesh-renderer",SpineAnimationRenderer:"spine-animation",SpotLight:"spot-light",SpringJoint:"physics",SpriteMask:"sprite-mask",SpriteRenderer:"sprite-renderer",StaticCollider:"physics",Text:"ui",TextRenderer:"text-renderer",TrailRenderer:"trail-renderer",Transform:"transform",UIGroup:"ui",UICanvas:"ui",UITransform:"ui","XR Anchor Manager":"xr","XR Image Manager":"xr","XR Origin":"xr","XR Plane Manager":"xr"},ASSET_MODULE_REGISTRY={"all-assets":{load:async()=>__vitePreload(()=>import("./index-a5d368cf.js"),["_static/index-a5d368cf.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-01dd51dc.js","_static/AssetViewer-ee5df0a5.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-f105daea.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-1b309564.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/ProxyConfigs-85431ba7.js","_static/MeshAsset-4c7358f8.js","_static/index-3c825346.js","_static/MeshThumbnail-e9c08166.js","_static/AnimatorControllerAsset-2d28e356.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-fc42dad4.js","_static/module-ea41b53d.js","_static/module-a20a329a.js","_static/SpriteAsset-0c49dc5d.js","_static/SpriteAtlasAsset-6461f25f.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js","_static/AmbientLightAsset-20ad0c84.js","_static/LottieAsset-4be66309.js","_static/ShaderChunkAsset-e6717d7f.js","_static/SpineSkeletonDataAsset-8ea5b7b8.js","_static/FontAsset-68e03b27.js","_static/SceneAsset-7e22b810.js","_static/ShaderAsset-c9f375b5.js","_static/ShaderUIScriptAsset-259555e9.js","_static/PrimitiveMesh-dc3ad0fa.js","_static/XRReferenceImageAsset-b3c01eec.js","_static/module-b106d3a2.js","_static/PrefabAsset-a6b88bbd.js","_static/PhysicsMaterialAsset-af1ebf10.js","_static/RenderTargetAsset-fab94566.js","_static/AudioAsset-4a8dee15.js","_static/index-07b22cd4.js","_static/MarkdownAsset-b5fb62bf.js"]),warmupEntryPath:"plugins/main/src/assets/index.ts"},"ambient-light":{load:async()=>__vitePreload(()=>import("./AmbientLightAsset-20ad0c84.js"),["_static/AmbientLightAsset-20ad0c84.js","_static/enum-58295f88.js","_static/index-7e3053d3.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/ambient/AmbientLightAsset.tsx"},"animation-clip":{load:async()=>__vitePreload(()=>import("./index-ad26cc11.js"),["_static/index-ad26cc11.js","_static/AnimationClipAsset-fc42dad4.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js","_static/assetEditorActions-c4e5962f.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/module-ea41b53d.js","_static/module-a20a329a.js"]),warmupEntryPath:"plugins/main/src/assets/animation-clip/index.tsx"},"animator-controller":{load:async()=>__vitePreload(()=>import("./AnimatorControllerAsset-2d28e356.js"),["_static/AnimatorControllerAsset-2d28e356.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js"]),warmupEntryPath:"plugins/main/src/assets/animator-controller/AnimatorControllerAsset.ts"},audio:{load:async()=>__vitePreload(()=>import("./AudioAsset-4a8dee15.js"),["_static/AudioAsset-4a8dee15.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js"]),warmupEntryPath:"plugins/main/src/assets/audio/AudioAsset.tsx"},font:{load:async()=>__vitePreload(()=>import("./FontAsset-68e03b27.js"),["_static/FontAsset-68e03b27.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js"]),warmupEntryPath:"plugins/main/src/assets/font/FontAsset.tsx"},gltf:{load:async()=>__vitePreload(()=>import("./GlTFAsset-f105daea.js").then(nt=>nt.b),["_static/GlTFAsset-f105daea.js","_static/glTFIO-79bbca27.js","_static/meshopt_simplifier.module-cd99529d.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js","_static/MaterialAsset-1b309564.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/ProxyConfigs-85431ba7.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/gltf/GlTFAsset.tsx"},lottie:{load:async()=>__vitePreload(()=>import("./LottieAsset-4be66309.js"),["_static/LottieAsset-4be66309.js","_static/module-ea41b53d.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/SpriteAsset-0c49dc5d.js","_static/AssetViewer-ee5df0a5.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/Tooltip-01dd51dc.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js","_static/SpriteAtlasAsset-6461f25f.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js"]),warmupEntryPath:"plugins/main/src/assets/lottie/LottieAsset.tsx"},markdown:{load:async()=>__vitePreload(()=>import("./MarkdownAsset-b5fb62bf.js"),["_static/MarkdownAsset-b5fb62bf.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/assets/markdown/MarkdownAsset.ts"},material:{load:async()=>__vitePreload(()=>import("./MaterialAsset-1b309564.js").then(nt=>nt.b),["_static/MaterialAsset-1b309564.js","_static/index-7e3053d3.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/AssetViewer-ee5df0a5.js","_static/ProxyConfigs-85431ba7.js"]),warmupEntryPath:"plugins/main/src/assets/material/MaterialAsset.tsx"},mesh:{load:async()=>__vitePreload(()=>import("./MeshAsset-4c7358f8.js"),["_static/MeshAsset-4c7358f8.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/index-3c825346.js","_static/MeshThumbnail-e9c08166.js","_static/AssetViewer-ee5df0a5.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js"]),warmupEntryPath:"plugins/main/src/assets/mesh/MeshAsset.tsx"},"physics-material":{load:async()=>__vitePreload(()=>import("./PhysicsMaterialAsset-af1ebf10.js"),["_static/PhysicsMaterialAsset-af1ebf10.js","_static/index-7e3053d3.js"]),warmupEntryPath:"plugins/main/src/assets/physics/PhysicsMaterialAsset.ts"},prefab:{load:async()=>__vitePreload(()=>import("./PrefabAsset-a6b88bbd.js"),["_static/PrefabAsset-a6b88bbd.js","_static/TaskQueue-05c94a4d.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js"]),warmupEntryPath:"plugins/main/src/assets/prefab/PrefabAsset.ts"},"primitive-mesh":{load:async()=>__vitePreload(()=>import("./PrimitiveMesh-dc3ad0fa.js"),["_static/PrimitiveMesh-dc3ad0fa.js","_static/index-7e3053d3.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/MeshThumbnail-e9c08166.js"]),warmupEntryPath:"plugins/main/src/assets/primitive-mesh/PrimitiveMesh.ts"},"render-target":{load:async()=>__vitePreload(()=>import("./RenderTargetAsset-fab94566.js"),["_static/RenderTargetAsset-fab94566.js","_static/index-7e3053d3.js","_static/AssetViewer-ee5df0a5.js"]),warmupEntryPath:"plugins/main/src/assets/render-target/RenderTargetAsset.ts"},scene:{load:async()=>__vitePreload(()=>import("./SceneAsset-7e22b810.js"),["_static/SceneAsset-7e22b810.js","_static/index-7e3053d3.js"]),warmupEntryPath:"plugins/main/src/assets/scene/SceneAsset.tsx"},script:{load:async()=>__vitePreload(()=>import("./index-07b22cd4.js"),["_static/index-07b22cd4.js","_static/ShaderUIScriptAsset-259555e9.js","_static/index-7e3053d3.js"]),warmupEntryPath:"plugins/main/src/assets/script/index.ts"},shader:{load:async()=>__vitePreload(()=>import("./index-05673ab3.js"),["_static/index-05673ab3.js","_static/ShaderAsset-c9f375b5.js","_static/index-7e3053d3.js","_static/ProxyConfigs-85431ba7.js","_static/IconPointFilled-7903ac4b.js","_static/index-3c825346.js","_static/ShaderUIScriptAsset-259555e9.js"]),warmupEntryPath:"plugins/main/src/assets/shader/index.ts"},spine:{load:async()=>__vitePreload(()=>import("./SpineSkeletonDataAsset-8ea5b7b8.js").then(nt=>nt.a),["_static/SpineSkeletonDataAsset-8ea5b7b8.js","_static/module-a20a329a.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js"]),warmupEntryPath:"plugins/main/src/assets/spine/SpineSkeletonDataAsset.tsx"},"sprite-atlas":{load:async()=>__vitePreload(()=>import("./SpriteAtlasAsset-6461f25f.js").then(nt=>nt.a),["_static/SpriteAtlasAsset-6461f25f.js","_static/index-7e3053d3.js","_static/SpriteAsset-0c49dc5d.js","_static/AssetViewer-ee5df0a5.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/postmen-c85935a0.js","_static/encode-ac4bb64e.js","_static/Tooltip-01dd51dc.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js"]),warmupEntryPath:"plugins/main/src/assets/atlas/SpriteAtlasAsset.tsx"},sprite:{load:async()=>__vitePreload(()=>import("./SpriteAsset-0c49dc5d.js").then(nt=>nt.e),["_static/SpriteAsset-0c49dc5d.js","_static/index-7e3053d3.js","_static/AssetViewer-ee5df0a5.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/postmen-c85935a0.js","_static/encode-ac4bb64e.js","_static/Tooltip-01dd51dc.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/sprite/SpriteAsset.ts"},texture:{load:async()=>__vitePreload(()=>import("./TextureAsset-be48e190.js").then(nt=>nt.d),["_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-01dd51dc.js","_static/AssetViewer-ee5df0a5.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/texture/TextureAsset.tsx"},"xr-reference-image":{load:async()=>__vitePreload(()=>import("./XRReferenceImageAsset-b3c01eec.js"),["_static/XRReferenceImageAsset-b3c01eec.js","_static/module-b106d3a2.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/AssetViewer-ee5df0a5.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js"]),warmupEntryPath:"plugins/main/src/assets/xr/XRReferenceImageAsset.tsx"}},COMPONENT_MODULE_REGISTRY={"all-components":{load:async()=>__vitePreload(()=>import("./index-adfb8156.js"),["_static/index-adfb8156.js","_static/CameraComponent-d400a082.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/DirectLight-33282025.js","_static/LightBaseComponent-64fe62fe.js","_static/PointLight-651ea32e.js","_static/postmen-c85935a0.js","_static/SpotLight-18d73c78.js","_static/MeshRendererComponent-ac7bf46b.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-b96134c1.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/MeshRendererBaseComponent-7d9673f0.js","_static/SkinnedMeshRendererComponent-d64b225e.js","_static/AnimatorStore-41d7a260.js","_static/SpriteRendererComponent-503d7e55.js","_static/SpriteBaseComponent-f1a5422d.js","_static/SpriteMaskComponent-b2cd1787.js","_static/PhysicsStore-e7d36c5c.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js","_static/index-1844727f.js","_static/scriptPropertyActions-d3a583d2.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-01dd51dc.js","_static/AssetViewer-ee5df0a5.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-f105daea.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-1b309564.js","_static/ProxyConfigs-85431ba7.js","_static/MeshAsset-4c7358f8.js","_static/index-3c825346.js","_static/MeshThumbnail-e9c08166.js","_static/AnimatorControllerAsset-2d28e356.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-fc42dad4.js","_static/module-ea41b53d.js","_static/module-a20a329a.js","_static/SpriteAsset-0c49dc5d.js","_static/SpriteAtlasAsset-6461f25f.js","_static/AmbientLightAsset-20ad0c84.js","_static/LottieAsset-4be66309.js","_static/ShaderChunkAsset-e6717d7f.js","_static/SpineSkeletonDataAsset-8ea5b7b8.js","_static/FontAsset-68e03b27.js","_static/SceneAsset-7e22b810.js","_static/ShaderAsset-c9f375b5.js","_static/ShaderUIScriptAsset-259555e9.js","_static/PrimitiveMesh-dc3ad0fa.js","_static/XRReferenceImageAsset-b3c01eec.js","_static/module-b106d3a2.js","_static/PrefabAsset-a6b88bbd.js","_static/PhysicsMaterialAsset-af1ebf10.js","_static/RenderTargetAsset-fab94566.js","_static/AudioAsset-4a8dee15.js","_static/index-07b22cd4.js","_static/MarkdownAsset-b5fb62bf.js","_static/TextRendererComponent-cffe7c03.js","_static/TextBaseComponent-186ad55d.js","_static/LottieAnimationComponent-5a53d9a8.js","_static/SpineAnimationComponent-ba68382f.js","_static/ParticleRendererComponent-34dd0c15.js","_static/index-f3f5cf05.js","_static/Menu-4b6f69f6.js","_static/TrailRendererComponent-2bbe404b.js","_static/index-af55ef2b.js","_static/PostProcessComponent-fc2f6f21.js","_static/AudioComponent-b49da961.js","_static/TransformComponent-540cfdc3.js","_static/TransformBaseComponent-4fd596d1.js","_static/index-07686e59.js","_static/Callout-5731416b.js"]),warmupEntryPath:"plugins/main/src/components/index.ts"},animator:{load:async()=>__vitePreload(()=>import("./index-a44cbb78.js"),["_static/index-a44cbb78.js","_static/AnimatorStore-41d7a260.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/components/animator/index.ts"},"audio-listener":{load:async()=>__vitePreload(()=>import("./audio-4bf84573.js"),["_static/audio-4bf84573.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/components/audio.ts"},"audio-source":{load:async()=>__vitePreload(()=>import("./AudioComponent-b49da961.js"),["_static/AudioComponent-b49da961.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/components/AudioComponent.ts"},camera:{load:async()=>__vitePreload(()=>import("./CameraComponent-d400a082.js"),["_static/CameraComponent-d400a082.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js"]),warmupEntryPath:"plugins/main/src/components/CameraComponent.ts"},"direct-light":{load:async()=>__vitePreload(()=>import("./DirectLight-33282025.js"),["_static/DirectLight-33282025.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/LightBaseComponent-64fe62fe.js"]),warmupEntryPath:"plugins/main/src/components/light/DirectLight.ts"},"lottie-animation":{load:async()=>__vitePreload(()=>import("./LottieAnimationComponent-5a53d9a8.js"),["_static/LottieAnimationComponent-5a53d9a8.js","_static/module-ea41b53d.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/components/LottieAnimationComponent.ts"},"mesh-renderer":{load:async()=>__vitePreload(()=>import("./MeshRendererComponent-ac7bf46b.js"),["_static/MeshRendererComponent-ac7bf46b.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-b96134c1.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/MeshRendererBaseComponent-7d9673f0.js"]),warmupEntryPath:"plugins/main/src/components/mesh-renderer/MeshRendererComponent.ts"},"particle-renderer":{load:async()=>__vitePreload(()=>import("./ParticleRendererComponent-34dd0c15.js"),["_static/ParticleRendererComponent-34dd0c15.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-b96134c1.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-01dd51dc.js","_static/AssetViewer-ee5df0a5.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-f105daea.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-1b309564.js","_static/ProxyConfigs-85431ba7.js","_static/MeshAsset-4c7358f8.js","_static/index-3c825346.js","_static/MeshThumbnail-e9c08166.js","_static/AnimatorControllerAsset-2d28e356.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-fc42dad4.js","_static/module-ea41b53d.js","_static/module-a20a329a.js","_static/SpriteAsset-0c49dc5d.js","_static/SpriteAtlasAsset-6461f25f.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js","_static/AmbientLightAsset-20ad0c84.js","_static/LottieAsset-4be66309.js","_static/ShaderChunkAsset-e6717d7f.js","_static/SpineSkeletonDataAsset-8ea5b7b8.js","_static/FontAsset-68e03b27.js","_static/SceneAsset-7e22b810.js","_static/ShaderAsset-c9f375b5.js","_static/ShaderUIScriptAsset-259555e9.js","_static/PrimitiveMesh-dc3ad0fa.js","_static/XRReferenceImageAsset-b3c01eec.js","_static/module-b106d3a2.js","_static/PrefabAsset-a6b88bbd.js","_static/PhysicsMaterialAsset-af1ebf10.js","_static/RenderTargetAsset-fab94566.js","_static/AudioAsset-4a8dee15.js","_static/index-07b22cd4.js","_static/MarkdownAsset-b5fb62bf.js","_static/index-f3f5cf05.js","_static/Menu-4b6f69f6.js"]),warmupEntryPath:"plugins/main/src/components/effects/ParticleRendererComponent.tsx"},physics:{load:async()=>__vitePreload(()=>import("./index-39c4a09f.js"),["_static/index-39c4a09f.js","_static/PhysicsStore-e7d36c5c.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js"]),warmupEntryPath:"plugins/main/src/components/physics/index.ts"},"point-light":{load:async()=>__vitePreload(()=>import("./PointLight-651ea32e.js"),["_static/PointLight-651ea32e.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/LightBaseComponent-64fe62fe.js"]),warmupEntryPath:"plugins/main/src/components/light/PointLight.ts"},"post-process":{load:async()=>__vitePreload(()=>import("./index-1aa955ce.js"),["_static/index-1aa955ce.js","_static/PostProcessComponent-fc2f6f21.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/Menu-4b6f69f6.js","_static/Accordion-8e8abfeb.js"]),warmupEntryPath:"plugins/main/src/components/postProcess/index.ts"},script:{load:async()=>__vitePreload(()=>import("./index-1844727f.js"),["_static/index-1844727f.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/scriptPropertyActions-d3a583d2.js","_static/TextureAsset-be48e190.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-01dd51dc.js","_static/AssetViewer-ee5df0a5.js","_static/ktx2-encoder-486056b9.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-f105daea.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-1b309564.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/ProxyConfigs-85431ba7.js","_static/MeshAsset-4c7358f8.js","_static/index-3c825346.js","_static/MeshThumbnail-e9c08166.js","_static/AnimatorControllerAsset-2d28e356.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-fc42dad4.js","_static/module-ea41b53d.js","_static/module-a20a329a.js","_static/SpriteAsset-0c49dc5d.js","_static/SpriteAtlasAsset-6461f25f.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js","_static/AmbientLightAsset-20ad0c84.js","_static/LottieAsset-4be66309.js","_static/ShaderChunkAsset-e6717d7f.js","_static/SpineSkeletonDataAsset-8ea5b7b8.js","_static/FontAsset-68e03b27.js","_static/SceneAsset-7e22b810.js","_static/ShaderAsset-c9f375b5.js","_static/ShaderUIScriptAsset-259555e9.js","_static/PrimitiveMesh-dc3ad0fa.js","_static/XRReferenceImageAsset-b3c01eec.js","_static/module-b106d3a2.js","_static/PrefabAsset-a6b88bbd.js","_static/PhysicsMaterialAsset-af1ebf10.js","_static/RenderTargetAsset-fab94566.js","_static/AudioAsset-4a8dee15.js","_static/index-07b22cd4.js","_static/MarkdownAsset-b5fb62bf.js"]),warmupEntryPath:"plugins/main/src/components/ScriptComponent/index.tsx"},"skinned-mesh-renderer":{load:async()=>__vitePreload(()=>import("./SkinnedMeshRendererComponent-d64b225e.js"),["_static/SkinnedMeshRendererComponent-d64b225e.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/createOnModelChange-b57a0da8.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js","_static/MeshRendererBaseComponent-7d9673f0.js"]),warmupEntryPath:"plugins/main/src/components/skinned-mesh-renderer/SkinnedMeshRendererComponent.ts"},"spine-animation":{load:async()=>__vitePreload(()=>import("./SpineAnimationComponent-ba68382f.js"),["_static/SpineAnimationComponent-ba68382f.js","_static/module-a20a329a.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/components/SpineAnimationComponent.ts"},"spot-light":{load:async()=>__vitePreload(()=>import("./SpotLight-18d73c78.js"),["_static/SpotLight-18d73c78.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/LightBaseComponent-64fe62fe.js"]),warmupEntryPath:"plugins/main/src/components/light/SpotLight.ts"},"sprite-mask":{load:async()=>__vitePreload(()=>import("./SpriteMaskComponent-b2cd1787.js"),["_static/SpriteMaskComponent-b2cd1787.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js"]),warmupEntryPath:"plugins/main/src/components/SpriteMaskComponent.ts"},"sprite-renderer":{load:async()=>__vitePreload(()=>import("./SpriteRendererComponent-503d7e55.js"),["_static/SpriteRendererComponent-503d7e55.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/createOnModelChange-b57a0da8.js","_static/SpriteBaseComponent-f1a5422d.js"]),warmupEntryPath:"plugins/main/src/components/sprite/SpriteRendererComponent.ts"},"text-renderer":{load:async()=>__vitePreload(()=>import("./TextRendererComponent-cffe7c03.js"),["_static/TextRendererComponent-cffe7c03.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/TextBaseComponent-186ad55d.js"]),warmupEntryPath:"plugins/main/src/components/text/TextRendererComponent.ts"},"trail-renderer":{load:async()=>__vitePreload(()=>import("./TrailRendererComponent-2bbe404b.js"),["_static/TrailRendererComponent-2bbe404b.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/postmen-c85935a0.js","_static/index-f3f5cf05.js","_static/Menu-4b6f69f6.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-b96134c1.js","_static/MaterialInspector-0f1fa214.js","_static/IconPointFilled-7903ac4b.js"]),warmupEntryPath:"plugins/main/src/components/effects/TrailRendererComponent.tsx"},transform:{load:async()=>__vitePreload(()=>import("./TransformComponent-540cfdc3.js"),["_static/TransformComponent-540cfdc3.js","_static/index-7e3053d3.js","_static/Component-49fa7a68.js","_static/TransformBaseComponent-4fd596d1.js"]),warmupEntryPath:"plugins/main/src/components/transform/TransformComponent.ts"},ui:{load:async()=>__vitePreload(()=>import("./index-07686e59.js"),["_static/index-07686e59.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/Component-49fa7a68.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js","_static/SpriteBaseComponent-f1a5422d.js","_static/TextBaseComponent-186ad55d.js","_static/TransformBaseComponent-4fd596d1.js","_static/Callout-5731416b.js"]),warmupEntryPath:"plugins/main/src/components/ui/index.ts"},xr:{load:async()=>__vitePreload(()=>import("./index-af55ef2b.js").then(nt=>nt.i),["_static/index-af55ef2b.js","_static/module-b106d3a2.js","_static/index-7e3053d3.js","_static/postmen-c85935a0.js","_static/FormItemArray-1eb0a655.js","_static/Accordion-8e8abfeb.js","_static/IconEdit-e6cba426.js","_static/scriptPropertyActions-d3a583d2.js"]),warmupEntryPath:"plugins/main/src/components/xr/index.ts"}},GLTF_IO_MODULE_REGISTRATION={load:async()=>__vitePreload(()=>import("./glTFIO-79bbca27.js").then(nt=>nt.j),["_static/glTFIO-79bbca27.js","_static/meshopt_simplifier.module-cd99529d.js"]),warmupEntryPath:"plugins/main/src/assets/gltf/glTFIO.ts"};function createRuntimeBootstrapState(){return{loadedAssetModuleKeys:new Set,loadedComponentModuleKeys:new Set,gltfIOInitialized:!1}}async function runRuntimeBootstrapPlan({state:nt,plan:_e,onStage:tt,loadAssetModule:et,loadComponentModule:rt,loadGlTFIOModule:it}){const ot=_e.assetModuleKeys.filter(st=>!nt.loadedAssetModuleKeys.has(st));ot.length>0&&(tt==null||tt("register-assets"),await Promise.all(ot.map(async st=>{await et(st),nt.loadedAssetModuleKeys.add(st)})));const at=_e.componentModuleKeys.filter(st=>!nt.loadedComponentModuleKeys.has(st));if(at.length>0&&(tt==null||tt("register-components"),await Promise.all(at.map(async st=>{await rt(st),nt.loadedComponentModuleKeys.add(st)}))),_e.shouldInitGlTFIO&&!nt.gltfIOInitialized){tt==null||tt("init-gltf-io");const{initGlTFIO:st}=await it();await st(),nt.gltfIOInitialized=!0}}function bootstrapEditorRuntime(nt={}){const _e=()=>runRuntimeBootstrapPlan({state:bootstrapState,plan:nt.plan??FULL_RUNTIME_BOOTSTRAP_PLAN,onStage:nt.onStage,loadAssetModule:nt.loadAssetModule??defaultLoadAssetModule,loadComponentModule:nt.loadComponentModule??defaultLoadComponentModule,loadGlTFIOModule:nt.loadGlTFIOModule??defaultLoadGlTFIOModule}),tt=bootstrapQueue.then(_e,_e);return bootstrapQueue=tt.then(()=>{},()=>{}),tt}const FULL_RUNTIME_BOOTSTRAP_PLAN={mode:"full",assetTypes:[],componentTypes:[],unknownAssetTypes:[],unknownComponentTypes:[],assetModuleKeys:[...FULL_ASSET_MODULE_KEYS],componentModuleKeys:[...FULL_COMPONENT_MODULE_KEYS],shouldInitGlTFIO:!0};function defaultLoadAssetModule(nt){var tt;const _e=(tt=ASSET_MODULE_REGISTRY[nt])==null?void 0:tt.load;if(!_e)throw new Error(`unsupported asset runtime module: ${nt}`);return _e()}function defaultLoadComponentModule(nt){var tt;const _e=(tt=COMPONENT_MODULE_REGISTRY[nt])==null?void 0:tt.load;if(!_e)throw new Error(`unsupported component runtime module: ${nt}`);return _e()}async function defaultLoadGlTFIOModule(){return await GLTF_IO_MODULE_REGISTRATION.load()}const bootstrapState=createRuntimeBootstrapState();let bootstrapQueue=Promise.resolve();function attachSceneHotReload(nt){const _e=new EventSource("/events"),tt=()=>nt.readyStatus??createDefaultViewportReadyStatus();return _e.onmessage=async et=>{var it,ot,at,st;let rt=null;try{rt=JSON.parse(et.data)}catch{return}try{rt.type==="full-refresh"?((it=nt.onStatus)==null||it.call(nt,rt.reason==="project"?"project changed, rebuilding...":"scene changed, refreshing..."),await nt.runtime.reload()):((ot=nt.onStatus)==null||ot.call(nt,`assets changed (${rt.changes.length}), refreshing...`),await nt.runtime.applyAssetBatchChange({changes:rt.changes})),(at=nt.onStatus)==null||at.call(nt,tt(),"idle")}catch(ct){console.error(ct),(st=nt.onStatus)==null||st.call(nt,"refresh failed, reloading page...","busy"),setTimeout(()=>location.reload(),500)}},_e.onerror=()=>{var et;(et=nt.onStatus)==null||et.call(nt,"hot reload disconnected, retrying...")},_e.onopen=()=>{var et;(et=nt.onStatus)==null||et.call(nt,tt(),"idle")},()=>{_e.close()}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(nt){return nt&&nt.__esModule&&Object.prototype.hasOwnProperty.call(nt,"default")?nt.default:nt}function getAugmentedNamespace(nt){if(nt.__esModule)return nt;var _e=nt.default;if(typeof _e=="function"){var tt=function et(){return this instanceof et?Reflect.construct(_e,arguments,this.constructor):_e.apply(this,arguments)};tt.prototype=_e.prototype}else tt={};return Object.defineProperty(tt,"__esModule",{value:!0}),Object.keys(nt).forEach(function(et){var rt=Object.getOwnPropertyDescriptor(nt,et);Object.defineProperty(tt,et,rt.get?rt:{enumerable:!0,get:function(){return nt[et]}})}),tt}var browser={exports:{}};(function(nt){(_e=>{var tt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,rt=Object.getOwnPropertyNames,it=Object.prototype.hasOwnProperty,ot=(Kt,Qt)=>{for(var nn in Qt)tt(Kt,nn,{get:Qt[nn],enumerable:!0})},at=(Kt,Qt,nn,un)=>{if(Qt&&typeof Qt=="object"||typeof Qt=="function")for(let yn of rt(Qt))!it.call(Kt,yn)&&yn!==nn&&tt(Kt,yn,{get:()=>Qt[yn],enumerable:!(un=et(Qt,yn))||un.enumerable});return Kt},st=Kt=>at(tt({},"__esModule",{value:!0}),Kt),ct=(Kt,Qt,nn)=>new Promise((un,yn)=>{var Sn=dn=>{try{An(nn.next(dn))}catch(Dn){yn(Dn)}},mn=dn=>{try{An(nn.throw(dn))}catch(Dn){yn(Dn)}},An=dn=>dn.done?un(dn.value):Promise.resolve(dn.value).then(Sn,mn);An((nn=nn.apply(Kt,Qt)).next())}),ut={};ot(ut,{analyzeMetafile:()=>Yr,analyzeMetafileSync:()=>Jr,build:()=>Cr,buildSync:()=>Kr,context:()=>_r,default:()=>zr,formatMessages:()=>Xr,formatMessagesSync:()=>Qr,initialize:()=>_i,stop:()=>Zr,transform:()=>Vr,transformSync:()=>qr,version:()=>mr}),_e.exports=st(ut);function dt(Kt){let Qt=un=>{if(un===null)nn.write8(0);else if(typeof un=="boolean")nn.write8(1),nn.write8(+un);else if(typeof un=="number")nn.write8(2),nn.write32(un|0);else if(typeof un=="string")nn.write8(3),nn.write(pt(un));else if(un instanceof Uint8Array)nn.write8(4),nn.write(un);else if(un instanceof Array){nn.write8(5),nn.write32(un.length);for(let yn of un)Qt(yn)}else{let yn=Object.keys(un);nn.write8(6),nn.write32(yn.length);for(let Sn of yn)nn.write(pt(Sn)),Qt(un[Sn])}},nn=new ft;return nn.write32(0),nn.write32(Kt.id<<1|+!Kt.isRequest),Qt(Kt.value),yt(nn.buf,nn.len-4,0),nn.buf.subarray(0,nn.len)}function ht(Kt){let Qt=()=>{switch(nn.read8()){case 0:return null;case 1:return!!nn.read8();case 2:return nn.read32();case 3:return mt(nn.read());case 4:return nn.read();case 5:{let mn=nn.read32(),An=[];for(let dn=0;dn<mn;dn++)An.push(Qt());return An}case 6:{let mn=nn.read32(),An={};for(let dn=0;dn<mn;dn++)An[mt(nn.read())]=Qt();return An}default:throw new Error("Invalid packet")}},nn=new ft(Kt),un=nn.read32(),yn=(un&1)===0;un>>>=1;let Sn=Qt();if(nn.ptr!==Kt.length)throw new Error("Invalid packet");return{id:un,isRequest:yn,value:Sn}}var ft=class{constructor(Kt=new Uint8Array(1024)){this.buf=Kt,this.len=0,this.ptr=0}_write(Kt){if(this.len+Kt>this.buf.length){let Qt=new Uint8Array((this.len+Kt)*2);Qt.set(this.buf),this.buf=Qt}return this.len+=Kt,this.len-Kt}write8(Kt){let Qt=this._write(1);this.buf[Qt]=Kt}write32(Kt){let Qt=this._write(4);yt(this.buf,Kt,Qt)}write(Kt){let Qt=this._write(4+Kt.length);yt(this.buf,Kt.length,Qt),this.buf.set(Kt,Qt+4)}_read(Kt){if(this.ptr+Kt>this.buf.length)throw new Error("Invalid packet");return this.ptr+=Kt,this.ptr-Kt}read8(){return this.buf[this._read(1)]}read32(){return _t(this.buf,this._read(4))}read(){let Kt=this.read32(),Qt=new Uint8Array(Kt),nn=this._read(Qt.length);return Qt.set(this.buf.subarray(nn,nn+Kt)),Qt}},pt,mt,vt;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let Kt=new TextEncoder,Qt=new TextDecoder;pt=nn=>Kt.encode(nn),mt=nn=>Qt.decode(nn),vt='new TextEncoder().encode("")'}else if(typeof Buffer<"u")pt=Kt=>Buffer.from(Kt),mt=Kt=>{let{buffer:Qt,byteOffset:nn,byteLength:un}=Kt;return Buffer.from(Qt,nn,un).toString()},vt='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(pt("")instanceof Uint8Array))throw new Error(`Invariant violation: "${vt} instanceof Uint8Array" is incorrectly false
1
+ var yo=Object.defineProperty;var bo=(nt,_e,tt)=>_e in nt?yo(nt,_e,{enumerable:!0,configurable:!0,writable:!0,value:tt}):nt[_e]=tt;var wt=(nt,_e,tt)=>(bo(nt,typeof _e!="symbol"?_e+"":_e,tt),tt);function _mergeNamespaces(nt,_e){for(var tt=0;tt<_e.length;tt++){const et=_e[tt];if(typeof et!="string"&&!Array.isArray(et)){for(const rt in et)if(rt!=="default"&&!(rt in nt)){const it=Object.getOwnPropertyDescriptor(et,rt);it&&Object.defineProperty(nt,rt,it.get?it:{enumerable:!0,get:()=>et[rt]})}}}return Object.freeze(Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}))}(function(){const _e=document.createElement("link").relList;if(_e&&_e.supports&&_e.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))et(rt);new MutationObserver(rt=>{for(const it of rt)if(it.type==="childList")for(const ot of it.addedNodes)ot.tagName==="LINK"&&ot.rel==="modulepreload"&&et(ot)}).observe(document,{childList:!0,subtree:!0});function tt(rt){const it={};return rt.integrity&&(it.integrity=rt.integrity),rt.referrerPolicy&&(it.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?it.credentials="include":rt.crossOrigin==="anonymous"?it.credentials="omit":it.credentials="same-origin",it}function et(rt){if(rt.ep)return;rt.ep=!0;const it=tt(rt);fetch(rt.href,it)}})();const CLI_VIEWPORT_READY_MESSAGE="render path prototype";function createDefaultViewportReadyStatus(){return`viewport initialized (${CLI_VIEWPORT_READY_MESSAGE})`}function createViewportReadyStatus(nt){return`viewport initialized in ${nt} (${CLI_VIEWPORT_READY_MESSAGE})`}const stageLabels={"boot-runtime":"booting runtime modules","register-assets":"registering asset types","register-components":"registering components","init-gltf-io":"initializing gltf io","resolve-project-id":"resolving project id","query-project":"querying project","init-project":"initializing project","init-engine":"creating engine","init-assets":"loading assets","init-scene":"loading scene","run-engine":"starting viewport","replay-bindings":"replaying bindings","resume-history":"finalizing runtime"};function createStartupStatusReporter(nt){const _e=nt.now??defaultNow,tt=_e();let et=createDefaultViewportReadyStatus();return{reportStage:ot=>{nt.setStatus(`${stageLabels[ot]}... ${formatElapsed(_e()-tt)}`,"busy")},finish:()=>{et=createViewportReadyStatus(formatElapsed(_e()-tt)),nt.setStatus(et,"idle")},getReadyStatus:()=>et}}function defaultNow(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function formatElapsed(nt){const _e=Math.max(nt,0);return _e>=1e3?`${(_e/1e3).toFixed(1)}s`:`${_e.toFixed(0)}ms`}const scriptRel="modulepreload",assetsURL=function(nt){return"/"+nt},seen={},__vitePreload=function(_e,tt,et){if(!tt||tt.length===0)return _e();const rt=document.getElementsByTagName("link");return Promise.all(tt.map(it=>{if(it=assetsURL(it),it in seen)return;seen[it]=!0;const ot=it.endsWith(".css"),at=ot?'[rel="stylesheet"]':"";if(!!et)for(let ut=rt.length-1;ut>=0;ut--){const dt=rt[ut];if(dt.href===it&&(!ot||dt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${at}`))return;const ct=document.createElement("link");if(ct.rel=ot?"stylesheet":scriptRel,ot||(ct.as="script",ct.crossOrigin=""),ct.href=it,document.head.appendChild(ct),ot)return new Promise((ut,dt)=>{ct.addEventListener("load",ut),ct.addEventListener("error",()=>dt(new Error(`Unable to preload CSS for ${it}`)))})})).then(()=>_e()).catch(it=>{const ot=new Event("vite:preloadError",{cancelable:!0});if(ot.payload=it,window.dispatchEvent(ot),!ot.defaultPrevented)throw it})},FULL_ASSET_MODULE_KEYS=["all-assets"],FULL_COMPONENT_MODULE_KEYS=["all-components"],NON_RUNTIME_ASSET_TYPES=new Set(["Folder"]),ASSET_MODULE_KEYS_BY_TYPE={AmbientLight:"ambient-light",AnimationClip:"animation-clip",AnimatorController:"animator-controller",Audio:"audio",Font:"font",glTF:"gltf",Lottie:"lottie",LottieClip:"lottie",Markdown:"markdown",Material:"material",Mesh:"mesh",PhysicsMaterial:"physics-material",Prefab:"prefab",PrimitiveMesh:"primitive-mesh",RenderTarget:"render-target",Scene:"scene",script:"script",Shader:"shader",ShaderChunk:"shader",Spine:"spine",SpineAtlas:"spine",SpineSkeletonData:"spine",SpriteAtlas:"sprite-atlas",sprite:"sprite",StateMachineScript:"script",Texture:"texture",XRReferenceImage:"xr-reference-image"},COMPONENT_MODULE_KEYS_BY_TYPE={Animator:"animator",Audio:"audio-listener",AudioSource:"audio-source",Button:"ui",Camera:"camera",CharacterController:"physics",DirectLight:"direct-light",DynamicCollider:"physics",FixedJoint:"physics",HingeJoint:"physics",Image:"ui",LottieAnimation:"lottie-animation",MeshRenderer:"mesh-renderer",ParticleRenderer:"particle-renderer",PointLight:"point-light",PostProcess:"post-process",Script:"script",SkinnedMeshRenderer:"skinned-mesh-renderer",SpineAnimationRenderer:"spine-animation",SpotLight:"spot-light",SpringJoint:"physics",SpriteMask:"sprite-mask",SpriteRenderer:"sprite-renderer",StaticCollider:"physics",Text:"ui",TextRenderer:"text-renderer",TrailRenderer:"trail-renderer",Transform:"transform",UIGroup:"ui",UICanvas:"ui",UITransform:"ui","XR Anchor Manager":"xr","XR Image Manager":"xr","XR Origin":"xr","XR Plane Manager":"xr"},ASSET_MODULE_REGISTRY={"all-assets":{load:async()=>__vitePreload(()=>import("./index-7b81c737.js"),["_static/index-7b81c737.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-c35612f0.js","_static/AssetViewer-a2f4ee75.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-84f09723.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-088e8e0a.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/ProxyConfigs-d85202ac.js","_static/MeshAsset-ff94b6a7.js","_static/index-ca459192.js","_static/MeshThumbnail-768ca939.js","_static/AnimatorControllerAsset-1b29c766.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-a5adbe0b.js","_static/module-7c8b159f.js","_static/module-4879e776.js","_static/SpriteAsset-9b36d0ae.js","_static/SpriteAtlasAsset-3f3112ca.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js","_static/AmbientLightAsset-52dfaaf8.js","_static/LottieAsset-898108e3.js","_static/ShaderChunkAsset-6fc715c5.js","_static/SpineSkeletonDataAsset-cddcc22b.js","_static/FontAsset-29ed97fd.js","_static/SceneAsset-c2a6f842.js","_static/ShaderAsset-d1e99a96.js","_static/ShaderUIScriptAsset-aa3adb43.js","_static/PrimitiveMesh-10b1161f.js","_static/XRReferenceImageAsset-b786aca3.js","_static/module-b565f34f.js","_static/PrefabAsset-0afc28fa.js","_static/PhysicsMaterialAsset-291fc997.js","_static/RenderTargetAsset-248f1eb5.js","_static/AudioAsset-f206da55.js","_static/index-7abbe07f.js","_static/MarkdownAsset-707897f5.js"]),warmupEntryPath:"plugins/main/src/assets/index.ts"},"ambient-light":{load:async()=>__vitePreload(()=>import("./AmbientLightAsset-52dfaaf8.js"),["_static/AmbientLightAsset-52dfaaf8.js","_static/enum-58295f88.js","_static/index-0487cdcf.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/ambient/AmbientLightAsset.tsx"},"animation-clip":{load:async()=>__vitePreload(()=>import("./index-6798427d.js"),["_static/index-6798427d.js","_static/AnimationClipAsset-a5adbe0b.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js","_static/assetEditorActions-c4e5962f.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/module-7c8b159f.js","_static/module-4879e776.js"]),warmupEntryPath:"plugins/main/src/assets/animation-clip/index.tsx"},"animator-controller":{load:async()=>__vitePreload(()=>import("./AnimatorControllerAsset-1b29c766.js"),["_static/AnimatorControllerAsset-1b29c766.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js"]),warmupEntryPath:"plugins/main/src/assets/animator-controller/AnimatorControllerAsset.ts"},audio:{load:async()=>__vitePreload(()=>import("./AudioAsset-f206da55.js"),["_static/AudioAsset-f206da55.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js"]),warmupEntryPath:"plugins/main/src/assets/audio/AudioAsset.tsx"},font:{load:async()=>__vitePreload(()=>import("./FontAsset-29ed97fd.js"),["_static/FontAsset-29ed97fd.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js"]),warmupEntryPath:"plugins/main/src/assets/font/FontAsset.tsx"},gltf:{load:async()=>__vitePreload(()=>import("./GlTFAsset-84f09723.js").then(nt=>nt.b),["_static/GlTFAsset-84f09723.js","_static/glTFIO-79bbca27.js","_static/meshopt_simplifier.module-cd99529d.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js","_static/MaterialAsset-088e8e0a.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/ProxyConfigs-d85202ac.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/gltf/GlTFAsset.tsx"},lottie:{load:async()=>__vitePreload(()=>import("./LottieAsset-898108e3.js"),["_static/LottieAsset-898108e3.js","_static/module-7c8b159f.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/SpriteAsset-9b36d0ae.js","_static/AssetViewer-a2f4ee75.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/Tooltip-c35612f0.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js","_static/SpriteAtlasAsset-3f3112ca.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js"]),warmupEntryPath:"plugins/main/src/assets/lottie/LottieAsset.tsx"},markdown:{load:async()=>__vitePreload(()=>import("./MarkdownAsset-707897f5.js"),["_static/MarkdownAsset-707897f5.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/assets/markdown/MarkdownAsset.ts"},material:{load:async()=>__vitePreload(()=>import("./MaterialAsset-088e8e0a.js").then(nt=>nt.b),["_static/MaterialAsset-088e8e0a.js","_static/index-0487cdcf.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/AssetViewer-a2f4ee75.js","_static/ProxyConfigs-d85202ac.js"]),warmupEntryPath:"plugins/main/src/assets/material/MaterialAsset.tsx"},mesh:{load:async()=>__vitePreload(()=>import("./MeshAsset-ff94b6a7.js"),["_static/MeshAsset-ff94b6a7.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/index-ca459192.js","_static/MeshThumbnail-768ca939.js","_static/AssetViewer-a2f4ee75.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js"]),warmupEntryPath:"plugins/main/src/assets/mesh/MeshAsset.tsx"},"physics-material":{load:async()=>__vitePreload(()=>import("./PhysicsMaterialAsset-291fc997.js"),["_static/PhysicsMaterialAsset-291fc997.js","_static/index-0487cdcf.js"]),warmupEntryPath:"plugins/main/src/assets/physics/PhysicsMaterialAsset.ts"},prefab:{load:async()=>__vitePreload(()=>import("./PrefabAsset-0afc28fa.js"),["_static/PrefabAsset-0afc28fa.js","_static/TaskQueue-05c94a4d.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js"]),warmupEntryPath:"plugins/main/src/assets/prefab/PrefabAsset.ts"},"primitive-mesh":{load:async()=>__vitePreload(()=>import("./PrimitiveMesh-10b1161f.js"),["_static/PrimitiveMesh-10b1161f.js","_static/index-0487cdcf.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/MeshThumbnail-768ca939.js"]),warmupEntryPath:"plugins/main/src/assets/primitive-mesh/PrimitiveMesh.ts"},"render-target":{load:async()=>__vitePreload(()=>import("./RenderTargetAsset-248f1eb5.js"),["_static/RenderTargetAsset-248f1eb5.js","_static/index-0487cdcf.js","_static/AssetViewer-a2f4ee75.js"]),warmupEntryPath:"plugins/main/src/assets/render-target/RenderTargetAsset.ts"},scene:{load:async()=>__vitePreload(()=>import("./SceneAsset-c2a6f842.js"),["_static/SceneAsset-c2a6f842.js","_static/index-0487cdcf.js"]),warmupEntryPath:"plugins/main/src/assets/scene/SceneAsset.tsx"},script:{load:async()=>__vitePreload(()=>import("./index-7abbe07f.js"),["_static/index-7abbe07f.js","_static/ShaderUIScriptAsset-aa3adb43.js","_static/index-0487cdcf.js"]),warmupEntryPath:"plugins/main/src/assets/script/index.ts"},shader:{load:async()=>__vitePreload(()=>import("./index-06fc94fa.js"),["_static/index-06fc94fa.js","_static/ShaderAsset-d1e99a96.js","_static/index-0487cdcf.js","_static/ProxyConfigs-d85202ac.js","_static/IconPointFilled-71525313.js","_static/index-ca459192.js","_static/ShaderUIScriptAsset-aa3adb43.js"]),warmupEntryPath:"plugins/main/src/assets/shader/index.ts"},spine:{load:async()=>__vitePreload(()=>import("./SpineSkeletonDataAsset-cddcc22b.js").then(nt=>nt.a),["_static/SpineSkeletonDataAsset-cddcc22b.js","_static/module-4879e776.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js"]),warmupEntryPath:"plugins/main/src/assets/spine/SpineSkeletonDataAsset.tsx"},"sprite-atlas":{load:async()=>__vitePreload(()=>import("./SpriteAtlasAsset-3f3112ca.js").then(nt=>nt.a),["_static/SpriteAtlasAsset-3f3112ca.js","_static/index-0487cdcf.js","_static/SpriteAsset-9b36d0ae.js","_static/AssetViewer-a2f4ee75.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/postmen-e6429bad.js","_static/encode-ac4bb64e.js","_static/Tooltip-c35612f0.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js"]),warmupEntryPath:"plugins/main/src/assets/atlas/SpriteAtlasAsset.tsx"},sprite:{load:async()=>__vitePreload(()=>import("./SpriteAsset-9b36d0ae.js").then(nt=>nt.e),["_static/SpriteAsset-9b36d0ae.js","_static/index-0487cdcf.js","_static/AssetViewer-a2f4ee75.js","_static/meshopt_simplifier.module-cd99529d.js","_static/bundlers-9b0d37fc.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/postmen-e6429bad.js","_static/encode-ac4bb64e.js","_static/Tooltip-c35612f0.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/sprite/SpriteAsset.ts"},texture:{load:async()=>__vitePreload(()=>import("./TextureAsset-77e6000d.js").then(nt=>nt.d),["_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-c35612f0.js","_static/AssetViewer-a2f4ee75.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js"]),warmupEntryPath:"plugins/main/src/assets/texture/TextureAsset.tsx"},"xr-reference-image":{load:async()=>__vitePreload(()=>import("./XRReferenceImageAsset-b786aca3.js"),["_static/XRReferenceImageAsset-b786aca3.js","_static/module-b565f34f.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/AssetViewer-a2f4ee75.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js"]),warmupEntryPath:"plugins/main/src/assets/xr/XRReferenceImageAsset.tsx"}},COMPONENT_MODULE_REGISTRY={"all-components":{load:async()=>__vitePreload(()=>import("./index-48d557b0.js"),["_static/index-48d557b0.js","_static/CameraComponent-850a5d98.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/DirectLight-8734007f.js","_static/LightBaseComponent-14ad9432.js","_static/PointLight-248fb1a9.js","_static/postmen-e6429bad.js","_static/SpotLight-3bb8f39e.js","_static/MeshRendererComponent-7f29ba50.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-659bf0ee.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/MeshRendererBaseComponent-b7db519d.js","_static/SkinnedMeshRendererComponent-4a77c8d9.js","_static/AnimatorStore-2bd92a36.js","_static/SpriteRendererComponent-8afb7837.js","_static/SpriteBaseComponent-ab727e8e.js","_static/SpriteMaskComponent-ed64e403.js","_static/PhysicsStore-50022658.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js","_static/index-906d9f78.js","_static/scriptPropertyActions-d3a583d2.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-c35612f0.js","_static/AssetViewer-a2f4ee75.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-84f09723.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-088e8e0a.js","_static/ProxyConfigs-d85202ac.js","_static/MeshAsset-ff94b6a7.js","_static/index-ca459192.js","_static/MeshThumbnail-768ca939.js","_static/AnimatorControllerAsset-1b29c766.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-a5adbe0b.js","_static/module-7c8b159f.js","_static/module-4879e776.js","_static/SpriteAsset-9b36d0ae.js","_static/SpriteAtlasAsset-3f3112ca.js","_static/AmbientLightAsset-52dfaaf8.js","_static/LottieAsset-898108e3.js","_static/ShaderChunkAsset-6fc715c5.js","_static/SpineSkeletonDataAsset-cddcc22b.js","_static/FontAsset-29ed97fd.js","_static/SceneAsset-c2a6f842.js","_static/ShaderAsset-d1e99a96.js","_static/ShaderUIScriptAsset-aa3adb43.js","_static/PrimitiveMesh-10b1161f.js","_static/XRReferenceImageAsset-b786aca3.js","_static/module-b565f34f.js","_static/PrefabAsset-0afc28fa.js","_static/PhysicsMaterialAsset-291fc997.js","_static/RenderTargetAsset-248f1eb5.js","_static/AudioAsset-f206da55.js","_static/index-7abbe07f.js","_static/MarkdownAsset-707897f5.js","_static/TextRendererComponent-8eb60833.js","_static/TextBaseComponent-13689460.js","_static/LottieAnimationComponent-163b16fe.js","_static/SpineAnimationComponent-b5de1844.js","_static/ParticleRendererComponent-9bcd1886.js","_static/index-8800c7e6.js","_static/Menu-d694f08a.js","_static/TrailRendererComponent-cabae051.js","_static/index-fd599472.js","_static/PostProcessComponent-cd6546b3.js","_static/AudioComponent-a1e6e156.js","_static/TransformComponent-d6649e8f.js","_static/TransformBaseComponent-c0a6a3c8.js","_static/index-6087df7e.js","_static/Callout-a96a8430.js"]),warmupEntryPath:"plugins/main/src/components/index.ts"},animator:{load:async()=>__vitePreload(()=>import("./index-8b6efd6a.js"),["_static/index-8b6efd6a.js","_static/AnimatorStore-2bd92a36.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/components/animator/index.ts"},"audio-listener":{load:async()=>__vitePreload(()=>import("./audio-7c0ae7d6.js"),["_static/audio-7c0ae7d6.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/components/audio.ts"},"audio-source":{load:async()=>__vitePreload(()=>import("./AudioComponent-a1e6e156.js"),["_static/AudioComponent-a1e6e156.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/components/AudioComponent.ts"},camera:{load:async()=>__vitePreload(()=>import("./CameraComponent-850a5d98.js"),["_static/CameraComponent-850a5d98.js","_static/index-0487cdcf.js","_static/Component-964374b8.js"]),warmupEntryPath:"plugins/main/src/components/CameraComponent.ts"},"direct-light":{load:async()=>__vitePreload(()=>import("./DirectLight-8734007f.js"),["_static/DirectLight-8734007f.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/LightBaseComponent-14ad9432.js"]),warmupEntryPath:"plugins/main/src/components/light/DirectLight.ts"},"lottie-animation":{load:async()=>__vitePreload(()=>import("./LottieAnimationComponent-163b16fe.js"),["_static/LottieAnimationComponent-163b16fe.js","_static/module-7c8b159f.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/components/LottieAnimationComponent.ts"},"mesh-renderer":{load:async()=>__vitePreload(()=>import("./MeshRendererComponent-7f29ba50.js"),["_static/MeshRendererComponent-7f29ba50.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-659bf0ee.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/MeshRendererBaseComponent-b7db519d.js"]),warmupEntryPath:"plugins/main/src/components/mesh-renderer/MeshRendererComponent.ts"},"particle-renderer":{load:async()=>__vitePreload(()=>import("./ParticleRendererComponent-9bcd1886.js"),["_static/ParticleRendererComponent-9bcd1886.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-659bf0ee.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-c35612f0.js","_static/AssetViewer-a2f4ee75.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-84f09723.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-088e8e0a.js","_static/ProxyConfigs-d85202ac.js","_static/MeshAsset-ff94b6a7.js","_static/index-ca459192.js","_static/MeshThumbnail-768ca939.js","_static/AnimatorControllerAsset-1b29c766.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-a5adbe0b.js","_static/module-7c8b159f.js","_static/module-4879e776.js","_static/SpriteAsset-9b36d0ae.js","_static/SpriteAtlasAsset-3f3112ca.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js","_static/AmbientLightAsset-52dfaaf8.js","_static/LottieAsset-898108e3.js","_static/ShaderChunkAsset-6fc715c5.js","_static/SpineSkeletonDataAsset-cddcc22b.js","_static/FontAsset-29ed97fd.js","_static/SceneAsset-c2a6f842.js","_static/ShaderAsset-d1e99a96.js","_static/ShaderUIScriptAsset-aa3adb43.js","_static/PrimitiveMesh-10b1161f.js","_static/XRReferenceImageAsset-b786aca3.js","_static/module-b565f34f.js","_static/PrefabAsset-0afc28fa.js","_static/PhysicsMaterialAsset-291fc997.js","_static/RenderTargetAsset-248f1eb5.js","_static/AudioAsset-f206da55.js","_static/index-7abbe07f.js","_static/MarkdownAsset-707897f5.js","_static/index-8800c7e6.js","_static/Menu-d694f08a.js"]),warmupEntryPath:"plugins/main/src/components/effects/ParticleRendererComponent.tsx"},physics:{load:async()=>__vitePreload(()=>import("./index-8b6ebbf6.js"),["_static/index-8b6ebbf6.js","_static/PhysicsStore-50022658.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js"]),warmupEntryPath:"plugins/main/src/components/physics/index.ts"},"point-light":{load:async()=>__vitePreload(()=>import("./PointLight-248fb1a9.js"),["_static/PointLight-248fb1a9.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/LightBaseComponent-14ad9432.js"]),warmupEntryPath:"plugins/main/src/components/light/PointLight.ts"},"post-process":{load:async()=>__vitePreload(()=>import("./index-bd2b1247.js"),["_static/index-bd2b1247.js","_static/PostProcessComponent-cd6546b3.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/Menu-d694f08a.js","_static/Accordion-4581466b.js"]),warmupEntryPath:"plugins/main/src/components/postProcess/index.ts"},script:{load:async()=>__vitePreload(()=>import("./index-906d9f78.js"),["_static/index-906d9f78.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/scriptPropertyActions-d3a583d2.js","_static/TextureAsset-77e6000d.js","_static/enum-58295f88.js","_static/encode-ac4bb64e.js","_static/meshopt_simplifier.module-cd99529d.js","_static/Tooltip-c35612f0.js","_static/AssetViewer-a2f4ee75.js","_static/ktx2-encoder-5413e034.js","_static/TaskQueue-05c94a4d.js","_static/GlTFAsset-84f09723.js","_static/glTFIO-79bbca27.js","_static/MaterialAsset-088e8e0a.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/ProxyConfigs-d85202ac.js","_static/MeshAsset-ff94b6a7.js","_static/index-ca459192.js","_static/MeshThumbnail-768ca939.js","_static/AnimatorControllerAsset-1b29c766.js","_static/bundlers-9b0d37fc.js","_static/assetEditorActions-c4e5962f.js","_static/AnimationClipAsset-a5adbe0b.js","_static/module-7c8b159f.js","_static/module-4879e776.js","_static/SpriteAsset-9b36d0ae.js","_static/SpriteAtlasAsset-3f3112ca.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js","_static/AmbientLightAsset-52dfaaf8.js","_static/LottieAsset-898108e3.js","_static/ShaderChunkAsset-6fc715c5.js","_static/SpineSkeletonDataAsset-cddcc22b.js","_static/FontAsset-29ed97fd.js","_static/SceneAsset-c2a6f842.js","_static/ShaderAsset-d1e99a96.js","_static/ShaderUIScriptAsset-aa3adb43.js","_static/PrimitiveMesh-10b1161f.js","_static/XRReferenceImageAsset-b786aca3.js","_static/module-b565f34f.js","_static/PrefabAsset-0afc28fa.js","_static/PhysicsMaterialAsset-291fc997.js","_static/RenderTargetAsset-248f1eb5.js","_static/AudioAsset-f206da55.js","_static/index-7abbe07f.js","_static/MarkdownAsset-707897f5.js"]),warmupEntryPath:"plugins/main/src/components/ScriptComponent/index.tsx"},"skinned-mesh-renderer":{load:async()=>__vitePreload(()=>import("./SkinnedMeshRendererComponent-4a77c8d9.js"),["_static/SkinnedMeshRendererComponent-4a77c8d9.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/createOnModelChange-b57a0da8.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js","_static/MeshRendererBaseComponent-b7db519d.js"]),warmupEntryPath:"plugins/main/src/components/skinned-mesh-renderer/SkinnedMeshRendererComponent.ts"},"spine-animation":{load:async()=>__vitePreload(()=>import("./SpineAnimationComponent-b5de1844.js"),["_static/SpineAnimationComponent-b5de1844.js","_static/module-4879e776.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/components/SpineAnimationComponent.ts"},"spot-light":{load:async()=>__vitePreload(()=>import("./SpotLight-3bb8f39e.js"),["_static/SpotLight-3bb8f39e.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/LightBaseComponent-14ad9432.js"]),warmupEntryPath:"plugins/main/src/components/light/SpotLight.ts"},"sprite-mask":{load:async()=>__vitePreload(()=>import("./SpriteMaskComponent-ed64e403.js"),["_static/SpriteMaskComponent-ed64e403.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js"]),warmupEntryPath:"plugins/main/src/components/SpriteMaskComponent.ts"},"sprite-renderer":{load:async()=>__vitePreload(()=>import("./SpriteRendererComponent-8afb7837.js"),["_static/SpriteRendererComponent-8afb7837.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/createOnModelChange-b57a0da8.js","_static/SpriteBaseComponent-ab727e8e.js"]),warmupEntryPath:"plugins/main/src/components/sprite/SpriteRendererComponent.ts"},"text-renderer":{load:async()=>__vitePreload(()=>import("./TextRendererComponent-8eb60833.js"),["_static/TextRendererComponent-8eb60833.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/TextBaseComponent-13689460.js"]),warmupEntryPath:"plugins/main/src/components/text/TextRendererComponent.ts"},"trail-renderer":{load:async()=>__vitePreload(()=>import("./TrailRendererComponent-cabae051.js"),["_static/TrailRendererComponent-cabae051.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/postmen-e6429bad.js","_static/index-8800c7e6.js","_static/Menu-d694f08a.js","_static/createOnModelChange-b57a0da8.js","_static/ReferencedMaterial-659bf0ee.js","_static/MaterialInspector-93a0838d.js","_static/IconPointFilled-71525313.js"]),warmupEntryPath:"plugins/main/src/components/effects/TrailRendererComponent.tsx"},transform:{load:async()=>__vitePreload(()=>import("./TransformComponent-d6649e8f.js"),["_static/TransformComponent-d6649e8f.js","_static/index-0487cdcf.js","_static/Component-964374b8.js","_static/TransformBaseComponent-c0a6a3c8.js"]),warmupEntryPath:"plugins/main/src/components/transform/TransformComponent.ts"},ui:{load:async()=>__vitePreload(()=>import("./index-6087df7e.js"),["_static/index-6087df7e.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/Component-964374b8.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js","_static/SpriteBaseComponent-ab727e8e.js","_static/TextBaseComponent-13689460.js","_static/TransformBaseComponent-c0a6a3c8.js","_static/Callout-a96a8430.js"]),warmupEntryPath:"plugins/main/src/components/ui/index.ts"},xr:{load:async()=>__vitePreload(()=>import("./index-fd599472.js").then(nt=>nt.i),["_static/index-fd599472.js","_static/module-b565f34f.js","_static/index-0487cdcf.js","_static/postmen-e6429bad.js","_static/FormItemArray-536e9ade.js","_static/Accordion-4581466b.js","_static/IconEdit-493cbbb3.js","_static/scriptPropertyActions-d3a583d2.js"]),warmupEntryPath:"plugins/main/src/components/xr/index.ts"}},GLTF_IO_MODULE_REGISTRATION={load:async()=>__vitePreload(()=>import("./glTFIO-79bbca27.js").then(nt=>nt.j),["_static/glTFIO-79bbca27.js","_static/meshopt_simplifier.module-cd99529d.js"]),warmupEntryPath:"plugins/main/src/assets/gltf/glTFIO.ts"};function createRuntimeBootstrapState(){return{loadedAssetModuleKeys:new Set,loadedComponentModuleKeys:new Set,gltfIOInitialized:!1}}async function runRuntimeBootstrapPlan({state:nt,plan:_e,onStage:tt,loadAssetModule:et,loadComponentModule:rt,loadGlTFIOModule:it}){const ot=_e.assetModuleKeys.filter(st=>!nt.loadedAssetModuleKeys.has(st));ot.length>0&&(tt==null||tt("register-assets"),await Promise.all(ot.map(async st=>{await et(st),nt.loadedAssetModuleKeys.add(st)})));const at=_e.componentModuleKeys.filter(st=>!nt.loadedComponentModuleKeys.has(st));if(at.length>0&&(tt==null||tt("register-components"),await Promise.all(at.map(async st=>{await rt(st),nt.loadedComponentModuleKeys.add(st)}))),_e.shouldInitGlTFIO&&!nt.gltfIOInitialized){tt==null||tt("init-gltf-io");const{initGlTFIO:st}=await it();await st(),nt.gltfIOInitialized=!0}}function bootstrapEditorRuntime(nt={}){const _e=()=>runRuntimeBootstrapPlan({state:bootstrapState,plan:nt.plan??FULL_RUNTIME_BOOTSTRAP_PLAN,onStage:nt.onStage,loadAssetModule:nt.loadAssetModule??defaultLoadAssetModule,loadComponentModule:nt.loadComponentModule??defaultLoadComponentModule,loadGlTFIOModule:nt.loadGlTFIOModule??defaultLoadGlTFIOModule}),tt=bootstrapQueue.then(_e,_e);return bootstrapQueue=tt.then(()=>{},()=>{}),tt}const FULL_RUNTIME_BOOTSTRAP_PLAN={mode:"full",assetTypes:[],componentTypes:[],unknownAssetTypes:[],unknownComponentTypes:[],assetModuleKeys:[...FULL_ASSET_MODULE_KEYS],componentModuleKeys:[...FULL_COMPONENT_MODULE_KEYS],shouldInitGlTFIO:!0};function defaultLoadAssetModule(nt){var tt;const _e=(tt=ASSET_MODULE_REGISTRY[nt])==null?void 0:tt.load;if(!_e)throw new Error(`unsupported asset runtime module: ${nt}`);return _e()}function defaultLoadComponentModule(nt){var tt;const _e=(tt=COMPONENT_MODULE_REGISTRY[nt])==null?void 0:tt.load;if(!_e)throw new Error(`unsupported component runtime module: ${nt}`);return _e()}async function defaultLoadGlTFIOModule(){return await GLTF_IO_MODULE_REGISTRATION.load()}const bootstrapState=createRuntimeBootstrapState();let bootstrapQueue=Promise.resolve();function attachSceneHotReload(nt){const _e=new EventSource("/events");return _e.onmessage=async tt=>{var rt,it,ot,at,st;let et=null;try{et=JSON.parse(tt.data)}catch{return}try{et.type==="full-refresh"?((rt=nt.onStatus)==null||rt.call(nt,et.reason==="project"?"project changed, rebuilding...":"scene changed, refreshing..."),await nt.runtime.reload(),(it=nt.onStatus)==null||it.call(nt,et.reason==="project"?"project rebuilt":"scene refreshed","idle")):((ot=nt.onStatus)==null||ot.call(nt,`assets changed (${et.changes.length}), refreshing...`),await nt.runtime.applyAssetBatchChange({changes:et.changes}),(at=nt.onStatus)==null||at.call(nt,`assets refreshed (${et.changes.length})`,"idle"))}catch(ct){console.error(ct),(st=nt.onStatus)==null||st.call(nt,"refresh failed, reloading page...","busy"),setTimeout(()=>location.reload(),500)}},_e.onerror=()=>{var tt;(tt=nt.onStatus)==null||tt.call(nt,"hot reload disconnected, retrying...")},_e.onopen=()=>{var tt;(tt=nt.onStatus)==null||tt.call(nt,"hot reload connected","idle")},()=>{_e.close()}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(nt){return nt&&nt.__esModule&&Object.prototype.hasOwnProperty.call(nt,"default")?nt.default:nt}function getAugmentedNamespace(nt){if(nt.__esModule)return nt;var _e=nt.default;if(typeof _e=="function"){var tt=function et(){return this instanceof et?Reflect.construct(_e,arguments,this.constructor):_e.apply(this,arguments)};tt.prototype=_e.prototype}else tt={};return Object.defineProperty(tt,"__esModule",{value:!0}),Object.keys(nt).forEach(function(et){var rt=Object.getOwnPropertyDescriptor(nt,et);Object.defineProperty(tt,et,rt.get?rt:{enumerable:!0,get:function(){return nt[et]}})}),tt}var browser={exports:{}};(function(nt){(_e=>{var tt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,rt=Object.getOwnPropertyNames,it=Object.prototype.hasOwnProperty,ot=(Kt,Qt)=>{for(var nn in Qt)tt(Kt,nn,{get:Qt[nn],enumerable:!0})},at=(Kt,Qt,nn,un)=>{if(Qt&&typeof Qt=="object"||typeof Qt=="function")for(let yn of rt(Qt))!it.call(Kt,yn)&&yn!==nn&&tt(Kt,yn,{get:()=>Qt[yn],enumerable:!(un=et(Qt,yn))||un.enumerable});return Kt},st=Kt=>at(tt({},"__esModule",{value:!0}),Kt),ct=(Kt,Qt,nn)=>new Promise((un,yn)=>{var Sn=dn=>{try{An(nn.next(dn))}catch(Dn){yn(Dn)}},mn=dn=>{try{An(nn.throw(dn))}catch(Dn){yn(Dn)}},An=dn=>dn.done?un(dn.value):Promise.resolve(dn.value).then(Sn,mn);An((nn=nn.apply(Kt,Qt)).next())}),ut={};ot(ut,{analyzeMetafile:()=>Yr,analyzeMetafileSync:()=>Jr,build:()=>Cr,buildSync:()=>Kr,context:()=>_r,default:()=>zr,formatMessages:()=>Xr,formatMessagesSync:()=>Qr,initialize:()=>_i,stop:()=>Zr,transform:()=>Vr,transformSync:()=>qr,version:()=>mr}),_e.exports=st(ut);function dt(Kt){let Qt=un=>{if(un===null)nn.write8(0);else if(typeof un=="boolean")nn.write8(1),nn.write8(+un);else if(typeof un=="number")nn.write8(2),nn.write32(un|0);else if(typeof un=="string")nn.write8(3),nn.write(pt(un));else if(un instanceof Uint8Array)nn.write8(4),nn.write(un);else if(un instanceof Array){nn.write8(5),nn.write32(un.length);for(let yn of un)Qt(yn)}else{let yn=Object.keys(un);nn.write8(6),nn.write32(yn.length);for(let Sn of yn)nn.write(pt(Sn)),Qt(un[Sn])}},nn=new ft;return nn.write32(0),nn.write32(Kt.id<<1|+!Kt.isRequest),Qt(Kt.value),yt(nn.buf,nn.len-4,0),nn.buf.subarray(0,nn.len)}function ht(Kt){let Qt=()=>{switch(nn.read8()){case 0:return null;case 1:return!!nn.read8();case 2:return nn.read32();case 3:return mt(nn.read());case 4:return nn.read();case 5:{let mn=nn.read32(),An=[];for(let dn=0;dn<mn;dn++)An.push(Qt());return An}case 6:{let mn=nn.read32(),An={};for(let dn=0;dn<mn;dn++)An[mt(nn.read())]=Qt();return An}default:throw new Error("Invalid packet")}},nn=new ft(Kt),un=nn.read32(),yn=(un&1)===0;un>>>=1;let Sn=Qt();if(nn.ptr!==Kt.length)throw new Error("Invalid packet");return{id:un,isRequest:yn,value:Sn}}var ft=class{constructor(Kt=new Uint8Array(1024)){this.buf=Kt,this.len=0,this.ptr=0}_write(Kt){if(this.len+Kt>this.buf.length){let Qt=new Uint8Array((this.len+Kt)*2);Qt.set(this.buf),this.buf=Qt}return this.len+=Kt,this.len-Kt}write8(Kt){let Qt=this._write(1);this.buf[Qt]=Kt}write32(Kt){let Qt=this._write(4);yt(this.buf,Kt,Qt)}write(Kt){let Qt=this._write(4+Kt.length);yt(this.buf,Kt.length,Qt),this.buf.set(Kt,Qt+4)}_read(Kt){if(this.ptr+Kt>this.buf.length)throw new Error("Invalid packet");return this.ptr+=Kt,this.ptr-Kt}read8(){return this.buf[this._read(1)]}read32(){return _t(this.buf,this._read(4))}read(){let Kt=this.read32(),Qt=new Uint8Array(Kt),nn=this._read(Qt.length);return Qt.set(this.buf.subarray(nn,nn+Kt)),Qt}},pt,mt,vt;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let Kt=new TextEncoder,Qt=new TextDecoder;pt=nn=>Kt.encode(nn),mt=nn=>Qt.decode(nn),vt='new TextEncoder().encode("")'}else if(typeof Buffer<"u")pt=Kt=>Buffer.from(Kt),mt=Kt=>{let{buffer:Qt,byteOffset:nn,byteLength:un}=Kt;return Buffer.from(Qt,nn,un).toString()},vt='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(pt("")instanceof Uint8Array))throw new Error(`Invariant violation: "${vt} instanceof Uint8Array" is incorrectly false
2
2
 
3
3
  This indicates that your JavaScript environment is broken. You cannot use
4
4
  esbuild in this environment because esbuild relies on this invariant. This
@@ -707,7 +707,7 @@ Please switch to a supported browser to use this feature.`,"unsupported-confirm"
707
707
  请切换到受支持的浏览器后再使用。`,"unsupported-confirm":"知道了"},"sprite-atlas":{title:"精灵图集",adding:"添加中",success:"成功",error:"添加精灵失败"},"tree-shaking":{tip:"Tree Shaking 是减少项目文件大小的有效功能。在打包时可智能移除项目中不需要的资产",default:{title:"默认",desc:"关闭 Tree Shaking"},"current-scene":{title:"当前场景",desc:"仅对默认场景做 Tree Shaking"},"all-scene":{title:"所有场景",desc:"对所有场景做 Tree Shaking"},title:"Tree Shaking"},"primitive-mesh":{title:"原始网格",type:{label:"类型",info:"要创建的原始网格类型"},sphere:{radius:{label:"半径",info:"球体的半径"},step:{label:"步数",info:"构建球体所用的段数"}},capsule:{radius:{label:"半径",info:"胶囊体的半径"},height:{label:"高度",info:"胶囊体的高度"},"radial-segments":{label:"径向段数",info:"胶囊体周围的段数"},"height-segments":{label:"高度段数",info:"胶囊体高度上的段数"}},cone:{radius:{label:"底部半径",info:"圆锥底部的半径"},height:{label:"高度",info:"圆锥的高度"},"radial-segments":{label:"径向段数",info:"圆锥周围的段数"},"height-segments":{label:"高度段数",info:"圆锥高度上的段数"}},cuboid:{width:{label:"宽度",info:"立方体的宽度"},height:{label:"高度",info:"立方体的高度"},depth:{label:"深度",info:"立方体的深度"}},cylinder:{"radius-top":{label:"顶半径",info:"圆柱顶的半径"},"radius-bottom":{label:"底半径",info:"圆柱底的半径"},height:{label:"高度",info:"圆柱的高度"},"radial-segments":{label:"径向段数",info:"圆柱周围的段数"},"height-segments":{label:"高度段数",info:"圆柱高度上的段数"}},plane:{width:{label:"宽度",info:"平面的宽度"},height:{label:"高度",info:"平面的高度"},"horizontal-segments":{label:"水平段数",info:"平面宽度上的段数"},"vertical-segments":{label:"垂直段数",info:"平面高度上的段数"}},torus:{radius:{label:"半径",info:"从环中心到管中心的半径"},"tube-radius":{label:"管半径",info:"环管的半径"},"radial-segments":{label:"径向段数",info:"环周围的段数"},"tubular-segments":{label:"管段数",info:"管周围的段数"},arc:{label:"弧度",info:"环段的中心角度"}}},gltf:{title:"GlTF","basic-info":"基本信息",triangles:"三角形",drawcall:"绘制调用","compute-tangents":"计算切线","keep-mesh-data":"保留网格数据","refresh-tip":"刷新后生效",issues:"问题","remapped-materials":"重新映射的材质",compression:"压缩",quantize:"量化",meshopt:"网格优化"},"select-asset":"选择资产...",filter:{all:"全部"},folder:{title:"文件夹"},shader:{title:"着色器"},material:{title:"材质"},script:{title:"脚本"},font:{title:"字体"},"texture-cube":{title:"TextureCube"},"ambient-light":{title:"环境光"},"directional-light":{title:"平行光"},"point-light":{title:"点光源"},"spot-light":{title:"聚光灯"},sprite:{title:"精灵"},"xr-reference-image":{title:"XR参考图像"},"animator-controller":{title:"动画控制器"},"animation-clip":{title:"动画片段"},scene:{title:"场景"},"physics-material":{title:"物理材质"},"render-target":{title:"渲染目标"},"entity-script":{title:"实体脚本"},"state-machine-script":{title:"状态机脚本"},"shader-chunk":{title:"着色器片段"},"shader-ui-script":{title:"着色器UI脚本"},prefab:{title:"预制体"},audio:{title:"音频"},mesh:{title:"网格"},lottie:{title:"Lottie"},"spine-skeleton-data":{title:"Spine骨骼数据"},"spine-atlas":{title:"图集"},ktx2:{mode:{label:"模式",uastc:{label:"UASTC",desc:"UASTC 提供更好的质量但文件更大"},etc1s:{label:"ETC1S",desc:"ETC1S 提供更好的压缩率但质量较低"}},quality:"质量"}},transform$3={position:{title:"位置",info:"实体在3D空间中的位置"},rotation:{title:"旋转",info:"实体在3D空间中的旋转角度"},scale:{title:"缩放",info:"实体在3D空间中的缩放比例"},error:{"cant-disable":"无法禁用变换组件","cant-delete":"无法删除变换组件"}},light$1={color:"颜色","culling-mask":"剔除遮罩",point:{distance:{label:"距离",info:"点光源能照亮的最大距离"}},shadow:{title:"阴影",type:{label:"类型",info:"阴影类型",none:"无",hard:"硬阴影",softlow:"软阴影(低质量)",softhigh:"软阴影(高质量)"},bias:{label:"偏移",info:"阴影偏移,用于防止阴影痤疮"},"normal-bias":{label:"法线偏移",info:"阴影法线偏移,用于防止阴影痤疮"},"near-plane-offset":{label:"近平面偏移",info:"阴影近平面偏移"},strength:{label:"强度",info:"阴影强度"}},spot:{distance:{label:"距离",info:"聚光灯能照亮的最大距离"},angle:{label:"角度",info:"聚光灯的锥形角度"},penumbra:{label:"半影角度",info:"聚光灯的半影角度"}}},prefab$1={inspector:{"basic-info":"基本信息","dependent-assets":"依赖资产",url:"URL",missed:"缺失"},error:{"create-from-sub":"不能从预制体子实体创建预制体"},delete:{title:"删除预制体实例?",description:"预制体 '{{name}}' 已被移除,是否要删除所有实例?"},button:{no:"否",yes:"是"},replace:{title:"替换预制体",description:'确定要替换预制体 "{{name}}" 吗?所有预制体实例都将被替换',confirm:"仍然替换"}},community$1={title:"社区","all-projects":"全部项目","my-projects":"我的项目","all-projects-desc":"探索社区分享的项目","my-projects-desc":"您发布到社区的项目","search-placeholder":"搜索社区项目...","no-projects":"未找到社区项目","no-my-projects":"您还没有发布任何项目","publish-hint":"发布您的第一个项目与社区分享","load-more":"加载更多",loading:"加载中...","no-preview":"预览不可用",preview:"预览",share:"分享",withdraw:"撤回",tags:"标签",license:"许可证",stats:"统计",copyright:"额外版权声明",views:"浏览",likes:"点赞",downloads:"下载",publish:{title:"发布到社区","published-at":"发布于","publish-button":"发布",agreement:"点击发布即表示您同意我们的","community-guidelines":"社区准则","more-options":"更多选项"},"link-copied":"链接已复制到剪贴板","withdraw-success":"项目撤回成功","withdraw-error":"撤回项目失败","publish-success":"已提交审核",status:{pending:"待审核",approved:"已通过",rejected:"已拒绝"}},resourcePackage$1={export:"导出为资源包","export-cdn":"CDN 资源包","export-local":"文件资源包","export-project":"导出整个项目","export-project-cdn":"CDN 资源包","export-project-local":"文件资源包",import:"导入资源包","import-from-file":"从文件导入","import-from-url":"从 URL 导入","input-url":"请输入 GRP 资源包 URL",cancel:"取消",confirm:"确定",exporting:"正在导出资源包...",uploading:"正在上传资源包...",importing:"正在导入资源包...","export-success":"资源包导出成功","upload-success":"CDN URL 已复制到剪贴板","export-failed":"资源包导出失败","import-success":"资源包导入成功","import-failed":"资源包导入失败","no-assets-selected":"请先选择要导出的资产","cant-export-sub-asset":"无法导出子资产",assets:"个资产"},zh$2={service:service$1,"code-editor":{"back-to-editor":"返回场景编辑器",preview:"预览",devtools:{console:"控制台",inspector:"检查器"},file:{"not-saved":"文件未保存。","not-saved-description":"是否仍要放弃更改?所有未保存的更改都将丢失。",cancel:"取消",confirm:"确认",project:"项目"},"event-debug":{input:"输入",json:"JSON",clear:"清空",confirm:"确认",events:"事件",trigger:"触发","no-events":"未检测到来自预览的任何事件信号。"},"file-tree":{title:"资源",search:{placeholder:"搜索文件..."}},library:{title:"依赖",import:"导入",search:{placeholder:"库名称"},version:{latest:"最新",updating:"更新中..."}},menubar:{file:{title:"文件","new-file":"新建文件","open-file":"打开文件",save:"保存",close:"关闭"},edit:{title:"编辑",undo:"撤销",redo:"重做",find:{title:"查找...",find:"查找",replace:"替换"},cut:"剪切",copy:"复制",paste:"粘贴"},view:{title:"视图","show-minimap":"显示小地图","new-tab":"新建标签页","close-tab":"关闭标签页",share:"分享",print:"打印"},help:{title:"帮助",documentation:"文档","shaderlab-syntax":"Shaderlab 语法",about:"关于"}},monaco:{loading:"加载中..."},"preview-inspector":{title:"检查器"},"preview-toolbar":{"open-in-new-tab":"在新标签页中打开","toggle-orientation":"切换方向","toggle-lock":"切换锁定",refresh:"刷新",close:"关闭"}},shortcuts:shortcuts$1,project:project$1,member:member$1,setting:setting$1,snapshot:snapshot$1,export:{"copied-to-clipboard":"已复制到剪贴板",auto:"自动","playing-options":{title:"游玩选项","loading-ui":"加载界面","orbit-control":"轨道控制",enable:"启用",disabled:"禁用"},"main-scene":"主场景",default:"默认","current-scene":"当前场景","all-scene":"所有场景",fixed:"固定","required-external-components":"必需的外部组件",rendering:"渲染","webgl-mode":"WebGL模式",alpha:"使用 Alpha 通道","preserve-drawing-buffer":"保留绘图缓冲区",dpr:{label:"设备像素比模式",fixed:"固定",auto:"自动"},publish:"发 布",update:"更 新","publish-success":{title:"发布成功",description:"恭喜!您已经成功发布了您的第一个项目。现在您可以与他人分享了。","got-it":"知道了"},"publish-to-web":"公共URL","public-url-generated":"公共URL已生成","download-project-json":"下载Project.json","update-public-url":"更新公共URL","generate-public-url":"生成公共URL","platform-setting":"平台设置","copy-url":"复制URL",scenes:"场景",download:"下 载",orientation:"方向",portrait:"竖屏",landscape:"横屏","network-timeout":"网络超时",request:"请求","connect-socket":"连接Socket","upload-file":"上传文件","download-file":"下载文件","web-project":"Web 项目",vanilla:"Vanilla JS",react:"React",vue:"Vue",framework:"框架","runtime-options":"运行时设置","package-to-zip":"打包成zip","export-as-react-project":"导出为React项目","export-as-vue-project":"导出为Vue项目","public-url":"公共URL","shader-and-publish":"着色器和发布","public-url-publish":"发布到互联网","wechat-mini-game":"微信小游戏","publish-to-wechat":"发布到微信","tiktok-mini-game":"抖音小游戏","publish-to-tiktok":"发布到抖音","project-url":"获取项目 URL","subpackage-setting":"子包列表","subpackage-list":"子包列表","subpackage-add":"添加子包","subpackage-index":"子包","subpackage-empty":"列表为空","subpackage-folder":"子包目录","subpackage-holder":"选择一个目录作为子包","subpackage-info":"选中目录将作为一个子包。该目录中除了脚本以外的资产均会导出到子包","subpackage-conflict":"和现有子包冲突,冲突子包为:子包 "},plugin:plugin$1,hierarchy:hierarchy$1,inspector:inspector$1,menu:menu$1,viewport:viewport$2,effects:effects$1,trail:trail$1,texture:texture$1,ui:ui$3,xr:xr$1,homepage:homepage$1,user:user$1,layout:layout$1,sandbox:sandbox$1,entity:entity$1,component:component$1,"skinned-mesh-renderer":{title:"蒙皮网格渲染器","local-bounds":{title:"局部边界框",info:"蒙皮网格渲染器的局部空间边界框",min:{label:"最小值",info:"局部边界框的最小点"},max:{label:"最大值",info:"局部边界框的最大点"}},skin:{title:"蒙皮","root-bone":{label:"根骨骼",info:"蒙皮网格渲染器的根骨骼"},bones:{label:"骨骼",info:"骨骼数量"}}},"mesh-renderer":{material:{title:"材质",info:"网格渲染器使用的材质",thumbnail:"材质缩略图"},mesh:{title:"网格",info:"要渲染的网格"},"receive-shadows":{title:"接收阴影",info:"网格是否接收阴影"},"cast-shadows":{title:"投射阴影",info:"网格是否投射阴影"},priority:{title:"优先级",info:"渲染优先级"}},script:script$1,scene:scene$1,"post-process":{global:{title:"全局",info:"后处理是否全局,局部模式必须与碰撞器组件一起使用。"},"blend-distance":{title:"混合距离",info:"开始混合的外距离。"},priority:{title:"优先级",info:"当后处理有相等的影响力时,确定使用哪个后处理。"},layer:{title:"图层",info:"后处理所属的图层,可以与摄像机的后处理遮罩一起使用"},effects:{options:{half:"半",quarter:"四分之一",neutral:"中性",aces:"ACES(电影色彩编码系统)"},bloom:{title:"泛光","high-quality-filtering":{label:"高质量过滤",info:"启用高质量过滤"},scatter:{label:"散射",info:"设置泛光效果的半径"},"down-scale":{label:"下采样",info:"控制此效果开始处理的起始分辨率"},threshold:{label:"阈值",info:"过滤掉此亮度级别以下的像素。值在伽马空间中"},intensity:{label:"强度",info:"泛光效果的强度"},tint:{label:"色调",info:"泛光效果的色调"},"dirt-texture":{label:"污渍纹理",info:"添加污渍或灰尘到泛光效果的纹理"},"dirt-intensity":{label:"污渍强度",info:"污渍纹理的强度"}},"tone-mapping":{title:"色调映射",mode:{label:"模式",info:"色调映射模式,`Neutral`模式尤其适合只想最小化颜色色调和饱和度影响的情况下进行范围重新映射;`ACES`模式使用电影剪辑的ACES参考颜色空间,它产生电影般对比效果,但性能消耗更多"}},title:"后处理效果",add:"添加效果"}},camera:camera$1,physics:physics$1,shader:shader$1,sprite:sprite$1,"text-renderer":{text:{label:"文本",info:"要显示的文本内容"},color:{label:"颜色",info:"文本的颜色"},"font-size":{label:"字体大小",info:"文本字体的大小"},font:{label:"字体",info:"用于渲染文本的字体资产"},width:{label:"宽度",info:"文本渲染器的宽度"},height:{label:"高度",info:"文本渲染器的高度"},"line-spacing":{label:"行间距",info:"文本行间的间距"},"font-style":{label:"字体样式",info:"字体的样式(粗体、斜体)"},"horizontal-alignment":{label:"水平对齐",info:"文本的水平对齐"},"vertical-alignment":{label:"垂直对齐",info:"文本的垂直对齐"},"enable-wrapping":{label:"启用换行",info:"是否启用文本换行"},"overflow-mode":{label:"溢出模式",info:"如何处理超出容器的文本",overflow:"溢出",truncate:"截断"},"mask-interaction":{label:"遮罩交互",info:"此文本渲染器与精灵遮罩如何交互",none:"无","visible-inside":"遮罩内可见","visible-outside":"遮罩外可见"},"mask-layer":{label:"遮罩图层",info:"此文本渲染器所属的遮罩图层",everything:"所有",nothing:"无",layer0:"图层0",layer1:"图层1",layer2:"图层2",layer3:"图层3",layer4:"图层4",layer5:"图层5",layer6:"图层6",layer7:"图层7",layer8:"图层8"},priority:{label:"优先级",info:"文本渲染器的渲染优先级"}},lottie:lottie$1,spine:spine$1,animation:animation$1,asset:asset$2,transform:transform$3,light:light$1,prefab:prefab$1,"ai-panel":{"remaining-times":"剩余次数","image-to-3d":"图片生成3D","upload-description":"上传图片生成3D模型","ai-generated":"所有模型均由AI生成",retry:"重试",view:"预览",generate:"生成",upload:{error:"仅支持 PNG、JPG、JPEG 格式的文件","drag-drop":"拖拽或点击上传图片","supported-formats":"支持的格式:PNG、JPG、JPEG"},pagination:{previous:"上一页",next:"下一页","page-info":"第 {{current}} 页,共 {{total}} 页"},history:"历史记录","generate-error":"生成模型失败, 请稍后重试",use:"使用","add-success":"已成功添加到资产面板中","add-error":"添加失败,请稍后重试","fetch-error":"加载模型列表失败,请稍后重试",waiting:"排队中,剩余 {{queuePosition}} 人"},community:community$1,resourcePackage:resourcePackage$1},service={error:{10001:"アカウント認証に失敗しました",10002:"無効なパラメータ",10003:"メールがすでに使用されています",10006:"メールを送信できる回数が制限を超えました。しばらくしてからもう一度お試しください。",10007:"ログイン確認コードエラー",10008:"ログイン確認コードが期限切れです",10010:"招待の有効期限が切れています",10011:"現在のユーザーはこのプロジェクトに参加できません",10012:"ユーザーはこのプロジェクトに参加しました",10013:"招待はすでに存在します",11001:"使用済みのストレージスペースが制限を超えています",11002:"作成されたプロジェクトの数が制限を超えています",11003:"権限が不十分です",mesh:{label:"メッシュ",info:"レンダーモードがメッシュのときのみ有効"}}},shortcuts={title:"キーボードショートカット",category:{global:"グローバル",viewport:"ビューポート",hierarchy:"階層",assets:"アセット",inspector:"インスペクター","animation-clip":"アニメーションクリップ","animator-controller":"アニメーターコントローラー","animation-clip-property":"アニメーションクリッププロパティ","animator-controller-state-machine":"アニメーターコントローラーステートマシン"},all:{"play-project":"プロジェクトを再生",undo:"元に戻す",redo:"やり直す","entity-focus":"エンティティフォーカス"},viewport:{zoom:"ズーム",orbit:"軌道",pan:"パン",around:"周り","fly-up":"上昇","fly-down":"下降","fly-forward":"前進","fly-backward":"後退","fly-left":"左へ飛ぶ","fly-right":"右へ飛ぶ","navigation-tool":"ナビゲーションツール","gizmo-translate":"ギズモ翻訳","gizmo-rotate":"ギズモ回転","gizmo-scale":"ギズモスケール","gizmo-rect":"ギズモ矩形","entity-focus":"エンティティフォーカス","align-with-view":"ビューと整列"},hierarchy:{"add-entity":"エンティティを追加","copy-entity":"エンティティをコピー","paste-entity":"エンティティを貼り付け","search-entity":"エンティティを検索","remove-entity":"エンティティを削除","duplicated-entity":"エンティティを複製"},"animation-clip":{"delete-event":"イベントを削除","delete-keyframe":"キーフレームを削除"},"animation-clip-property":{"delete-property":"プロパティを削除"},"animator-controller-state-machine":{"delete-cell":"セルを削除"},assets:{"delete-asset":"アセットを削除","copy-asset":"アセットをコピー","duplicate-asset":"アセットを複製","search-asset":"アセットを検索","paste-asset":"アセットを貼り付け"}},project={name:"名前",banner:"バナー",thumbnail:"サムネイル",description:"説明","new-project":"新しいプロジェクト","3d-project":"3Dプロジェクト","2d-project":"2Dプロジェクト",cloning:"クローン作成中",cloned:"クローン作成完了","clone-failed":"クローン作成に失敗しました。","delete-project-title":"プロジェクトを削除","delete-project-desc":"このプロジェクトを削除してもよろしいですか",deleting:"削除中",deleted:"削除完了","delete-failed":"削除に失敗しました。",open:"開く",clone:"クローン",delete:"削除","project-settings":"プロジェクト設定",syncing:{status:"同期状態"},created:"作成日時:","engine-version":"エンジンバージョン","create-time":"作成時間",operation:"操作",projects:"プロジェクト",search:"検索","all-projects":"すべてのプロジェクト","load-more":"さらに読み込む",create:{contextmenu:{label:"新しいものを作成"}},saving:"プロジェクト保存中"},member={Developer:"開発者",Visiter:"訪問者",Administator:"管理者",Creator:"作成者",assignedMembers:"割り当てられたメンバー","share-project-title":"プロジェクトを共有",pendingInvitations:"保留中の招待","update-success":"更新成功","delete-success":"削除成功",yourself:"自分自身","share-link":"共有リンク",admin:{title:"管理者",desc:"編集、共有、プレビューが可能"},"generate-share-link":"共有リンクを生成","copy-share-link":"共有リンクをコピー","link-access":"リンクアクセス",developer:{title:"開発者",desc:"編集可能ですが、他の人と共有することはできません"},visiter:{title:"訪問者",desc:"プレビューのみ可能"},remove:"削除",creator:{title:"作成者"},search:{"via-username":"ユーザー名で検索","via-email":"メールで検索",invite:"招待","placeholder-mail":"メールでユーザーを検索...","placeholder-user":"名前でユーザーを検索...","invalid-email":"メールアドレスが無効です"},"already-added":"メンバーは既に追加されています"},setting={title:"設定",upgrade:{engine:{loading:"エンジンをアップグレード中...",success:"エンジンのアップグレードが完了しました",error:"エンジンのアップグレードに失敗しました"}},rendering:"レンダリング","update-engine-tip":"エンジンを更新するとページがリフレッシュされます。","physics-backend":"物理バックエンド",auto:"自動","xr-backend":"XRバックエンド","select-target-verions":"ターゲットバージョンを選択","model-import-options":"モデルインポートオプション","anim-framerate":"アニメーションフレームレート","compute-normals":"法線を計算","blendshape-normals":"ブレンドシェイプ法線","blendshape-tangents":"ブレンドシェイプ切線",basic:{title:"基本"},snapshots:{title:"スナップショット"},"plugin-manager":{title:"プラグインマネージャー"},"edit-member":"メンバーを編集",none:"なし",save:{title:"保存",success:"設定が正常に保存されました",error:"設定の保存に失敗しました"}},snapshot={delete:{title:"削除",desc:"スナップショットを削除してもよろしいですか?",loading:"スナップショットを削除中...","delete.success":"削除成功!","delete.error":"スナップショットを削除に失敗しました。"},"sure-to-revert":"このバージョンに戻してもよろしいですか?",operation:"操作",add:{title:"スナップショットを追加",loading:"スナップショットを追加中...",success:"保存成功!",error:"スナップショットを追加に失敗しました。"},manage:"スナップショットを管理",revert:{title:"戻す",loading:"スナップショットを戻している...",success:"戻し完了!",error:"スナップショットを戻しに失敗しました。"}},plugin={select:{title:"プラグインフォルダを選択",desc:"ドラッグまたはクリックしてフォルダを選択"},detect:{title:"検出",desc:"プラグイン情報を自動的に検出します"},install:{title:"インストール",desc:"検出プロセスが成功したら、ボタンをクリックしてプラグインを読み込んでください",success:"プラグインが正常にインストールされました",button:"プラグインをインストール"},"non-detected":"未検出",directory:"プラグインディレクトリを選択",name:"プラグイン名","minum-version":"最低Galaceanバージョン",background:"背景","custom-ui":"カスタムUI","custom-component":"カスタムコンポーネント",clear:"クリア",recheck:"再チェック","latest-version":"最新バージョン","running-plugin":"実行中のプラグイン","add-plugin":"プラグインを追加","manage-plugins":"プラグインを管理","install-developing-plugin":"開発中のプラグインをインストール",title:"プラグイン",topics:"トピック",topic:{animation:"アニメーション",camera:"カメラ","asset-management":"アセット管理",material:"材料"},required:{warning:"プロジェクトにはこのプラグインが必要です。"},"developing-plugins":"開発中のプラグイン"},hierarchy={"copy-success":"パスがクリップボードに正常にコピーされました。","apply-to-prefab":"プレハブに適用",revert:"戻す","added-entity":"エンティティを追加","removed-entity":"エンティティを削除","create-prefab":"プレハブを作成","unpack-prefab":"プレハブを解包","copy-relative-path":"相対パスをコピー","copy-entity":"コピー","paste-entity":"貼り付け","duplicated-entity":"複製されたエンティティ","delete-entity":"削除","align-with-view":"ビューと整列",error:{"move-gltf":"glTFのエンティティを移動できません","move-sub-entity-of-prefab":"プレハブのサブエンティティを移動できません"},"search-node":"ノードを検索"},inspector={name:"名前","select-parameter":"パラメータを選択","add-statemachine-script":"ステートマシンスクリプトを追加",conditions:"条件","add-condition":"条件を追加","statemachine-script":"ステートマシンスクリプト",script:"スクリプト","material-remap-tip":"材料はglTF資産内に埋め込まれており、材料を編集するにはコピーと再マッピングが必要です。","duplicate-and-remap":"複製と再マッピング","batch-editing-alert":"バッチ編集はサポートされていません","batch-editing":"バッチ編集","apply-to-prefab":"プレハブに適用",revert:"戻す","modified-component":"変更されたコンポーネント","added-component":"追加されたコンポーネント","removed-component":"削除されたコンポーネント","remove-component":"削除",asset:"アセット","locate-asset":"アセットを特定","alert-disable-component":"コンポーネントを無効にできません","alert-remove-component":"コンポーネントを削除できません","add-component":"コンポーネントを追加","basic-information":"基本情報","modified-entity":"変更されたエンティティ"},menu={audio:"オーディオ",scripts:"スクリプト",undo:"元に戻す",redo:"やり直し","remove-entity":"エンティティを削除",entity:"エンティティ",camera:"カメラ",light:"ライト","3d-object":"3Dオブジェクト",cuboid:"直方体",sphere:"球体",plane:"平面",cylinder:"円柱",capsule:"カプセル",cone:"円錐","2d-object":"2Dオブジェクト","sprite-renderer":"スプライトレンダラー","sprite-mask":"スプライトマスク","text-renderer":"テキストレンダラー","lottie-animation":"Lottieアニメーション","spine-animation-renderer":"Spineアニメーションレンダラー",ui:{title:"UI",canvas:"キャンバス",image:"画像",text:"テキスト",button:"ボタン"},effects:"エフェクト",particle:"粒子",trail:"トレイル",xr:"XR","ar-origin":"AR原点","vr-origin":"VR原点","post-process":"ポストプロセス","global-post-process":"グローバルポストプロセス","box-post-process":"ボックスポストプロセス","sphere-post-process":"スフィアポストプロセス","new-project":"新しいプロジェクト","new-3d-project":"新しい3Dプロジェクト","new-2d-project":"新しい2Dプロジェクト",clone:"クローン","project-settings":"プロジェクト設定",learn:"学ぶ","report-bug":"バグを報告","latest-version":"最新","back-to-files":"ホームページに戻る",assets:"アセット",component:"コンポーネント",theme:{title:"テーマ",dark:"ダーク",light:"ライト"},text:{basic:"基本"},"direct-light":"指向性ライト","point-light":"ポイントライト","spot-light":"スポットライト"},viewport$1={setting:"カメラ設定",fov:"視野角",navigation:"ナビゲーション設定",smooth:"スムーズ",ease:"イーズ",acceleration:"加速",speed:"速度","dynamic-clipping":"動的クリッピング","near-clip-plane":"近クリップ面","far-clip-plane":"遠クリップ面",capture:"キャプチャ",focus:"フォーカス","gizmo-move":"移動","view-tool":"ビュー道具","gizmo-rotate":"回転","gizmo-scale":"スケール","gizmo-rect":"矩形","pivot-anchor":"ピボットアンカー","center-anchor":"中心アンカー","local-coordinate":"ローカル座標","global-coordinate":"グローバル座標","3d-icons":"3Dアイコン","switch-to-2d-mode":"2Dモードに切り替える","switch-to-3d-mode":"3Dモードに切り替える",play:"再生","switch-to-perspective":"透視に切り替える","switch-to-orthographic":"正射に切り替える",grid:"グリッド","auxiliary-element-settings":"補助要素設定","scene-camera-settings":"シーンカメラ設定","navigation-gizmo":"ナビゲーションギズモ",outline:"アウトライン",camera:"カメラ",light:"ライト","static-collider":"静的コライダー","dynamic-collider":"動的コライダー","character-controller":"キャラクターコントローラー","emission-shape":"発射形状","ui-canvas":"UIキャンバス","scan-qr-code":"QRコードをスキャン","scan-qr-code-in-mobile":"モバイルで開くためにQRコードをスキャン","refresh-qr-code":"QRコードを生成","qr-code-ttl":"QRコードは1時間利用可能","watch-mode":"ウォッチモード","force-reload":"強制リロード","open-in-new-tab":"新しいタブで開く","apply-aigc-model":"アセットとして適用",exit:"終了",update:{idle:"",success:"最後の更新成功",error:"最後の更新失敗",syncing:"保存中..."},"locate-camera":"このカメラをビューポートで特定","full-screen":"フルスクリーン"},effects={shape:{type:{label:"タイプ",info:"粒子放出の形状タイプ"},options:{box:"ボックス",circle:"サークル",cone:"コーン",hemisphere:"半球",sphere:"球"},"cone-base":"コーンベース",volume:"ボリューム",angle:"角度",radius:"半径",length:"長さ",size:"サイズ",arc:"アーク",loop:"ループ",random:"ランダム","random-direction-amount":"ランダム方向数","random-direction-amount-tip":"粒子の開始方向をランダム化します。","arc-mode":{label:"アークモード",info:"粒子放出のアークモード"},"arc-speed":{label:"アーク速度",info:"粒子放出のアーク速度"},"emit-type":{label:"放出タイプ",info:"粒子の放出タイプ"}},particle:{title:"粒子",restart:"粒子を再起動",pause:"粒子を一時停止",play:"粒子を再生",stop:"粒子を停止",speed:"速度",scope:{label:"範囲",selected:"選択済み",everything:"すべて"},bounding:"バウンディング"},burst:{add:"バーストを追加",item:"バースト",time:{label:"時間"},count:{label:"カウント"}},renderer:{mesh:{label:"メッシュ",info:"レンダーモードがメッシュのときのみ有効"},"velocity-scale":{label:"速度スケール",info:"粒子が速度に応じてどれだけ伸びるかを指定します"},"length-scale":{label:"長さスケール",info:"粒子が移動方向にどれだけ引き伸ばされるかを定義します。粒子の長さと幅との比率です"},duration:{label:"持続時間",info:"粒子ジェネレーターの持続時間(秒単位)"},start:{size:{label:"開始サイズ",info:"有効にすると、各軸のサイズを個別に制御できます"},rotation:{label:"開始回転",info:"有効にすると、各軸の回転を個別に制御できます"},delay:{label:"開始遅延",info:"開始遅延(秒単位)"},speed:{label:"開始速度",info:"粒子が放出されるときの初速度"},color:{label:"開始色",info:"粒子が放出されるときの初色"},lifetime:{label:"開始寿命",info:"粒子が放出されるときの初寿命"}},"gravity-modifier":{label:"重力修正",info:"Physics.gravityで定義された重力にこの粒子ジェネレーターが適用するスケール"},"scaling-mode":{label:"スケーリングモード",info:"粒子ジェネレーターが放出する粒子に変換コンポーネントをどのように適用するかを制御します",options:{hierarchy:"階層",local:"ローカル",world:"ワールド"}},"curve-mode":{options:{constant:"定数",curve:"曲線","two-constants":"二定数","two-curves":"二曲線"}},pivot:{label:"ピボット"},"render-mode":{label:"レンダーモード",options:{billboard:"ビルボード","stretch-billboard":"ストレッチビルボード","horizontal-billboard":"水平ビルボード","vertical-billboard":"垂直ビルボード",mesh:"メッシュ",none:"なし"}},"play-on-enabled":{label:"有効時に再生",info:"trueに設定すると、粒子ジェネレーターは有効時に自動的に再生を開始します"},"max-particles":{label:"最大粒子数",info:"最大粒子数"},"over-lifetime":{size:{label:"寿命中のサイズ"},rotation:{label:"寿命中の回転"},velocity:{label:"寿命中の速度"},color:{label:"寿命中の色"},frame:{label:"時間中のフレーム"}},"rate-over-time":{label:"時間中のレート",info:"粒子の放出レートを表します。デフォルト値は10です"},"space-mode":{label:"空間モード",info:"寿命中の速度の空間モード",options:{local:"ローカル",world:"ワールド"}},velocity:{x:{label:"速度X",info:"寿命中のX軸の速度"},y:{label:"速度Y",info:"寿命中のY軸の速度"},z:{label:"速度Z",info:"寿命中のZ軸の速度"}},"limit-velocity":{limit:{label:"速度制限"},dampen:{label:"ダンピング",info:"速度制限を超えた速度をどの程度減衰させるかを制御します。0は減衰なし、1は完全な減衰"},drag:{label:"ドラッグ",info:"粒子速度に適用されるドラッグの量を制御します"},"multiply-drag-by-size":{label:"サイズでドラッグを乗算",info:"粒子サイズに基づいてドラッグ量を調整します"},"multiply-drag-by-velocity":{label:"速度でドラッグを乗算",info:"粒子速度に基づいてドラッグ量を調整します"},space:{info:"寿命中の速度制限の空間モード"}},"texture-sheet":{label:"テクスチャシートアニメーション",type:{label:"テクスチャシートタイプ",info:"テクスチャシートアニメーションのタイプ",options:{"whole-sheet":"全シート","single-row":"単一行"}},"cycle-count":{label:"サイクルカウント",info:"テクスチャシートアニメーションのサイクル数"},tiling:{label:"タイル",info:"テクスチャシートのタイル"}},"flip-rotation":{label:"回転を反転",info:"一部の粒子を逆方向に回転させる"},simulation:{space:{label:"シミュレーションスペース",info:"粒子をシミュレートする空間を選択します。それはワールドスペースまたはローカルスペースにすることができます",options:{local:"ローカル",world:"ワールド",custom:"カスタム"}},speed:{label:"シミュレーション速度",info:"粒子ジェネレーターのデフォルトの再生速度を上書きする"}},"color-over-lifetime":{label:"寿命中の色",info:"粒子の色が寿命中にどのように変化するかを制御します"},sections:{rendering:"レンダリング",main:"メイン",emission:"放射",shape:"形状","size-over-lifetime":"寿命中のサイズ","rotation-over-lifetime":"寿命中の回転","velocity-over-lifetime":"寿命中の速度","limit-velocity-over-lifetime":"寿命中の速度制限","color-over-lifetime":"寿命中の色","texture-sheet-animation":"テクスチャシートアニメーション",noise:"ノイズ"},noise:{preview:{label:"プレビュー"},strength:{label:"強度"},frequency:{label:"周波数"},"scroll-speed":{label:"スクロール速度"},"octave-count":{label:"オクターブ数"},"octave-intensity-multiplier":{label:"オクターブ強度乗数"},"octave-frequency-multiplier":{label:"オクターブ周波数乗数"}},loop:{label:"ループ",info:"粒子ジェネレーターがループするかどうか"},material:{label:"材料",info:"粒子レンダラーが使用する材料"},priority:{label:"レンダープライオリティ",info:"粒子レンダラーのレンダープライオリティ"},bursts:{label:"バースト",info:"粒子システムのバースト設定"}},curve:{constant:"定数","two-constant":"二定数",curve:"曲線","two-curve":"二曲線","3d-prefix":"3D","separate-axes":"軸分離",gradient:"グラデーション","two-gradient":"二グラデーション"}},trail={emitting:{label:"放出中",info:"トレイルが現在放出されているかどうか"},time:{label:"時間",info:"トレイルのフェードアウト時間(秒)"},"min-vertex-distance":{label:"最小頂点距離",info:"トレイル頂点間の最小距離"},"width-curve":{label:"幅カーブ",info:"トレイルの生存期間における幅倍率カーブ"},"color-gradient":{label:"カラーグラデーション",info:"トレイルの生存期間におけるカラーグラデーション"},"texture-mode":{label:"テクスチャモード",info:"テクスチャがトレイルに適用される方法",stretch:"ストレッチ",tile:"タイル"},"texture-scale":{label:"テクスチャスケール",info:"トレイルテクスチャの UV スケール"},material:{label:"マテリアル",info:"トレイルレンダラーが使用するマテリアル"},priority:{label:"レンダープライオリティ",info:"トレイルレンダラーのレンダープライオリティ"}},texture={"select-texture":"テクスチャを選択...",shape:{title:"シェイプ"},"filter-mode":{title:"テクスチャフィルターモード",point:"フィルターモードポイント",bilinear:"フィルターモードバイリニア",trilinear:"フィルターモードトリリニア"},"wrap-mode":{u:{title:"U軸ラップモード"},v:{title:"V軸ラップモード"},clamp:"ラップモードクランプ",repeat:"ラップモードリピート",mirror:"ラップモードミラー"},"aniso-level":{title:"テクスチャ異方性レベル"},width:{title:"テクスチャ幅"},height:{title:"テクスチャ高さ"},sRGB:{title:"sRGB"},mipmap:{title:"ミップマップ"},bundle:{"format-options":"形式",overwrite:"上書き","texture-compression":"圧縮",type:{ktx2:"KTX2",webp:"WebP",original:"オリジナル"}},dilate:{title:"色膨張",info:"透明または半透明のエッジピクセルを膨張させて黒い境界を避ける"}},ui$2={canvas:{warning:{label:"ヒント",info:"詳細","not-root-canvas":"このキャンバスはルートキャンバスではありません","not-root-canvas-reason-disabled":"(コンポーネントが無効です)","not-root-canvas-reason-not-closest":"(ルートノードに最も近いキャンバスではありません)"},"render-mode":{label:"レンダーモード",info:"UIキャンバスのレンダリングモード","screen-space-overlay":"スクリーンスペース - オーバーレイ","screen-space-camera":"スクリーンスペース - カメラ","world-space":"ワールドスペース"},resolution:{label:"参照解像度",info:"`ScreenSpaceCamera`と`ScreenSpaceOverlay`モードのUIキャンバスの参照解像度"},"resolution-per-unit":{label:"単位ごとの解像度",info:"このキャンバスのUI要素の参照解像度と単位の変換比。"},"render-camera":{label:"レンダーカメラ",info:"`ScreenSpaceCamera`モードでUIキャンバスをレンダリングするために使用されるカメラ。"},adaptation:"適応","adaptation-mode":{label:"適応モード",info:"`ScreenSpaceCamera`と`ScreenSpaceOverlay`モードのUIキャンバスの画面解像度適応モード。",width:"幅",height:"高さ",both:"両方",expand:"拡張",shrink:"縮小"},"sort-order":{label:"並べ替え順序",info:"`ScreenSpaceOverlay`モードでのUIキャンバスのレンダリング順序の優先度"},distance:{label:"平面距離",info:"`ScreenSpaceCamera`モードでUIキャンバスとカメラとの距離。"}},image:{material:{info:"画像のマテリアル",label:"マテリアル"},raycast:{title:"レイキャスト",enabled:{label:"レイキャストを有効にする",info:"この画像がレイキャストで選択されるかどうか"},padding:{label:"レイキャストパディング",info:"レイキャスト検出のためのカスタム境界",left:"左",down:"下",right:"右",up:"上"}}},button:{interactive:{label:"インタラクティブ",info:"ボタンがインタラクティブであるかどうか"},transitions:{label:"トランジション",info:"ボタンの状態が変わるとトリガーされるトランジションのリスト"}},transition:{target:{label:"ターゲット",info:"トランジションを適用するターゲットコンポーネント"},type:{label:"タイプ",info:"トランジションのタイプを選択",sprite:"スプライト",scale:"スケール",color:"色"},duration:{label:"持続時間",info:"トランジションの持続時間(秒単位)"},color:{normal:{label:"通常の色"},hover:{label:"ホバー色"},pressed:{label:"押された色"},disabled:{label:"無効色"}},scale:{normal:{label:"通常のスケール"},hover:{label:"ホバースケール"},pressed:{label:"押されたスケール"},disabled:{label:"無効スケール"}}},group:{alpha:{label:"アルファ",info:"グループのアルファ値"},interactive:{label:"インタラクティブ",info:"グループがインタラクティブであるかどうか"},"ignore-parent":{label:"親グループを無視",info:"グループが親グループの設定を無視するかどうか"}},transform:{size:{label:"サイズ",info:"UI要素のサイズ(ピクセル単位)"},pivot:{label:"ピボット",info:"UI要素の中心点(0,0は左下、1,1は右上)"},error:{"cant-disable":"Transformコンポーネントを無効にできません","cant-delete":"Transformコンポーネントを削除できません"},relativeLayout:"相対レイアウト",horizontalAlignment:{label:"水平配置"},alignLeft:{label:"左間隔"},alignRight:{label:"右間隔"},alignCenter:{label:"中央間隔"},verticalAlignment:{label:"垂直配置"},alignTop:{label:"上部間隔"},alignBottom:{label:"下部間隔"},alignMiddle:{label:"中間間隔"}}},xr={origin:{title:"XR原点",mode:{label:"セッションモード",info:"XRセッションのモード",none:"なし",ar:"AR",vr:"VR"},origin:{label:"原点",info:"仮想世界と現実世界の接続点(XRスペース)"},camera:{label:"カメラ",info:"XRスペース内のカメラ"},"left-camera":{label:"左カメラ",info:"XRスペース内の左目"},"right-camera":{label:"右カメラ",info:"XRスペース内の右目"}},anchor:{title:"XRアンカーマネージャー",list:{label:"アンカーリスト",info:"追跡するアンカー"},position:"アンカーの位置",rotation:"アンカーのクォータニオン",item:"アンカー {{index}}"},image:{title:"XRイメージマネージャー",list:{label:"イメージリスト",info:"追跡するイメージ"},select:"イメージを選択...",add:"イメージを追加",width:{label:"物理的な幅",info:"追跡されている実世界の画像の予想される物理的な幅(メートル単位)"}},plane:{title:"XR平面マネージャー","detection-mode":{label:"検出モード",info:"平面の検出モード"}},prefab:"オブジェクトが追跡されたとき、自動的にプレハブが取り付けられます。",toast:{"only-one-effect":"XR原点は1つのみ効果を発揮します"}},homepage={projects:"プロジェクト",templates:"エグザンプル",documentation:"ドキュメント",discussion:"ディスカッション","templates-all":"すべて",time:{"just-now":"ただ今","hours-ago":"時間前","days-ago":"日前","months-ago":"ヶ月前"},template:{disclaimer:"免責事項",open:"編集器で開く"},plan:{text:{plan:{beta:"ベータプラン"},"created-project":"作成されたプロジェクト","used-space":"使用済みスペース",unlimit:"無制限"}}},user={avatar:{title:"アバター",error:{"file-size":"アバターは正方形の画像で、幅と高さが少なくとも100px以上必要です。最大サイズは2MBです。"},tip:"アバターは正方形の画像で、幅と高さが少なくとも100px以上必要です。最大サイズは2MBです。",change:"変更"},"account-settings":"アカウント設定","update-avatar-success":"アバターの更新に成功","save-name-success":"名前の保存に成功","save-failed":"保存に失敗",logout:"ログアウト","account-detail":"アカウントの詳細","display-name":"表示名",security:"セキュリティ","access-token":"アクセストークン","access-token-tip":"アクセストークンはプロジェクトリソースへのアクセスに使用されます。安全に保管し、他の人と共有しないでください。","access-token-description":"アクセストークンエイリアス",revoke:"取り消し","copy-token-tip":"アクセストークンを適切に保存したことを確認してください。再度表示することはできません!",generate:"生成",email:"メール","connected-account":"接続されたアカウント",wechat:"Wechat",connected:"接続済み",connect:"接続",alipay:"Alipay","auth-code-error":"認証コードエラー","rebind-email":{title:"メールを再バインド",confirm:"確認","tip-0":"メールをリセットするには、まず自分自身を認証する必要があります。","tip-1":"新しいメールアドレスを入力してください。","tip-2":"新しいメールアドレスに確認コードを添えたメールを送信しました。"},"send-auth-code":"認証コードを送信","email-successfully-modified":"メールが正常に変更されました","email-modified-tip":"このダイアログを安全に閉じることができます。","send-code-error":"コード送信エラー",permission:{tip:{first:"申し訳ありませんが、このプロジェクトにアクセスできません",second:"オーナーに連絡してメンバーとして追加してもらってください"},dev:{title:"パーミッションリクエスト",desc:"開いているプロジェクトにはサードパーティのプラグイン開発が含まれています。プロジェクトを開く前にプラグインへのアクセスを許可してください。",button:"パーミッションを許可",tip:"この動作を防ぐために、ブラウザで少なくとも1つのGalaceanページタブを開いたままにしてください。"}},login:{error:"ログインに失敗しました。メールでgalacean_support@alipay.service.comに問い合わせてください",success:"ログイン成功",redirecting:"リダイレクト中..."},lock:{warning:{title:"現在このプロジェクトを編集できません",description:"このプロジェクトは現在{{name}}によって編集されています。同時に複数のユーザーが同じプロジェクトを編集することはサポートされていません。後で再試行してください。",ok:"リスクを理解しました。続行",confirm:"リスクを理解しました、続行"}},signin:{text:{welcome:"Galaceanへようこそ",purewelcome:"ようこそ、 ",verion:"イントラネットバージョン",sendemail:"メールにコードを送信しました",subwelcome:"以下にメールを入力して、一時パスコードを受け取ります。",security:"企業イントラネット環境が検出されました。情報セキュリティに注意してください。",verfify:"メールに送信した6桁のコードを入力してください。",policy:{policy1:"続行することで、",policy2:"サービス利用規約",policy3:"および",policy4:"プライバシーポリシー"},powered:"Galaceanエンジンによって提供"},btn:{signup:"サインアップ",login:"ログイン",logout:"ログアウト",continue:"続行",oauth:{ali:"Alipay社員チャンネル",other:"続行",resend:"コードを再送"}},input:{invitecode:"招待コード",email:"@example.com"},cannot:{signin:{value:"サインインに問題がありますか?",description:"galacean_support@service.alipay.comに連絡してください"}},"email-input":"メールを入力してください","email-valid":"有効なメールを入力してください","resend-code-after":"後でコードを再送します","policy-agree":"続行をクリックすることで、当社の",artist:"アーティスト"}},layout={"layout-name":"レイアウト名...",cancel:"キャンセル",add:"追加",panels:"パネル",sidebar:"サイドバー","move-to-left":"左に移動","move-to-right":"右に移動",panel:{name:{hierarchy:"階層",ai:"AI",assets:"アセット",inspector:"インスペクター",animationclip:"アニメーションクリップ",animatorcontroller:"アニメーターコントローラー"}},preset:{name:{default:"デフォルト","left-to-right":"左から右"}},reset:{title:"レイアウトをリセット",description:`レイアウトをリセットしてもよろしいですか?
708
708
  この操作は現在のすべてのレイアウト設定をクリアします。`,confirm:"リセット"},action:{"add.name":"レイアウトを追加","delete.name":"レイアウトを削除","save.name":"レイアウトを保存"},"collapse-all":"すべて折りたたむ","close-all-tab":"すべてのタブを閉じる",title:"レイアウト"},sandbox={mask:{loading:"読み込み中...",deps:{resolving:"解決中...",resolved:"解決済み。"}}},entity={"select-entity":"エンティティを選択...",name:"名前","is-active":"アクティブ",clear:"クリア","search-node":"ノードを検索...",layer:{title:"レイヤー",info:"カメラのカリングマスクまたはライトのカリングマスクを使用すると、特定のレイヤー内のエンティティのみをレンダリングまたは照明できます",everything:"すべて",nothing:"なし",layer0:"レイヤー0",layer1:"レイヤー1",layer2:"レイヤー2",layer3:"レイヤー3",layer4:"レイヤー4",layer5:"レイヤー5",layer6:"レイヤー6",layer7:"レイヤー7",layer8:"レイヤー8",layer9:"レイヤー9",layer10:"レイヤー10",layer11:"レイヤー11",layer12:"レイヤー12",layer13:"レイヤー13",layer14:"レイヤー14",layer15:"レイヤー15",layer16:"レイヤー16",layer17:"レイヤー17",layer18:"レイヤー18",layer19:"レイヤー19",layer20:"レイヤー20",layer21:"レイヤー21",layer22:"レイヤー22",layer23:"レイヤー23",layer24:"レイヤー24",layer25:"レイヤー25",layer26:"レイヤー26",layer27:"レイヤー27",layer28:"レイヤー28",layer29:"レイヤー29",layer30:"レイヤー30",layer31:"レイヤー31","select-all":"すべて選択","update-children":{title:"子エンティティのレイヤーを更新",description:"すべての子エンティティのレイヤーを更新しますか?",confirm:"更新",cancel:"キャンセル"},selected:"レイヤーが選択されています",none:"なし"}},component={transform:{title:"トランスフォーム"},prefab:{"cannot-modify":"プレハブを変更できません","mutually-exclusive":"相互排他的なコンポーネントは変更できません!"},delete:{title:"コンポーネントを削除","remove-dependent":"{{0}}を削除する前に{{1}}を削除する必要があります","remove-together":"{{0}}を一緒に削除"},add:{dependent:"{{0}}を追加する前に{{1}}を追加する必要があります",unique:"{{0}}は1つしか追加できません"},"ui-transform":{title:"UIトランスフォーム"},"ui-canvas":{title:"UIキャンバス"},"static-collider":{title:"静的コライダー"},"dynamic-collider":{title:"動的コライダー"},renderer:{mesh:{title:"メッシュレンダラー"},"skinned-mesh":{title:"スキンメッシュレンダラー"},sprite:{title:"スプライトレンダラー"}},"post-process":{title:"ポストプロセス"},animator:{title:"アニメーター"},"sprite-mask":{title:"スプライトマスク"},camera:{title:"カメラ"},light:{direct:{title:"指向性ライト"},point:{title:"ポイントライト"},spot:{title:"スポットライト"}},"lottie-animation":{title:"Lottieアニメーション"},"spine-animation":{title:"Spineアニメーション"},"ui-group":{title:"UIグループ"},"ui-button":{title:"ボタン"},"ui-text":{title:"テキスト"},"ui-image":{title:"画像"},audio:{title:"オーディオ"},script:{title:"スクリプト","parse-properties":"プロパティを解析","script-label":"スクリプト","properties-label":"プロパティ"},"text-renderer":{title:"テキストレンダラー"},physics:{character:{title:"キャラクターコントローラー"},"spring-joint":{title:"スプリングジョイント"},"fixed-joint":{title:"固定ジョイント"},"hinge-joint":{title:"ヒンジジョイント"}},group:{ui:"UI","2d":"2D","3d":"3D",basic:"基本",light:"ライト",effects:"エフェクト",xr:"XR",physics:"物理"},"particle-renderer":{title:"粒子レンダラー"},"trail-renderer":{title:"トレイルレンダラー"}},script={source:{code:"ソースコード"}},scene={"ambient-light":{title:"環境光",diffuse:{title:"拡散",mode:"モード",source:"ソース","source-info":"拡散反射がソリッドカラーかベイクされた球面調和数から来るかを指定します","source-background":"背景","source-solid-color":"ソリッドカラー","solid-color":"ソリッドカラー","solid-color-info":"拡散ソリッドカラー",intensity:"強度","intensity-info":"拡散強度"},specular:{title:"スペキュラー",mode:"モード",source:"ソース","source-background":"背景","source-custom":"カスタム","custom-texture":"カスタムテクスチャ","custom-texture-info":"スペキュラー反射用のカスタムHDRテクスチャ",intensity:"強度","intensity-info":"スペキュラー強度"},bake:{title:"ベイク",auto:{title:"自動ベイク",info:"背景が変更されたとき、またはベイク解像度が変更されたときに自動ベイクします"},resolution:{title:"解像度",info:"ベイクされたキューブテクスチャの解像度を制御します。この解像度はベイク製品のサイズに影響を与えます。シーンに明確な反射が必要ない場合は、より小さい解像度を選んでください",r16:"16",r32:"32",r64:"64",r128:"128",r256:"256",r512:"512",r1024:"1024"},button:{title:"ベイクボタン",info:"現在のシーン構成に基づいてベイクを開始します。ベイクされた製品には球面調和数と事前フィルタリングされた環境マップが含まれています"}}},ambientOcclusion:{title:"アンビエントオクルージョン",enable:"有効化","enable-info":"アンビエントオクルージョンを有効にするかどうかを制御します",quality:{title:"品質",info:"アンビエントオクルージョン効果の品質を制御します",low:"低",medium:"中",high:"高"},intensity:"強度","intensity-info":"アンビエントオクルージョン効果の強さを制御します",power:"コントラスト","power-info":"アンビエントオクルージョンのコントラストを制御します。値が大きいほど効果が灰色っぽくなります",radius:"半径","radius-info":"アンビエントオクルージョンの半径を制御します。値が大きいほど遮蔽範囲が広くなります",bias:"バイアス","bias-info":"自己遮蔽のアーティファクトを防ぐためのバイアスを制御します",bilateralThreshold:"バイラテラルしきい値","bilateralThreshold-info":"ぼかしエッジのしきい値を制御します。値が小さいとエッジがはっきりし、値が大きいとエッジが柔らかくなります",minHorizonAngle:"最小地平角","minHorizonAngle-info":"ポリゴン数の少ないジオメトリから発生するアーティファクトを減らすために最小地平角を制御します"},background:{title:"背景",mode:{title:"モード",info:"背景モードがソリッドカラー、テクスチャ、または空であるかを指定します",solidcolor:"ソリッドカラー",texture:"テクスチャ",sky:"空"},color:{title:"色",info:"背景のソリッドカラー"},texture:{title:"テクスチャ",info:"背景のテクスチャ"},"texture-fill-mode":{title:"フィルモード",info:"背景テクスチャのフィルモード",aspectfitheight:"アスペクトフィット高さ",aspectfitwidth:"アスペクトフィット幅",fill:"フィル"}},sky:{title:"空",material:{title:"素材",info:"背景用の空の素材"},mesh:{title:"メッシュ",info:"背景用の空のメッシュ"}},shadow:{title:"影","cast-shadows":{title:"影を投げる",info:"影を投げるかどうか"},"enable-transparent":{title:"透明な影を有効にする",info:"透明な影を投げるかどうか"},resolution:{title:"解像度",info:"シャドウマップの解像度",low:"低",medium:"中",high:"高",veryhigh:"非常に高い"},cascades:{title:"カスケード",info:"指向性ライトのシャドウ用に使用するカスケードの数",nocascades:"カスケードなし",twocascades:"二つのカスケード",fourcascades:"四つのカスケード"},"two-cascade-splits":{title:"二つのカスケードスプリット",info:"二つのカスケード分布のスプリット"},"four-cascade-splits":{title:"四つのカスケードスプリット",info:"四つのカスケード分布のスプリット"},distance:{title:"距離",info:"最大シャドウ距離"},"fade-border":{title:"フェードボーダー",info:"境界からの最後のシャドウフェード距離をパーセンテージで指定します。範囲は[0,1]です"}},fog:{title:"霧",enable:{title:"有効",info:"霧を有効にする"},mode:{title:"モード",info:"霧のモード",none:"なし",linear:"線形",exponential:"指数関数",exponentialsquared:"指数二乗"},color:{title:"色",info:"霧の色"},start:{title:"開始",info:"霧の開始"},end:{title:"終了",info:"霧の終了"},density:{title:"密度",info:"霧の密度"}}},camera={"is-orthographic":"オルソグラフィック","near-clip-plane":"近クリップ面","far-clip-plane":"遠クリップ面","field-of-view":"視野角","orthographic-size":"オルソグラフィックサイズ","enable-frustum-culling":"フラスタムカリングを有効にする","clear-flags":{title:"クリアフラグ",none:"クリアしない",color:"カラーをクリア",depth:"深度をクリア",stencil:"ステンシルをクリア",all:"すべてクリア",colordepth:"カラー&深度をクリア",colorstencil:"カラー&ステンシルをクリア",depthstencil:"深度&ステンシルをクリア"},"culling-mask":"カリングマスク","post-process-mask":"ポストプロセスマスク","depth-texture-mode":{title:"深度テクスチャモード",info:"`DepthTextureMode.PrePass`が使用されている場合、シェーダーで`camera_DepthTexture`を使用して深度テクスチャにアクセスできます",none:"なし",prepass:"プレパス"},"opaque-texture-enabled":{title:"不透明テクスチャ",info:"有効にすると、シェーダーで`camera_OpaqueTexture`を使用して不透明テクスチャにアクセスできます"},"opaque-texture-down-sampling":{title:"不透明テクスチャのダウンサンプリング",info:"不透明テクスチャのダウンサンプリング",none:"なし",twox:"2倍",fourx:"4倍",eightx:"8倍"},"msaa-samples":{title:"MSAAサンプル",info:"マルチサンプリングアンチギザギザ(MSAA)のサンプル数は、幾何学的なエッジのギザギザを低減します",none:"なし",twox:"2倍",fourx:"4倍",eightx:"8倍"},"enable-hdr":{title:"HDR",info:"HDRレンダリングを有効にし、シェーダー出力色を浮動小数点数で保存できるようにします。これにより、ポストプロセッシングや他の状況でより広い範囲の値を得ることができます"},"enable-post-process":{title:"ポストプロセス",info:"ポストプロセスを有効にします。具体的な構成はシーンパネルにあります"},"anti-aliasing":{title:"アンチエイリアシング",info:"カメラが最終画像にレンダリングするピクセルのギザギザを低減するスクリーン空間のアンチエイジング手法です",none:"なし",fxaa:"FXAA"},"is-alpha-output-required":{title:"アルファ出力が必要です",info:"出力でアルファチャンネルを保持するかどうかを決定します。trueに設定すると、アルファチャンネルは常に保持されます。falseに設定すると、エンジンが自動的に保持するかどうかを決定します。"},"render-target":{title:"レンダーターゲット"},viewport:{title:"ビューポート"},priority:{title:"優先度",info:"シーンに複数のカメラが存在する場合、どのカメラが使用されるかを決定します"}},physics={shape:{add:"形状を追加",type:{title:"タイプ",info:"コライダー形状のタイプを選択"},box:{title:"ボックス",size:{title:"サイズ",info:"ボックス形状のサイズ。"}},sphere:{title:"球体",radius:{title:"半径",info:"球体形状の半径。"}},capsule:{title:"カプセル",radius:{title:"半径",info:"カプセル形状の半径。"},height:{title:"高さ",info:"カプセル形状の高さ。"},"up-axis":{title:"上向き軸",info:"カプセル形状の上向き軸。"}},plane:{title:"平面"},"item-name":"コライダー形状 {{index}}"},collider:{title:"コライダー形状",info:"このコライダーの形状。",trigger:{title:"トリガー",info:"Trueの場合、TriggerShape。Falseの場合、SimulationShape。"},material:{title:"素材",info:"このコライダー形状の物理素材を選択。"},"local-position":{title:"ローカル位置",info:"このコライダー形状のローカル位置。"},rotation:{title:"ローカル回転",info:"このコライダー形状のローカル回転。"}},"dynamic-collider":{kinematic:{title:"キネマティック",info:"動的コライダーに物理が影響を与えるかどうかを制御。"},"collision-detection-mode":{title:"衝突検出モード",discrete:"ディスクリート",continuous:"連続","continuous-dynamic":"連続動的","continuous-speculative":"連続推測"},constraints:{title:"制約",info:"特定の剛体動的ロックフラグ。"},shapes:{title:"コライダー形状",info:"このコライダーの形状。"},mass:{title:"質量",info:"動的コライダーの質量。"},gravity:{title:"重力を使用",info:"有効にすると、動的コライダーは重力の影響を受けます。"},"linear-damping":{title:"線形減衰",info:"動的コライダーの線形減衰。"},"angular-damping":{title:"角度減衰",info:"動的コライダーの角度減衰。"},"automatic-center-of-mass":{title:"重心を自動的に計算",info:"有効にすると、重心は自動的に計算されます。"},"center-of-mass":{title:"重心",info:"変換の原点に対する重心。"},"automatic-inertia-tensor":{title:"慣性テンソルを自動的に計算",info:"有効にすると、慣性テンソルは自動的に計算されます。"},"inertia-tensor":{title:"慣性テンソル",info:"重心に対する質量の慣性テンソル。"},"linear-velocity":{title:"線形速度",info:"動的コライダーの線形速度ベクトル(秒あたりのワールド単位で測定)。"},"angular-velocity":{title:"角速度",info:"動的コライダーの角速度ベクトル(ラジアン毎秒)。"},"max-angular-velocity":{title:"最大角速度",info:"ラジアン毎秒で測定されたコライダーの最大角速度。"},"max-depenetration-velocity":{title:"最大脱浸透速度",info:"浸透状態から移動するときのコライダーの最大速度。"},"sleep-threshold":{title:"スリープしきい値",info:"質量正規化されたエネルギーしきい値。これを下回るとオブジェクトはスリープを開始します。"},"solver-iterations":{title:"ソルバー反復",info:"solverIterationsはコライダージョイントと衝突接触がどれだけ正確に解決されるかを決定します。"}},character:{title:"キャラクターコントローラー",info:"キャラクターコントローラー","step-offset":{title:"ステップオフセット",info:"ステップオフセット"},"up-direction":{title:"上方向",info:"上方向"},"slop-limit":{title:"スロープリミット",info:"スロープリミット"},"non-walkable-mode":{title:"歩行不能モード",info:"歩行不能な表面上でのキャラクターコントローラーの動作を制御します","prevent-climbing":"登れないようにする","prevent-climbing-and-force-sliding":"登れないようにして滑りを強制する"}},joint:{"connected-collider":{title:"接続されたコライダー",info:"接続されたコライダーが属するエンティティを選択します。"},anchor:{title:"アンカー"},"automatic-connected-anchor":{title:"接続アンカーを自動設定"},"connected-anchor":{title:"接続されたアンカー"},"break-force":{title:"破壊力"},"break-torque":{title:"破壊トルク"},"mass-scale":{title:"質量スケール"},"connected-mass-scale":{title:"接続された質量スケール"}},"hinge-joint":{axis:{title:"軸"},"use-limits":{title:"制限を使用"},"use-spring":{title:"スプリングを使用"},limits:{title:"制限"},"use-motor":{title:"モーターを使用"},motor:{title:"モーター"}},"spring-joint":{"connected-collider":{title:"接続されたコライダー",info:"接続されたコライダーが属するエンティティを選択します。"},anchor:{title:"アンカー"},"automatic-connected-anchor":{title:"接続アンカーを自動設定"},"connected-anchor":{title:"接続されたアンカー"},spring:{title:"スプリング"},damper:{title:"ダンパー"},"min-distance":{title:"最小距離"},"max-distance":{title:"最大距離"},tolerance:{title:"許容値"}},"joint-limits":{min:"最小",max:"最大",stiffness:"剛性",damping:"減衰","contact-distance":"接触距離"},"joint-motor":{"target-velocity":"目標速度","force-limit":"力の制限","gear-ratio":"ギア比","free-spin":"フリースピン"},"collider-constraints":{"freeze-position":{title:"位置を固定",info:"位置の動きを固定"},"freeze-rotation":{title:"回転を固定",info:"回転の動きを固定"}},"collider-picker":{placeholder:"コライダーが属するものを選択..."}},shader={compile:{error:"コンパイルエラー"},source:{code:"ソースコード"},material:{ior:"IOR","base-color":"基本色","base-texture":"基本テクスチャ",metallic:"金属感",roughness:"粗さ","roughness-metallic-texture":"粗さ金属感テクスチャ","pbr-specular-color":"色","pbr-specular-intensity":"強さ","pbr-specular-intensity-texture":"強度テクスチャ","pbr-specular-color-texture":"色の質感",glossiness:"光沢","specular-glossiness-texture":"スペキュラー光沢テクスチャ","anisotropy-info":"異方性情報",anisotropy:"異方性","anisotropy-rotation":"異方性回転","anisotropy-texture":"異方性テクスチャ","normal-texture":"法線テクスチャ","normal-intensity":"法線強度","emissive-color":"放射色","emissive-texture":"放射テクスチャ","specular-color":"スペキュラー色","specular-texture":"スペキュラーテクスチャ",shininess:"光沢度","occlusion-texture":"遮蔽テクスチャ","occlusion-intensity":"遮蔽強度","occlusion-texture-coord":"遮蔽テクスチャ座標",clearcoat:"クリアコート","clear-coat-texture":"クリアコートテクスチャ","clear-coat-roughness":"クリアコート粗さ","clear-coat-roughness-texture":"クリアコート粗さテクスチャ","clear-coat-normal-texture":"クリアコート法線テクスチャ",iridescence:"虹色","iridescence-ior":"虹色IOR","iridescence-range":"虹色範囲","iridescence-thickness-texture":"虹色厚さテクスチャ","iridescence-texture":"虹色テクスチャ","sheen-color":"光沢色","sheen-intensity":"光沢強度","sheen-roughness":"光沢粗さ","sheen-texture":"光沢テクスチャ","sheen-roughness-texture":"光沢粗さテクスチャ",transmission:"透過","transmission-texture":"透過テクスチャ","transmission-thickness":"透過厚さ","transmission-thickness-texture":"透過厚さテクスチャ","refraction-mode":"屈折モード","attenuation-color":"減衰色","attenuation-distance":"減衰距離","lightmap-texture":"ライトマップテクスチャ","lightmap-intensity":"ライトマップ強度","tint-color":"色合い",exposure:"露出",rotation:"回転","texture-cube":"Texture Cube","sun-mode":"太陽モード","sun-size":"太陽サイズ","sun-size-convergence":"太陽サイズ収束","atmosphere-thickness":"大気の厚さ","sky-tint":"空の色合い","ground-tint":"地面の色合い","is-transparent":"透明かどうか","alpha-cutoff":"アルファカットオフ","render-face":"レンダー面","blend-mode":"ブレンドモード","tiling-offset":"タイルオフセット","blend-mode-options":{normal:"通常ブレンドモード",additive:"加算ブレンドモード"},uv:{uv0:"UV0",uv1:"UV1"},group:{base:"基本","metal-roughness":"金属粗さ","specular-glossiness":"スペキュラー光沢",anisotropy:"異方性",normal:"法線",emissive:"放射","blinn-phong":"ブリン・フォン",occlusion:"遮蔽","clear-coat":"クリアコート",common:"共通",iridescence:"虹色",sheen:"光沢",transmission:"透過"}},chunk:{title:"シェーダーチャンク","include-path":"インクルードパス"},inspector:{"compile-error":"コンパイルエラー",properties:"プロパティ","included-ui-script":"含まれるUIScript",macro:"マクロ"}},sprite={texture:{info:"スプライトに使用されるテクスチャ",label:"テクスチャ"},width:{info:"3Dワールド内のスプライトの幅",label:"幅"},height:{info:"3Dワールド内のスプライトの高さ",label:"高さ"},region:{info:"スプライトの矩形領域を正規化された値で指定",label:"領域"},"quick-pivot":{info:"スプライトの中心点の位置を矩形領域内で指定(正規化)",label:"クイックピボット",center:"中心","top-left":"左上",top:"上","top-right":"右上",left:"左",right:"右","bottom-left":"左下",bottom:"下","bottom-right":"右下",custom:"カスタム"},pivot:{info:"スプライトのピボット点",label:"ピボット"},border:{info:"スプライトのボーダー(スライスモードとタイルモードの描画効果に影響)",label:"ボーダー",editor:{title:"ボーダーエディター",guides:"9スライスガイド",preview:"ストレッチプレビュー","source-size":"元サイズ","preview-size":"プレビューサイズ",left:"左",bottom:"下",right:"右",top:"上",cancel:"キャンセル",apply:"適用"}},belong:{info:"スプライトが属するスプライトアトラス",label:"所属"},mask:{sprite:{info:"マスキングに使用されるスプライト",label:"マスクスプライト"},"alpha-cutoff":{info:"マスキングのためのアルファしきい値",label:"アルファカットオフ"},"influence-layers":{info:"このマスクの影響を受けるレイヤー",label:"影響レイヤー",everything:"すべて",nothing:"なし",layer1:"レイヤー1",layer2:"レイヤー2",layer3:"レイヤー3",layer4:"レイヤー4",layer5:"レイヤー5",layer6:"レイヤー6",layer7:"レイヤー7",layer8:"レイヤー8"}},atlas:{"max-width":{info:"アトラステクスチャの最大幅",label:"最大幅"},"max-height":{info:"アトラステクスチャの最大高さ",label:"最大高さ"},padding:{info:"アトラス内のスプライト間のパディング",label:"パディング"},rotation:{info:"より良いパッキングのためにスプライトの回転を許可する",label:"回転を許可"},"tight-packing":{info:"メッシュの輪郭を使用して全体のテクスチャ矩形の代わりにフィットさせる。",label:"タイトパッキング"},mipmap:{label:"ミップマップを生成"},"filter-mode":{label:"フィルターモード",point:"ポイント",bilinear:"バイリニア",trilinear:"トリリニア"},"wrap-mode-u":{label:"U軸のラップモード"},"wrap-mode-v":{label:"V軸のラップモード"},"wrap-mode":{clamp:"クランプ",repeat:"リピート",mirror:"ミラー"},"aniso-level":{label:"異方性レベル"},"sprite-list":{label:"スプライトリスト"},"pack-error":{title:"アトラスパッケージエラー","no-sprite":"最初にスプライトを追加してください"},"add-object":{label:"リストに追加"},"pack-preview":{label:"パックしてプレビュー"},packing:"パッキング中",export:"エクスポート",list:"パッキング用オブジェクト","belong-to":"アトラスに追加","add-sprite":"スプライトの追加","select-sprite-atlas":"スプライトシートを選択..."},renderer:{material:{info:"スプライトレンダラーのマテリアル",label:"マテリアル"},sprite:{info:"レンダリングするスプライト",label:"スプライト"},width:{info:"スプライトレンダラーの幅",label:"幅"},height:{info:"スプライトレンダラーの高さ",label:"高さ"},flip:{label:"フリップ",info:"X軸またはY軸でスプライトを反転",x:"X",y:"Y"},"draw-mode":{label:"描画モード",info:"スプライトレンダラーの描画モード",simple:"シンプル",sliced:"スライス",tiled:"タイル"},color:{label:"色",info:"スプライトに適用される色の色調"},"mask-interaction":{label:"マスクとの相互作用",info:"このスプライトレンダラーがスプライトマスクとどのように相互作用するか",none:"なし","visible-inside":"マスク内で可視","visible-outside":"マスク外で可視"},"mask-layer":{label:"マスクレイヤー",info:"このスプライトレンダラーが属するマスクレイヤー",everything:"すべて",nothing:"なし",layer1:"レイヤー1",layer2:"レイヤー2",layer3:"レイヤー3",layer4:"レイヤー4",layer5:"レイヤー5",layer6:"レイヤー6",layer7:"レイヤー7",layer8:"レイヤー8"},priority:{label:"優先度",info:"スプライトレンダラーのレンダリング優先度"}},inspector:{title:"スプライト","texture-thumbnail":"テクスチャサムネイル",thumbnail:"スプライトサムネイル"}},lottie={resource:{label:"リソース",info:"Lottieアニメーションリソースファイル"},"auto-play":{label:"自動再生",info:"Lottieアニメーションが自動再生するかどうかを設定"},"is-looping":{label:"ループ",info:"Lottieアニメーションがループするかどうかを設定"},speed:{label:"速度",info:"Lottieアニメーションの再生速度を設定"},priority:{label:"優先度",info:"Lottieアニメーションのレンダリング優先度"},clip:{name:"クリップ名",start:"開始フレーム",end:"終了フレーム"},asset:{width:"幅",height:"高さ",duration:"持続時間","in-point":"インポイント","out-point":"アウトポイント",mipmap:"ミップマップ","color-dilate":"色膨張","filter-mode":{title:"テクスチャフィルターモード",point:"ポイント",bilinear:"バイリニア",trilinear:"トリリニア"},"wrap-mode":{u:"U軸ラップモード",v:"V軸ラップモード",clamp:"クランプ",repeat:"リピート",mirror:"ミラー"},"atlas-export":"アトラスエクスポート"},clips:{title:"クリップ",add:"クリップを追加",item:"クリップ {{index}}"}},spine={resource:{label:"リソース",info:"Spineスケルトンデータリソース"},loop:{label:"ループ",info:"初期アニメーションループ"},animation:{label:"初期アニメーション",info:"再生する初期アニメーション"},skin:{label:"スキン",info:"レンダリングに使用するスキン"},priority:{label:"レンダリング優先度",info:"レンダリングの優先度"},"premultiplied-alpha":{label:"プリマルチプライドアルファ",info:"プリマルチプライドアルファモードでレンダリングするかどうか"},"tint-black":{label:"濃色着色",info:"濃色の着色機能を有効化するか"},error:{"generate-skeleton-data":"Spineスケルトンデータの生成に失敗しました","no-atlas-file":".atlasファイルが見つかりません。Spineアセットに少なくとも1つの.atlasファイルをアップロードしてください。","missing-images":"アトラスに対応する画像ファイルが見つかりません。関連するすべての画像ファイルがアップロードされていることを確認してください","missing-attachments":"アップロードされたアトラスファイルに必要なすべてのアタッチメントが含まれていません","incompatible-version":'認識できないアタッチメントタイプ:"{{0}}"。スケルトンが互換性のないSpineバージョンからエクスポートされた可能性があります。'}},animation={layer:{name:"名前",weight:"重さ",blending:"ブレンディング",override:"オーバーライド",additive:"加算"},"remove-property":"プロパティを削除","recording-mode-tip":"録画モードを有効/無効にする","play-tip":"アニメーションクリップを再生/一時停止","replay-tip":"アニメーションクリップを再生","add-event":"イベントを追加","add-property":"プロパティを追加","remove-event":"イベントを削除","remove-keyframe":"キーフレームを削除","left-tangent":"左タンジェント",linear:"線形",constant:"定数",free:"自由","right-tangent":"右タンジェント","both-tangent":"両方のタンジェント","select-target-entity":"アニメーション化するターゲットエンティティを階層パネルから選択","no-parameters":"パラメータなし",layers:"レイヤー",parameters:"パラメータ","add-animator-state":"アニメーターステートを追加","select-controller":"編集するアニメーターコントローラーアセットをアセットパネルから選択",clip:{event:"イベント","param-type":{title:"パラメータタイプ",string:"文字列",number:"数値",null:"ヌル"},"function-name":"関数名",number:"数値",string:"文字列",asset:"アセット","tip-0":"{{0}}をアニメーション化するために、アニメーターに{{1}}を追加","tip-1":"{{0}}をアニメーション化するために、アニメーターコントローラーを作成","tip-2":"{{0}}をアニメーション化するために、","tip-3":"、アニメーターを作成して{{0}}を追加","tip-4":"アニメーターを作成","an-clip":"アニメーションクリップ",create:"作成","create-animator-controller":"アニメーターコントローラーを作成","add-target":"ターゲットを追加","current-frame":"現在のフレーム",error:{"sub-property-existed":"サブプロパティはすでに存在します","property-existed":"プロパティはすでに存在します","property-not-supported":"プロパティはサポートされていません","keyframe-parse-failed":"キーフレーム解析エラー、Galacean 開発者にお問い合わせください"},"select-entity-preview":"プレビューするエンティティを選択"},"animator-controller":{controller:{title:"コントローラー",info:"アニメーションステートマシンを制御するために使用されるアニメーターコントローラーリソース"},"culling-mode":{title:"カリングモード",info:"アニメーターコンポーネントのカリングモード",none:"なし",complete:"完了"},speed:{title:"速度",info:"アニメーションの再生速度"},delete:"削除",state:{name:"名前",clip:"アニメーションクリップ","wrap-mode":{title:"ラップモード",once:"一度",loop:"ループ"},speed:"速度","start-time":"開始時間","end-time":"終了時間",new:"新しい状態",validation:{"must-be-unique":"ステート名は一意である必要があります"}},transition:{solo:"ソロ",mute:"ミュート","has-exit-time":"終了時間あり","fixed-duration":"固定持続時間",duration:"持続時間","exit-time":"終了時間",offset:"オフセット"},editor:{open:"アニメーターコントローラーエディターを開く"}}},asset$1={markdown:{title:"Markdown",toolbar:{bold:"太字",italic:"斜体",strikethrough:"取り消し線","inline-code":"インラインコード",heading1:"見出し1",heading2:"見出し2",heading3:"見出し3","bullet-list":"箇条書き","ordered-list":"番号付きリスト","task-list":"タスクリスト",blockquote:"引用","code-block":"コードブロック","horizontal-rule":"水平線",table:"表を挿入"}},texture:{title:"テクスチャ","texture-compression":"圧縮"},menu:{Folder:"フォルダー",Material:"材料",AnimatorController:"アニメーターコントローラー",AnimationClip:"アニメーションクリップ",sprite:"スプライト",SpriteAtlas:"スプライトアトラス",Scene:"シーン",PrimitiveMesh:"プリミティブメッシュ",PhysicsMaterial:"物理素材",scripting:"スクリプティング","entity-script":"エンティティスクリプト","state-machine-script":"ステートマシンスクリプト",shader:"シェーダー","shader-chunk":"シェーダーチャンク","shader-ui-script":"シェーダーUIScript"},"copied-to-clipboard":"クリップボードにコピーされました",create:"作成",search:"アセットを検索...",explorer:{name:"名前",type:"タイプ",size:"サイズ","ascending-in-alphabet":"アルファベット順に昇順","descending-in-alphabet":"アルファベット順に降順","ascending-with-file-type":"ファイルタイプで昇順","descending-with-file-type":"ファイルタイプで降順"},upload:"アップロード","add-to-atlas":"アトラスに追加",duplicate:"重複",copy:"コピー",paste:"貼り付け","copy-file-url":"ファイルURLをコピー","copy-relative-path":"相対パスをコピー","copy-relative-path-success":"相対パスがクリップボードにコピーされました","copy-development-id":"開発IDをコピー","copy-development-id-success":"開発IDがクリップボードにコピーされました",download:"ダウンロード...",delete:"削除",root:"ルート","cant-download-sub-asset":"サブアセットをダウンロードできません。","export-success":"エクスポート成功","open-in-code-editor":"コードエディターで開く","moved-assets-to":"アセットを{{0}}フォルダーに移動しました","export-asset":"アセットをエクスポート","these-assets":"これらのアセット","this-asset":"このアセット","delete-asset":"アセットを削除",cancel:"キャンセル","sure-to-delete":"本当に{{0}}を削除してもよろしいですか?","upload-success":"アップロード成功",uploading:"アップロード中","overwrite-tip":"同じ名前のファイルを上書きしますか?","paste-error":"まずアセットを選択してください!","paste-assets-error":"アセットの貼り付けエラー","copy-none":"まずアセットを選択してください!","duplicate-folder-error":"フォルダーを複製することはできません!","delete-scene-error":"現在のシーンを削除できません","delete-internal-asset-error":"内部アセットを削除できません","upload-failed":"アップロード失敗","file-size-limit":"ファイルサイズ制限",title:"アセット","upload-to-cdn":"CDNにアップロード",original:"オリジナル",exporting:"エクスポート中...","local-workspace-sync":{"create-workspace":"ローカルワークスペースをリンク",sync:"ローカルワークスペースを同期","select-directory":"ローカルワークスペースをリンク",linked:"ローカルワークスペースをリンク済み",restoring:"ローカルワークスペースのリンクを復元中...","local-workspace":"ローカルワークスペース",connected:"{{0}} にリンクしました","permission-required":"アクセス権が必要です","permission-denied":"同期する前にローカルワークスペースへのアクセス権が必要です。",planning:"アセットを準備中",applying:"ファイルを書き込み中",progress:"{{0}}({{1}}/{{2}})","current-path":"現在: {{0}}",syncing:"ローカルワークスペースを同期中...",success:"アセットを {{0}} に同期しました",failed:"ローカルワークスペースの同期に失敗しました。",error:"同期エラー","conflict-title":"ファイルの競合を検出しました","conflict-description":"{{0}} 件のファイルがエディターとローカルワークスペース間で異なります。解決方法を選択してください:","conflict-confirm":"同期して上書き","conflict-use-editor":"エディター版を使用","conflict-use-local":"ローカル版を使用","conflict-more":"…ほか {{0}} 件","guide-title":"ローカルワークスペースをリンク","guide-description":"プロジェクトアセットをローカルフォルダに同期し、お好みの IDE やツールで編集できます。変更は自動検出され、双方向に同期されます。","guide-feature-1":"VS Code、WebStorm、または任意の IDE でスクリプトやシェーダーを編集","guide-feature-2":"ローカルファイルの変更を自動検出してエディターに同期","guide-feature-3":"上書き前にファイルの競合を自動検出して解決","guide-requirement":"Chrome 86+ または Edge 86+ が必要です。ブラウザは選択したフォルダへの読み書き権限を要求します。","guide-select-folder":"フォルダを選択","unsupported-title":"ブラウザがサポートされていません","unsupported-description":`ローカルワークスペース同期には File System Access API が必要です。この機能は Chrome 86+ または Edge 86+ でのみ利用可能です。
709
709
 
710
- サポートされているブラウザに切り替えてください。`,"unsupported-confirm":"OK"},"sprite-atlas":{title:"スプライトアトラス",adding:"追加中",success:"成功",error:"スプライトの追加に失敗しました"},"tree-shaking":{tip:"ツリーシェイキングは、プロジェクトファイルのサイズを削減するための効果的な機能です。パッケージング中にプロジェクトから不要なアセットをインテリジェントに削除することができます。",default:{title:"デフォルト",desc:"ツリーシェイキングなし。"},"current-scene":{title:"現在のシーン",desc:"現在のシーンのみツリーシェイクします。"},"all-scene":{title:"すべてのシーン",desc:"すべてのシーンをツリーシェイクします。"},title:"ツリーシェイキング"},"primitive-mesh":{title:"プリミティブメッシュ",type:{label:"タイプ",info:"作成するプリミティブメッシュのタイプ"},sphere:{radius:{label:"半径",info:"球体の半径"},step:{label:"ステップ",info:"球体を構築するために使用されるセグメントの数"}},capsule:{radius:{label:"半径",info:"カプセルの半径"},height:{label:"高さ",info:"カプセルの高さ"},"radial-segments":{label:"ラジアルセグメント",info:"カプセルの円周を囲むセグメント数"},"height-segments":{label:"高さセグメント",info:"カプセルの高さに沿ったセグメント数"}},cone:{radius:{label:"半径",info:"円錐の底面の半径"},height:{label:"高さ",info:"円錐の高さ"},"radial-segments":{label:"ラジアルセグメント",info:"円錐の円周を囲むセグメント数"},"height-segments":{label:"高さセグメント",info:"円錐の高さに沿ったセグメント数"}},cuboid:{width:{label:"幅",info:"直方体の幅"},height:{label:"高さ",info:"直方体の高さ"},depth:{label:"深さ",info:"直方体の深さ"}},cylinder:{"radius-top":{label:"上部半径",info:"円柱の上部の半径"},"radius-bottom":{label:"底部半径",info:"円柱の底部の半径"},height:{label:"高さ",info:"円柱の高さ"},"radial-segments":{label:"ラジアルセグメント",info:"円柱の円周を囲むセグメント数"},"height-segments":{label:"高さセグメント",info:"円柱の高さに沿ったセグメント数"}},plane:{width:{label:"幅",info:"平面の幅"},height:{label:"高さ",info:"平面の高さ"},"horizontal-segments":{label:"水平セグメント",info:"平面の幅に沿ったセグメント数"},"vertical-segments":{label:"垂直セグメント",info:"平面の高さに沿ったセグメント数"}},torus:{radius:{label:"半径",info:"トーラスの中心からチューブの中心への半径"},"tube-radius":{label:"チューブ半径",info:"トーラスのチューブの半径"},"radial-segments":{label:"ラジアルセグメント",info:"トーラスの円周を囲むセグメント数"},"tubular-segments":{label:"チューブラーセグメント",info:"チューブを囲むセグメント数"},arc:{label:"アーク",info:"トーラスセクションの中心角"}}},gltf:{title:"GlTF","basic-info":"基本情報",triangles:"三角形",drawcall:"ドローコール","compute-tangents":"タンジェントを計算","keep-mesh-data":"メッシュデータを保持","refresh-tip":"リフレッシュ後に有効",issues:"問題","remapped-materials":"再マッピングされた材料",compression:"圧縮",quantize:"量子化",meshopt:"メッシュオプティマイズ"},"select-asset":"アセットを選択...",filter:{all:"すべて"},folder:{title:"フォルダー"},shader:{title:"シェーダー"},material:{title:"材料"},script:{title:"スクリプト"},font:{title:"フォント"},"texture-cube":{title:"TextureCube"},"ambient-light":{title:"環境光"},"directional-light":{title:"指向性ライト"},"point-light":{title:"ポイントライト"},"spot-light":{title:"スポットライト"},sprite:{title:"スプライト"},"xr-reference-image":{title:"XRリファレンスイメージ"},"animator-controller":{title:"アニメーターコントローラー"},"animation-clip":{title:"アニメーションクリップ"},scene:{title:"シーン"},"physics-material":{title:"物理素材"},"render-target":{title:"レンダーターゲット"},"entity-script":{title:"エンティティスクリプト"},"state-machine-script":{title:"ステートマシンスクリプト"},"shader-chunk":{title:"シェーダーチャンク"},"shader-ui-script":{title:"シェーダーUIScript"},prefab:{title:"プレハブ"},audio:{title:"オーディオ"},mesh:{title:"メッシュ"},lottie:{title:"Lottie"},"spine-skeleton-data":{title:"Spineスケルトンデータ"},"spine-atlas":{title:"アトラス"},ktx2:{mode:{label:"モード",uastc:{label:"UASTC",desc:"UASTCはより良い品質を提供しますが、ファイルサイズが大きくなります"},etc1s:{label:"ETC1S",desc:"ETC1Sはより良い圧縮を提供しますが、品質が低くなります"}},quality:"品質"}},transform$2={position:{title:"位置",info:"3D空間内のエンティティの位置"},rotation:{title:"回転",info:"3D空間内のエンティティの回転角度"},scale:{title:"スケール",info:"3D空間内のエンティティのスケールファクター"},error:{"cant-disable":"トランスフォームコンポーネントを無効にできません","cant-delete":"トランスフォームコンポーネントを削除できません"}},light={color:"色","culling-mask":"カリングマスク",point:{distance:{label:"距離",info:"ポイントライトが照らす最大距離"}},shadow:{title:"影",type:{label:"タイプ",info:"影のタイプ",none:"なし",hard:"ハード",softlow:"ソフト低",softhigh:"ソフト高"},bias:{label:"バイアス",info:"影のアクネを防ぐための影バイアス"},"normal-bias":{label:"ノーマルバイアス",info:"影のアクネを防ぐためのノーマルバイアス"},"near-plane-offset":{label:"近クリップ面オフセット",info:"影の近クリップ面のオフセット"},strength:{label:"強度",info:"影の強度"}},spot:{distance:{label:"距離",info:"スポットライトが照らす最大距離"},angle:{label:"角度",info:"スポットライトの円錐の角度"},penumbra:{label:"ペンブラス",info:"スポットライトのペンブラス角度"}}},prefab={inspector:{"basic-info":"基本情報","dependent-assets":"依存アセット",url:"URL",missed:"失敗"},error:{"create-from-sub":"プレハブサブエンティティからプレハブを作成できません。"},delete:{title:"プレハブインスタンスを削除しますか?",description:"プレハブ '{{name}}' が削除されました。すべてのインスタンスを削除しますか?"},button:{no:"いいえ",yes:"はい"},replace:{title:"プレハブを置き換える",description:'プレハブ "{{name}}" を置き換えてもよろしいですか?すべてのプレハブインスタンスが置き換えられます',confirm:"それでも置き換える"}},community={title:"コミュニティ","all-projects":"すべてのプロジェクト","my-projects":"マイプロジェクト","all-projects-desc":"コミュニティで共有されているプロジェクトを探索","my-projects-desc":"コミュニティに公開したプロジェクト","search-placeholder":"コミュニティプロジェクトを検索...","no-projects":"コミュニティプロジェクトが見つかりません","no-my-projects":"まだプロジェクトを公開していません","publish-hint":"最初のプロジェクトを公開してコミュニティと共有しましょう","load-more":"さらに読み込む",loading:"読み込み中...","no-preview":"プレビューが利用できません",preview:"プレビュー",share:"共有",withdraw:"撤回",tags:"タグ",license:"ライセンス",stats:"統計",copyright:"著作権",views:"閲覧数",likes:"いいね",downloads:"ダウンロード","publish-success":"レビュー待ちに提出しました",publish:{title:"コミュニティに公開","published-at":"公開日","publish-button":"公開",agreement:"公開をクリックすることで、","more-options":"その他のオプション","community-guidelines":"コミュニティガイドライン"}},resourcePackage={export:"リソースパッケージとしてエクスポート","export-cdn":"CDN パッケージ","export-local":"ファイルパッケージ",import:"リソースパッケージをインポート","import-from-file":"ファイルから","import-from-url":"URL から","input-url":"GRP リソースパッケージの URL を入力",cancel:"キャンセル",confirm:"確認",exporting:"リソースパッケージをエクスポート中...",uploading:"リソースパッケージをアップロード中...",importing:"リソースパッケージをインポート中...","export-success":"リソースパッケージのエクスポートに成功しました","upload-success":"CDN URLがクリップボードにコピーされました","export-failed":"リソースパッケージのエクスポートに失敗しました","import-success":"リソースパッケージのインポートに成功しました","import-failed":"リソースパッケージのインポートに失敗しました","no-assets-selected":"エクスポートするアセットを選択してください","cant-export-sub-asset":"サブアセットはエクスポートできません",assets:"個のアセット"},ja$2={service,"code-editor":{"back-to-editor":"シーンエディターに戻る",preview:"プレビュー",devtools:{console:"コンソール",inspector:"インスペクター"},file:{"not-saved":"ファイルは保存されていません。","not-saved-description":"変更を破棄してもよろしいですか?保存されていない変更はすべて失われます。",cancel:"キャンセル",confirm:"確認",project:"プロジェクト"},"event-debug":{input:"入力",json:"JSON",clear:"クリア",confirm:"確認",events:"イベント",trigger:"トリガー","no-events":"プレビューからイベント信号を検出できません。"},"file-tree":{title:"アセット",search:{placeholder:"ファイルを検索..."}},library:{title:"依存関係",import:"インポート",search:{placeholder:"ライブラリ名"},version:{latest:"最新",updating:"更新中..."}},menubar:{file:{title:"ファイル","new-file":"新しいファイル","open-file":"ファイルを開く",save:"保存",close:"閉じる"},edit:{title:"編集",undo:"元に戻す",redo:"やり直す",find:{title:"検索...",find:"検索",replace:"置換"},cut:"切り取り",copy:"コピー",paste:"貼り付け"},view:{title:"表示","show-minimap":"ミニマップを表示","new-tab":"新しいタブ","close-tab":"タブを閉じる",share:"共有",print:"印刷"},help:{title:"ヘルプ",documentation:"ドキュメント","shaderlab-syntax":"Shaderlab構文",about:"について"}},monaco:{loading:"読み込み中..."},"preview-inspector":{title:"インスペクター"},"preview-toolbar":{"open-in-new-tab":"新しいタブで開く","toggle-orientation":"向きを切り替える","toggle-lock":"ロックを切り替える",refresh:"更新",close:"閉じる"}},shortcuts,project,member,setting,snapshot,export:{"copied-to-clipboard":"クリップボードにコピーしました",auto:"自動","playing-options":{title:"プレイオプション","loading-ui":"ローディングUI","orbit-control":"軌道制御",enable:"有効",disabled:"無効"},"main-scene":"メインシーン",default:"デフォルト","current-scene":"現在のシーン","all-scene":"すべてのシーン",fixed:"固定","required-external-components":"必要な外部コンポーネント",rendering:"レンダリング","webgl-mode":"WebGLモード",alpha:"アルファを使用","preserve-drawing-buffer":"描画バッファを保存",dpr:{label:"デバイスピクセル比モード",fixed:"固定",auto:"自動"},update:"更新",publish:"公開","publish-success":{title:"公開成功",description:"おめでとうございます!初回プロジェクトの公開が完了しました。他の人と共有できるようになりました。","got-it":"了解"},"public-url-generated":"公開URLが生成されました","download-project-json":"Project.jsonをダウンロード","update-public-url":"公開URLを更新","generate-public-url":"公開URLを生成","platform-setting":"プラットフォーム設定","copy-url":"URLをコピー",scenes:"シーン",download:"ダウンロード",orientation:"向き",portrait:"縦向き",landscape:"横向き","network-timeout":"ネットワークタイムアウト",request:"リクエスト","connect-socket":"ソケットに接続","upload-file":"ファイルをアップロード","download-file":"ファイルをダウンロード","web-project":"Webプロジェクト",vanilla:"Vanilla JS",react:"React",vue:"Vue",framework:"フレームワーク","package-to-zip":"Zipにパッケージ","public-url-publish":"Webに公開","export-as-react-project":"Reactプロジェクトとしてエクスポート","export-as-vue-project":"Vueプロジェクトとしてエクスポート","public-url":"公開URL","shader-and-publish":"シェーダーと公開","wechat-mini-game":"Wechatミニゲーム","publish-to-wechat":"Wechatに公開","tiktok-mini-game":"TikTokミニゲーム","publish-to-tiktok":"TikTokに公開","project-url":"プロジェクトURLを取得","subpackage-setting":"サブパッケージリスト","subpackage-list":"サブパッケージリスト","subpackage-add":"サブパッケージを追加","subpackage-index":"サブパッケージ","subpackage-empty":"リストは空です","subpackage-folder":"サブパッケージディレクトリ","subpackage-holder":"サブパッケージとしてディレクトリを選択","subpackage-info":"選択したディレクトリはサブパッケージとして使用されます。このディレクトリ内のスクリプト以外のすべてのアセットはサブパッケージにエクスポートされます","subpackage-conflict":"既存のサブパッケージと競合します。競合するサブパッケージは次のとおりです: サブパッケージ "},plugin,hierarchy,inspector,menu,viewport:viewport$1,effects,trail,texture,ui:ui$2,xr,homepage,user,layout,sandbox,entity,component,"skinned-mesh-renderer":{title:"スキンメッシュレンダラー","local-bounds":{title:"ローカル境界",info:"スキンドスケルタルレンダラーのローカル空間境界ボックス",min:{label:"最小",info:"ローカル境界ボックスの最小点"},max:{label:"最大",info:"ローカル境界ボックスの最大点"}},skin:{title:"スキン","root-bone":{label:"ルートボーン",info:"スキンメッシュレンダラーのルートボーン"},bones:{label:"ボーン",info:"ボーンの数"}}},"mesh-renderer":{material:{title:"材料",info:"メッシュレンダラーが使用する材料",thumbnail:"材料サムネイル"},mesh:{title:"メッシュ",info:"レンダリングするメッシュ"},"receive-shadows":{title:"影を受け取る",info:"メッシュが影を受け取るかどうか"},"cast-shadows":{title:"影を投げる",info:"メッシュが影を投げるかどうか"},priority:{title:"優先度",info:"レンダリングの優先度"}},script,scene,"post-process":{global:{title:"グローバル",info:"ポストプロセスがグローバルであるかどうかを示します。ローカルモードはコライダーコンポーネントと一緒に使用する必要があります。"},"blend-distance":{title:"ブレンド距離",info:"ブレンドを開始する外部距離。"},priority:{title:"優先度",info:"ポストプロセスがシーンに等しい影響度を持つ場合、どのポストプロセスが使用されるかを決定します。"},layer:{title:"レイヤー",info:"ポストプロセスが属するレイヤーで、カメラのポストプロセスマスクと一緒に使用できます"},effects:{options:{half:"半分",quarter:"四分の一",neutral:"ニュートラル",aces:"ACES(アカデミーカラーエンコーディングシステム)"},bloom:{title:"ブルーム","high-quality-filtering":{label:"高品質フィルタリング",info:"高品質フィルタリングを有効にする"},scatter:{label:"スキャッター",info:"ブルームエフェクトの半径を設定します"},"down-scale":{label:"ダウンスケール",info:"このエフェクトが処理を開始する解像度を制御します"},threshold:{label:"しきい値",info:"この明るさレベル以下のピクセルをフィルタリングします。値はガンマ空間で指定されます"},intensity:{label:"強度",info:"ブルームエフェクトの強さ"},tint:{label:"色調",info:"ブルームエフェクトの色調"},"dirt-texture":{label:"汚れのテクスチャ",info:"ブルームエフェクトに汚れやほこりを追加する汚れのテクスチャ"},"dirt-intensity":{label:"汚れの強度",info:"汚れのテクスチャの強さ"}},"tone-mapping":{title:"トーンマッピング",mode:{label:"モード",info:"トーンマッピングモード、`Neutral`モードは、色相と彩度への影響を最小限に抑えながら範囲リマッピングだけを希望する状況に特に適しています。`ACES`モードは長編映画用のACES参照カラー空間を使用し、シネマティックでコントラストのある結果を生み出しますが、より多くのパフォーマンスが必要です"}},title:"ポストエフェクト",add:"エフェクトを追加"}},camera,physics,shader,sprite,"text-renderer":{text:{label:"テキスト",info:"表示するテキストコンテンツ"},color:{label:"色",info:"テキストの色"},"font-size":{label:"フォントサイズ",info:"テキストフォントのサイズ"},font:{label:"フォント",info:"テキストのレンダリングに使用するフォントアセット"},width:{label:"幅",info:"テキストレンダラーの幅"},height:{label:"高さ",info:"テキストレンダラーの高さ"},"line-spacing":{label:"行間隔",info:"テキストの行間隔"},"font-style":{label:"フォントスタイル",info:"フォントのスタイル(太字、イタリック)"},"horizontal-alignment":{label:"水平配置",info:"テキストの水平配置"},"vertical-alignment":{label:"垂直配置",info:"テキストの垂直配置"},"enable-wrapping":{label:"折り返しを有効にする",info:"テキストの折り返しを有効にするかどうか"},"overflow-mode":{label:"オーバーフローモード",info:"コンテナをオーバーフローするテキストをどのように処理するか",overflow:"オーバーフロー",truncate:"切り詰め"},"mask-interaction":{label:"マスクとの相互作用",info:"このテキストレンダラーがスプライトマスクとどのように相互作用するか",none:"なし","visible-inside":"マスク内で可視","visible-outside":"マスク外で可視"},"mask-layer":{label:"マスクレイヤー",info:"このテキストレンダラーが属するマスクレイヤー",everything:"すべて",nothing:"なし",layer0:"レイヤー0",layer1:"レイヤー1",layer2:"レイヤー2",layer3:"レイヤー3",layer4:"レイヤー4",layer5:"レイヤー5",layer6:"レイヤー6",layer7:"レイヤー7",layer8:"レイヤー8"},priority:{label:"優先度",info:"テキストレンダラーのレンダリング優先度"}},lottie,spine,animation,asset:asset$1,transform:transform$2,light,prefab,"ai-panel":{"remaining-times":"残りの回数","image-to-3d":"画像から3Dモデルを生成","upload-description":"画像をアップロードして3Dモデルを生成","ai-generated":"すべてのモデルはAIによって生成されました",retry:"再試行",view:"表示",generate:"生成",upload:{error:"PNG、JPG、JPEGファイルのみサポートされています。","drag-drop":"画像をドラッグまたはクリックしてアップロード","supported-formats":"サポートされているフォーマット:PNG、JPG、JPEG"},pagination:{previous:"前へ",next:"次へ","page-info":"ページ {{current}} / {{total}}"},history:"履歴","generate-error":"モデルの生成に失敗しました,しばらくしてから再試行してください",use:"使用","add-success":"資産パネルに正常に追加されました","add-error":"追加に失敗しました。しばらくしてから再試行してください","fetch-error":"モデルリストの読み込みに失敗しました。しばらくしてから再試行してください",waiting:"{{queuePosition}} 人待っています"},community,resourcePackage},localStorageLanguage="__language__";instance.use(initReactI18next).init({resources:{en:{translation:en},zh:{translation:zh$2},ja:{translation:ja$2}},lng:typeof localStorage<"u"?localStorage.getItem(localStorageLanguage):void 0,fallbackLng:"en",interpolation:{escapeValue:!1}});const{t:t$8}=instance;let editorUiModulePromise=null;function loadEditorUiModule(){return editorUiModulePromise??(editorUiModulePromise=__vitePreload(()=>import("./index-d7bb5fc3.js"),["_static/index-d7bb5fc3.js","_static/IconEdit-e6cba426.js","_static/index-f3f5cf05.js","_static/Menu-4b6f69f6.js","_static/Accordion-8e8abfeb.js","_static/Callout-5731416b.js","_static/Tooltip-01dd51dc.js"])),editorUiModulePromise}function showEditorUiAlert(nt){loadEditorUiModule().then(({showAlert:_e})=>{_e(nt)})}function showEditorUiToastSuccess(nt){loadEditorUiModule().then(({toast:_e})=>{_e.success(nt)})}function showEditorUiToastError(nt){loadEditorUiModule().then(({toast:_e})=>{_e.error(nt)})}async function runWithEditorUiToastPromise(nt,_e){const{toast:tt}=await loadEditorUiModule();return tt.promise(nt,_e)}function showComponentAlert(nt){showEditorUiAlert(nt)}function showComponentToastError(nt){showEditorUiToastError(nt)}var eventemitter3={exports:{}};(function(nt){var _e=Object.prototype.hasOwnProperty,tt="~";function et(){}Object.create&&(et.prototype=Object.create(null),new et().__proto__||(tt=!1));function rt(st,ct,ut){this.fn=st,this.context=ct,this.once=ut||!1}function it(st,ct,ut,dt,ht){if(typeof ut!="function")throw new TypeError("The listener must be a function");var ft=new rt(ut,dt||st,ht),pt=tt?tt+ct:ct;return st._events[pt]?st._events[pt].fn?st._events[pt]=[st._events[pt],ft]:st._events[pt].push(ft):(st._events[pt]=ft,st._eventsCount++),st}function ot(st,ct){--st._eventsCount===0?st._events=new et:delete st._events[ct]}function at(){this._events=new et,this._eventsCount=0}at.prototype.eventNames=function(){var ct=[],ut,dt;if(this._eventsCount===0)return ct;for(dt in ut=this._events)_e.call(ut,dt)&&ct.push(tt?dt.slice(1):dt);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(ut)):ct},at.prototype.listeners=function(ct){var ut=tt?tt+ct:ct,dt=this._events[ut];if(!dt)return[];if(dt.fn)return[dt.fn];for(var ht=0,ft=dt.length,pt=new Array(ft);ht<ft;ht++)pt[ht]=dt[ht].fn;return pt},at.prototype.listenerCount=function(ct){var ut=tt?tt+ct:ct,dt=this._events[ut];return dt?dt.fn?1:dt.length:0},at.prototype.emit=function(ct,ut,dt,ht,ft,pt){var mt=tt?tt+ct:ct;if(!this._events[mt])return!1;var vt=this._events[mt],_t=arguments.length,yt,bt;if(vt.fn){switch(vt.once&&this.removeListener(ct,vt.fn,void 0,!0),_t){case 1:return vt.fn.call(vt.context),!0;case 2:return vt.fn.call(vt.context,ut),!0;case 3:return vt.fn.call(vt.context,ut,dt),!0;case 4:return vt.fn.call(vt.context,ut,dt,ht),!0;case 5:return vt.fn.call(vt.context,ut,dt,ht,ft),!0;case 6:return vt.fn.call(vt.context,ut,dt,ht,ft,pt),!0}for(bt=1,yt=new Array(_t-1);bt<_t;bt++)yt[bt-1]=arguments[bt];vt.fn.apply(vt.context,yt)}else{var St=vt.length,xt;for(bt=0;bt<St;bt++)switch(vt[bt].once&&this.removeListener(ct,vt[bt].fn,void 0,!0),_t){case 1:vt[bt].fn.call(vt[bt].context);break;case 2:vt[bt].fn.call(vt[bt].context,ut);break;case 3:vt[bt].fn.call(vt[bt].context,ut,dt);break;case 4:vt[bt].fn.call(vt[bt].context,ut,dt,ht);break;default:if(!yt)for(xt=1,yt=new Array(_t-1);xt<_t;xt++)yt[xt-1]=arguments[xt];vt[bt].fn.apply(vt[bt].context,yt)}}return!0},at.prototype.on=function(ct,ut,dt){return it(this,ct,ut,dt,!1)},at.prototype.once=function(ct,ut,dt){return it(this,ct,ut,dt,!0)},at.prototype.removeListener=function(ct,ut,dt,ht){var ft=tt?tt+ct:ct;if(!this._events[ft])return this;if(!ut)return ot(this,ft),this;var pt=this._events[ft];if(pt.fn)pt.fn===ut&&(!ht||pt.once)&&(!dt||pt.context===dt)&&ot(this,ft);else{for(var mt=0,vt=[],_t=pt.length;mt<_t;mt++)(pt[mt].fn!==ut||ht&&!pt[mt].once||dt&&pt[mt].context!==dt)&&vt.push(pt[mt]);vt.length?this._events[ft]=vt.length===1?vt[0]:vt:ot(this,ft)}return this},at.prototype.removeAllListeners=function(ct){var ut;return ct?(ut=tt?tt+ct:ct,this._events[ut]&&ot(this,ut)):(this._events=new et,this._eventsCount=0),this},at.prototype.off=at.prototype.removeListener,at.prototype.addListener=at.prototype.on,at.prefixed=tt,at.EventEmitter=at,nt.exports=at})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class MessageCenterImpl extends EventEmitter{dispatch(_e,...tt){this.emit(_e,...tt)}}const MessageCenter=new MessageCenterImpl;function hasProp$1(nt,_e){return Object.prototype.hasOwnProperty.call(nt,_e)}function addHiddenProp$1(nt,_e,tt){Object.defineProperty(nt,_e,{enumerable:!1,writable:!0,configurable:!0,value:tt})}function isDeepKey(nt){switch(typeof nt){case"number":case"symbol":return!1;case"string":return nt.includes(".")||nt.includes("[")||nt.includes("]")}}function toKey$1(nt){return Object.is(nt,-0)?"-0":nt.toString()}function toPath$1(nt){const _e=[],tt=nt.length;if(tt===0)return _e;let et=0,rt="",it="",ot=!1;for(nt.charCodeAt(0)===46&&(_e.push(""),et++);et<tt;){const at=nt[et];it?at==="\\"&&et+1<tt?(et++,rt+=nt[et]):at===it?it="":rt+=at:ot?at==='"'||at==="'"?it=at:at==="]"?(ot=!1,_e.push(rt),rt=""):rt+=at:at==="["?(ot=!0,rt&&(_e.push(rt),rt="")):at==="."?rt&&(_e.push(rt),rt=""):rt+=at,et++}return rt&&_e.push(rt),_e}function get$3(nt,_e,tt){if(nt==null)return tt;switch(typeof _e){case"string":{const et=nt[_e];return et===void 0?isDeepKey(_e)?get$3(nt,toPath$1(_e),tt):tt:et}case"number":case"symbol":{typeof _e=="number"&&(_e=toKey$1(_e));const et=nt[_e];return et===void 0?tt:et}default:{if(Array.isArray(_e))return getWithPath(nt,_e,tt);Object.is(_e==null?void 0:_e.valueOf(),-0)?_e="-0":_e=String(_e);const et=nt[_e];return et===void 0?tt:et}}}function getWithPath(nt,_e,tt){if(_e.length===0)return tt;let et=nt;for(let rt=0;rt<_e.length;rt++){if(et==null)return tt;et=et[_e[rt]]}return et===void 0?tt:et}const IS_UNSIGNED_INTEGER=/^(?:0|[1-9]\d*)$/;function isIndex$1(nt,_e=Number.MAX_SAFE_INTEGER){switch(typeof nt){case"number":return Number.isInteger(nt)&&nt>=0&&nt<_e;case"symbol":return!1;case"string":return IS_UNSIGNED_INTEGER.test(nt)}}function set$1(nt,_e,tt){const et=Array.isArray(_e)?_e:typeof _e=="string"?toPath$1(_e):[_e];let rt=nt;for(let ot=0;ot<et.length-1;ot++){const at=et[ot],st=et[ot+1];rt[at]==null&&(rt[at]=isIndex$1(st)?[]:{}),rt=rt[at]}const it=et[et.length-1];return rt[it]=tt,nt}var react={exports:{}},react_production_min={};/**
710
+ サポートされているブラウザに切り替えてください。`,"unsupported-confirm":"OK"},"sprite-atlas":{title:"スプライトアトラス",adding:"追加中",success:"成功",error:"スプライトの追加に失敗しました"},"tree-shaking":{tip:"ツリーシェイキングは、プロジェクトファイルのサイズを削減するための効果的な機能です。パッケージング中にプロジェクトから不要なアセットをインテリジェントに削除することができます。",default:{title:"デフォルト",desc:"ツリーシェイキングなし。"},"current-scene":{title:"現在のシーン",desc:"現在のシーンのみツリーシェイクします。"},"all-scene":{title:"すべてのシーン",desc:"すべてのシーンをツリーシェイクします。"},title:"ツリーシェイキング"},"primitive-mesh":{title:"プリミティブメッシュ",type:{label:"タイプ",info:"作成するプリミティブメッシュのタイプ"},sphere:{radius:{label:"半径",info:"球体の半径"},step:{label:"ステップ",info:"球体を構築するために使用されるセグメントの数"}},capsule:{radius:{label:"半径",info:"カプセルの半径"},height:{label:"高さ",info:"カプセルの高さ"},"radial-segments":{label:"ラジアルセグメント",info:"カプセルの円周を囲むセグメント数"},"height-segments":{label:"高さセグメント",info:"カプセルの高さに沿ったセグメント数"}},cone:{radius:{label:"半径",info:"円錐の底面の半径"},height:{label:"高さ",info:"円錐の高さ"},"radial-segments":{label:"ラジアルセグメント",info:"円錐の円周を囲むセグメント数"},"height-segments":{label:"高さセグメント",info:"円錐の高さに沿ったセグメント数"}},cuboid:{width:{label:"幅",info:"直方体の幅"},height:{label:"高さ",info:"直方体の高さ"},depth:{label:"深さ",info:"直方体の深さ"}},cylinder:{"radius-top":{label:"上部半径",info:"円柱の上部の半径"},"radius-bottom":{label:"底部半径",info:"円柱の底部の半径"},height:{label:"高さ",info:"円柱の高さ"},"radial-segments":{label:"ラジアルセグメント",info:"円柱の円周を囲むセグメント数"},"height-segments":{label:"高さセグメント",info:"円柱の高さに沿ったセグメント数"}},plane:{width:{label:"幅",info:"平面の幅"},height:{label:"高さ",info:"平面の高さ"},"horizontal-segments":{label:"水平セグメント",info:"平面の幅に沿ったセグメント数"},"vertical-segments":{label:"垂直セグメント",info:"平面の高さに沿ったセグメント数"}},torus:{radius:{label:"半径",info:"トーラスの中心からチューブの中心への半径"},"tube-radius":{label:"チューブ半径",info:"トーラスのチューブの半径"},"radial-segments":{label:"ラジアルセグメント",info:"トーラスの円周を囲むセグメント数"},"tubular-segments":{label:"チューブラーセグメント",info:"チューブを囲むセグメント数"},arc:{label:"アーク",info:"トーラスセクションの中心角"}}},gltf:{title:"GlTF","basic-info":"基本情報",triangles:"三角形",drawcall:"ドローコール","compute-tangents":"タンジェントを計算","keep-mesh-data":"メッシュデータを保持","refresh-tip":"リフレッシュ後に有効",issues:"問題","remapped-materials":"再マッピングされた材料",compression:"圧縮",quantize:"量子化",meshopt:"メッシュオプティマイズ"},"select-asset":"アセットを選択...",filter:{all:"すべて"},folder:{title:"フォルダー"},shader:{title:"シェーダー"},material:{title:"材料"},script:{title:"スクリプト"},font:{title:"フォント"},"texture-cube":{title:"TextureCube"},"ambient-light":{title:"環境光"},"directional-light":{title:"指向性ライト"},"point-light":{title:"ポイントライト"},"spot-light":{title:"スポットライト"},sprite:{title:"スプライト"},"xr-reference-image":{title:"XRリファレンスイメージ"},"animator-controller":{title:"アニメーターコントローラー"},"animation-clip":{title:"アニメーションクリップ"},scene:{title:"シーン"},"physics-material":{title:"物理素材"},"render-target":{title:"レンダーターゲット"},"entity-script":{title:"エンティティスクリプト"},"state-machine-script":{title:"ステートマシンスクリプト"},"shader-chunk":{title:"シェーダーチャンク"},"shader-ui-script":{title:"シェーダーUIScript"},prefab:{title:"プレハブ"},audio:{title:"オーディオ"},mesh:{title:"メッシュ"},lottie:{title:"Lottie"},"spine-skeleton-data":{title:"Spineスケルトンデータ"},"spine-atlas":{title:"アトラス"},ktx2:{mode:{label:"モード",uastc:{label:"UASTC",desc:"UASTCはより良い品質を提供しますが、ファイルサイズが大きくなります"},etc1s:{label:"ETC1S",desc:"ETC1Sはより良い圧縮を提供しますが、品質が低くなります"}},quality:"品質"}},transform$2={position:{title:"位置",info:"3D空間内のエンティティの位置"},rotation:{title:"回転",info:"3D空間内のエンティティの回転角度"},scale:{title:"スケール",info:"3D空間内のエンティティのスケールファクター"},error:{"cant-disable":"トランスフォームコンポーネントを無効にできません","cant-delete":"トランスフォームコンポーネントを削除できません"}},light={color:"色","culling-mask":"カリングマスク",point:{distance:{label:"距離",info:"ポイントライトが照らす最大距離"}},shadow:{title:"影",type:{label:"タイプ",info:"影のタイプ",none:"なし",hard:"ハード",softlow:"ソフト低",softhigh:"ソフト高"},bias:{label:"バイアス",info:"影のアクネを防ぐための影バイアス"},"normal-bias":{label:"ノーマルバイアス",info:"影のアクネを防ぐためのノーマルバイアス"},"near-plane-offset":{label:"近クリップ面オフセット",info:"影の近クリップ面のオフセット"},strength:{label:"強度",info:"影の強度"}},spot:{distance:{label:"距離",info:"スポットライトが照らす最大距離"},angle:{label:"角度",info:"スポットライトの円錐の角度"},penumbra:{label:"ペンブラス",info:"スポットライトのペンブラス角度"}}},prefab={inspector:{"basic-info":"基本情報","dependent-assets":"依存アセット",url:"URL",missed:"失敗"},error:{"create-from-sub":"プレハブサブエンティティからプレハブを作成できません。"},delete:{title:"プレハブインスタンスを削除しますか?",description:"プレハブ '{{name}}' が削除されました。すべてのインスタンスを削除しますか?"},button:{no:"いいえ",yes:"はい"},replace:{title:"プレハブを置き換える",description:'プレハブ "{{name}}" を置き換えてもよろしいですか?すべてのプレハブインスタンスが置き換えられます',confirm:"それでも置き換える"}},community={title:"コミュニティ","all-projects":"すべてのプロジェクト","my-projects":"マイプロジェクト","all-projects-desc":"コミュニティで共有されているプロジェクトを探索","my-projects-desc":"コミュニティに公開したプロジェクト","search-placeholder":"コミュニティプロジェクトを検索...","no-projects":"コミュニティプロジェクトが見つかりません","no-my-projects":"まだプロジェクトを公開していません","publish-hint":"最初のプロジェクトを公開してコミュニティと共有しましょう","load-more":"さらに読み込む",loading:"読み込み中...","no-preview":"プレビューが利用できません",preview:"プレビュー",share:"共有",withdraw:"撤回",tags:"タグ",license:"ライセンス",stats:"統計",copyright:"著作権",views:"閲覧数",likes:"いいね",downloads:"ダウンロード","publish-success":"レビュー待ちに提出しました",publish:{title:"コミュニティに公開","published-at":"公開日","publish-button":"公開",agreement:"公開をクリックすることで、","more-options":"その他のオプション","community-guidelines":"コミュニティガイドライン"}},resourcePackage={export:"リソースパッケージとしてエクスポート","export-cdn":"CDN パッケージ","export-local":"ファイルパッケージ",import:"リソースパッケージをインポート","import-from-file":"ファイルから","import-from-url":"URL から","input-url":"GRP リソースパッケージの URL を入力",cancel:"キャンセル",confirm:"確認",exporting:"リソースパッケージをエクスポート中...",uploading:"リソースパッケージをアップロード中...",importing:"リソースパッケージをインポート中...","export-success":"リソースパッケージのエクスポートに成功しました","upload-success":"CDN URLがクリップボードにコピーされました","export-failed":"リソースパッケージのエクスポートに失敗しました","import-success":"リソースパッケージのインポートに成功しました","import-failed":"リソースパッケージのインポートに失敗しました","no-assets-selected":"エクスポートするアセットを選択してください","cant-export-sub-asset":"サブアセットはエクスポートできません",assets:"個のアセット"},ja$2={service,"code-editor":{"back-to-editor":"シーンエディターに戻る",preview:"プレビュー",devtools:{console:"コンソール",inspector:"インスペクター"},file:{"not-saved":"ファイルは保存されていません。","not-saved-description":"変更を破棄してもよろしいですか?保存されていない変更はすべて失われます。",cancel:"キャンセル",confirm:"確認",project:"プロジェクト"},"event-debug":{input:"入力",json:"JSON",clear:"クリア",confirm:"確認",events:"イベント",trigger:"トリガー","no-events":"プレビューからイベント信号を検出できません。"},"file-tree":{title:"アセット",search:{placeholder:"ファイルを検索..."}},library:{title:"依存関係",import:"インポート",search:{placeholder:"ライブラリ名"},version:{latest:"最新",updating:"更新中..."}},menubar:{file:{title:"ファイル","new-file":"新しいファイル","open-file":"ファイルを開く",save:"保存",close:"閉じる"},edit:{title:"編集",undo:"元に戻す",redo:"やり直す",find:{title:"検索...",find:"検索",replace:"置換"},cut:"切り取り",copy:"コピー",paste:"貼り付け"},view:{title:"表示","show-minimap":"ミニマップを表示","new-tab":"新しいタブ","close-tab":"タブを閉じる",share:"共有",print:"印刷"},help:{title:"ヘルプ",documentation:"ドキュメント","shaderlab-syntax":"Shaderlab構文",about:"について"}},monaco:{loading:"読み込み中..."},"preview-inspector":{title:"インスペクター"},"preview-toolbar":{"open-in-new-tab":"新しいタブで開く","toggle-orientation":"向きを切り替える","toggle-lock":"ロックを切り替える",refresh:"更新",close:"閉じる"}},shortcuts,project,member,setting,snapshot,export:{"copied-to-clipboard":"クリップボードにコピーしました",auto:"自動","playing-options":{title:"プレイオプション","loading-ui":"ローディングUI","orbit-control":"軌道制御",enable:"有効",disabled:"無効"},"main-scene":"メインシーン",default:"デフォルト","current-scene":"現在のシーン","all-scene":"すべてのシーン",fixed:"固定","required-external-components":"必要な外部コンポーネント",rendering:"レンダリング","webgl-mode":"WebGLモード",alpha:"アルファを使用","preserve-drawing-buffer":"描画バッファを保存",dpr:{label:"デバイスピクセル比モード",fixed:"固定",auto:"自動"},update:"更新",publish:"公開","publish-success":{title:"公開成功",description:"おめでとうございます!初回プロジェクトの公開が完了しました。他の人と共有できるようになりました。","got-it":"了解"},"public-url-generated":"公開URLが生成されました","download-project-json":"Project.jsonをダウンロード","update-public-url":"公開URLを更新","generate-public-url":"公開URLを生成","platform-setting":"プラットフォーム設定","copy-url":"URLをコピー",scenes:"シーン",download:"ダウンロード",orientation:"向き",portrait:"縦向き",landscape:"横向き","network-timeout":"ネットワークタイムアウト",request:"リクエスト","connect-socket":"ソケットに接続","upload-file":"ファイルをアップロード","download-file":"ファイルをダウンロード","web-project":"Webプロジェクト",vanilla:"Vanilla JS",react:"React",vue:"Vue",framework:"フレームワーク","package-to-zip":"Zipにパッケージ","public-url-publish":"Webに公開","export-as-react-project":"Reactプロジェクトとしてエクスポート","export-as-vue-project":"Vueプロジェクトとしてエクスポート","public-url":"公開URL","shader-and-publish":"シェーダーと公開","wechat-mini-game":"Wechatミニゲーム","publish-to-wechat":"Wechatに公開","tiktok-mini-game":"TikTokミニゲーム","publish-to-tiktok":"TikTokに公開","project-url":"プロジェクトURLを取得","subpackage-setting":"サブパッケージリスト","subpackage-list":"サブパッケージリスト","subpackage-add":"サブパッケージを追加","subpackage-index":"サブパッケージ","subpackage-empty":"リストは空です","subpackage-folder":"サブパッケージディレクトリ","subpackage-holder":"サブパッケージとしてディレクトリを選択","subpackage-info":"選択したディレクトリはサブパッケージとして使用されます。このディレクトリ内のスクリプト以外のすべてのアセットはサブパッケージにエクスポートされます","subpackage-conflict":"既存のサブパッケージと競合します。競合するサブパッケージは次のとおりです: サブパッケージ "},plugin,hierarchy,inspector,menu,viewport:viewport$1,effects,trail,texture,ui:ui$2,xr,homepage,user,layout,sandbox,entity,component,"skinned-mesh-renderer":{title:"スキンメッシュレンダラー","local-bounds":{title:"ローカル境界",info:"スキンドスケルタルレンダラーのローカル空間境界ボックス",min:{label:"最小",info:"ローカル境界ボックスの最小点"},max:{label:"最大",info:"ローカル境界ボックスの最大点"}},skin:{title:"スキン","root-bone":{label:"ルートボーン",info:"スキンメッシュレンダラーのルートボーン"},bones:{label:"ボーン",info:"ボーンの数"}}},"mesh-renderer":{material:{title:"材料",info:"メッシュレンダラーが使用する材料",thumbnail:"材料サムネイル"},mesh:{title:"メッシュ",info:"レンダリングするメッシュ"},"receive-shadows":{title:"影を受け取る",info:"メッシュが影を受け取るかどうか"},"cast-shadows":{title:"影を投げる",info:"メッシュが影を投げるかどうか"},priority:{title:"優先度",info:"レンダリングの優先度"}},script,scene,"post-process":{global:{title:"グローバル",info:"ポストプロセスがグローバルであるかどうかを示します。ローカルモードはコライダーコンポーネントと一緒に使用する必要があります。"},"blend-distance":{title:"ブレンド距離",info:"ブレンドを開始する外部距離。"},priority:{title:"優先度",info:"ポストプロセスがシーンに等しい影響度を持つ場合、どのポストプロセスが使用されるかを決定します。"},layer:{title:"レイヤー",info:"ポストプロセスが属するレイヤーで、カメラのポストプロセスマスクと一緒に使用できます"},effects:{options:{half:"半分",quarter:"四分の一",neutral:"ニュートラル",aces:"ACES(アカデミーカラーエンコーディングシステム)"},bloom:{title:"ブルーム","high-quality-filtering":{label:"高品質フィルタリング",info:"高品質フィルタリングを有効にする"},scatter:{label:"スキャッター",info:"ブルームエフェクトの半径を設定します"},"down-scale":{label:"ダウンスケール",info:"このエフェクトが処理を開始する解像度を制御します"},threshold:{label:"しきい値",info:"この明るさレベル以下のピクセルをフィルタリングします。値はガンマ空間で指定されます"},intensity:{label:"強度",info:"ブルームエフェクトの強さ"},tint:{label:"色調",info:"ブルームエフェクトの色調"},"dirt-texture":{label:"汚れのテクスチャ",info:"ブルームエフェクトに汚れやほこりを追加する汚れのテクスチャ"},"dirt-intensity":{label:"汚れの強度",info:"汚れのテクスチャの強さ"}},"tone-mapping":{title:"トーンマッピング",mode:{label:"モード",info:"トーンマッピングモード、`Neutral`モードは、色相と彩度への影響を最小限に抑えながら範囲リマッピングだけを希望する状況に特に適しています。`ACES`モードは長編映画用のACES参照カラー空間を使用し、シネマティックでコントラストのある結果を生み出しますが、より多くのパフォーマンスが必要です"}},title:"ポストエフェクト",add:"エフェクトを追加"}},camera,physics,shader,sprite,"text-renderer":{text:{label:"テキスト",info:"表示するテキストコンテンツ"},color:{label:"色",info:"テキストの色"},"font-size":{label:"フォントサイズ",info:"テキストフォントのサイズ"},font:{label:"フォント",info:"テキストのレンダリングに使用するフォントアセット"},width:{label:"幅",info:"テキストレンダラーの幅"},height:{label:"高さ",info:"テキストレンダラーの高さ"},"line-spacing":{label:"行間隔",info:"テキストの行間隔"},"font-style":{label:"フォントスタイル",info:"フォントのスタイル(太字、イタリック)"},"horizontal-alignment":{label:"水平配置",info:"テキストの水平配置"},"vertical-alignment":{label:"垂直配置",info:"テキストの垂直配置"},"enable-wrapping":{label:"折り返しを有効にする",info:"テキストの折り返しを有効にするかどうか"},"overflow-mode":{label:"オーバーフローモード",info:"コンテナをオーバーフローするテキストをどのように処理するか",overflow:"オーバーフロー",truncate:"切り詰め"},"mask-interaction":{label:"マスクとの相互作用",info:"このテキストレンダラーがスプライトマスクとどのように相互作用するか",none:"なし","visible-inside":"マスク内で可視","visible-outside":"マスク外で可視"},"mask-layer":{label:"マスクレイヤー",info:"このテキストレンダラーが属するマスクレイヤー",everything:"すべて",nothing:"なし",layer0:"レイヤー0",layer1:"レイヤー1",layer2:"レイヤー2",layer3:"レイヤー3",layer4:"レイヤー4",layer5:"レイヤー5",layer6:"レイヤー6",layer7:"レイヤー7",layer8:"レイヤー8"},priority:{label:"優先度",info:"テキストレンダラーのレンダリング優先度"}},lottie,spine,animation,asset:asset$1,transform:transform$2,light,prefab,"ai-panel":{"remaining-times":"残りの回数","image-to-3d":"画像から3Dモデルを生成","upload-description":"画像をアップロードして3Dモデルを生成","ai-generated":"すべてのモデルはAIによって生成されました",retry:"再試行",view:"表示",generate:"生成",upload:{error:"PNG、JPG、JPEGファイルのみサポートされています。","drag-drop":"画像をドラッグまたはクリックしてアップロード","supported-formats":"サポートされているフォーマット:PNG、JPG、JPEG"},pagination:{previous:"前へ",next:"次へ","page-info":"ページ {{current}} / {{total}}"},history:"履歴","generate-error":"モデルの生成に失敗しました,しばらくしてから再試行してください",use:"使用","add-success":"資産パネルに正常に追加されました","add-error":"追加に失敗しました。しばらくしてから再試行してください","fetch-error":"モデルリストの読み込みに失敗しました。しばらくしてから再試行してください",waiting:"{{queuePosition}} 人待っています"},community,resourcePackage},localStorageLanguage="__language__";instance.use(initReactI18next).init({resources:{en:{translation:en},zh:{translation:zh$2},ja:{translation:ja$2}},lng:typeof localStorage<"u"?localStorage.getItem(localStorageLanguage):void 0,fallbackLng:"en",interpolation:{escapeValue:!1}});const{t:t$8}=instance;let editorUiModulePromise=null;function loadEditorUiModule(){return editorUiModulePromise??(editorUiModulePromise=__vitePreload(()=>import("./index-b731a7fe.js"),["_static/index-b731a7fe.js","_static/IconEdit-493cbbb3.js","_static/index-8800c7e6.js","_static/Menu-d694f08a.js","_static/Accordion-4581466b.js","_static/Callout-a96a8430.js","_static/Tooltip-c35612f0.js"])),editorUiModulePromise}function showEditorUiAlert(nt){loadEditorUiModule().then(({showAlert:_e})=>{_e(nt)})}function showEditorUiToastSuccess(nt){loadEditorUiModule().then(({toast:_e})=>{_e.success(nt)})}function showEditorUiToastError(nt){loadEditorUiModule().then(({toast:_e})=>{_e.error(nt)})}async function runWithEditorUiToastPromise(nt,_e){const{toast:tt}=await loadEditorUiModule();return tt.promise(nt,_e)}function showComponentAlert(nt){showEditorUiAlert(nt)}function showComponentToastError(nt){showEditorUiToastError(nt)}var eventemitter3={exports:{}};(function(nt){var _e=Object.prototype.hasOwnProperty,tt="~";function et(){}Object.create&&(et.prototype=Object.create(null),new et().__proto__||(tt=!1));function rt(st,ct,ut){this.fn=st,this.context=ct,this.once=ut||!1}function it(st,ct,ut,dt,ht){if(typeof ut!="function")throw new TypeError("The listener must be a function");var ft=new rt(ut,dt||st,ht),pt=tt?tt+ct:ct;return st._events[pt]?st._events[pt].fn?st._events[pt]=[st._events[pt],ft]:st._events[pt].push(ft):(st._events[pt]=ft,st._eventsCount++),st}function ot(st,ct){--st._eventsCount===0?st._events=new et:delete st._events[ct]}function at(){this._events=new et,this._eventsCount=0}at.prototype.eventNames=function(){var ct=[],ut,dt;if(this._eventsCount===0)return ct;for(dt in ut=this._events)_e.call(ut,dt)&&ct.push(tt?dt.slice(1):dt);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(ut)):ct},at.prototype.listeners=function(ct){var ut=tt?tt+ct:ct,dt=this._events[ut];if(!dt)return[];if(dt.fn)return[dt.fn];for(var ht=0,ft=dt.length,pt=new Array(ft);ht<ft;ht++)pt[ht]=dt[ht].fn;return pt},at.prototype.listenerCount=function(ct){var ut=tt?tt+ct:ct,dt=this._events[ut];return dt?dt.fn?1:dt.length:0},at.prototype.emit=function(ct,ut,dt,ht,ft,pt){var mt=tt?tt+ct:ct;if(!this._events[mt])return!1;var vt=this._events[mt],_t=arguments.length,yt,bt;if(vt.fn){switch(vt.once&&this.removeListener(ct,vt.fn,void 0,!0),_t){case 1:return vt.fn.call(vt.context),!0;case 2:return vt.fn.call(vt.context,ut),!0;case 3:return vt.fn.call(vt.context,ut,dt),!0;case 4:return vt.fn.call(vt.context,ut,dt,ht),!0;case 5:return vt.fn.call(vt.context,ut,dt,ht,ft),!0;case 6:return vt.fn.call(vt.context,ut,dt,ht,ft,pt),!0}for(bt=1,yt=new Array(_t-1);bt<_t;bt++)yt[bt-1]=arguments[bt];vt.fn.apply(vt.context,yt)}else{var St=vt.length,xt;for(bt=0;bt<St;bt++)switch(vt[bt].once&&this.removeListener(ct,vt[bt].fn,void 0,!0),_t){case 1:vt[bt].fn.call(vt[bt].context);break;case 2:vt[bt].fn.call(vt[bt].context,ut);break;case 3:vt[bt].fn.call(vt[bt].context,ut,dt);break;case 4:vt[bt].fn.call(vt[bt].context,ut,dt,ht);break;default:if(!yt)for(xt=1,yt=new Array(_t-1);xt<_t;xt++)yt[xt-1]=arguments[xt];vt[bt].fn.apply(vt[bt].context,yt)}}return!0},at.prototype.on=function(ct,ut,dt){return it(this,ct,ut,dt,!1)},at.prototype.once=function(ct,ut,dt){return it(this,ct,ut,dt,!0)},at.prototype.removeListener=function(ct,ut,dt,ht){var ft=tt?tt+ct:ct;if(!this._events[ft])return this;if(!ut)return ot(this,ft),this;var pt=this._events[ft];if(pt.fn)pt.fn===ut&&(!ht||pt.once)&&(!dt||pt.context===dt)&&ot(this,ft);else{for(var mt=0,vt=[],_t=pt.length;mt<_t;mt++)(pt[mt].fn!==ut||ht&&!pt[mt].once||dt&&pt[mt].context!==dt)&&vt.push(pt[mt]);vt.length?this._events[ft]=vt.length===1?vt[0]:vt:ot(this,ft)}return this},at.prototype.removeAllListeners=function(ct){var ut;return ct?(ut=tt?tt+ct:ct,this._events[ut]&&ot(this,ut)):(this._events=new et,this._eventsCount=0),this},at.prototype.off=at.prototype.removeListener,at.prototype.addListener=at.prototype.on,at.prefixed=tt,at.EventEmitter=at,nt.exports=at})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class MessageCenterImpl extends EventEmitter{dispatch(_e,...tt){this.emit(_e,...tt)}}const MessageCenter=new MessageCenterImpl;function hasProp$1(nt,_e){return Object.prototype.hasOwnProperty.call(nt,_e)}function addHiddenProp$1(nt,_e,tt){Object.defineProperty(nt,_e,{enumerable:!1,writable:!0,configurable:!0,value:tt})}function isDeepKey(nt){switch(typeof nt){case"number":case"symbol":return!1;case"string":return nt.includes(".")||nt.includes("[")||nt.includes("]")}}function toKey$1(nt){return Object.is(nt,-0)?"-0":nt.toString()}function toPath$1(nt){const _e=[],tt=nt.length;if(tt===0)return _e;let et=0,rt="",it="",ot=!1;for(nt.charCodeAt(0)===46&&(_e.push(""),et++);et<tt;){const at=nt[et];it?at==="\\"&&et+1<tt?(et++,rt+=nt[et]):at===it?it="":rt+=at:ot?at==='"'||at==="'"?it=at:at==="]"?(ot=!1,_e.push(rt),rt=""):rt+=at:at==="["?(ot=!0,rt&&(_e.push(rt),rt="")):at==="."?rt&&(_e.push(rt),rt=""):rt+=at,et++}return rt&&_e.push(rt),_e}function get$3(nt,_e,tt){if(nt==null)return tt;switch(typeof _e){case"string":{const et=nt[_e];return et===void 0?isDeepKey(_e)?get$3(nt,toPath$1(_e),tt):tt:et}case"number":case"symbol":{typeof _e=="number"&&(_e=toKey$1(_e));const et=nt[_e];return et===void 0?tt:et}default:{if(Array.isArray(_e))return getWithPath(nt,_e,tt);Object.is(_e==null?void 0:_e.valueOf(),-0)?_e="-0":_e=String(_e);const et=nt[_e];return et===void 0?tt:et}}}function getWithPath(nt,_e,tt){if(_e.length===0)return tt;let et=nt;for(let rt=0;rt<_e.length;rt++){if(et==null)return tt;et=et[_e[rt]]}return et===void 0?tt:et}const IS_UNSIGNED_INTEGER=/^(?:0|[1-9]\d*)$/;function isIndex$1(nt,_e=Number.MAX_SAFE_INTEGER){switch(typeof nt){case"number":return Number.isInteger(nt)&&nt>=0&&nt<_e;case"symbol":return!1;case"string":return IS_UNSIGNED_INTEGER.test(nt)}}function set$1(nt,_e,tt){const et=Array.isArray(_e)?_e:typeof _e=="string"?toPath$1(_e):[_e];let rt=nt;for(let ot=0;ot<et.length-1;ot++){const at=et[ot],st=et[ot+1];rt[at]==null&&(rt[at]=isIndex$1(st)?[]:{}),rt=rt[at]}const it=et[et.length-1];return rt[it]=tt,nt}var react={exports:{}},react_production_min={};/**
711
711
  * @license React
712
712
  * react.production.min.js
713
713
  *
@@ -11484,4 +11484,4 @@ void main() {
11484
11484
  `)}return it.push("}"),it.join(`
11485
11485
  `)}}class DropInfo{constructor(_e,tt,et,rt,it){__publicField(this,"node"),__publicField(this,"rect"),__publicField(this,"location"),__publicField(this,"index"),__publicField(this,"className"),this.node=_e,this.rect=tt,this.location=et,this.index=rt,this.className=it}}class BorderSet{constructor(_e){__publicField(this,"borders"),__publicField(this,"borderMap"),__publicField(this,"layoutHorizontal"),this.borders=[],this.borderMap=new Map,this.layoutHorizontal=!0}static fromJson(_e,tt){const et=new BorderSet(tt);et.borders=_e.map(rt=>BorderNode.fromJson(rt,tt));for(const rt of et.borders)et.borderMap.set(rt.getLocation(),rt);return et}toJson(){return this.borders.map(_e=>_e.toJson())}getLayoutHorizontal(){return this.layoutHorizontal}getBorders(){return this.borders}getBorderMap(){return this.borderMap}forEachNode(_e){for(const tt of this.borders){_e(tt,0);for(const et of tt.getChildren())et.forEachNode(_e,1)}}setPaths(){for(const _e of this.borders){const tt="/border/"+_e.getLocation().getName();_e.setPath(tt);let et=0;for(const rt of _e.getChildren())rt.setPath(tt+"/t"+et),et++}}findDropTargetNode(_e,tt,et){for(const rt of this.borders)if(rt.isShowing()){const it=rt.canDrop(_e,tt,et);if(it!==void 0)return it}}}let Node$1=class{constructor(_e){__publicField(this,"model"),__publicField(this,"attributes"),__publicField(this,"parent"),__publicField(this,"children"),__publicField(this,"rect"),__publicField(this,"path"),__publicField(this,"listeners"),this.model=_e,this.attributes={},this.children=[],this.rect=Rect.empty(),this.listeners=new Map,this.path=""}getId(){let _e=this.attributes.id;return _e!==void 0||(_e=this.model.nextUniqueId(),this.setId(_e)),_e}getModel(){return this.model}getType(){return this.attributes.type}getParent(){return this.parent}getChildren(){return this.children}getRect(){return this.rect}getPath(){return this.path}getOrientation(){return this.parent===void 0?this.model.isRootOrientationVertical()?Orientation.VERT:Orientation.HORZ:Orientation.flip(this.parent.getOrientation())}setEventListener(_e,tt){this.listeners.set(_e,tt)}removeEventListener(_e){this.listeners.delete(_e)}setId(_e){this.attributes.id=_e}fireEvent(_e,tt){this.listeners.has(_e)&&this.listeners.get(_e)(tt)}getAttr(_e){let tt=this.attributes[_e];if(tt===void 0){const et=this.getAttributeDefinitions().getModelName(_e);et!==void 0&&(tt=this.model.getAttribute(et))}return tt}forEachNode(_e,tt){_e(this,tt),tt++;for(const et of this.children)et.forEachNode(_e,tt)}setPaths(_e){let tt=0;for(const et of this.children){let rt=_e;et.getType()==="row"?rt+="/r"+tt:et.getType()==="tabset"?rt+="/ts"+tt:et.getType()==="tab"&&(rt+="/t"+tt),et.path=rt,et.setPaths(rt),tt++}}setParent(_e){this.parent=_e}setRect(_e){this.rect=_e}setPath(_e){this.path=_e}setWeight(_e){this.attributes.weight=_e}setSelected(_e){this.attributes.selected=_e}findDropTargetNode(_e,tt,et,rt){let it;if(this.rect.contains(et,rt)){if(this.model.getMaximizedTabset(_e)!==void 0)it=this.model.getMaximizedTabset(_e).canDrop(tt,et,rt);else if(it=this.canDrop(tt,et,rt),it===void 0&&this.children.length!==0){for(const ot of this.children)if(it=ot.findDropTargetNode(_e,tt,et,rt),it!==void 0)break}}return it}canDrop(_e,tt,et){}canDockInto(_e,tt){if(tt!=null){if(tt.location===DockLocation.CENTER&&tt.node.isEnableDrop()===!1||tt.location===DockLocation.CENTER&&_e.getType()==="tabset"&&_e.getName()!==void 0||tt.location!==DockLocation.CENTER&&tt.node.isEnableDivide()===!1)return!1;if(this.model.getOnAllowDrop())return this.model.getOnAllowDrop()(_e,tt)}return!0}removeChild(_e){const tt=this.children.indexOf(_e);return tt!==-1&&this.children.splice(tt,1),tt}addChild(_e,tt){return tt!=null?this.children.splice(tt,0,_e):(this.children.push(_e),tt=this.children.length-1),_e.parent=this,tt}removeAll(){this.children=[]}styleWithPosition(_e){return _e==null&&(_e={}),this.rect.styleWithPosition(_e)}isEnableDivide(){return!0}toAttributeString(){return JSON.stringify(this.attributes,void 0," ")}};const _TabNode=class kr extends Node$1{constructor(_e,tt,et=!0){super(_e),__publicField(this,"tabRect",Rect.empty()),__publicField(this,"moveableElement"),__publicField(this,"tabStamp"),__publicField(this,"renderedName"),__publicField(this,"extra"),__publicField(this,"visible"),__publicField(this,"rendered"),__publicField(this,"scrollTop"),__publicField(this,"scrollLeft"),this.extra={},this.moveableElement=null,this.tabStamp=null,this.rendered=!1,this.visible=!1,kr.attributeDefinitions.fromJson(tt,this.attributes),et===!0&&_e.addNode(this)}static fromJson(_e,tt,et=!0){return new kr(tt,_e,et)}getName(){return this.getAttr("name")}getHelpText(){return this.getAttr("helpText")}getComponent(){return this.getAttr("component")}getWindowId(){return this.parent instanceof TabSetNode?this.parent.getWindowId():Model.MAIN_WINDOW_ID}getWindow(){const _e=this.model.getwindowsMap().get(this.getWindowId());if(_e)return _e.window}getConfig(){return this.attributes.config}getExtraData(){return this.extra}isPoppedOut(){return this.getWindowId()!==Model.MAIN_WINDOW_ID}isSelected(){return this.getParent().getSelectedNode()===this}getIcon(){return this.getAttr("icon")}isEnableClose(){return this.getAttr("enableClose")}getCloseType(){return this.getAttr("closeType")}isEnablePopout(){return this.getAttr("enablePopout")}isEnablePopoutIcon(){return this.getAttr("enablePopoutIcon")}isEnablePopoutOverlay(){return this.getAttr("enablePopoutOverlay")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableRename(){return this.getAttr("enableRename")}isEnableWindowReMount(){return this.getAttr("enableWindowReMount")}getClassName(){return this.getAttr("className")}getContentClassName(){return this.getAttr("contentClassName")}getTabSetClassName(){return this.getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this.getAttr("enableRenderOnDemand")}getMinWidth(){return this.getAttr("minWidth")}getMinHeight(){return this.getAttr("minHeight")}getMaxWidth(){return this.getAttr("maxWidth")}getMaxHeight(){return this.getAttr("maxHeight")}isVisible(){return this.visible}toJson(){const _e={};return kr.attributeDefinitions.toJson(_e,this.attributes),_e}saveScrollPosition(){this.moveableElement&&(this.scrollLeft=this.moveableElement.scrollLeft,this.scrollTop=this.moveableElement.scrollTop)}restoreScrollPosition(){this.scrollTop&&requestAnimationFrame(()=>{this.moveableElement&&this.scrollTop&&(this.moveableElement.scrollTop=this.scrollTop,this.moveableElement.scrollLeft=this.scrollLeft)})}setRect(_e){_e.equals(this.rect)||(this.fireEvent("resize",{rect:_e}),this.rect=_e)}setVisible(_e){_e!==this.visible&&(this.visible=_e,this.fireEvent("visibility",{visible:_e}))}getScrollTop(){return this.scrollTop}setScrollTop(_e){this.scrollTop=_e}getScrollLeft(){return this.scrollLeft}setScrollLeft(_e){this.scrollLeft=_e}isRendered(){return this.rendered}setRendered(_e){this.rendered=_e}getTabRect(){return this.tabRect}setTabRect(_e){this.tabRect=_e}getTabStamp(){return this.tabStamp}setTabStamp(_e){this.tabStamp=_e}getMoveableElement(){return this.moveableElement}setMoveableElement(_e){this.moveableElement=_e}setRenderedName(_e){this.renderedName=_e}getNameForOverflowMenu(){const _e=this.getAttr("altName");return _e!==void 0?_e:this.renderedName}setName(_e){this.attributes.name=_e}delete(){this.parent.remove(this),this.fireEvent("close",{})}updateAttrs(_e){kr.attributeDefinitions.update(_e,this.attributes)}getAttributeDefinitions(){return kr.attributeDefinitions}setBorderWidth(_e){this.attributes.borderWidth=_e}setBorderHeight(_e){this.attributes.borderHeight=_e}static getAttributeDefinitions(){return kr.attributeDefinitions}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("type",kr.TYPE,!0).setType(Attribute.STRING).setFixed(),_e.add("id",void 0).setType(Attribute.STRING).setDescription("the unique id of the tab, if left undefined a uuid will be assigned"),_e.add("name","[Unnamed Tab]").setType(Attribute.STRING).setDescription("name of tab to be displayed in the tab button"),_e.add("altName",void 0).setType(Attribute.STRING).setDescription("if there is no name specifed then this value will be used in the overflow menu"),_e.add("helpText",void 0).setType(Attribute.STRING).setDescription("An optional help text for the tab to be displayed upon tab hover."),_e.add("component",void 0).setType(Attribute.STRING).setDescription("string identifying which component to run (for factory)"),_e.add("config",void 0).setType("any").setDescription("a place to hold json config for the hosted component"),_e.add("tabsetClassName",void 0).setType(Attribute.STRING).setDescription("class applied to parent tabset when this is the only tab and it is stretched to fill the tabset"),_e.add("enableWindowReMount",!1).setType(Attribute.BOOLEAN).setDescription("if enabled the tab will re-mount when popped out/in"),_e.addInherited("enableClose","tabEnableClose").setType(Attribute.BOOLEAN).setDescription("allow user to close tab via close button"),_e.addInherited("closeType","tabCloseType").setType("ICloseType").setDescription("see values in ICloseType"),_e.addInherited("enableDrag","tabEnableDrag").setType(Attribute.BOOLEAN).setDescription("allow user to drag tab to new location"),_e.addInherited("enableRename","tabEnableRename").setType(Attribute.BOOLEAN).setDescription("allow user to rename tabs by double clicking"),_e.addInherited("className","tabClassName").setType(Attribute.STRING).setDescription("class applied to tab button"),_e.addInherited("contentClassName","tabContentClassName").setType(Attribute.STRING).setDescription("class applied to tab content"),_e.addInherited("icon","tabIcon").setType(Attribute.STRING).setDescription("the tab icon"),_e.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(Attribute.BOOLEAN).setDescription("whether to avoid rendering component until tab is visible"),_e.addInherited("enablePopout","tabEnablePopout").setType(Attribute.BOOLEAN).setAlias("enableFloat").setDescription("enable popout (in popout capable browser)"),_e.addInherited("enablePopoutIcon","tabEnablePopoutIcon").setType(Attribute.BOOLEAN).setDescription("whether to show the popout icon in the tabset header if this tab enables popouts"),_e.addInherited("enablePopoutOverlay","tabEnablePopoutOverlay").setType(Attribute.BOOLEAN).setDescription(`if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
11486
11486
  then enabling this option will gray out this tab`),_e.addInherited("borderWidth","tabBorderWidth").setType(Attribute.NUMBER).setDescription("width when added to border, -1 will use border size"),_e.addInherited("borderHeight","tabBorderHeight").setType(Attribute.NUMBER).setDescription("height when added to border, -1 will use border size"),_e.addInherited("minWidth","tabMinWidth").setType(Attribute.NUMBER).setDescription("the min width of this tab"),_e.addInherited("minHeight","tabMinHeight").setType(Attribute.NUMBER).setDescription("the min height of this tab"),_e.addInherited("maxWidth","tabMaxWidth").setType(Attribute.NUMBER).setDescription("the max width of this tab"),_e.addInherited("maxHeight","tabMaxHeight").setType(Attribute.NUMBER).setDescription("the max height of this tab"),_e}};__publicField(_TabNode,"TYPE","tab");__publicField(_TabNode,"attributeDefinitions",_TabNode.createAttributeDefinitions());let TabNode=_TabNode;function isDesktop(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches}function getRenderStateEx(nt,_e,tt){let et;const rt=_e.getName(),it=_e.getName();tt===void 0&&(tt=0),et===void 0&&_e.getIcon()!==void 0&&(tt!==0?et=jsxRuntimeExports.jsx("img",{style:{width:"1em",height:"1em",transform:"rotate("+tt+"deg)"},src:_e.getIcon(),alt:"leadingContent"}):et=jsxRuntimeExports.jsx("img",{style:{width:"1em",height:"1em"},src:_e.getIcon(),alt:"leadingContent"}));const at={leading:et,content:rt,name:it,buttons:[]};return nt.customizeTab(_e,at),_e.setRenderedName(at.name),at}function isAuxMouseEvent(nt){let _e=!1;return nt.nativeEvent instanceof MouseEvent&&(nt.nativeEvent.button!==0||nt.ctrlKey||nt.altKey||nt.metaKey||nt.shiftKey)&&(_e=!0),_e}function enablePointerOnIFrames(nt,_e){const tt=[...getElementsByTagName("iframe",_e),...getElementsByTagName("webview",_e)];for(const et of tt)et.style.pointerEvents=nt?"auto":"none"}function getElementsByTagName(nt,_e){return[..._e.getElementsByTagName(nt)]}function startDrag(nt,_e,tt,et,rt){_e.preventDefault();const it=st=>{st.preventDefault(),tt(st.clientX,st.clientY)},ot=st=>{st.preventDefault(),rt()},at=()=>{nt.removeEventListener("pointermove",it),nt.removeEventListener("pointerup",at),nt.removeEventListener("pointercancel",ot),et()};nt.addEventListener("pointermove",it),nt.addEventListener("pointerup",at),nt.addEventListener("pointercancel",ot)}function canDockToWindow(nt){if(nt instanceof TabNode)return nt.isEnablePopout();if(nt instanceof TabSetNode){for(const _e of nt.getChildren())if(_e.isEnablePopout()===!1)return!1;return!0}return!1}function copyInlineStyles(nt,_e){const tt=nt.getAttribute("style"),et=_e.getAttribute("style");return tt===et?!1:(tt?_e.setAttribute("style",tt):_e.removeAttribute("style"),!0)}function isSafari(){const nt=navigator.userAgent;return nt.includes("Safari")&&!nt.includes("Chrome")&&!nt.includes("Chromium")}function adjustSelectedIndex(nt,_e){if(nt!==void 0&&(nt instanceof TabSetNode||nt instanceof BorderNode)){const tt=nt.getSelected();tt!==-1&&(_e===tt&&nt.getChildren().length>0?_e>=nt.getChildren().length&&nt.setSelected(nt.getChildren().length-1):_e<tt?nt.setSelected(tt-1):_e>tt||nt.setSelected(-1))}}function randomUUID(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,nt=>(nt^crypto.getRandomValues(new Uint8Array(1))[0]&15>>nt/4).toString(16))}const _TabSetNode=class Rr extends Node$1{constructor(_e,tt){super(_e),__publicField(this,"tabStripRect",Rect.empty()),__publicField(this,"contentRect",Rect.empty()),__publicField(this,"calculatedMinHeight"),__publicField(this,"calculatedMinWidth"),__publicField(this,"calculatedMaxHeight"),__publicField(this,"calculatedMaxWidth"),this.calculatedMinHeight=0,this.calculatedMinWidth=0,this.calculatedMaxHeight=0,this.calculatedMaxWidth=0,Rr.attributeDefinitions.fromJson(tt,this.attributes),_e.addNode(this)}static fromJson(_e,tt,et){const rt=new Rr(tt,_e);if(_e.children!=null)for(const it of _e.children){const ot=TabNode.fromJson(it,tt);rt.addChild(ot)}return rt.children.length===0&&rt.setSelected(-1),_e.maximized&&_e.maximized===!0&&(et.maximizedTabSet=rt),_e.active&&_e.active===!0&&(et.activeTabSet=rt),rt}getName(){return this.getAttr("name")}isEnableActiveIcon(){return this.getAttr("enableActiveIcon")}getSelected(){const _e=this.attributes.selected;return _e!==void 0?_e:-1}getSelectedNode(){const _e=this.getSelected();if(_e!==-1)return this.children[_e]}getWeight(){return this.getAttr("weight")}getAttrMinWidth(){return this.getAttr("minWidth")}getAttrMinHeight(){return this.getAttr("minHeight")}getMinWidth(){return this.calculatedMinWidth}getMinHeight(){return this.calculatedMinHeight}getMinSize(_e){return _e===Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getAttrMaxWidth(){return this.getAttr("maxWidth")}getAttrMaxHeight(){return this.getAttr("maxHeight")}getMaxWidth(){return this.calculatedMaxWidth}getMaxHeight(){return this.calculatedMaxHeight}getMaxSize(_e){return _e===Orientation.HORZ?this.getMaxWidth():this.getMaxHeight()}getConfig(){return this.attributes.config}isMaximized(){return this.model.getMaximizedTabset(this.getWindowId())===this}isActive(){return this.model.getActiveTabset(this.getWindowId())===this}isEnableDeleteWhenEmpty(){return this.getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this.getAttr("enableDrop")}isEnableTabWrap(){return this.getAttr("enableTabWrap")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableDivide(){return this.getAttr("enableDivide")}isEnableMaximize(){return this.getAttr("enableMaximize")}isEnableClose(){return this.getAttr("enableClose")}isEnableSingleTabStretch(){return this.getAttr("enableSingleTabStretch")}isEnableTabStrip(){return this.getAttr("enableTabStrip")}isAutoSelectTab(){return this.getAttr("autoSelectTab")}isEnableTabScrollbar(){return this.getAttr("enableTabScrollbar")}getClassNameTabStrip(){return this.getAttr("classNameTabStrip")}getTabLocation(){return this.getAttr("tabLocation")}toJson(){const _e={};return Rr.attributeDefinitions.toJson(_e,this.attributes),_e.children=this.children.map(tt=>tt.toJson()),this.isActive()&&(_e.active=!0),this.isMaximized()&&(_e.maximized=!0),_e}calcMinMaxSize(){this.calculatedMinHeight=this.getAttrMinHeight(),this.calculatedMinWidth=this.getAttrMinWidth(),this.calculatedMaxHeight=this.getAttrMaxHeight(),this.calculatedMaxWidth=this.getAttrMaxWidth();for(const _e of this.children){const tt=_e;this.calculatedMinWidth=Math.max(this.calculatedMinWidth,tt.getMinWidth()),this.calculatedMinHeight=Math.max(this.calculatedMinHeight,tt.getMinHeight()),this.calculatedMaxWidth=Math.min(this.calculatedMaxWidth,tt.getMaxWidth()),this.calculatedMaxHeight=Math.min(this.calculatedMaxHeight,tt.getMaxHeight())}this.calculatedMinHeight+=this.tabStripRect.height,this.calculatedMaxHeight+=this.tabStripRect.height}canMaximize(){return this.isEnableMaximize()?this.getModel().getMaximizedTabset(this.getWindowId())===this?!0:!(this.getParent()===this.getModel().getRoot(this.getWindowId())&&this.getModel().getRoot(this.getWindowId()).getChildren().length===1):!1}setContentRect(_e){this.contentRect=_e}getContentRect(){return this.contentRect}setTabStripRect(_e){this.tabStripRect=_e}setWeight(_e){this.attributes.weight=_e}setSelected(_e){this.attributes.selected=_e}getWindowId(){return this.parent.getWindowId()}canDrop(_e,tt,et){let rt;if(_e===this){const it=DockLocation.CENTER,ot=this.tabStripRect;rt=new DropInfo(this,ot,it,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else{if(this.getWindowId()!==Model.MAIN_WINDOW_ID&&!canDockToWindow(_e))return;if(this.contentRect.contains(tt,et)){let it=DockLocation.CENTER;this.model.getMaximizedTabset(this.parent.getWindowId())===void 0&&(it=DockLocation.getLocation(this.contentRect,tt,et));const ot=it.getDockRect(this.rect);rt=new DropInfo(this,ot,it,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this.tabStripRect!=null&&this.tabStripRect.contains(tt,et)){let it,ot,at;if(this.children.length===0)it=this.tabStripRect.clone(),ot=it.y+3,at=it.height-4,it.width=2;else{let st=this.children[0];it=st.getTabRect(),ot=it.y,at=it.height;let ct=this.tabStripRect.x,ut=0;for(let dt=0;dt<this.children.length;dt++){if(st=this.children[dt],it=st.getTabRect(),it.y!==ot&&(ot=it.y,ct=this.tabStripRect.x),ut=it.x+it.width/2,ct<=tt&&tt<ut&&it.y<et&&et<it.getBottom()){const ht=DockLocation.CENTER,ft=new Rect(it.x-2,it.y,3,it.height);if(this.rect.x<it.x&&it.x<this.rect.getRight()){rt=new DropInfo(this,ft,ht,dt,CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}else return}ct=ut}}if(rt==null&&it.getRight()<this.rect.getRight()){const st=DockLocation.CENTER,ct=new Rect(it.getRight()-2,ot,3,at);rt=new DropInfo(this,ct,st,this.children.length,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}}if(_e.canDockInto(_e,rt))return rt}delete(){this.parent.removeChild(this)}remove(_e){const tt=this.removeChild(_e);this.model.tidy(),adjustSelectedIndex(this,tt)}drop(_e,tt,et,rt){const it=tt;if(this===_e)return;let ot=_e.getParent(),at=0;if(ot!==void 0&&(at=ot.removeChild(_e),ot instanceof BorderNode&&ot.getSelected()===at?ot.setSelected(-1):adjustSelectedIndex(ot,at)),_e instanceof TabNode&&ot===this&&at<et&&et>0&&et--,it===DockLocation.CENTER){let st=et;if(st===-1&&(st=this.children.length),_e instanceof TabNode)this.addChild(_e,st),(rt||rt!==!1&&this.isAutoSelectTab())&&this.setSelected(st);else if(_e instanceof RowNode)_e.forEachNode((ct,ut)=>{ct instanceof TabNode&&(this.addChild(ct,st),st++)},0);else{for(let ct=0;ct<_e.getChildren().length;ct++){const ut=_e.getChildren()[ct];this.addChild(ut,st),st++}this.getSelected()===-1&&this.children.length>0&&this.setSelected(0)}this.model.setActiveTabset(this,this.parent.getWindowId())}else{let st=_e;if(_e instanceof TabNode){const dt=this.model.getOnCreateTabSet();st=new Rr(this.model,dt?dt(_e):{}),st.addChild(_e),ot=st}else if(_e instanceof RowNode){const dt=this.getParent();if(_e.getOrientation()===dt.getOrientation()&&(tt.getOrientation()===dt.getOrientation()||tt===DockLocation.CENTER)){const ht=new RowNode(this.model,this.getWindowId(),{});ht.addChild(_e),st=ht}}else st=_e;const ct=this.parent,ut=ct.getChildren().indexOf(this);if(ct.getOrientation()===it.orientation)st.setWeight(this.getWeight()/2),this.setWeight(this.getWeight()/2),ct.addChild(st,ut+it.indexPlus);else{const dt=new RowNode(this.model,this.getWindowId(),{});dt.setWeight(this.getWeight()),dt.addChild(this),this.setWeight(50),st.setWeight(50),dt.addChild(st,it.indexPlus),ct.removeChild(this),ct.addChild(dt,ut)}st instanceof Rr&&this.model.setActiveTabset(st,this.getWindowId())}this.model.tidy()}updateAttrs(_e){Rr.attributeDefinitions.update(_e,this.attributes)}getAttributeDefinitions(){return Rr.attributeDefinitions}static getAttributeDefinitions(){return Rr.attributeDefinitions}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("type",Rr.TYPE,!0).setType(Attribute.STRING).setFixed(),_e.add("id",void 0).setType(Attribute.STRING).setDescription("the unique id of the tab set, if left undefined a uuid will be assigned"),_e.add("weight",100).setType(Attribute.NUMBER).setDescription("relative weight for sizing of this tabset in parent row"),_e.add("selected",0).setType(Attribute.NUMBER).setDescription("index of selected/visible tab in tabset"),_e.add("name",void 0).setType(Attribute.STRING),_e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),_e.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty").setDescription("whether to delete this tabset when is has no tabs"),_e.addInherited("enableDrop","tabSetEnableDrop").setDescription("allow user to drag tabs into this tabset"),_e.addInherited("enableDrag","tabSetEnableDrag").setDescription("allow user to drag tabs out this tabset"),_e.addInherited("enableDivide","tabSetEnableDivide").setDescription("allow user to drag tabs to region of this tabset, splitting into new tabset"),_e.addInherited("enableMaximize","tabSetEnableMaximize").setDescription("allow user to maximize tabset to fill view via maximize button"),_e.addInherited("enableClose","tabSetEnableClose").setDescription("allow user to close tabset via a close button"),_e.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch").setDescription("if the tabset has only a single tab then stretch the single tab to fill area and display in a header style"),_e.addInherited("classNameTabStrip","tabSetClassNameTabStrip").setDescription("a class name to apply to the tab strip"),_e.addInherited("enableTabStrip","tabSetEnableTabStrip").setDescription("enable tab strip and allow multiple tabs in this tabset"),_e.addInherited("minWidth","tabSetMinWidth").setDescription("minimum width (in px) for this tabset"),_e.addInherited("minHeight","tabSetMinHeight").setDescription("minimum height (in px) for this tabset"),_e.addInherited("maxWidth","tabSetMaxWidth").setDescription("maximum width (in px) for this tabset"),_e.addInherited("maxHeight","tabSetMaxHeight").setDescription("maximum height (in px) for this tabset"),_e.addInherited("enableTabWrap","tabSetEnableTabWrap").setDescription("wrap tabs onto multiple lines"),_e.addInherited("tabLocation","tabSetTabLocation").setDescription("the location of the tabs either top or bottom"),_e.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(Attribute.BOOLEAN).setDescription("whether to select new/moved tabs in tabset"),_e.addInherited("enableActiveIcon","tabSetEnableActiveIcon").setType(Attribute.BOOLEAN).setDescription("whether the active icon (*) should be displayed when the tabset is active"),_e.addInherited("enableTabScrollbar","tabSetEnableTabScrollbar").setType(Attribute.BOOLEAN).setDescription("whether to show a mini scrollbar for the tabs"),_e}};__publicField(_TabSetNode,"TYPE","tabset");__publicField(_TabSetNode,"attributeDefinitions",_TabSetNode.createAttributeDefinitions());let TabSetNode=_TabSetNode;const _RowNode=class or extends Node$1{constructor(_e,tt,et){super(_e),__publicField(this,"windowId"),__publicField(this,"minHeight"),__publicField(this,"minWidth"),__publicField(this,"maxHeight"),__publicField(this,"maxWidth"),this.windowId=tt,this.minHeight=DefaultMin,this.minWidth=DefaultMin,this.maxHeight=DefaultMax,this.maxWidth=DefaultMax,or.attributeDefinitions.fromJson(et,this.attributes),this.normalizeWeights(),_e.addNode(this)}static fromJson(_e,tt,et){const rt=new or(tt,et.windowId,_e);if(_e.children!=null)for(const it of _e.children)if(it.type===TabSetNode.TYPE){const ot=TabSetNode.fromJson(it,tt,et);rt.addChild(ot)}else{const ot=or.fromJson(it,tt,et);rt.addChild(ot)}return rt}getWeight(){return this.attributes.weight}toJson(){const _e={};or.attributeDefinitions.toJson(_e,this.attributes),_e.children=[];for(const tt of this.children)_e.children.push(tt.toJson());return _e}getWindowId(){return this.windowId}setWindowId(_e){this.windowId=_e}setWeight(_e){this.attributes.weight=_e}getSplitterBounds(_e){const tt=this.getOrientation()===Orientation.HORZ,et=this.getChildren(),rt=this.model.getSplitterSize(),it=et[0].getRect(),ot=et[et.length-1].getRect();let at=tt?[it.x,ot.getRight()]:[it.y,ot.getBottom()];const st=tt?[it.x,ot.getRight()]:[it.y,ot.getBottom()];for(let ct=0;ct<_e;ct++){const ut=et[ct];at[0]+=tt?ut.getMinWidth():ut.getMinHeight(),st[0]+=tt?ut.getMaxWidth():ut.getMaxHeight(),ct>0&&(at[0]+=rt,st[0]+=rt)}for(let ct=et.length-1;ct>=_e;ct--){const ut=et[ct];at[1]-=(tt?ut.getMinWidth():ut.getMinHeight())+rt,st[1]-=(tt?ut.getMaxWidth():ut.getMaxHeight())+rt}return at=[Math.max(st[1],at[0]),Math.min(st[0],at[1])],at}getSplitterInitials(_e){const tt=this.getOrientation()===Orientation.HORZ,et=this.getChildren(),rt=this.model.getSplitterSize(),it=[];let ot=0;for(let ct=0;ct<et.length;ct++){const dt=et[ct].getRect(),ht=tt?dt.width:dt.height;it.push(ht),ot+=ht}const at=et[_e].getRect(),st=(tt?at.x:at.y)-rt;return{initialSizes:it,sum:ot,startPosition:st}}calculateSplit(_e,tt,et,rt,it){const ot=this.getOrientation()===Orientation.HORZ,at=this.getChildren(),st=at[_e],ct=ot?st.getMaxWidth():st.getMaxHeight(),ut=[...et];if(tt<it){let ht=it-tt,ft=0;ut[_e]+ht>ct?(ft=ut[_e]+ht-ct,ut[_e]=ct):ut[_e]+=ht;for(let pt=_e-1;pt>=0;pt--){const mt=at[pt],vt=ot?mt.getMinWidth():mt.getMinHeight();if(ut[pt]-ht>vt){ut[pt]-=ht;break}else ht-=ut[pt]-vt,ut[pt]=vt}for(let pt=_e+1;pt<at.length;pt++){const mt=at[pt],vt=ot?mt.getMaxWidth():mt.getMaxHeight();if(ut[pt]+ft<vt){ut[pt]+=ft;break}else ft-=vt-ut[pt],ut[pt]=vt}}else{let ht=tt-it,ft=0;ut[_e-1]+ht>ct?(ft=ut[_e-1]+ht-ct,ut[_e-1]=ct):ut[_e-1]+=ht;for(let pt=_e;pt<at.length;pt++){const mt=at[pt],vt=ot?mt.getMinWidth():mt.getMinHeight();if(ut[pt]-ht>vt){ut[pt]-=ht;break}else ht-=ut[pt]-vt,ut[pt]=vt}for(let pt=_e-1;pt>=0;pt--){const mt=at[pt],vt=ot?mt.getMaxWidth():mt.getMaxHeight();if(ut[pt]+ft<vt){ut[pt]+=ft;break}else ft-=vt-ut[pt],ut[pt]=vt}}return ut.map(ht=>Math.max(.1,ht)*100/rt)}getMinSize(_e){return _e===Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this.minWidth}getMinHeight(){return this.minHeight}getMaxSize(_e){return _e===Orientation.HORZ?this.getMaxWidth():this.getMaxHeight()}getMaxWidth(){return this.maxWidth}getMaxHeight(){return this.maxHeight}calcMinMaxSize(){this.minHeight=DefaultMin,this.minWidth=DefaultMin,this.maxHeight=DefaultMax,this.maxWidth=DefaultMax;let _e=!0;for(const tt of this.children){const et=tt;et.calcMinMaxSize(),this.getOrientation()===Orientation.VERT?(this.minHeight+=et.getMinHeight(),this.maxHeight+=et.getMaxHeight(),_e||(this.minHeight+=this.model.getSplitterSize(),this.maxHeight+=this.model.getSplitterSize()),this.minWidth=Math.max(this.minWidth,et.getMinWidth()),this.maxWidth=Math.min(this.maxWidth,et.getMaxWidth())):(this.minWidth+=et.getMinWidth(),this.maxWidth+=et.getMaxWidth(),_e||(this.minWidth+=this.model.getSplitterSize(),this.maxWidth+=this.model.getSplitterSize()),this.minHeight=Math.max(this.minHeight,et.getMinHeight()),this.maxHeight=Math.min(this.maxHeight,et.getMaxHeight())),_e=!1}}tidy(){let _e=0;for(;_e<this.children.length;){const tt=this.children[_e];if(tt instanceof or){tt.tidy();const et=tt.getChildren();if(et.length===0)this.removeChild(tt);else if(et.length===1){const rt=et[0];if(this.removeChild(tt),rt instanceof or){let it=0;const ot=rt.getChildren();for(const at of ot)it+=at.getWeight();for(let at=0;at<ot.length;at++){const st=ot[at];st.setWeight(tt.getWeight()*st.getWeight()/it),this.addChild(st,_e+at)}}else rt.setWeight(tt.getWeight()),this.addChild(rt,_e)}else _e++}else tt instanceof TabSetNode&&tt.getChildren().length===0&&tt.isEnableDeleteWhenEmpty()?(this.removeChild(tt),tt===this.model.getMaximizedTabset(this.windowId)&&this.model.setMaximizedTabset(void 0,this.windowId)):_e++}if(this===this.model.getRoot(this.windowId)&&this.children.length===0){const tt=this.model.getOnCreateTabSet();let et=tt?tt():{};et={...et,selected:-1};const rt=new TabSetNode(this.model,et);this.model.setActiveTabset(rt,this.windowId),this.addChild(rt)}}canDrop(_e,tt,et){const rt=et-this.rect.y,it=tt-this.rect.x,ot=this.rect.width,at=this.rect.height,st=10,ct=50;let ut;if(!(this.getWindowId()!==Model.MAIN_WINDOW_ID&&!canDockToWindow(_e))){if(this.model.isEnableEdgeDock()&&this.parent===void 0){if(tt<this.rect.x+st&&rt>at/2-ct&&rt<at/2+ct){const dt=DockLocation.LEFT,ht=dt.getDockRect(this.rect);ht.width=ht.width/2,ut=new DropInfo(this,ht,dt,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(tt>this.rect.getRight()-st&&rt>at/2-ct&&rt<at/2+ct){const dt=DockLocation.RIGHT,ht=dt.getDockRect(this.rect);ht.width=ht.width/2,ht.x+=ht.width,ut=new DropInfo(this,ht,dt,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(et<this.rect.y+st&&it>ot/2-ct&&it<ot/2+ct){const dt=DockLocation.TOP,ht=dt.getDockRect(this.rect);ht.height=ht.height/2,ut=new DropInfo(this,ht,dt,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(et>this.rect.getBottom()-st&&it>ot/2-ct&&it<ot/2+ct){const dt=DockLocation.BOTTOM,ht=dt.getDockRect(this.rect);ht.height=ht.height/2,ht.y+=ht.height,ut=new DropInfo(this,ht,dt,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(ut!==void 0&&!_e.canDockInto(_e,ut))return}return ut}}drop(_e,tt,et){const rt=tt,it=_e.getParent();it&&it.removeChild(_e),it!==void 0&&it instanceof TabSetNode&&it.setSelected(0),it!==void 0&&it instanceof BorderNode&&it.setSelected(-1);let ot;if(_e instanceof TabSetNode||_e instanceof or)ot=_e,ot instanceof or&&ot.getOrientation()===this.getOrientation()&&(tt.getOrientation()===this.getOrientation()||tt===DockLocation.CENTER)&&(ot=new or(this.model,this.windowId,{}),ot.addChild(_e));else{const ct=this.model.getOnCreateTabSet();ot=new TabSetNode(this.model,ct?ct(_e):{}),ot.addChild(_e)}let at=this.children.reduce((ct,ut)=>ct+ut.getWeight(),0);at===0&&(at=100),ot.setWeight(at/3);const st=!this.model.isRootOrientationVertical();if(rt===DockLocation.CENTER)et===-1?this.addChild(ot,this.children.length):this.addChild(ot,et);else if(st&&rt===DockLocation.LEFT||!st&&rt===DockLocation.TOP)this.addChild(ot,0);else if(st&&rt===DockLocation.RIGHT||!st&&rt===DockLocation.BOTTOM)this.addChild(ot);else if(st&&rt===DockLocation.TOP||!st&&rt===DockLocation.LEFT){const ct=new or(this.model,this.windowId,{}),ut=new or(this.model,this.windowId,{});ut.setWeight(75),ot.setWeight(25);for(const dt of this.children)ut.addChild(dt);this.removeAll(),ct.addChild(ot),ct.addChild(ut),this.addChild(ct)}else if(st&&rt===DockLocation.BOTTOM||!st&&rt===DockLocation.RIGHT){const ct=new or(this.model,this.windowId,{}),ut=new or(this.model,this.windowId,{});ut.setWeight(75),ot.setWeight(25);for(const dt of this.children)ut.addChild(dt);this.removeAll(),ct.addChild(ut),ct.addChild(ot),this.addChild(ct)}ot instanceof TabSetNode&&this.model.setActiveTabset(ot,this.windowId),this.model.tidy()}isEnableDrop(){return!0}getAttributeDefinitions(){return or.attributeDefinitions}updateAttrs(_e){or.attributeDefinitions.update(_e,this.attributes)}static getAttributeDefinitions(){return or.attributeDefinitions}normalizeWeights(){let _e=0;for(const tt of this.children)_e+=tt.getWeight();_e===0&&(_e=1);for(const tt of this.children){const et=tt;et.setWeight(Math.max(.001,100*et.getWeight()/_e))}}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("type",or.TYPE,!0).setType(Attribute.STRING).setFixed(),_e.add("id",void 0).setType(Attribute.STRING).setDescription("the unique id of the row, if left undefined a uuid will be assigned"),_e.add("weight",100).setType(Attribute.NUMBER).setDescription("relative weight for sizing of this row in parent row"),_e}};__publicField(_RowNode,"TYPE","row");__publicField(_RowNode,"attributeDefinitions",_RowNode.createAttributeDefinitions());let RowNode=_RowNode;class LayoutWindow{constructor(_e,tt){__publicField(this,"_windowId"),__publicField(this,"_layout"),__publicField(this,"_rect"),__publicField(this,"_window"),__publicField(this,"_root"),__publicField(this,"_maximizedTabSet"),__publicField(this,"_activeTabSet"),__publicField(this,"_toScreenRectFunction"),this._windowId=_e,this._rect=tt,this._toScreenRectFunction=et=>et}visitNodes(_e){this.root.forEachNode(_e,0)}get windowId(){return this._windowId}get rect(){return this._rect}get layout(){return this._layout}get window(){return this._window}get root(){return this._root}get maximizedTabSet(){return this._maximizedTabSet}get activeTabSet(){return this._activeTabSet}set rect(_e){this._rect=_e}set layout(_e){this._layout=_e}set window(_e){this._window=_e}set root(_e){this._root=_e}set maximizedTabSet(_e){this._maximizedTabSet=_e}set activeTabSet(_e){this._activeTabSet=_e}get toScreenRectFunction(){return this._toScreenRectFunction}set toScreenRectFunction(_e){this._toScreenRectFunction=_e}toJson(){return this._window&&this._window.screenTop>-1e4&&(this.rect=new Rect(this._window.screenLeft,this._window.screenTop,this._window.outerWidth,this._window.outerHeight)),{layout:this.root.toJson(),rect:this.rect.toJson()}}static fromJson(_e,tt,et){const rt=tt.getwindowsMap().size,it=_e.rect?Rect.fromJson(_e.rect):new Rect(50+50*rt,50+50*rt,600,400);it.snap(10);const ot=new LayoutWindow(et,it);return ot.root=RowNode.fromJson(_e.layout,tt,ot),ot}}const DefaultMin=0,DefaultMax=99999,_Model=class Kn{constructor(){__publicField(this,"attributes"),__publicField(this,"idMap"),__publicField(this,"changeListeners"),__publicField(this,"borders"),__publicField(this,"onAllowDrop"),__publicField(this,"onCreateTabSet"),__publicField(this,"windows"),__publicField(this,"rootWindow"),this.attributes={},this.idMap=new Map,this.borders=new BorderSet(this),this.windows=new Map,this.rootWindow=new LayoutWindow(Kn.MAIN_WINDOW_ID,Rect.empty()),this.windows.set(Kn.MAIN_WINDOW_ID,this.rootWindow),this.changeListeners=[]}doAction(_e){var tt;let et;switch(_e.type){case Actions.ADD_NODE:{const rt=new TabNode(this,_e.data.json,!0),it=this.idMap.get(_e.data.toNode);(it instanceof TabSetNode||it instanceof BorderNode||it instanceof RowNode)&&(it.drop(rt,DockLocation.getByName(_e.data.location),_e.data.index,_e.data.select),et=rt);break}case Actions.MOVE_NODE:{const rt=this.idMap.get(_e.data.fromNode);if(rt instanceof TabNode||rt instanceof TabSetNode||rt instanceof RowNode){if(rt===this.getMaximizedTabset(rt.getWindowId())){const ot=this.windows.get(rt.getWindowId());ot.maximizedTabSet=void 0}const it=this.idMap.get(_e.data.toNode);(it instanceof TabSetNode||it instanceof BorderNode||it instanceof RowNode)&&it.drop(rt,DockLocation.getByName(_e.data.location),_e.data.index,_e.data.select)}this.removeEmptyWindows();break}case Actions.DELETE_TAB:{const rt=this.idMap.get(_e.data.node);rt instanceof TabNode&&rt.delete(),this.removeEmptyWindows();break}case Actions.DELETE_TABSET:{const rt=this.idMap.get(_e.data.node);if(rt instanceof TabSetNode){const it=[...rt.getChildren()];for(let ot=0;ot<it.length;ot++){const at=it[ot];at.isEnableClose()&&at.delete()}rt.getChildren().length===0&&rt.delete(),this.tidy()}this.removeEmptyWindows();break}case Actions.POPOUT_TABSET:{const rt=this.idMap.get(_e.data.node);if(rt instanceof TabSetNode){const it=rt.isMaximized(),ot=this.windows.get(rt.getWindowId()),at=randomUUID(),st=new LayoutWindow(at,ot.toScreenRectFunction(rt.getRect())),ct={type:"row",children:[]},ut=RowNode.fromJson(ct,this,st);st.root=ut,this.windows.set(at,st),ut.drop(rt,DockLocation.CENTER,0),it&&(this.rootWindow.maximizedTabSet=void 0)}this.removeEmptyWindows();break}case Actions.POPOUT_TAB:{const rt=this.idMap.get(_e.data.node);if(rt instanceof TabNode){const it=randomUUID();let ot=Rect.empty();rt.getParent()instanceof TabSetNode?ot=rt.getParent().getRect():ot=rt.getParent().getContentRect();const at=this.windows.get(rt.getWindowId()),st=new LayoutWindow(it,at.toScreenRectFunction(ot)),ct=randomUUID(),ut={type:"row",children:[{type:"tabset",id:ct}]},dt=RowNode.fromJson(ut,this,st);st.root=dt,this.windows.set(it,st),this.idMap.get(ct).drop(rt,DockLocation.CENTER,0,!0)}this.removeEmptyWindows();break}case Actions.CLOSE_WINDOW:{const rt=this.windows.get(_e.data.windowId);rt&&((tt=this.rootWindow.root)==null||tt.drop(rt.root,DockLocation.CENTER,-1),this.rootWindow.visitNodes((it,ot)=>{it instanceof RowNode&&it.setWindowId(Kn.MAIN_WINDOW_ID)}),this.windows.delete(_e.data.windowId));break}case Actions.CREATE_WINDOW:{const rt=randomUUID(),it=new LayoutWindow(rt,Rect.fromJson(_e.data.rect)),ot=RowNode.fromJson(_e.data.layout,this,it);it.root=ot,this.windows.set(rt,it),et=rt;break}case Actions.RENAME_TAB:{const rt=this.idMap.get(_e.data.node);rt instanceof TabNode&&rt.setName(_e.data.text);break}case Actions.SELECT_TAB:{const rt=this.idMap.get(_e.data.tabNode),it=_e.data.windowId?_e.data.windowId:Kn.MAIN_WINDOW_ID,ot=this.windows.get(it);if(rt instanceof TabNode){const at=rt.getParent(),st=at.getChildren().indexOf(rt);at instanceof BorderNode?at.getSelected()===st?at.setSelected(-1):at.setSelected(st):at instanceof TabSetNode&&(at.getSelected()!==st&&at.setSelected(st),ot.activeTabSet=at)}break}case Actions.SET_ACTIVE_TABSET:{const rt=_e.data.windowId?_e.data.windowId:Kn.MAIN_WINDOW_ID,it=this.windows.get(rt);if(_e.data.tabsetNode===void 0)it.activeTabSet=void 0;else{const ot=this.idMap.get(_e.data.tabsetNode);ot instanceof TabSetNode&&(it.activeTabSet=ot)}break}case Actions.ADJUST_WEIGHTS:{const it=this.idMap.get(_e.data.nodeId).getChildren();for(let ot=0;ot<it.length;ot++)it[ot].setWeight(_e.data.weights[ot]);break}case Actions.ADJUST_BORDER_SPLIT:{const rt=this.idMap.get(_e.data.node);rt instanceof BorderNode&&rt.setSize(_e.data.pos);break}case Actions.MAXIMIZE_TOGGLE:{const rt=_e.data.windowId?_e.data.windowId:Kn.MAIN_WINDOW_ID,it=this.windows.get(rt),ot=this.idMap.get(_e.data.node);ot instanceof TabSetNode&&(ot===it.maximizedTabSet?it.maximizedTabSet=void 0:(it.maximizedTabSet=ot,it.activeTabSet=ot));break}case Actions.UPDATE_MODEL_ATTRIBUTES:{this.updateAttrs(_e.data.json);break}case Actions.UPDATE_NODE_ATTRIBUTES:{this.idMap.get(_e.data.node).updateAttrs(_e.data.json);break}}this.updateIdMap();for(const rt of this.changeListeners)rt(_e);return et}getActiveTabset(_e=Kn.MAIN_WINDOW_ID){const tt=this.windows.get(_e);if(tt&&tt.activeTabSet&&this.getNodeById(tt.activeTabSet.getId()))return tt.activeTabSet}getMaximizedTabset(_e=Kn.MAIN_WINDOW_ID){return this.windows.get(_e).maximizedTabSet}getRoot(_e=Kn.MAIN_WINDOW_ID){return this.windows.get(_e).root}isRootOrientationVertical(){return this.attributes.rootOrientationVertical}isEnableRotateBorderIcons(){return this.attributes.enableRotateBorderIcons}getBorderSet(){return this.borders}getwindowsMap(){return this.windows}visitNodes(_e){this.borders.forEachNode(_e);for(const[tt,et]of this.windows)et.root.forEachNode(_e,0)}visitWindowNodes(_e,tt){this.windows.has(_e)&&(_e===Kn.MAIN_WINDOW_ID&&this.borders.forEachNode(tt),this.windows.get(_e).visitNodes(tt))}getNodeById(_e){return this.idMap.get(_e)}getFirstTabSet(_e=this.windows.get(Kn.MAIN_WINDOW_ID).root){const tt=_e.getChildren()[0];return tt instanceof TabSetNode?tt:this.getFirstTabSet(tt)}static fromJson(_e){const tt=new Kn;if(Kn.attributeDefinitions.fromJson(_e.global,tt.attributes),_e.borders&&(tt.borders=BorderSet.fromJson(_e.borders,tt)),_e.popouts)for(const et in _e.popouts){const rt=_e.popouts[et],it=LayoutWindow.fromJson(rt,tt,et);tt.windows.set(et,it)}return tt.rootWindow.root=RowNode.fromJson(_e.layout,tt,tt.getwindowsMap().get(Kn.MAIN_WINDOW_ID)),tt.tidy(),tt}toJson(){const _e={};Kn.attributeDefinitions.toJson(_e,this.attributes),this.visitNodes(et=>{et.fireEvent("save",{})});const tt={};for(const[et,rt]of this.windows)et!==Kn.MAIN_WINDOW_ID&&(tt[et]=rt.toJson());return{global:_e,borders:this.borders.toJson(),layout:this.rootWindow.root.toJson(),popouts:tt}}getSplitterSize(){return this.attributes.splitterSize}getSplitterExtra(){return this.attributes.splitterExtra}isEnableEdgeDock(){return this.attributes.enableEdgeDock}isSplitterEnableHandle(){return this.attributes.splitterEnableHandle}setOnAllowDrop(_e){this.onAllowDrop=_e}setOnCreateTabSet(_e){this.onCreateTabSet=_e}addChangeListener(_e){this.changeListeners.push(_e)}removeChangeListener(_e){const tt=this.changeListeners.findIndex(et=>et===_e);tt!==-1&&this.changeListeners.splice(tt,1)}toString(){return JSON.stringify(this.toJson())}removeEmptyWindows(){const _e=new Set;for(const[tt]of this.windows)if(tt!==Kn.MAIN_WINDOW_ID){let et=0;this.visitWindowNodes(tt,rt=>{rt instanceof TabNode&&et++}),et===0&&_e.add(tt)}for(const tt of _e)this.windows.delete(tt)}setActiveTabset(_e,tt){const et=this.windows.get(tt);et&&(_e?et.activeTabSet=_e:et.activeTabSet=void 0)}setMaximizedTabset(_e,tt){const et=this.windows.get(tt);et&&(_e?et.maximizedTabSet=_e:et.maximizedTabSet=void 0)}updateIdMap(){this.idMap.clear(),this.visitNodes(_e=>{this.idMap.set(_e.getId(),_e)})}addNode(_e){const tt=_e.getId();if(this.idMap.has(tt))throw new Error(`Error: each node must have a unique id, duplicate id:${_e.getId()}`);this.idMap.set(tt,_e)}findDropTargetNode(_e,tt,et,rt){let it=this.windows.get(_e).root.findDropTargetNode(_e,tt,et,rt);return it===void 0&&_e===Kn.MAIN_WINDOW_ID&&(it=this.borders.findDropTargetNode(tt,et,rt)),it}tidy(){for(const[_e,tt]of this.windows)tt.root.tidy()}updateAttrs(_e){Kn.attributeDefinitions.update(_e,this.attributes)}nextUniqueId(){return"#"+randomUUID()}getAttribute(_e){return this.attributes[_e]}getOnAllowDrop(){return this.onAllowDrop}getOnCreateTabSet(){return this.onCreateTabSet}static toTypescriptInterfaces(){Kn.attributeDefinitions.pairAttributes("RowNode",RowNode.getAttributeDefinitions()),Kn.attributeDefinitions.pairAttributes("TabSetNode",TabSetNode.getAttributeDefinitions()),Kn.attributeDefinitions.pairAttributes("TabNode",TabNode.getAttributeDefinitions()),Kn.attributeDefinitions.pairAttributes("BorderNode",BorderNode.getAttributeDefinitions());const _e=[];_e.push(Kn.attributeDefinitions.toTypescriptInterface("Global",void 0)),_e.push(RowNode.getAttributeDefinitions().toTypescriptInterface("Row",Kn.attributeDefinitions)),_e.push(TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet",Kn.attributeDefinitions)),_e.push(TabNode.getAttributeDefinitions().toTypescriptInterface("Tab",Kn.attributeDefinitions)),_e.push(BorderNode.getAttributeDefinitions().toTypescriptInterface("Border",Kn.attributeDefinitions)),console.log(_e.join(`
11487
- `))}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("enableEdgeDock",!0).setType(Attribute.BOOLEAN).setDescription("enable docking to the edges of the layout, this will show the edge indicators"),_e.add("rootOrientationVertical",!1).setType(Attribute.BOOLEAN).setDescription("the top level 'row' will layout horizontally by default, set this option true to make it layout vertically"),_e.add("enableRotateBorderIcons",!0).setType(Attribute.BOOLEAN).setDescription("boolean indicating if tab icons should rotate with the text in the left and right borders"),_e.add("splitterSize",8).setType(Attribute.NUMBER).setDescription("width in pixels of all splitters between tabsets/borders"),_e.add("splitterExtra",0).setType(Attribute.NUMBER).setDescription("additional width in pixels of the splitter hit test area"),_e.add("splitterEnableHandle",!1).setType(Attribute.BOOLEAN).setDescription("enable a small centralized handle on all splitters"),_e.add("tabEnableClose",!0).setType(Attribute.BOOLEAN),_e.add("tabCloseType",1).setType("ICloseType"),_e.add("tabEnablePopout",!1).setType(Attribute.BOOLEAN).setAlias("tabEnableFloat"),_e.add("tabEnablePopoutIcon",!0).setType(Attribute.BOOLEAN),_e.add("tabEnablePopoutOverlay",!1).setType(Attribute.BOOLEAN),_e.add("tabEnableDrag",!0).setType(Attribute.BOOLEAN),_e.add("tabEnableRename",!0).setType(Attribute.BOOLEAN),_e.add("tabContentClassName",void 0).setType(Attribute.STRING),_e.add("tabClassName",void 0).setType(Attribute.STRING),_e.add("tabIcon",void 0).setType(Attribute.STRING),_e.add("tabEnableRenderOnDemand",!0).setType(Attribute.BOOLEAN),_e.add("tabDragSpeed",.3).setType(Attribute.NUMBER),_e.add("tabBorderWidth",-1).setType(Attribute.NUMBER),_e.add("tabBorderHeight",-1).setType(Attribute.NUMBER),_e.add("tabSetEnableDeleteWhenEmpty",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableDrop",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableDrag",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableDivide",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableMaximize",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableClose",!1).setType(Attribute.BOOLEAN),_e.add("tabSetEnableSingleTabStretch",!1).setType(Attribute.BOOLEAN),_e.add("tabSetAutoSelectTab",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableActiveIcon",!1).setType(Attribute.BOOLEAN),_e.add("tabSetClassNameTabStrip",void 0).setType(Attribute.STRING),_e.add("tabSetEnableTabStrip",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableTabWrap",!1).setType(Attribute.BOOLEAN),_e.add("tabSetTabLocation","top").setType("ITabLocation"),_e.add("tabMinWidth",DefaultMin).setType(Attribute.NUMBER),_e.add("tabMinHeight",DefaultMin).setType(Attribute.NUMBER),_e.add("tabSetMinWidth",DefaultMin).setType(Attribute.NUMBER),_e.add("tabSetMinHeight",DefaultMin).setType(Attribute.NUMBER),_e.add("tabMaxWidth",DefaultMax).setType(Attribute.NUMBER),_e.add("tabMaxHeight",DefaultMax).setType(Attribute.NUMBER),_e.add("tabSetMaxWidth",DefaultMax).setType(Attribute.NUMBER),_e.add("tabSetMaxHeight",DefaultMax).setType(Attribute.NUMBER),_e.add("tabSetEnableTabScrollbar",!1).setType(Attribute.BOOLEAN),_e.add("borderSize",200).setType(Attribute.NUMBER),_e.add("borderMinSize",DefaultMin).setType(Attribute.NUMBER),_e.add("borderMaxSize",DefaultMax).setType(Attribute.NUMBER),_e.add("borderEnableDrop",!0).setType(Attribute.BOOLEAN),_e.add("borderAutoSelectTabWhenOpen",!0).setType(Attribute.BOOLEAN),_e.add("borderAutoSelectTabWhenClosed",!1).setType(Attribute.BOOLEAN),_e.add("borderClassName",void 0).setType(Attribute.STRING),_e.add("borderEnableAutoHide",!1).setType(Attribute.BOOLEAN),_e.add("borderEnableTabScrollbar",!1).setType(Attribute.BOOLEAN),_e}};__publicField(_Model,"MAIN_WINDOW_ID","__main_window_id__");__publicField(_Model,"attributeDefinitions",_Model.createAttributeDefinitions());let Model=_Model;const _BorderNode=class Dr extends Node$1{constructor(_e,tt,et){super(et),__publicField(this,"contentRect",Rect.empty()),__publicField(this,"tabHeaderRect",Rect.empty()),__publicField(this,"location"),this.location=_e,this.attributes.id=`border_${_e.getName()}`,Dr.attributeDefinitions.fromJson(tt,this.attributes),et.addNode(this)}static fromJson(_e,tt){const et=DockLocation.getByName(_e.location),rt=new Dr(et,_e,tt);return _e.children&&(rt.children=_e.children.map(it=>{const ot=TabNode.fromJson(it,tt);return ot.setParent(rt),ot})),rt}getLocation(){return this.location}getClassName(){return this.getAttr("className")}isHorizontal(){return this.location.orientation===Orientation.HORZ}getSize(){const _e=this.getAttr("size"),tt=this.getSelected();if(tt===-1)return _e;{const et=this.children[tt],rt=this.isHorizontal()?et.getAttr("borderWidth"):et.getAttr("borderHeight");return rt===-1?_e:rt}}getMinSize(){const _e=this.getSelectedNode();let tt=this.getAttr("minSize");if(_e){const et=this.isHorizontal()?_e.getMinWidth():_e.getMinHeight();tt=Math.max(tt,et)}return tt}getMaxSize(){const _e=this.getSelectedNode();let tt=this.getAttr("maxSize");if(_e){const et=this.isHorizontal()?_e.getMaxWidth():_e.getMaxHeight();tt=Math.min(tt,et)}return tt}getSelected(){return this.attributes.selected}isAutoHide(){return this.getAttr("enableAutoHide")}getSelectedNode(){if(this.getSelected()!==-1)return this.children[this.getSelected()]}getOrientation(){return this.location.getOrientation()}getConfig(){return this.attributes.config}isMaximized(){return!1}isShowing(){return this.attributes.show}toJson(){const _e={};return Dr.attributeDefinitions.toJson(_e,this.attributes),_e.location=this.location.getName(),_e.children=this.children.map(tt=>tt.toJson()),_e}isAutoSelectTab(_e){return _e==null&&(_e=this.getSelected()!==-1),_e?this.getAttr("autoSelectTabWhenOpen"):this.getAttr("autoSelectTabWhenClosed")}isEnableTabScrollbar(){return this.getAttr("enableTabScrollbar")}setSelected(_e){this.attributes.selected=_e}getTabHeaderRect(){return this.tabHeaderRect}setTabHeaderRect(_e){this.tabHeaderRect=_e}getRect(){return this.tabHeaderRect}getContentRect(){return this.contentRect}setContentRect(_e){this.contentRect=_e}isEnableDrop(){return this.getAttr("enableDrop")}setSize(_e){const tt=this.getSelected();if(tt===-1)this.attributes.size=_e;else{const et=this.children[tt];(this.isHorizontal()?et.getAttr("borderWidth"):et.getAttr("borderHeight"))===-1?this.attributes.size=_e:this.isHorizontal()?et.setBorderWidth(_e):et.setBorderHeight(_e)}}updateAttrs(_e){Dr.attributeDefinitions.update(_e,this.attributes)}remove(_e){const tt=this.removeChild(_e);this.getSelected()!==-1&&adjustSelectedIndex(this,tt)}canDrop(_e,tt,et){if(!(_e instanceof TabNode))return;let rt;const it=DockLocation.CENTER;if(this.tabHeaderRect.contains(tt,et)){if(this.location.orientation===Orientation.VERT)if(this.children.length>0){let ot=this.children[0],at=ot.getTabRect();const st=at.y,ct=at.height;let ut=this.tabHeaderRect.x,dt=0;for(let ht=0;ht<this.children.length;ht++){if(ot=this.children[ht],at=ot.getTabRect(),dt=at.x+at.width/2,tt>=ut&&tt<dt){const ft=new Rect(at.x-2,st,3,ct);rt=new DropInfo(this,ft,it,ht,CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}ut=dt}if(rt==null){const ht=new Rect(at.getRight()-2,st,3,ct);rt=new DropInfo(this,ht,it,this.children.length,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const ot=new Rect(this.tabHeaderRect.x+1,this.tabHeaderRect.y+2,3,18);rt=new DropInfo(this,ot,it,0,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this.children.length>0){let ot=this.children[0],at=ot.getTabRect();const st=at.x,ct=at.width;let ut=this.tabHeaderRect.y,dt=0;for(let ht=0;ht<this.children.length;ht++){if(ot=this.children[ht],at=ot.getTabRect(),dt=at.y+at.height/2,et>=ut&&et<dt){const ft=new Rect(st,at.y-2,ct,3);rt=new DropInfo(this,ft,it,ht,CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}ut=dt}if(rt==null){const ht=new Rect(st,at.getBottom()-2,ct,3);rt=new DropInfo(this,ht,it,this.children.length,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const ot=new Rect(this.tabHeaderRect.x+2,this.tabHeaderRect.y+1,18,3);rt=new DropInfo(this,ot,it,0,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}if(!_e.canDockInto(_e,rt))return}else if(this.getSelected()!==-1&&this.contentRect.contains(tt,et)){const ot=this.contentRect;if(rt=new DropInfo(this,ot,it,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT),!_e.canDockInto(_e,rt))return}return rt}drop(_e,tt,et,rt){let it=0;const ot=_e.getParent();ot!==void 0&&(it=ot.removeChild(_e),ot!==this&&ot instanceof Dr&&ot.getSelected()===it?ot.setSelected(-1):adjustSelectedIndex(ot,it)),_e instanceof TabNode&&ot===this&&it<et&&et>0&&et--;let at=et;at===-1&&(at=this.children.length),_e instanceof TabNode&&this.addChild(_e,at),(rt||rt!==!1&&this.isAutoSelectTab())&&this.setSelected(at),this.model.tidy()}getSplitterBounds(_e,tt=!1){const et=[0,0],rt=tt?this.getMinSize():0,it=tt?this.getMaxSize():99999,ot=this.model.getRoot(Model.MAIN_WINDOW_ID),at=ot.getRect(),st=this.model.getSplitterSize();if(this.location===DockLocation.TOP){et[0]=this.tabHeaderRect.getBottom()+rt;const ct=this.tabHeaderRect.getBottom()+it;et[1]=Math.max(et[0],at.getBottom()-ot.getMinHeight()-st),et[1]=Math.min(et[1],ct)}else if(this.location===DockLocation.LEFT){et[0]=this.tabHeaderRect.getRight()+rt;const ct=this.tabHeaderRect.getRight()+it;et[1]=Math.max(et[0],at.getRight()-ot.getMinWidth()-st),et[1]=Math.min(et[1],ct)}else if(this.location===DockLocation.BOTTOM){et[1]=this.tabHeaderRect.y-rt-st;const ct=this.tabHeaderRect.y-it-st;et[0]=Math.min(et[1],at.y+ot.getMinHeight()),et[0]=Math.max(et[0],ct)}else if(this.location===DockLocation.RIGHT){et[1]=this.tabHeaderRect.x-rt-st;const ct=this.tabHeaderRect.x-it-st;et[0]=Math.min(et[1],at.x+ot.getMinWidth()),et[0]=Math.max(et[0],ct)}return et}calculateSplit(_e,tt){const et=this.getSplitterBounds(tt);return this.location===DockLocation.BOTTOM||this.location===DockLocation.RIGHT?Math.max(0,et[1]-tt):Math.max(0,tt-et[0])}getAttributeDefinitions(){return Dr.attributeDefinitions}static getAttributeDefinitions(){return Dr.attributeDefinitions}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("type",Dr.TYPE,!0).setType(Attribute.STRING).setFixed(),_e.add("selected",-1).setType(Attribute.NUMBER).setDescription("index of selected/visible tab in border; -1 means no tab selected"),_e.add("show",!0).setType(Attribute.BOOLEAN).setDescription("show/hide this border"),_e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),_e.addInherited("enableDrop","borderEnableDrop").setType(Attribute.BOOLEAN).setDescription("whether tabs can be dropped into this border"),_e.addInherited("className","borderClassName").setType(Attribute.STRING).setDescription("class applied to tab button"),_e.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(Attribute.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is already open"),_e.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(Attribute.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is currently closed"),_e.addInherited("size","borderSize").setType(Attribute.NUMBER).setDescription("size of the tab area when selected"),_e.addInherited("minSize","borderMinSize").setType(Attribute.NUMBER).setDescription("the minimum size of the tab area"),_e.addInherited("maxSize","borderMaxSize").setType(Attribute.NUMBER).setDescription("the maximum size of the tab area"),_e.addInherited("enableAutoHide","borderEnableAutoHide").setType(Attribute.BOOLEAN).setDescription("hide border if it has zero tabs"),_e.addInherited("enableTabScrollbar","borderEnableTabScrollbar").setType(Attribute.BOOLEAN).setDescription("whether to show a mini scrollbar for the tabs"),_e}};__publicField(_BorderNode,"TYPE","border");__publicField(_BorderNode,"attributeDefinitions",_BorderNode.createAttributeDefinitions());let BorderNode=_BorderNode,splitterDragging=!1;const Splitter=nt=>{const{layout:_e,node:tt,index:et,horizontal:rt}=nt,[it,ot]=reactExports$1.useState(!1),at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=reactExports$1.useRef([]),ut=reactExports$1.useRef(void 0),dt=reactExports$1.useRef(void 0),ht=reactExports$1.useRef(0),ft=reactExports$1.useRef(0),pt=reactExports$1.useRef({initialSizes:[],sum:0,startPosition:0}),mt=tt.getModel().getSplitterSize();let vt=tt.getModel().getSplitterExtra();isDesktop()||(vt=Math.max(20,vt+mt)-mt),reactExports$1.useEffect(()=>{var $t,Dt;return($t=at.current)==null||$t.addEventListener("touchstart",_t,{passive:!1}),(Dt=st.current)==null||Dt.addEventListener("touchstart",_t,{passive:!1}),()=>{var Lt,Mt;(Lt=at.current)==null||Lt.removeEventListener("touchstart",_t),(Mt=st.current)==null||Mt.removeEventListener("touchstart",_t)}},[]);const _t=$t=>{$t.preventDefault(),$t.stopImmediatePropagation()},yt=$t=>{var Dt;$t.stopPropagation(),tt instanceof RowNode&&(pt.current=tt.getSplitterInitials(et)),enablePointerOnIFrames(!1,_e.getCurrentDocument()),startDrag($t.currentTarget.ownerDocument,$t,St,xt,bt),ct.current=tt.getSplitterBounds(et,!0);const Lt=_e.getRootDiv();ut.current=_e.getCurrentDocument().createElement("div"),ut.current.style.flexDirection=rt?"row":"column",ut.current.className=_e.getClassName(CLASSES.FLEXLAYOUT__SPLITTER_DRAG),ut.current.style.cursor=tt.getOrientation()===Orientation.VERT?"ns-resize":"ew-resize",tt.getModel().isSplitterEnableHandle()&&(dt.current=_e.getCurrentDocument().createElement("div"),dt.current.className=At(CLASSES.FLEXLAYOUT__SPLITTER_HANDLE)+" "+At(rt?CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_VERT),ut.current.appendChild(dt.current));const Mt=(Dt=at.current)==null?void 0:Dt.getBoundingClientRect(),It=new Rect(Mt.x-_e.getDomRect().x,Mt.y-_e.getDomRect().y,Mt.width,Mt.height);ht.current=$t.clientX-Mt.x,ft.current=$t.clientY-Mt.y,It.positionElement(ut.current),Lt&&Lt.appendChild(ut.current),ot(!0),splitterDragging=!0},bt=()=>{const $t=_e.getRootDiv();$t&&ut.current&&$t.removeChild(ut.current),ut.current=void 0,ot(!1),splitterDragging=!1},St=($t,Dt)=>{if(ut.current){const Lt=_e.getDomRect();if(!Lt)return;tt.getOrientation()===Orientation.VERT?ut.current.style.top=Et(Dt-Lt.y-ft.current)+"px":ut.current.style.left=Et($t-Lt.x-ht.current)+"px",_e.isRealtimeResize()&&Ct()}},xt=()=>{if(ut.current){Ct();const $t=_e.getRootDiv();$t&&ut.current&&$t.removeChild(ut.current),ut.current=void 0}enablePointerOnIFrames(!0,_e.getCurrentDocument()),ot(!1),splitterDragging=!1},Ct=$t=>{(()=>{if(ut.current){let Lt=0;if(tt.getOrientation()===Orientation.VERT?Lt=ut.current.offsetTop:Lt=ut.current.offsetLeft,tt instanceof BorderNode){const Mt=tt.calculateSplit(tt,Lt);_e.doAction(Actions.adjustBorderSplit(tt.getId(),Mt))}else{const Mt=pt.current,It=tt.calculateSplit(et,Lt,Mt.initialSizes,Mt.sum,Mt.startPosition);_e.doAction(Actions.adjustWeights(tt.getId(),It))}}})()},Et=$t=>{const Dt=ct.current;let Lt=$t;return $t<Dt[0]&&(Lt=Dt[0]),$t>Dt[1]&&(Lt=Dt[1]),Lt},At=_e.getClassName,Pt={cursor:rt?"ew-resize":"ns-resize",flexDirection:rt?"column":"row"};let Tt=At(CLASSES.FLEXLAYOUT__SPLITTER)+" "+At(CLASSES.FLEXLAYOUT__SPLITTER_+tt.getOrientation().getName());tt instanceof BorderNode?Tt+=" "+At(CLASSES.FLEXLAYOUT__SPLITTER_BORDER):tt.getModel().getMaximizedTabset(_e.getWindowId())!==void 0&&(Pt.display="none"),rt?(Pt.width=mt+"px",Pt.minWidth=mt+"px"):(Pt.height=mt+"px",Pt.minHeight=mt+"px");let Rt;if(!it&&tt.getModel().isSplitterEnableHandle()&&(Rt=jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__SPLITTER_HANDLE)+" "+At(rt?CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_VERT)})),vt===0)return jsxRuntimeExports.jsx("div",{className:Tt,style:Pt,ref:at,"data-layout-path":tt.getPath()+"/s"+(et-1),onPointerDown:yt,children:Rt});{const $t={};tt.getOrientation()===Orientation.HORZ?($t.height="100%",$t.width=mt+vt+"px",$t.cursor="ew-resize"):($t.height=mt+vt+"px",$t.width="100%",$t.cursor="ns-resize");const Dt=At(CLASSES.FLEXLAYOUT__SPLITTER_EXTRA);return jsxRuntimeExports.jsx("div",{className:Tt,style:Pt,ref:at,"data-layout-path":tt.getPath()+"/s"+(et-1),onPointerDown:yt,children:jsxRuntimeExports.jsx("div",{style:$t,ref:st,className:Dt,onPointerDown:yt})})}};function BorderTab(nt){const{layout:_e,border:tt,show:et}=nt,rt=reactExports$1.useRef(null),it=reactExports$1.useRef(void 0);reactExports$1.useLayoutEffect(()=>{const ct=_e.getBoundingClientRect(rt.current);!isNaN(ct.x)&&ct.width>0&&(tt.getContentRect().equals(ct)||(tt.setContentRect(ct),splitterDragging?(it.current&&clearTimeout(it.current),it.current=setTimeout(()=>{_e.redrawInternal("border content rect "+ct),it.current=void 0},50)):_e.redrawInternal("border content rect "+ct)))});let ot=!0;const at={};tt.getOrientation()===Orientation.HORZ?(at.width=tt.getSize(),at.minWidth=tt.getMinSize(),at.maxWidth=tt.getMaxSize()):(at.height=tt.getSize(),at.minHeight=tt.getMinSize(),at.maxHeight=tt.getMaxSize(),ot=!1),at.display=et?"flex":"none";const st=_e.getClassName(CLASSES.FLEXLAYOUT__BORDER_TAB_CONTENTS);return tt.getLocation()===DockLocation.LEFT||tt.getLocation()===DockLocation.TOP?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{ref:rt,style:at,className:st}),et&&jsxRuntimeExports.jsx(Splitter,{layout:_e,node:tt,index:0,horizontal:ot})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[et&&jsxRuntimeExports.jsx(Splitter,{layout:_e,node:tt,index:0,horizontal:ot}),jsxRuntimeExports.jsx("div",{ref:rt,style:at,className:st})]})}var ICloseType=(nt=>(nt[nt.Visible=1]="Visible",nt[nt.Always=2]="Always",nt[nt.Selected=3]="Selected",nt))(ICloseType||{});const BorderButton=nt=>{const{layout:_e,node:tt,selected:et,border:rt,icons:it,path:ot}=nt,at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=Pt=>{tt.isEnableDrag()?(Pt.stopPropagation(),_e.setDragNode(Pt.nativeEvent,tt)):Pt.preventDefault()},ut=Pt=>{Pt.stopPropagation(),_e.clearDragMain()},dt=Pt=>{isAuxMouseEvent(Pt)&&_e.auxMouseClick(tt,Pt)},ht=Pt=>{_e.showContextMenu(tt,Pt)},ft=()=>{_e.doAction(Actions.selectTab(tt.getId()))},pt=()=>{const Pt=tt.getCloseType();return!!(et||Pt===ICloseType.Always||Pt===ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},mt=Pt=>{pt()&&(_e.doAction(Actions.deleteTab(tt.getId())),Pt.stopPropagation())},vt=Pt=>{Pt.stopPropagation()};reactExports$1.useLayoutEffect(()=>{tt.setTabRect(_e.getBoundingClientRect(at.current)),_e.getEditingTab()===tt&&st.current.select()});const _t=Pt=>{Pt.stopPropagation()},yt=Pt=>{Pt.code==="Escape"?_e.setEditingTab(void 0):(Pt.code==="Enter"||Pt.code==="NumpadEnter")&&(_e.setEditingTab(void 0),_e.doAction(Actions.renameTab(tt.getId(),Pt.target.value)))},bt=_e.getClassName;let St=bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON)+" "+bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_+rt);et?St+=" "+bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON__SELECTED):St+=" "+bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),tt.getClassName()!==void 0&&(St+=" "+tt.getClassName());let xt=0;tt.getModel().isEnableRotateBorderIcons()===!1&&(rt==="left"?xt=90:rt==="right"&&(xt=-90));const Ct=getRenderStateEx(_e,tt,xt);let Et=Ct.content?jsxRuntimeExports.jsx("div",{className:bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT),children:Ct.content}):null;const At=Ct.leading?jsxRuntimeExports.jsx("div",{className:bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING),children:Ct.leading}):null;if(_e.getEditingTab()===tt&&(Et=jsxRuntimeExports.jsx("input",{ref:st,className:bt(CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":ot+"/textbox",type:"text",autoFocus:!0,defaultValue:tt.getName(),onKeyDown:yt,onPointerDown:_t})),tt.isEnableClose()){const Pt=_e.i18nName(I18nLabel.Close_Tab);Ct.buttons.push(jsxRuntimeExports.jsx("div",{"data-layout-path":ot+"/button/close",title:Pt,className:bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onPointerDown:vt,onClick:mt,children:typeof it.close=="function"?it.close(tt):it.close},"close"))}return jsxRuntimeExports.jsxs("div",{ref:at,"data-layout-path":ot,className:St,onClick:ft,onAuxClick:dt,onContextMenu:ht,title:tt.getHelpText(),draggable:!0,onDragStart:ct,onDragEnd:ut,children:[At,Et,Ct.buttons]})},TabButtonStamp=nt=>{const{layout:_e,node:tt}=nt,et=_e.getClassName,rt=et(CLASSES.FLEXLAYOUT__TAB_BUTTON_STAMP),it=getRenderStateEx(_e,tt),ot=it.content?jsxRuntimeExports.jsx("div",{className:et(CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT),children:it.content}):tt.getNameForOverflowMenu(),at=it.leading?jsxRuntimeExports.jsx("div",{className:et(CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING),children:it.leading}):null;return jsxRuntimeExports.jsxs("div",{className:rt,title:tt.getHelpText(),children:[at,ot]})};function showPopup(nt,_e,tt,et,rt){const it=rt.getRootDiv(),ot=rt.getClassName,at=nt.ownerDocument,st=nt.getBoundingClientRect(),ct=(it==null?void 0:it.getBoundingClientRect())??new DOMRect(0,0,100,100),ut=at.createElement("div");ut.className=ot(CLASSES.FLEXLAYOUT__POPUP_MENU_CONTAINER),st.left<ct.left+ct.width/2?ut.style.left=st.left-ct.left+"px":ut.style.right=ct.right-st.right+"px",st.top<ct.top+ct.height/2?ut.style.top=st.top-ct.top+"px":ut.style.bottom=ct.bottom-st.bottom+"px",rt.showOverlay(!0),it&&it.appendChild(ut);const dt=()=>{rt.hideControlInPortal(),rt.showOverlay(!1),it&&it.removeChild(ut),ut.removeEventListener("pointerdown",ht),at.removeEventListener("pointerdown",ft)},ht=pt=>{pt.stopPropagation()},ft=pt=>{dt()};ut.addEventListener("pointerdown",ht),at.addEventListener("pointerdown",ft),rt.showControlInPortal(jsxRuntimeExports.jsx(PopupMenu,{currentDocument:at,parentNode:_e,onSelect:et,onHide:dt,items:tt,classNameMapper:ot,layout:rt}),ut)}const PopupMenu=nt=>{const{parentNode:_e,items:tt,onHide:et,onSelect:rt,classNameMapper:it,layout:ot}=nt,at=reactExports$1.useRef(null);reactExports$1.useEffect(()=>{at.current&&at.current.focus()},[]);const st=(ft,pt)=>{rt(ft),et(),pt.stopPropagation()},ct=(ft,pt)=>{ft.stopPropagation(),ot.setDragNode(ft.nativeEvent,pt),setTimeout(()=>{et()},0)},ut=ft=>{ot.clearDragMain()},dt=ft=>{ft.key==="Escape"&&et()},ht=tt.map((ft,pt)=>{let mt=it(CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM);return _e.getSelected()===ft.index&&(mt+=" "+it(CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM__SELECTED)),jsxRuntimeExports.jsx("div",{className:mt,"data-layout-path":"/popup-menu/tb"+pt,onClick:vt=>st(ft,vt),draggable:!0,onDragStart:vt=>ct(vt,ft.node),onDragEnd:ut,title:ft.node.getHelpText(),children:jsxRuntimeExports.jsx(TabButtonStamp,{node:ft.node,layout:ot})},ft.index)});return jsxRuntimeExports.jsx("div",{className:it(CLASSES.FLEXLAYOUT__POPUP_MENU),ref:at,tabIndex:0,onKeyDown:dt,"data-layout-path":"/popup-menu",children:ht})},useTabOverflow=(nt,_e,tt,et,rt,it)=>{const[ot,at]=reactExports$1.useState([]),[st,ct]=reactExports$1.useState(!1),[ut,dt]=reactExports$1.useState(!1),ht=reactExports$1.useRef(null),ft=reactExports$1.useRef(!1),pt=reactExports$1.useRef(void 0),mt=reactExports$1.useRef([]),vt=reactExports$1.useRef(0),_t=reactExports$1.useRef(!1);mt.current=ot,reactExports$1.useLayoutEffect(()=>{et.current&&Nt(0)},[_e.getId()]),reactExports$1.useLayoutEffect(()=>{ft.current=!1},[_e.getSelectedNode(),_e.getRect().width,_e.getRect().height]),reactExports$1.useLayoutEffect(()=>{Rt(),ft.current===!1&&bt(),St(),xt()}),reactExports$1.useEffect(()=>{var jt;return(jt=ht.current)==null||jt.addEventListener("wheel",yt,{passive:!1}),()=>{var Ht;(Ht=ht.current)==null||Ht.removeEventListener("wheel",yt)}},[ht.current]);const yt=jt=>{jt.preventDefault()};function bt(){const jt=_e.getSelectedNode();if(jt&&et.current){const Ht=nt.getBoundingClientRect(et.current),qt=jt.getTabRect();let tn=Lt(Ht)-Lt(qt);tn>0||Bt(qt)>Bt(Ht)?(Nt(Vt(et.current)-tn),_t.current=!0):(tn=Mt(qt)-Mt(Ht),tn>0&&(Nt(Vt(et.current)+tn),_t.current=!0))}}const St=()=>{if(et.current&&rt.current){const jt=et.current,Ht=rt.current,qt=It(jt),tn=Ot(jt),Xt=Vt(jt);if(tn>qt&&tn>0){let sn=qt*qt/tn,Zt=0;sn<20&&(Zt=20-sn,sn=20);const cn=Xt*(qt-Zt)/tn;tt===Orientation.HORZ?(Ht.style.width=sn+"px",Ht.style.left=cn+"px"):(Ht.style.height=sn+"px",Ht.style.top=cn+"px"),Ht.style.display="block"}else Ht.style.display="none";tt===Orientation.HORZ?Ht.style.bottom="0px":Ht.style.right="0px"}},xt=()=>{const Ht=$t().length>0;Ht!==st&&ct(Ht),pt.current===void 0&&(pt.current=setTimeout(()=>{const qt=$t();arraysEqual(qt,mt.current)||at(qt),pt.current=void 0},100))},Ct=()=>{_t.current||(ft.current=!0),_t.current=!1,St(),xt()},Et=jt=>{var Ht;jt.stopPropagation(),rt.current.setPointerCapture(jt.pointerId);const qt=(Ht=rt.current)==null?void 0:Ht.getBoundingClientRect();tt===Orientation.HORZ?vt.current=jt.clientX-qt.x:vt.current=jt.clientY-qt.y,startDrag(jt.currentTarget.ownerDocument,jt,At,Pt,Tt)},At=(jt,Ht)=>{if(et.current&&rt.current){const qt=et.current,tn=rt.current,Xt=It(qt),sn=Ot(qt),Zt=It(tn),cn=qt.getBoundingClientRect();let _n=0;if(tt===Orientation.HORZ?_n=jt-cn.x-vt.current:_n=Ht-cn.y-vt.current,_n=Math.max(0,Math.min(sn-Zt,_n)),Xt>0){const gn=_n*sn/Xt;Nt(gn)}}},Pt=()=>{},Tt=()=>{},Rt=()=>{if(et.current){const Ht=et.current.firstElementChild,qt=ut?10:0,tn=It(Ht)+qt>It(et.current);tn!==ut&&dt(tn)}},$t=()=>{const jt=[];if(et.current){const Ht=et.current,qt=Ht.getBoundingClientRect(),tn=Lt(qt)-1,Xt=Mt(qt)+1,sn=Ht.firstElementChild;let Zt=0;Array.from(sn.children).forEach(cn=>{const _n=cn.getBoundingClientRect();cn.classList.contains(it)&&((Lt(_n)<tn||Mt(_n)>Xt)&&jt.push(Zt),Zt++)})}return jt},Dt=jt=>{if(et.current){if(_e.getChildren().length===0)return;let Ht=0;if(Math.abs(jt.deltaY)>0){Ht=-jt.deltaY,jt.deltaMode===1&&(Ht*=40);const qt=Vt(et.current)-Ht,tn=Ot(et.current)-It(et.current),Xt=Math.max(0,Math.min(tn,qt));Nt(Xt),jt.stopPropagation()}}},Lt=jt=>tt===Orientation.HORZ?jt.x:jt.y,Mt=jt=>tt===Orientation.HORZ?jt.right:jt.bottom,It=jt=>tt===Orientation.HORZ?jt.clientWidth:jt.clientHeight,Bt=jt=>tt===Orientation.HORZ?jt.width:jt.height,Ot=jt=>tt===Orientation.HORZ?jt.scrollWidth:jt.scrollHeight,Nt=jt=>{tt===Orientation.HORZ?et.current.scrollLeft=jt:et.current.scrollTop=jt},Vt=jt=>tt===Orientation.HORZ?jt.scrollLeft:jt.scrollTop;return{selfRef:ht,userControlledPositionRef:ft,onScroll:Ct,onScrollPointerDown:Et,hiddenTabs:ot,onMouseWheel:Dt,isDockStickyButtons:ut,isShowHiddenTabs:st}};function arraysEqual(nt,_e){return nt.length===_e.length&&nt.every((tt,et)=>tt===_e[et])}const BorderTabSet=nt=>{const{border:_e,layout:tt,size:et}=nt,rt=reactExports$1.useRef(null),it=reactExports$1.useRef(null),ot=reactExports$1.useRef(null),at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=tt.getIcons();reactExports$1.useLayoutEffect(()=>{_e.setTabHeaderRect(tt.getBoundingClientRect(ut.current))});const{selfRef:ut,userControlledPositionRef:dt,onScroll:ht,onScrollPointerDown:ft,hiddenTabs:pt,onMouseWheel:mt,isDockStickyButtons:vt,isShowHiddenTabs:_t}=useTabOverflow(tt,_e,Orientation.flip(_e.getOrientation()),st,it,tt.getClassName(CLASSES.FLEXLAYOUT__BORDER_BUTTON)),yt=qt=>{isAuxMouseEvent(qt)&&tt.auxMouseClick(_e,qt)},bt=qt=>{tt.showContextMenu(_e,qt)},St=qt=>{qt.stopPropagation()},xt=qt=>{const tn=tt.getShowOverflowMenu(),Xt=pt.map(sn=>({index:sn,node:_e.getChildren()[sn]}));if(tn!==void 0)tn(_e,qt,Xt,Ct);else{const sn=ot.current;showPopup(sn,_e,Xt,Ct,tt)}qt.stopPropagation()},Ct=qt=>{tt.doAction(Actions.selectTab(qt.node.getId())),dt.current=!1},Et=qt=>{const tn=_e.getChildren()[_e.getSelected()];tn!==void 0&&tt.doAction(Actions.popoutTab(tn.getId())),qt.stopPropagation()},At=tt.getClassName,Pt=[],Tt=qt=>{const tn=_e.getSelected()===qt,Xt=_e.getChildren()[qt];Pt.push(jsxRuntimeExports.jsx(BorderButton,{layout:tt,border:_e.getLocation().getName(),node:Xt,path:_e.getPath()+"/tb"+qt,selected:tn,icons:ct},Xt.getId())),qt<_e.getChildren().length-1&&Pt.push(jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER)},"divider"+qt))};for(let qt=0;qt<_e.getChildren().length;qt++)Tt(qt);let Rt=At(CLASSES.FLEXLAYOUT__BORDER)+" "+At(CLASSES.FLEXLAYOUT__BORDER_+_e.getLocation().getName());_e.getClassName()!==void 0&&(Rt+=" "+_e.getClassName());let $t,Dt=[],Lt=[];const Mt={leading:$t,buttons:Dt,stickyButtons:Lt,overflowPosition:void 0};if(tt.customizeTabSet(_e,Mt),$t=Mt.leading,Lt=Mt.stickyButtons,Dt=Mt.buttons,Mt.overflowPosition===void 0&&(Mt.overflowPosition=Lt.length),Lt.length>0&&(vt?Dt=[...Lt,...Dt]:Pt.push(jsxRuntimeExports.jsx("div",{ref:at,onPointerDown:St,onDragStart:qt=>{qt.preventDefault()},className:At(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER),children:Lt},"sticky_buttons_container"))),_t){const qt=tt.i18nName(I18nLabel.Overflow_Menu_Tooltip);let tn;if(typeof ct.more=="function"){const Xt=pt.map(sn=>({index:sn,node:_e.getChildren()[sn]}));tn=ct.more(_e,Xt)}else tn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ct.more,jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT),children:pt.length>0?pt.length:""})]});Dt.splice(Math.min(Mt.overflowPosition,Dt.length),0,jsxRuntimeExports.jsx("button",{ref:ot,className:At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+_e.getLocation().getName()),title:qt,onClick:xt,onPointerDown:St,children:tn},"overflowbutton"))}const It=_e.getSelected();if(It!==-1){const qt=_e.getChildren()[It];if(qt!==void 0&&tt.isSupportsPopout()&&qt.isEnablePopout()){const tn=tt.i18nName(I18nLabel.Popout_Tab);Dt.push(jsxRuntimeExports.jsx("button",{title:tn,className:At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:Et,onPointerDown:St,children:typeof ct.popout=="function"?ct.popout(qt):ct.popout},"popout"))}}const Bt=jsxRuntimeExports.jsx("div",{ref:rt,className:At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_+_e.getLocation().getName()),children:Dt},"toolbar");let Ot={},Nt={};const Vt=et-1;_e.getLocation()===DockLocation.LEFT?(Ot={right:"100%",top:0},Nt={width:Vt,overflowY:"auto"}):_e.getLocation()===DockLocation.RIGHT?(Ot={left:"100%",top:0},Nt={width:Vt,overflowY:"auto"}):(Ot={left:0},Nt={height:Vt,overflowX:"auto"});let jt;_e.isEnableTabScrollbar()&&(jt=jsxRuntimeExports.jsx("div",{ref:it,className:At(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR),onPointerDown:ft}));let Ht;return $t&&(Ht=jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__BORDER_LEADING),children:$t})),jsxRuntimeExports.jsxs("div",{ref:ut,style:{display:"flex",flexDirection:_e.getOrientation()===Orientation.VERT?"row":"column"},className:Rt,"data-layout-path":_e.getPath(),onClick:yt,onAuxClick:yt,onContextMenu:bt,onWheel:mt,children:[Ht,jsxRuntimeExports.jsxs("div",{className:At(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER),children:[jsxRuntimeExports.jsx("div",{ref:st,className:At(CLASSES.FLEXLAYOUT__BORDER_INNER)+" "+At(CLASSES.FLEXLAYOUT__BORDER_INNER_+_e.getLocation().getName()),style:Nt,onScroll:ht,children:jsxRuntimeExports.jsx("div",{style:Ot,className:At(CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+At(CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+_e.getLocation().getName()),children:Pt})}),jt]}),Bt]})},DragContainer=nt=>{const{layout:_e,node:tt}=nt,et=reactExports$1.useRef(null);reactExports$1.useEffect(()=>{tt.setTabStamp(et.current)},[tt,et.current]);const rt=_e.getClassName,it=rt(CLASSES.FLEXLAYOUT__DRAG_RECT);return jsxRuntimeExports.jsx("div",{ref:et,className:it,children:jsxRuntimeExports.jsx(TabButtonStamp,{layout:_e,node:tt},tt.getId())})},PopoutWindow=nt=>{const{title:_e,layout:tt,layoutWindow:et,url:rt,onCloseWindow:it,onSetWindow:ot,children:at}=nt,st=reactExports$1.useRef(null),[ct,ut]=reactExports$1.useState(void 0),dt=new Map;return reactExports$1.useLayoutEffect(()=>{if(!st.current){const ht=et.windowId,ft=et.rect;st.current=window.open(rt,ht,`left=${ft.x},top=${ft.y},width=${ft.width},height=${ft.height}`),st.current?(et.window=st.current,ot(et,st.current),window.addEventListener("beforeunload",()=>{if(st.current){const pt=st.current;st.current=null,pt.close()}}),st.current.addEventListener("load",()=>{if(st.current){st.current.focus(),st.current.resizeTo(ft.width,ft.height),st.current.moveTo(ft.x,ft.y);const pt=st.current.document;pt.title=_e;const mt=pt.createElement("div");mt.className=CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,pt.body.appendChild(mt),copyStyles(pt,dt).then(()=>{ut(mt)});const vt=new MutationObserver(_t=>handleStyleMutations(_t,pt,dt));vt.observe(document.head,{childList:!0}),st.current.addEventListener("beforeunload",()=>{st.current&&(it(et),st.current=null,vt.disconnect())})}})):(console.warn(`Unable to open window ${rt}`),it(et))}return()=>{var ht;tt.getModel().getwindowsMap().has(et.windowId)||((ht=st.current)==null||ht.close(),st.current=null)}},[]),ct!==void 0?reactDomExports.createPortal(at,ct):null};function handleStyleMutations(nt,_e,tt){for(const et of nt)if(et.type==="childList"){for(const rt of et.addedNodes)(rt instanceof HTMLLinkElement||rt instanceof HTMLStyleElement)&&copyStyle(_e,rt,tt);for(const rt of et.removedNodes)if(rt instanceof HTMLLinkElement||rt instanceof HTMLStyleElement){const it=tt.get(rt);it&&_e.head.removeChild(it)}}}function copyStyles(nt,_e){const tt=[],et=document.querySelectorAll('style, link[rel="stylesheet"]');for(const rt of et)copyStyle(nt,rt,_e,tt);return Promise.all(tt)}function copyStyle(nt,_e,tt,et){if(_e instanceof HTMLLinkElement){const rt=_e.cloneNode(!0);nt.head.appendChild(rt),tt.set(_e,rt),et&&et.push(new Promise(it=>{rt.onload=()=>it(!0)}))}else if(_e instanceof HTMLStyleElement)try{const rt=_e.cloneNode(!0);nt.head.appendChild(rt),tt.set(_e,rt)}catch{}}const style={width:"1em",height:"1em",display:"flex",alignItems:"center"},CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",children:[jsxRuntimeExports.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]}),MaximizeIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})]}),OverflowIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"})]}),EdgeIcon=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100",children:jsxRuntimeExports.jsx("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"})}),PopoutIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 20 20",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),jsxRuntimeExports.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]}),RestoreIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})]}),AsterickIcon=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style,height:"24px",viewBox:"0 -960 960 960",width:"24px",children:jsxRuntimeExports.jsx("path",{fill:"var(--color-icon)",stroke:"var(--color-icon)",d:"M440-120v-264L254-197l-57-57 187-186H120v-80h264L197-706l57-57 186 187v-264h80v264l186-187 57 57-187 186h264v80H576l187 186-57 57-186-187v264h-80Z"})}),Overlay=nt=>{const{layout:_e,show:tt}=nt;return jsxRuntimeExports.jsx("div",{className:_e.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_OVERLAY),style:{display:tt?"flex":"none"}})},TabButton=nt=>{const{layout:_e,node:tt,selected:et,path:rt}=nt,it=reactExports$1.useRef(null),ot=reactExports$1.useRef(null),at=_e.getIcons();reactExports$1.useLayoutEffect(()=>{tt.setTabRect(_e.getBoundingClientRect(it.current)),_e.getEditingTab()===tt&&ot.current.select()});const st=Dt=>{tt.isEnableDrag()?(Dt.stopPropagation(),_e.setDragNode(Dt.nativeEvent,tt)):Dt.preventDefault()},ct=Dt=>{_e.clearDragMain()},ut=Dt=>{isAuxMouseEvent(Dt)&&_e.auxMouseClick(tt,Dt)},dt=Dt=>{_e.showContextMenu(tt,Dt)},ht=()=>{_e.doAction(Actions.selectTab(tt.getId()))},ft=Dt=>{tt.isEnableRename()&&(pt(),Dt.stopPropagation())},pt=()=>{_e.setEditingTab(tt),_e.getCurrentDocument().body.addEventListener("pointerdown",mt)},mt=Dt=>{Dt.target!==ot.current&&(_e.getCurrentDocument().body.removeEventListener("pointerdown",mt),_e.setEditingTab(void 0))},vt=()=>{const Dt=tt.getCloseType();return!!(et||Dt===ICloseType.Always||Dt===ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},_t=Dt=>{vt()&&(_e.doAction(Actions.deleteTab(tt.getId())),Dt.stopPropagation())},yt=Dt=>{Dt.stopPropagation()},bt=Dt=>{Dt.stopPropagation()},St=Dt=>{Dt.code==="Escape"?_e.setEditingTab(void 0):(Dt.code==="Enter"||Dt.code==="NumpadEnter")&&(_e.setEditingTab(void 0),_e.doAction(Actions.renameTab(tt.getId(),Dt.target.value)))},xt=_e.getClassName,Ct=tt.getParent(),Et=Ct.isEnableSingleTabStretch()&&Ct.getChildren().length===1,At=Et?CLASSES.FLEXLAYOUT__TAB_BUTTON_STRETCH:CLASSES.FLEXLAYOUT__TAB_BUTTON;let Pt=xt(At);Pt+=" "+xt(At+"_"+Ct.getTabLocation()),Et||(et?Pt+=" "+xt(At+"--selected"):Pt+=" "+xt(At+"--unselected")),tt.getClassName()!==void 0&&(Pt+=" "+tt.getClassName());const Tt=getRenderStateEx(_e,tt);let Rt=Tt.content?jsxRuntimeExports.jsx("div",{className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT),children:Tt.content}):null;const $t=Tt.leading?jsxRuntimeExports.jsx("div",{className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING),children:Tt.leading}):null;if(_e.getEditingTab()===tt&&(Rt=jsxRuntimeExports.jsx("input",{ref:ot,className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":rt+"/textbox",type:"text",autoFocus:!0,defaultValue:tt.getName(),onKeyDown:St,onPointerDown:bt})),tt.isEnableClose()&&!Et){const Dt=_e.i18nName(I18nLabel.Close_Tab);Tt.buttons.push(jsxRuntimeExports.jsx("div",{"data-layout-path":rt+"/button/close",title:Dt,className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING),onPointerDown:yt,onClick:_t,children:typeof at.close=="function"?at.close(tt):at.close},"close"))}return jsxRuntimeExports.jsxs("div",{ref:it,"data-layout-path":rt,className:Pt,onClick:ht,onAuxClick:ut,onContextMenu:dt,title:tt.getHelpText(),draggable:!0,onDragStart:st,onDragEnd:ct,onDoubleClick:ft,children:[$t,Rt,Tt.buttons]})},TabSet=nt=>{const{node:_e,layout:tt}=nt,et=reactExports$1.useRef(null),rt=reactExports$1.useRef(null),it=reactExports$1.useRef(null),ot=reactExports$1.useRef(null),at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=reactExports$1.useRef(null),ut=reactExports$1.useRef(void 0),dt=tt.getIcons();reactExports$1.useLayoutEffect(()=>{_e.setRect(tt.getBoundingClientRect(ht.current)),et.current&&_e.setTabStripRect(tt.getBoundingClientRect(et.current));const hn=tt.getBoundingClientRect(ot.current);!_e.getContentRect().equals(hn)&&!isNaN(hn.x)&&(_e.setContentRect(hn),splitterDragging?(ut.current&&clearTimeout(ut.current),ut.current=setTimeout(()=>{tt.redrawInternal("border content rect "+hn),ut.current=void 0},50)):tt.redrawInternal("border content rect "+hn))});const{selfRef:ht,userControlledPositionRef:ft,onScroll:pt,onScrollPointerDown:mt,hiddenTabs:vt,onMouseWheel:_t,isDockStickyButtons:yt,isShowHiddenTabs:bt}=useTabOverflow(tt,_e,Orientation.HORZ,it,rt,tt.getClassName(CLASSES.FLEXLAYOUT__TAB_BUTTON)),St=hn=>{const xn=tt.getShowOverflowMenu(),Un=vt.map(Ln=>({index:Ln,node:_e.getChildren()[Ln]}));if(xn!==void 0)xn(_e,hn,Un,xt);else{const Ln=st.current;showPopup(Ln,_e,Un,xt,tt)}hn.stopPropagation()},xt=hn=>{tt.doAction(Actions.selectTab(hn.node.getId())),ft.current=!1},Ct=hn=>{tt.getEditingTab()?hn.preventDefault():_e.isEnableDrag()?(hn.stopPropagation(),tt.setDragNode(hn.nativeEvent,_e)):hn.preventDefault()},Et=hn=>{isAuxMouseEvent(hn)||tt.doAction(Actions.setActiveTabset(_e.getId(),tt.getWindowId()))},At=hn=>{isAuxMouseEvent(hn)&&tt.auxMouseClick(_e,hn)},Pt=hn=>{tt.showContextMenu(_e,hn)},Tt=hn=>{hn.stopPropagation()},Rt=hn=>{_e.canMaximize()&&tt.maximize(_e),hn.stopPropagation()},$t=hn=>{tt.doAction(Actions.deleteTabset(_e.getId())),hn.stopPropagation()},Dt=hn=>{tt.doAction(Actions.deleteTab(_e.getChildren()[0].getId())),hn.stopPropagation()},Lt=hn=>{Bt!==void 0&&tt.doAction(Actions.popoutTab(Bt.getId())),hn.stopPropagation()},Mt=hn=>{_e.canMaximize()&&tt.maximize(_e)},It=tt.getClassName,Bt=_e.getSelectedNode(),Ot=_e.getPath(),Nt=[];if(_e.isEnableTabStrip())for(let hn=0;hn<_e.getChildren().length;hn++){const xn=_e.getChildren()[hn],Un=_e.getSelected()===hn;Nt.push(jsxRuntimeExports.jsx(TabButton,{layout:tt,node:xn,path:Ot+"/tb"+hn,selected:Un},xn.getId())),hn<_e.getChildren().length-1&&Nt.push(jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER)},"divider"+hn))}let Vt,jt=[],Ht=[];const qt={leading:Vt,stickyButtons:jt,buttons:Ht,overflowPosition:void 0};tt.customizeTabSet(_e,qt),Vt=qt.leading,jt=qt.stickyButtons,Ht=qt.buttons;const tn=_e.isEnableSingleTabStretch()&&_e.getChildren().length===1,Xt=tn&&_e.getChildren()[0].isEnableClose()||_e.isEnableClose();if(qt.overflowPosition===void 0&&(qt.overflowPosition=jt.length),jt.length>0&&(!_e.isEnableTabWrap()&&(yt||tn)?Ht=[...jt,...Ht]:Nt.push(jsxRuntimeExports.jsx("div",{ref:ct,onPointerDown:Tt,onDragStart:hn=>{hn.preventDefault()},className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER),children:jt},"sticky_buttons_container"))),!_e.isEnableTabWrap()&&bt){const hn=tt.i18nName(I18nLabel.Overflow_Menu_Tooltip);let xn;if(typeof dt.more=="function"){const Un=vt.map(Ln=>({index:Ln,node:_e.getChildren()[Ln]}));xn=dt.more(_e,Un)}else xn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[dt.more,jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT),children:vt.length>0?vt.length:""})]});Ht.splice(Math.min(qt.overflowPosition,Ht.length),0,jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/overflow",ref:st,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:hn,onClick:St,onPointerDown:Tt,children:xn},"overflowbutton"))}if(Bt!==void 0&&tt.isSupportsPopout()&&Bt.isEnablePopout()&&Bt.isEnablePopoutIcon()){const hn=tt.i18nName(I18nLabel.Popout_Tab);Ht.push(jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/popout",title:hn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:Lt,onPointerDown:Tt,children:typeof dt.popout=="function"?dt.popout(Bt):dt.popout},"popout"))}if(_e.canMaximize()){const hn=tt.i18nName(I18nLabel.Restore),xn=tt.i18nName(I18nLabel.Maximize);Ht.push(jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/max",title:_e.isMaximized()?hn:xn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(_e.isMaximized()?"max":"min")),onClick:Rt,onPointerDown:Tt,children:_e.isMaximized()?typeof dt.restore=="function"?dt.restore(_e):dt.restore:typeof dt.maximize=="function"?dt.maximize(_e):dt.maximize},"max"))}if(!_e.isMaximized()&&Xt){const hn=tn?tt.i18nName(I18nLabel.Close_Tab):tt.i18nName(I18nLabel.Close_Tabset);Ht.push(jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/close",title:hn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:tn?Dt:$t,onPointerDown:Tt,children:typeof dt.closeTabset=="function"?dt.closeTabset(_e):dt.closeTabset},"close"))}if(_e.isActive()&&_e.isEnableActiveIcon()){const hn=tt.i18nName(I18nLabel.Active_Tabset);Ht.push(jsxRuntimeExports.jsx("div",{"data-layout-path":Ot+"/button/active",title:hn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_ICON),children:typeof dt.activeTabset=="function"?dt.activeTabset(_e):dt.activeTabset},"active"))}const sn=jsxRuntimeExports.jsx("div",{ref:at,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onPointerDown:Tt,onDragStart:hn=>{hn.preventDefault()},children:Ht},"buttonbar");let Zt,cn=It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(_e.getClassNameTabStrip()!==void 0&&(cn+=" "+_e.getClassNameTabStrip()),cn+=" "+CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_+_e.getTabLocation(),_e.isActive()&&(cn+=" "+It(CLASSES.FLEXLAYOUT__TABSET_SELECTED)),_e.isMaximized()&&(cn+=" "+It(CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),tn){const hn=_e.getChildren()[0];hn.getTabSetClassName()!==void 0&&(cn+=" "+hn.getTabSetClassName())}let _n;if(Vt&&(_n=jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TABSET_LEADING),children:Vt})),_e.isEnableTabWrap())_e.isEnableTabStrip()&&(Zt=jsxRuntimeExports.jsxs("div",{className:cn,style:{flexWrap:"wrap",gap:"1px",marginTop:"2px"},ref:et,"data-layout-path":Ot+"/tabstrip",onPointerDown:Et,onDoubleClick:Mt,onContextMenu:Pt,onClick:At,onAuxClick:At,draggable:!0,onDragStart:Ct,children:[_n,Nt,jsxRuntimeExports.jsx("div",{style:{flexGrow:1}}),sn]}));else if(_e.isEnableTabStrip()){let hn;_e.isEnableTabScrollbar()&&(hn=jsxRuntimeExports.jsx("div",{ref:rt,className:It(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR),onPointerDown:mt})),Zt=jsxRuntimeExports.jsxs("div",{className:cn,ref:et,"data-layout-path":Ot+"/tabstrip",onPointerDown:Et,onDoubleClick:Mt,onContextMenu:Pt,onClick:At,onAuxClick:At,draggable:!0,onWheel:_t,onDragStart:Ct,children:[_n,jsxRuntimeExports.jsxs("div",{className:It(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER),children:[jsxRuntimeExports.jsx("div",{ref:it,className:It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_+_e.getTabLocation()),style:{overflowX:"auto",overflowY:"hidden"},onScroll:pt,children:jsxRuntimeExports.jsx("div",{style:{width:tn?"100%":"none"},className:It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+_e.getTabLocation()),children:Nt})}),hn]}),sn]})}let gn;if(_e.getChildren().length===0){const hn=tt.getTabSetPlaceHolderCallback();hn&&(gn=hn(_e))}let pn=jsxRuntimeExports.jsx("div",{ref:ot,className:It(CLASSES.FLEXLAYOUT__TABSET_CONTENT),children:gn});_e.getTabLocation()==="top"?pn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Zt,pn]}):pn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[pn,Zt]});const Tn={flexGrow:Math.max(1,_e.getWeight()*1e3),minWidth:_e.getMinWidth(),minHeight:_e.getMinHeight(),maxWidth:_e.getMaxWidth(),maxHeight:_e.getMaxHeight()};_e.getModel().getMaximizedTabset(tt.getWindowId())!==void 0&&!_e.isMaximized()&&(Tn.display="none");const In=jsxRuntimeExports.jsx("div",{ref:ht,className:It(CLASSES.FLEXLAYOUT__TABSET_CONTAINER),style:Tn,children:jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TABSET),"data-layout-path":Ot,children:pn})});return _e.isMaximized()&&tt.getMainElement()?reactDomExports.createPortal(jsxRuntimeExports.jsx("div",{style:{position:"absolute",display:"flex",top:0,left:0,bottom:0,right:0},children:In}),tt.getMainElement()):In},Row=nt=>{const{layout:_e,node:tt}=nt,et=reactExports$1.useRef(null),rt=tt.getOrientation()===Orientation.HORZ;reactExports$1.useLayoutEffect(()=>{tt.setRect(_e.getBoundingClientRect(et.current))});const it=[];let ot=0;for(const st of tt.getChildren())ot>0&&it.push(jsxRuntimeExports.jsx(Splitter,{layout:_e,node:tt,index:ot,horizontal:rt},"splitter"+ot)),st instanceof RowNode?it.push(jsxRuntimeExports.jsx(Row,{layout:_e,node:st},st.getId())):st instanceof TabSetNode&&it.push(jsxRuntimeExports.jsx(TabSet,{layout:_e,node:st},st.getId())),ot++;const at={flexGrow:Math.max(1,tt.getWeight()*1e3),minWidth:tt.getMinWidth(),minHeight:tt.getMinHeight(),maxWidth:tt.getMaxWidth(),maxHeight:tt.getMaxHeight()};return rt?at.flexDirection="row":at.flexDirection="column",jsxRuntimeExports.jsx("div",{ref:et,className:_e.getClassName(CLASSES.FLEXLAYOUT__ROW),style:at,children:it})},Tab=nt=>{const{layout:_e,selected:tt,node:et,path:rt}=nt,it=reactExports$1.useRef(null),ot=reactExports$1.useRef(!0),at=et.getParent(),st=at.getContentRect();reactExports$1.useLayoutEffect(()=>{const pt=et.getMoveableElement();it.current.appendChild(pt),et.setMoveableElement(pt);const mt=()=>{et.saveScrollPosition()};return pt.addEventListener("scroll",mt),it.current.addEventListener("pointerdown",ct),()=>{pt.removeEventListener("scroll",mt),it.current&&it.current.removeEventListener("pointerdown",ct),et.setVisible(!1)}},[]),reactExports$1.useEffect(()=>{et.isSelected()&&ot.current&&(et.restoreScrollPosition(),ot.current=!1)});const ct=()=>{const pt=et.getParent();pt instanceof TabSetNode&&(pt.isActive()||_e.doAction(Actions.setActiveTabset(pt.getId(),_e.getWindowId())))};et.setRect(st);const ut=_e.getClassName,dt={};st.styleWithPosition(dt);let ht=null;if(tt){if(et.setVisible(!0),document.hidden&&et.isEnablePopoutOverlay()){const pt={};st.styleWithPosition(pt),ht=jsxRuntimeExports.jsx("div",{style:pt,className:ut(CLASSES.FLEXLAYOUT__TAB_OVERLAY)})}}else dt.display="none",et.setVisible(!1);at instanceof TabSetNode&&et.getModel().getMaximizedTabset(_e.getWindowId())!==void 0&&(at.isMaximized()?dt.zIndex=10:dt.display="none"),at instanceof BorderNode&&(at.isShowing()||(dt.display="none"));let ft=ut(CLASSES.FLEXLAYOUT__TAB);return at instanceof BorderNode&&(ft+=" "+ut(CLASSES.FLEXLAYOUT__TAB_BORDER),ft+=" "+ut(CLASSES.FLEXLAYOUT__TAB_BORDER_+at.getLocation().getName())),et.getContentClassName()!==void 0&&(ft+=" "+et.getContentClassName()),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ht,jsxRuntimeExports.jsx("div",{ref:it,style:dt,className:ft,"data-layout-path":rt})]})};class ErrorBoundary extends reactExports$1.Component{constructor(_e){super(_e),__publicField(this,"retry",()=>{this.setState({hasError:!1})}),this.state={hasError:!1}}static getDerivedStateFromError(_e){return{hasError:!0}}componentDidCatch(_e,tt){console.debug(_e),console.debug(tt)}render(){return this.state.hasError?jsxRuntimeExports.jsx("div",{className:CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER,children:jsxRuntimeExports.jsx("div",{className:CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT,children:jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[this.props.message,jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("button",{onClick:this.retry,children:this.props.retryText})})]})})}):this.props.children}}const SizeTracker=reactExports$1.memo(({layout:nt,node:_e})=>jsxRuntimeExports.jsx(ErrorBoundary,{message:nt.i18nName(I18nLabel.Error_rendering_component),retryText:nt.i18nName(I18nLabel.Error_rendering_component_retry),children:nt.props.factory(_e)}),arePropsEqual);function arePropsEqual(nt,_e){return!(_e.visible&&(!nt.rect.equalSize(_e.rect)||nt.forceRevision!==_e.forceRevision||nt.tabsRevision!==_e.tabsRevision))}const _LayoutInternal=class pr extends reactExports$1.Component{constructor(_e){super(_e),__publicField(this,"selfRef"),__publicField(this,"moveablesRef"),__publicField(this,"findBorderBarSizeRef"),__publicField(this,"mainRef"),__publicField(this,"previousModel"),__publicField(this,"orderedTabIds"),__publicField(this,"orderedTabMoveableIds"),__publicField(this,"moveableElementMap",new Map),__publicField(this,"dropInfo"),__publicField(this,"outlineDiv"),__publicField(this,"currentDocument"),__publicField(this,"currentWindow"),__publicField(this,"supportsPopout"),__publicField(this,"popoutURL"),__publicField(this,"icons"),__publicField(this,"resizeObserver"),__publicField(this,"dragEnterCount",0),__publicField(this,"dragging",!1),__publicField(this,"windowId"),__publicField(this,"layoutWindow"),__publicField(this,"mainLayout"),__publicField(this,"isMainWindow"),__publicField(this,"isDraggingOverWindow"),__publicField(this,"styleObserver"),__publicField(this,"popoutWindowName"),__publicField(this,"updateLayoutMetrics",()=>{if(this.findBorderBarSizeRef.current){const tt=this.findBorderBarSizeRef.current.getBoundingClientRect().height;tt!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:tt})}}),__publicField(this,"onModelChange",tt=>{this.redrawInternal("model change"),this.props.onModelChange&&this.props.onModelChange(this.props.model,tt)}),__publicField(this,"updateRect",()=>{if(this.selfRef.current){const tt=Rect.fromDomRect(this.selfRef.current.getBoundingClientRect());!tt.equals(this.state.rect)&&tt.width!==0&&tt.height!==0&&(this.setState({rect:tt}),this.windowId!==Model.MAIN_WINDOW_ID&&this.redrawInternal("rect updated"))}}),__publicField(this,"getClassName",tt=>this.props.classNameMapper===void 0?tt:this.props.classNameMapper(tt)),__publicField(this,"onCloseWindow",tt=>{this.doAction(Actions.closeWindow(tt.windowId))}),__publicField(this,"onSetWindow",(tt,et)=>{}),__publicField(this,"showControlInPortal",(tt,et)=>{const rt=reactDomExports.createPortal(tt,et);this.setState({portal:rt})}),__publicField(this,"hideControlInPortal",()=>{this.setState({portal:void 0})}),__publicField(this,"getIcons",()=>this.icons),__publicField(this,"setDragNode",(tt,et)=>{if(pr.dragState=new DragState(this.mainLayout,"internal",et,void 0,void 0),tt.dataTransfer.setData("text/plain","--flexlayout--"),tt.dataTransfer.effectAllowed="copyMove",tt.dataTransfer.dropEffect="move",this.dragEnterCount=0,et instanceof TabSetNode){let rt=!1,it=this.i18nName(I18nLabel.Move_Tabset);if(et.getChildren().length>0&&(it=this.i18nName(I18nLabel.Move_Tabs).replace("?",String(et.getChildren().length))),this.props.onRenderDragRect){const ot=this.props.onRenderDragRect(it,et,void 0);ot&&(this.setDragComponent(tt,ot,10,10),rt=!0)}rt||this.setDragComponent(tt,it,10,10)}else{const it=tt.target.getBoundingClientRect(),ot=tt.clientX-it.left,at=tt.clientY-it.top,st=et==null?void 0:et.getParent(),ct=st instanceof BorderNode&&st.getOrientation()===Orientation.HORZ,ut=ct?10:ot,dt=ct?10:at;let ht=!1;if(this.props.onRenderDragRect){const ft=jsxRuntimeExports.jsx(TabButtonStamp,{layout:this,node:et},et.getId()),pt=this.props.onRenderDragRect(ft,et,void 0);pt&&(this.setDragComponent(tt,pt,ut,dt),ht=!0)}ht||(isSafari()?this.setDragComponent(tt,jsxRuntimeExports.jsx(TabButtonStamp,{node:et,layout:this}),ut,dt):tt.dataTransfer.setDragImage(et.getTabStamp(),ut,dt))}}),__publicField(this,"onDragEnterRaw",tt=>{this.dragEnterCount++,this.dragEnterCount===1&&this.onDragEnter(tt)}),__publicField(this,"onDragLeaveRaw",tt=>{this.dragEnterCount--,this.dragEnterCount===0&&this.onDragLeave(tt)}),__publicField(this,"onDragEnter",tt=>{if(!pr.dragState&&this.props.onExternalDrag){const et=this.props.onExternalDrag(tt);if(et){const rt=TabNode.fromJson(et.json,this.props.model,!1);pr.dragState=new DragState(this.mainLayout,"external",rt,et.json,et.onDrop)}}if(pr.dragState){if(this.windowId!==Model.MAIN_WINDOW_ID&&pr.dragState.mainLayout===this.mainLayout&&pr.dragState.mainLayout.setDraggingOverWindow(!0),pr.dragState.mainLayout!==this.mainLayout)return;tt.preventDefault(),this.dropInfo=void 0;const et=this.selfRef.current;this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(CLASSES.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden";const rt=this.props.model.getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${rt}s, left ${rt}s, width ${rt}s, height ${rt}s`,et.appendChild(this.outlineDiv),this.dragging=!0,this.showOverlay(!0),!this.isDraggingOverWindow&&this.props.model.getMaximizedTabset(this.windowId)===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()});const it=this.selfRef.current.getBoundingClientRect();new Rect(tt.clientX-it.left,tt.clientY-it.top,1,1).positionElement(this.outlineDiv)}}),__publicField(this,"onDragOver",tt=>{var et;if(this.dragging&&!this.isDraggingOverWindow){tt.preventDefault();const rt=(et=this.selfRef.current)==null?void 0:et.getBoundingClientRect(),it={x:tt.clientX-((rt==null?void 0:rt.left)??0),y:tt.clientY-((rt==null?void 0:rt.top)??0)};this.checkForBorderToShow(it.x,it.y);const ot=this.props.model.findDropTargetNode(this.windowId,pr.dragState.dragNode,it.x,it.y);ot&&(this.dropInfo=ot,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(ot.className),ot.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))}}),__publicField(this,"onDragLeave",tt=>{this.dragging&&(this.windowId!==Model.MAIN_WINDOW_ID&&pr.dragState.mainLayout.setDraggingOverWindow(!1),this.clearDragLocal())}),__publicField(this,"onDrop",tt=>{if(this.dragging){tt.preventDefault();const et=pr.dragState;if(this.dropInfo)if(et.dragJson!==void 0){const rt=this.doAction(Actions.addNode(et.dragJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));et.fnNewNodeDropped!==void 0&&et.fnNewNodeDropped(rt,tt)}else et.dragNode!==void 0&&this.doAction(Actions.moveNode(et.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.mainLayout.clearDragMain()}this.dragEnterCount=0}),this.orderedTabIds=[],this.orderedTabMoveableIds=[],this.selfRef=reactExports$1.createRef(),this.moveablesRef=reactExports$1.createRef(),this.mainRef=reactExports$1.createRef(),this.findBorderBarSizeRef=reactExports$1.createRef(),this.supportsPopout=_e.supportsPopout!==void 0?_e.supportsPopout:defaultSupportsPopout,this.popoutURL=_e.popoutURL?_e.popoutURL:"popout.html",this.icons={...defaultIcons,..._e.icons},this.windowId=_e.windowId?_e.windowId:Model.MAIN_WINDOW_ID,this.mainLayout=this.props.mainLayout?this.props.mainLayout:this,this.isDraggingOverWindow=!1,this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.popoutWindowName=this.props.popoutWindowName||"Popout Window",this.state={rect:Rect.empty(),editingTab:void 0,showEdges:!1,showOverlay:!1,calculatedBorderBarSize:29,layoutRevision:0,forceRevision:0,showHiddenBorder:DockLocation.CENTER},this.isMainWindow=this.windowId===Model.MAIN_WINDOW_ID}componentDidMount(){if(this.updateRect(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.layoutWindow.window=this.currentWindow,this.layoutWindow.toScreenRectFunction=_e=>this.getScreenRect(_e),this.resizeObserver=new ResizeObserver(_e=>{requestAnimationFrame(()=>{this.updateRect()})}),this.selfRef.current&&this.resizeObserver.observe(this.selfRef.current),this.isMainWindow)this.props.model.addChangeListener(this.onModelChange),this.updateLayoutMetrics();else{this.currentWindow.addEventListener("resize",()=>{this.updateRect()});const _e=this.props.mainLayout.getRootDiv(),tt=this.selfRef.current;copyInlineStyles(_e,tt),this.styleObserver=new MutationObserver(()=>{copyInlineStyles(_e,tt)&&this.redraw("mutation observer")}),this.styleObserver.observe(_e,{attributeFilter:["style"]})}document.addEventListener("visibilitychange",()=>{for(const[_e,tt]of this.props.model.getwindowsMap())tt.layout&&this.redraw("visibility change")})}componentDidUpdate(){this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.isMainWindow&&(this.props.model!==this.previousModel&&(this.previousModel!==void 0&&this.previousModel.removeChangeListener(this.onModelChange),this.props.model.getwindowsMap().get(this.windowId).layout=this,this.props.model.addChangeListener(this.onModelChange),this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.layoutWindow.toScreenRectFunction=_e=>this.getScreenRect(_e),this.previousModel=this.props.model,this.tidyMoveablesMap()),this.updateLayoutMetrics())}componentWillUnmount(){var _e,tt;this.selfRef.current&&((_e=this.resizeObserver)==null||_e.unobserve(this.selfRef.current)),this.isMainWindow&&this.props.model.removeChangeListener(this.onModelChange),(tt=this.styleObserver)==null||tt.disconnect()}render(){if(!this.selfRef.current)return jsxRuntimeExports.jsxs("div",{ref:this.selfRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT),children:[jsxRuntimeExports.jsx("div",{ref:this.moveablesRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_MOVEABLES)},"__moveables__"),this.renderMetricsElements()]});const _e=this.props.model;_e.getRoot(this.windowId).calcMinMaxSize(),_e.getRoot(this.windowId).setPaths(""),_e.getBorderSet().setPaths();const tt=this.renderLayout(),et=this.renderBorders(tt),rt=this.renderTabs(),it=this.reorderComponents(rt,this.orderedTabIds);let ot=null,at=null,st=null,ct=null;if(this.isMainWindow){ot=this.renderWindows(),ct=this.renderMetricsElements();const ut=this.renderTabMoveables();at=this.reorderComponents(ut,this.orderedTabMoveableIds),st=jsxRuntimeExports.jsx("div",{className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_TAB_STAMPS),children:this.renderTabStamps()},"__tabStamps__")}return jsxRuntimeExports.jsxs("div",{ref:this.selfRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT),onDragEnter:this.onDragEnterRaw,onDragLeave:this.onDragLeaveRaw,onDragOver:this.onDragOver,onDrop:this.onDrop,children:[jsxRuntimeExports.jsx("div",{ref:this.moveablesRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_MOVEABLES)},"__moveables__"),ct,jsxRuntimeExports.jsx(Overlay,{layout:this,show:this.state.showOverlay},"__overlay__"),et,it,at,st,this.state.portal,ot]})}renderBorders(_e){const tt=this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_MAIN),et=this.props.model.getBorderSet().getBorderMap();if(this.isMainWindow&&et.size>0){_e=jsxRuntimeExports.jsx("div",{className:tt,ref:this.mainRef,children:_e});const rt=new Map,it=new Map;for(const[st,ct]of DockLocation.values){const ut=et.get(ct);ut&&ut.isShowing()&&(!ut.isAutoHide()||ut.isAutoHide()&&(ut.getChildren().length>0||this.state.showHiddenBorder===ct))&&(rt.set(ct,jsxRuntimeExports.jsx(BorderTabSet,{layout:this,border:ut,size:this.state.calculatedBorderBarSize})),it.set(ct,jsxRuntimeExports.jsx(BorderTab,{layout:this,border:ut,show:ut.getSelected()!==-1})))}const ot=this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER),at=this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER);if(this.props.model.getBorderSet().getLayoutHorizontal()){const st=jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"column"},children:[it.get(DockLocation.TOP),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"row"},children:[it.get(DockLocation.LEFT),_e,it.get(DockLocation.RIGHT)]}),it.get(DockLocation.BOTTOM)]});return jsxRuntimeExports.jsxs("div",{className:ot,style:{flexDirection:"column"},children:[rt.get(DockLocation.TOP),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"row"},children:[rt.get(DockLocation.LEFT),st,rt.get(DockLocation.RIGHT)]}),rt.get(DockLocation.BOTTOM)]})}else{const st=jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"row"},children:[it.get(DockLocation.LEFT),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"column"},children:[it.get(DockLocation.TOP),_e,it.get(DockLocation.BOTTOM)]}),it.get(DockLocation.RIGHT)]});return jsxRuntimeExports.jsxs("div",{className:ot,style:{flexDirection:"row"},children:[rt.get(DockLocation.LEFT),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"column"},children:[rt.get(DockLocation.TOP),st,rt.get(DockLocation.BOTTOM)]}),rt.get(DockLocation.RIGHT)]})}}else return jsxRuntimeExports.jsx("div",{className:tt,ref:this.mainRef,style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex"},children:_e})}renderLayout(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Row,{layout:this,node:this.props.model.getRoot(this.windowId)},"__row__"),this.renderEdgeIndicators()]})}renderEdgeIndicators(){const _e=[],tt=this.icons.edgeArrow;if(this.state.showEdges){const et=this.props.model.getRoot(this.windowId).getRect(),rt=edgeRectLength,it=edgeRectWidth,ot=edgeRectLength/2,at=this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT),st=50;_e.push(jsxRuntimeExports.jsx("div",{style:{top:0,left:et.width/2-ot,width:rt,height:it,borderBottomLeftRadius:st,borderBottomRightRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_TOP),children:jsxRuntimeExports.jsx("div",{style:{transform:"rotate(180deg)"},children:tt})},"North")),_e.push(jsxRuntimeExports.jsx("div",{style:{top:et.height/2-ot,left:0,width:it,height:rt,borderTopRightRadius:st,borderBottomRightRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_LEFT),children:jsxRuntimeExports.jsx("div",{style:{transform:"rotate(90deg)"},children:tt})},"West")),_e.push(jsxRuntimeExports.jsx("div",{style:{top:et.height-it,left:et.width/2-ot,width:rt,height:it,borderTopLeftRadius:st,borderTopRightRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_BOTTOM),children:jsxRuntimeExports.jsx("div",{children:tt})},"South")),_e.push(jsxRuntimeExports.jsx("div",{style:{top:et.height/2-ot,left:et.width-it,width:it,height:rt,borderTopLeftRadius:st,borderBottomLeftRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_RIGHT),children:jsxRuntimeExports.jsx("div",{style:{transform:"rotate(-90deg)"},children:tt})},"East"))}return _e}renderWindows(){const _e=[];if(this.supportsPopout){const tt=this.props.model.getwindowsMap();let et=1;for(const[rt,it]of tt)rt!==Model.MAIN_WINDOW_ID&&(_e.push(jsxRuntimeExports.jsx(PopoutWindow,{layout:this,title:this.popoutWindowName+" "+et,layoutWindow:it,url:this.popoutURL+"?id="+rt,onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow,children:jsxRuntimeExports.jsx("div",{className:this.props.popoutClassName,children:jsxRuntimeExports.jsx(pr,{...this.props,windowId:rt,mainLayout:this})})},rt)),et++)}return _e}renderTabMoveables(){const _e=new Map;return this.props.model.visitNodes(tt=>{if(tt instanceof TabNode){const et=tt,rt=this.getMoveableElement(et.getId());et.setMoveableElement(rt);const it=et.isSelected(),ot=et.getParent().getContentRect(),at=it||!et.isEnableRenderOnDemand(),st=et.isRendered()||at&&ot.width>0&&ot.height>0;if(st){const ct=et.getId()+(et.isEnableWindowReMount()?et.getWindowId():"");_e.set(tt.getId(),reactDomExports.createPortal(jsxRuntimeExports.jsx(SizeTracker,{layout:this,node:et,rect:ot,visible:at,forceRevision:this.state.forceRevision,tabsRevision:this.props.renderRevision},ct),rt,ct)),et.setRendered(st)}}}),_e}renderTabStamps(){const _e=[];return this.props.model.visitNodes(tt=>{if(tt instanceof TabNode){const et=tt;_e.push(jsxRuntimeExports.jsx(DragContainer,{layout:this,node:et},et.getId()))}}),_e}renderTabs(){const _e=new Map;return this.props.model.visitWindowNodes(this.windowId,tt=>{if(tt instanceof TabNode){const et=tt,rt=et.isSelected(),it=et.getPath();(et.isRendered()||rt||!et.isEnableRenderOnDemand())&&_e.set(et.getId(),jsxRuntimeExports.jsx(Tab,{layout:this,path:it,node:et,selected:rt},et.getId()))}}),_e}renderMetricsElements(){return jsxRuntimeExports.jsx("div",{ref:this.findBorderBarSizeRef,className:this.getClassName(CLASSES.FLEXLAYOUT__BORDER_SIZER),children:"FindBorderBarSize"},"findBorderBarSize")}checkForBorderToShow(_e,tt){const et=this.getBoundingClientRect(this.mainRef.current),rt=et.getCenter(),it=edgeRectWidth,ot=edgeRectLength/2;let at=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===DockLocation.CENTER&&(tt>rt.y-ot&&tt<rt.y+ot||_e>rt.x-ot&&_e<rt.x+ot)&&(at=!0);let st=DockLocation.CENTER;at||(_e<=et.x+it?st=DockLocation.LEFT:_e>=et.getRight()-it?st=DockLocation.RIGHT:tt<=et.y+it?st=DockLocation.TOP:tt>=et.getBottom()-it&&(st=DockLocation.BOTTOM)),st!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:st})}tidyMoveablesMap(){const _e=new Map;this.props.model.visitNodes((tt,et)=>{tt instanceof TabNode&&_e.set(tt.getId(),tt)});for(const[tt,et]of this.moveableElementMap)_e.has(tt)||(et.remove(),this.moveableElementMap.delete(tt))}reorderComponents(_e,tt){const et=[],rt=new Set;let it=[];for(const ot of tt)_e.get(ot)&&(et.push(ot),rt.add(ot));tt.splice(0,tt.length,...et);for(const[ot,at]of _e)rt.has(ot)||tt.push(ot);return it=tt.map(ot=>_e.get(ot)),it}redraw(_e){this.mainLayout.setState((tt,et)=>({forceRevision:tt.forceRevision+1}))}redrawInternal(_e){this.mainLayout.setState((tt,et)=>({layoutRevision:tt.layoutRevision+1}))}doAction(_e){if(this.props.onAction!==void 0){const tt=this.props.onAction(_e);return tt!==void 0?this.props.model.doAction(tt):void 0}else return this.props.model.doAction(_e)}getBoundingClientRect(_e){const tt=this.getDomRect();return tt?Rect.getBoundingClientRect(_e).relativeTo(tt):Rect.empty()}getMoveableContainer(){return this.moveablesRef.current}getMoveableElement(_e){let tt=this.moveableElementMap.get(_e);return tt===void 0&&(tt=document.createElement("div"),this.moveablesRef.current.appendChild(tt),tt.className=CLASSES.FLEXLAYOUT__TAB_MOVEABLE,this.moveableElementMap.set(_e,tt)),tt}getMainLayout(){return this.mainLayout}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current?Rect.fromDomRect(this.selfRef.current.getBoundingClientRect()):Rect.empty()}getWindowId(){return this.windowId}getRootDiv(){return this.selfRef.current}getMainElement(){return this.mainRef.current}getFactory(){return this.props.factory}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){return this.props.realtimeResize??!1}getPopoutURL(){return this.popoutURL}setEditingTab(_e){this.setState({editingTab:_e})}getEditingTab(){return this.state.editingTab}getModel(){return this.props.model}getScreenRect(_e){const tt=_e.clone(),et=this.getDomRect(),rt=60,it=2;return tt.x=this.currentWindow.screenX+this.currentWindow.scrollX+it/2+et.x+tt.x,tt.y=this.currentWindow.screenY+this.currentWindow.scrollY+(rt-it/2)+et.y+tt.y,tt.height+=rt,tt.width+=it,tt}addTabToTabSet(_e,tt){if(this.props.model.getNodeById(_e)!==void 0)return this.doAction(Actions.addNode(tt,_e,DockLocation.CENTER,-1))}addTabToActiveTabSet(_e){const tt=this.props.model.getActiveTabset(this.windowId);if(tt!==void 0)return this.doAction(Actions.addNode(_e,tt.getId(),DockLocation.CENTER,-1))}maximize(_e){this.doAction(Actions.maximizeToggle(_e.getId(),this.getWindowId()))}customizeTab(_e,tt){this.props.onRenderTab&&this.props.onRenderTab(_e,tt)}customizeTabSet(_e,tt){this.props.onRenderTabSet&&this.props.onRenderTabSet(_e,tt)}i18nName(_e,tt){let et;return this.props.i18nMapper&&(et=this.props.i18nMapper(_e,tt)),et===void 0&&(et=_e+(tt===void 0?"":tt)),et}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(_e,tt){this.props.onContextMenu&&this.props.onContextMenu(_e,tt)}auxMouseClick(_e,tt){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(_e,tt)}showOverlay(_e){this.setState({showOverlay:_e}),enablePointerOnIFrames(!_e,this.currentDocument)}addTabWithDragAndDrop(_e,tt,et){const rt=TabNode.fromJson(tt,this.props.model,!1);pr.dragState=new DragState(this.mainLayout,"add",rt,tt,et)}moveTabWithDragAndDrop(_e,tt){this.setDragNode(_e,tt)}setDragComponent(_e,tt,et,rt){const it=jsxRuntimeExports.jsx("div",{style:{position:"unset"},className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT)+" "+this.getClassName(CLASSES.FLEXLAYOUT__DRAG_RECT),children:tt}),ot=this.currentDocument.createElement("div");ot.setAttribute("data-layout-path","/drag-rectangle"),ot.style.position="absolute",ot.style.left="-10000px",ot.style.top="-10000px",this.currentDocument.body.appendChild(ot),createRoot(ot).render(it),_e.dataTransfer.setDragImage(ot,et,rt),setTimeout(()=>{this.currentDocument.body.removeChild(ot)},0)}setDraggingOverWindow(_e){this.isDraggingOverWindow!==_e&&(this.outlineDiv&&(this.outlineDiv.style.visibility=_e?"hidden":"visible"),_e?this.setState({showEdges:!1}):this.props.model.getMaximizedTabset(this.windowId)===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.isDraggingOverWindow=_e)}clearDragMain(){pr.dragState=void 0,this.windowId===Model.MAIN_WINDOW_ID&&(this.isDraggingOverWindow=!1);for(const[,_e]of this.props.model.getwindowsMap())_e.layout.clearDragLocal()}clearDragLocal(){this.setState({showEdges:!1}),this.showOverlay(!1),this.dragEnterCount=0,this.dragging=!1,this.outlineDiv&&(this.selfRef.current.removeChild(this.outlineDiv),this.outlineDiv=void 0)}};__publicField(_LayoutInternal,"dragState");const defaultIcons={close:jsxRuntimeExports.jsx(CloseIcon,{}),closeTabset:jsxRuntimeExports.jsx(CloseIcon,{}),popout:jsxRuntimeExports.jsx(PopoutIcon,{}),maximize:jsxRuntimeExports.jsx(MaximizeIcon,{}),restore:jsxRuntimeExports.jsx(RestoreIcon,{}),more:jsxRuntimeExports.jsx(OverflowIcon,{}),edgeArrow:jsxRuntimeExports.jsx(EdgeIcon,{}),activeTabset:jsxRuntimeExports.jsx(AsterickIcon,{})},defaultSupportsPopout=isDesktop(),edgeRectLength=100,edgeRectWidth=10;class DragState{constructor(_e,tt,et,rt,it){__publicField(this,"mainLayout"),__publicField(this,"dragSource"),__publicField(this,"dragNode"),__publicField(this,"dragJson"),__publicField(this,"fnNewNodeDropped"),this.mainLayout=_e,this.dragSource=tt,this.dragNode=et,this.dragJson=rt,this.fnNewNodeDropped=it}}const log=logger$2("layout");class LayoutSystem extends RootStore{constructor(tt){super(tt);wt(this,"CACHE_LAYOUT_KEY","galacean-layoutFile");wt(this,"CACHE_SIDEBAR_KEY","galacean-sidebar");wt(this,"CUSTOM_LAYOUT_KEY","galacean-custom-layoutFile");wt(this,"EDITOR_MODE_KEY","galacean-editor-mode");wt(this,"sidebarVisible",!0);wt(this,"sidebarPosition","left");wt(this,"editorMode","professional");wt(this,"flexLayoutModel",null);wt(this,"controller");wt(this,"tabs",null);wt(this,"panels",[]);wt(this,"panelContents",new Map);wt(this,"customLayouts",[]);wt(this,"initTabs",tt=>{this.tabs=tt});wt(this,"activeTab",tt=>{const{flexLayoutModel:et}=this;et.doAction(Actions.selectTab(tt))});wt(this,"saveController",tt=>{this.controller=tt});wt(this,"setModel",tt=>{this.flexLayoutModel=tt});wt(this,"addPanel",(tt,et)=>{this.panelContents.set(tt.id,et),this.panels.push(tt)});wt(this,"closePanel",tt=>{const et=this.panels.findIndex(rt=>rt.id===tt);et>-1&&this.panels.splice(et,1)});wt(this,"removePanel",tt=>{this.panelContents.delete(tt)});wt(this,"resizePanel",(tt,et)=>{const rt=this.panels.find(it=>it.id===tt);rt&&(rt.size=et)});wt(this,"toggleSidebar",tt=>{if(tt!==void 0){this.sidebarVisible=tt;return}this.sidebarVisible=!this.sidebarVisible,set(this.CACHE_SIDEBAR_KEY,this.sidebarVisible)});wt(this,"setSidebarPosition",tt=>{this.sidebarPosition=tt});wt(this,"toggleEditorMode",tt=>{tt!==void 0?this.editorMode=tt:this.editorMode=this.editorMode==="simple"?"professional":"simple",set(this.EDITOR_MODE_KEY,this.editorMode)});wt(this,"toggleTabVisibility",(tt,et)=>{const{flexLayoutModel:rt,tabs:it,controller:ot}=this,at=rt.getNodeById(tt),st=rt.getNodeById(it.Viewport.id),ct=["Assets","AnimatorController","AnimationClip"],ut=["Hierarchy"],dt=["Inspector"];if(at&&et===!1){rt.doAction(Actions.deleteTab(at.getId()));return}if(at){if(at.isVisible()&&rt.doAction(Actions.selectTab(tt)),et!==!1){const mt=it[tt];mt!=null&&mt.onVisibilityChange&&mt.onVisibilityChange(mt.id,!0)}return}let ht=rt.getRoot().getId(),ft=DockLocation.BOTTOM;function pt(mt,vt,_t){const yt=mt.find(bt=>rt.getNodeById(it[bt].id));if(yt){_t=rt.getNodeById(it[yt].id).getParent().getId(),ot.addTabToTabSet(_t,it[tt]);return}rt.doAction(Actions.addNode(it[tt],_t,vt,0))}if(ut.includes(tt))return ft=DockLocation.LEFT,pt(ut,ft,ht);if(dt.includes(tt))return ft=DockLocation.RIGHT,pt(dt,ft,ht);if(ct.includes(tt))return ht=st.getParent().getId(),ft=DockLocation.BOTTOM,pt(ct,ft,ht)});wt(this,"toggleSceneMaximize",()=>{const{flexLayoutModel:tt,tabs:et}=this,it=tt.getNodeById(et.Viewport.id).getParent();tt.doAction(Actions.maximizeToggle(it.getId()))});wt(this,"cache",tt=>{log.info("save layout","verbose");const et=tt||this.flexLayoutModel;et&&set(this.CACHE_LAYOUT_KEY,et.toJson())});wt(this,"addCustomLayout",async tt=>{const et={name:tt,layout:this.flexLayoutModel.toJson()};await get(this.CUSTOM_LAYOUT_KEY)?update$1(this.CUSTOM_LAYOUT_KEY,it=>[...it,et]):set(this.CUSTOM_LAYOUT_KEY,[et]),this.customLayouts.push(et)});wt(this,"deleteCustomLayout",tt=>{update$1(this.CUSTOM_LAYOUT_KEY,et=>et.filter(rt=>rt.name!==tt)),this.customLayouts=this.customLayouts.filter(et=>et.name!==tt)});wt(this,"clearCacheLayout",async()=>{await del(this.CACHE_LAYOUT_KEY),await del(this.CACHE_SIDEBAR_KEY),location.reload()});makeObservable(this,{sidebarVisible:observable,sidebarPosition:observable,editorMode:observable,customLayouts:observable.shallow,toggleSidebar:action,setSidebarPosition:action,toggleEditorMode:action,flexLayoutModel:observable.ref,panels:observable,panelContents:observable.ref,removePanel:observable.ref})}async getCustomLayoutFromLocal(){const tt=await get(this.CUSTOM_LAYOUT_KEY);this.customLayouts=tt||[]}async initLayout(tt,et,rt){this.CACHE_LAYOUT_KEY=`${this.CACHE_LAYOUT_KEY}-${et}`,this.CACHE_SIDEBAR_KEY=`${this.CACHE_SIDEBAR_KEY}-${et}`,this.CUSTOM_LAYOUT_KEY=`${this.CUSTOM_LAYOUT_KEY}-${rt}`,this.EDITOR_MODE_KEY=`${this.EDITOR_MODE_KEY}-${rt}`;const it=await this.loadCacheLayout(),ot=await this.loadCacheSidebar(),at=await this.loadCacheEditorMode(),st=it?{...it,global:tt.global}:tt;this.flexLayoutModel=Model.fromJson(st),this.sidebarVisible=ot??!0,this.editorMode=at??"professional",await this.getCustomLayoutFromLocal()}async loadCacheLayout(){try{return await get(this.CACHE_LAYOUT_KEY)}catch{return console.warn("Failed to load and parse layout from cache."),null}}async loadCacheSidebar(){try{return await get(this.CACHE_SIDEBAR_KEY)}catch{console.warn("Failed to load and parse layout from cache.");return}}async loadCacheEditorMode(){try{return await get(this.EDITOR_MODE_KEY)}catch{console.warn("Failed to load editor mode from cache.");return}}replaceLayout(tt){this.flexLayoutModel=Model.fromJson(tt),this.cache()}}class SelectionStore extends RootStore{constructor(tt){super(tt);wt(this,"_logger",new TraceLogger("SelectionStore"));wt(this,"_fallbackContext","scene");wt(this,"_listeners",new Set);wt(this,"_snapshot",null);wt(this,"_sceneDisposer",null);wt(this,"_assetDisposer",null);wt(this,"_disposed",!1)}subscribe(tt){return this._disposed?()=>{}:(this._ensureSelectionBridge(),this._listeners.add(tt),()=>{this._listeners.delete(tt)})}getSnapshot(){return this._disposed?this._buildSnapshot():(this._ensureSelectionBridge(),this._snapshot||(this._snapshot=this._buildSnapshot()),this._snapshot)}get context(){return this.assetIds.size||this.lastSelectedAssetId?"asset":this.entityIds.size||this.lastSelectedEntityId?"entity":this._fallbackContext}get entityIds(){var tt;return new Set(Array.from(((tt=this.root.sceneUIStore)==null?void 0:tt.selectedKeys)??[]))}get assetIds(){var tt;return new Set(((tt=this.root.assetUIStore)==null?void 0:tt.pickedAssets)??[])}get lastSelectedEntityId(){var tt;return((tt=this.root.sceneUIStore)==null?void 0:tt.lastSelectedId)??null}get lastSelectedAssetId(){var tt;return((tt=this.root.assetUIStore)==null?void 0:tt.selectedAssetId)??null}_buildSnapshot(){return{context:this.context,entityIds:Array.from(this.entityIds),assetIds:Array.from(this.assetIds),lastSelectedEntityId:this.lastSelectedEntityId,lastSelectedAssetId:this.lastSelectedAssetId}}_notify(){this._snapshot=null,this._logger.info("_notify",{listeners:this._listeners.size,lastEntityId:this.lastSelectedEntityId});for(const tt of this._listeners)tt()}_ensureSelectionBridge(){this._disposed||this._sceneDisposer||(this.root.sceneUIStore&&(this._sceneDisposer=this.root.sceneUIStore.onSelectionChange(()=>this._notify())),this.root.assetUIStore&&(this._assetDisposer=this.root.assetUIStore.onSelectionChange(()=>this._notify())))}_disposeSelectionBridge(){var tt,et;(tt=this._sceneDisposer)==null||tt.call(this),(et=this._assetDisposer)==null||et.call(this),this._sceneDisposer=null,this._assetDisposer=null}dispose(){this._disposed||(this._disposed=!0,this._listeners.clear(),this._snapshot=null,this._disposeSelectionBridge())}get selectedEntities(){return this.root.sceneStore?Array.from(this.entityIds).map(tt=>this.root.sceneStore.entities.get(tt)).filter(Boolean):[]}get selectedAssets(){return this.root.assetStore?Array.from(this.assetIds).map(tt=>this.root.assetStore.assets[tt]).filter(Boolean):[]}get lastSelectedEntity(){return!this.lastSelectedEntityId||!this.root.sceneStore?null:this.root.sceneStore.entities.get(this.lastSelectedEntityId)??null}get selectedEntityReadModels(){return this.root.readModelStore?Array.from(this.entityIds).map(tt=>this.root.readModelStore.getEntity(tt)).filter(tt=>tt!==void 0):[]}get lastSelectedEntityReadModel(){return!this.lastSelectedEntityId||!this.root.readModelStore?null:this.root.readModelStore.getEntity(this.lastSelectedEntityId)??null}get lastSelectedAsset(){return!this.lastSelectedAssetId||!this.root.assetStore?null:this.root.assetStore.assets[this.lastSelectedAssetId]??null}selectEntity(tt,et=!1){var rt;this._fallbackContext="entity",typeof((rt=this.root.sceneStore)==null?void 0:rt.selectEntity)=="function"?this.root.sceneStore.selectEntity(tt,et):this.root.sceneUIStore&&(et||this.root.sceneUIStore.clearSelection(),this.root.sceneUIStore.selectEntity(tt,!0))}deselectEntity(tt){var et;(et=this.root.sceneUIStore)==null||et.deselectEntity(tt)}selectAsset(tt,et=!1){var rt,it,ot,at,st;if(this._fallbackContext="asset",et){const ct=[...((rt=this.root.assetUIStore)==null?void 0:rt.pickedAssets)??[]];ct.includes(tt)||ct.push(tt),(ot=(it=this.root.assetStore)==null?void 0:it.selectAsset)==null||ot.call(it,ct);return}(st=(at=this.root.assetStore)==null?void 0:at.selectAsset)==null||st.call(at,tt)}deselectAsset(tt){if(!this.root.assetUIStore)return;const et=this.root.assetUIStore.pickedAssets.filter(it=>it!==tt),rt=this.root.assetUIStore.selectedAssetId===tt?et.at(-1)??null:this.root.assetUIStore.selectedAssetId;this.root.assetUIStore.setSelection(et,rt)}clearSelection(){var tt,et;(tt=this.root.sceneUIStore)==null||tt.clearSelection(),(et=this.root.assetUIStore)==null||et.clearSelect(),this._fallbackContext="scene",this._notify()}setContext(tt){this._fallbackContext=tt,this._notify()}}class EditorError extends Error{constructor(_e,tt,et,rt,it){super(rt),this.domain=_e,this.severity=tt,this.code=et,this.details=it,this.name="EditorError"}}var ProjectionErrorCode=(nt=>(nt.PARENT_NOT_FOUND="PROJECTION_PARENT_NOT_FOUND",nt.ENTITY_NOT_FOUND="PROJECTION_ENTITY_NOT_FOUND",nt.ROLLBACK_FAILED="PROJECTION_ROLLBACK_FAILED",nt.REBUILD_FAILED="PROJECTION_REBUILD_FAILED",nt))(ProjectionErrorCode||{});class ProjectionError extends EditorError{constructor(_e,tt,et){super("projection","recoverable",_e,tt,et),this.name="ProjectionError"}}var EffectsErrorCode=(nt=>(nt.DELETE_FAILED="EFFECTS_DELETE_FAILED",nt.CREATE_FAILED="EFFECTS_CREATE_FAILED",nt.UPDATE_FAILED="EFFECTS_UPDATE_FAILED",nt))(EffectsErrorCode||{});class EffectsError extends EditorError{constructor(_e,tt,et){super("effects","warning",_e,tt,et),this.name="EffectsError"}}const defaultComponentFactory=()=>null;function assertNeverEvent$2(nt){throw new Error(`EngineProjection: unhandled event ${nt.type}`)}class EngineProjection{constructor(_e,tt,et){wt(this,"entityMap",new Map);wt(this,"entityReverseMap",new WeakMap);wt(this,"componentMap",new Map);wt(this,"assetMap",new Map);wt(this,"externalEntityIds",new Set);wt(this,"graveyardEntities",new Map);wt(this,"graveyardComponents",new Map);wt(this,"componentFactory");wt(this,"assetResolver",null);wt(this,"_canRedo");this._scene=_e,this.componentFactory=tt??defaultComponentFactory,this._canRedo=et??(()=>!1)}get scene(){return this._scene}setComponentFactory(_e){this.componentFactory=_e}flushDeferredComponentProps(){var _e,tt;(tt=(_e=this.componentFactory).flushDeferred)==null||tt.call(_e)}rebindAssetReferences(_e){var tt,et,rt,it;(et=(tt=this.componentFactory).rebindAssetReferences)==null||et.call(tt,_e),(it=(rt=this.componentFactory).flushDeferred)==null||it.call(rt)}setAssetResolver(_e){this.assetResolver=_e}resolveRef(_e){if(_e==null||typeof _e!="object"||!("refId"in _e))return _e;if(!this.assetResolver)return;const tt=_e,et=tt.key?`${tt.refId}-${tt.key}`:tt.refId,rt=this.assetResolver(et);return rt!==null?rt:void 0}setScene(_e){if(this._scene===_e)return;this._scene=_e;const tt=[];for(const et of this.entityMap.values())et.parent||tt.push(et);for(const et of tt)_e.addRootEntity(et)}apply(_e,tt){tt&&!isUndoRedoCommand(tt)&&!this._canRedo()&&this.clearGraveyard(),_e!=null&&_e.length&&this.applyEvents(_e)}applyEvents(_e){for(const tt of _e)switch(tt.type){case"EntityCreated":this.createEngineEntity(tt.entityId,tt.entity);break;case"EntityUpdated":this.applyEntityUpdatedEvent(tt);break;case"EntityMoved":this.applyEntityMovedEvent(tt);break;case"EntityDeleted":this.applyEntityDeletedEvent(tt);break;case"ComponentAdded":this.applyComponentAddedEvent(tt);break;case"ComponentUpdated":this.applyComponentUpdatedEvent(tt);break;case"ComponentRemoved":this.destroyEngineComponent(tt.componentId);break;case"SceneSettingUpdated":this.applySceneSettingEvent(tt.settingPath,tt.value);break;case"AssetCreated":this.assetMap.set(tt.assetId,tt.asset);break;case"AssetUpdated":this.applyAssetUpdatedEvent(tt);break;case"AssetDeleted":this.assetMap.delete(tt.assetId);break;case"PrefabBindingCreated":case"PrefabBindingRemoved":case"PrefabBindingRebased":case"PrefabOverrideChanged":break;default:assertNeverEvent$2(tt)}}applyEntityUpdatedEvent(_e){const tt=this.entityMap.get(_e.entityId);if(!tt)return;const{changes:et}=_e;if(et.name!==void 0&&(tt.name=et.name),et.isActive!==void 0&&(tt.isActive=et.isActive),et.layer!==void 0&&(tt.layer=et.layer),et.transform){const rt=et.transform;rt.position&&this.updateTransformProperty(tt,["position"],{x:rt.position.x??tt.transform.position.x,y:rt.position.y??tt.transform.position.y,z:rt.position.z??tt.transform.position.z}),rt.rotation&&this.updateTransformProperty(tt,["rotation"],{x:rt.rotation.x??tt.transform.rotation.x,y:rt.rotation.y??tt.transform.rotation.y,z:rt.rotation.z??tt.transform.rotation.z}),rt.scale&&this.updateTransformProperty(tt,["scale"],{x:rt.scale.x??tt.transform.scale.x,y:rt.scale.y??tt.transform.scale.y,z:rt.scale.z??tt.transform.scale.z})}}applyEntityMovedEvent(_e){const tt=this.entityMap.get(_e.entityId);tt&&(this.reparentEntity(tt,_e.parentId),tt.siblingIndex=_e.index)}applyEntityDeletedEvent(_e){for(const tt of[..._e.subtreeIds].reverse())this.destroyEngineEntity(tt)}applyComponentAddedEvent(_e){const tt=this.entityMap.get(_e.entityId);tt&&this.createEngineComponent(tt,_e.componentId,_e.component)}applyComponentUpdatedEvent(_e){for(const[tt,et]of Object.entries(_e.changes))this.updateComponentProperty(_e.componentId,tt,et)}applyAssetUpdatedEvent(_e){this.assetMap.set(_e.assetId,_e.asset);const tt=_e.previousAsset.meta??{},et=_e.asset.meta??{},rt=new Set([...Object.keys(tt),...Object.keys(et)]);for(const it of rt){const ot=tt[it],at=et[it];JSON.stringify(ot)!==JSON.stringify(at)&&this.projectAssetMetaToEngine(_e.assetId,it,at)}}createEngineEntity(_e,tt){const et=this.graveyardEntities.get(_e);et&&(this.entityMap.set(_e,et),this.entityReverseMap.set(et,_e),this.externalEntityIds.add(_e),this.graveyardEntities.delete(_e));const rt=this.resolveParentEntity(_e,tt.parentId),it=this.entityMap.get(_e);if(it){if(this.externalEntityIds.has(_e)){const at=it;at.__editorExternalComponentClaimRevision=(at.__editorExternalComponentClaimRevision??0)+1}if(rt)it.parent!==rt&&rt.addChild(it);else{const at=!!it.parent;at&&(it.parent=null),(at||!it.scene||it.scene!==this.scene)&&this.scene.addRootEntity(it)}if(this.applyEntityState(it,tt),tt.components)for(const[at,st]of Object.entries(tt.components))this.componentMap.has(at)||this.createEngineComponent(it,at,st);return}const ot=rt?rt.createChild(tt.name):this.scene.createRootEntity(tt.name);if(this.applyEntityState(ot,tt),this.entityMap.set(_e,ot),this.entityReverseMap.set(ot,_e),tt.components)for(const[at,st]of Object.entries(tt.components))this.createEngineComponent(ot,at,st)}resolveParentEntity(_e,tt){if(!tt)return null;const et=this.entityMap.get(tt);if(!et)throw new ProjectionError(ProjectionErrorCode.PARENT_NOT_FOUND,`EngineProjection: parent entity "${tt}" not found when creating "${_e}".`,{entityId:_e,parentId:tt});return et}applyEntityState(_e,tt){_e.name=tt.name,_e.isActive=tt.isActive,_e.layer=tt.layer;const{position:et,rotation:rt,scale:it}=tt.transform;_e.transform.position.set(et.x,et.y,et.z),_e.transform.rotation.set(rt.x,rt.y,rt.z),_e.transform.scale.set(it.x,it.y,it.z)}destroyEngineEntity(_e){var rt,it;const tt=this.entityMap.get(_e);if(!tt)return;const et=this.externalEntityIds.has(_e);for(const[ot,at]of this.componentMap)at.entity===tt&&((it=(rt=this.componentFactory).forgetComponentAssetReferences)==null||it.call(rt,at),et&&this.addToGraveyard(_e,ot,at),this.componentMap.delete(ot));if(et)tt.parent=null,tt.scene===this.scene&&this.scene.removeRootEntity(tt),this.graveyardEntities.set(_e,tt);else try{tt.destroy()}catch(ot){console.warn("[EngineProjection] destroyEngineEntity failed:",ot)}this.entityMap.delete(_e),this.externalEntityIds.delete(_e),tt&&this.entityReverseMap.delete(tt)}createEngineComponent(_e,tt,et){var ot,at;const rt=this.findEntityId(_e);if(rt){const st=this.graveyardComponents.get(rt);if(st!=null&&st.has(tt)){const ct=st.get(tt);ct.__editorComponentType=et.type;for(const[ut,dt]of Object.entries(et.props))(at=(ot=this.componentFactory).trackAssetReference)==null||at.call(ot,ct,et.type,ut,dt);this.componentMap.set(tt,ct),st.delete(tt),st.size===0&&this.graveyardComponents.delete(rt);return}}const it=this.componentFactory(_e,et.type,et.props);it&&(it.__editorComponentType=et.type,this.componentMap.set(tt,it))}findEntityId(_e){return this.entityReverseMap.get(_e)}destroyEngineComponent(_e){var rt,it;const tt=this.componentMap.get(_e);if(!tt)return;(it=(rt=this.componentFactory).forgetComponentAssetReferences)==null||it.call(rt,tt);const et=this.findEntityId(tt.entity);if(et&&this.externalEntityIds.has(et)){this.addToGraveyard(et,_e,tt),this.componentMap.delete(_e);return}tt.destroy(),this.componentMap.delete(_e)}addToGraveyard(_e,tt,et){let rt=this.graveyardComponents.get(_e);rt||(rt=new Map,this.graveyardComponents.set(_e,rt)),rt.set(tt,et)}clearGraveyard(){if(!(this.graveyardEntities.size===0&&this.graveyardComponents.size===0)){for(const _e of this.graveyardEntities.values())try{_e.destroy()}catch{}for(const _e of this.graveyardComponents.values())for(const tt of _e.values())try{tt.destroy()}catch{}this.graveyardEntities.clear(),this.graveyardComponents.clear()}}updateComponentProperty(_e,tt,et){var st,ct,ut,dt,ht;const rt=this.componentMap.get(_e);if(!rt)return;const it=rt.__editorComponentType;it&&((ct=(st=this.componentFactory).trackAssetReference)==null||ct.call(st,rt,it,tt,et));const ot=et===void 0?void 0:this.resolveRef(et);if(et!==void 0&&ot===void 0)return;const at=it?(ht=(dt=(ut=this.componentFactory).getProxyMap)==null?void 0:dt.call(ut,it))==null?void 0:ht[tt]:void 0;if(at&&typeof rt[at]=="function"){rt[at](ot);return}if(tt in rt)try{rt[tt]=ot}catch{}}reparentEntity(_e,tt){if(tt){const et=this.entityMap.get(tt);if(!et)throw new ProjectionError(ProjectionErrorCode.PARENT_NOT_FOUND,`EngineProjection: new parent "${tt}" not found for reparent.`,{parentId:tt});_e.parent=et}else _e.parent=null,this.scene.addRootEntity(_e)}updateTransformProperty(_e,tt,et){if(tt.length===0){const at=et;_e.transform.position.set(at.position.x,at.position.y,at.position.z),_e.transform.rotation.set(at.rotation.x,at.rotation.y,at.rotation.z),_e.transform.scale.set(at.scale.x,at.scale.y,at.scale.z);return}if(tt.length===1){const[at]=tt,st=et;_e.transform[at].set(st.x,st.y,st.z);return}const[rt,it]=tt,ot=_e.transform[rt];if(ot&&it in ot){const at={x:ot.x,y:ot.y,z:ot.z};at[it]=et,ot.set(at.x,at.y,at.z)}}projectAssetMetaToEngine(_e,tt,et){if(!this.assetResolver)return;const rt=this.assetResolver(_e);if(!(!rt||typeof rt!="object")&&tt in rt)try{rt[tt]=et}catch{}}applySceneSettingEvent(_e,tt){const et=_e.split("/");et.length<2||this.applySceneSetting(et[0],et[1],tt)}applySceneSetting(_e,tt,et){const rt=this._scene,it=getSceneSettingDefinition(_e,tt);it!=null&&it.runtimeTarget&&this.applySceneSettingByTarget(rt,it.runtimeTarget,et)}applySceneSettingByTarget(_e,tt,et){const rt=this.resolveSceneSettingTarget(_e,tt.scope);if(rt)switch(tt.valueKind){case"direct":rt[tt.key]=et;return;case"structured":this.applyStructuredValue(rt,tt.key,et);return;case"assetRef":this.applyAssetReferenceValue(rt,tt.key,et);return}}resolveSceneSettingTarget(_e,tt){switch(tt){case"scene":return _e;case"ambientLight":return _e.ambientLight??null;case"background":return _e.background??null;case"background.sky":{const et=_e.background;return(et==null?void 0:et.sky)??null}case"ambientOcclusion":return _e.ambientOcclusion??null}}applyAssetReferenceValue(_e,tt,et){if(et==null){_e[tt]=et;return}const rt=this.resolveRef(et);rt!==void 0&&(_e[tt]=rt)}applyStructuredValue(_e,tt,et){if(!et||typeof et!="object"){_e[tt]=et;return}const rt=_e[tt];if(rt&&typeof rt=="object"&&"set"in rt){const it=rt.set,ot=et;"r"in ot?it.call(rt,ot.r,ot.g,ot.b,ot.a):"x"in ot&&it.call(rt,ot.x,ot.y,ot.z)}else _e[tt]=et}checkHealth(_e){const tt=new Set(Object.keys(_e.entities)),et=new Set(this.entityMap.keys()),rt=new Set(Object.keys(_e.assets)),it=new Set(this.assetMap.keys()),ot=Array.from(tt).filter(ut=>!et.has(ut)),at=Array.from(et).filter(ut=>!tt.has(ut)),st=Array.from(rt).filter(ut=>!it.has(ut)),ct=Array.from(it).filter(ut=>!rt.has(ut));return ot.sort(),at.sort(),st.sort(),ct.sort(),{healthy:ot.length===0&&at.length===0&&st.length===0&&ct.length===0,missingInEngine:ot,orphanInEngine:at,missingAssets:st,orphanAssets:ct}}getEntity(_e){return this.entityMap.get(_e)}getAsset(_e){return this.assetMap.get(_e)}getComponent(_e){return this.componentMap.get(_e)}setEntityRuntimeActive(_e,tt){const et=this.entityMap.get(_e);et&&(et.isActive=tt)}addEntityChild(_e,tt,et){const rt=this.entityMap.get(_e),it=this.entityMap.get(tt);rt&&it&&(et!==void 0?rt.addChild(et,it):rt.addChild(it))}removeEntityChild(_e,tt){const et=this.entityMap.get(_e),rt=this.entityMap.get(tt);et&&rt&&et.removeChild(rt)}getEntityIdByEngineObject(_e){return this.entityReverseMap.get(_e)}registerExternalEntity(_e,tt){this.entityMap.set(_e,tt),this.entityReverseMap.set(tt,_e),this.externalEntityIds.add(_e),tt.__editorExternalEntity=!0}reset(){var tt,et;for(const rt of this.componentMap.values()){const it=this.findEntityId(rt.entity);if(!(it&&this.externalEntityIds.has(it)))try{rt.destroy()}catch{}}this.componentMap.clear();const _e=new Map;for(const[rt,it]of this.entityMap){if(this.externalEntityIds.has(rt)){_e.set(rt,it);continue}try{it.destroy()}catch{}}this.entityMap=_e;for(const rt of this.graveyardEntities.values())try{rt.destroy()}catch{}this.graveyardEntities.clear(),this.graveyardComponents.clear(),this.assetMap.clear(),(et=(tt=this.componentFactory).clearAssetReferenceTracking)==null||et.call(tt)}rebuildFromState(_e){this.reset();const tt=new Set,et=rt=>{if(tt.has(rt))return;const it=_e.entities[rt];it&&(it.parentId&&!tt.has(it.parentId)&&et(it.parentId),this.createEngineEntity(rt,it),tt.add(rt))};for(const rt of _e.scene.rootEntityIds)et(rt);for(const rt of Object.keys(_e.entities))et(rt);for(const[rt,it]of Object.entries(_e.assets))this.assetMap.set(rt,it)}}function assertNeverEvent$1(nt){throw new Error(`EntityModelProjection: unhandled event ${nt.type}`)}class EntityModelProjection{constructor(_e,tt){wt(this,"_logger",new TraceLogger("EntityModelProjection"));this._getScene=_e,this._getEP=tt}apply(_e,tt){const et=this._getScene();et&&_e!=null&&_e.length&&this._applyEvents(_e,tt,et)}_applyEvents(_e,tt,et){for(const rt of _e)switch(rt.type){case"EntityCreated":this._handleEntityCreatedEvent(rt,et);break;case"EntityDeleted":for(const it of rt.subtreeIds)et.entities.delete(it);break;case"EntityUpdated":this._handleEntityUpdatedEvent(rt,tt,et);break;case"ComponentAdded":this._applyComponentAdd(rt.entityId,rt.componentId,rt.component,et);break;case"ComponentUpdated":this._handleComponentUpdatedEvent(rt,et);break;case"ComponentRemoved":this._handleComponentRemovedEvent(rt.entityId,rt.componentId,et);break;case"EntityMoved":case"SceneSettingUpdated":case"AssetCreated":case"AssetUpdated":case"AssetDeleted":case"PrefabBindingCreated":case"PrefabBindingRemoved":case"PrefabBindingRebased":case"PrefabOverrideChanged":break;default:assertNeverEvent$1(rt)}}_handleEntityCreatedEvent(_e,tt){var ot,at;const et=tt.entities.get(_e.entityId);if(et){this._logger.info("EntityCreated re-set existing",{entityId:_e.entityId}),tt.entities.set(_e.entityId,et),_e.entity.parentId&&tt.addEntityToParent&&tt.addEntityToParent(et,_e.entity.parentId);return}if(!tt.createEntity)return;this._logger.info("EntityCreated createEntity",{entityId:_e.entityId,name:_e.entity.name});const rt=tt.createEntity(_e.entity.name,_e.entityId);rt&&_e.entity.parentId&&tt.addEntityToParent&&tt.addEntityToParent(rt,_e.entity.parentId);const it=(ot=this._getEP())==null?void 0:ot.getEntity(_e.entityId);rt&&it&&((at=rt.initImmediate)==null||at.call(rt,it))}_handleEntityUpdatedEvent(_e,tt,et){var it,ot,at,st;const rt=et.entities.get(_e.entityId);rt&&((it=rt.invalidateFromDomain)==null||it.call(rt),_e.changes.isLocked!==void 0&&((ot=rt.applyLockedFromDomain)==null||ot.call(rt,_e.changes.isLocked)),_e.changes.transform&&!tt.has(_e.entityId)&&((st=(at=rt.transform)==null?void 0:at.syncEngineToEditor)==null||st.call(at)))}_applyComponentAdd(_e,tt,et,rt){const it=rt.entities.get(_e);it&&this._addComponentToModel(it,tt,et)}_handleComponentRemovedEvent(_e,tt,et){const rt=et.entities.get(_e);rt&&this._removeComponentFromModel(rt,tt)}_handleComponentUpdatedEvent(_e,tt){var it,ot;const et=tt.entities.get(_e.entityId);if(!et)return;const rt=(it=et.components)==null?void 0:it.find(at=>at.id===_e.componentId);if(rt)for(const[at,st]of Object.entries(_e.changes))(ot=rt.applyPropertyFromDomain)==null||ot.call(rt,at,st)}_addComponentToModel(_e,tt,et){var it,ot,at;const rt=(it=_e.getComponentByTypeName)==null?void 0:it.call(_e,et.type);rt&&rt.id!==tt&&((ot=_e.removeComponentFromDomain)==null||ot.call(_e,rt.id)),(at=_e.addComponentFromDomain)==null||at.call(_e,tt,et)}_removeComponentFromModel(_e,tt){var et;(et=_e.removeComponentFromDomain)==null||et.call(_e,tt)}}function assertNeverEvent(nt){throw new Error(`RuntimeProjection: unhandled event ${nt.type}`)}class RuntimeEntityCache{constructor(){wt(this,"_models",new Map)}stash(_e,tt){this._models.set(_e,tt)}restore(_e){const tt=this._models.get(_e);return tt&&this._models.delete(_e),tt}clear(){this._models.clear()}}const NOOP_RUNTIME_BINDER_REGISTRY={detachEntityBinder:()=>{},restoreEntityBinder:()=>null,clearDetachedEntityBinders:()=>{}};class RuntimeProjection{constructor(_e,tt,et=NOOP_RUNTIME_BINDER_REGISTRY,rt=()=>!1){wt(this,"_entityCache",new RuntimeEntityCache);wt(this,"_logger",new TraceLogger("RuntimeProjection"));this._getScene=_e,this._getEP=tt,this._runtimeBinderRegistry=et,this._canRedo=rt}apply(_e,tt){const et=this._getScene(),rt=new Set;if(!et)return rt;const it=isUndoRedoCommand(tt);!it&&!this._canRedo()&&(this._entityCache.clear(),this._runtimeBinderRegistry.clearDetachedEntityBinders());const ot=it?this._getEP():null;if(!(_e!=null&&_e.length))return rt;for(const at of _e)switch(at.type){case"EntityCreated":this._handleEntityCreated(at.entityId,at.entity,et,it,ot,rt);break;case"EntityDeleted":for(const st of[...at.subtreeIds].reverse())this._handleEntityDeleted(st,et);break;case"EntityUpdated":case"EntityMoved":case"ComponentAdded":case"ComponentUpdated":case"ComponentRemoved":case"SceneSettingUpdated":case"AssetCreated":case"AssetUpdated":case"AssetDeleted":case"PrefabBindingCreated":case"PrefabBindingRemoved":case"PrefabBindingRebased":case"PrefabOverrideChanged":break;default:assertNeverEvent(at)}return rt}reset(){this._entityCache.clear(),this._runtimeBinderRegistry.clearDetachedEntityBinders()}_handleEntityCreated(_e,tt,et,rt,it,ot){rt&&this._restoreOrMaterialize(_e,tt,et,it,ot)}_handleEntityDeleted(_e,tt){this._stashAndDetach(_e,tt)}_stashAndDetach(_e,tt){const et=tt.entities.get(_e);et&&(this._entityCache.stash(_e,et),this._runtimeBinderRegistry.detachEntityBinder(_e)),tt.entities.delete(_e)}_restoreOrMaterialize(_e,tt,et,rt,it){var ct,ut,dt,ht;if(et.entities.has(_e))return;const ot=this._entityCache.restore(_e);if(ot){this._runtimeBinderRegistry.restoreEntityBinder(_e),et.entities.set(_e,ot),rt&&this._rebindRestoredEntity(ot,rt),(ct=ot.applyLockedFromDomain)==null||ct.call(ot,tt.isLocked??!1),it.add(_e);return}this._runtimeBinderRegistry.restoreEntityBinder(_e);const at=rt==null?void 0:rt.getEntity(_e);if(!at){this._logger.warn("Skip cache-miss runtime restore: engine entity not found",{entityId:_e});return}if(!et.createEntity){this._logger.warn("Skip cache-miss runtime restore: scene.createEntity unavailable",{entityId:_e});return}const st=et.createEntity(tt.name,_e);if(this._hydrateCacheMissModel(st,tt),(ut=st.initImmediate)==null||ut.call(st,at),tt.components)for(const[ft,pt]of Object.entries(tt.components))(dt=st.addComponentFromDomain)==null||dt.call(st,ft,pt);(ht=st.applyLockedFromDomain)==null||ht.call(st,tt.isLocked??!1),it.add(_e)}_rebindRestoredEntity(_e,tt){var rt,it;const et=tt.getEntity(_e.id);if(et&&((rt=_e.bindEngineObject)==null||rt.call(_e,et,!1),_e.transform)){const ot=_e.transform;ot._engineObject=et.transform,(it=ot.syncEngineToEditor)==null||it.call(ot)}}_hydrateCacheMissModel(_e,tt){_e.name=tt.name,_e.isActive=tt.isActive??!0}}class UIProjection{constructor(_e,tt){wt(this,"_logger",new TraceLogger("UIProjection"));wt(this,"unsubscribe",null);wt(this,"assetStore",null);wt(this,"_sceneStore",null);wt(this,"prefabOverrideBucketCounts",new Map);wt(this,"contentApplier",null);wt(this,"pendingContentReplayByAssetId",new Map);this.readModelStore=tt,this.rebuildFromState(_e.state),this.unsubscribe=_e.subscribe((et,rt)=>{var it;if(et.commandName==="reset"){this.rebuildFromState(rt);return}(it=et.events)!=null&&it.length&&this.applyEvents(et.events,rt)})}setContentApplier(_e){this.contentApplier=_e}async awaitContentReplay(_e){const tt=this.pendingContentReplayByAssetId.get(_e);if(tt)try{await tt}catch{}}setAssetStore(_e){this.assetStore=_e}setSceneStore(_e){this._sceneStore=_e}warnDev(_e,tt){this._logger.warn(_e,tt)}cloneSerializable(_e){if(_e==null)return _e;try{return structuredClone(_e)}catch{return JSON.parse(JSON.stringify(_e))}}dispose(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null),this.assetStore=null,this._sceneStore=null,this.contentApplier=null,this.prefabOverrideBucketCounts.clear(),this.pendingContentReplayByAssetId.clear()}rebuildFromState(_e){var rt,it;this.readModelStore.beginBatch(),this.readModelStore.clear(),this.prefabOverrideBucketCounts.clear();for(const[ot,at]of Object.entries(_e.entities)){const st=this.createEntityReadModel(ot,at);this.readModelStore.setEntity(ot,st)}const tt=new Map,et=[];for(const[ot,at]of Object.entries(_e.assets)){const st=this.createAssetReadModel(ot,at);if(this.readModelStore.setAsset(ot,st),this.assetStore&&!this.assetStore.assets[ot]&&((it=(rt=this.assetStore).createEditorAssetFromState)==null||it.call(rt,ot,at)),at.parentFolderId){const ct=tt.get(at.parentFolderId)??[];ct.push(ot),tt.set(at.parentFolderId,ct)}else et.push(ot)}for(const[ot,at]of tt)this.readModelStore.setFolderChildren(ot,at);if(this.readModelStore.setRootAssetIds(et),this.readModelStore.setScene({rootEntityIds:[..._e.scene.rootEntityIds]}),_e.prefab){for(const[ot,at]of Object.entries(_e.prefab.bindings))this.setPrefabBindingReadModel(ot,at);for(const[ot,at]of Object.entries(_e.prefab.byAssetId))this.readModelStore.setAssetBindingIds(ot,[...at])}this.readModelStore.endBatch()}applyEvents(_e,tt){for(const et of _e)switch(et.type){case"EntityCreated":this._logger.info("EntityCreated",{entityId:et.entityId,parentId:et.parentId}),this.refreshEntityFromState(et.entityId,tt),et.parentId&&this.refreshEntityFromState(et.parentId,tt),this.refreshSceneFromState(tt);break;case"EntityUpdated":this.refreshEntityFromState(et.entityId,tt);break;case"EntityMoved":this.refreshEntityFromState(et.entityId,tt),et.previousParentId&&this.refreshEntityFromState(et.previousParentId,tt),et.parentId&&et.parentId!==et.previousParentId&&this.refreshEntityFromState(et.parentId,tt),this.refreshSceneFromState(tt);break;case"EntityDeleted":for(const rt of et.subtreeIds)this.readModelStore.deleteEntity(rt);et.snapshot.parentId&&this.refreshEntityFromState(et.snapshot.parentId,tt),this.refreshSceneFromState(tt);break;case"ComponentAdded":case"ComponentUpdated":case"ComponentRemoved":this.refreshEntityFromState(et.entityId,tt);break;case"SceneSettingUpdated":this.applySceneSettingValueToStore(et.settingPath,et.value);break;case"AssetCreated":this.applyAssetCreatedEvent(et);break;case"AssetUpdated":this.applyAssetUpdatedEvent(et);break;case"AssetDeleted":this.applyAssetDeletedEvent(et);break;case"PrefabBindingCreated":case"PrefabBindingRebased":this.refreshPrefabBindingFromState(et.bindingId,tt),this.refreshAssetBindingIdsFromState(et.assetId,tt);break;case"PrefabOverrideChanged":{const rt=tt.prefab.bindings[et.bindingId];rt?this.readModelStore.prefabBindings.get(et.bindingId)?this.updatePrefabBindingOverrideCount(et.bindingId,rt,et.bucket):this.setPrefabBindingReadModel(et.bindingId,rt):this.refreshPrefabBindingFromState(et.bindingId,tt),this.refreshAssetBindingIdsFromState(et.assetId,tt);break}case"PrefabBindingRemoved":this.refreshPrefabBindingFromState(et.bindingId,tt),this.refreshAssetBindingIdsFromState(et.assetId,tt);break;default:return et}}refreshEntityFromState(_e,tt){const et=tt.entities[_e];if(!et){this.readModelStore.deleteEntity(_e);return}this.readModelStore.setEntity(_e,this.createEntityReadModel(_e,et))}refreshSceneFromState(_e){this.readModelStore.setScene({rootEntityIds:[..._e.scene.rootEntityIds]})}refreshPrefabBindingFromState(_e,tt){const et=tt.prefab.bindings[_e];et?this.setPrefabBindingReadModel(_e,et):(this.prefabOverrideBucketCounts.delete(_e),this.readModelStore.deletePrefabBinding(_e))}refreshAssetBindingIdsFromState(_e,tt){const et=tt.prefab.byAssetId[_e];this.readModelStore.setAssetBindingIds(_e,et?[...et]:[])}replayAssetContent(_e,tt,et,rt){if(this.contentApplier)try{const it=this.contentApplier(_e,tt,et);if(it&&typeof it.then=="function"){const ot=Promise.resolve(it).catch(at=>{this.warnDev(`[UIProjection] contentApplier failed for asset: ${_e}`,{error:at,details:rt})}).finally(()=>{this.pendingContentReplayByAssetId.get(_e)===ot&&this.pendingContentReplayByAssetId.delete(_e)});this.pendingContentReplayByAssetId.set(_e,ot)}else this.pendingContentReplayByAssetId.delete(_e)}catch(it){this.warnDev(`[UIProjection] contentApplier threw for asset: ${_e}`,{error:it,details:rt})}}isSerializableEqual(_e,tt){return JSON.stringify(_e)===JSON.stringify(tt)}syncAssetPropsFromSnapshots(_e,tt,et){var it,ot,at;const rt=(it=this.assetStore)==null?void 0:it.assets[_e];if(rt){for(const st of Object.keys(tt??{}))(!et||!(st in et))&&((ot=rt.resetPropertyToDefaultFromDomain)==null||ot.call(rt,st));for(const[st,ct]of Object.entries(et??{}))(!tt||!this.isSerializableEqual(tt[st],ct))&&((at=rt.applyPropertyFromDomain)==null||at.call(rt,st,ct))}}syncAssetStoreFromSnapshots(_e,tt,et){var it,ot,at,st;const rt=(it=this.assetStore)==null?void 0:it.assets[_e];rt&&((!tt||tt.name!==et.name)&&((ot=rt.applyNameFromDomain)==null||ot.call(rt,et.name)),(!tt||tt.parentFolderId!==et.parentFolderId)&&((at=rt.applyParentFolderFromDomain)==null||at.call(rt,et.parentFolderId)),(!tt||!this.isSerializableEqual(tt.meta??{},et.meta??{}))&&((st=rt.applyMetaFromDomain)==null||st.call(rt,{...et.meta??{}})),this.syncAssetPropsFromSnapshots(_e,tt==null?void 0:tt.props,et.props)),(!tt||!this.isSerializableEqual(tt.content,et.content))&&et.content&&this.replayAssetContent(_e,et.type,et.content,{event:"AssetUpdated"})}applyAssetCreatedEvent(_e){var tt,et;this.readModelStore.setAsset(_e.assetId,this.createAssetReadModel(_e.assetId,_e.asset)),this.updateFolderChildrenOnAdd(_e.assetId,_e.asset.parentFolderId),this.assetStore&&(this.assetStore.assets[_e.assetId]?this.syncAssetStoreFromSnapshots(_e.assetId,void 0,_e.asset):(et=(tt=this.assetStore).createEditorAssetFromState)==null||et.call(tt,_e.assetId,_e.asset))}applyAssetUpdatedEvent(_e){this.readModelStore.setAsset(_e.assetId,this.createAssetReadModel(_e.assetId,_e.asset)),_e.previousAsset.parentFolderId!==_e.asset.parentFolderId&&this.updateFolderChildrenOnMove(_e.assetId,_e.previousAsset.parentFolderId,_e.asset.parentFolderId),this.syncAssetStoreFromSnapshots(_e.assetId,_e.previousAsset,_e.asset)}applyAssetDeletedEvent(_e){var tt,et,rt;this.updateFolderChildrenOnRemove(_e.assetId,_e.snapshot.parentFolderId),this.readModelStore.deleteAsset(_e.assetId),(tt=this.assetStore)!=null&&tt.assets[_e.assetId]&&((rt=(et=this.assetStore).deleteEditorAsset)==null||rt.call(et,_e.assetId))}updateFolderChildrenOnAdd(_e,tt){if(tt){const et=this.readModelStore.folderChildren.get(tt)??[];et.includes(_e)||(et.push(_e),this.readModelStore.setFolderChildren(tt,et))}else this.readModelStore.rootAssetIds.includes(_e)||this.readModelStore.rootAssetIds.push(_e)}updateFolderChildrenOnRemove(_e,tt){if(tt){const et=this.readModelStore.folderChildren.get(tt)??[],rt=et.indexOf(_e);rt!==-1&&(et.splice(rt,1),this.readModelStore.setFolderChildren(tt,et))}else{const et=this.readModelStore.rootAssetIds.indexOf(_e);et!==-1&&this.readModelStore.rootAssetIds.splice(et,1)}}updateFolderChildrenOnMove(_e,tt,et){this.updateFolderChildrenOnRemove(_e,tt),this.updateFolderChildrenOnAdd(_e,et)}applySceneSettingValueToStore(_e,tt){var et,rt;(rt=(et=this._sceneStore)==null?void 0:et.applySettingFromDomain)==null||rt.call(et,_e,tt)}measureOverrideBucketCounts(_e){return{entityProps:Object.keys(_e.entityProps).length,componentProps:Object.keys(_e.componentProps).length,removedEntities:Object.keys(_e.removedEntities).length,removedComponents:Object.keys(_e.removedComponents).length,addedEntities:Object.keys(_e.addedEntities).length,addedComponents:Object.keys(_e.addedComponents).length}}sumOverrideBucketCounts(_e){return _e.entityProps+_e.componentProps+_e.removedEntities+_e.removedComponents+_e.addedEntities+_e.addedComponents}setPrefabBindingReadModel(_e,tt){const et=this.measureOverrideBucketCounts(tt.overrides);this.prefabOverrideBucketCounts.set(_e,et),this.readModelStore.setPrefabBinding(_e,{id:_e,assetId:tt.assetId,assetKind:tt.assetKind,instanceRootEntityId:tt.instanceRootEntityId,sourceRevision:tt.sourceRevision,overrideCount:this.sumOverrideBucketCounts(et)})}updatePrefabBindingOverrideCount(_e,tt,et){const rt=this.readModelStore.prefabBindings.get(_e);if(!rt)return;const it=this.prefabOverrideBucketCounts.get(_e)??this.measureOverrideBucketCounts(tt.overrides),ot=et?{...it,[et]:Object.keys(tt.overrides[et]).length}:this.measureOverrideBucketCounts(tt.overrides);this.prefabOverrideBucketCounts.set(_e,ot),this.readModelStore.setPrefabBinding(_e,{...rt,overrideCount:this.sumOverrideBucketCounts(ot)})}createEntityReadModel(_e,tt){var rt;const et=new Map;for(const[it,ot]of Object.entries(tt.components))et.set(it,{id:it,type:ot.type,enabled:((rt=ot.props)==null?void 0:rt.enabled)??!0,props:{...ot.props}});return{id:_e,name:tt.name,isActive:tt.isActive,layer:tt.layer??0,isLocked:tt.isLocked??!1,parentId:tt.parentId,children:[...tt.children],isStripped:tt.isStripped===!0,modifications:this.cloneSerializable(tt.modifications??[]),removedEntities:this.cloneSerializable(tt.removedEntities??[]),removedComponents:this.cloneSerializable(tt.removedComponents??[]),transform:{position:{...tt.transform.position},rotation:{...tt.transform.rotation},scale:{...tt.transform.scale}},components:et,instance:tt.instance??null,instanceRef:this.resolveEntityInstanceRef(tt)}}resolveEntityInstanceRef(_e){return resolveEntityInstanceRef(_e)}createAssetReadModel(_e,tt){return{id:_e,name:tt.name,type:tt.type,parentFolderId:tt.parentFolderId,url:tt.url,meta:tt.meta?{...tt.meta}:void 0,props:tt.props&&Object.keys(tt.props).length>0?{...tt.props}:void 0,content:tt.content?{...tt.content}:void 0}}}function isNonPojoObject(nt){return!nt||typeof nt!="object"?!1:"constructor"in nt&&nt.constructor!==Object}function isUICanvasRenderCameraReady(nt){if(!nt||typeof nt!="object")return!0;const _e=nt.entity;return _e?!!_e._updateFlagManager:!0}function createComponentFactory(nt){const _e=new WeakMap,tt=[],et=new Map;let rt=new WeakMap;function it(ft){if(!ft||typeof ft!="object"||!("refId"in ft)||typeof ft.refId!="string")return null;const pt=ft;return pt.key?`${pt.refId}-${pt.key}`:pt.refId}function ot(ft,pt){const mt=rt.get(ft),vt=mt==null?void 0:mt.get(pt);if(!vt)return;const _t=it(vt.value);if(_t){const yt=et.get(_t);yt==null||yt.delete(vt),(yt==null?void 0:yt.size)===0&&et.delete(_t)}mt==null||mt.delete(pt),(mt==null?void 0:mt.size)===0&&rt.delete(ft)}function at(ft,pt,mt,vt){ot(ft,mt);const _t=it(vt);if(!_t)return;const yt={component:ft,type:pt,key:mt,value:vt};let bt=rt.get(ft);bt||(bt=new Map,rt.set(ft,bt)),bt.set(mt,yt);let St=et.get(_t);St||(St=new Set,et.set(_t,St)),St.add(yt)}function st(ft,pt){for(let mt=tt.length-1;mt>=0;mt--){const vt=tt[mt];vt.component===ft&&(pt===void 0||vt.key===pt)&&tt.splice(mt,1)}}function ct(ft,pt,mt,vt){var Ct,Et;const _t=getComponentSemantics(pt),yt=(Ct=_t==null?void 0:_t.proxyMap)==null?void 0:Ct[mt],bt=yt&&typeof ft[yt]=="function";if(!!yt&&((Et=_t==null?void 0:_t.methodKeys)==null?void 0:Et.has(mt))&&!yt.startsWith("set")||!(mt in ft)&&!bt||mt in ft&&isNonPojoObject(ft[mt]))return"applied";let xt=vt;if(nt){const At=it(xt);if(At){const Pt=nt(At);if(Pt===null)return"await-asset";isTraceEnabled()&&console.log(`[ComponentFactory] resolved ref ${At} → ${(Pt==null?void 0:Pt.name)??Pt}`),xt=Pt}}if(pt==="UICanvas"&&mt==="renderCamera"&&!isUICanvasRenderCameraReady(xt))return"needs-defer";try{return bt?(isTraceEnabled()&&console.log(`[ComponentFactory] ${pt}.${yt}(${xt})`),ft[yt](xt)):(isTraceEnabled()&&console.log(`[ComponentFactory] ${pt}.${mt} = ${xt}`),ft[mt]=xt),"applied"}catch(At){return console.warn(`[ComponentFactory] Failed to set prop "${mt}" on ${pt}:`,At),"needs-defer"}}function ut(ft){const pt=ft.__editorExternalComponentClaimRevision,mt=typeof pt=="number"?pt:0,vt=_e.get(ft);if(vt&&vt.revision===mt)return vt.components;const _t={revision:mt,components:new Set};return _e.set(ft,_t),_t.components}function dt(ft,pt){var bt;const mt=ut(ft),vt=[],_t=ft;if(_t.getComponents){_t.getComponents(pt,vt);for(const St of vt)if(!mt.has(St))return mt.add(St),St}const yt=((bt=_t.getComponent)==null?void 0:bt.call(_t,pt))??null;return yt&&!mt.has(yt)?(mt.add(yt),yt):null}const ht=(ft,pt,mt)=>{const vt=EditorComponent.getEngineComponent(pt);if(!vt)return console.warn(`[ComponentFactory] Unknown component type: ${pt}`),null;const _t=!!ft.__editorExternalEntity;let yt=null;if(_t){const St=dt(ft,vt);St&&(yt=St)}yt||(yt=ft.addComponent(vt),_t&&ut(ft).add(yt)),isTraceEnabled()&&console.log(`[ComponentFactory] create ${pt} on entity ${ft.name}`);const bt=yt;for(const St of Object.keys(mt)){const xt=mt[St];it(xt)?at(bt,pt,St,xt):ot(bt,St),ct(bt,pt,St,xt)==="needs-defer"&&tt.push({component:bt,type:pt,key:St,value:xt})}return yt};return ht.getProxyMap=ft=>{var pt;return(pt=getComponentSemantics(ft))==null?void 0:pt.proxyMap},ht.flushDeferred=()=>{if(tt.length===0)return;const ft=[];for(let pt=0,mt=tt.length;pt<mt;pt++){const vt=tt[pt];if(vt.type==="UICanvas"&&vt.key==="renderCamera"&&!isUICanvasRenderCameraReady(vt.value)){ft.push(vt);continue}ct(vt.component,vt.type,vt.key,vt.value)!=="applied"&&ft.push(vt)}tt.length=0,tt.push(...ft)},ht.trackAssetReference=(ft,pt,mt,vt)=>{if(it(vt)){at(ft,pt,mt,vt);return}ot(ft,mt)},ht.forgetComponentAssetReferences=ft=>{const pt=rt.get(ft);if(pt)for(const mt of Array.from(pt.keys()))ot(ft,mt);st(ft)},ht.rebindAssetReferences=ft=>{const pt=et.get(ft);if(pt!=null&&pt.size)for(const mt of Array.from(pt))ct(mt.component,mt.type,mt.key,mt.value)==="applied"&&st(mt.component,mt.key)},ht.clearAssetReferenceTracking=()=>{tt.length=0,et.clear(),rt=new WeakMap},ht}function rebindEntityModels(nt,_e){for(const[tt,et]of nt){const rt=_e.getEntity(tt);if(!(!rt||et.engineObject===rt)){et.bindEngineObject(rt,!1);for(const it of et.components){const ot=_e.getComponent(it.id);ot&&it.engineObject!==ot&&(it._engineObject=ot)}}}}class ReadModelStore{constructor(){wt(this,"_logger",new TraceLogger("ReadModelStore"));wt(this,"entities",new Map);wt(this,"assets",new Map);wt(this,"scene",{rootEntityIds:[]});wt(this,"folderChildren",new Map);wt(this,"prefabBindings",new Map);wt(this,"assetBindingIds",new Map);wt(this,"rootAssetIds",[]);wt(this,"_globalListeners",new Set);wt(this,"_entityListeners",new Map);wt(this,"_batching",!1);wt(this,"_batchedEntityIds",new Set)}subscribe(_e){return this._globalListeners.add(_e),()=>this._globalListeners.delete(_e)}subscribeEntity(_e,tt){let et=this._entityListeners.get(_e);return et||(et=new Set,this._entityListeners.set(_e,et)),et.add(tt),()=>{et.delete(tt),et.size===0&&this._entityListeners.delete(_e)}}_notifyGlobal(){if(!this._batching)for(const _e of this._globalListeners)_e()}_notifyEntity(_e){if(this._batching)return;const tt=this._entityListeners.get(_e);if(tt)for(const et of tt)et()}getEntity(_e){return this.entities.get(_e)}getEntityName(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.name)??""}getEntityChildren(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.children)??[]}getEntityParent(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.parentId)??null}getRootEntities(){return this.scene.rootEntityIds.map(_e=>this.entities.get(_e)).filter(_e=>_e!==void 0)}isEntityLocked(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.isLocked)??!1}isEntityActive(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.isActive)??!0}getAsset(_e){return this.assets.get(_e)}getAssetName(_e){var tt;return((tt=this.assets.get(_e))==null?void 0:tt.name)??""}getAssetType(_e){var tt;return((tt=this.assets.get(_e))==null?void 0:tt.type)??""}getFolderChildren(_e){return _e===null?this.rootAssetIds:this.folderChildren.get(_e)??[]}getRootAssets(){return this.rootAssetIds.map(_e=>this.assets.get(_e)).filter(_e=>_e!==void 0)}getComponent(_e,tt){var et;return(et=this.entities.get(_e))==null?void 0:et.components.get(tt)}getComponentsByEntity(_e){const tt=this.entities.get(_e);return tt?Array.from(tt.components.values()):[]}getComponentByType(_e,tt){const et=this.entities.get(_e);if(et){for(const rt of et.components.values())if(rt.type===tt)return rt}}getBindingByEntity(_e){const tt=this.entities.get(_e);if(tt!=null&&tt.instance)return this.prefabBindings.get(tt.instance.bindingId)}getBindingsByAsset(_e){return(this.assetBindingIds.get(_e)??[]).map(et=>this.prefabBindings.get(et)).filter(et=>et!==void 0)}setEntity(_e,tt){if(this._logger.info("setEntity",{id:_e,name:tt.name}),this.entities.set(_e,tt),this._batching){this._batchedEntityIds.add(_e);return}this._notifyEntity(_e),this._notifyGlobal()}deleteEntity(_e){this.entities.delete(_e),this._notifyEntity(_e),this._notifyGlobal()}setAsset(_e,tt){this.assets.set(_e,tt),this._notifyGlobal()}deleteAsset(_e){this.assets.delete(_e),this._notifyGlobal()}setScene(_e){this._logger.info("setScene",{rootEntityIds:_e.rootEntityIds}),this.scene=_e,this._notifyGlobal()}setFolderChildren(_e,tt){this.folderChildren.set(_e,tt),this._notifyGlobal()}setRootAssetIds(_e){this.rootAssetIds=_e,this._notifyGlobal()}setPrefabBinding(_e,tt){this.prefabBindings.set(_e,tt),this._notifyGlobal()}deletePrefabBinding(_e){this.prefabBindings.delete(_e),this._notifyGlobal()}setAssetBindingIds(_e,tt){tt.length===0?this.assetBindingIds.delete(_e):this.assetBindingIds.set(_e,tt),this._notifyGlobal()}beginBatch(){this._batching=!0,this._batchedEntityIds.clear()}endBatch(){this._batching=!1;for(const _e of this._batchedEntityIds)this._notifyEntity(_e);this._batchedEntityIds.clear(),this._notifyGlobal()}clear(){if(this._batching)for(const tt of this.entities.keys())this._batchedEntityIds.add(tt);const _e=this._batching?[]:Array.from(this.entities.keys());if(this.entities.clear(),this.assets.clear(),this.folderChildren.clear(),this.prefabBindings.clear(),this.assetBindingIds.clear(),this.rootAssetIds=[],this.scene={rootEntityIds:[]},!this._batching){for(const tt of _e)this._notifyEntity(tt);this._notifyGlobal()}}}function parseUploadMeta(nt){if(!(typeof nt!="string"||nt.length===0))try{const _e=JSON.parse(nt);if(_e&&typeof _e=="object"&&!Array.isArray(_e))return _e}catch{}}class UploadService{constructor(_e){this.root=_e}async upload(_e){const{file:tt,name:et,projectId:rt,assetId:it,assetType:ot,meta:at,parentFolderId:st,isFBX:ct=!1,onProgress:ut}=_e,dt=await this.root.storage.assets.create({blob:tt,name:et,projectId:rt,uuid:it,type:ot,meta:at,parentId:st,options:{useCache:!ct,onProgress:ut}});return{serverId:dt.id,url:dt.url,meta:parseUploadMeta(dt.meta)}}async uploadAndUpdateState(_e,tt){try{const et=await this.upload(tt);return this.root.assetFacade.markAssetReady(_e,et.serverId,et.url),et}catch(et){throw this.root.assetFacade.markAssetError(_e,et instanceof Error?et.message:String(et)),et}}}function buildCreateAssetRequest(nt){const{assetId:_e,projectId:tt,state:et}=nt;return{blob:null,name:et.name,projectId:tt,uuid:_e,type:et.type==="Folder"?EProjectAssetType.Directory:EProjectAssetType.File,meta:JSON.stringify(et.meta),parentId:et.parentFolderId??void 0,url:et.url}}const so=class so{constructor(_e,tt,et,rt){wt(this,"_sessionToken",0);wt(this,"unsubscribe",null);wt(this,"revisions",new Map);wt(this,"assetChains",new Map);wt(this,"pendingDeletes",[]);wt(this,"workSet",new Set);wt(this,"trackedPersistenceTasks",new WeakSet);wt(this,"_lastError",null);wt(this,"idleResolvers",[]);wt(this,"statusListeners",new Set);this.domainStore=_e,this.projectIdOrGetter=tt,this.api=et,this.onError=rt}start(){this.unsubscribe||(this._sessionToken++,this.unsubscribe=this.domainStore.subscribe(_e=>this.handleTransaction(_e)))}stop(){var _e;this._sessionToken++,(_e=this.unsubscribe)==null||_e.call(this),this.unsubscribe=null,this.assetChains.clear()}get pendingCount(){return this.workSet.size}get lastError(){return this._lastError}clearLastError(){this._lastError&&(this._lastError=null,this.notifyStatusChange())}waitForIdle(){return this.pendingCount===0?Promise.resolve():new Promise(_e=>{this.idleResolvers.push(_e)})}onStatusChange(_e){return this.statusListeners.add(_e),()=>{this.statusListeners.delete(_e)}}trackPersistenceTask(_e,tt){_e&&(this.trackedPersistenceTasks.has(_e)||(this.trackedPersistenceTasks.add(_e),this.runTask((async()=>{try{await _e}catch(et){this.reportError(new EffectsError(EffectsErrorCode.UPDATE_FAILED,"Asset persistence task failed",{...tt,originalError:et}))}})())))}get projectId(){return typeof this.projectIdOrGetter=="function"?this.projectIdOrGetter():this.projectIdOrGetter}handleTransaction(_e){if(_e.commandName==="system"||_e.commandName==="remote"||_e.commandName==="asset.init"||_e.commandName==="reset")return;const tt=this._sessionToken,et=this.projectId,rt=_e.commandName??"",it=rt.startsWith("undo:")||rt==="redo:asset.create"||rt==="asset.copy",ot=new Map;for(const at of _e.operations){const st=this.parsePropertyPath(at.path);if(st&&at.op==="replace"&&"value"in at){const dt=ot.get(st.assetId)??{hasParentId:!1};st.property==="name"?dt.name=at.value:(dt.hasParentId=!0,dt.parentId=at.value),ot.set(st.assetId,dt);continue}const ct=this.extractRootAssetId(at.path);if(!ct)continue;const ut=(this.revisions.get(ct)??0)+1;if(this.revisions.set(ct,ut),at.op==="remove"){const dt=at.oldValue;dt!=null&&dt.serverId&&this.scheduleAssetTask(ct,()=>this.executeDelete([dt.serverId],et),tt)}else if(at.op==="add"&&it&&"value"in at){const dt=at.value;dt.url&&this.scheduleAssetTask(ct,()=>this.handleCreate(ct,dt,ut,et,tt),tt)}}for(const[at,st]of ot)this.scheduleAssetTask(at,async()=>{var dt;let ct=(dt=this.domainStore.state.assets[at])==null?void 0:dt.serverId;if(ct||(ct=await this.waitForServerId(at,3e4,tt)),!ct)return;const ut={};st.name!==void 0&&(ut.name=st.name),st.hasParentId&&(ut.parentId=st.parentId),await this.executeUpdate(ct,ut)},tt)}async executeDelete(_e,tt){const{error:et}=await this.retryOnce(()=>this.api.assets.delete(_e,tt));et&&(this.pendingDeletes.push(..._e),console.warn("[AssetEffectsRunner] delete failed:",et.retryError),this.reportError(new EffectsError(EffectsErrorCode.DELETE_FAILED,"Asset delete side effects failed",{serverIds:_e,originalError:et.originalError,retryError:et.retryError})))}async executeUpdate(_e,tt){const{error:et}=await this.retryOnce(()=>this.api.assets.update(_e,tt));et&&(console.warn("[AssetEffectsRunner] update failed:",et.retryError),this.reportError(new EffectsError(EffectsErrorCode.UPDATE_FAILED,`Asset update side effects failed: ${_e}`,{serverId:_e,data:tt,originalError:et.originalError,retryError:et.retryError})))}async retryOnce(_e){try{return await _e(),{}}catch(tt){await new Promise(et=>setTimeout(et,so.RETRY_DELAY_MS));try{return await _e(),{}}catch(et){return{error:{originalError:tt,retryError:et}}}}}getPendingDeletes(){return[...this.pendingDeletes]}async retryPendingDeletes(){const _e=this.pendingDeletes.splice(0);_e.length!==0&&await this.runTask(this.executeDelete(_e,this.projectId))}async handleCreate(_e,tt,et,rt,it){try{const ot=await this.api.assets.create(buildCreateAssetRequest({assetId:_e,projectId:rt,state:tt}));if(this._sessionToken!==it){this.runTask(this.executeDelete([ot.id],rt));return}const at=this.domainStore.state.assets[_e];if(this.revisions.get(_e)!==et||!at){this.runTask(this.executeDelete([ot.id],rt));return}const st=Object.prototype.hasOwnProperty.call(at,"serverId")?"replace":"add";try{this.domainStore.applySystem([{op:st,path:`/assets/${_e}/serverId`,value:ot.id}])}catch(ct){throw this.runTask(this.executeDelete([ot.id],rt)),ct}}catch(ot){console.warn("[AssetEffectsRunner] recreate failed:",ot),this.reportError(new EffectsError(EffectsErrorCode.CREATE_FAILED,`Asset create side effects failed: ${_e}`,{assetId:_e,originalError:ot}))}}runTask(_e){const tt=this.beginWork();return _e.finally(()=>{this.endWork(tt)})}scheduleAssetTask(_e,tt,et){const rt=this.beginWork(),it=async()=>{this._sessionToken===et&&await tt()},ot=this.assetChains.get(_e),at=(ot?ot.catch(()=>{}).then(it):Promise.resolve(it())).catch(st=>{this.reportError(new EffectsError(EffectsErrorCode.UPDATE_FAILED,`Asset side effects scheduler failed: ${_e}`,{assetId:_e,originalError:st}))}).finally(()=>{this.endWork(rt),this.assetChains.get(_e)===at&&this.assetChains.delete(_e)});this.assetChains.set(_e,at)}beginWork(){const _e=Symbol("asset-effects-work");return this.workSet.size===0&&(this._lastError=null),this.workSet.add(_e),this.notifyStatusChange(),_e}endWork(_e){this.workSet.delete(_e)&&this.notifyStatusChange()}notifyStatusChange(){const _e=this.pendingCount;for(const tt of this.statusListeners)tt(_e,_e===0?this._lastError:null);if(_e===0){const tt=this.idleResolvers.splice(0);for(const et of tt)et()}}reportError(_e){var tt;this._lastError=_e,(tt=this.onError)==null||tt.call(this,_e)}parsePropertyPath(_e){const tt=_e.match(/^\/assets\/([^/]+)\/(name|parentFolderId)$/);return tt?{assetId:tt[1],property:tt[2]}:null}extractRootAssetId(_e){if(!_e.startsWith("/assets/"))return null;const tt=_e.slice(8);return!tt||tt.includes("/")?null:tt}waitForServerId(_e,tt,et){const rt=this.domainStore.state.assets[_e];return rt?rt.serverId?Promise.resolve(rt.serverId):this._sessionToken!==et?Promise.resolve(null):new Promise(it=>{let ot=!1;const at=ut=>{ot||(ot=!0,clearTimeout(st),ct(),it(ut))},st=setTimeout(()=>at(null),tt),ct=this.domainStore.subscribe(()=>{if(this._sessionToken!==et)return at(null);const ut=this.domainStore.state.assets[_e];if(!ut)return at(null);ut.serverId&&at(ut.serverId)})}):Promise.resolve(null)}};wt(so,"RETRY_DELAY_MS",500);let AssetEffectsRunner=so;const SKIP_COMMANDS=new Set(["system","remote","asset.init","reset"]);class ScenePersistenceRunner{constructor(_e,tt){wt(this,"_unsubscribe",null);this.domainStore=_e,this.config=tt}start(){this._unsubscribe||(this._unsubscribe=this.domainStore.subscribe(_e=>this.handleTransaction(_e)))}stop(){var _e;(_e=this._unsubscribe)==null||_e.call(this),this._unsubscribe=null}handleTransaction(_e){if(this.domainStore.isHistoryPaused)return;const tt=_e.commandName??"";SKIP_COMMANDS.has(tt)||!_e.operations.some(rt=>rt.path.startsWith("/entities/")||rt.path.startsWith("/scene/"))||this.config.persistSceneDebounced(tt||"unknown")}}class InspectorSelectionService{constructor(_e){this.root=_e}getSelectedEntityId(){var tt;const _e=((tt=this.root.sceneUIStore)==null?void 0:tt.lastSelectedId)??null;return!_e||_e===DEFAULT_SCENE?null:_e}getSelectedEntityModel(){const _e=this.getSelectedEntityId();return _e?this.root.sceneStore.entities.get(_e)??null:null}getSelectedEntityReadModel(){const _e=this.getSelectedEntityId();return _e?this.root.readModelStore.getEntity(_e)??null:null}getSelectedComponents(){var _e;return((_e=this.getSelectedEntityModel())==null?void 0:_e.components)??[]}}function disposeReloadState(nt,_e){var tt,et,rt,it,ot,at,st;(tt=nt.assetEffectsRunner)==null||tt.stop(),(et=nt.scenePersistenceRunner)==null||et.stop(),(rt=nt.selectionStore)==null||rt.dispose(),(it=nt.domainStateReactive)==null||it.dispose(),(ot=nt.uiProjection)==null||ot.dispose(),(at=nt.runtimeBinderRegistry)==null||at.dispose(),(st=nt.runtimeAssetStore)==null||st.dispose(),_e==null||_e()}function bindAssetRuntimeReadyToProjection(nt,_e,tt){return nt.subscribe((et,rt)=>{var it,ot,at;(rt==null?void 0:rt.status)==="ready"&&((it=_e())==null||it.rebindAssetReferences(et),(at=(ot=tt==null?void 0:tt())==null?void 0:ot.rebindAssetReferences)==null||at.call(ot,et,!1))})}const Mr=class Mr{constructor(){wt(this,"projectStore");wt(this,"configDataStore");wt(this,"layoutStore");wt(this,"assetStore");wt(this,"animationClipStore");wt(this,"animatorControllerStore");wt(this,"snapshot");wt(this,"inspectorStore",inspectorStore);wt(this,"selectionStore");wt(this,"sceneUIStore");wt(this,"assetUIStore");wt(this,"assetService");wt(this,"assetRegistry");wt(this,"domainStore");wt(this,"commandBus");wt(this,"engineProjection",null);wt(this,"_lastProjectionRebuildTime",0);wt(this,"_projectionRebuildTimer",null);wt(this,"_disposeAssetRuntimeReadySubscription",null);wt(this,"domainStateReactive");wt(this,"entityModelProjection");wt(this,"runtimeProjection");wt(this,"readModelStore");wt(this,"uiProjection");wt(this,"entityFacade");wt(this,"assetFacade");wt(this,"componentFacade");wt(this,"sceneFacade");wt(this,"inspectorFacade");wt(this,"prefabFacade");wt(this,"uploadService");wt(this,"_logger",new TraceLogger("Root"));wt(this,"assetEffectsRunner");wt(this,"scenePersistenceRunner");wt(this,"inspectorSelectionService");wt(this,"runtimeBinderRegistry");wt(this,"runtimeAssetStore");wt(this,"storage");wt(this,"esbuildInstancePromise",Mr.getEsbuildInstancePromise());wt(this,"reload",()=>{disposeReloadState(this,()=>{var _e;(_e=this._disposeAssetRuntimeReadySubscription)==null||_e.call(this),this._disposeAssetRuntimeReadySubscription=null,this._projectionRebuildTimer&&(clearTimeout(this._projectionRebuildTimer),this._projectionRebuildTimer=null)}),this.configDataStore=new ConfigDataCenter,this.projectStore=new Project(this),this.layoutStore=new LayoutSystem(this),this.snapshot=snapshotStore,this.assetUIStore=new AssetUIStore,this.assetService=new AssetService(this),this.assetRegistry=new AssetRegistry,this.assetStore=new AssetManager(this),this.animationClipStore=new AnimationClipStore(this),this.animatorControllerStore=new AnimatorControllerStore(this),this.selectionStore=new SelectionStore(this),this.sceneUIStore=new SceneUIStore(this),this.domainStore=new DomainStore,this.domainStore.pauseHistory(),this.commandBus=new CommandBus(this.domainStore),this.domainStateReactive=new DomainStateReactive(this.domainStore),this.readModelStore=new ReadModelStore,this.runtimeAssetStore=new RuntimeAssetStore,this.runtimeBinderRegistry=new RuntimeBinderRegistry,this.uiProjection=new UIProjection(this.domainStore,this.readModelStore),this.uiProjection.setAssetStore(this.assetStore),this.runtimeProjection=new RuntimeProjection(()=>this.sceneStore,()=>this.engineProjection,this.runtimeBinderRegistry,()=>this.domainStore.canRedo),this.entityModelProjection=new EntityModelProjection(()=>this.sceneStore,()=>this.engineProjection),this.domainStore.subscribe(_e=>{if(this.engineProjection){if(_e.commandName==="reset"){this.runtimeProjection.reset();try{this.engineProjection.rebuildFromState(this.domainStore.state),this._rebindAllEntityModels()}catch(rt){console.error("EngineProjection rebuild failed:",rt),this._requestEngineProjectionRebuild(rt)}return}try{this.engineProjection.apply(_e.events,_e.commandName)}catch(rt){console.error("EngineProjection apply failed:",rt),this._requestEngineProjectionRebuild(rt)}}const tt=this.runtimeProjection.apply(_e.events,_e.commandName);this.entityModelProjection.apply(_e.events,tt),isUndoRedoCommand(_e.commandName)&&this._syncUploadingAssetIds(_e.operations),this._resumeCreateByAddAfterRedo(_e.operations,_e.commandName)}),this.entityFacade=new EntityFacade(this),this.assetFacade=new AssetFacade(this),this.componentFacade=new ComponentFacade(this),this.sceneFacade=new SceneFacade(this.domainStore,this.commandBus),this.inspectorFacade=new InspectorFacade(this),this.prefabFacade=new PrefabFacade(this),isTraceEnabled()&&(instrumentCommandBus(this.commandBus),instrumentDomainStore(this.domainStore),wrapFacadeWithTrace(this.entityFacade,"EntityFacade"),wrapFacadeWithTrace(this.componentFacade,"ComponentFacade"),wrapFacadeWithTrace(this.assetFacade,"AssetFacade"),wrapFacadeWithTrace(this.inspectorFacade,"InspectorFacade")),this.uploadService=new UploadService(this),this.assetEffectsRunner=new AssetEffectsRunner(this.domainStore,()=>this.projectStore.id,{assets:{delete:(..._e)=>this.storage.assets.delete(..._e),create:_e=>this.storage.assets.create(_e),update:(_e,tt)=>this.storage.assets.update(_e,tt).then(()=>{})}}),this.scenePersistenceRunner=new ScenePersistenceRunner(this.domainStore,{persistSceneDebounced:_e=>this.projectStore.persistSceneDebounced(_e)}),this.inspectorSelectionService=new InspectorSelectionService(this)});this.reload()}static getEsbuildInstancePromise(){return Mr.esbuildInstancePromiseSingleton||(Mr.esbuildInstancePromiseSingleton=browserExports.initialize({worker:!0,wasmURL:"https://gw.alipayobjects.com/os/lib/esbuild-wasm/0.25.8/esbuild.wasm"})),Mr.esbuildInstancePromiseSingleton}createLogger(_e){return new TraceLogger(_e)}get sceneStore(){return this.projectStore.currentScene}get viewportStore(){return this.projectStore.currentViewport}undo(){isTraceEnabled()&&beginTrace();try{return this.domainStore.undo()!==null}finally{isTraceEnabled()&&endTrace()}}redo(){isTraceEnabled()&&beginTrace();try{return this.domainStore.redo()!==null}finally{isTraceEnabled()&&endTrace()}}get canUndo(){return this.domainStore.canUndo}get canRedo(){return this.domainStore.canRedo}runInUndoGroup(_e,tt){this.domainStore.beginUndoGroup();const et=()=>{this.domainStore.endUndoGroup(_e)};try{const rt=tt();return rt&&typeof rt.then=="function"?rt.finally(et):(et(),rt)}catch(rt){throw et(),rt}}resumeHistoryCapture(){this.domainStore.resumeHistory.bind(this.domainStore)()}setStorage(_e){if(!(_e!=null&&_e.project)||!(_e!=null&&_e.assets)||!(_e!=null&&_e.schema))throw new Error("setStorage: storage must implement project, assets, and schema");this.storage=_e}initEngineProjection(_e){var et;(et=this._disposeAssetRuntimeReadySubscription)==null||et.call(this),this._disposeAssetRuntimeReadySubscription=null,this.engineProjection=new EngineProjection(_e,void 0,()=>this.domainStore.canRedo);const tt=rt=>{var it;return((it=this.runtimeAssetStore.get(rt))==null?void 0:it.engineObject)??null};this.engineProjection.setAssetResolver(tt),this.engineProjection.setComponentFactory(createComponentFactory(tt)),this._disposeAssetRuntimeReadySubscription=bindAssetRuntimeReadyToProjection(this.runtimeAssetStore,()=>this.engineProjection,()=>this.sceneStore),this.sceneStore&&this.uiProjection.setSceneStore(this.sceneStore)}_requestEngineProjectionRebuild(_e){if(!this.engineProjection)return;const rt=Date.now()-this._lastProjectionRebuildTime;if(rt>=Mr.PROJECTION_REBUILD_THROTTLE_MS){this._runEngineProjectionRebuild(_e);return}if(this._projectionRebuildTimer)return;const it=Mr.PROJECTION_REBUILD_THROTTLE_MS-rt;this._projectionRebuildTimer=setTimeout(()=>{this._projectionRebuildTimer=null,this._runEngineProjectionRebuild(_e)},it)}_resumeCreateByAddAfterRedo(_e,tt){const et=collectCreateByAddResumeCandidates({commandName:tt,operations:_e,assets:this.domainStore.state.assets});for(const rt of et)this.assetStore.resumeCreateAssetByAddFromState(rt).catch(it=>{console.warn("[Root] resumeCreateAssetByAddFromState failed:",{assetId:rt,error:it})})}_runEngineProjectionRebuild(_e){const tt=this.engineProjection;if(tt){this._lastProjectionRebuildTime=Date.now();try{tt.rebuildFromState(this.domainStore.state),this._rebindAllEntityModels()}catch(et){console.error("EngineProjection rebuild failed:",et,"reason:",_e);try{tt.reset()}catch(rt){console.error("EngineProjection reset failed:",rt)}}}}_rebindAllEntityModels(){const _e=this.sceneStore;!_e||!this.engineProjection||rebindEntityModels(_e.entities,this.engineProjection)}_syncUploadingAssetIds(_e){const tt=this.assetUIStore;if(!tt)return;const et=/^\/assets\/([^/]+)$/;for(const it of _e){const ot=et.exec(it.path);if(!ot)continue;const at=ot[1];it.op==="add"&&it.value&&typeof it.value=="object"&&it.value.status==="uploading"?tt.markAssetUploading(at):it.op==="remove"&&tt.clearAssetUploading(at)}const rt=/^\/assets\/([^/]+)\/status$/;for(const it of _e){const ot=rt.exec(it.path);if(!ot)continue;const at=ot[1];it.op!=="remove"&&"value"in it&&it.value==="uploading"?tt.markAssetUploading(at):tt.clearAssetUploading(at)}}};wt(Mr,"esbuildInstancePromiseSingleton",null),wt(Mr,"PROJECTION_REBUILD_THROTTLE_MS",3e3);let Root=Mr;async function initProjectReadRuntime({root:nt,storage:_e,projectId:tt,canvas:et,projectInfo:rt,onStage:it}){var ut;nt.setStorage(_e);const ot=rt??await(async()=>(it==null||it("query-project"),_e.project.query(tt)))(),at=nt.projectStore,st=[...ot.assets??[]];it==null||it("init-project"),await at.init(ot),it==null||it("init-engine"),await at.initEngine(et),it==null||it("init-assets"),await at.initAssets(st),it==null||it("init-scene"),await at.initScene(),it==null||it("run-engine"),at.runEngine();const ct=(ut=nt.sceneStore)!=null&&ut.entities?Array.from(nt.sceneStore.entities.values()).flatMap(dt=>dt.components):[];return it==null||it("replay-bindings"),await Promise.all(ct.map(dt=>{var ht;return((ht=dt.replaySerializedBindings)==null?void 0:ht.call(dt))??Promise.resolve()})),it==null||it("resume-history"),nt.resumeHistoryCapture(),{root:nt,projectInfo:ot,projectStore:at,viewportStore:at.currentViewport}}function collectAssetPickerMatches(nt,_e){if(!nt)return[];const tt=[],et=getPropertyConfigs(nt);for(const rt in et){const it=et[rt];if(!it||it.type!==ComponentType.AssetPicker)continue;const ot=nt[rt];ot&&typeof ot=="object"&&"refId"in ot&&ot.refId===_e&&tt.push({target:nt,key:rt})}return tt}function refreshAssetReferenceMatch(nt){var ut,dt,ht,ft,pt,mt,vt;const{target:_e,key:tt}=nt,et=(ut=getPropertyConfigs(_e))==null?void 0:ut[tt];(dt=_e.triggerPropertyChange)==null||dt.call(_e,tt,!1);const rt=((ht=_e==null?void 0:_e[storedPropertyProxySymbol])==null?void 0:ht[tt])??((ft=getPropertyProxyConfigs(_e))==null?void 0:ft[tt]),it=rt==null?void 0:rt.engineKey;if(!!(et!=null&&et.bindPath||et!=null&&et.onChange)||!it)return;const at=_e==null?void 0:_e.engineObject;if(!at||typeof at[it]!="function")return;const st=_e[tt],ct=st!=null&&st.refId?((vt=(mt=(pt=_e==null?void 0:_e.root)==null?void 0:pt.assetStore)==null?void 0:mt.assets)==null?void 0:vt[st.refId])??null:null;at[it]((ct==null?void 0:ct.engineObject)??null)}const TEXT_ASSET_TYPES=new Set(["Scene","Prefab","script","Shader","ShaderChunk","StateMachineScript"]);function parseAssetMeta(nt,_e){if(!nt)return{};try{const tt=JSON.parse(nt);if(!tt||typeof tt!="object"||Array.isArray(tt))throw new Error("asset meta is not an object");return tt}catch(tt){return console.warn(`[applyProjectReadRefresh] invalid asset meta for ${_e}, fallback to empty meta`,tt),{}}}function toDomainAssetState(nt){const _e=parseAssetMeta(nt.meta,nt.uuid);return{id:nt.uuid,name:nt.name,type:_e.type??"Unknown",serverId:nt.id??null,parentFolderId:nt.parentId||null,url:nt.url||void 0,meta:_e,status:"ready"}}function isSerializableEqual(nt,_e){return JSON.stringify(nt)===JSON.stringify(_e)}async function fetchAssetPayload(nt,_e){const tt=await fetch(nt);if(!tt.ok)throw new Error(`asset fetch failed: ${tt.status}`);const et=await tt.blob(),rt=TEXT_ASSET_TYPES.has(_e)?await et.text():void 0;return{blob:et,text:rt}}function refreshSceneAssetPickerReferences(nt,_e){var rt,it,ot,at;const tt=nt.sceneStore;if(!tt)return;const et=st=>{for(const ct of collectAssetPickerMatches(st,_e))refreshAssetReferenceMatch(ct)};et(tt);for(const st of((it=(rt=tt.entities)==null?void 0:rt.values)==null?void 0:it.call(rt))??[])for(const ct of st.components??[])et(ct);for(const st of((at=(ot=tt.strippedEntities)==null?void 0:ot.values)==null?void 0:at.call(ot))??[])for(const ct of st.components??[])et(ct)}function syncDomainAssetState(nt,_e){const tt=_e.id,et=nt.domainStore.state.assets[tt];if(et&&isSerializableEqual(et,_e))return;const rt=encodeJsonPointerSegment(tt),it=et?{op:"replace",path:`/assets/${rt}`,value:_e}:{op:"add",path:`/assets/${rt}`,value:_e};nt.domainStore.applyRemote([it])}function normalizeAssetBatchChanges(nt){const _e=new Map;for(const tt of nt){const et=_e.get(tt.assetId);if(!et){_e.set(tt.assetId,{assetId:tt.assetId,reason:tt.reason});continue}et.reason!=="main"&&tt.reason==="main"&&_e.set(tt.assetId,{assetId:tt.assetId,reason:"main"})}return Array.from(_e.values())}async function fetchAndLoadMainFile(nt,_e){var it;const tt=_e.url;if(!tt||typeof nt.reloadMainFileFromRemote!="function")return;const{blob:et,text:rt}=await fetchAssetPayload(tt,_e.type);return(it=nt.setUrl)==null||it.call(nt,tt),await nt.reloadMainFileFromRemote({blob:et,url:tt}),_e.type==="ShaderChunk"&&typeof rt=="string"&&typeof nt.updateCode=="function"&&nt.updateCode(rt),rt}async function reloadRuntimeAsset(nt,_e,tt,et){var rt;if(!nt){const it=tt.assetStore.initAsset(et);if(!it)return;let ot;try{ot=await fetchAndLoadMainFile(it,_e)}catch(at){console.warn(`[applyProjectReadRefresh] initial main file load failed for ${et.uuid}`,at)}try{await((rt=it.collectDependencies)==null?void 0:rt.call(it))}catch(at){console.warn(`[applyProjectReadRefresh] collectDependencies failed for ${et.uuid}`,at)}return ot}return fetchAndLoadMainFile(nt,_e)}async function refreshCurrentScene(nt,_e){var rt,it;const tt=nt.domainStore.state,et=createEmptyDomainState();et.version=tt.version,et.assets=tt.assets,nt.domainStore.reset(et),await((it=(rt=nt.sceneStore)==null?void 0:rt.init)==null?void 0:it.call(rt,_e))}async function applyProjectReadFullRefresh(nt){var at;const{root:_e,storage:tt,projectId:et}=nt,rt=nt.projectInfo??await tt.project.query(et),it=_e.domainStore.state.assets??{},ot=(at=_e.sceneStore)==null?void 0:at.refId;await EditorAsset.runWithGlobalAutoSaveSuspended(async()=>{await _e.domainStore.runAsRemote(async()=>{var ct,ut;let st=null;for(const dt of rt.assets){const ht=toDomainAssetState(dt),ft=it[dt.uuid];if(ft&&isSerializableEqual(ft,ht))continue;syncDomainAssetState(_e,ht);const pt=(ct=_e.assetStore.assets)==null?void 0:ct[dt.uuid];dt.uuid===ot&&(st=pt);try{await reloadRuntimeAsset(pt,ht,_e,dt)}catch(mt){console.warn(`[applyProjectReadFullRefresh] reload runtime asset failed for ${dt.uuid}, skipping`,mt)}dt.uuid!==ot&&refreshSceneAssetPickerReferences(_e,dt.uuid)}if(st||ot){const dt=st??((ut=_e.assetStore.assets)==null?void 0:ut[ot]);await refreshCurrentScene(_e,dt)}})})}async function applyProjectReadAssetBatchRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et,changes:rt}){const it=et??await _e.project.query(tt),ot=normalizeAssetBatchChanges(rt);await EditorAsset.runWithGlobalAutoSaveSuspended(async()=>{await nt.domainStore.runAsRemote(async()=>{var at;for(const st of ot){const ct=it.assets.find(ht=>ht.uuid===st.assetId);if(!ct)throw new Error(`refresh asset not found in project detail: ${st.assetId}`);const ut=toDomainAssetState(ct),dt=(at=nt.assetStore.assets)==null?void 0:at[st.assetId];syncDomainAssetState(nt,ut),st.reason==="main"&&(await reloadRuntimeAsset(dt,ut,nt,ct),refreshSceneAssetPickerReferences(nt,st.assetId))}})})}async function applyProjectReadRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et,change:rt}){if(rt.type==="scene-changed"){await applyProjectReadFullRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et});return}await applyProjectReadAssetBatchRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et,changes:[{assetId:rt.assetId,reason:rt.reason}]})}function mountEngineCanvas(nt,_e){var et;const tt=_e.canvas;if(!tt)throw new Error("projectStore.canvas is missing");return tt.style.width="100%",tt.style.height="100%",tt.oncontextmenu=rt=>{rt.preventDefault()},tt.parentElement!==nt&&nt.appendChild(tt),(et=_e.engine)==null||et.dispatch("onReady"),tt}function unique(nt){return Array.from(new Set(nt))}function createRuntimeBootstrapPlan({projectInfo:nt,sceneData:_e}){const tt=Array.from(collectAssetTypes(nt.assets)).sort(),et=Array.from(collectComponentTypes(_e)).sort(),rt=tt.filter(ot=>!ASSET_MODULE_KEYS_BY_TYPE[ot]),it=et.filter(ot=>!COMPONENT_MODULE_KEYS_BY_TYPE[ot]);return!_e||rt.length>0||it.length>0?{mode:"full",assetTypes:tt,componentTypes:et,unknownAssetTypes:rt,unknownComponentTypes:it,assetModuleKeys:[...FULL_ASSET_MODULE_KEYS],componentModuleKeys:[...FULL_COMPONENT_MODULE_KEYS],shouldInitGlTFIO:!0}:{mode:"selective",assetTypes:tt,componentTypes:et,unknownAssetTypes:rt,unknownComponentTypes:it,assetModuleKeys:unique([...tt.map(ot=>ASSET_MODULE_KEYS_BY_TYPE[ot]).filter(Boolean),"ambient-light"]).sort(),componentModuleKeys:unique(et.map(ot=>COMPONENT_MODULE_KEYS_BY_TYPE[ot]).filter(Boolean)).sort(),shouldInitGlTFIO:tt.includes("glTF")}}async function loadRuntimeBootstrapContext({storage:nt,projectId:_e,fetchImpl:tt=fetch}){const et=await nt.project.query(_e),rt=await loadCurrentSceneData(et,tt);return{projectInfo:et,currentSceneData:rt,plan:createRuntimeBootstrapPlan({projectInfo:et,sceneData:rt})}}async function loadCurrentSceneData(nt,_e){var rt;const tt=(rt=nt.content)==null?void 0:rt.scene,et=resolveCurrentSceneAsset(nt.assets,tt);if(!(et!=null&&et.url))return null;try{const it=await _e(et.url);if(!it.ok)return null;const ot=await it.json();return ot&&typeof ot=="object"?ot:null}catch{return null}}function resolveCurrentSceneAsset(nt,_e){if(_e){const tt=nt.find(et=>et.uuid===_e);if(tt)return tt}return nt.find(tt=>parseAssetType(tt.meta)==="Scene")}function collectAssetTypes(nt){const _e=new Set;for(const tt of nt){const et=parseAssetType(tt.meta);et&&!NON_RUNTIME_ASSET_TYPES.has(et)&&_e.add(et)}return _e}function parseAssetType(nt){try{const _e=JSON.parse(nt);return typeof _e.type=="string"&&_e.type.length>0?_e.type:null}catch{return null}}function collectComponentTypes(nt){var et;const _e=new Set,tt=nt==null?void 0:nt.entities;if(!Array.isArray(tt))return _e;for(const rt of tt){if(!rt||typeof rt!="object")continue;const it=readString((et=rt.transform)==null?void 0:et.class);it&&_e.add(it);const ot=rt.components;if(Array.isArray(ot))for(const at of ot){const st=readString(at==null?void 0:at.class);st&&_e.add(st)}}return _e}function readString(nt){return typeof nt=="string"&&nt.length>0?nt:null}class ViewportRuntime{constructor(){wt(this,"root",null);wt(this,"projectStore",null);wt(this,"viewportStore",null);wt(this,"container",null);wt(this,"storage",null);wt(this,"projectId",null);wt(this,"taskQueue",Promise.resolve());wt(this,"resizeObserver",null)}get engine(){var _e;return((_e=this.projectStore)==null?void 0:_e.engine)??null}async init(_e,tt,et,rt={}){this.container=_e,this.storage=tt,this.projectId=et,await this.enqueueBootstrap(_e,tt,et,!1,rt.onStage,rt.projectInfo)}async reload(_e=this.storage,tt=this.projectId){if(!_e)throw new Error("storage is required");if(!tt)throw new Error("projectId is required");if(this.storage=_e,this.projectId=tt,this.root){await this.enqueueTask(async()=>{const et=await this.ensureBootstrapForCurrentProject();await applyProjectReadFullRefresh({root:this.root,storage:_e,projectId:tt,projectInfo:et==null?void 0:et.projectInfo})});return}if(!this.container)throw new Error("container is required");await this.enqueueBootstrap(this.container,_e,tt,!0)}async applyChange(_e){if(_e.type==="project-changed"){await this.reload();return}await this.enqueueTask(async()=>{const tt=this.root,et=this.storage,rt=this.projectId;if(!tt)throw new Error("runtime root is required");if(!et)throw new Error("storage is required");if(!rt)throw new Error("projectId is required");const it=await this.ensureBootstrapForCurrentProject();await applyProjectReadRefresh({root:tt,storage:et,projectId:rt,projectInfo:it==null?void 0:it.projectInfo,change:{type:_e.type,assetId:_e.assetId,reason:_e.reason}})})}async applyAssetBatchChange({changes:_e}){await this.enqueueTask(async()=>{const tt=this.root,et=this.storage,rt=this.projectId;if(!tt)throw new Error("runtime root is required");if(!et)throw new Error("storage is required");if(!rt)throw new Error("projectId is required");const it=await this.ensureBootstrapForCurrentProject();await applyProjectReadAssetBatchRefresh({root:tt,storage:et,projectId:rt,projectInfo:it==null?void 0:it.projectInfo,changes:_e})})}async ensureBootstrapForCurrentProject(){const _e=this.storage,tt=this.projectId;if(!_e||!tt)return null;try{const et=await loadRuntimeBootstrapContext({storage:_e,projectId:tt});return await bootstrapEditorRuntime({plan:et.plan}),et}catch(et){return console.warn("[ViewportRuntime] ensureBootstrapForCurrentProject failed:",et),null}}async setEntityTransform(_e,tt,et={}){await this.enqueueTask(async()=>{const{root:rt,projectStore:it}=this.requireRuntimeHandles();rt.entityFacade.setTransform(_e,tt),await this.persistSceneIfRequested(it,et.persist)})}async saveScene(){await this.enqueueTask(async()=>{const{projectStore:_e}=this.requireRuntimeHandles();await this.persistScene(_e)})}async undo(_e={}){return this.enqueueTask(async()=>{const{root:tt,projectStore:et}=this.requireRuntimeHandles(),rt=tt.undo();return rt&&await this.persistSceneIfRequested(et,_e.persist),rt})}async redo(_e={}){return this.enqueueTask(async()=>{const{root:tt,projectStore:et}=this.requireRuntimeHandles(),rt=tt.redo();return rt&&await this.persistSceneIfRequested(et,_e.persist),rt})}dispose(){this.disposeRuntime(),this.container=null,this.storage=null,this.projectId=null}enqueueBootstrap(_e,tt,et,rt=!1,it,ot){return this.enqueueTask(async()=>{rt&&this.disposeRuntime(),await this.bootstrap(_e,tt,et,it,ot)})}enqueueTask(_e){const tt=this.taskQueue.then(_e,_e);return this.taskQueue=tt.then(()=>{},()=>{}),tt}async bootstrap(_e,tt,et,rt,it){const ot=new Root,at=document.createElement("canvas"),st=await initProjectReadRuntime({root:ot,storage:tt,projectId:et,canvas:at,projectInfo:it,onStage:rt,viewport:{mode:"viewer"}});this.root=st.root,this.projectStore=st.projectStore,this.viewportStore=st.viewportStore,mountEngineCanvas(_e,this.projectStore),this.attachResizeSync(_e)}disposeRuntime(){var tt,et,rt,it;(tt=this.resizeObserver)==null||tt.disconnect(),this.resizeObserver=null;const _e=(et=this.projectStore)==null?void 0:et.canvas;_e!=null&&_e.parentElement&&_e.parentElement.removeChild(_e),(it=(rt=this.projectStore)==null?void 0:rt.reset)==null||it.call(rt),this.root=null,this.projectStore=null,this.viewportStore=null}attachResizeSync(_e){var et,rt,it;if((et=this.resizeObserver)==null||et.disconnect(),this.resizeObserver=null,(it=(rt=this.viewportStore)==null?void 0:rt.handleContainerResize)==null||it.call(rt),typeof ResizeObserver>"u")return;const tt=new ResizeObserver(()=>{var ot,at;(at=(ot=this.viewportStore)==null?void 0:ot.handleContainerResize)==null||at.call(ot)});tt.observe(_e),this.resizeObserver=tt}requireRuntimeHandles(){const _e=this.root,tt=this.projectStore;if(!_e)throw new Error("runtime root is required");if(!tt)throw new Error("projectStore is required");return{root:_e,projectStore:tt}}async persistSceneIfRequested(_e,tt=!1){tt&&await this.persistScene(_e)}async persistScene(_e){var et;const tt=(et=_e.updateSceneAsset)==null?void 0:et.bind(_e);if(!tt)throw new Error("projectStore.updateSceneAsset is required");await tt()}}class HttpStorage{constructor(_e){wt(this,"project");wt(this,"assets");wt(this,"schema");this.project={query:tt=>_e.project.query(tt),modifyProjectName:(tt,et)=>_e.project.modifyProjectName(tt,et).then(()=>{}),updateThumbnail:(tt,et)=>_e.project.updateThumbnail(tt,et),updateMetaInfo:(tt,et,rt)=>_e.project.updateMetaInfo(tt,et,rt).then(()=>{}),updateSetting:(tt,et)=>_e.project.updateSetting(tt,et).then(()=>{})},this.assets={create:async tt=>{const{id:et,url:rt,meta:it}=await _e.assets.create(tt);return{id:et,url:rt,meta:typeof it=="string"?it:void 0}},update:(tt,et)=>_e.assets.update(tt,et),delete:(tt,et)=>_e.assets.delete(tt,et),duplicate:async tt=>(await _e.assets.duplicateTo(tt)).data},this.schema={update:(tt,et)=>_e.schema.update(tt,et)}}}function createStorage(nt,_e=fetch){const tt={project:{query:async et=>{const rt=await _e(`${nt}/api/project/${et}`);if(!rt.ok)throw new Error(`project query failed: ${rt.status}`);return rt.json()},modifyProjectName:async()=>({}),updateThumbnail:async()=>({thumbnail:""}),updateMetaInfo:async()=>({}),updateSetting:async()=>({})},assets:{create:async()=>({id:"",url:""}),update:async(et,rt)=>{const it=await serializeAssetUpdate(rt),ot=await _e(`${nt}/api/assets/${encodeURIComponent(et)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(it)});if(!ot.ok)throw new Error(`asset update failed: ${ot.status}`);return ot.json()},delete:async()=>{},duplicateTo:async()=>({data:[]})},schema:{update:async()=>{}}};return new HttpStorage(tt)}async function serializeAssetUpdate(nt){return{file:nt.file?await serializeBlob(nt.file):void 0,meta:nt.meta,name:nt.name,parentId:nt.parentId,url:nt.url}}async function serializeBlob(nt){const _e=await nt.arrayBuffer();return{base64:encodeBase64(_e),type:nt.type}}function encodeBase64(nt){if(typeof Buffer<"u")return Buffer.from(nt).toString("base64");let _e="";const tt=new Uint8Array(nt);for(let et=0;et<tt.length;et++)_e+=String.fromCharCode(tt[et]);return btoa(_e)}async function loadRuntimeProjectId(nt,_e=fetch){const tt=normalizeBaseUrl(nt),et=await _e(`${tt}/healthz`);if(!et.ok)throw new Error(`project id query failed: ${et.status}`);const rt=await et.json();return typeof rt.projectId=="string"&&rt.projectId.length>0?rt.projectId:"local"}async function loadRuntimeProjectContext(nt,_e={}){var at,st;const tt=normalizeBaseUrl(nt),et=_e.fetchImpl??fetch;(at=_e.onStage)==null||at.call(_e,"resolve-project-id");const rt=await loadRuntimeProjectId(tt,et),it=createStorage(tt,et);(st=_e.onStage)==null||st.call(_e,"query-project");const ot=await loadRuntimeBootstrapContext({storage:it,projectId:rt,fetchImpl:et});return{storage:it,projectId:rt,...ot}}function normalizeBaseUrl(nt){return nt.replace(/\/$/,"")}async function main(){const nt=document.getElementById("app"),_e=document.getElementById("status");if(!nt)throw new Error("viewport container not found");const tt=(at,st="busy")=>{_e&&(_e.textContent=at,_e.setAttribute("data-state",st))},et=createStartupStatusReporter({setStatus:tt}),rt="",it=new ViewportRuntime;let ot=null;try{const{storage:at,projectId:st,projectInfo:ct,plan:ut}=await loadRuntimeProjectContext(rt,{onStage:et.reportStage});et.reportStage("boot-runtime"),await bootstrapEditorRuntime({onStage:et.reportStage,plan:ut}),await it.init(nt,at,st,{onStage:et.reportStage,projectInfo:ct}),window.__runtime=it,Object.defineProperty(window,"__engine",{configurable:!0,enumerable:!0,get:()=>it.engine}),et.finish(),ot=attachSceneHotReload({runtime:it,onStatus:tt,readyStatus:et.getReadyStatus()});const dt=()=>{ot==null||ot(),it.dispose()};window.addEventListener("beforeunload",dt)}catch(at){console.error(at),tt(at instanceof Error?at.message:String(at))}}main();export{SpriteRenderer as $,AntiAliasing as A,Color$1 as B,ComponentType as C,DepthTextureMode as D,EditorComponent as E,RefractionMode as F,SunMode as G,RenderFace as H,CullMode as I,BlendMode as J,Vector3 as K,LayerSetting as L,MSAASamples as M,Vector2 as N,MeshRenderer as O,PhysicsMaterialCombineMode as P,PBRMaterial as Q,RenderQueueType as R,Script as S,TextureCoordinate as T,BoundingBox as U,Vector4 as V,resourceLoader as W,Loader as X,Renderer$1 as Y,ignoreClone as Z,Entity as _,Layer as a,meta as a$,TextureWrapMode$1 as a0,TextRenderer as a1,Font as a2,Logger as a3,Engine as a4,AssetPromise as a5,Utils$3 as a6,AssetType as a7,EngineObject as a8,Sprite as a9,Rect$1 as aA,Quaternion as aB,jsxRuntimeExports$1 as aC,FormItem as aD,extractFormItemProps as aE,StyledText as aF,createReactComponent as aG,createReactComponent$1 as aH,angleSerializer as aI,SpriteMaskLayer as aJ,SpriteMaskInteraction as aK,action as aL,hdrColorSerializer as aM,SpriteDrawMode as aN,styled as aO,Flex as aP,observer as aQ,useTranslation as aR,jsxRuntimeExports as aS,ActionButton as aT,reactExports$1 as aU,Collapsible as aV,InspectorForm as aW,Button$2 as aX,AnimatorController as aY,AnimatorControllerLayer as aZ,AnimatorLayerBlendingMode as a_,SubPrimitive as aa,BlendFactor as ab,BlendOperation as ac,VertexElement as ad,VertexElementFormat as ae,Buffer$3 as af,BufferBindFlag as ag,BufferUsage as ah,IndexBufferBinding as ai,IndexFormat as aj,assignmentClone as ak,deepClone as al,ReferResource as am,TextureFilterMode as an,Shader as ao,Material as ap,Primitive as aq,VertexBufferBinding as ar,XRManager as as,decoder as at,Ray as au,Plane as av,decode as aw,CameraType$1 as ax,Matrix as ay,Signal as az,CameraClearFlags as b,SelectItem as b$,override as b0,AnimatorStateTransition as b1,reportSavingWhileDestroy as b2,reactExports as b3,IconPlus$1 as b4,createCollection$1 as b5,createContextScope$5 as b6,createCollapsibleScope as b7,React$1 as b8,useControllableState as b9,openScriptReport as bA,ShaderLanguage as bB,ShaderProperty as bC,computed as bD,MathUtil as bE,BufferMesh as bF,VertexAttribute as bG,ContentRestorer as bH,Texture2D as bI,TextureFormat as bJ,RenderTarget as bK,React$3 as bL,Separator as bM,FormItemAssetPicker$1 as bN,FormItemButton as bO,toJS as bP,addPropertyProxyConfig as bQ,api as bR,ModelMesh as bS,BlendShape$1 as bT,MeshTopology as bU,BlinnPhongMaterial as bV,collectDependenciesFromMeta as bW,ShaderFactory as bX,ensureUploadMainFile as bY,AssetPreviewer as bZ,Select as b_,useComposedRefs$6 as ba,useDirection as bb,composeEventHandlers$6 as bc,Primitive$9 as bd,useId as be,Root$c as bf,Trigger$5 as bg,Content$5 as bh,keyframes$2 as bi,IconChevronRight as bj,Spin as bk,FormItemSelect as bl,FormItemVector3 as bm,EntityPicker$1 as bn,Transform$1 as bo,AnimatorCullingMode as bp,BaseScript as bq,Animator as br,viewport as bs,ViewportPlugin as bt,Group$2 as bu,PBR as bv,registerIncludes as bw,resolve$2 as bx,n$1 as by,openCodeEditor as bz,Downsampling as c,TangentMode as c$,v4 as c0,extname as c1,basename as c2,assetService as c3,ParticleCurve as c4,CurveKey as c5,denormalizeColor as c6,ColorPicker as c7,normalizeColor as c8,ParticleGradient as c9,UICanvas as cA,UIGroup as cB,Button$1 as cC,Image$1 as cD,Text as cE,DynamicCollider as cF,StaticCollider as cG,CharacterController as cH,SpringJoint as cI,FixedJoint as cJ,HingeJoint as cK,AudioSource as cL,PostProcess as cM,AnimationFloatCurve as cN,AnimationFloatArrayCurve as cO,AnimationVector2Curve as cP,AnimationVector3Curve as cQ,AnimationVector4Curve as cR,AnimationQuaternionCurve as cS,AnimationColorCurve as cT,AnimationRefCurve as cU,AnimationRectCurve as cV,AnimationBoolCurve as cW,AnimationStringCurve as cX,AnimationArrayCurve as cY,PropertyType as cZ,getPropertyProxyConfigs as c_,GradientColorKey as ca,GradientAlphaKey as cb,TrailTextureMode as cc,TextVerticalAlignment as cd,TextHorizontalAlignment as ce,FontStyle as cf,InterpolationType as cg,OverflowMode as ch,PrimitiveMesh as ci,ParticleRenderer as cj,reaction as ck,ShaderPropertyType as cl,CompareFunction as cm,extendObservable as cn,cloneDeep$1 as co,isObservableProp as cp,virtualPropertyManually as cq,FormItemInput as cr,FormItemInputNumber as cs,DirectLight as ct,Camera as cu,SkinnedMeshRenderer as cv,PointLight as cw,SpotLight as cx,SpriteMask as cy,UITransform as cz,decomposeLayersByBitwise as d,isValidFileHeader as d$,TangentType as d0,openAnimatorStateReport as d1,AnimationClip as d2,getPropertyUniquePath as d3,getPropertyConfigs as d4,isSubProperty as d5,storedPropertyProxySymbol as d6,Keyframe$1 as d7,Root as d8,showEditorUiToastError as d9,FormItemVector2 as dA,PostProcessEffectTextureParameter as dB,PostProcessEffectColorParameter as dC,FormItemColor as dD,PostProcessEffectEnumParameter as dE,PostProcessEffectBoolParameter as dF,FormItemToggle as dG,PostProcessEffectFloatParameter as dH,TonemappingEffect as dI,BloomEffect as dJ,FormItemRect as dK,showAlert as dL,SpriteAtlas as dM,computeAssetTemplateDiffs as dN,TraceLogger as dO,FormItemGroup as dP,ParticleStopMode as dQ,isTraceEnabled as dR,beginTrace as dS,endTrace as dT,EntityManager as dU,getNormalizedComponent as dV,PrefabResource as dW,TextureCubeFace as dX,BakerResolution as dY,DecodeMode as dZ,IBLBaker as d_,assetIconMap as da,getBoundingBox as db,createStore as dc,get as dd,set as de,md5 as df,logger$2 as dg,useLayoutEffect2$1 as dh,ReactDOM as di,composeRefs$8 as dj,createPopperScope$1 as dk,Anchor$2 as dl,Presence$2 as dm,DismissableLayer as dn,Content$3 as dp,Arrow$2 as dq,Root2$6 as dr,IconPlus as ds,Checkbox as dt,IconTrash as du,PostProcessEffectParameter as dv,PostProcessEffectVector4Parameter as dw,FormItemVector4 as dx,PostProcessEffectVector3Parameter as dy,PostProcessEffectVector2Parameter as dz,t$8 as e,BoxShape as e$,toBuffer as e0,toBufferKTX2 as e1,SphericalHarmonics3 as e2,AmbientLight as e3,DiffuseMode as e4,FileHeader as e5,Input as e6,reactDomExports as e7,IconPlayerPauseFilled as e8,IconPlayerPlayFilled as e9,ActionButtonGroup as eA,Popover as eB,ScaleTransition as eC,ColorTransition as eD,SpriteTransition as eE,HorizontalAlignmentMode as eF,VerticalAlignmentMode as eG,css$1 as eH,InputNumber as eI,EntityModifyFlags as eJ,debounce$2 as eK,CanvasRenderMode as eL,ResolutionAdaptationMode as eM,CameraModifyFlags as eN,getDefaultExportFromCjs as eO,autorun as eP,Component as eQ,StyledTitle$1 as eR,Scene as eS,storedMainSymbol as eT,ParticleShapeArcMode as eU,ConeEmitType as eV,MeshShape as eW,SphereShape as eX,HemisphereShape as eY,ConeShape as eZ,CircleShape as e_,FormItemSlider as ea,LineDrawer as eb,__vitePreload as ec,Galacean as ed,browserExports as ee,GLTFResource as ef,MessageCenter as eg,TextureCube as eh,replaceExtname as ei,getTextureInformation as ej,ColliderShapeUpAxis$1 as ek,SphereColliderShape as el,PlaneColliderShape as em,CapsuleColliderShape as en,BoxColliderShape as eo,createPendingMethodRetryableError as ep,FormItemToggleGroup as eq,DynamicColliderConstraints as er,CollisionDetectionMode as es,ControllerNonWalkableMode as et,FormItemEntityPicker as eu,EditorDependentMode as ev,JointLimits as ew,JointMotor as ex,clamp$2 as ey,mergeRefs as ez,propertyProxy as f,globalCss as f$,ParticleCurveMode as f0,FormItemTable as f1,ParticleCompositeCurve as f2,Burst as f3,ParticleGradientMode as f4,ParticleRenderMode as f5,ParticleSimulationSpace as f6,ParticleScaleMode as f7,Ie$1 as f8,useDrop as f9,generatePreviewColor as fA,srgbColorToLinear as fB,linearColorToSRGB as fC,GradientSlider as fD,ParticleSlider as fE,HDRSlider as fF,EyeDropperIcon as fG,IconRightBottomCorner as fH,IconPendingFile$1 as fI,PopoverCloseTrigger as fJ,SegmentControl as fK,SegmentControlItem as fL,Slider as fM,StyledTextarea as fN,ToggleGroup$1 as fO,ToggleGroupItem as fP,StyledBold as fQ,StyledLink as fR,TreeItemRoot as fS,TreeItemContent as fT,TreeItemIcon as fU,TreeItemPreview as fV,TreeGroup$1 as fW,AlertDialog as fX,AssetItem as fY,HoverCard as fZ,resetStyle as f_,Overlay$2 as fa,overlayFadeIn as fb,Content$1 as fc,contentShow as fd,contentFadeIn as fe,contentFadeOut as ff,DialogClose as fg,Trigger$2 as fh,Title as fi,Description$1 as fj,IconX as fk,Root$3 as fl,Portal$3 as fm,lightTheme as fn,darkTheme as fo,Badge as fp,Breadcrumbs as fq,BreadcrumbItem as fr,CascadeSlider as fs,useColorSpaceConversion as ft,createDisplayColorSpaceToggle as fu,toNormalizeHexStr as fv,isEqual$1 as fw,blendParticleStops as fx,generateLinearGradient as fy,generateHDR as fz,getMultipleLayerOptions as g,theme as g0,getCssText as g1,createTheme as g2,recipes as g3,keyframes$1 as g4,DragContext as g5,DragDropContextProvider as g6,useDrag as g7,Slot$1 as g8,reactDomExports$1 as g9,createRovingFocusGroupScope as gA,Root$6 as gB,Item$1 as gC,dispatchDiscreteCustomEvent$1 as gD,clamp$3 as gE,radioGroupStyle as gF,labelStyle as gG,basicItemStyle as gH,contentStyle as gI,contextMenuContentStyle as gJ,subMenuItemStyle as gK,separatorStyle as gL,checkboxItemStyle as gM,radioItemStyle as gN,indicatorStyle as gO,dropdownMenuContentStyle as gP,IconCheck as gQ,getAugmentedNamespace as gR,useSize as ga,useFloating as gb,autoUpdate as gc,offset$2 as gd,shift as ge,limitShift as gf,flip as gg,size as gh,arrow as gi,hide as gj,useCallbackRef$2 as gk,hideOthers as gl,useFocusGuards as gm,FocusScope as gn,RemoveScroll as go,Portal$6 as gp,createSidecarMedium as gq,__rest$r as gr,useMergeRefs as gs,__assign as gt,fullWidthClassName as gu,zeroRightClassName as gv,styleSingleton as gw,__spreadArray as gx,RemoveScrollBar as gy,exportSidecar as gz,layerProxy as h,ShadowType as i,EditorAsset as j,PhysicsMaterial as k,layerSerializer as l,main$1 as m,asset as n,AssetsImportType as o,propertyField as p,DragLayer as q,runInAction as r,serialize as s,transformEnumToOptions as t,makeObservable as u,virtualProperty as v,openMarkdownEditor as w,observable as x,EventBus as y,ValueTypeEnum as z};
11487
+ `))}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("enableEdgeDock",!0).setType(Attribute.BOOLEAN).setDescription("enable docking to the edges of the layout, this will show the edge indicators"),_e.add("rootOrientationVertical",!1).setType(Attribute.BOOLEAN).setDescription("the top level 'row' will layout horizontally by default, set this option true to make it layout vertically"),_e.add("enableRotateBorderIcons",!0).setType(Attribute.BOOLEAN).setDescription("boolean indicating if tab icons should rotate with the text in the left and right borders"),_e.add("splitterSize",8).setType(Attribute.NUMBER).setDescription("width in pixels of all splitters between tabsets/borders"),_e.add("splitterExtra",0).setType(Attribute.NUMBER).setDescription("additional width in pixels of the splitter hit test area"),_e.add("splitterEnableHandle",!1).setType(Attribute.BOOLEAN).setDescription("enable a small centralized handle on all splitters"),_e.add("tabEnableClose",!0).setType(Attribute.BOOLEAN),_e.add("tabCloseType",1).setType("ICloseType"),_e.add("tabEnablePopout",!1).setType(Attribute.BOOLEAN).setAlias("tabEnableFloat"),_e.add("tabEnablePopoutIcon",!0).setType(Attribute.BOOLEAN),_e.add("tabEnablePopoutOverlay",!1).setType(Attribute.BOOLEAN),_e.add("tabEnableDrag",!0).setType(Attribute.BOOLEAN),_e.add("tabEnableRename",!0).setType(Attribute.BOOLEAN),_e.add("tabContentClassName",void 0).setType(Attribute.STRING),_e.add("tabClassName",void 0).setType(Attribute.STRING),_e.add("tabIcon",void 0).setType(Attribute.STRING),_e.add("tabEnableRenderOnDemand",!0).setType(Attribute.BOOLEAN),_e.add("tabDragSpeed",.3).setType(Attribute.NUMBER),_e.add("tabBorderWidth",-1).setType(Attribute.NUMBER),_e.add("tabBorderHeight",-1).setType(Attribute.NUMBER),_e.add("tabSetEnableDeleteWhenEmpty",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableDrop",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableDrag",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableDivide",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableMaximize",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableClose",!1).setType(Attribute.BOOLEAN),_e.add("tabSetEnableSingleTabStretch",!1).setType(Attribute.BOOLEAN),_e.add("tabSetAutoSelectTab",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableActiveIcon",!1).setType(Attribute.BOOLEAN),_e.add("tabSetClassNameTabStrip",void 0).setType(Attribute.STRING),_e.add("tabSetEnableTabStrip",!0).setType(Attribute.BOOLEAN),_e.add("tabSetEnableTabWrap",!1).setType(Attribute.BOOLEAN),_e.add("tabSetTabLocation","top").setType("ITabLocation"),_e.add("tabMinWidth",DefaultMin).setType(Attribute.NUMBER),_e.add("tabMinHeight",DefaultMin).setType(Attribute.NUMBER),_e.add("tabSetMinWidth",DefaultMin).setType(Attribute.NUMBER),_e.add("tabSetMinHeight",DefaultMin).setType(Attribute.NUMBER),_e.add("tabMaxWidth",DefaultMax).setType(Attribute.NUMBER),_e.add("tabMaxHeight",DefaultMax).setType(Attribute.NUMBER),_e.add("tabSetMaxWidth",DefaultMax).setType(Attribute.NUMBER),_e.add("tabSetMaxHeight",DefaultMax).setType(Attribute.NUMBER),_e.add("tabSetEnableTabScrollbar",!1).setType(Attribute.BOOLEAN),_e.add("borderSize",200).setType(Attribute.NUMBER),_e.add("borderMinSize",DefaultMin).setType(Attribute.NUMBER),_e.add("borderMaxSize",DefaultMax).setType(Attribute.NUMBER),_e.add("borderEnableDrop",!0).setType(Attribute.BOOLEAN),_e.add("borderAutoSelectTabWhenOpen",!0).setType(Attribute.BOOLEAN),_e.add("borderAutoSelectTabWhenClosed",!1).setType(Attribute.BOOLEAN),_e.add("borderClassName",void 0).setType(Attribute.STRING),_e.add("borderEnableAutoHide",!1).setType(Attribute.BOOLEAN),_e.add("borderEnableTabScrollbar",!1).setType(Attribute.BOOLEAN),_e}};__publicField(_Model,"MAIN_WINDOW_ID","__main_window_id__");__publicField(_Model,"attributeDefinitions",_Model.createAttributeDefinitions());let Model=_Model;const _BorderNode=class Dr extends Node$1{constructor(_e,tt,et){super(et),__publicField(this,"contentRect",Rect.empty()),__publicField(this,"tabHeaderRect",Rect.empty()),__publicField(this,"location"),this.location=_e,this.attributes.id=`border_${_e.getName()}`,Dr.attributeDefinitions.fromJson(tt,this.attributes),et.addNode(this)}static fromJson(_e,tt){const et=DockLocation.getByName(_e.location),rt=new Dr(et,_e,tt);return _e.children&&(rt.children=_e.children.map(it=>{const ot=TabNode.fromJson(it,tt);return ot.setParent(rt),ot})),rt}getLocation(){return this.location}getClassName(){return this.getAttr("className")}isHorizontal(){return this.location.orientation===Orientation.HORZ}getSize(){const _e=this.getAttr("size"),tt=this.getSelected();if(tt===-1)return _e;{const et=this.children[tt],rt=this.isHorizontal()?et.getAttr("borderWidth"):et.getAttr("borderHeight");return rt===-1?_e:rt}}getMinSize(){const _e=this.getSelectedNode();let tt=this.getAttr("minSize");if(_e){const et=this.isHorizontal()?_e.getMinWidth():_e.getMinHeight();tt=Math.max(tt,et)}return tt}getMaxSize(){const _e=this.getSelectedNode();let tt=this.getAttr("maxSize");if(_e){const et=this.isHorizontal()?_e.getMaxWidth():_e.getMaxHeight();tt=Math.min(tt,et)}return tt}getSelected(){return this.attributes.selected}isAutoHide(){return this.getAttr("enableAutoHide")}getSelectedNode(){if(this.getSelected()!==-1)return this.children[this.getSelected()]}getOrientation(){return this.location.getOrientation()}getConfig(){return this.attributes.config}isMaximized(){return!1}isShowing(){return this.attributes.show}toJson(){const _e={};return Dr.attributeDefinitions.toJson(_e,this.attributes),_e.location=this.location.getName(),_e.children=this.children.map(tt=>tt.toJson()),_e}isAutoSelectTab(_e){return _e==null&&(_e=this.getSelected()!==-1),_e?this.getAttr("autoSelectTabWhenOpen"):this.getAttr("autoSelectTabWhenClosed")}isEnableTabScrollbar(){return this.getAttr("enableTabScrollbar")}setSelected(_e){this.attributes.selected=_e}getTabHeaderRect(){return this.tabHeaderRect}setTabHeaderRect(_e){this.tabHeaderRect=_e}getRect(){return this.tabHeaderRect}getContentRect(){return this.contentRect}setContentRect(_e){this.contentRect=_e}isEnableDrop(){return this.getAttr("enableDrop")}setSize(_e){const tt=this.getSelected();if(tt===-1)this.attributes.size=_e;else{const et=this.children[tt];(this.isHorizontal()?et.getAttr("borderWidth"):et.getAttr("borderHeight"))===-1?this.attributes.size=_e:this.isHorizontal()?et.setBorderWidth(_e):et.setBorderHeight(_e)}}updateAttrs(_e){Dr.attributeDefinitions.update(_e,this.attributes)}remove(_e){const tt=this.removeChild(_e);this.getSelected()!==-1&&adjustSelectedIndex(this,tt)}canDrop(_e,tt,et){if(!(_e instanceof TabNode))return;let rt;const it=DockLocation.CENTER;if(this.tabHeaderRect.contains(tt,et)){if(this.location.orientation===Orientation.VERT)if(this.children.length>0){let ot=this.children[0],at=ot.getTabRect();const st=at.y,ct=at.height;let ut=this.tabHeaderRect.x,dt=0;for(let ht=0;ht<this.children.length;ht++){if(ot=this.children[ht],at=ot.getTabRect(),dt=at.x+at.width/2,tt>=ut&&tt<dt){const ft=new Rect(at.x-2,st,3,ct);rt=new DropInfo(this,ft,it,ht,CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}ut=dt}if(rt==null){const ht=new Rect(at.getRight()-2,st,3,ct);rt=new DropInfo(this,ht,it,this.children.length,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const ot=new Rect(this.tabHeaderRect.x+1,this.tabHeaderRect.y+2,3,18);rt=new DropInfo(this,ot,it,0,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this.children.length>0){let ot=this.children[0],at=ot.getTabRect();const st=at.x,ct=at.width;let ut=this.tabHeaderRect.y,dt=0;for(let ht=0;ht<this.children.length;ht++){if(ot=this.children[ht],at=ot.getTabRect(),dt=at.y+at.height/2,et>=ut&&et<dt){const ft=new Rect(st,at.y-2,ct,3);rt=new DropInfo(this,ft,it,ht,CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}ut=dt}if(rt==null){const ht=new Rect(st,at.getBottom()-2,ct,3);rt=new DropInfo(this,ht,it,this.children.length,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const ot=new Rect(this.tabHeaderRect.x+2,this.tabHeaderRect.y+1,18,3);rt=new DropInfo(this,ot,it,0,CLASSES.FLEXLAYOUT__OUTLINE_RECT)}if(!_e.canDockInto(_e,rt))return}else if(this.getSelected()!==-1&&this.contentRect.contains(tt,et)){const ot=this.contentRect;if(rt=new DropInfo(this,ot,it,-1,CLASSES.FLEXLAYOUT__OUTLINE_RECT),!_e.canDockInto(_e,rt))return}return rt}drop(_e,tt,et,rt){let it=0;const ot=_e.getParent();ot!==void 0&&(it=ot.removeChild(_e),ot!==this&&ot instanceof Dr&&ot.getSelected()===it?ot.setSelected(-1):adjustSelectedIndex(ot,it)),_e instanceof TabNode&&ot===this&&it<et&&et>0&&et--;let at=et;at===-1&&(at=this.children.length),_e instanceof TabNode&&this.addChild(_e,at),(rt||rt!==!1&&this.isAutoSelectTab())&&this.setSelected(at),this.model.tidy()}getSplitterBounds(_e,tt=!1){const et=[0,0],rt=tt?this.getMinSize():0,it=tt?this.getMaxSize():99999,ot=this.model.getRoot(Model.MAIN_WINDOW_ID),at=ot.getRect(),st=this.model.getSplitterSize();if(this.location===DockLocation.TOP){et[0]=this.tabHeaderRect.getBottom()+rt;const ct=this.tabHeaderRect.getBottom()+it;et[1]=Math.max(et[0],at.getBottom()-ot.getMinHeight()-st),et[1]=Math.min(et[1],ct)}else if(this.location===DockLocation.LEFT){et[0]=this.tabHeaderRect.getRight()+rt;const ct=this.tabHeaderRect.getRight()+it;et[1]=Math.max(et[0],at.getRight()-ot.getMinWidth()-st),et[1]=Math.min(et[1],ct)}else if(this.location===DockLocation.BOTTOM){et[1]=this.tabHeaderRect.y-rt-st;const ct=this.tabHeaderRect.y-it-st;et[0]=Math.min(et[1],at.y+ot.getMinHeight()),et[0]=Math.max(et[0],ct)}else if(this.location===DockLocation.RIGHT){et[1]=this.tabHeaderRect.x-rt-st;const ct=this.tabHeaderRect.x-it-st;et[0]=Math.min(et[1],at.x+ot.getMinWidth()),et[0]=Math.max(et[0],ct)}return et}calculateSplit(_e,tt){const et=this.getSplitterBounds(tt);return this.location===DockLocation.BOTTOM||this.location===DockLocation.RIGHT?Math.max(0,et[1]-tt):Math.max(0,tt-et[0])}getAttributeDefinitions(){return Dr.attributeDefinitions}static getAttributeDefinitions(){return Dr.attributeDefinitions}static createAttributeDefinitions(){const _e=new AttributeDefinitions;return _e.add("type",Dr.TYPE,!0).setType(Attribute.STRING).setFixed(),_e.add("selected",-1).setType(Attribute.NUMBER).setDescription("index of selected/visible tab in border; -1 means no tab selected"),_e.add("show",!0).setType(Attribute.BOOLEAN).setDescription("show/hide this border"),_e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),_e.addInherited("enableDrop","borderEnableDrop").setType(Attribute.BOOLEAN).setDescription("whether tabs can be dropped into this border"),_e.addInherited("className","borderClassName").setType(Attribute.STRING).setDescription("class applied to tab button"),_e.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(Attribute.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is already open"),_e.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(Attribute.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is currently closed"),_e.addInherited("size","borderSize").setType(Attribute.NUMBER).setDescription("size of the tab area when selected"),_e.addInherited("minSize","borderMinSize").setType(Attribute.NUMBER).setDescription("the minimum size of the tab area"),_e.addInherited("maxSize","borderMaxSize").setType(Attribute.NUMBER).setDescription("the maximum size of the tab area"),_e.addInherited("enableAutoHide","borderEnableAutoHide").setType(Attribute.BOOLEAN).setDescription("hide border if it has zero tabs"),_e.addInherited("enableTabScrollbar","borderEnableTabScrollbar").setType(Attribute.BOOLEAN).setDescription("whether to show a mini scrollbar for the tabs"),_e}};__publicField(_BorderNode,"TYPE","border");__publicField(_BorderNode,"attributeDefinitions",_BorderNode.createAttributeDefinitions());let BorderNode=_BorderNode,splitterDragging=!1;const Splitter=nt=>{const{layout:_e,node:tt,index:et,horizontal:rt}=nt,[it,ot]=reactExports$1.useState(!1),at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=reactExports$1.useRef([]),ut=reactExports$1.useRef(void 0),dt=reactExports$1.useRef(void 0),ht=reactExports$1.useRef(0),ft=reactExports$1.useRef(0),pt=reactExports$1.useRef({initialSizes:[],sum:0,startPosition:0}),mt=tt.getModel().getSplitterSize();let vt=tt.getModel().getSplitterExtra();isDesktop()||(vt=Math.max(20,vt+mt)-mt),reactExports$1.useEffect(()=>{var $t,Dt;return($t=at.current)==null||$t.addEventListener("touchstart",_t,{passive:!1}),(Dt=st.current)==null||Dt.addEventListener("touchstart",_t,{passive:!1}),()=>{var Lt,Mt;(Lt=at.current)==null||Lt.removeEventListener("touchstart",_t),(Mt=st.current)==null||Mt.removeEventListener("touchstart",_t)}},[]);const _t=$t=>{$t.preventDefault(),$t.stopImmediatePropagation()},yt=$t=>{var Dt;$t.stopPropagation(),tt instanceof RowNode&&(pt.current=tt.getSplitterInitials(et)),enablePointerOnIFrames(!1,_e.getCurrentDocument()),startDrag($t.currentTarget.ownerDocument,$t,St,xt,bt),ct.current=tt.getSplitterBounds(et,!0);const Lt=_e.getRootDiv();ut.current=_e.getCurrentDocument().createElement("div"),ut.current.style.flexDirection=rt?"row":"column",ut.current.className=_e.getClassName(CLASSES.FLEXLAYOUT__SPLITTER_DRAG),ut.current.style.cursor=tt.getOrientation()===Orientation.VERT?"ns-resize":"ew-resize",tt.getModel().isSplitterEnableHandle()&&(dt.current=_e.getCurrentDocument().createElement("div"),dt.current.className=At(CLASSES.FLEXLAYOUT__SPLITTER_HANDLE)+" "+At(rt?CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_VERT),ut.current.appendChild(dt.current));const Mt=(Dt=at.current)==null?void 0:Dt.getBoundingClientRect(),It=new Rect(Mt.x-_e.getDomRect().x,Mt.y-_e.getDomRect().y,Mt.width,Mt.height);ht.current=$t.clientX-Mt.x,ft.current=$t.clientY-Mt.y,It.positionElement(ut.current),Lt&&Lt.appendChild(ut.current),ot(!0),splitterDragging=!0},bt=()=>{const $t=_e.getRootDiv();$t&&ut.current&&$t.removeChild(ut.current),ut.current=void 0,ot(!1),splitterDragging=!1},St=($t,Dt)=>{if(ut.current){const Lt=_e.getDomRect();if(!Lt)return;tt.getOrientation()===Orientation.VERT?ut.current.style.top=Et(Dt-Lt.y-ft.current)+"px":ut.current.style.left=Et($t-Lt.x-ht.current)+"px",_e.isRealtimeResize()&&Ct()}},xt=()=>{if(ut.current){Ct();const $t=_e.getRootDiv();$t&&ut.current&&$t.removeChild(ut.current),ut.current=void 0}enablePointerOnIFrames(!0,_e.getCurrentDocument()),ot(!1),splitterDragging=!1},Ct=$t=>{(()=>{if(ut.current){let Lt=0;if(tt.getOrientation()===Orientation.VERT?Lt=ut.current.offsetTop:Lt=ut.current.offsetLeft,tt instanceof BorderNode){const Mt=tt.calculateSplit(tt,Lt);_e.doAction(Actions.adjustBorderSplit(tt.getId(),Mt))}else{const Mt=pt.current,It=tt.calculateSplit(et,Lt,Mt.initialSizes,Mt.sum,Mt.startPosition);_e.doAction(Actions.adjustWeights(tt.getId(),It))}}})()},Et=$t=>{const Dt=ct.current;let Lt=$t;return $t<Dt[0]&&(Lt=Dt[0]),$t>Dt[1]&&(Lt=Dt[1]),Lt},At=_e.getClassName,Pt={cursor:rt?"ew-resize":"ns-resize",flexDirection:rt?"column":"row"};let Tt=At(CLASSES.FLEXLAYOUT__SPLITTER)+" "+At(CLASSES.FLEXLAYOUT__SPLITTER_+tt.getOrientation().getName());tt instanceof BorderNode?Tt+=" "+At(CLASSES.FLEXLAYOUT__SPLITTER_BORDER):tt.getModel().getMaximizedTabset(_e.getWindowId())!==void 0&&(Pt.display="none"),rt?(Pt.width=mt+"px",Pt.minWidth=mt+"px"):(Pt.height=mt+"px",Pt.minHeight=mt+"px");let Rt;if(!it&&tt.getModel().isSplitterEnableHandle()&&(Rt=jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__SPLITTER_HANDLE)+" "+At(rt?CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:CLASSES.FLEXLAYOUT__SPLITTER_HANDLE_VERT)})),vt===0)return jsxRuntimeExports.jsx("div",{className:Tt,style:Pt,ref:at,"data-layout-path":tt.getPath()+"/s"+(et-1),onPointerDown:yt,children:Rt});{const $t={};tt.getOrientation()===Orientation.HORZ?($t.height="100%",$t.width=mt+vt+"px",$t.cursor="ew-resize"):($t.height=mt+vt+"px",$t.width="100%",$t.cursor="ns-resize");const Dt=At(CLASSES.FLEXLAYOUT__SPLITTER_EXTRA);return jsxRuntimeExports.jsx("div",{className:Tt,style:Pt,ref:at,"data-layout-path":tt.getPath()+"/s"+(et-1),onPointerDown:yt,children:jsxRuntimeExports.jsx("div",{style:$t,ref:st,className:Dt,onPointerDown:yt})})}};function BorderTab(nt){const{layout:_e,border:tt,show:et}=nt,rt=reactExports$1.useRef(null),it=reactExports$1.useRef(void 0);reactExports$1.useLayoutEffect(()=>{const ct=_e.getBoundingClientRect(rt.current);!isNaN(ct.x)&&ct.width>0&&(tt.getContentRect().equals(ct)||(tt.setContentRect(ct),splitterDragging?(it.current&&clearTimeout(it.current),it.current=setTimeout(()=>{_e.redrawInternal("border content rect "+ct),it.current=void 0},50)):_e.redrawInternal("border content rect "+ct)))});let ot=!0;const at={};tt.getOrientation()===Orientation.HORZ?(at.width=tt.getSize(),at.minWidth=tt.getMinSize(),at.maxWidth=tt.getMaxSize()):(at.height=tt.getSize(),at.minHeight=tt.getMinSize(),at.maxHeight=tt.getMaxSize(),ot=!1),at.display=et?"flex":"none";const st=_e.getClassName(CLASSES.FLEXLAYOUT__BORDER_TAB_CONTENTS);return tt.getLocation()===DockLocation.LEFT||tt.getLocation()===DockLocation.TOP?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{ref:rt,style:at,className:st}),et&&jsxRuntimeExports.jsx(Splitter,{layout:_e,node:tt,index:0,horizontal:ot})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[et&&jsxRuntimeExports.jsx(Splitter,{layout:_e,node:tt,index:0,horizontal:ot}),jsxRuntimeExports.jsx("div",{ref:rt,style:at,className:st})]})}var ICloseType=(nt=>(nt[nt.Visible=1]="Visible",nt[nt.Always=2]="Always",nt[nt.Selected=3]="Selected",nt))(ICloseType||{});const BorderButton=nt=>{const{layout:_e,node:tt,selected:et,border:rt,icons:it,path:ot}=nt,at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=Pt=>{tt.isEnableDrag()?(Pt.stopPropagation(),_e.setDragNode(Pt.nativeEvent,tt)):Pt.preventDefault()},ut=Pt=>{Pt.stopPropagation(),_e.clearDragMain()},dt=Pt=>{isAuxMouseEvent(Pt)&&_e.auxMouseClick(tt,Pt)},ht=Pt=>{_e.showContextMenu(tt,Pt)},ft=()=>{_e.doAction(Actions.selectTab(tt.getId()))},pt=()=>{const Pt=tt.getCloseType();return!!(et||Pt===ICloseType.Always||Pt===ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},mt=Pt=>{pt()&&(_e.doAction(Actions.deleteTab(tt.getId())),Pt.stopPropagation())},vt=Pt=>{Pt.stopPropagation()};reactExports$1.useLayoutEffect(()=>{tt.setTabRect(_e.getBoundingClientRect(at.current)),_e.getEditingTab()===tt&&st.current.select()});const _t=Pt=>{Pt.stopPropagation()},yt=Pt=>{Pt.code==="Escape"?_e.setEditingTab(void 0):(Pt.code==="Enter"||Pt.code==="NumpadEnter")&&(_e.setEditingTab(void 0),_e.doAction(Actions.renameTab(tt.getId(),Pt.target.value)))},bt=_e.getClassName;let St=bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON)+" "+bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_+rt);et?St+=" "+bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON__SELECTED):St+=" "+bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),tt.getClassName()!==void 0&&(St+=" "+tt.getClassName());let xt=0;tt.getModel().isEnableRotateBorderIcons()===!1&&(rt==="left"?xt=90:rt==="right"&&(xt=-90));const Ct=getRenderStateEx(_e,tt,xt);let Et=Ct.content?jsxRuntimeExports.jsx("div",{className:bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT),children:Ct.content}):null;const At=Ct.leading?jsxRuntimeExports.jsx("div",{className:bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING),children:Ct.leading}):null;if(_e.getEditingTab()===tt&&(Et=jsxRuntimeExports.jsx("input",{ref:st,className:bt(CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":ot+"/textbox",type:"text",autoFocus:!0,defaultValue:tt.getName(),onKeyDown:yt,onPointerDown:_t})),tt.isEnableClose()){const Pt=_e.i18nName(I18nLabel.Close_Tab);Ct.buttons.push(jsxRuntimeExports.jsx("div",{"data-layout-path":ot+"/button/close",title:Pt,className:bt(CLASSES.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onPointerDown:vt,onClick:mt,children:typeof it.close=="function"?it.close(tt):it.close},"close"))}return jsxRuntimeExports.jsxs("div",{ref:at,"data-layout-path":ot,className:St,onClick:ft,onAuxClick:dt,onContextMenu:ht,title:tt.getHelpText(),draggable:!0,onDragStart:ct,onDragEnd:ut,children:[At,Et,Ct.buttons]})},TabButtonStamp=nt=>{const{layout:_e,node:tt}=nt,et=_e.getClassName,rt=et(CLASSES.FLEXLAYOUT__TAB_BUTTON_STAMP),it=getRenderStateEx(_e,tt),ot=it.content?jsxRuntimeExports.jsx("div",{className:et(CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT),children:it.content}):tt.getNameForOverflowMenu(),at=it.leading?jsxRuntimeExports.jsx("div",{className:et(CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING),children:it.leading}):null;return jsxRuntimeExports.jsxs("div",{className:rt,title:tt.getHelpText(),children:[at,ot]})};function showPopup(nt,_e,tt,et,rt){const it=rt.getRootDiv(),ot=rt.getClassName,at=nt.ownerDocument,st=nt.getBoundingClientRect(),ct=(it==null?void 0:it.getBoundingClientRect())??new DOMRect(0,0,100,100),ut=at.createElement("div");ut.className=ot(CLASSES.FLEXLAYOUT__POPUP_MENU_CONTAINER),st.left<ct.left+ct.width/2?ut.style.left=st.left-ct.left+"px":ut.style.right=ct.right-st.right+"px",st.top<ct.top+ct.height/2?ut.style.top=st.top-ct.top+"px":ut.style.bottom=ct.bottom-st.bottom+"px",rt.showOverlay(!0),it&&it.appendChild(ut);const dt=()=>{rt.hideControlInPortal(),rt.showOverlay(!1),it&&it.removeChild(ut),ut.removeEventListener("pointerdown",ht),at.removeEventListener("pointerdown",ft)},ht=pt=>{pt.stopPropagation()},ft=pt=>{dt()};ut.addEventListener("pointerdown",ht),at.addEventListener("pointerdown",ft),rt.showControlInPortal(jsxRuntimeExports.jsx(PopupMenu,{currentDocument:at,parentNode:_e,onSelect:et,onHide:dt,items:tt,classNameMapper:ot,layout:rt}),ut)}const PopupMenu=nt=>{const{parentNode:_e,items:tt,onHide:et,onSelect:rt,classNameMapper:it,layout:ot}=nt,at=reactExports$1.useRef(null);reactExports$1.useEffect(()=>{at.current&&at.current.focus()},[]);const st=(ft,pt)=>{rt(ft),et(),pt.stopPropagation()},ct=(ft,pt)=>{ft.stopPropagation(),ot.setDragNode(ft.nativeEvent,pt),setTimeout(()=>{et()},0)},ut=ft=>{ot.clearDragMain()},dt=ft=>{ft.key==="Escape"&&et()},ht=tt.map((ft,pt)=>{let mt=it(CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM);return _e.getSelected()===ft.index&&(mt+=" "+it(CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM__SELECTED)),jsxRuntimeExports.jsx("div",{className:mt,"data-layout-path":"/popup-menu/tb"+pt,onClick:vt=>st(ft,vt),draggable:!0,onDragStart:vt=>ct(vt,ft.node),onDragEnd:ut,title:ft.node.getHelpText(),children:jsxRuntimeExports.jsx(TabButtonStamp,{node:ft.node,layout:ot})},ft.index)});return jsxRuntimeExports.jsx("div",{className:it(CLASSES.FLEXLAYOUT__POPUP_MENU),ref:at,tabIndex:0,onKeyDown:dt,"data-layout-path":"/popup-menu",children:ht})},useTabOverflow=(nt,_e,tt,et,rt,it)=>{const[ot,at]=reactExports$1.useState([]),[st,ct]=reactExports$1.useState(!1),[ut,dt]=reactExports$1.useState(!1),ht=reactExports$1.useRef(null),ft=reactExports$1.useRef(!1),pt=reactExports$1.useRef(void 0),mt=reactExports$1.useRef([]),vt=reactExports$1.useRef(0),_t=reactExports$1.useRef(!1);mt.current=ot,reactExports$1.useLayoutEffect(()=>{et.current&&Nt(0)},[_e.getId()]),reactExports$1.useLayoutEffect(()=>{ft.current=!1},[_e.getSelectedNode(),_e.getRect().width,_e.getRect().height]),reactExports$1.useLayoutEffect(()=>{Rt(),ft.current===!1&&bt(),St(),xt()}),reactExports$1.useEffect(()=>{var jt;return(jt=ht.current)==null||jt.addEventListener("wheel",yt,{passive:!1}),()=>{var Ht;(Ht=ht.current)==null||Ht.removeEventListener("wheel",yt)}},[ht.current]);const yt=jt=>{jt.preventDefault()};function bt(){const jt=_e.getSelectedNode();if(jt&&et.current){const Ht=nt.getBoundingClientRect(et.current),qt=jt.getTabRect();let tn=Lt(Ht)-Lt(qt);tn>0||Bt(qt)>Bt(Ht)?(Nt(Vt(et.current)-tn),_t.current=!0):(tn=Mt(qt)-Mt(Ht),tn>0&&(Nt(Vt(et.current)+tn),_t.current=!0))}}const St=()=>{if(et.current&&rt.current){const jt=et.current,Ht=rt.current,qt=It(jt),tn=Ot(jt),Xt=Vt(jt);if(tn>qt&&tn>0){let sn=qt*qt/tn,Zt=0;sn<20&&(Zt=20-sn,sn=20);const cn=Xt*(qt-Zt)/tn;tt===Orientation.HORZ?(Ht.style.width=sn+"px",Ht.style.left=cn+"px"):(Ht.style.height=sn+"px",Ht.style.top=cn+"px"),Ht.style.display="block"}else Ht.style.display="none";tt===Orientation.HORZ?Ht.style.bottom="0px":Ht.style.right="0px"}},xt=()=>{const Ht=$t().length>0;Ht!==st&&ct(Ht),pt.current===void 0&&(pt.current=setTimeout(()=>{const qt=$t();arraysEqual(qt,mt.current)||at(qt),pt.current=void 0},100))},Ct=()=>{_t.current||(ft.current=!0),_t.current=!1,St(),xt()},Et=jt=>{var Ht;jt.stopPropagation(),rt.current.setPointerCapture(jt.pointerId);const qt=(Ht=rt.current)==null?void 0:Ht.getBoundingClientRect();tt===Orientation.HORZ?vt.current=jt.clientX-qt.x:vt.current=jt.clientY-qt.y,startDrag(jt.currentTarget.ownerDocument,jt,At,Pt,Tt)},At=(jt,Ht)=>{if(et.current&&rt.current){const qt=et.current,tn=rt.current,Xt=It(qt),sn=Ot(qt),Zt=It(tn),cn=qt.getBoundingClientRect();let _n=0;if(tt===Orientation.HORZ?_n=jt-cn.x-vt.current:_n=Ht-cn.y-vt.current,_n=Math.max(0,Math.min(sn-Zt,_n)),Xt>0){const gn=_n*sn/Xt;Nt(gn)}}},Pt=()=>{},Tt=()=>{},Rt=()=>{if(et.current){const Ht=et.current.firstElementChild,qt=ut?10:0,tn=It(Ht)+qt>It(et.current);tn!==ut&&dt(tn)}},$t=()=>{const jt=[];if(et.current){const Ht=et.current,qt=Ht.getBoundingClientRect(),tn=Lt(qt)-1,Xt=Mt(qt)+1,sn=Ht.firstElementChild;let Zt=0;Array.from(sn.children).forEach(cn=>{const _n=cn.getBoundingClientRect();cn.classList.contains(it)&&((Lt(_n)<tn||Mt(_n)>Xt)&&jt.push(Zt),Zt++)})}return jt},Dt=jt=>{if(et.current){if(_e.getChildren().length===0)return;let Ht=0;if(Math.abs(jt.deltaY)>0){Ht=-jt.deltaY,jt.deltaMode===1&&(Ht*=40);const qt=Vt(et.current)-Ht,tn=Ot(et.current)-It(et.current),Xt=Math.max(0,Math.min(tn,qt));Nt(Xt),jt.stopPropagation()}}},Lt=jt=>tt===Orientation.HORZ?jt.x:jt.y,Mt=jt=>tt===Orientation.HORZ?jt.right:jt.bottom,It=jt=>tt===Orientation.HORZ?jt.clientWidth:jt.clientHeight,Bt=jt=>tt===Orientation.HORZ?jt.width:jt.height,Ot=jt=>tt===Orientation.HORZ?jt.scrollWidth:jt.scrollHeight,Nt=jt=>{tt===Orientation.HORZ?et.current.scrollLeft=jt:et.current.scrollTop=jt},Vt=jt=>tt===Orientation.HORZ?jt.scrollLeft:jt.scrollTop;return{selfRef:ht,userControlledPositionRef:ft,onScroll:Ct,onScrollPointerDown:Et,hiddenTabs:ot,onMouseWheel:Dt,isDockStickyButtons:ut,isShowHiddenTabs:st}};function arraysEqual(nt,_e){return nt.length===_e.length&&nt.every((tt,et)=>tt===_e[et])}const BorderTabSet=nt=>{const{border:_e,layout:tt,size:et}=nt,rt=reactExports$1.useRef(null),it=reactExports$1.useRef(null),ot=reactExports$1.useRef(null),at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=tt.getIcons();reactExports$1.useLayoutEffect(()=>{_e.setTabHeaderRect(tt.getBoundingClientRect(ut.current))});const{selfRef:ut,userControlledPositionRef:dt,onScroll:ht,onScrollPointerDown:ft,hiddenTabs:pt,onMouseWheel:mt,isDockStickyButtons:vt,isShowHiddenTabs:_t}=useTabOverflow(tt,_e,Orientation.flip(_e.getOrientation()),st,it,tt.getClassName(CLASSES.FLEXLAYOUT__BORDER_BUTTON)),yt=qt=>{isAuxMouseEvent(qt)&&tt.auxMouseClick(_e,qt)},bt=qt=>{tt.showContextMenu(_e,qt)},St=qt=>{qt.stopPropagation()},xt=qt=>{const tn=tt.getShowOverflowMenu(),Xt=pt.map(sn=>({index:sn,node:_e.getChildren()[sn]}));if(tn!==void 0)tn(_e,qt,Xt,Ct);else{const sn=ot.current;showPopup(sn,_e,Xt,Ct,tt)}qt.stopPropagation()},Ct=qt=>{tt.doAction(Actions.selectTab(qt.node.getId())),dt.current=!1},Et=qt=>{const tn=_e.getChildren()[_e.getSelected()];tn!==void 0&&tt.doAction(Actions.popoutTab(tn.getId())),qt.stopPropagation()},At=tt.getClassName,Pt=[],Tt=qt=>{const tn=_e.getSelected()===qt,Xt=_e.getChildren()[qt];Pt.push(jsxRuntimeExports.jsx(BorderButton,{layout:tt,border:_e.getLocation().getName(),node:Xt,path:_e.getPath()+"/tb"+qt,selected:tn,icons:ct},Xt.getId())),qt<_e.getChildren().length-1&&Pt.push(jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER)},"divider"+qt))};for(let qt=0;qt<_e.getChildren().length;qt++)Tt(qt);let Rt=At(CLASSES.FLEXLAYOUT__BORDER)+" "+At(CLASSES.FLEXLAYOUT__BORDER_+_e.getLocation().getName());_e.getClassName()!==void 0&&(Rt+=" "+_e.getClassName());let $t,Dt=[],Lt=[];const Mt={leading:$t,buttons:Dt,stickyButtons:Lt,overflowPosition:void 0};if(tt.customizeTabSet(_e,Mt),$t=Mt.leading,Lt=Mt.stickyButtons,Dt=Mt.buttons,Mt.overflowPosition===void 0&&(Mt.overflowPosition=Lt.length),Lt.length>0&&(vt?Dt=[...Lt,...Dt]:Pt.push(jsxRuntimeExports.jsx("div",{ref:at,onPointerDown:St,onDragStart:qt=>{qt.preventDefault()},className:At(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER),children:Lt},"sticky_buttons_container"))),_t){const qt=tt.i18nName(I18nLabel.Overflow_Menu_Tooltip);let tn;if(typeof ct.more=="function"){const Xt=pt.map(sn=>({index:sn,node:_e.getChildren()[sn]}));tn=ct.more(_e,Xt)}else tn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ct.more,jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT),children:pt.length>0?pt.length:""})]});Dt.splice(Math.min(Mt.overflowPosition,Dt.length),0,jsxRuntimeExports.jsx("button",{ref:ot,className:At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+_e.getLocation().getName()),title:qt,onClick:xt,onPointerDown:St,children:tn},"overflowbutton"))}const It=_e.getSelected();if(It!==-1){const qt=_e.getChildren()[It];if(qt!==void 0&&tt.isSupportsPopout()&&qt.isEnablePopout()){const tn=tt.i18nName(I18nLabel.Popout_Tab);Dt.push(jsxRuntimeExports.jsx("button",{title:tn,className:At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:Et,onPointerDown:St,children:typeof ct.popout=="function"?ct.popout(qt):ct.popout},"popout"))}}const Bt=jsxRuntimeExports.jsx("div",{ref:rt,className:At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR)+" "+At(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_+_e.getLocation().getName()),children:Dt},"toolbar");let Ot={},Nt={};const Vt=et-1;_e.getLocation()===DockLocation.LEFT?(Ot={right:"100%",top:0},Nt={width:Vt,overflowY:"auto"}):_e.getLocation()===DockLocation.RIGHT?(Ot={left:"100%",top:0},Nt={width:Vt,overflowY:"auto"}):(Ot={left:0},Nt={height:Vt,overflowX:"auto"});let jt;_e.isEnableTabScrollbar()&&(jt=jsxRuntimeExports.jsx("div",{ref:it,className:At(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR),onPointerDown:ft}));let Ht;return $t&&(Ht=jsxRuntimeExports.jsx("div",{className:At(CLASSES.FLEXLAYOUT__BORDER_LEADING),children:$t})),jsxRuntimeExports.jsxs("div",{ref:ut,style:{display:"flex",flexDirection:_e.getOrientation()===Orientation.VERT?"row":"column"},className:Rt,"data-layout-path":_e.getPath(),onClick:yt,onAuxClick:yt,onContextMenu:bt,onWheel:mt,children:[Ht,jsxRuntimeExports.jsxs("div",{className:At(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER),children:[jsxRuntimeExports.jsx("div",{ref:st,className:At(CLASSES.FLEXLAYOUT__BORDER_INNER)+" "+At(CLASSES.FLEXLAYOUT__BORDER_INNER_+_e.getLocation().getName()),style:Nt,onScroll:ht,children:jsxRuntimeExports.jsx("div",{style:Ot,className:At(CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+At(CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+_e.getLocation().getName()),children:Pt})}),jt]}),Bt]})},DragContainer=nt=>{const{layout:_e,node:tt}=nt,et=reactExports$1.useRef(null);reactExports$1.useEffect(()=>{tt.setTabStamp(et.current)},[tt,et.current]);const rt=_e.getClassName,it=rt(CLASSES.FLEXLAYOUT__DRAG_RECT);return jsxRuntimeExports.jsx("div",{ref:et,className:it,children:jsxRuntimeExports.jsx(TabButtonStamp,{layout:_e,node:tt},tt.getId())})},PopoutWindow=nt=>{const{title:_e,layout:tt,layoutWindow:et,url:rt,onCloseWindow:it,onSetWindow:ot,children:at}=nt,st=reactExports$1.useRef(null),[ct,ut]=reactExports$1.useState(void 0),dt=new Map;return reactExports$1.useLayoutEffect(()=>{if(!st.current){const ht=et.windowId,ft=et.rect;st.current=window.open(rt,ht,`left=${ft.x},top=${ft.y},width=${ft.width},height=${ft.height}`),st.current?(et.window=st.current,ot(et,st.current),window.addEventListener("beforeunload",()=>{if(st.current){const pt=st.current;st.current=null,pt.close()}}),st.current.addEventListener("load",()=>{if(st.current){st.current.focus(),st.current.resizeTo(ft.width,ft.height),st.current.moveTo(ft.x,ft.y);const pt=st.current.document;pt.title=_e;const mt=pt.createElement("div");mt.className=CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,pt.body.appendChild(mt),copyStyles(pt,dt).then(()=>{ut(mt)});const vt=new MutationObserver(_t=>handleStyleMutations(_t,pt,dt));vt.observe(document.head,{childList:!0}),st.current.addEventListener("beforeunload",()=>{st.current&&(it(et),st.current=null,vt.disconnect())})}})):(console.warn(`Unable to open window ${rt}`),it(et))}return()=>{var ht;tt.getModel().getwindowsMap().has(et.windowId)||((ht=st.current)==null||ht.close(),st.current=null)}},[]),ct!==void 0?reactDomExports.createPortal(at,ct):null};function handleStyleMutations(nt,_e,tt){for(const et of nt)if(et.type==="childList"){for(const rt of et.addedNodes)(rt instanceof HTMLLinkElement||rt instanceof HTMLStyleElement)&&copyStyle(_e,rt,tt);for(const rt of et.removedNodes)if(rt instanceof HTMLLinkElement||rt instanceof HTMLStyleElement){const it=tt.get(rt);it&&_e.head.removeChild(it)}}}function copyStyles(nt,_e){const tt=[],et=document.querySelectorAll('style, link[rel="stylesheet"]');for(const rt of et)copyStyle(nt,rt,_e,tt);return Promise.all(tt)}function copyStyle(nt,_e,tt,et){if(_e instanceof HTMLLinkElement){const rt=_e.cloneNode(!0);nt.head.appendChild(rt),tt.set(_e,rt),et&&et.push(new Promise(it=>{rt.onload=()=>it(!0)}))}else if(_e instanceof HTMLStyleElement)try{const rt=_e.cloneNode(!0);nt.head.appendChild(rt),tt.set(_e,rt)}catch{}}const style={width:"1em",height:"1em",display:"flex",alignItems:"center"},CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",children:[jsxRuntimeExports.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]}),MaximizeIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})]}),OverflowIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"})]}),EdgeIcon=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100",children:jsxRuntimeExports.jsx("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"})}),PopoutIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 20 20",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),jsxRuntimeExports.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]}),RestoreIcon=()=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})]}),AsterickIcon=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style,height:"24px",viewBox:"0 -960 960 960",width:"24px",children:jsxRuntimeExports.jsx("path",{fill:"var(--color-icon)",stroke:"var(--color-icon)",d:"M440-120v-264L254-197l-57-57 187-186H120v-80h264L197-706l57-57 186 187v-264h80v264l186-187 57 57-187 186h264v80H576l187 186-57 57-186-187v264h-80Z"})}),Overlay=nt=>{const{layout:_e,show:tt}=nt;return jsxRuntimeExports.jsx("div",{className:_e.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_OVERLAY),style:{display:tt?"flex":"none"}})},TabButton=nt=>{const{layout:_e,node:tt,selected:et,path:rt}=nt,it=reactExports$1.useRef(null),ot=reactExports$1.useRef(null),at=_e.getIcons();reactExports$1.useLayoutEffect(()=>{tt.setTabRect(_e.getBoundingClientRect(it.current)),_e.getEditingTab()===tt&&ot.current.select()});const st=Dt=>{tt.isEnableDrag()?(Dt.stopPropagation(),_e.setDragNode(Dt.nativeEvent,tt)):Dt.preventDefault()},ct=Dt=>{_e.clearDragMain()},ut=Dt=>{isAuxMouseEvent(Dt)&&_e.auxMouseClick(tt,Dt)},dt=Dt=>{_e.showContextMenu(tt,Dt)},ht=()=>{_e.doAction(Actions.selectTab(tt.getId()))},ft=Dt=>{tt.isEnableRename()&&(pt(),Dt.stopPropagation())},pt=()=>{_e.setEditingTab(tt),_e.getCurrentDocument().body.addEventListener("pointerdown",mt)},mt=Dt=>{Dt.target!==ot.current&&(_e.getCurrentDocument().body.removeEventListener("pointerdown",mt),_e.setEditingTab(void 0))},vt=()=>{const Dt=tt.getCloseType();return!!(et||Dt===ICloseType.Always||Dt===ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},_t=Dt=>{vt()&&(_e.doAction(Actions.deleteTab(tt.getId())),Dt.stopPropagation())},yt=Dt=>{Dt.stopPropagation()},bt=Dt=>{Dt.stopPropagation()},St=Dt=>{Dt.code==="Escape"?_e.setEditingTab(void 0):(Dt.code==="Enter"||Dt.code==="NumpadEnter")&&(_e.setEditingTab(void 0),_e.doAction(Actions.renameTab(tt.getId(),Dt.target.value)))},xt=_e.getClassName,Ct=tt.getParent(),Et=Ct.isEnableSingleTabStretch()&&Ct.getChildren().length===1,At=Et?CLASSES.FLEXLAYOUT__TAB_BUTTON_STRETCH:CLASSES.FLEXLAYOUT__TAB_BUTTON;let Pt=xt(At);Pt+=" "+xt(At+"_"+Ct.getTabLocation()),Et||(et?Pt+=" "+xt(At+"--selected"):Pt+=" "+xt(At+"--unselected")),tt.getClassName()!==void 0&&(Pt+=" "+tt.getClassName());const Tt=getRenderStateEx(_e,tt);let Rt=Tt.content?jsxRuntimeExports.jsx("div",{className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT),children:Tt.content}):null;const $t=Tt.leading?jsxRuntimeExports.jsx("div",{className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING),children:Tt.leading}):null;if(_e.getEditingTab()===tt&&(Rt=jsxRuntimeExports.jsx("input",{ref:ot,className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":rt+"/textbox",type:"text",autoFocus:!0,defaultValue:tt.getName(),onKeyDown:St,onPointerDown:bt})),tt.isEnableClose()&&!Et){const Dt=_e.i18nName(I18nLabel.Close_Tab);Tt.buttons.push(jsxRuntimeExports.jsx("div",{"data-layout-path":rt+"/button/close",title:Dt,className:xt(CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING),onPointerDown:yt,onClick:_t,children:typeof at.close=="function"?at.close(tt):at.close},"close"))}return jsxRuntimeExports.jsxs("div",{ref:it,"data-layout-path":rt,className:Pt,onClick:ht,onAuxClick:ut,onContextMenu:dt,title:tt.getHelpText(),draggable:!0,onDragStart:st,onDragEnd:ct,onDoubleClick:ft,children:[$t,Rt,Tt.buttons]})},TabSet=nt=>{const{node:_e,layout:tt}=nt,et=reactExports$1.useRef(null),rt=reactExports$1.useRef(null),it=reactExports$1.useRef(null),ot=reactExports$1.useRef(null),at=reactExports$1.useRef(null),st=reactExports$1.useRef(null),ct=reactExports$1.useRef(null),ut=reactExports$1.useRef(void 0),dt=tt.getIcons();reactExports$1.useLayoutEffect(()=>{_e.setRect(tt.getBoundingClientRect(ht.current)),et.current&&_e.setTabStripRect(tt.getBoundingClientRect(et.current));const hn=tt.getBoundingClientRect(ot.current);!_e.getContentRect().equals(hn)&&!isNaN(hn.x)&&(_e.setContentRect(hn),splitterDragging?(ut.current&&clearTimeout(ut.current),ut.current=setTimeout(()=>{tt.redrawInternal("border content rect "+hn),ut.current=void 0},50)):tt.redrawInternal("border content rect "+hn))});const{selfRef:ht,userControlledPositionRef:ft,onScroll:pt,onScrollPointerDown:mt,hiddenTabs:vt,onMouseWheel:_t,isDockStickyButtons:yt,isShowHiddenTabs:bt}=useTabOverflow(tt,_e,Orientation.HORZ,it,rt,tt.getClassName(CLASSES.FLEXLAYOUT__TAB_BUTTON)),St=hn=>{const xn=tt.getShowOverflowMenu(),Un=vt.map(Ln=>({index:Ln,node:_e.getChildren()[Ln]}));if(xn!==void 0)xn(_e,hn,Un,xt);else{const Ln=st.current;showPopup(Ln,_e,Un,xt,tt)}hn.stopPropagation()},xt=hn=>{tt.doAction(Actions.selectTab(hn.node.getId())),ft.current=!1},Ct=hn=>{tt.getEditingTab()?hn.preventDefault():_e.isEnableDrag()?(hn.stopPropagation(),tt.setDragNode(hn.nativeEvent,_e)):hn.preventDefault()},Et=hn=>{isAuxMouseEvent(hn)||tt.doAction(Actions.setActiveTabset(_e.getId(),tt.getWindowId()))},At=hn=>{isAuxMouseEvent(hn)&&tt.auxMouseClick(_e,hn)},Pt=hn=>{tt.showContextMenu(_e,hn)},Tt=hn=>{hn.stopPropagation()},Rt=hn=>{_e.canMaximize()&&tt.maximize(_e),hn.stopPropagation()},$t=hn=>{tt.doAction(Actions.deleteTabset(_e.getId())),hn.stopPropagation()},Dt=hn=>{tt.doAction(Actions.deleteTab(_e.getChildren()[0].getId())),hn.stopPropagation()},Lt=hn=>{Bt!==void 0&&tt.doAction(Actions.popoutTab(Bt.getId())),hn.stopPropagation()},Mt=hn=>{_e.canMaximize()&&tt.maximize(_e)},It=tt.getClassName,Bt=_e.getSelectedNode(),Ot=_e.getPath(),Nt=[];if(_e.isEnableTabStrip())for(let hn=0;hn<_e.getChildren().length;hn++){const xn=_e.getChildren()[hn],Un=_e.getSelected()===hn;Nt.push(jsxRuntimeExports.jsx(TabButton,{layout:tt,node:xn,path:Ot+"/tb"+hn,selected:Un},xn.getId())),hn<_e.getChildren().length-1&&Nt.push(jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER)},"divider"+hn))}let Vt,jt=[],Ht=[];const qt={leading:Vt,stickyButtons:jt,buttons:Ht,overflowPosition:void 0};tt.customizeTabSet(_e,qt),Vt=qt.leading,jt=qt.stickyButtons,Ht=qt.buttons;const tn=_e.isEnableSingleTabStretch()&&_e.getChildren().length===1,Xt=tn&&_e.getChildren()[0].isEnableClose()||_e.isEnableClose();if(qt.overflowPosition===void 0&&(qt.overflowPosition=jt.length),jt.length>0&&(!_e.isEnableTabWrap()&&(yt||tn)?Ht=[...jt,...Ht]:Nt.push(jsxRuntimeExports.jsx("div",{ref:ct,onPointerDown:Tt,onDragStart:hn=>{hn.preventDefault()},className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER),children:jt},"sticky_buttons_container"))),!_e.isEnableTabWrap()&&bt){const hn=tt.i18nName(I18nLabel.Overflow_Menu_Tooltip);let xn;if(typeof dt.more=="function"){const Un=vt.map(Ln=>({index:Ln,node:_e.getChildren()[Ln]}));xn=dt.more(_e,Un)}else xn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[dt.more,jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT),children:vt.length>0?vt.length:""})]});Ht.splice(Math.min(qt.overflowPosition,Ht.length),0,jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/overflow",ref:st,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:hn,onClick:St,onPointerDown:Tt,children:xn},"overflowbutton"))}if(Bt!==void 0&&tt.isSupportsPopout()&&Bt.isEnablePopout()&&Bt.isEnablePopoutIcon()){const hn=tt.i18nName(I18nLabel.Popout_Tab);Ht.push(jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/popout",title:hn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:Lt,onPointerDown:Tt,children:typeof dt.popout=="function"?dt.popout(Bt):dt.popout},"popout"))}if(_e.canMaximize()){const hn=tt.i18nName(I18nLabel.Restore),xn=tt.i18nName(I18nLabel.Maximize);Ht.push(jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/max",title:_e.isMaximized()?hn:xn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(_e.isMaximized()?"max":"min")),onClick:Rt,onPointerDown:Tt,children:_e.isMaximized()?typeof dt.restore=="function"?dt.restore(_e):dt.restore:typeof dt.maximize=="function"?dt.maximize(_e):dt.maximize},"max"))}if(!_e.isMaximized()&&Xt){const hn=tn?tt.i18nName(I18nLabel.Close_Tab):tt.i18nName(I18nLabel.Close_Tabset);Ht.push(jsxRuntimeExports.jsx("button",{"data-layout-path":Ot+"/button/close",title:hn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:tn?Dt:$t,onPointerDown:Tt,children:typeof dt.closeTabset=="function"?dt.closeTabset(_e):dt.closeTabset},"close"))}if(_e.isActive()&&_e.isEnableActiveIcon()){const hn=tt.i18nName(I18nLabel.Active_Tabset);Ht.push(jsxRuntimeExports.jsx("div",{"data-layout-path":Ot+"/button/active",title:hn,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_ICON),children:typeof dt.activeTabset=="function"?dt.activeTabset(_e):dt.activeTabset},"active"))}const sn=jsxRuntimeExports.jsx("div",{ref:at,className:It(CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onPointerDown:Tt,onDragStart:hn=>{hn.preventDefault()},children:Ht},"buttonbar");let Zt,cn=It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(_e.getClassNameTabStrip()!==void 0&&(cn+=" "+_e.getClassNameTabStrip()),cn+=" "+CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_+_e.getTabLocation(),_e.isActive()&&(cn+=" "+It(CLASSES.FLEXLAYOUT__TABSET_SELECTED)),_e.isMaximized()&&(cn+=" "+It(CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),tn){const hn=_e.getChildren()[0];hn.getTabSetClassName()!==void 0&&(cn+=" "+hn.getTabSetClassName())}let _n;if(Vt&&(_n=jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TABSET_LEADING),children:Vt})),_e.isEnableTabWrap())_e.isEnableTabStrip()&&(Zt=jsxRuntimeExports.jsxs("div",{className:cn,style:{flexWrap:"wrap",gap:"1px",marginTop:"2px"},ref:et,"data-layout-path":Ot+"/tabstrip",onPointerDown:Et,onDoubleClick:Mt,onContextMenu:Pt,onClick:At,onAuxClick:At,draggable:!0,onDragStart:Ct,children:[_n,Nt,jsxRuntimeExports.jsx("div",{style:{flexGrow:1}}),sn]}));else if(_e.isEnableTabStrip()){let hn;_e.isEnableTabScrollbar()&&(hn=jsxRuntimeExports.jsx("div",{ref:rt,className:It(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR),onPointerDown:mt})),Zt=jsxRuntimeExports.jsxs("div",{className:cn,ref:et,"data-layout-path":Ot+"/tabstrip",onPointerDown:Et,onDoubleClick:Mt,onContextMenu:Pt,onClick:At,onAuxClick:At,draggable:!0,onWheel:_t,onDragStart:Ct,children:[_n,jsxRuntimeExports.jsxs("div",{className:It(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER),children:[jsxRuntimeExports.jsx("div",{ref:it,className:It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_+_e.getTabLocation()),style:{overflowX:"auto",overflowY:"hidden"},onScroll:pt,children:jsxRuntimeExports.jsx("div",{style:{width:tn?"100%":"none"},className:It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+It(CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+_e.getTabLocation()),children:Nt})}),hn]}),sn]})}let gn;if(_e.getChildren().length===0){const hn=tt.getTabSetPlaceHolderCallback();hn&&(gn=hn(_e))}let pn=jsxRuntimeExports.jsx("div",{ref:ot,className:It(CLASSES.FLEXLAYOUT__TABSET_CONTENT),children:gn});_e.getTabLocation()==="top"?pn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Zt,pn]}):pn=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[pn,Zt]});const Tn={flexGrow:Math.max(1,_e.getWeight()*1e3),minWidth:_e.getMinWidth(),minHeight:_e.getMinHeight(),maxWidth:_e.getMaxWidth(),maxHeight:_e.getMaxHeight()};_e.getModel().getMaximizedTabset(tt.getWindowId())!==void 0&&!_e.isMaximized()&&(Tn.display="none");const In=jsxRuntimeExports.jsx("div",{ref:ht,className:It(CLASSES.FLEXLAYOUT__TABSET_CONTAINER),style:Tn,children:jsxRuntimeExports.jsx("div",{className:It(CLASSES.FLEXLAYOUT__TABSET),"data-layout-path":Ot,children:pn})});return _e.isMaximized()&&tt.getMainElement()?reactDomExports.createPortal(jsxRuntimeExports.jsx("div",{style:{position:"absolute",display:"flex",top:0,left:0,bottom:0,right:0},children:In}),tt.getMainElement()):In},Row=nt=>{const{layout:_e,node:tt}=nt,et=reactExports$1.useRef(null),rt=tt.getOrientation()===Orientation.HORZ;reactExports$1.useLayoutEffect(()=>{tt.setRect(_e.getBoundingClientRect(et.current))});const it=[];let ot=0;for(const st of tt.getChildren())ot>0&&it.push(jsxRuntimeExports.jsx(Splitter,{layout:_e,node:tt,index:ot,horizontal:rt},"splitter"+ot)),st instanceof RowNode?it.push(jsxRuntimeExports.jsx(Row,{layout:_e,node:st},st.getId())):st instanceof TabSetNode&&it.push(jsxRuntimeExports.jsx(TabSet,{layout:_e,node:st},st.getId())),ot++;const at={flexGrow:Math.max(1,tt.getWeight()*1e3),minWidth:tt.getMinWidth(),minHeight:tt.getMinHeight(),maxWidth:tt.getMaxWidth(),maxHeight:tt.getMaxHeight()};return rt?at.flexDirection="row":at.flexDirection="column",jsxRuntimeExports.jsx("div",{ref:et,className:_e.getClassName(CLASSES.FLEXLAYOUT__ROW),style:at,children:it})},Tab=nt=>{const{layout:_e,selected:tt,node:et,path:rt}=nt,it=reactExports$1.useRef(null),ot=reactExports$1.useRef(!0),at=et.getParent(),st=at.getContentRect();reactExports$1.useLayoutEffect(()=>{const pt=et.getMoveableElement();it.current.appendChild(pt),et.setMoveableElement(pt);const mt=()=>{et.saveScrollPosition()};return pt.addEventListener("scroll",mt),it.current.addEventListener("pointerdown",ct),()=>{pt.removeEventListener("scroll",mt),it.current&&it.current.removeEventListener("pointerdown",ct),et.setVisible(!1)}},[]),reactExports$1.useEffect(()=>{et.isSelected()&&ot.current&&(et.restoreScrollPosition(),ot.current=!1)});const ct=()=>{const pt=et.getParent();pt instanceof TabSetNode&&(pt.isActive()||_e.doAction(Actions.setActiveTabset(pt.getId(),_e.getWindowId())))};et.setRect(st);const ut=_e.getClassName,dt={};st.styleWithPosition(dt);let ht=null;if(tt){if(et.setVisible(!0),document.hidden&&et.isEnablePopoutOverlay()){const pt={};st.styleWithPosition(pt),ht=jsxRuntimeExports.jsx("div",{style:pt,className:ut(CLASSES.FLEXLAYOUT__TAB_OVERLAY)})}}else dt.display="none",et.setVisible(!1);at instanceof TabSetNode&&et.getModel().getMaximizedTabset(_e.getWindowId())!==void 0&&(at.isMaximized()?dt.zIndex=10:dt.display="none"),at instanceof BorderNode&&(at.isShowing()||(dt.display="none"));let ft=ut(CLASSES.FLEXLAYOUT__TAB);return at instanceof BorderNode&&(ft+=" "+ut(CLASSES.FLEXLAYOUT__TAB_BORDER),ft+=" "+ut(CLASSES.FLEXLAYOUT__TAB_BORDER_+at.getLocation().getName())),et.getContentClassName()!==void 0&&(ft+=" "+et.getContentClassName()),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ht,jsxRuntimeExports.jsx("div",{ref:it,style:dt,className:ft,"data-layout-path":rt})]})};class ErrorBoundary extends reactExports$1.Component{constructor(_e){super(_e),__publicField(this,"retry",()=>{this.setState({hasError:!1})}),this.state={hasError:!1}}static getDerivedStateFromError(_e){return{hasError:!0}}componentDidCatch(_e,tt){console.debug(_e),console.debug(tt)}render(){return this.state.hasError?jsxRuntimeExports.jsx("div",{className:CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER,children:jsxRuntimeExports.jsx("div",{className:CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT,children:jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[this.props.message,jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("button",{onClick:this.retry,children:this.props.retryText})})]})})}):this.props.children}}const SizeTracker=reactExports$1.memo(({layout:nt,node:_e})=>jsxRuntimeExports.jsx(ErrorBoundary,{message:nt.i18nName(I18nLabel.Error_rendering_component),retryText:nt.i18nName(I18nLabel.Error_rendering_component_retry),children:nt.props.factory(_e)}),arePropsEqual);function arePropsEqual(nt,_e){return!(_e.visible&&(!nt.rect.equalSize(_e.rect)||nt.forceRevision!==_e.forceRevision||nt.tabsRevision!==_e.tabsRevision))}const _LayoutInternal=class pr extends reactExports$1.Component{constructor(_e){super(_e),__publicField(this,"selfRef"),__publicField(this,"moveablesRef"),__publicField(this,"findBorderBarSizeRef"),__publicField(this,"mainRef"),__publicField(this,"previousModel"),__publicField(this,"orderedTabIds"),__publicField(this,"orderedTabMoveableIds"),__publicField(this,"moveableElementMap",new Map),__publicField(this,"dropInfo"),__publicField(this,"outlineDiv"),__publicField(this,"currentDocument"),__publicField(this,"currentWindow"),__publicField(this,"supportsPopout"),__publicField(this,"popoutURL"),__publicField(this,"icons"),__publicField(this,"resizeObserver"),__publicField(this,"dragEnterCount",0),__publicField(this,"dragging",!1),__publicField(this,"windowId"),__publicField(this,"layoutWindow"),__publicField(this,"mainLayout"),__publicField(this,"isMainWindow"),__publicField(this,"isDraggingOverWindow"),__publicField(this,"styleObserver"),__publicField(this,"popoutWindowName"),__publicField(this,"updateLayoutMetrics",()=>{if(this.findBorderBarSizeRef.current){const tt=this.findBorderBarSizeRef.current.getBoundingClientRect().height;tt!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:tt})}}),__publicField(this,"onModelChange",tt=>{this.redrawInternal("model change"),this.props.onModelChange&&this.props.onModelChange(this.props.model,tt)}),__publicField(this,"updateRect",()=>{if(this.selfRef.current){const tt=Rect.fromDomRect(this.selfRef.current.getBoundingClientRect());!tt.equals(this.state.rect)&&tt.width!==0&&tt.height!==0&&(this.setState({rect:tt}),this.windowId!==Model.MAIN_WINDOW_ID&&this.redrawInternal("rect updated"))}}),__publicField(this,"getClassName",tt=>this.props.classNameMapper===void 0?tt:this.props.classNameMapper(tt)),__publicField(this,"onCloseWindow",tt=>{this.doAction(Actions.closeWindow(tt.windowId))}),__publicField(this,"onSetWindow",(tt,et)=>{}),__publicField(this,"showControlInPortal",(tt,et)=>{const rt=reactDomExports.createPortal(tt,et);this.setState({portal:rt})}),__publicField(this,"hideControlInPortal",()=>{this.setState({portal:void 0})}),__publicField(this,"getIcons",()=>this.icons),__publicField(this,"setDragNode",(tt,et)=>{if(pr.dragState=new DragState(this.mainLayout,"internal",et,void 0,void 0),tt.dataTransfer.setData("text/plain","--flexlayout--"),tt.dataTransfer.effectAllowed="copyMove",tt.dataTransfer.dropEffect="move",this.dragEnterCount=0,et instanceof TabSetNode){let rt=!1,it=this.i18nName(I18nLabel.Move_Tabset);if(et.getChildren().length>0&&(it=this.i18nName(I18nLabel.Move_Tabs).replace("?",String(et.getChildren().length))),this.props.onRenderDragRect){const ot=this.props.onRenderDragRect(it,et,void 0);ot&&(this.setDragComponent(tt,ot,10,10),rt=!0)}rt||this.setDragComponent(tt,it,10,10)}else{const it=tt.target.getBoundingClientRect(),ot=tt.clientX-it.left,at=tt.clientY-it.top,st=et==null?void 0:et.getParent(),ct=st instanceof BorderNode&&st.getOrientation()===Orientation.HORZ,ut=ct?10:ot,dt=ct?10:at;let ht=!1;if(this.props.onRenderDragRect){const ft=jsxRuntimeExports.jsx(TabButtonStamp,{layout:this,node:et},et.getId()),pt=this.props.onRenderDragRect(ft,et,void 0);pt&&(this.setDragComponent(tt,pt,ut,dt),ht=!0)}ht||(isSafari()?this.setDragComponent(tt,jsxRuntimeExports.jsx(TabButtonStamp,{node:et,layout:this}),ut,dt):tt.dataTransfer.setDragImage(et.getTabStamp(),ut,dt))}}),__publicField(this,"onDragEnterRaw",tt=>{this.dragEnterCount++,this.dragEnterCount===1&&this.onDragEnter(tt)}),__publicField(this,"onDragLeaveRaw",tt=>{this.dragEnterCount--,this.dragEnterCount===0&&this.onDragLeave(tt)}),__publicField(this,"onDragEnter",tt=>{if(!pr.dragState&&this.props.onExternalDrag){const et=this.props.onExternalDrag(tt);if(et){const rt=TabNode.fromJson(et.json,this.props.model,!1);pr.dragState=new DragState(this.mainLayout,"external",rt,et.json,et.onDrop)}}if(pr.dragState){if(this.windowId!==Model.MAIN_WINDOW_ID&&pr.dragState.mainLayout===this.mainLayout&&pr.dragState.mainLayout.setDraggingOverWindow(!0),pr.dragState.mainLayout!==this.mainLayout)return;tt.preventDefault(),this.dropInfo=void 0;const et=this.selfRef.current;this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(CLASSES.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden";const rt=this.props.model.getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${rt}s, left ${rt}s, width ${rt}s, height ${rt}s`,et.appendChild(this.outlineDiv),this.dragging=!0,this.showOverlay(!0),!this.isDraggingOverWindow&&this.props.model.getMaximizedTabset(this.windowId)===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()});const it=this.selfRef.current.getBoundingClientRect();new Rect(tt.clientX-it.left,tt.clientY-it.top,1,1).positionElement(this.outlineDiv)}}),__publicField(this,"onDragOver",tt=>{var et;if(this.dragging&&!this.isDraggingOverWindow){tt.preventDefault();const rt=(et=this.selfRef.current)==null?void 0:et.getBoundingClientRect(),it={x:tt.clientX-((rt==null?void 0:rt.left)??0),y:tt.clientY-((rt==null?void 0:rt.top)??0)};this.checkForBorderToShow(it.x,it.y);const ot=this.props.model.findDropTargetNode(this.windowId,pr.dragState.dragNode,it.x,it.y);ot&&(this.dropInfo=ot,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(ot.className),ot.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))}}),__publicField(this,"onDragLeave",tt=>{this.dragging&&(this.windowId!==Model.MAIN_WINDOW_ID&&pr.dragState.mainLayout.setDraggingOverWindow(!1),this.clearDragLocal())}),__publicField(this,"onDrop",tt=>{if(this.dragging){tt.preventDefault();const et=pr.dragState;if(this.dropInfo)if(et.dragJson!==void 0){const rt=this.doAction(Actions.addNode(et.dragJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));et.fnNewNodeDropped!==void 0&&et.fnNewNodeDropped(rt,tt)}else et.dragNode!==void 0&&this.doAction(Actions.moveNode(et.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.mainLayout.clearDragMain()}this.dragEnterCount=0}),this.orderedTabIds=[],this.orderedTabMoveableIds=[],this.selfRef=reactExports$1.createRef(),this.moveablesRef=reactExports$1.createRef(),this.mainRef=reactExports$1.createRef(),this.findBorderBarSizeRef=reactExports$1.createRef(),this.supportsPopout=_e.supportsPopout!==void 0?_e.supportsPopout:defaultSupportsPopout,this.popoutURL=_e.popoutURL?_e.popoutURL:"popout.html",this.icons={...defaultIcons,..._e.icons},this.windowId=_e.windowId?_e.windowId:Model.MAIN_WINDOW_ID,this.mainLayout=this.props.mainLayout?this.props.mainLayout:this,this.isDraggingOverWindow=!1,this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.popoutWindowName=this.props.popoutWindowName||"Popout Window",this.state={rect:Rect.empty(),editingTab:void 0,showEdges:!1,showOverlay:!1,calculatedBorderBarSize:29,layoutRevision:0,forceRevision:0,showHiddenBorder:DockLocation.CENTER},this.isMainWindow=this.windowId===Model.MAIN_WINDOW_ID}componentDidMount(){if(this.updateRect(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.layoutWindow.window=this.currentWindow,this.layoutWindow.toScreenRectFunction=_e=>this.getScreenRect(_e),this.resizeObserver=new ResizeObserver(_e=>{requestAnimationFrame(()=>{this.updateRect()})}),this.selfRef.current&&this.resizeObserver.observe(this.selfRef.current),this.isMainWindow)this.props.model.addChangeListener(this.onModelChange),this.updateLayoutMetrics();else{this.currentWindow.addEventListener("resize",()=>{this.updateRect()});const _e=this.props.mainLayout.getRootDiv(),tt=this.selfRef.current;copyInlineStyles(_e,tt),this.styleObserver=new MutationObserver(()=>{copyInlineStyles(_e,tt)&&this.redraw("mutation observer")}),this.styleObserver.observe(_e,{attributeFilter:["style"]})}document.addEventListener("visibilitychange",()=>{for(const[_e,tt]of this.props.model.getwindowsMap())tt.layout&&this.redraw("visibility change")})}componentDidUpdate(){this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.isMainWindow&&(this.props.model!==this.previousModel&&(this.previousModel!==void 0&&this.previousModel.removeChangeListener(this.onModelChange),this.props.model.getwindowsMap().get(this.windowId).layout=this,this.props.model.addChangeListener(this.onModelChange),this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.layoutWindow.toScreenRectFunction=_e=>this.getScreenRect(_e),this.previousModel=this.props.model,this.tidyMoveablesMap()),this.updateLayoutMetrics())}componentWillUnmount(){var _e,tt;this.selfRef.current&&((_e=this.resizeObserver)==null||_e.unobserve(this.selfRef.current)),this.isMainWindow&&this.props.model.removeChangeListener(this.onModelChange),(tt=this.styleObserver)==null||tt.disconnect()}render(){if(!this.selfRef.current)return jsxRuntimeExports.jsxs("div",{ref:this.selfRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT),children:[jsxRuntimeExports.jsx("div",{ref:this.moveablesRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_MOVEABLES)},"__moveables__"),this.renderMetricsElements()]});const _e=this.props.model;_e.getRoot(this.windowId).calcMinMaxSize(),_e.getRoot(this.windowId).setPaths(""),_e.getBorderSet().setPaths();const tt=this.renderLayout(),et=this.renderBorders(tt),rt=this.renderTabs(),it=this.reorderComponents(rt,this.orderedTabIds);let ot=null,at=null,st=null,ct=null;if(this.isMainWindow){ot=this.renderWindows(),ct=this.renderMetricsElements();const ut=this.renderTabMoveables();at=this.reorderComponents(ut,this.orderedTabMoveableIds),st=jsxRuntimeExports.jsx("div",{className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_TAB_STAMPS),children:this.renderTabStamps()},"__tabStamps__")}return jsxRuntimeExports.jsxs("div",{ref:this.selfRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT),onDragEnter:this.onDragEnterRaw,onDragLeave:this.onDragLeaveRaw,onDragOver:this.onDragOver,onDrop:this.onDrop,children:[jsxRuntimeExports.jsx("div",{ref:this.moveablesRef,className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_MOVEABLES)},"__moveables__"),ct,jsxRuntimeExports.jsx(Overlay,{layout:this,show:this.state.showOverlay},"__overlay__"),et,it,at,st,this.state.portal,ot]})}renderBorders(_e){const tt=this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_MAIN),et=this.props.model.getBorderSet().getBorderMap();if(this.isMainWindow&&et.size>0){_e=jsxRuntimeExports.jsx("div",{className:tt,ref:this.mainRef,children:_e});const rt=new Map,it=new Map;for(const[st,ct]of DockLocation.values){const ut=et.get(ct);ut&&ut.isShowing()&&(!ut.isAutoHide()||ut.isAutoHide()&&(ut.getChildren().length>0||this.state.showHiddenBorder===ct))&&(rt.set(ct,jsxRuntimeExports.jsx(BorderTabSet,{layout:this,border:ut,size:this.state.calculatedBorderBarSize})),it.set(ct,jsxRuntimeExports.jsx(BorderTab,{layout:this,border:ut,show:ut.getSelected()!==-1})))}const ot=this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER),at=this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER);if(this.props.model.getBorderSet().getLayoutHorizontal()){const st=jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"column"},children:[it.get(DockLocation.TOP),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"row"},children:[it.get(DockLocation.LEFT),_e,it.get(DockLocation.RIGHT)]}),it.get(DockLocation.BOTTOM)]});return jsxRuntimeExports.jsxs("div",{className:ot,style:{flexDirection:"column"},children:[rt.get(DockLocation.TOP),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"row"},children:[rt.get(DockLocation.LEFT),st,rt.get(DockLocation.RIGHT)]}),rt.get(DockLocation.BOTTOM)]})}else{const st=jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"row"},children:[it.get(DockLocation.LEFT),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"column"},children:[it.get(DockLocation.TOP),_e,it.get(DockLocation.BOTTOM)]}),it.get(DockLocation.RIGHT)]});return jsxRuntimeExports.jsxs("div",{className:ot,style:{flexDirection:"row"},children:[rt.get(DockLocation.LEFT),jsxRuntimeExports.jsxs("div",{className:at,style:{flexDirection:"column"},children:[rt.get(DockLocation.TOP),st,rt.get(DockLocation.BOTTOM)]}),rt.get(DockLocation.RIGHT)]})}}else return jsxRuntimeExports.jsx("div",{className:tt,ref:this.mainRef,style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex"},children:_e})}renderLayout(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Row,{layout:this,node:this.props.model.getRoot(this.windowId)},"__row__"),this.renderEdgeIndicators()]})}renderEdgeIndicators(){const _e=[],tt=this.icons.edgeArrow;if(this.state.showEdges){const et=this.props.model.getRoot(this.windowId).getRect(),rt=edgeRectLength,it=edgeRectWidth,ot=edgeRectLength/2,at=this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT),st=50;_e.push(jsxRuntimeExports.jsx("div",{style:{top:0,left:et.width/2-ot,width:rt,height:it,borderBottomLeftRadius:st,borderBottomRightRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_TOP),children:jsxRuntimeExports.jsx("div",{style:{transform:"rotate(180deg)"},children:tt})},"North")),_e.push(jsxRuntimeExports.jsx("div",{style:{top:et.height/2-ot,left:0,width:it,height:rt,borderTopRightRadius:st,borderBottomRightRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_LEFT),children:jsxRuntimeExports.jsx("div",{style:{transform:"rotate(90deg)"},children:tt})},"West")),_e.push(jsxRuntimeExports.jsx("div",{style:{top:et.height-it,left:et.width/2-ot,width:rt,height:it,borderTopLeftRadius:st,borderTopRightRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_BOTTOM),children:jsxRuntimeExports.jsx("div",{children:tt})},"South")),_e.push(jsxRuntimeExports.jsx("div",{style:{top:et.height/2-ot,left:et.width-it,width:it,height:rt,borderTopLeftRadius:st,borderBottomLeftRadius:st},className:at+" "+this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT_RIGHT),children:jsxRuntimeExports.jsx("div",{style:{transform:"rotate(-90deg)"},children:tt})},"East"))}return _e}renderWindows(){const _e=[];if(this.supportsPopout){const tt=this.props.model.getwindowsMap();let et=1;for(const[rt,it]of tt)rt!==Model.MAIN_WINDOW_ID&&(_e.push(jsxRuntimeExports.jsx(PopoutWindow,{layout:this,title:this.popoutWindowName+" "+et,layoutWindow:it,url:this.popoutURL+"?id="+rt,onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow,children:jsxRuntimeExports.jsx("div",{className:this.props.popoutClassName,children:jsxRuntimeExports.jsx(pr,{...this.props,windowId:rt,mainLayout:this})})},rt)),et++)}return _e}renderTabMoveables(){const _e=new Map;return this.props.model.visitNodes(tt=>{if(tt instanceof TabNode){const et=tt,rt=this.getMoveableElement(et.getId());et.setMoveableElement(rt);const it=et.isSelected(),ot=et.getParent().getContentRect(),at=it||!et.isEnableRenderOnDemand(),st=et.isRendered()||at&&ot.width>0&&ot.height>0;if(st){const ct=et.getId()+(et.isEnableWindowReMount()?et.getWindowId():"");_e.set(tt.getId(),reactDomExports.createPortal(jsxRuntimeExports.jsx(SizeTracker,{layout:this,node:et,rect:ot,visible:at,forceRevision:this.state.forceRevision,tabsRevision:this.props.renderRevision},ct),rt,ct)),et.setRendered(st)}}}),_e}renderTabStamps(){const _e=[];return this.props.model.visitNodes(tt=>{if(tt instanceof TabNode){const et=tt;_e.push(jsxRuntimeExports.jsx(DragContainer,{layout:this,node:et},et.getId()))}}),_e}renderTabs(){const _e=new Map;return this.props.model.visitWindowNodes(this.windowId,tt=>{if(tt instanceof TabNode){const et=tt,rt=et.isSelected(),it=et.getPath();(et.isRendered()||rt||!et.isEnableRenderOnDemand())&&_e.set(et.getId(),jsxRuntimeExports.jsx(Tab,{layout:this,path:it,node:et,selected:rt},et.getId()))}}),_e}renderMetricsElements(){return jsxRuntimeExports.jsx("div",{ref:this.findBorderBarSizeRef,className:this.getClassName(CLASSES.FLEXLAYOUT__BORDER_SIZER),children:"FindBorderBarSize"},"findBorderBarSize")}checkForBorderToShow(_e,tt){const et=this.getBoundingClientRect(this.mainRef.current),rt=et.getCenter(),it=edgeRectWidth,ot=edgeRectLength/2;let at=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===DockLocation.CENTER&&(tt>rt.y-ot&&tt<rt.y+ot||_e>rt.x-ot&&_e<rt.x+ot)&&(at=!0);let st=DockLocation.CENTER;at||(_e<=et.x+it?st=DockLocation.LEFT:_e>=et.getRight()-it?st=DockLocation.RIGHT:tt<=et.y+it?st=DockLocation.TOP:tt>=et.getBottom()-it&&(st=DockLocation.BOTTOM)),st!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:st})}tidyMoveablesMap(){const _e=new Map;this.props.model.visitNodes((tt,et)=>{tt instanceof TabNode&&_e.set(tt.getId(),tt)});for(const[tt,et]of this.moveableElementMap)_e.has(tt)||(et.remove(),this.moveableElementMap.delete(tt))}reorderComponents(_e,tt){const et=[],rt=new Set;let it=[];for(const ot of tt)_e.get(ot)&&(et.push(ot),rt.add(ot));tt.splice(0,tt.length,...et);for(const[ot,at]of _e)rt.has(ot)||tt.push(ot);return it=tt.map(ot=>_e.get(ot)),it}redraw(_e){this.mainLayout.setState((tt,et)=>({forceRevision:tt.forceRevision+1}))}redrawInternal(_e){this.mainLayout.setState((tt,et)=>({layoutRevision:tt.layoutRevision+1}))}doAction(_e){if(this.props.onAction!==void 0){const tt=this.props.onAction(_e);return tt!==void 0?this.props.model.doAction(tt):void 0}else return this.props.model.doAction(_e)}getBoundingClientRect(_e){const tt=this.getDomRect();return tt?Rect.getBoundingClientRect(_e).relativeTo(tt):Rect.empty()}getMoveableContainer(){return this.moveablesRef.current}getMoveableElement(_e){let tt=this.moveableElementMap.get(_e);return tt===void 0&&(tt=document.createElement("div"),this.moveablesRef.current.appendChild(tt),tt.className=CLASSES.FLEXLAYOUT__TAB_MOVEABLE,this.moveableElementMap.set(_e,tt)),tt}getMainLayout(){return this.mainLayout}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current?Rect.fromDomRect(this.selfRef.current.getBoundingClientRect()):Rect.empty()}getWindowId(){return this.windowId}getRootDiv(){return this.selfRef.current}getMainElement(){return this.mainRef.current}getFactory(){return this.props.factory}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){return this.props.realtimeResize??!1}getPopoutURL(){return this.popoutURL}setEditingTab(_e){this.setState({editingTab:_e})}getEditingTab(){return this.state.editingTab}getModel(){return this.props.model}getScreenRect(_e){const tt=_e.clone(),et=this.getDomRect(),rt=60,it=2;return tt.x=this.currentWindow.screenX+this.currentWindow.scrollX+it/2+et.x+tt.x,tt.y=this.currentWindow.screenY+this.currentWindow.scrollY+(rt-it/2)+et.y+tt.y,tt.height+=rt,tt.width+=it,tt}addTabToTabSet(_e,tt){if(this.props.model.getNodeById(_e)!==void 0)return this.doAction(Actions.addNode(tt,_e,DockLocation.CENTER,-1))}addTabToActiveTabSet(_e){const tt=this.props.model.getActiveTabset(this.windowId);if(tt!==void 0)return this.doAction(Actions.addNode(_e,tt.getId(),DockLocation.CENTER,-1))}maximize(_e){this.doAction(Actions.maximizeToggle(_e.getId(),this.getWindowId()))}customizeTab(_e,tt){this.props.onRenderTab&&this.props.onRenderTab(_e,tt)}customizeTabSet(_e,tt){this.props.onRenderTabSet&&this.props.onRenderTabSet(_e,tt)}i18nName(_e,tt){let et;return this.props.i18nMapper&&(et=this.props.i18nMapper(_e,tt)),et===void 0&&(et=_e+(tt===void 0?"":tt)),et}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(_e,tt){this.props.onContextMenu&&this.props.onContextMenu(_e,tt)}auxMouseClick(_e,tt){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(_e,tt)}showOverlay(_e){this.setState({showOverlay:_e}),enablePointerOnIFrames(!_e,this.currentDocument)}addTabWithDragAndDrop(_e,tt,et){const rt=TabNode.fromJson(tt,this.props.model,!1);pr.dragState=new DragState(this.mainLayout,"add",rt,tt,et)}moveTabWithDragAndDrop(_e,tt){this.setDragNode(_e,tt)}setDragComponent(_e,tt,et,rt){const it=jsxRuntimeExports.jsx("div",{style:{position:"unset"},className:this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT)+" "+this.getClassName(CLASSES.FLEXLAYOUT__DRAG_RECT),children:tt}),ot=this.currentDocument.createElement("div");ot.setAttribute("data-layout-path","/drag-rectangle"),ot.style.position="absolute",ot.style.left="-10000px",ot.style.top="-10000px",this.currentDocument.body.appendChild(ot),createRoot(ot).render(it),_e.dataTransfer.setDragImage(ot,et,rt),setTimeout(()=>{this.currentDocument.body.removeChild(ot)},0)}setDraggingOverWindow(_e){this.isDraggingOverWindow!==_e&&(this.outlineDiv&&(this.outlineDiv.style.visibility=_e?"hidden":"visible"),_e?this.setState({showEdges:!1}):this.props.model.getMaximizedTabset(this.windowId)===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.isDraggingOverWindow=_e)}clearDragMain(){pr.dragState=void 0,this.windowId===Model.MAIN_WINDOW_ID&&(this.isDraggingOverWindow=!1);for(const[,_e]of this.props.model.getwindowsMap())_e.layout.clearDragLocal()}clearDragLocal(){this.setState({showEdges:!1}),this.showOverlay(!1),this.dragEnterCount=0,this.dragging=!1,this.outlineDiv&&(this.selfRef.current.removeChild(this.outlineDiv),this.outlineDiv=void 0)}};__publicField(_LayoutInternal,"dragState");const defaultIcons={close:jsxRuntimeExports.jsx(CloseIcon,{}),closeTabset:jsxRuntimeExports.jsx(CloseIcon,{}),popout:jsxRuntimeExports.jsx(PopoutIcon,{}),maximize:jsxRuntimeExports.jsx(MaximizeIcon,{}),restore:jsxRuntimeExports.jsx(RestoreIcon,{}),more:jsxRuntimeExports.jsx(OverflowIcon,{}),edgeArrow:jsxRuntimeExports.jsx(EdgeIcon,{}),activeTabset:jsxRuntimeExports.jsx(AsterickIcon,{})},defaultSupportsPopout=isDesktop(),edgeRectLength=100,edgeRectWidth=10;class DragState{constructor(_e,tt,et,rt,it){__publicField(this,"mainLayout"),__publicField(this,"dragSource"),__publicField(this,"dragNode"),__publicField(this,"dragJson"),__publicField(this,"fnNewNodeDropped"),this.mainLayout=_e,this.dragSource=tt,this.dragNode=et,this.dragJson=rt,this.fnNewNodeDropped=it}}const log=logger$2("layout");class LayoutSystem extends RootStore{constructor(tt){super(tt);wt(this,"CACHE_LAYOUT_KEY","galacean-layoutFile");wt(this,"CACHE_SIDEBAR_KEY","galacean-sidebar");wt(this,"CUSTOM_LAYOUT_KEY","galacean-custom-layoutFile");wt(this,"EDITOR_MODE_KEY","galacean-editor-mode");wt(this,"sidebarVisible",!0);wt(this,"sidebarPosition","left");wt(this,"editorMode","professional");wt(this,"flexLayoutModel",null);wt(this,"controller");wt(this,"tabs",null);wt(this,"panels",[]);wt(this,"panelContents",new Map);wt(this,"customLayouts",[]);wt(this,"initTabs",tt=>{this.tabs=tt});wt(this,"activeTab",tt=>{const{flexLayoutModel:et}=this;et.doAction(Actions.selectTab(tt))});wt(this,"saveController",tt=>{this.controller=tt});wt(this,"setModel",tt=>{this.flexLayoutModel=tt});wt(this,"addPanel",(tt,et)=>{this.panelContents.set(tt.id,et),this.panels.push(tt)});wt(this,"closePanel",tt=>{const et=this.panels.findIndex(rt=>rt.id===tt);et>-1&&this.panels.splice(et,1)});wt(this,"removePanel",tt=>{this.panelContents.delete(tt)});wt(this,"resizePanel",(tt,et)=>{const rt=this.panels.find(it=>it.id===tt);rt&&(rt.size=et)});wt(this,"toggleSidebar",tt=>{if(tt!==void 0){this.sidebarVisible=tt;return}this.sidebarVisible=!this.sidebarVisible,set(this.CACHE_SIDEBAR_KEY,this.sidebarVisible)});wt(this,"setSidebarPosition",tt=>{this.sidebarPosition=tt});wt(this,"toggleEditorMode",tt=>{tt!==void 0?this.editorMode=tt:this.editorMode=this.editorMode==="simple"?"professional":"simple",set(this.EDITOR_MODE_KEY,this.editorMode)});wt(this,"toggleTabVisibility",(tt,et)=>{const{flexLayoutModel:rt,tabs:it,controller:ot}=this,at=rt.getNodeById(tt),st=rt.getNodeById(it.Viewport.id),ct=["Assets","AnimatorController","AnimationClip"],ut=["Hierarchy"],dt=["Inspector"];if(at&&et===!1){rt.doAction(Actions.deleteTab(at.getId()));return}if(at){if(at.isVisible()&&rt.doAction(Actions.selectTab(tt)),et!==!1){const mt=it[tt];mt!=null&&mt.onVisibilityChange&&mt.onVisibilityChange(mt.id,!0)}return}let ht=rt.getRoot().getId(),ft=DockLocation.BOTTOM;function pt(mt,vt,_t){const yt=mt.find(bt=>rt.getNodeById(it[bt].id));if(yt){_t=rt.getNodeById(it[yt].id).getParent().getId(),ot.addTabToTabSet(_t,it[tt]);return}rt.doAction(Actions.addNode(it[tt],_t,vt,0))}if(ut.includes(tt))return ft=DockLocation.LEFT,pt(ut,ft,ht);if(dt.includes(tt))return ft=DockLocation.RIGHT,pt(dt,ft,ht);if(ct.includes(tt))return ht=st.getParent().getId(),ft=DockLocation.BOTTOM,pt(ct,ft,ht)});wt(this,"toggleSceneMaximize",()=>{const{flexLayoutModel:tt,tabs:et}=this,it=tt.getNodeById(et.Viewport.id).getParent();tt.doAction(Actions.maximizeToggle(it.getId()))});wt(this,"cache",tt=>{log.info("save layout","verbose");const et=tt||this.flexLayoutModel;et&&set(this.CACHE_LAYOUT_KEY,et.toJson())});wt(this,"addCustomLayout",async tt=>{const et={name:tt,layout:this.flexLayoutModel.toJson()};await get(this.CUSTOM_LAYOUT_KEY)?update$1(this.CUSTOM_LAYOUT_KEY,it=>[...it,et]):set(this.CUSTOM_LAYOUT_KEY,[et]),this.customLayouts.push(et)});wt(this,"deleteCustomLayout",tt=>{update$1(this.CUSTOM_LAYOUT_KEY,et=>et.filter(rt=>rt.name!==tt)),this.customLayouts=this.customLayouts.filter(et=>et.name!==tt)});wt(this,"clearCacheLayout",async()=>{await del(this.CACHE_LAYOUT_KEY),await del(this.CACHE_SIDEBAR_KEY),location.reload()});makeObservable(this,{sidebarVisible:observable,sidebarPosition:observable,editorMode:observable,customLayouts:observable.shallow,toggleSidebar:action,setSidebarPosition:action,toggleEditorMode:action,flexLayoutModel:observable.ref,panels:observable,panelContents:observable.ref,removePanel:observable.ref})}async getCustomLayoutFromLocal(){const tt=await get(this.CUSTOM_LAYOUT_KEY);this.customLayouts=tt||[]}async initLayout(tt,et,rt){this.CACHE_LAYOUT_KEY=`${this.CACHE_LAYOUT_KEY}-${et}`,this.CACHE_SIDEBAR_KEY=`${this.CACHE_SIDEBAR_KEY}-${et}`,this.CUSTOM_LAYOUT_KEY=`${this.CUSTOM_LAYOUT_KEY}-${rt}`,this.EDITOR_MODE_KEY=`${this.EDITOR_MODE_KEY}-${rt}`;const it=await this.loadCacheLayout(),ot=await this.loadCacheSidebar(),at=await this.loadCacheEditorMode(),st=it?{...it,global:tt.global}:tt;this.flexLayoutModel=Model.fromJson(st),this.sidebarVisible=ot??!0,this.editorMode=at??"professional",await this.getCustomLayoutFromLocal()}async loadCacheLayout(){try{return await get(this.CACHE_LAYOUT_KEY)}catch{return console.warn("Failed to load and parse layout from cache."),null}}async loadCacheSidebar(){try{return await get(this.CACHE_SIDEBAR_KEY)}catch{console.warn("Failed to load and parse layout from cache.");return}}async loadCacheEditorMode(){try{return await get(this.EDITOR_MODE_KEY)}catch{console.warn("Failed to load editor mode from cache.");return}}replaceLayout(tt){this.flexLayoutModel=Model.fromJson(tt),this.cache()}}class SelectionStore extends RootStore{constructor(tt){super(tt);wt(this,"_logger",new TraceLogger("SelectionStore"));wt(this,"_fallbackContext","scene");wt(this,"_listeners",new Set);wt(this,"_snapshot",null);wt(this,"_sceneDisposer",null);wt(this,"_assetDisposer",null);wt(this,"_disposed",!1)}subscribe(tt){return this._disposed?()=>{}:(this._ensureSelectionBridge(),this._listeners.add(tt),()=>{this._listeners.delete(tt)})}getSnapshot(){return this._disposed?this._buildSnapshot():(this._ensureSelectionBridge(),this._snapshot||(this._snapshot=this._buildSnapshot()),this._snapshot)}get context(){return this.assetIds.size||this.lastSelectedAssetId?"asset":this.entityIds.size||this.lastSelectedEntityId?"entity":this._fallbackContext}get entityIds(){var tt;return new Set(Array.from(((tt=this.root.sceneUIStore)==null?void 0:tt.selectedKeys)??[]))}get assetIds(){var tt;return new Set(((tt=this.root.assetUIStore)==null?void 0:tt.pickedAssets)??[])}get lastSelectedEntityId(){var tt;return((tt=this.root.sceneUIStore)==null?void 0:tt.lastSelectedId)??null}get lastSelectedAssetId(){var tt;return((tt=this.root.assetUIStore)==null?void 0:tt.selectedAssetId)??null}_buildSnapshot(){return{context:this.context,entityIds:Array.from(this.entityIds),assetIds:Array.from(this.assetIds),lastSelectedEntityId:this.lastSelectedEntityId,lastSelectedAssetId:this.lastSelectedAssetId}}_notify(){this._snapshot=null,this._logger.info("_notify",{listeners:this._listeners.size,lastEntityId:this.lastSelectedEntityId});for(const tt of this._listeners)tt()}_ensureSelectionBridge(){this._disposed||this._sceneDisposer||(this.root.sceneUIStore&&(this._sceneDisposer=this.root.sceneUIStore.onSelectionChange(()=>this._notify())),this.root.assetUIStore&&(this._assetDisposer=this.root.assetUIStore.onSelectionChange(()=>this._notify())))}_disposeSelectionBridge(){var tt,et;(tt=this._sceneDisposer)==null||tt.call(this),(et=this._assetDisposer)==null||et.call(this),this._sceneDisposer=null,this._assetDisposer=null}dispose(){this._disposed||(this._disposed=!0,this._listeners.clear(),this._snapshot=null,this._disposeSelectionBridge())}get selectedEntities(){return this.root.sceneStore?Array.from(this.entityIds).map(tt=>this.root.sceneStore.entities.get(tt)).filter(Boolean):[]}get selectedAssets(){return this.root.assetStore?Array.from(this.assetIds).map(tt=>this.root.assetStore.assets[tt]).filter(Boolean):[]}get lastSelectedEntity(){return!this.lastSelectedEntityId||!this.root.sceneStore?null:this.root.sceneStore.entities.get(this.lastSelectedEntityId)??null}get selectedEntityReadModels(){return this.root.readModelStore?Array.from(this.entityIds).map(tt=>this.root.readModelStore.getEntity(tt)).filter(tt=>tt!==void 0):[]}get lastSelectedEntityReadModel(){return!this.lastSelectedEntityId||!this.root.readModelStore?null:this.root.readModelStore.getEntity(this.lastSelectedEntityId)??null}get lastSelectedAsset(){return!this.lastSelectedAssetId||!this.root.assetStore?null:this.root.assetStore.assets[this.lastSelectedAssetId]??null}selectEntity(tt,et=!1){var rt;this._fallbackContext="entity",typeof((rt=this.root.sceneStore)==null?void 0:rt.selectEntity)=="function"?this.root.sceneStore.selectEntity(tt,et):this.root.sceneUIStore&&(et||this.root.sceneUIStore.clearSelection(),this.root.sceneUIStore.selectEntity(tt,!0))}deselectEntity(tt){var et;(et=this.root.sceneUIStore)==null||et.deselectEntity(tt)}selectAsset(tt,et=!1){var rt,it,ot,at,st;if(this._fallbackContext="asset",et){const ct=[...((rt=this.root.assetUIStore)==null?void 0:rt.pickedAssets)??[]];ct.includes(tt)||ct.push(tt),(ot=(it=this.root.assetStore)==null?void 0:it.selectAsset)==null||ot.call(it,ct);return}(st=(at=this.root.assetStore)==null?void 0:at.selectAsset)==null||st.call(at,tt)}deselectAsset(tt){if(!this.root.assetUIStore)return;const et=this.root.assetUIStore.pickedAssets.filter(it=>it!==tt),rt=this.root.assetUIStore.selectedAssetId===tt?et.at(-1)??null:this.root.assetUIStore.selectedAssetId;this.root.assetUIStore.setSelection(et,rt)}clearSelection(){var tt,et;(tt=this.root.sceneUIStore)==null||tt.clearSelection(),(et=this.root.assetUIStore)==null||et.clearSelect(),this._fallbackContext="scene",this._notify()}setContext(tt){this._fallbackContext=tt,this._notify()}}class EditorError extends Error{constructor(_e,tt,et,rt,it){super(rt),this.domain=_e,this.severity=tt,this.code=et,this.details=it,this.name="EditorError"}}var ProjectionErrorCode=(nt=>(nt.PARENT_NOT_FOUND="PROJECTION_PARENT_NOT_FOUND",nt.ENTITY_NOT_FOUND="PROJECTION_ENTITY_NOT_FOUND",nt.ROLLBACK_FAILED="PROJECTION_ROLLBACK_FAILED",nt.REBUILD_FAILED="PROJECTION_REBUILD_FAILED",nt))(ProjectionErrorCode||{});class ProjectionError extends EditorError{constructor(_e,tt,et){super("projection","recoverable",_e,tt,et),this.name="ProjectionError"}}var EffectsErrorCode=(nt=>(nt.DELETE_FAILED="EFFECTS_DELETE_FAILED",nt.CREATE_FAILED="EFFECTS_CREATE_FAILED",nt.UPDATE_FAILED="EFFECTS_UPDATE_FAILED",nt))(EffectsErrorCode||{});class EffectsError extends EditorError{constructor(_e,tt,et){super("effects","warning",_e,tt,et),this.name="EffectsError"}}const defaultComponentFactory=()=>null;function assertNeverEvent$2(nt){throw new Error(`EngineProjection: unhandled event ${nt.type}`)}class EngineProjection{constructor(_e,tt,et){wt(this,"entityMap",new Map);wt(this,"entityReverseMap",new WeakMap);wt(this,"componentMap",new Map);wt(this,"assetMap",new Map);wt(this,"externalEntityIds",new Set);wt(this,"graveyardEntities",new Map);wt(this,"graveyardComponents",new Map);wt(this,"componentFactory");wt(this,"assetResolver",null);wt(this,"_canRedo");this._scene=_e,this.componentFactory=tt??defaultComponentFactory,this._canRedo=et??(()=>!1)}get scene(){return this._scene}setComponentFactory(_e){this.componentFactory=_e}flushDeferredComponentProps(){var _e,tt;(tt=(_e=this.componentFactory).flushDeferred)==null||tt.call(_e)}rebindAssetReferences(_e){var tt,et,rt,it;(et=(tt=this.componentFactory).rebindAssetReferences)==null||et.call(tt,_e),(it=(rt=this.componentFactory).flushDeferred)==null||it.call(rt)}setAssetResolver(_e){this.assetResolver=_e}resolveRef(_e){if(_e==null||typeof _e!="object"||!("refId"in _e))return _e;if(!this.assetResolver)return;const tt=_e,et=tt.key?`${tt.refId}-${tt.key}`:tt.refId,rt=this.assetResolver(et);return rt!==null?rt:void 0}setScene(_e){if(this._scene===_e)return;this._scene=_e;const tt=[];for(const et of this.entityMap.values())et.parent||tt.push(et);for(const et of tt)_e.addRootEntity(et)}apply(_e,tt){tt&&!isUndoRedoCommand(tt)&&!this._canRedo()&&this.clearGraveyard(),_e!=null&&_e.length&&this.applyEvents(_e)}applyEvents(_e){for(const tt of _e)switch(tt.type){case"EntityCreated":this.createEngineEntity(tt.entityId,tt.entity);break;case"EntityUpdated":this.applyEntityUpdatedEvent(tt);break;case"EntityMoved":this.applyEntityMovedEvent(tt);break;case"EntityDeleted":this.applyEntityDeletedEvent(tt);break;case"ComponentAdded":this.applyComponentAddedEvent(tt);break;case"ComponentUpdated":this.applyComponentUpdatedEvent(tt);break;case"ComponentRemoved":this.destroyEngineComponent(tt.componentId);break;case"SceneSettingUpdated":this.applySceneSettingEvent(tt.settingPath,tt.value);break;case"AssetCreated":this.assetMap.set(tt.assetId,tt.asset);break;case"AssetUpdated":this.applyAssetUpdatedEvent(tt);break;case"AssetDeleted":this.assetMap.delete(tt.assetId);break;case"PrefabBindingCreated":case"PrefabBindingRemoved":case"PrefabBindingRebased":case"PrefabOverrideChanged":break;default:assertNeverEvent$2(tt)}}applyEntityUpdatedEvent(_e){const tt=this.entityMap.get(_e.entityId);if(!tt)return;const{changes:et}=_e;if(et.name!==void 0&&(tt.name=et.name),et.isActive!==void 0&&(tt.isActive=et.isActive),et.layer!==void 0&&(tt.layer=et.layer),et.transform){const rt=et.transform;rt.position&&this.updateTransformProperty(tt,["position"],{x:rt.position.x??tt.transform.position.x,y:rt.position.y??tt.transform.position.y,z:rt.position.z??tt.transform.position.z}),rt.rotation&&this.updateTransformProperty(tt,["rotation"],{x:rt.rotation.x??tt.transform.rotation.x,y:rt.rotation.y??tt.transform.rotation.y,z:rt.rotation.z??tt.transform.rotation.z}),rt.scale&&this.updateTransformProperty(tt,["scale"],{x:rt.scale.x??tt.transform.scale.x,y:rt.scale.y??tt.transform.scale.y,z:rt.scale.z??tt.transform.scale.z})}}applyEntityMovedEvent(_e){const tt=this.entityMap.get(_e.entityId);tt&&(this.reparentEntity(tt,_e.parentId),tt.siblingIndex=_e.index)}applyEntityDeletedEvent(_e){for(const tt of[..._e.subtreeIds].reverse())this.destroyEngineEntity(tt)}applyComponentAddedEvent(_e){const tt=this.entityMap.get(_e.entityId);tt&&this.createEngineComponent(tt,_e.componentId,_e.component)}applyComponentUpdatedEvent(_e){for(const[tt,et]of Object.entries(_e.changes))this.updateComponentProperty(_e.componentId,tt,et)}applyAssetUpdatedEvent(_e){this.assetMap.set(_e.assetId,_e.asset);const tt=_e.previousAsset.meta??{},et=_e.asset.meta??{},rt=new Set([...Object.keys(tt),...Object.keys(et)]);for(const it of rt){const ot=tt[it],at=et[it];JSON.stringify(ot)!==JSON.stringify(at)&&this.projectAssetMetaToEngine(_e.assetId,it,at)}}createEngineEntity(_e,tt){const et=this.graveyardEntities.get(_e);et&&(this.entityMap.set(_e,et),this.entityReverseMap.set(et,_e),this.externalEntityIds.add(_e),this.graveyardEntities.delete(_e));const rt=this.resolveParentEntity(_e,tt.parentId),it=this.entityMap.get(_e);if(it){if(this.externalEntityIds.has(_e)){const at=it;at.__editorExternalComponentClaimRevision=(at.__editorExternalComponentClaimRevision??0)+1}if(rt)it.parent!==rt&&rt.addChild(it);else{const at=!!it.parent;at&&(it.parent=null),(at||!it.scene||it.scene!==this.scene)&&this.scene.addRootEntity(it)}if(this.applyEntityState(it,tt),tt.components)for(const[at,st]of Object.entries(tt.components))this.componentMap.has(at)||this.createEngineComponent(it,at,st);return}const ot=rt?rt.createChild(tt.name):this.scene.createRootEntity(tt.name);if(this.applyEntityState(ot,tt),this.entityMap.set(_e,ot),this.entityReverseMap.set(ot,_e),tt.components)for(const[at,st]of Object.entries(tt.components))this.createEngineComponent(ot,at,st)}resolveParentEntity(_e,tt){if(!tt)return null;const et=this.entityMap.get(tt);if(!et)throw new ProjectionError(ProjectionErrorCode.PARENT_NOT_FOUND,`EngineProjection: parent entity "${tt}" not found when creating "${_e}".`,{entityId:_e,parentId:tt});return et}applyEntityState(_e,tt){_e.name=tt.name,_e.isActive=tt.isActive,_e.layer=tt.layer;const{position:et,rotation:rt,scale:it}=tt.transform;_e.transform.position.set(et.x,et.y,et.z),_e.transform.rotation.set(rt.x,rt.y,rt.z),_e.transform.scale.set(it.x,it.y,it.z)}destroyEngineEntity(_e){var rt,it;const tt=this.entityMap.get(_e);if(!tt)return;const et=this.externalEntityIds.has(_e);for(const[ot,at]of this.componentMap)at.entity===tt&&((it=(rt=this.componentFactory).forgetComponentAssetReferences)==null||it.call(rt,at),et&&this.addToGraveyard(_e,ot,at),this.componentMap.delete(ot));if(et)tt.parent=null,tt.scene===this.scene&&this.scene.removeRootEntity(tt),this.graveyardEntities.set(_e,tt);else try{tt.destroy()}catch(ot){console.warn("[EngineProjection] destroyEngineEntity failed:",ot)}this.entityMap.delete(_e),this.externalEntityIds.delete(_e),tt&&this.entityReverseMap.delete(tt)}createEngineComponent(_e,tt,et){var ot,at;const rt=this.findEntityId(_e);if(rt){const st=this.graveyardComponents.get(rt);if(st!=null&&st.has(tt)){const ct=st.get(tt);ct.__editorComponentType=et.type;for(const[ut,dt]of Object.entries(et.props))(at=(ot=this.componentFactory).trackAssetReference)==null||at.call(ot,ct,et.type,ut,dt);this.componentMap.set(tt,ct),st.delete(tt),st.size===0&&this.graveyardComponents.delete(rt);return}}const it=this.componentFactory(_e,et.type,et.props);it&&(it.__editorComponentType=et.type,this.componentMap.set(tt,it))}findEntityId(_e){return this.entityReverseMap.get(_e)}destroyEngineComponent(_e){var rt,it;const tt=this.componentMap.get(_e);if(!tt)return;(it=(rt=this.componentFactory).forgetComponentAssetReferences)==null||it.call(rt,tt);const et=this.findEntityId(tt.entity);if(et&&this.externalEntityIds.has(et)){this.addToGraveyard(et,_e,tt),this.componentMap.delete(_e);return}tt.destroy(),this.componentMap.delete(_e)}addToGraveyard(_e,tt,et){let rt=this.graveyardComponents.get(_e);rt||(rt=new Map,this.graveyardComponents.set(_e,rt)),rt.set(tt,et)}clearGraveyard(){if(!(this.graveyardEntities.size===0&&this.graveyardComponents.size===0)){for(const _e of this.graveyardEntities.values())try{_e.destroy()}catch{}for(const _e of this.graveyardComponents.values())for(const tt of _e.values())try{tt.destroy()}catch{}this.graveyardEntities.clear(),this.graveyardComponents.clear()}}updateComponentProperty(_e,tt,et){var st,ct,ut,dt,ht;const rt=this.componentMap.get(_e);if(!rt)return;const it=rt.__editorComponentType;it&&((ct=(st=this.componentFactory).trackAssetReference)==null||ct.call(st,rt,it,tt,et));const ot=et===void 0?void 0:this.resolveRef(et);if(et!==void 0&&ot===void 0)return;const at=it?(ht=(dt=(ut=this.componentFactory).getProxyMap)==null?void 0:dt.call(ut,it))==null?void 0:ht[tt]:void 0;if(at&&typeof rt[at]=="function"){rt[at](ot);return}if(tt in rt)try{rt[tt]=ot}catch{}}reparentEntity(_e,tt){if(tt){const et=this.entityMap.get(tt);if(!et)throw new ProjectionError(ProjectionErrorCode.PARENT_NOT_FOUND,`EngineProjection: new parent "${tt}" not found for reparent.`,{parentId:tt});_e.parent=et}else _e.parent=null,this.scene.addRootEntity(_e)}updateTransformProperty(_e,tt,et){if(tt.length===0){const at=et;_e.transform.position.set(at.position.x,at.position.y,at.position.z),_e.transform.rotation.set(at.rotation.x,at.rotation.y,at.rotation.z),_e.transform.scale.set(at.scale.x,at.scale.y,at.scale.z);return}if(tt.length===1){const[at]=tt,st=et;_e.transform[at].set(st.x,st.y,st.z);return}const[rt,it]=tt,ot=_e.transform[rt];if(ot&&it in ot){const at={x:ot.x,y:ot.y,z:ot.z};at[it]=et,ot.set(at.x,at.y,at.z)}}projectAssetMetaToEngine(_e,tt,et){if(!this.assetResolver)return;const rt=this.assetResolver(_e);if(!(!rt||typeof rt!="object")&&tt in rt)try{rt[tt]=et}catch{}}applySceneSettingEvent(_e,tt){const et=_e.split("/");et.length<2||this.applySceneSetting(et[0],et[1],tt)}applySceneSetting(_e,tt,et){const rt=this._scene,it=getSceneSettingDefinition(_e,tt);it!=null&&it.runtimeTarget&&this.applySceneSettingByTarget(rt,it.runtimeTarget,et)}applySceneSettingByTarget(_e,tt,et){const rt=this.resolveSceneSettingTarget(_e,tt.scope);if(rt)switch(tt.valueKind){case"direct":rt[tt.key]=et;return;case"structured":this.applyStructuredValue(rt,tt.key,et);return;case"assetRef":this.applyAssetReferenceValue(rt,tt.key,et);return}}resolveSceneSettingTarget(_e,tt){switch(tt){case"scene":return _e;case"ambientLight":return _e.ambientLight??null;case"background":return _e.background??null;case"background.sky":{const et=_e.background;return(et==null?void 0:et.sky)??null}case"ambientOcclusion":return _e.ambientOcclusion??null}}applyAssetReferenceValue(_e,tt,et){if(et==null){_e[tt]=et;return}const rt=this.resolveRef(et);rt!==void 0&&(_e[tt]=rt)}applyStructuredValue(_e,tt,et){if(!et||typeof et!="object"){_e[tt]=et;return}const rt=_e[tt];if(rt&&typeof rt=="object"&&"set"in rt){const it=rt.set,ot=et;"r"in ot?it.call(rt,ot.r,ot.g,ot.b,ot.a):"x"in ot&&it.call(rt,ot.x,ot.y,ot.z)}else _e[tt]=et}checkHealth(_e){const tt=new Set(Object.keys(_e.entities)),et=new Set(this.entityMap.keys()),rt=new Set(Object.keys(_e.assets)),it=new Set(this.assetMap.keys()),ot=Array.from(tt).filter(ut=>!et.has(ut)),at=Array.from(et).filter(ut=>!tt.has(ut)),st=Array.from(rt).filter(ut=>!it.has(ut)),ct=Array.from(it).filter(ut=>!rt.has(ut));return ot.sort(),at.sort(),st.sort(),ct.sort(),{healthy:ot.length===0&&at.length===0&&st.length===0&&ct.length===0,missingInEngine:ot,orphanInEngine:at,missingAssets:st,orphanAssets:ct}}getEntity(_e){return this.entityMap.get(_e)}getAsset(_e){return this.assetMap.get(_e)}getComponent(_e){return this.componentMap.get(_e)}setEntityRuntimeActive(_e,tt){const et=this.entityMap.get(_e);et&&(et.isActive=tt)}addEntityChild(_e,tt,et){const rt=this.entityMap.get(_e),it=this.entityMap.get(tt);rt&&it&&(et!==void 0?rt.addChild(et,it):rt.addChild(it))}removeEntityChild(_e,tt){const et=this.entityMap.get(_e),rt=this.entityMap.get(tt);et&&rt&&et.removeChild(rt)}getEntityIdByEngineObject(_e){return this.entityReverseMap.get(_e)}registerExternalEntity(_e,tt){this.entityMap.set(_e,tt),this.entityReverseMap.set(tt,_e),this.externalEntityIds.add(_e),tt.__editorExternalEntity=!0}reset(){var tt,et;for(const rt of this.componentMap.values()){const it=this.findEntityId(rt.entity);if(!(it&&this.externalEntityIds.has(it)))try{rt.destroy()}catch{}}this.componentMap.clear();const _e=new Map;for(const[rt,it]of this.entityMap){if(this.externalEntityIds.has(rt)){_e.set(rt,it);continue}try{it.destroy()}catch{}}this.entityMap=_e;for(const rt of this.graveyardEntities.values())try{rt.destroy()}catch{}this.graveyardEntities.clear(),this.graveyardComponents.clear(),this.assetMap.clear(),(et=(tt=this.componentFactory).clearAssetReferenceTracking)==null||et.call(tt)}rebuildFromState(_e){this.reset();const tt=new Set,et=rt=>{if(tt.has(rt))return;const it=_e.entities[rt];it&&(it.parentId&&!tt.has(it.parentId)&&et(it.parentId),this.createEngineEntity(rt,it),tt.add(rt))};for(const rt of _e.scene.rootEntityIds)et(rt);for(const rt of Object.keys(_e.entities))et(rt);for(const[rt,it]of Object.entries(_e.assets))this.assetMap.set(rt,it)}}function assertNeverEvent$1(nt){throw new Error(`EntityModelProjection: unhandled event ${nt.type}`)}class EntityModelProjection{constructor(_e,tt){wt(this,"_logger",new TraceLogger("EntityModelProjection"));this._getScene=_e,this._getEP=tt}apply(_e,tt){const et=this._getScene();et&&_e!=null&&_e.length&&this._applyEvents(_e,tt,et)}_applyEvents(_e,tt,et){for(const rt of _e)switch(rt.type){case"EntityCreated":this._handleEntityCreatedEvent(rt,et);break;case"EntityDeleted":for(const it of rt.subtreeIds)et.entities.delete(it);break;case"EntityUpdated":this._handleEntityUpdatedEvent(rt,tt,et);break;case"ComponentAdded":this._applyComponentAdd(rt.entityId,rt.componentId,rt.component,et);break;case"ComponentUpdated":this._handleComponentUpdatedEvent(rt,et);break;case"ComponentRemoved":this._handleComponentRemovedEvent(rt.entityId,rt.componentId,et);break;case"EntityMoved":case"SceneSettingUpdated":case"AssetCreated":case"AssetUpdated":case"AssetDeleted":case"PrefabBindingCreated":case"PrefabBindingRemoved":case"PrefabBindingRebased":case"PrefabOverrideChanged":break;default:assertNeverEvent$1(rt)}}_handleEntityCreatedEvent(_e,tt){var ot,at;const et=tt.entities.get(_e.entityId);if(et){this._logger.info("EntityCreated re-set existing",{entityId:_e.entityId}),tt.entities.set(_e.entityId,et),_e.entity.parentId&&tt.addEntityToParent&&tt.addEntityToParent(et,_e.entity.parentId);return}if(!tt.createEntity)return;this._logger.info("EntityCreated createEntity",{entityId:_e.entityId,name:_e.entity.name});const rt=tt.createEntity(_e.entity.name,_e.entityId);rt&&_e.entity.parentId&&tt.addEntityToParent&&tt.addEntityToParent(rt,_e.entity.parentId);const it=(ot=this._getEP())==null?void 0:ot.getEntity(_e.entityId);rt&&it&&((at=rt.initImmediate)==null||at.call(rt,it))}_handleEntityUpdatedEvent(_e,tt,et){var it,ot,at,st;const rt=et.entities.get(_e.entityId);rt&&((it=rt.invalidateFromDomain)==null||it.call(rt),_e.changes.isLocked!==void 0&&((ot=rt.applyLockedFromDomain)==null||ot.call(rt,_e.changes.isLocked)),_e.changes.transform&&!tt.has(_e.entityId)&&((st=(at=rt.transform)==null?void 0:at.syncEngineToEditor)==null||st.call(at)))}_applyComponentAdd(_e,tt,et,rt){const it=rt.entities.get(_e);it&&this._addComponentToModel(it,tt,et)}_handleComponentRemovedEvent(_e,tt,et){const rt=et.entities.get(_e);rt&&this._removeComponentFromModel(rt,tt)}_handleComponentUpdatedEvent(_e,tt){var it,ot;const et=tt.entities.get(_e.entityId);if(!et)return;const rt=(it=et.components)==null?void 0:it.find(at=>at.id===_e.componentId);if(rt)for(const[at,st]of Object.entries(_e.changes))(ot=rt.applyPropertyFromDomain)==null||ot.call(rt,at,st)}_addComponentToModel(_e,tt,et){var it,ot,at;const rt=(it=_e.getComponentByTypeName)==null?void 0:it.call(_e,et.type);rt&&rt.id!==tt&&((ot=_e.removeComponentFromDomain)==null||ot.call(_e,rt.id)),(at=_e.addComponentFromDomain)==null||at.call(_e,tt,et)}_removeComponentFromModel(_e,tt){var et;(et=_e.removeComponentFromDomain)==null||et.call(_e,tt)}}function assertNeverEvent(nt){throw new Error(`RuntimeProjection: unhandled event ${nt.type}`)}class RuntimeEntityCache{constructor(){wt(this,"_models",new Map)}stash(_e,tt){this._models.set(_e,tt)}restore(_e){const tt=this._models.get(_e);return tt&&this._models.delete(_e),tt}clear(){this._models.clear()}}const NOOP_RUNTIME_BINDER_REGISTRY={detachEntityBinder:()=>{},restoreEntityBinder:()=>null,clearDetachedEntityBinders:()=>{}};class RuntimeProjection{constructor(_e,tt,et=NOOP_RUNTIME_BINDER_REGISTRY,rt=()=>!1){wt(this,"_entityCache",new RuntimeEntityCache);wt(this,"_logger",new TraceLogger("RuntimeProjection"));this._getScene=_e,this._getEP=tt,this._runtimeBinderRegistry=et,this._canRedo=rt}apply(_e,tt){const et=this._getScene(),rt=new Set;if(!et)return rt;const it=isUndoRedoCommand(tt);!it&&!this._canRedo()&&(this._entityCache.clear(),this._runtimeBinderRegistry.clearDetachedEntityBinders());const ot=it?this._getEP():null;if(!(_e!=null&&_e.length))return rt;for(const at of _e)switch(at.type){case"EntityCreated":this._handleEntityCreated(at.entityId,at.entity,et,it,ot,rt);break;case"EntityDeleted":for(const st of[...at.subtreeIds].reverse())this._handleEntityDeleted(st,et);break;case"EntityUpdated":case"EntityMoved":case"ComponentAdded":case"ComponentUpdated":case"ComponentRemoved":case"SceneSettingUpdated":case"AssetCreated":case"AssetUpdated":case"AssetDeleted":case"PrefabBindingCreated":case"PrefabBindingRemoved":case"PrefabBindingRebased":case"PrefabOverrideChanged":break;default:assertNeverEvent(at)}return rt}reset(){this._entityCache.clear(),this._runtimeBinderRegistry.clearDetachedEntityBinders()}_handleEntityCreated(_e,tt,et,rt,it,ot){rt&&this._restoreOrMaterialize(_e,tt,et,it,ot)}_handleEntityDeleted(_e,tt){this._stashAndDetach(_e,tt)}_stashAndDetach(_e,tt){const et=tt.entities.get(_e);et&&(this._entityCache.stash(_e,et),this._runtimeBinderRegistry.detachEntityBinder(_e)),tt.entities.delete(_e)}_restoreOrMaterialize(_e,tt,et,rt,it){var ct,ut,dt,ht;if(et.entities.has(_e))return;const ot=this._entityCache.restore(_e);if(ot){this._runtimeBinderRegistry.restoreEntityBinder(_e),et.entities.set(_e,ot),rt&&this._rebindRestoredEntity(ot,rt),(ct=ot.applyLockedFromDomain)==null||ct.call(ot,tt.isLocked??!1),it.add(_e);return}this._runtimeBinderRegistry.restoreEntityBinder(_e);const at=rt==null?void 0:rt.getEntity(_e);if(!at){this._logger.warn("Skip cache-miss runtime restore: engine entity not found",{entityId:_e});return}if(!et.createEntity){this._logger.warn("Skip cache-miss runtime restore: scene.createEntity unavailable",{entityId:_e});return}const st=et.createEntity(tt.name,_e);if(this._hydrateCacheMissModel(st,tt),(ut=st.initImmediate)==null||ut.call(st,at),tt.components)for(const[ft,pt]of Object.entries(tt.components))(dt=st.addComponentFromDomain)==null||dt.call(st,ft,pt);(ht=st.applyLockedFromDomain)==null||ht.call(st,tt.isLocked??!1),it.add(_e)}_rebindRestoredEntity(_e,tt){var rt,it;const et=tt.getEntity(_e.id);if(et&&((rt=_e.bindEngineObject)==null||rt.call(_e,et,!1),_e.transform)){const ot=_e.transform;ot._engineObject=et.transform,(it=ot.syncEngineToEditor)==null||it.call(ot)}}_hydrateCacheMissModel(_e,tt){_e.name=tt.name,_e.isActive=tt.isActive??!0}}class UIProjection{constructor(_e,tt){wt(this,"_logger",new TraceLogger("UIProjection"));wt(this,"unsubscribe",null);wt(this,"assetStore",null);wt(this,"_sceneStore",null);wt(this,"prefabOverrideBucketCounts",new Map);wt(this,"contentApplier",null);wt(this,"pendingContentReplayByAssetId",new Map);this.readModelStore=tt,this.rebuildFromState(_e.state),this.unsubscribe=_e.subscribe((et,rt)=>{var it;if(et.commandName==="reset"){this.rebuildFromState(rt);return}(it=et.events)!=null&&it.length&&this.applyEvents(et.events,rt)})}setContentApplier(_e){this.contentApplier=_e}async awaitContentReplay(_e){const tt=this.pendingContentReplayByAssetId.get(_e);if(tt)try{await tt}catch{}}setAssetStore(_e){this.assetStore=_e}setSceneStore(_e){this._sceneStore=_e}warnDev(_e,tt){this._logger.warn(_e,tt)}cloneSerializable(_e){if(_e==null)return _e;try{return structuredClone(_e)}catch{return JSON.parse(JSON.stringify(_e))}}dispose(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null),this.assetStore=null,this._sceneStore=null,this.contentApplier=null,this.prefabOverrideBucketCounts.clear(),this.pendingContentReplayByAssetId.clear()}rebuildFromState(_e){var rt,it;this.readModelStore.beginBatch(),this.readModelStore.clear(),this.prefabOverrideBucketCounts.clear();for(const[ot,at]of Object.entries(_e.entities)){const st=this.createEntityReadModel(ot,at);this.readModelStore.setEntity(ot,st)}const tt=new Map,et=[];for(const[ot,at]of Object.entries(_e.assets)){const st=this.createAssetReadModel(ot,at);if(this.readModelStore.setAsset(ot,st),this.assetStore&&!this.assetStore.assets[ot]&&((it=(rt=this.assetStore).createEditorAssetFromState)==null||it.call(rt,ot,at)),at.parentFolderId){const ct=tt.get(at.parentFolderId)??[];ct.push(ot),tt.set(at.parentFolderId,ct)}else et.push(ot)}for(const[ot,at]of tt)this.readModelStore.setFolderChildren(ot,at);if(this.readModelStore.setRootAssetIds(et),this.readModelStore.setScene({rootEntityIds:[..._e.scene.rootEntityIds]}),_e.prefab){for(const[ot,at]of Object.entries(_e.prefab.bindings))this.setPrefabBindingReadModel(ot,at);for(const[ot,at]of Object.entries(_e.prefab.byAssetId))this.readModelStore.setAssetBindingIds(ot,[...at])}this.readModelStore.endBatch()}applyEvents(_e,tt){for(const et of _e)switch(et.type){case"EntityCreated":this._logger.info("EntityCreated",{entityId:et.entityId,parentId:et.parentId}),this.refreshEntityFromState(et.entityId,tt),et.parentId&&this.refreshEntityFromState(et.parentId,tt),this.refreshSceneFromState(tt);break;case"EntityUpdated":this.refreshEntityFromState(et.entityId,tt);break;case"EntityMoved":this.refreshEntityFromState(et.entityId,tt),et.previousParentId&&this.refreshEntityFromState(et.previousParentId,tt),et.parentId&&et.parentId!==et.previousParentId&&this.refreshEntityFromState(et.parentId,tt),this.refreshSceneFromState(tt);break;case"EntityDeleted":for(const rt of et.subtreeIds)this.readModelStore.deleteEntity(rt);et.snapshot.parentId&&this.refreshEntityFromState(et.snapshot.parentId,tt),this.refreshSceneFromState(tt);break;case"ComponentAdded":case"ComponentUpdated":case"ComponentRemoved":this.refreshEntityFromState(et.entityId,tt);break;case"SceneSettingUpdated":this.applySceneSettingValueToStore(et.settingPath,et.value);break;case"AssetCreated":this.applyAssetCreatedEvent(et);break;case"AssetUpdated":this.applyAssetUpdatedEvent(et);break;case"AssetDeleted":this.applyAssetDeletedEvent(et);break;case"PrefabBindingCreated":case"PrefabBindingRebased":this.refreshPrefabBindingFromState(et.bindingId,tt),this.refreshAssetBindingIdsFromState(et.assetId,tt);break;case"PrefabOverrideChanged":{const rt=tt.prefab.bindings[et.bindingId];rt?this.readModelStore.prefabBindings.get(et.bindingId)?this.updatePrefabBindingOverrideCount(et.bindingId,rt,et.bucket):this.setPrefabBindingReadModel(et.bindingId,rt):this.refreshPrefabBindingFromState(et.bindingId,tt),this.refreshAssetBindingIdsFromState(et.assetId,tt);break}case"PrefabBindingRemoved":this.refreshPrefabBindingFromState(et.bindingId,tt),this.refreshAssetBindingIdsFromState(et.assetId,tt);break;default:return et}}refreshEntityFromState(_e,tt){const et=tt.entities[_e];if(!et){this.readModelStore.deleteEntity(_e);return}this.readModelStore.setEntity(_e,this.createEntityReadModel(_e,et))}refreshSceneFromState(_e){this.readModelStore.setScene({rootEntityIds:[..._e.scene.rootEntityIds]})}refreshPrefabBindingFromState(_e,tt){const et=tt.prefab.bindings[_e];et?this.setPrefabBindingReadModel(_e,et):(this.prefabOverrideBucketCounts.delete(_e),this.readModelStore.deletePrefabBinding(_e))}refreshAssetBindingIdsFromState(_e,tt){const et=tt.prefab.byAssetId[_e];this.readModelStore.setAssetBindingIds(_e,et?[...et]:[])}replayAssetContent(_e,tt,et,rt){if(this.contentApplier)try{const it=this.contentApplier(_e,tt,et);if(it&&typeof it.then=="function"){const ot=Promise.resolve(it).catch(at=>{this.warnDev(`[UIProjection] contentApplier failed for asset: ${_e}`,{error:at,details:rt})}).finally(()=>{this.pendingContentReplayByAssetId.get(_e)===ot&&this.pendingContentReplayByAssetId.delete(_e)});this.pendingContentReplayByAssetId.set(_e,ot)}else this.pendingContentReplayByAssetId.delete(_e)}catch(it){this.warnDev(`[UIProjection] contentApplier threw for asset: ${_e}`,{error:it,details:rt})}}isSerializableEqual(_e,tt){return JSON.stringify(_e)===JSON.stringify(tt)}syncAssetPropsFromSnapshots(_e,tt,et){var it,ot,at;const rt=(it=this.assetStore)==null?void 0:it.assets[_e];if(rt){for(const st of Object.keys(tt??{}))(!et||!(st in et))&&((ot=rt.resetPropertyToDefaultFromDomain)==null||ot.call(rt,st));for(const[st,ct]of Object.entries(et??{}))(!tt||!this.isSerializableEqual(tt[st],ct))&&((at=rt.applyPropertyFromDomain)==null||at.call(rt,st,ct))}}syncAssetStoreFromSnapshots(_e,tt,et){var it,ot,at,st;const rt=(it=this.assetStore)==null?void 0:it.assets[_e];rt&&((!tt||tt.name!==et.name)&&((ot=rt.applyNameFromDomain)==null||ot.call(rt,et.name)),(!tt||tt.parentFolderId!==et.parentFolderId)&&((at=rt.applyParentFolderFromDomain)==null||at.call(rt,et.parentFolderId)),(!tt||!this.isSerializableEqual(tt.meta??{},et.meta??{}))&&((st=rt.applyMetaFromDomain)==null||st.call(rt,{...et.meta??{}})),this.syncAssetPropsFromSnapshots(_e,tt==null?void 0:tt.props,et.props)),(!tt||!this.isSerializableEqual(tt.content,et.content))&&et.content&&this.replayAssetContent(_e,et.type,et.content,{event:"AssetUpdated"})}applyAssetCreatedEvent(_e){var tt,et;this.readModelStore.setAsset(_e.assetId,this.createAssetReadModel(_e.assetId,_e.asset)),this.updateFolderChildrenOnAdd(_e.assetId,_e.asset.parentFolderId),this.assetStore&&(this.assetStore.assets[_e.assetId]?this.syncAssetStoreFromSnapshots(_e.assetId,void 0,_e.asset):(et=(tt=this.assetStore).createEditorAssetFromState)==null||et.call(tt,_e.assetId,_e.asset))}applyAssetUpdatedEvent(_e){this.readModelStore.setAsset(_e.assetId,this.createAssetReadModel(_e.assetId,_e.asset)),_e.previousAsset.parentFolderId!==_e.asset.parentFolderId&&this.updateFolderChildrenOnMove(_e.assetId,_e.previousAsset.parentFolderId,_e.asset.parentFolderId),this.syncAssetStoreFromSnapshots(_e.assetId,_e.previousAsset,_e.asset)}applyAssetDeletedEvent(_e){var tt,et,rt;this.updateFolderChildrenOnRemove(_e.assetId,_e.snapshot.parentFolderId),this.readModelStore.deleteAsset(_e.assetId),(tt=this.assetStore)!=null&&tt.assets[_e.assetId]&&((rt=(et=this.assetStore).deleteEditorAsset)==null||rt.call(et,_e.assetId))}updateFolderChildrenOnAdd(_e,tt){if(tt){const et=this.readModelStore.folderChildren.get(tt)??[];et.includes(_e)||(et.push(_e),this.readModelStore.setFolderChildren(tt,et))}else this.readModelStore.rootAssetIds.includes(_e)||this.readModelStore.rootAssetIds.push(_e)}updateFolderChildrenOnRemove(_e,tt){if(tt){const et=this.readModelStore.folderChildren.get(tt)??[],rt=et.indexOf(_e);rt!==-1&&(et.splice(rt,1),this.readModelStore.setFolderChildren(tt,et))}else{const et=this.readModelStore.rootAssetIds.indexOf(_e);et!==-1&&this.readModelStore.rootAssetIds.splice(et,1)}}updateFolderChildrenOnMove(_e,tt,et){this.updateFolderChildrenOnRemove(_e,tt),this.updateFolderChildrenOnAdd(_e,et)}applySceneSettingValueToStore(_e,tt){var et,rt;(rt=(et=this._sceneStore)==null?void 0:et.applySettingFromDomain)==null||rt.call(et,_e,tt)}measureOverrideBucketCounts(_e){return{entityProps:Object.keys(_e.entityProps).length,componentProps:Object.keys(_e.componentProps).length,removedEntities:Object.keys(_e.removedEntities).length,removedComponents:Object.keys(_e.removedComponents).length,addedEntities:Object.keys(_e.addedEntities).length,addedComponents:Object.keys(_e.addedComponents).length}}sumOverrideBucketCounts(_e){return _e.entityProps+_e.componentProps+_e.removedEntities+_e.removedComponents+_e.addedEntities+_e.addedComponents}setPrefabBindingReadModel(_e,tt){const et=this.measureOverrideBucketCounts(tt.overrides);this.prefabOverrideBucketCounts.set(_e,et),this.readModelStore.setPrefabBinding(_e,{id:_e,assetId:tt.assetId,assetKind:tt.assetKind,instanceRootEntityId:tt.instanceRootEntityId,sourceRevision:tt.sourceRevision,overrideCount:this.sumOverrideBucketCounts(et)})}updatePrefabBindingOverrideCount(_e,tt,et){const rt=this.readModelStore.prefabBindings.get(_e);if(!rt)return;const it=this.prefabOverrideBucketCounts.get(_e)??this.measureOverrideBucketCounts(tt.overrides),ot=et?{...it,[et]:Object.keys(tt.overrides[et]).length}:this.measureOverrideBucketCounts(tt.overrides);this.prefabOverrideBucketCounts.set(_e,ot),this.readModelStore.setPrefabBinding(_e,{...rt,overrideCount:this.sumOverrideBucketCounts(ot)})}createEntityReadModel(_e,tt){var rt;const et=new Map;for(const[it,ot]of Object.entries(tt.components))et.set(it,{id:it,type:ot.type,enabled:((rt=ot.props)==null?void 0:rt.enabled)??!0,props:{...ot.props}});return{id:_e,name:tt.name,isActive:tt.isActive,layer:tt.layer??0,isLocked:tt.isLocked??!1,parentId:tt.parentId,children:[...tt.children],isStripped:tt.isStripped===!0,modifications:this.cloneSerializable(tt.modifications??[]),removedEntities:this.cloneSerializable(tt.removedEntities??[]),removedComponents:this.cloneSerializable(tt.removedComponents??[]),transform:{position:{...tt.transform.position},rotation:{...tt.transform.rotation},scale:{...tt.transform.scale}},components:et,instance:tt.instance??null,instanceRef:this.resolveEntityInstanceRef(tt)}}resolveEntityInstanceRef(_e){return resolveEntityInstanceRef(_e)}createAssetReadModel(_e,tt){return{id:_e,name:tt.name,type:tt.type,parentFolderId:tt.parentFolderId,url:tt.url,meta:tt.meta?{...tt.meta}:void 0,props:tt.props&&Object.keys(tt.props).length>0?{...tt.props}:void 0,content:tt.content?{...tt.content}:void 0}}}function isNonPojoObject(nt){return!nt||typeof nt!="object"?!1:"constructor"in nt&&nt.constructor!==Object}function isUICanvasRenderCameraReady(nt){if(!nt||typeof nt!="object")return!0;const _e=nt.entity;return _e?!!_e._updateFlagManager:!0}function createComponentFactory(nt){const _e=new WeakMap,tt=[],et=new Map;let rt=new WeakMap;function it(ft){if(!ft||typeof ft!="object"||!("refId"in ft)||typeof ft.refId!="string")return null;const pt=ft;return pt.key?`${pt.refId}-${pt.key}`:pt.refId}function ot(ft,pt){const mt=rt.get(ft),vt=mt==null?void 0:mt.get(pt);if(!vt)return;const _t=it(vt.value);if(_t){const yt=et.get(_t);yt==null||yt.delete(vt),(yt==null?void 0:yt.size)===0&&et.delete(_t)}mt==null||mt.delete(pt),(mt==null?void 0:mt.size)===0&&rt.delete(ft)}function at(ft,pt,mt,vt){ot(ft,mt);const _t=it(vt);if(!_t)return;const yt={component:ft,type:pt,key:mt,value:vt};let bt=rt.get(ft);bt||(bt=new Map,rt.set(ft,bt)),bt.set(mt,yt);let St=et.get(_t);St||(St=new Set,et.set(_t,St)),St.add(yt)}function st(ft,pt){for(let mt=tt.length-1;mt>=0;mt--){const vt=tt[mt];vt.component===ft&&(pt===void 0||vt.key===pt)&&tt.splice(mt,1)}}function ct(ft,pt,mt,vt){var Ct,Et;const _t=getComponentSemantics(pt),yt=(Ct=_t==null?void 0:_t.proxyMap)==null?void 0:Ct[mt],bt=yt&&typeof ft[yt]=="function";if(!!yt&&((Et=_t==null?void 0:_t.methodKeys)==null?void 0:Et.has(mt))&&!yt.startsWith("set")||!(mt in ft)&&!bt||mt in ft&&isNonPojoObject(ft[mt]))return"applied";let xt=vt;if(nt){const At=it(xt);if(At){const Pt=nt(At);if(Pt===null)return"await-asset";isTraceEnabled()&&console.log(`[ComponentFactory] resolved ref ${At} → ${(Pt==null?void 0:Pt.name)??Pt}`),xt=Pt}}if(pt==="UICanvas"&&mt==="renderCamera"&&!isUICanvasRenderCameraReady(xt))return"needs-defer";try{return bt?(isTraceEnabled()&&console.log(`[ComponentFactory] ${pt}.${yt}(${xt})`),ft[yt](xt)):(isTraceEnabled()&&console.log(`[ComponentFactory] ${pt}.${mt} = ${xt}`),ft[mt]=xt),"applied"}catch(At){return console.warn(`[ComponentFactory] Failed to set prop "${mt}" on ${pt}:`,At),"needs-defer"}}function ut(ft){const pt=ft.__editorExternalComponentClaimRevision,mt=typeof pt=="number"?pt:0,vt=_e.get(ft);if(vt&&vt.revision===mt)return vt.components;const _t={revision:mt,components:new Set};return _e.set(ft,_t),_t.components}function dt(ft,pt){var bt;const mt=ut(ft),vt=[],_t=ft;if(_t.getComponents){_t.getComponents(pt,vt);for(const St of vt)if(!mt.has(St))return mt.add(St),St}const yt=((bt=_t.getComponent)==null?void 0:bt.call(_t,pt))??null;return yt&&!mt.has(yt)?(mt.add(yt),yt):null}const ht=(ft,pt,mt)=>{const vt=EditorComponent.getEngineComponent(pt);if(!vt)return console.warn(`[ComponentFactory] Unknown component type: ${pt}`),null;const _t=!!ft.__editorExternalEntity;let yt=null;if(_t){const St=dt(ft,vt);St&&(yt=St)}yt||(yt=ft.addComponent(vt),_t&&ut(ft).add(yt)),isTraceEnabled()&&console.log(`[ComponentFactory] create ${pt} on entity ${ft.name}`);const bt=yt;for(const St of Object.keys(mt)){const xt=mt[St];it(xt)?at(bt,pt,St,xt):ot(bt,St),ct(bt,pt,St,xt)==="needs-defer"&&tt.push({component:bt,type:pt,key:St,value:xt})}return yt};return ht.getProxyMap=ft=>{var pt;return(pt=getComponentSemantics(ft))==null?void 0:pt.proxyMap},ht.flushDeferred=()=>{if(tt.length===0)return;const ft=[];for(let pt=0,mt=tt.length;pt<mt;pt++){const vt=tt[pt];if(vt.type==="UICanvas"&&vt.key==="renderCamera"&&!isUICanvasRenderCameraReady(vt.value)){ft.push(vt);continue}ct(vt.component,vt.type,vt.key,vt.value)!=="applied"&&ft.push(vt)}tt.length=0,tt.push(...ft)},ht.trackAssetReference=(ft,pt,mt,vt)=>{if(it(vt)){at(ft,pt,mt,vt);return}ot(ft,mt)},ht.forgetComponentAssetReferences=ft=>{const pt=rt.get(ft);if(pt)for(const mt of Array.from(pt.keys()))ot(ft,mt);st(ft)},ht.rebindAssetReferences=ft=>{const pt=et.get(ft);if(pt!=null&&pt.size)for(const mt of Array.from(pt))ct(mt.component,mt.type,mt.key,mt.value)==="applied"&&st(mt.component,mt.key)},ht.clearAssetReferenceTracking=()=>{tt.length=0,et.clear(),rt=new WeakMap},ht}function rebindEntityModels(nt,_e){for(const[tt,et]of nt){const rt=_e.getEntity(tt);if(!(!rt||et.engineObject===rt)){et.bindEngineObject(rt,!1);for(const it of et.components){const ot=_e.getComponent(it.id);ot&&it.engineObject!==ot&&(it._engineObject=ot)}}}}class ReadModelStore{constructor(){wt(this,"_logger",new TraceLogger("ReadModelStore"));wt(this,"entities",new Map);wt(this,"assets",new Map);wt(this,"scene",{rootEntityIds:[]});wt(this,"folderChildren",new Map);wt(this,"prefabBindings",new Map);wt(this,"assetBindingIds",new Map);wt(this,"rootAssetIds",[]);wt(this,"_globalListeners",new Set);wt(this,"_entityListeners",new Map);wt(this,"_batching",!1);wt(this,"_batchedEntityIds",new Set)}subscribe(_e){return this._globalListeners.add(_e),()=>this._globalListeners.delete(_e)}subscribeEntity(_e,tt){let et=this._entityListeners.get(_e);return et||(et=new Set,this._entityListeners.set(_e,et)),et.add(tt),()=>{et.delete(tt),et.size===0&&this._entityListeners.delete(_e)}}_notifyGlobal(){if(!this._batching)for(const _e of this._globalListeners)_e()}_notifyEntity(_e){if(this._batching)return;const tt=this._entityListeners.get(_e);if(tt)for(const et of tt)et()}getEntity(_e){return this.entities.get(_e)}getEntityName(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.name)??""}getEntityChildren(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.children)??[]}getEntityParent(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.parentId)??null}getRootEntities(){return this.scene.rootEntityIds.map(_e=>this.entities.get(_e)).filter(_e=>_e!==void 0)}isEntityLocked(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.isLocked)??!1}isEntityActive(_e){var tt;return((tt=this.entities.get(_e))==null?void 0:tt.isActive)??!0}getAsset(_e){return this.assets.get(_e)}getAssetName(_e){var tt;return((tt=this.assets.get(_e))==null?void 0:tt.name)??""}getAssetType(_e){var tt;return((tt=this.assets.get(_e))==null?void 0:tt.type)??""}getFolderChildren(_e){return _e===null?this.rootAssetIds:this.folderChildren.get(_e)??[]}getRootAssets(){return this.rootAssetIds.map(_e=>this.assets.get(_e)).filter(_e=>_e!==void 0)}getComponent(_e,tt){var et;return(et=this.entities.get(_e))==null?void 0:et.components.get(tt)}getComponentsByEntity(_e){const tt=this.entities.get(_e);return tt?Array.from(tt.components.values()):[]}getComponentByType(_e,tt){const et=this.entities.get(_e);if(et){for(const rt of et.components.values())if(rt.type===tt)return rt}}getBindingByEntity(_e){const tt=this.entities.get(_e);if(tt!=null&&tt.instance)return this.prefabBindings.get(tt.instance.bindingId)}getBindingsByAsset(_e){return(this.assetBindingIds.get(_e)??[]).map(et=>this.prefabBindings.get(et)).filter(et=>et!==void 0)}setEntity(_e,tt){if(this._logger.info("setEntity",{id:_e,name:tt.name}),this.entities.set(_e,tt),this._batching){this._batchedEntityIds.add(_e);return}this._notifyEntity(_e),this._notifyGlobal()}deleteEntity(_e){this.entities.delete(_e),this._notifyEntity(_e),this._notifyGlobal()}setAsset(_e,tt){this.assets.set(_e,tt),this._notifyGlobal()}deleteAsset(_e){this.assets.delete(_e),this._notifyGlobal()}setScene(_e){this._logger.info("setScene",{rootEntityIds:_e.rootEntityIds}),this.scene=_e,this._notifyGlobal()}setFolderChildren(_e,tt){this.folderChildren.set(_e,tt),this._notifyGlobal()}setRootAssetIds(_e){this.rootAssetIds=_e,this._notifyGlobal()}setPrefabBinding(_e,tt){this.prefabBindings.set(_e,tt),this._notifyGlobal()}deletePrefabBinding(_e){this.prefabBindings.delete(_e),this._notifyGlobal()}setAssetBindingIds(_e,tt){tt.length===0?this.assetBindingIds.delete(_e):this.assetBindingIds.set(_e,tt),this._notifyGlobal()}beginBatch(){this._batching=!0,this._batchedEntityIds.clear()}endBatch(){this._batching=!1;for(const _e of this._batchedEntityIds)this._notifyEntity(_e);this._batchedEntityIds.clear(),this._notifyGlobal()}clear(){if(this._batching)for(const tt of this.entities.keys())this._batchedEntityIds.add(tt);const _e=this._batching?[]:Array.from(this.entities.keys());if(this.entities.clear(),this.assets.clear(),this.folderChildren.clear(),this.prefabBindings.clear(),this.assetBindingIds.clear(),this.rootAssetIds=[],this.scene={rootEntityIds:[]},!this._batching){for(const tt of _e)this._notifyEntity(tt);this._notifyGlobal()}}}function parseUploadMeta(nt){if(!(typeof nt!="string"||nt.length===0))try{const _e=JSON.parse(nt);if(_e&&typeof _e=="object"&&!Array.isArray(_e))return _e}catch{}}class UploadService{constructor(_e){this.root=_e}async upload(_e){const{file:tt,name:et,projectId:rt,assetId:it,assetType:ot,meta:at,parentFolderId:st,isFBX:ct=!1,onProgress:ut}=_e,dt=await this.root.storage.assets.create({blob:tt,name:et,projectId:rt,uuid:it,type:ot,meta:at,parentId:st,options:{useCache:!ct,onProgress:ut}});return{serverId:dt.id,url:dt.url,meta:parseUploadMeta(dt.meta)}}async uploadAndUpdateState(_e,tt){try{const et=await this.upload(tt);return this.root.assetFacade.markAssetReady(_e,et.serverId,et.url),et}catch(et){throw this.root.assetFacade.markAssetError(_e,et instanceof Error?et.message:String(et)),et}}}function buildCreateAssetRequest(nt){const{assetId:_e,projectId:tt,state:et}=nt;return{blob:null,name:et.name,projectId:tt,uuid:_e,type:et.type==="Folder"?EProjectAssetType.Directory:EProjectAssetType.File,meta:JSON.stringify(et.meta),parentId:et.parentFolderId??void 0,url:et.url}}const so=class so{constructor(_e,tt,et,rt){wt(this,"_sessionToken",0);wt(this,"unsubscribe",null);wt(this,"revisions",new Map);wt(this,"assetChains",new Map);wt(this,"pendingDeletes",[]);wt(this,"workSet",new Set);wt(this,"trackedPersistenceTasks",new WeakSet);wt(this,"_lastError",null);wt(this,"idleResolvers",[]);wt(this,"statusListeners",new Set);this.domainStore=_e,this.projectIdOrGetter=tt,this.api=et,this.onError=rt}start(){this.unsubscribe||(this._sessionToken++,this.unsubscribe=this.domainStore.subscribe(_e=>this.handleTransaction(_e)))}stop(){var _e;this._sessionToken++,(_e=this.unsubscribe)==null||_e.call(this),this.unsubscribe=null,this.assetChains.clear()}get pendingCount(){return this.workSet.size}get lastError(){return this._lastError}clearLastError(){this._lastError&&(this._lastError=null,this.notifyStatusChange())}waitForIdle(){return this.pendingCount===0?Promise.resolve():new Promise(_e=>{this.idleResolvers.push(_e)})}onStatusChange(_e){return this.statusListeners.add(_e),()=>{this.statusListeners.delete(_e)}}trackPersistenceTask(_e,tt){_e&&(this.trackedPersistenceTasks.has(_e)||(this.trackedPersistenceTasks.add(_e),this.runTask((async()=>{try{await _e}catch(et){this.reportError(new EffectsError(EffectsErrorCode.UPDATE_FAILED,"Asset persistence task failed",{...tt,originalError:et}))}})())))}get projectId(){return typeof this.projectIdOrGetter=="function"?this.projectIdOrGetter():this.projectIdOrGetter}handleTransaction(_e){if(_e.commandName==="system"||_e.commandName==="remote"||_e.commandName==="asset.init"||_e.commandName==="reset")return;const tt=this._sessionToken,et=this.projectId,rt=_e.commandName??"",it=rt.startsWith("undo:")||rt==="redo:asset.create"||rt==="asset.copy",ot=new Map;for(const at of _e.operations){const st=this.parsePropertyPath(at.path);if(st&&at.op==="replace"&&"value"in at){const dt=ot.get(st.assetId)??{hasParentId:!1};st.property==="name"?dt.name=at.value:(dt.hasParentId=!0,dt.parentId=at.value),ot.set(st.assetId,dt);continue}const ct=this.extractRootAssetId(at.path);if(!ct)continue;const ut=(this.revisions.get(ct)??0)+1;if(this.revisions.set(ct,ut),at.op==="remove"){const dt=at.oldValue;dt!=null&&dt.serverId&&this.scheduleAssetTask(ct,()=>this.executeDelete([dt.serverId],et),tt)}else if(at.op==="add"&&it&&"value"in at){const dt=at.value;dt.url&&this.scheduleAssetTask(ct,()=>this.handleCreate(ct,dt,ut,et,tt),tt)}}for(const[at,st]of ot)this.scheduleAssetTask(at,async()=>{var dt;let ct=(dt=this.domainStore.state.assets[at])==null?void 0:dt.serverId;if(ct||(ct=await this.waitForServerId(at,3e4,tt)),!ct)return;const ut={};st.name!==void 0&&(ut.name=st.name),st.hasParentId&&(ut.parentId=st.parentId),await this.executeUpdate(ct,ut)},tt)}async executeDelete(_e,tt){const{error:et}=await this.retryOnce(()=>this.api.assets.delete(_e,tt));et&&(this.pendingDeletes.push(..._e),console.warn("[AssetEffectsRunner] delete failed:",et.retryError),this.reportError(new EffectsError(EffectsErrorCode.DELETE_FAILED,"Asset delete side effects failed",{serverIds:_e,originalError:et.originalError,retryError:et.retryError})))}async executeUpdate(_e,tt){const{error:et}=await this.retryOnce(()=>this.api.assets.update(_e,tt));et&&(console.warn("[AssetEffectsRunner] update failed:",et.retryError),this.reportError(new EffectsError(EffectsErrorCode.UPDATE_FAILED,`Asset update side effects failed: ${_e}`,{serverId:_e,data:tt,originalError:et.originalError,retryError:et.retryError})))}async retryOnce(_e){try{return await _e(),{}}catch(tt){await new Promise(et=>setTimeout(et,so.RETRY_DELAY_MS));try{return await _e(),{}}catch(et){return{error:{originalError:tt,retryError:et}}}}}getPendingDeletes(){return[...this.pendingDeletes]}async retryPendingDeletes(){const _e=this.pendingDeletes.splice(0);_e.length!==0&&await this.runTask(this.executeDelete(_e,this.projectId))}async handleCreate(_e,tt,et,rt,it){try{const ot=await this.api.assets.create(buildCreateAssetRequest({assetId:_e,projectId:rt,state:tt}));if(this._sessionToken!==it){this.runTask(this.executeDelete([ot.id],rt));return}const at=this.domainStore.state.assets[_e];if(this.revisions.get(_e)!==et||!at){this.runTask(this.executeDelete([ot.id],rt));return}const st=Object.prototype.hasOwnProperty.call(at,"serverId")?"replace":"add";try{this.domainStore.applySystem([{op:st,path:`/assets/${_e}/serverId`,value:ot.id}])}catch(ct){throw this.runTask(this.executeDelete([ot.id],rt)),ct}}catch(ot){console.warn("[AssetEffectsRunner] recreate failed:",ot),this.reportError(new EffectsError(EffectsErrorCode.CREATE_FAILED,`Asset create side effects failed: ${_e}`,{assetId:_e,originalError:ot}))}}runTask(_e){const tt=this.beginWork();return _e.finally(()=>{this.endWork(tt)})}scheduleAssetTask(_e,tt,et){const rt=this.beginWork(),it=async()=>{this._sessionToken===et&&await tt()},ot=this.assetChains.get(_e),at=(ot?ot.catch(()=>{}).then(it):Promise.resolve(it())).catch(st=>{this.reportError(new EffectsError(EffectsErrorCode.UPDATE_FAILED,`Asset side effects scheduler failed: ${_e}`,{assetId:_e,originalError:st}))}).finally(()=>{this.endWork(rt),this.assetChains.get(_e)===at&&this.assetChains.delete(_e)});this.assetChains.set(_e,at)}beginWork(){const _e=Symbol("asset-effects-work");return this.workSet.size===0&&(this._lastError=null),this.workSet.add(_e),this.notifyStatusChange(),_e}endWork(_e){this.workSet.delete(_e)&&this.notifyStatusChange()}notifyStatusChange(){const _e=this.pendingCount;for(const tt of this.statusListeners)tt(_e,_e===0?this._lastError:null);if(_e===0){const tt=this.idleResolvers.splice(0);for(const et of tt)et()}}reportError(_e){var tt;this._lastError=_e,(tt=this.onError)==null||tt.call(this,_e)}parsePropertyPath(_e){const tt=_e.match(/^\/assets\/([^/]+)\/(name|parentFolderId)$/);return tt?{assetId:tt[1],property:tt[2]}:null}extractRootAssetId(_e){if(!_e.startsWith("/assets/"))return null;const tt=_e.slice(8);return!tt||tt.includes("/")?null:tt}waitForServerId(_e,tt,et){const rt=this.domainStore.state.assets[_e];return rt?rt.serverId?Promise.resolve(rt.serverId):this._sessionToken!==et?Promise.resolve(null):new Promise(it=>{let ot=!1;const at=ut=>{ot||(ot=!0,clearTimeout(st),ct(),it(ut))},st=setTimeout(()=>at(null),tt),ct=this.domainStore.subscribe(()=>{if(this._sessionToken!==et)return at(null);const ut=this.domainStore.state.assets[_e];if(!ut)return at(null);ut.serverId&&at(ut.serverId)})}):Promise.resolve(null)}};wt(so,"RETRY_DELAY_MS",500);let AssetEffectsRunner=so;const SKIP_COMMANDS=new Set(["system","remote","asset.init","reset"]);class ScenePersistenceRunner{constructor(_e,tt){wt(this,"_unsubscribe",null);this.domainStore=_e,this.config=tt}start(){this._unsubscribe||(this._unsubscribe=this.domainStore.subscribe(_e=>this.handleTransaction(_e)))}stop(){var _e;(_e=this._unsubscribe)==null||_e.call(this),this._unsubscribe=null}handleTransaction(_e){if(this.domainStore.isHistoryPaused)return;const tt=_e.commandName??"";SKIP_COMMANDS.has(tt)||!_e.operations.some(rt=>rt.path.startsWith("/entities/")||rt.path.startsWith("/scene/"))||this.config.persistSceneDebounced(tt||"unknown")}}class InspectorSelectionService{constructor(_e){this.root=_e}getSelectedEntityId(){var tt;const _e=((tt=this.root.sceneUIStore)==null?void 0:tt.lastSelectedId)??null;return!_e||_e===DEFAULT_SCENE?null:_e}getSelectedEntityModel(){const _e=this.getSelectedEntityId();return _e?this.root.sceneStore.entities.get(_e)??null:null}getSelectedEntityReadModel(){const _e=this.getSelectedEntityId();return _e?this.root.readModelStore.getEntity(_e)??null:null}getSelectedComponents(){var _e;return((_e=this.getSelectedEntityModel())==null?void 0:_e.components)??[]}}function disposeReloadState(nt,_e){var tt,et,rt,it,ot,at,st;(tt=nt.assetEffectsRunner)==null||tt.stop(),(et=nt.scenePersistenceRunner)==null||et.stop(),(rt=nt.selectionStore)==null||rt.dispose(),(it=nt.domainStateReactive)==null||it.dispose(),(ot=nt.uiProjection)==null||ot.dispose(),(at=nt.runtimeBinderRegistry)==null||at.dispose(),(st=nt.runtimeAssetStore)==null||st.dispose(),_e==null||_e()}function bindAssetRuntimeReadyToProjection(nt,_e,tt){return nt.subscribe((et,rt)=>{var it,ot,at;(rt==null?void 0:rt.status)==="ready"&&((it=_e())==null||it.rebindAssetReferences(et),(at=(ot=tt==null?void 0:tt())==null?void 0:ot.rebindAssetReferences)==null||at.call(ot,et,!1))})}const Mr=class Mr{constructor(){wt(this,"projectStore");wt(this,"configDataStore");wt(this,"layoutStore");wt(this,"assetStore");wt(this,"animationClipStore");wt(this,"animatorControllerStore");wt(this,"snapshot");wt(this,"inspectorStore",inspectorStore);wt(this,"selectionStore");wt(this,"sceneUIStore");wt(this,"assetUIStore");wt(this,"assetService");wt(this,"assetRegistry");wt(this,"domainStore");wt(this,"commandBus");wt(this,"engineProjection",null);wt(this,"_lastProjectionRebuildTime",0);wt(this,"_projectionRebuildTimer",null);wt(this,"_disposeAssetRuntimeReadySubscription",null);wt(this,"domainStateReactive");wt(this,"entityModelProjection");wt(this,"runtimeProjection");wt(this,"readModelStore");wt(this,"uiProjection");wt(this,"entityFacade");wt(this,"assetFacade");wt(this,"componentFacade");wt(this,"sceneFacade");wt(this,"inspectorFacade");wt(this,"prefabFacade");wt(this,"uploadService");wt(this,"_logger",new TraceLogger("Root"));wt(this,"assetEffectsRunner");wt(this,"scenePersistenceRunner");wt(this,"inspectorSelectionService");wt(this,"runtimeBinderRegistry");wt(this,"runtimeAssetStore");wt(this,"storage");wt(this,"esbuildInstancePromise",Mr.getEsbuildInstancePromise());wt(this,"reload",()=>{disposeReloadState(this,()=>{var _e;(_e=this._disposeAssetRuntimeReadySubscription)==null||_e.call(this),this._disposeAssetRuntimeReadySubscription=null,this._projectionRebuildTimer&&(clearTimeout(this._projectionRebuildTimer),this._projectionRebuildTimer=null)}),this.configDataStore=new ConfigDataCenter,this.projectStore=new Project(this),this.layoutStore=new LayoutSystem(this),this.snapshot=snapshotStore,this.assetUIStore=new AssetUIStore,this.assetService=new AssetService(this),this.assetRegistry=new AssetRegistry,this.assetStore=new AssetManager(this),this.animationClipStore=new AnimationClipStore(this),this.animatorControllerStore=new AnimatorControllerStore(this),this.selectionStore=new SelectionStore(this),this.sceneUIStore=new SceneUIStore(this),this.domainStore=new DomainStore,this.domainStore.pauseHistory(),this.commandBus=new CommandBus(this.domainStore),this.domainStateReactive=new DomainStateReactive(this.domainStore),this.readModelStore=new ReadModelStore,this.runtimeAssetStore=new RuntimeAssetStore,this.runtimeBinderRegistry=new RuntimeBinderRegistry,this.uiProjection=new UIProjection(this.domainStore,this.readModelStore),this.uiProjection.setAssetStore(this.assetStore),this.runtimeProjection=new RuntimeProjection(()=>this.sceneStore,()=>this.engineProjection,this.runtimeBinderRegistry,()=>this.domainStore.canRedo),this.entityModelProjection=new EntityModelProjection(()=>this.sceneStore,()=>this.engineProjection),this.domainStore.subscribe(_e=>{if(this.engineProjection){if(_e.commandName==="reset"){this.runtimeProjection.reset();try{this.engineProjection.rebuildFromState(this.domainStore.state),this._rebindAllEntityModels()}catch(rt){console.error("EngineProjection rebuild failed:",rt),this._requestEngineProjectionRebuild(rt)}return}try{this.engineProjection.apply(_e.events,_e.commandName)}catch(rt){console.error("EngineProjection apply failed:",rt),this._requestEngineProjectionRebuild(rt)}}const tt=this.runtimeProjection.apply(_e.events,_e.commandName);this.entityModelProjection.apply(_e.events,tt),isUndoRedoCommand(_e.commandName)&&this._syncUploadingAssetIds(_e.operations),this._resumeCreateByAddAfterRedo(_e.operations,_e.commandName)}),this.entityFacade=new EntityFacade(this),this.assetFacade=new AssetFacade(this),this.componentFacade=new ComponentFacade(this),this.sceneFacade=new SceneFacade(this.domainStore,this.commandBus),this.inspectorFacade=new InspectorFacade(this),this.prefabFacade=new PrefabFacade(this),isTraceEnabled()&&(instrumentCommandBus(this.commandBus),instrumentDomainStore(this.domainStore),wrapFacadeWithTrace(this.entityFacade,"EntityFacade"),wrapFacadeWithTrace(this.componentFacade,"ComponentFacade"),wrapFacadeWithTrace(this.assetFacade,"AssetFacade"),wrapFacadeWithTrace(this.inspectorFacade,"InspectorFacade")),this.uploadService=new UploadService(this),this.assetEffectsRunner=new AssetEffectsRunner(this.domainStore,()=>this.projectStore.id,{assets:{delete:(..._e)=>this.storage.assets.delete(..._e),create:_e=>this.storage.assets.create(_e),update:(_e,tt)=>this.storage.assets.update(_e,tt).then(()=>{})}}),this.scenePersistenceRunner=new ScenePersistenceRunner(this.domainStore,{persistSceneDebounced:_e=>this.projectStore.persistSceneDebounced(_e)}),this.inspectorSelectionService=new InspectorSelectionService(this)});this.reload()}static getEsbuildInstancePromise(){return Mr.esbuildInstancePromiseSingleton||(Mr.esbuildInstancePromiseSingleton=browserExports.initialize({worker:!0,wasmURL:"https://gw.alipayobjects.com/os/lib/esbuild-wasm/0.25.8/esbuild.wasm"})),Mr.esbuildInstancePromiseSingleton}createLogger(_e){return new TraceLogger(_e)}get sceneStore(){return this.projectStore.currentScene}get viewportStore(){return this.projectStore.currentViewport}undo(){isTraceEnabled()&&beginTrace();try{return this.domainStore.undo()!==null}finally{isTraceEnabled()&&endTrace()}}redo(){isTraceEnabled()&&beginTrace();try{return this.domainStore.redo()!==null}finally{isTraceEnabled()&&endTrace()}}get canUndo(){return this.domainStore.canUndo}get canRedo(){return this.domainStore.canRedo}runInUndoGroup(_e,tt){this.domainStore.beginUndoGroup();const et=()=>{this.domainStore.endUndoGroup(_e)};try{const rt=tt();return rt&&typeof rt.then=="function"?rt.finally(et):(et(),rt)}catch(rt){throw et(),rt}}resumeHistoryCapture(){this.domainStore.resumeHistory.bind(this.domainStore)()}setStorage(_e){if(!(_e!=null&&_e.project)||!(_e!=null&&_e.assets)||!(_e!=null&&_e.schema))throw new Error("setStorage: storage must implement project, assets, and schema");this.storage=_e}initEngineProjection(_e){var et;(et=this._disposeAssetRuntimeReadySubscription)==null||et.call(this),this._disposeAssetRuntimeReadySubscription=null,this.engineProjection=new EngineProjection(_e,void 0,()=>this.domainStore.canRedo);const tt=rt=>{var it;return((it=this.runtimeAssetStore.get(rt))==null?void 0:it.engineObject)??null};this.engineProjection.setAssetResolver(tt),this.engineProjection.setComponentFactory(createComponentFactory(tt)),this._disposeAssetRuntimeReadySubscription=bindAssetRuntimeReadyToProjection(this.runtimeAssetStore,()=>this.engineProjection,()=>this.sceneStore),this.sceneStore&&this.uiProjection.setSceneStore(this.sceneStore)}_requestEngineProjectionRebuild(_e){if(!this.engineProjection)return;const rt=Date.now()-this._lastProjectionRebuildTime;if(rt>=Mr.PROJECTION_REBUILD_THROTTLE_MS){this._runEngineProjectionRebuild(_e);return}if(this._projectionRebuildTimer)return;const it=Mr.PROJECTION_REBUILD_THROTTLE_MS-rt;this._projectionRebuildTimer=setTimeout(()=>{this._projectionRebuildTimer=null,this._runEngineProjectionRebuild(_e)},it)}_resumeCreateByAddAfterRedo(_e,tt){const et=collectCreateByAddResumeCandidates({commandName:tt,operations:_e,assets:this.domainStore.state.assets});for(const rt of et)this.assetStore.resumeCreateAssetByAddFromState(rt).catch(it=>{console.warn("[Root] resumeCreateAssetByAddFromState failed:",{assetId:rt,error:it})})}_runEngineProjectionRebuild(_e){const tt=this.engineProjection;if(tt){this._lastProjectionRebuildTime=Date.now();try{tt.rebuildFromState(this.domainStore.state),this._rebindAllEntityModels()}catch(et){console.error("EngineProjection rebuild failed:",et,"reason:",_e);try{tt.reset()}catch(rt){console.error("EngineProjection reset failed:",rt)}}}}_rebindAllEntityModels(){const _e=this.sceneStore;!_e||!this.engineProjection||rebindEntityModels(_e.entities,this.engineProjection)}_syncUploadingAssetIds(_e){const tt=this.assetUIStore;if(!tt)return;const et=/^\/assets\/([^/]+)$/;for(const it of _e){const ot=et.exec(it.path);if(!ot)continue;const at=ot[1];it.op==="add"&&it.value&&typeof it.value=="object"&&it.value.status==="uploading"?tt.markAssetUploading(at):it.op==="remove"&&tt.clearAssetUploading(at)}const rt=/^\/assets\/([^/]+)\/status$/;for(const it of _e){const ot=rt.exec(it.path);if(!ot)continue;const at=ot[1];it.op!=="remove"&&"value"in it&&it.value==="uploading"?tt.markAssetUploading(at):tt.clearAssetUploading(at)}}};wt(Mr,"esbuildInstancePromiseSingleton",null),wt(Mr,"PROJECTION_REBUILD_THROTTLE_MS",3e3);let Root=Mr;async function initProjectReadRuntime({root:nt,storage:_e,projectId:tt,canvas:et,projectInfo:rt,onStage:it}){var ut;nt.setStorage(_e);const ot=rt??await(async()=>(it==null||it("query-project"),_e.project.query(tt)))(),at=nt.projectStore,st=[...ot.assets??[]];it==null||it("init-project"),await at.init(ot),it==null||it("init-engine"),await at.initEngine(et),it==null||it("init-assets"),await at.initAssets(st),it==null||it("init-scene"),await at.initScene(),it==null||it("run-engine"),at.runEngine();const ct=(ut=nt.sceneStore)!=null&&ut.entities?Array.from(nt.sceneStore.entities.values()).flatMap(dt=>dt.components):[];return it==null||it("replay-bindings"),await Promise.all(ct.map(dt=>{var ht;return((ht=dt.replaySerializedBindings)==null?void 0:ht.call(dt))??Promise.resolve()})),it==null||it("resume-history"),nt.resumeHistoryCapture(),{root:nt,projectInfo:ot,projectStore:at,viewportStore:at.currentViewport}}function collectAssetPickerMatches(nt,_e){if(!nt)return[];const tt=[],et=getPropertyConfigs(nt);for(const rt in et){const it=et[rt];if(!it||it.type!==ComponentType.AssetPicker)continue;const ot=nt[rt];ot&&typeof ot=="object"&&"refId"in ot&&ot.refId===_e&&tt.push({target:nt,key:rt})}return tt}function refreshAssetReferenceMatch(nt){var ut,dt,ht,ft,pt,mt,vt;const{target:_e,key:tt}=nt,et=(ut=getPropertyConfigs(_e))==null?void 0:ut[tt];(dt=_e.triggerPropertyChange)==null||dt.call(_e,tt,!1);const rt=((ht=_e==null?void 0:_e[storedPropertyProxySymbol])==null?void 0:ht[tt])??((ft=getPropertyProxyConfigs(_e))==null?void 0:ft[tt]),it=rt==null?void 0:rt.engineKey;if(!!(et!=null&&et.bindPath||et!=null&&et.onChange)||!it)return;const at=_e==null?void 0:_e.engineObject;if(!at||typeof at[it]!="function")return;const st=_e[tt],ct=st!=null&&st.refId?((vt=(mt=(pt=_e==null?void 0:_e.root)==null?void 0:pt.assetStore)==null?void 0:mt.assets)==null?void 0:vt[st.refId])??null:null;at[it]((ct==null?void 0:ct.engineObject)??null)}const TEXT_ASSET_TYPES=new Set(["Scene","Prefab","script","Shader","ShaderChunk","StateMachineScript"]);function parseAssetMeta(nt,_e){if(!nt)return{};try{const tt=JSON.parse(nt);if(!tt||typeof tt!="object"||Array.isArray(tt))throw new Error("asset meta is not an object");return tt}catch(tt){return console.warn(`[applyProjectReadRefresh] invalid asset meta for ${_e}, fallback to empty meta`,tt),{}}}function toDomainAssetState(nt){const _e=parseAssetMeta(nt.meta,nt.uuid);return{id:nt.uuid,name:nt.name,type:_e.type??"Unknown",serverId:nt.id??null,parentFolderId:nt.parentId||null,url:nt.url||void 0,meta:_e,status:"ready"}}function isSerializableEqual(nt,_e){return JSON.stringify(nt)===JSON.stringify(_e)}async function fetchAssetPayload(nt,_e){const tt=await fetch(nt);if(!tt.ok)throw new Error(`asset fetch failed: ${tt.status}`);const et=await tt.blob(),rt=TEXT_ASSET_TYPES.has(_e)?await et.text():void 0;return{blob:et,text:rt}}function refreshSceneAssetPickerReferences(nt,_e){var rt,it,ot,at;const tt=nt.sceneStore;if(!tt)return;const et=st=>{for(const ct of collectAssetPickerMatches(st,_e))refreshAssetReferenceMatch(ct)};et(tt);for(const st of((it=(rt=tt.entities)==null?void 0:rt.values)==null?void 0:it.call(rt))??[])for(const ct of st.components??[])et(ct);for(const st of((at=(ot=tt.strippedEntities)==null?void 0:ot.values)==null?void 0:at.call(ot))??[])for(const ct of st.components??[])et(ct)}function syncDomainAssetState(nt,_e){const tt=_e.id,et=nt.domainStore.state.assets[tt];if(et&&isSerializableEqual(et,_e))return;const rt=encodeJsonPointerSegment(tt),it=et?{op:"replace",path:`/assets/${rt}`,value:_e}:{op:"add",path:`/assets/${rt}`,value:_e};nt.domainStore.applyRemote([it])}function normalizeAssetBatchChanges(nt){const _e=new Map;for(const tt of nt){const et=_e.get(tt.assetId);if(!et){_e.set(tt.assetId,{assetId:tt.assetId,reason:tt.reason});continue}et.reason!=="main"&&tt.reason==="main"&&_e.set(tt.assetId,{assetId:tt.assetId,reason:"main"})}return Array.from(_e.values())}async function fetchAndLoadMainFile(nt,_e){var it;const tt=_e.url;if(!tt||typeof nt.reloadMainFileFromRemote!="function")return;const{blob:et,text:rt}=await fetchAssetPayload(tt,_e.type);return(it=nt.setUrl)==null||it.call(nt,tt),await nt.reloadMainFileFromRemote({blob:et,url:tt}),_e.type==="ShaderChunk"&&typeof rt=="string"&&typeof nt.updateCode=="function"&&nt.updateCode(rt),rt}async function reloadRuntimeAsset(nt,_e,tt,et){var rt;if(!nt){const it=tt.assetStore.initAsset(et);if(!it)return;let ot;try{ot=await fetchAndLoadMainFile(it,_e)}catch(at){console.warn(`[applyProjectReadRefresh] initial main file load failed for ${et.uuid}`,at)}try{await((rt=it.collectDependencies)==null?void 0:rt.call(it))}catch(at){console.warn(`[applyProjectReadRefresh] collectDependencies failed for ${et.uuid}`,at)}return ot}return fetchAndLoadMainFile(nt,_e)}async function refreshCurrentScene(nt,_e){var rt,it;const tt=nt.domainStore.state,et=createEmptyDomainState();et.version=tt.version,et.assets=tt.assets,nt.domainStore.reset(et),await((it=(rt=nt.sceneStore)==null?void 0:rt.init)==null?void 0:it.call(rt,_e))}async function applyProjectReadFullRefresh(nt){var at;const{root:_e,storage:tt,projectId:et}=nt,rt=nt.projectInfo??await tt.project.query(et),it=_e.domainStore.state.assets??{},ot=(at=_e.sceneStore)==null?void 0:at.refId;await EditorAsset.runWithGlobalAutoSaveSuspended(async()=>{await _e.domainStore.runAsRemote(async()=>{var ct,ut;let st=null;for(const dt of rt.assets){const ht=toDomainAssetState(dt),ft=it[dt.uuid];if(ft&&isSerializableEqual(ft,ht))continue;syncDomainAssetState(_e,ht);const pt=(ct=_e.assetStore.assets)==null?void 0:ct[dt.uuid];dt.uuid===ot&&(st=pt);try{await reloadRuntimeAsset(pt,ht,_e,dt)}catch(mt){console.warn(`[applyProjectReadFullRefresh] reload runtime asset failed for ${dt.uuid}, skipping`,mt)}dt.uuid!==ot&&refreshSceneAssetPickerReferences(_e,dt.uuid)}if(st||ot){const dt=st??((ut=_e.assetStore.assets)==null?void 0:ut[ot]);await refreshCurrentScene(_e,dt)}})})}async function applyProjectReadAssetBatchRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et,changes:rt}){const it=et??await _e.project.query(tt),ot=normalizeAssetBatchChanges(rt);await EditorAsset.runWithGlobalAutoSaveSuspended(async()=>{await nt.domainStore.runAsRemote(async()=>{var at;for(const st of ot){const ct=it.assets.find(ht=>ht.uuid===st.assetId);if(!ct)throw new Error(`refresh asset not found in project detail: ${st.assetId}`);const ut=toDomainAssetState(ct),dt=(at=nt.assetStore.assets)==null?void 0:at[st.assetId];syncDomainAssetState(nt,ut),st.reason==="main"&&(await reloadRuntimeAsset(dt,ut,nt,ct),refreshSceneAssetPickerReferences(nt,st.assetId))}})})}async function applyProjectReadRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et,change:rt}){if(rt.type==="scene-changed"){await applyProjectReadFullRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et});return}await applyProjectReadAssetBatchRefresh({root:nt,storage:_e,projectId:tt,projectInfo:et,changes:[{assetId:rt.assetId,reason:rt.reason}]})}function mountEngineCanvas(nt,_e){var et;const tt=_e.canvas;if(!tt)throw new Error("projectStore.canvas is missing");return tt.style.width="100%",tt.style.height="100%",tt.oncontextmenu=rt=>{rt.preventDefault()},tt.parentElement!==nt&&nt.appendChild(tt),(et=_e.engine)==null||et.dispatch("onReady"),tt}function unique(nt){return Array.from(new Set(nt))}function createRuntimeBootstrapPlan({projectInfo:nt,sceneData:_e}){const tt=Array.from(collectAssetTypes(nt.assets)).sort(),et=Array.from(collectComponentTypes(_e)).sort(),rt=tt.filter(ot=>!ASSET_MODULE_KEYS_BY_TYPE[ot]),it=et.filter(ot=>!COMPONENT_MODULE_KEYS_BY_TYPE[ot]);return!_e||rt.length>0||it.length>0?{mode:"full",assetTypes:tt,componentTypes:et,unknownAssetTypes:rt,unknownComponentTypes:it,assetModuleKeys:[...FULL_ASSET_MODULE_KEYS],componentModuleKeys:[...FULL_COMPONENT_MODULE_KEYS],shouldInitGlTFIO:!0}:{mode:"selective",assetTypes:tt,componentTypes:et,unknownAssetTypes:rt,unknownComponentTypes:it,assetModuleKeys:unique([...tt.map(ot=>ASSET_MODULE_KEYS_BY_TYPE[ot]).filter(Boolean),"ambient-light"]).sort(),componentModuleKeys:unique(et.map(ot=>COMPONENT_MODULE_KEYS_BY_TYPE[ot]).filter(Boolean)).sort(),shouldInitGlTFIO:tt.includes("glTF")}}async function loadRuntimeBootstrapContext({storage:nt,projectId:_e,fetchImpl:tt=fetch}){const et=await nt.project.query(_e),rt=await loadCurrentSceneData(et,tt);return{projectInfo:et,currentSceneData:rt,plan:createRuntimeBootstrapPlan({projectInfo:et,sceneData:rt})}}async function loadCurrentSceneData(nt,_e){var rt;const tt=(rt=nt.content)==null?void 0:rt.scene,et=resolveCurrentSceneAsset(nt.assets,tt);if(!(et!=null&&et.url))return null;try{const it=await _e(et.url);if(!it.ok)return null;const ot=await it.json();return ot&&typeof ot=="object"?ot:null}catch{return null}}function resolveCurrentSceneAsset(nt,_e){if(_e){const tt=nt.find(et=>et.uuid===_e);if(tt)return tt}return nt.find(tt=>parseAssetType(tt.meta)==="Scene")}function collectAssetTypes(nt){const _e=new Set;for(const tt of nt){const et=parseAssetType(tt.meta);et&&!NON_RUNTIME_ASSET_TYPES.has(et)&&_e.add(et)}return _e}function parseAssetType(nt){try{const _e=JSON.parse(nt);return typeof _e.type=="string"&&_e.type.length>0?_e.type:null}catch{return null}}function collectComponentTypes(nt){var et;const _e=new Set,tt=nt==null?void 0:nt.entities;if(!Array.isArray(tt))return _e;for(const rt of tt){if(!rt||typeof rt!="object")continue;const it=readString((et=rt.transform)==null?void 0:et.class);it&&_e.add(it);const ot=rt.components;if(Array.isArray(ot))for(const at of ot){const st=readString(at==null?void 0:at.class);st&&_e.add(st)}}return _e}function readString(nt){return typeof nt=="string"&&nt.length>0?nt:null}class ViewportRuntime{constructor(){wt(this,"root",null);wt(this,"projectStore",null);wt(this,"viewportStore",null);wt(this,"container",null);wt(this,"storage",null);wt(this,"projectId",null);wt(this,"taskQueue",Promise.resolve());wt(this,"resizeObserver",null)}get engine(){var _e;return((_e=this.projectStore)==null?void 0:_e.engine)??null}async init(_e,tt,et,rt={}){this.container=_e,this.storage=tt,this.projectId=et,await this.enqueueBootstrap(_e,tt,et,!1,rt.onStage,rt.projectInfo)}async reload(_e=this.storage,tt=this.projectId){if(!_e)throw new Error("storage is required");if(!tt)throw new Error("projectId is required");if(this.storage=_e,this.projectId=tt,this.root){await this.enqueueTask(async()=>{const et=await this.ensureBootstrapForCurrentProject();await applyProjectReadFullRefresh({root:this.root,storage:_e,projectId:tt,projectInfo:et==null?void 0:et.projectInfo})});return}if(!this.container)throw new Error("container is required");await this.enqueueBootstrap(this.container,_e,tt,!0)}async applyChange(_e){if(_e.type==="project-changed"){await this.reload();return}await this.enqueueTask(async()=>{const tt=this.root,et=this.storage,rt=this.projectId;if(!tt)throw new Error("runtime root is required");if(!et)throw new Error("storage is required");if(!rt)throw new Error("projectId is required");const it=await this.ensureBootstrapForCurrentProject();await applyProjectReadRefresh({root:tt,storage:et,projectId:rt,projectInfo:it==null?void 0:it.projectInfo,change:{type:_e.type,assetId:_e.assetId,reason:_e.reason}})})}async applyAssetBatchChange({changes:_e}){await this.enqueueTask(async()=>{const tt=this.root,et=this.storage,rt=this.projectId;if(!tt)throw new Error("runtime root is required");if(!et)throw new Error("storage is required");if(!rt)throw new Error("projectId is required");const it=await this.ensureBootstrapForCurrentProject();await applyProjectReadAssetBatchRefresh({root:tt,storage:et,projectId:rt,projectInfo:it==null?void 0:it.projectInfo,changes:_e})})}async ensureBootstrapForCurrentProject(){const _e=this.storage,tt=this.projectId;if(!_e||!tt)return null;try{const et=await loadRuntimeBootstrapContext({storage:_e,projectId:tt});return await bootstrapEditorRuntime({plan:et.plan}),et}catch(et){return console.warn("[ViewportRuntime] ensureBootstrapForCurrentProject failed:",et),null}}async setEntityTransform(_e,tt,et={}){await this.enqueueTask(async()=>{const{root:rt,projectStore:it}=this.requireRuntimeHandles();rt.entityFacade.setTransform(_e,tt),await this.persistSceneIfRequested(it,et.persist)})}async saveScene(){await this.enqueueTask(async()=>{const{projectStore:_e}=this.requireRuntimeHandles();await this.persistScene(_e)})}async undo(_e={}){return this.enqueueTask(async()=>{const{root:tt,projectStore:et}=this.requireRuntimeHandles(),rt=tt.undo();return rt&&await this.persistSceneIfRequested(et,_e.persist),rt})}async redo(_e={}){return this.enqueueTask(async()=>{const{root:tt,projectStore:et}=this.requireRuntimeHandles(),rt=tt.redo();return rt&&await this.persistSceneIfRequested(et,_e.persist),rt})}dispose(){this.disposeRuntime(),this.container=null,this.storage=null,this.projectId=null}enqueueBootstrap(_e,tt,et,rt=!1,it,ot){return this.enqueueTask(async()=>{rt&&this.disposeRuntime(),await this.bootstrap(_e,tt,et,it,ot)})}enqueueTask(_e){const tt=this.taskQueue.then(_e,_e);return this.taskQueue=tt.then(()=>{},()=>{}),tt}async bootstrap(_e,tt,et,rt,it){const ot=new Root,at=document.createElement("canvas"),st=await initProjectReadRuntime({root:ot,storage:tt,projectId:et,canvas:at,projectInfo:it,onStage:rt,viewport:{mode:"viewer"}});this.root=st.root,this.projectStore=st.projectStore,this.viewportStore=st.viewportStore,mountEngineCanvas(_e,this.projectStore),this.attachResizeSync(_e)}disposeRuntime(){var tt,et,rt,it;(tt=this.resizeObserver)==null||tt.disconnect(),this.resizeObserver=null;const _e=(et=this.projectStore)==null?void 0:et.canvas;_e!=null&&_e.parentElement&&_e.parentElement.removeChild(_e),(it=(rt=this.projectStore)==null?void 0:rt.reset)==null||it.call(rt),this.root=null,this.projectStore=null,this.viewportStore=null}attachResizeSync(_e){var et,rt,it;if((et=this.resizeObserver)==null||et.disconnect(),this.resizeObserver=null,(it=(rt=this.viewportStore)==null?void 0:rt.handleContainerResize)==null||it.call(rt),typeof ResizeObserver>"u")return;const tt=new ResizeObserver(()=>{var ot,at;(at=(ot=this.viewportStore)==null?void 0:ot.handleContainerResize)==null||at.call(ot)});tt.observe(_e),this.resizeObserver=tt}requireRuntimeHandles(){const _e=this.root,tt=this.projectStore;if(!_e)throw new Error("runtime root is required");if(!tt)throw new Error("projectStore is required");return{root:_e,projectStore:tt}}async persistSceneIfRequested(_e,tt=!1){tt&&await this.persistScene(_e)}async persistScene(_e){var et;const tt=(et=_e.updateSceneAsset)==null?void 0:et.bind(_e);if(!tt)throw new Error("projectStore.updateSceneAsset is required");await tt()}}class HttpStorage{constructor(_e){wt(this,"project");wt(this,"assets");wt(this,"schema");this.project={query:tt=>_e.project.query(tt),modifyProjectName:(tt,et)=>_e.project.modifyProjectName(tt,et).then(()=>{}),updateThumbnail:(tt,et)=>_e.project.updateThumbnail(tt,et),updateMetaInfo:(tt,et,rt)=>_e.project.updateMetaInfo(tt,et,rt).then(()=>{}),updateSetting:(tt,et)=>_e.project.updateSetting(tt,et).then(()=>{})},this.assets={create:async tt=>{const{id:et,url:rt,meta:it}=await _e.assets.create(tt);return{id:et,url:rt,meta:typeof it=="string"?it:void 0}},update:(tt,et)=>_e.assets.update(tt,et),delete:(tt,et)=>_e.assets.delete(tt,et),duplicate:async tt=>(await _e.assets.duplicateTo(tt)).data},this.schema={update:(tt,et)=>_e.schema.update(tt,et)}}}function createStorage(nt,_e=fetch){const tt={project:{query:async et=>{const rt=await _e(`${nt}/api/project/${et}`);if(!rt.ok)throw new Error(`project query failed: ${rt.status}`);return rt.json()},modifyProjectName:async()=>({}),updateThumbnail:async()=>({thumbnail:""}),updateMetaInfo:async()=>({}),updateSetting:async()=>({})},assets:{create:async()=>({id:"",url:""}),update:async(et,rt)=>{const it=await serializeAssetUpdate(rt),ot=await _e(`${nt}/api/assets/${encodeURIComponent(et)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(it)});if(!ot.ok)throw new Error(`asset update failed: ${ot.status}`);return ot.json()},delete:async()=>{},duplicateTo:async()=>({data:[]})},schema:{update:async()=>{}}};return new HttpStorage(tt)}async function serializeAssetUpdate(nt){return{file:nt.file?await serializeBlob(nt.file):void 0,meta:nt.meta,name:nt.name,parentId:nt.parentId,url:nt.url}}async function serializeBlob(nt){const _e=await nt.arrayBuffer();return{base64:encodeBase64(_e),type:nt.type}}function encodeBase64(nt){if(typeof Buffer<"u")return Buffer.from(nt).toString("base64");let _e="";const tt=new Uint8Array(nt);for(let et=0;et<tt.length;et++)_e+=String.fromCharCode(tt[et]);return btoa(_e)}async function loadRuntimeProjectId(nt,_e=fetch){const tt=normalizeBaseUrl(nt),et=await _e(`${tt}/healthz`);if(!et.ok)throw new Error(`project id query failed: ${et.status}`);const rt=await et.json();return typeof rt.projectId=="string"&&rt.projectId.length>0?rt.projectId:"local"}async function loadRuntimeProjectContext(nt,_e={}){var at,st;const tt=normalizeBaseUrl(nt),et=_e.fetchImpl??fetch;(at=_e.onStage)==null||at.call(_e,"resolve-project-id");const rt=await loadRuntimeProjectId(tt,et),it=createStorage(tt,et);(st=_e.onStage)==null||st.call(_e,"query-project");const ot=await loadRuntimeBootstrapContext({storage:it,projectId:rt,fetchImpl:et});return{storage:it,projectId:rt,...ot}}function normalizeBaseUrl(nt){return nt.replace(/\/$/,"")}async function main(){const nt=document.getElementById("app"),_e=document.getElementById("status");if(!nt)throw new Error("viewport container not found");const tt=(at,st="busy")=>{_e&&(_e.textContent=at,_e.setAttribute("data-state",st))},et=createStartupStatusReporter({setStatus:tt}),rt="",it=new ViewportRuntime;let ot=null;try{const{storage:at,projectId:st,projectInfo:ct,plan:ut}=await loadRuntimeProjectContext(rt,{onStage:et.reportStage});et.reportStage("boot-runtime"),await bootstrapEditorRuntime({onStage:et.reportStage,plan:ut}),await it.init(nt,at,st,{onStage:et.reportStage,projectInfo:ct}),window.__runtime=it,Object.defineProperty(window,"__engine",{configurable:!0,enumerable:!0,get:()=>it.engine}),et.finish(),ot=attachSceneHotReload({runtime:it,onStatus:tt});const dt=()=>{ot==null||ot(),it.dispose()};window.addEventListener("beforeunload",dt)}catch(at){console.error(at),tt(at instanceof Error?at.message:String(at))}}main();export{SpriteRenderer as $,AntiAliasing as A,Color$1 as B,ComponentType as C,DepthTextureMode as D,EditorComponent as E,RefractionMode as F,SunMode as G,RenderFace as H,CullMode as I,BlendMode as J,Vector3 as K,LayerSetting as L,MSAASamples as M,Vector2 as N,MeshRenderer as O,PhysicsMaterialCombineMode as P,PBRMaterial as Q,RenderQueueType as R,Script as S,TextureCoordinate as T,BoundingBox as U,Vector4 as V,resourceLoader as W,Loader as X,Renderer$1 as Y,ignoreClone as Z,Entity as _,Layer as a,meta as a$,TextureWrapMode$1 as a0,TextRenderer as a1,Font as a2,Logger as a3,Engine as a4,AssetPromise as a5,Utils$3 as a6,AssetType as a7,EngineObject as a8,Sprite as a9,Rect$1 as aA,Quaternion as aB,jsxRuntimeExports$1 as aC,FormItem as aD,extractFormItemProps as aE,StyledText as aF,createReactComponent as aG,createReactComponent$1 as aH,angleSerializer as aI,SpriteMaskLayer as aJ,SpriteMaskInteraction as aK,action as aL,hdrColorSerializer as aM,SpriteDrawMode as aN,styled as aO,Flex as aP,observer as aQ,useTranslation as aR,jsxRuntimeExports as aS,ActionButton as aT,reactExports$1 as aU,Collapsible as aV,InspectorForm as aW,Button$2 as aX,AnimatorController as aY,AnimatorControllerLayer as aZ,AnimatorLayerBlendingMode as a_,SubPrimitive as aa,BlendFactor as ab,BlendOperation as ac,VertexElement as ad,VertexElementFormat as ae,Buffer$3 as af,BufferBindFlag as ag,BufferUsage as ah,IndexBufferBinding as ai,IndexFormat as aj,assignmentClone as ak,deepClone as al,ReferResource as am,TextureFilterMode as an,Shader as ao,Material as ap,Primitive as aq,VertexBufferBinding as ar,XRManager as as,decoder as at,Ray as au,Plane as av,decode as aw,CameraType$1 as ax,Matrix as ay,Signal as az,CameraClearFlags as b,SelectItem as b$,override as b0,AnimatorStateTransition as b1,reportSavingWhileDestroy as b2,reactExports as b3,IconPlus$1 as b4,createCollection$1 as b5,createContextScope$5 as b6,createCollapsibleScope as b7,React$1 as b8,useControllableState as b9,openScriptReport as bA,ShaderLanguage as bB,ShaderProperty as bC,computed as bD,MathUtil as bE,BufferMesh as bF,VertexAttribute as bG,ContentRestorer as bH,Texture2D as bI,TextureFormat as bJ,RenderTarget as bK,React$3 as bL,Separator as bM,FormItemAssetPicker$1 as bN,FormItemButton as bO,toJS as bP,addPropertyProxyConfig as bQ,api as bR,ModelMesh as bS,BlendShape$1 as bT,MeshTopology as bU,BlinnPhongMaterial as bV,collectDependenciesFromMeta as bW,ShaderFactory as bX,ensureUploadMainFile as bY,AssetPreviewer as bZ,Select as b_,useComposedRefs$6 as ba,useDirection as bb,composeEventHandlers$6 as bc,Primitive$9 as bd,useId as be,Root$c as bf,Trigger$5 as bg,Content$5 as bh,keyframes$2 as bi,IconChevronRight as bj,Spin as bk,FormItemSelect as bl,FormItemVector3 as bm,EntityPicker$1 as bn,Transform$1 as bo,AnimatorCullingMode as bp,BaseScript as bq,Animator as br,viewport as bs,ViewportPlugin as bt,Group$2 as bu,PBR as bv,registerIncludes as bw,resolve$2 as bx,n$1 as by,openCodeEditor as bz,Downsampling as c,TangentMode as c$,v4 as c0,extname as c1,basename as c2,assetService as c3,ParticleCurve as c4,CurveKey as c5,denormalizeColor as c6,ColorPicker as c7,normalizeColor as c8,ParticleGradient as c9,UICanvas as cA,UIGroup as cB,Button$1 as cC,Image$1 as cD,Text as cE,DynamicCollider as cF,StaticCollider as cG,CharacterController as cH,SpringJoint as cI,FixedJoint as cJ,HingeJoint as cK,AudioSource as cL,PostProcess as cM,AnimationFloatCurve as cN,AnimationFloatArrayCurve as cO,AnimationVector2Curve as cP,AnimationVector3Curve as cQ,AnimationVector4Curve as cR,AnimationQuaternionCurve as cS,AnimationColorCurve as cT,AnimationRefCurve as cU,AnimationRectCurve as cV,AnimationBoolCurve as cW,AnimationStringCurve as cX,AnimationArrayCurve as cY,PropertyType as cZ,getPropertyProxyConfigs as c_,GradientColorKey as ca,GradientAlphaKey as cb,TrailTextureMode as cc,TextVerticalAlignment as cd,TextHorizontalAlignment as ce,FontStyle as cf,InterpolationType as cg,OverflowMode as ch,PrimitiveMesh as ci,ParticleRenderer as cj,reaction as ck,ShaderPropertyType as cl,CompareFunction as cm,extendObservable as cn,cloneDeep$1 as co,isObservableProp as cp,virtualPropertyManually as cq,FormItemInput as cr,FormItemInputNumber as cs,DirectLight as ct,Camera as cu,SkinnedMeshRenderer as cv,PointLight as cw,SpotLight as cx,SpriteMask as cy,UITransform as cz,decomposeLayersByBitwise as d,isValidFileHeader as d$,TangentType as d0,openAnimatorStateReport as d1,AnimationClip as d2,getPropertyUniquePath as d3,getPropertyConfigs as d4,isSubProperty as d5,storedPropertyProxySymbol as d6,Keyframe$1 as d7,Root as d8,showEditorUiToastError as d9,FormItemVector2 as dA,PostProcessEffectTextureParameter as dB,PostProcessEffectColorParameter as dC,FormItemColor as dD,PostProcessEffectEnumParameter as dE,PostProcessEffectBoolParameter as dF,FormItemToggle as dG,PostProcessEffectFloatParameter as dH,TonemappingEffect as dI,BloomEffect as dJ,FormItemRect as dK,showAlert as dL,SpriteAtlas as dM,computeAssetTemplateDiffs as dN,TraceLogger as dO,FormItemGroup as dP,ParticleStopMode as dQ,isTraceEnabled as dR,beginTrace as dS,endTrace as dT,EntityManager as dU,getNormalizedComponent as dV,PrefabResource as dW,TextureCubeFace as dX,BakerResolution as dY,DecodeMode as dZ,IBLBaker as d_,assetIconMap as da,getBoundingBox as db,createStore as dc,get as dd,set as de,md5 as df,logger$2 as dg,useLayoutEffect2$1 as dh,ReactDOM as di,composeRefs$8 as dj,createPopperScope$1 as dk,Anchor$2 as dl,Presence$2 as dm,DismissableLayer as dn,Content$3 as dp,Arrow$2 as dq,Root2$6 as dr,IconPlus as ds,Checkbox as dt,IconTrash as du,PostProcessEffectParameter as dv,PostProcessEffectVector4Parameter as dw,FormItemVector4 as dx,PostProcessEffectVector3Parameter as dy,PostProcessEffectVector2Parameter as dz,t$8 as e,BoxShape as e$,toBuffer as e0,toBufferKTX2 as e1,SphericalHarmonics3 as e2,AmbientLight as e3,DiffuseMode as e4,FileHeader as e5,Input as e6,reactDomExports as e7,IconPlayerPauseFilled as e8,IconPlayerPlayFilled as e9,ActionButtonGroup as eA,Popover as eB,ScaleTransition as eC,ColorTransition as eD,SpriteTransition as eE,HorizontalAlignmentMode as eF,VerticalAlignmentMode as eG,css$1 as eH,InputNumber as eI,EntityModifyFlags as eJ,debounce$2 as eK,CanvasRenderMode as eL,ResolutionAdaptationMode as eM,CameraModifyFlags as eN,getDefaultExportFromCjs as eO,autorun as eP,Component as eQ,StyledTitle$1 as eR,Scene as eS,storedMainSymbol as eT,ParticleShapeArcMode as eU,ConeEmitType as eV,MeshShape as eW,SphereShape as eX,HemisphereShape as eY,ConeShape as eZ,CircleShape as e_,FormItemSlider as ea,LineDrawer as eb,__vitePreload as ec,Galacean as ed,browserExports as ee,GLTFResource as ef,MessageCenter as eg,TextureCube as eh,replaceExtname as ei,getTextureInformation as ej,ColliderShapeUpAxis$1 as ek,SphereColliderShape as el,PlaneColliderShape as em,CapsuleColliderShape as en,BoxColliderShape as eo,createPendingMethodRetryableError as ep,FormItemToggleGroup as eq,DynamicColliderConstraints as er,CollisionDetectionMode as es,ControllerNonWalkableMode as et,FormItemEntityPicker as eu,EditorDependentMode as ev,JointLimits as ew,JointMotor as ex,clamp$2 as ey,mergeRefs as ez,propertyProxy as f,globalCss as f$,ParticleCurveMode as f0,FormItemTable as f1,ParticleCompositeCurve as f2,Burst as f3,ParticleGradientMode as f4,ParticleRenderMode as f5,ParticleSimulationSpace as f6,ParticleScaleMode as f7,Ie$1 as f8,useDrop as f9,generatePreviewColor as fA,srgbColorToLinear as fB,linearColorToSRGB as fC,GradientSlider as fD,ParticleSlider as fE,HDRSlider as fF,EyeDropperIcon as fG,IconRightBottomCorner as fH,IconPendingFile$1 as fI,PopoverCloseTrigger as fJ,SegmentControl as fK,SegmentControlItem as fL,Slider as fM,StyledTextarea as fN,ToggleGroup$1 as fO,ToggleGroupItem as fP,StyledBold as fQ,StyledLink as fR,TreeItemRoot as fS,TreeItemContent as fT,TreeItemIcon as fU,TreeItemPreview as fV,TreeGroup$1 as fW,AlertDialog as fX,AssetItem as fY,HoverCard as fZ,resetStyle as f_,Overlay$2 as fa,overlayFadeIn as fb,Content$1 as fc,contentShow as fd,contentFadeIn as fe,contentFadeOut as ff,DialogClose as fg,Trigger$2 as fh,Title as fi,Description$1 as fj,IconX as fk,Root$3 as fl,Portal$3 as fm,lightTheme as fn,darkTheme as fo,Badge as fp,Breadcrumbs as fq,BreadcrumbItem as fr,CascadeSlider as fs,useColorSpaceConversion as ft,createDisplayColorSpaceToggle as fu,toNormalizeHexStr as fv,isEqual$1 as fw,blendParticleStops as fx,generateLinearGradient as fy,generateHDR as fz,getMultipleLayerOptions as g,theme as g0,getCssText as g1,createTheme as g2,recipes as g3,keyframes$1 as g4,DragContext as g5,DragDropContextProvider as g6,useDrag as g7,Slot$1 as g8,reactDomExports$1 as g9,createRovingFocusGroupScope as gA,Root$6 as gB,Item$1 as gC,dispatchDiscreteCustomEvent$1 as gD,clamp$3 as gE,radioGroupStyle as gF,labelStyle as gG,basicItemStyle as gH,contentStyle as gI,contextMenuContentStyle as gJ,subMenuItemStyle as gK,separatorStyle as gL,checkboxItemStyle as gM,radioItemStyle as gN,indicatorStyle as gO,dropdownMenuContentStyle as gP,IconCheck as gQ,getAugmentedNamespace as gR,useSize as ga,useFloating as gb,autoUpdate as gc,offset$2 as gd,shift as ge,limitShift as gf,flip as gg,size as gh,arrow as gi,hide as gj,useCallbackRef$2 as gk,hideOthers as gl,useFocusGuards as gm,FocusScope as gn,RemoveScroll as go,Portal$6 as gp,createSidecarMedium as gq,__rest$r as gr,useMergeRefs as gs,__assign as gt,fullWidthClassName as gu,zeroRightClassName as gv,styleSingleton as gw,__spreadArray as gx,RemoveScrollBar as gy,exportSidecar as gz,layerProxy as h,ShadowType as i,EditorAsset as j,PhysicsMaterial as k,layerSerializer as l,main$1 as m,asset as n,AssetsImportType as o,propertyField as p,DragLayer as q,runInAction as r,serialize as s,transformEnumToOptions as t,makeObservable as u,virtualProperty as v,openMarkdownEditor as w,observable as x,EventBus as y,ValueTypeEnum as z};