@galacean/cli 2.0.0-alpha.23 → 2.0.0-alpha.24

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 (89) hide show
  1. package/dist/cli.bundle.cjs +74 -12
  2. package/dist/preview-client/_static/{Accordion-75b7b34e.js → Accordion-f938dadf.js} +1 -1
  3. package/dist/preview-client/_static/{AmbientLightAsset-02786385.js → AmbientLightAsset-e34de607.js} +1 -1
  4. package/dist/preview-client/_static/{AnimationClipAsset-f96e0e56.js → AnimationClipAsset-b084da2a.js} +1 -1
  5. package/dist/preview-client/_static/{AnimatorControllerAsset-23cceb12.js → AnimatorControllerAsset-6cc04274.js} +1 -1
  6. package/dist/preview-client/_static/{AnimatorStore-48d2c14c.js → AnimatorStore-0bc90c37.js} +1 -1
  7. package/dist/preview-client/_static/{AssetViewer-1073ddb5.js → AssetViewer-d2c63b00.js} +1 -1
  8. package/dist/preview-client/_static/{AudioAsset-6218f2bb.js → AudioAsset-9c715952.js} +1 -1
  9. package/dist/preview-client/_static/{AudioComponent-16766db8.js → AudioComponent-80d06ef4.js} +1 -1
  10. package/dist/preview-client/_static/{Callout-312ada1c.js → Callout-48e71f13.js} +1 -1
  11. package/dist/preview-client/_static/{CameraComponent-c919c2dd.js → CameraComponent-9c9db3fb.js} +1 -1
  12. package/dist/preview-client/_static/{Component-6d1e73e5.js → Component-b95aa2af.js} +1 -1
  13. package/dist/preview-client/_static/{DirectLight-166a628d.js → DirectLight-b0490ef7.js} +1 -1
  14. package/dist/preview-client/_static/{FontAsset-8367aad9.js → FontAsset-6e9c0549.js} +1 -1
  15. package/dist/preview-client/_static/{FormItemArray-53c58844.js → FormItemArray-b2a3d249.js} +1 -1
  16. package/dist/preview-client/_static/{GlTFAsset-5c8e7813.js → GlTFAsset-83e8190e.js} +1 -1
  17. package/dist/preview-client/_static/{IconPlus-5fbc029e.js → IconPlus-172c6c17.js} +1 -1
  18. package/dist/preview-client/_static/{IconPointFilled-dbf63b5c.js → IconPointFilled-bad94cf1.js} +1 -1
  19. package/dist/preview-client/_static/{LightBaseComponent-545c5ee8.js → LightBaseComponent-b4854e8a.js} +1 -1
  20. package/dist/preview-client/_static/{LottieAnimationComponent-4db5a6c2.js → LottieAnimationComponent-efd5da2b.js} +1 -1
  21. package/dist/preview-client/_static/{MarkdownAsset-58491579.js → MarkdownAsset-b42846c0.js} +1 -1
  22. package/dist/preview-client/_static/{MaterialAsset-c83c7d3d.js → MaterialAsset-0b9d7eba.js} +1 -1
  23. package/dist/preview-client/_static/{MaterialInspector-237b6a5e.js → MaterialInspector-23ea0240.js} +1 -1
  24. package/dist/preview-client/_static/{Menu-a427d272.js → Menu-05c1f0a4.js} +1 -1
  25. package/dist/preview-client/_static/{MeshAsset-1c11d7ab.js → MeshAsset-85e99837.js} +1 -1
  26. package/dist/preview-client/_static/{MeshRendererBaseComponent-8fd1f0df.js → MeshRendererBaseComponent-5621d663.js} +1 -1
  27. package/dist/preview-client/_static/{MeshRendererComponent-082c1a1a.js → MeshRendererComponent-c3c3c683.js} +1 -1
  28. package/dist/preview-client/_static/{MeshThumbnail-d8ee2674.js → MeshThumbnail-b1283749.js} +1 -1
  29. package/dist/preview-client/_static/{ParticleRendererComponent-ff12cdb1.js → ParticleRendererComponent-94656239.js} +1 -1
  30. package/dist/preview-client/_static/{PhysicsMaterialAsset-7e86c718.js → PhysicsMaterialAsset-cb9afb6e.js} +1 -1
  31. package/dist/preview-client/_static/{PhysicsStore-66a9a461.js → PhysicsStore-0a751fa0.js} +1 -1
  32. package/dist/preview-client/_static/{PointLight-a9992e50.js → PointLight-a2bfed75.js} +1 -1
  33. package/dist/preview-client/_static/{PostProcessComponent-c17ac553.js → PostProcessComponent-040cf521.js} +1 -1
  34. package/dist/preview-client/_static/{PrefabAsset-a6750aec.js → PrefabAsset-265f6f48.js} +1 -1
  35. package/dist/preview-client/_static/{PrimitiveMesh-388f3f36.js → PrimitiveMesh-70c93e7e.js} +1 -1
  36. package/dist/preview-client/_static/{ReferencedMaterial-f7ea80fb.js → ReferencedMaterial-831d0583.js} +1 -1
  37. package/dist/preview-client/_static/{RenderTargetAsset-c48990a4.js → RenderTargetAsset-b810caf3.js} +1 -1
  38. package/dist/preview-client/_static/{SceneAsset-1e802e29.js → SceneAsset-d05b1a79.js} +1 -1
  39. package/dist/preview-client/_static/{ShaderAsset-256afb00.js → ShaderAsset-370b6f1c.js} +1 -1
  40. package/dist/preview-client/_static/{ShaderChunkAsset-a42443fc.js → ShaderChunkAsset-e3487bd1.js} +1 -1
  41. package/dist/preview-client/_static/{ShaderUIScriptAsset-5acb02f5.js → ShaderUIScriptAsset-ebf57ceb.js} +1 -1
  42. package/dist/preview-client/_static/{SkinnedMeshRendererComponent-934c055b.js → SkinnedMeshRendererComponent-ee33da25.js} +1 -1
  43. package/dist/preview-client/_static/{SpineAnimationComponent-b04ba1ee.js → SpineAnimationComponent-12e694e8.js} +1 -1
  44. package/dist/preview-client/_static/{SpineSkeletonDataAsset-fff17383.js → SpineSkeletonDataAsset-0dffbb4d.js} +1 -1
  45. package/dist/preview-client/_static/{SpotLight-617d8957.js → SpotLight-ada565f2.js} +1 -1
  46. package/dist/preview-client/_static/{SpriteBaseComponent-062cb4f8.js → SpriteBaseComponent-3156cb3b.js} +1 -1
  47. package/dist/preview-client/_static/{SpriteMaskComponent-43ae2b1f.js → SpriteMaskComponent-a32024e1.js} +1 -1
  48. package/dist/preview-client/_static/{SpriteRendererComponent-4f52910c.js → SpriteRendererComponent-489486e0.js} +1 -1
  49. package/dist/preview-client/_static/{TextBaseComponent-bd7ed8ee.js → TextBaseComponent-520dea39.js} +1 -1
  50. package/dist/preview-client/_static/{TextRendererComponent-8db74598.js → TextRendererComponent-6be5f80c.js} +1 -1
  51. package/dist/preview-client/_static/{TextureAsset-d88af413.js → TextureAsset-9cd94531.js} +1 -1
  52. package/dist/preview-client/_static/{Tooltip-3bc02b10.js → Tooltip-71e5a4e7.js} +1 -1
  53. package/dist/preview-client/_static/{TrailRendererComponent-42a58f1d.js → TrailRendererComponent-74bf88c0.js} +1 -1
  54. package/dist/preview-client/_static/{TransformBaseComponent-77478ccb.js → TransformBaseComponent-0d241199.js} +1 -1
  55. package/dist/preview-client/_static/{TransformComponent-0f395b08.js → TransformComponent-49d279f5.js} +1 -1
  56. package/dist/preview-client/_static/{XRReferenceImageAsset-d6d8e59c.js → XRReferenceImageAsset-79e78558.js} +1 -1
  57. package/dist/preview-client/_static/{audio-d14900e2.js → audio-5d0ddf55.js} +1 -1
  58. package/dist/preview-client/_static/{createOnModelChange-c010a049.js → createOnModelChange-e65da908.js} +1 -1
  59. package/dist/preview-client/_static/{createReactComponent-d9f8b1af.js → createReactComponent-cb70ea50.js} +1 -1
  60. package/dist/preview-client/_static/index-0fef73f8.js +1 -0
  61. package/dist/preview-client/_static/index-1e036622.js +1 -0
  62. package/dist/preview-client/_static/index-1fd4207a.js +1 -0
  63. package/dist/preview-client/_static/{index-9feced3c.js → index-46c87b46.js} +1 -1
  64. package/dist/preview-client/_static/index-6649d404.js +1 -0
  65. package/dist/preview-client/_static/{index-f165015e.js → index-788e8750.js} +1 -1
  66. package/dist/preview-client/_static/{index-75e7d483.js → index-7e414715.js} +1 -1
  67. package/dist/preview-client/_static/index-87ef1c72.js +1 -0
  68. package/dist/preview-client/_static/{index-f4d91eb4.js → index-b13216a9.js} +1 -1
  69. package/dist/preview-client/_static/{index-4e7bb453.js → index-b4bde36a.js} +1 -1
  70. package/dist/preview-client/_static/{index-071c0532.js → index-d00c8bc3.js} +1 -1
  71. package/dist/preview-client/_static/index-d9ee84ce.js +1 -0
  72. package/dist/preview-client/_static/{index-365736f7.js → index-debbe073.js} +1 -1
  73. package/dist/preview-client/_static/{index-3660a664.js → index-e44b357e.js} +4 -4
  74. package/dist/preview-client/_static/{index-eb74362c.js → index-ea7fe254.js} +1 -1
  75. package/dist/preview-client/_static/{index-8e169cc2.js → index-f7bd6fef.js} +1 -1
  76. package/dist/preview-client/_static/{ktx2-encoder-e9b1c83a.js → ktx2-encoder-522fc017.js} +1 -1
  77. package/dist/preview-client/_static/{module-4a37a616.js → module-5547be1c.js} +1 -1
  78. package/dist/preview-client/_static/{module-81a206c0.js → module-57b6e417.js} +1 -1
  79. package/dist/preview-client/_static/{module-1c91b4e1.js → module-5906e0d4.js} +1 -1
  80. package/dist/preview-client/_static/{postmen-c7605b45.js → postmen-443b3e5f.js} +1 -1
  81. package/dist/preview-client/_static/{shader-data-utils-6ef12596.js → shader-data-utils-000170ae.js} +1 -1
  82. package/dist/preview-client/index.html +1 -1
  83. package/package.json +1 -1
  84. package/dist/preview-client/_static/index-1c260f88.js +0 -1
  85. package/dist/preview-client/_static/index-44137d7e.js +0 -1
  86. package/dist/preview-client/_static/index-5ae70b23.js +0 -1
  87. package/dist/preview-client/_static/index-be42fc1e.js +0 -1
  88. package/dist/preview-client/_static/index-cfa0dccc.js +0 -1
  89. package/dist/preview-client/_static/index-f3d42be3.js +0 -1
@@ -1,4 +1,4 @@
1
- var d=Object.defineProperty;var u=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>(u(s,typeof e!="symbol"?e+"":e,t),t);import{bR as m,bY as b,bZ as y,b_ as h,bX as v,aJ as w,av as x,bS as O,O as f,j,Z as F,n as R,e as U,o as A}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";import{A as g}from"./AssetViewer-1073ddb5.js";async function _(s){const e={uploadFiles:[],errors:[]};for(const t in s){const n=s[t],r=n.name.toLocaleLowerCase();(r.endsWith(".ttf")||r.endsWith(".otf")||r.endsWith(".woff"))&&e.uploadFiles.push({main:n})}return e}async function C(s){const e=m(s.main,"font.ttf");try{const t=e.name,n=b(t),r=y(t,n),o=await h.uploadBlob(`${t}.json`,e),i={fontName:r,fontUrl:encodeURI(o.url).replace(/\(/g,"%28").replace(/\)/g,"%29")};return new File([JSON.stringify(i)],r)}catch(t){console.error(t),v.error(`parse font file fail ${t}`)}return e}class p extends g{constructor(){super()}setViewAsset(e,t){const n=t.createChild("font_entity"),r=n.addComponent(f);r.font=e.engineObject,r.text=`ABCDEFGHIJKLM
1
+ var d=Object.defineProperty;var u=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>(u(s,typeof e!="symbol"?e+"":e,t),t);import{bR as m,bY as b,bZ as y,b_ as h,bX as v,aJ as w,av as x,bS as O,O as f,j,Z as F,n as R,e as U,o as A}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";import{A as g}from"./AssetViewer-d2c63b00.js";async function _(s){const e={uploadFiles:[],errors:[]};for(const t in s){const n=s[t],r=n.name.toLocaleLowerCase();(r.endsWith(".ttf")||r.endsWith(".otf")||r.endsWith(".woff"))&&e.uploadFiles.push({main:n})}return e}async function C(s){const e=m(s.main,"font.ttf");try{const t=e.name,n=b(t),r=y(t,n),o=await h.uploadBlob(`${t}.json`,e),i={fontName:r,fontUrl:encodeURI(o.url).replace(/\(/g,"%28").replace(/\)/g,"%29")};return new File([JSON.stringify(i)],r)}catch(t){console.error(t),v.error(`parse font file fail ${t}`)}return e}class p extends g{constructor(){super()}setViewAsset(e,t){const n=t.createChild("font_entity"),r=n.addComponent(f);r.font=e.engineObject,r.text=`ABCDEFGHIJKLM
2
2
  NOPQRSTUVWXYZ
3
3
  abcdefghijklm
4
4
  nopqrstuvwxyz
@@ -1,4 +1,4 @@
1
- import{bB as d,aH as x,aP as v,aM as m,av as e,aw as f,ax as b,aI as l,bC as g,aL as i}from"./index-3660a664.js";import{A as j,a as I}from"./Accordion-75b7b34e.js";/**
1
+ import{bB as d,aH as x,aP as v,aM as m,av as e,aw as f,ax as b,aI as l,bC as g,aL as i}from"./index-e44b357e.js";import{A as j,a as I}from"./Accordion-f938dadf.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.
@@ -1,4 +1,4 @@
1
- var Ut=Object.defineProperty;var Ft=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>(Ft(e,typeof t!="symbol"?t+"":t,n),n);import{f5 as Dt,aH as Bt,aJ as pt,av as I,bA as qt,q as mt,aK as Gt,aN as Fe,aw as te,f6 as ye,dr as ne,bz as De,aM as Wt,e1 as Be,bR as Ht,u as yt,S as Xt,x as j,aC as G,br as Kt,f7 as Qt,bX as qe,e as bt,f8 as Jt,bV as Yt,cp as Zt,f9 as Ge,Z as en,y as We,v as tn,aT as W,aU as nn,n as sn,o as rn,dL as an}from"./index-3660a664.js";import{B as N,P,a as A,A as Me,b as $e,K as At,N as on,M as V,E as ae,D as Le,u as be,R as pe,S as ln,T as Ne,c as vt,d as _t,e as Tt,C as cn,f as un,g as fn,G as Ae,h as He,F as hn,i as ve}from"./glTFIO-45ff9a17.js";import{a as oe}from"./meshopt_simplifier.module-cd99529d.js";import{u as Et,I as gn}from"./index-365736f7.js";import"./postmen-c7605b45.js";import{A as dn}from"./AssetViewer-1073ddb5.js";import{M as pn}from"./MaterialAsset-c83c7d3d.js";import{k as mn}from"./ktx2-encoder-e9b1c83a.js";function Xe(e){const t=e%4;return t===0?e:e+(4-t)}function yn(e){return e.toLowerCase().endsWith(".png")?"image/png":e.toLowerCase().endsWith(".jpg")||e.toLowerCase().endsWith(".jpeg")?"image/jpeg":e.toLowerCase().endsWith(".webp")?"image/webp":"application/octet-stream"}function wt(e){const{json:t,resources:n}=e,s=new Uint32Array([1179937895,2,12]),r=JSON.stringify(t),a=N.pad(N.encodeText(r),32),i=N.toView(new Uint32Array([a.byteLength,1313821514])),o=N.concat([i,a]);s[s.length-1]+=o.byteLength;const l=Object.values(n)[0];if(!l||!l.byteLength)return N.concat([N.toView(s),o]);const f=N.pad(l,0),c=N.toView(new Uint32Array([f.byteLength,5130562])),h=N.concat([c,f]);return s[s.length-1]+=h.byteLength,N.concat([N.toView(s),o,h])}function bn(e){const t=e.json,n=[],s=[];let r=0;function a(h){return h.uri===void 0?void 0:e.resources[h.uri]}const i=t.buffers??[],o=new Map;i.forEach((h,u)=>{const g=a(h);g!==void 0&&(n.push(new Uint8Array(g)),s.push(r),delete h.uri,h.byteLength=g.byteLength,o.set(u,r),r+=Xe(g.byteLength))});let l=i.length;(t.images||[]).forEach(h=>{const u=a(h);if(!u){delete h.uri;return}const g={buffer:0,byteOffset:r,byteLength:u.byteLength};o.set(l++,r),r+=Xe(u.byteLength);const d=t.bufferViews??[];h.bufferView=d.length,h.mimeType=yn(h.uri),delete h.uri,d.push(g),n.push(new Uint8Array(u)),s.push(g.byteOffset)});for(const h of t.bufferViews??[])h.byteOffset=(h.byteOffset??0)+(o.get(h.buffer)??0),h.buffer=0;const c=new Uint8Array(r);return n.forEach((h,u)=>{c.set(h,s[u])}),t.buffers=[{byteLength:r}],wt({json:t,resources:{"buffer.bin":c}})}function An(e){for(var t=new Array(e),n=0;n<e;++n)t[n]=n;return t}var vn=An;/*!
1
+ var Ut=Object.defineProperty;var Ft=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>(Ft(e,typeof t!="symbol"?t+"":t,n),n);import{f5 as Dt,aH as Bt,aJ as pt,av as I,bA as qt,q as mt,aK as Gt,aN as Fe,aw as te,f6 as ye,dr as ne,bz as De,aM as Wt,e1 as Be,bR as Ht,u as yt,S as Xt,x as j,aC as G,br as Kt,f7 as Qt,bX as qe,e as bt,f8 as Jt,bV as Yt,cp as Zt,f9 as Ge,Z as en,y as We,v as tn,aT as W,aU as nn,n as sn,o as rn,dL as an}from"./index-e44b357e.js";import{B as N,P,a as A,A as Me,b as $e,K as At,N as on,M as V,E as ae,D as Le,u as be,R as pe,S as ln,T as Ne,c as vt,d as _t,e as Tt,C as cn,f as un,g as fn,G as Ae,h as He,F as hn,i as ve}from"./glTFIO-45ff9a17.js";import{a as oe}from"./meshopt_simplifier.module-cd99529d.js";import{u as Et,I as gn}from"./index-debbe073.js";import"./postmen-443b3e5f.js";import{A as dn}from"./AssetViewer-d2c63b00.js";import{M as pn}from"./MaterialAsset-0b9d7eba.js";import{k as mn}from"./ktx2-encoder-522fc017.js";function Xe(e){const t=e%4;return t===0?e:e+(4-t)}function yn(e){return e.toLowerCase().endsWith(".png")?"image/png":e.toLowerCase().endsWith(".jpg")||e.toLowerCase().endsWith(".jpeg")?"image/jpeg":e.toLowerCase().endsWith(".webp")?"image/webp":"application/octet-stream"}function wt(e){const{json:t,resources:n}=e,s=new Uint32Array([1179937895,2,12]),r=JSON.stringify(t),a=N.pad(N.encodeText(r),32),i=N.toView(new Uint32Array([a.byteLength,1313821514])),o=N.concat([i,a]);s[s.length-1]+=o.byteLength;const l=Object.values(n)[0];if(!l||!l.byteLength)return N.concat([N.toView(s),o]);const f=N.pad(l,0),c=N.toView(new Uint32Array([f.byteLength,5130562])),h=N.concat([c,f]);return s[s.length-1]+=h.byteLength,N.concat([N.toView(s),o,h])}function bn(e){const t=e.json,n=[],s=[];let r=0;function a(h){return h.uri===void 0?void 0:e.resources[h.uri]}const i=t.buffers??[],o=new Map;i.forEach((h,u)=>{const g=a(h);g!==void 0&&(n.push(new Uint8Array(g)),s.push(r),delete h.uri,h.byteLength=g.byteLength,o.set(u,r),r+=Xe(g.byteLength))});let l=i.length;(t.images||[]).forEach(h=>{const u=a(h);if(!u){delete h.uri;return}const g={buffer:0,byteOffset:r,byteLength:u.byteLength};o.set(l++,r),r+=Xe(u.byteLength);const d=t.bufferViews??[];h.bufferView=d.length,h.mimeType=yn(h.uri),delete h.uri,d.push(g),n.push(new Uint8Array(u)),s.push(g.byteOffset)});for(const h of t.bufferViews??[])h.byteOffset=(h.byteOffset??0)+(o.get(h.buffer)??0),h.buffer=0;const c=new Uint8Array(r);return n.forEach((h,u)=>{c.set(h,s[u])}),t.buffers=[{byteLength:r}],wt({json:t,resources:{"buffer.bin":c}})}function An(e){for(var t=new Array(e),n=0;n<e;++n)t[n]=n;return t}var vn=An;/*!
2
2
  * Determine if an object is a Buffer
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
@@ -1,4 +1,4 @@
1
- import{c as e}from"./createReactComponent-d9f8b1af.js";/**
1
+ import{c as e}from"./createReactComponent-cb70ea50.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./createReactComponent-d9f8b1af.js";/**
1
+ import{c as e}from"./createReactComponent-cb70ea50.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.
@@ -1 +1 @@
1
- var m=Object.defineProperty;var u=(r,e,o)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o;var p=(r,e,o)=>(u(r,typeof e!="symbol"?e+"":e,o),o);import{a as n,s as y,aD as v,p as c,C as g,l as P,f as b,h as f,g as C,E as L,d as _}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";var x=Object.defineProperty,O=Object.getOwnPropertyDescriptor,h=(r,e,o,l)=>{for(var a=l>1?void 0:l?O(e,o):e,s=r.length-1,i;s>=0;s--)(i=r[s])&&(a=(l?i(e,o,a):i(a))||a);return l&&a&&x(e,o,a),a};const t=[n.Everything,n.Nothing];class d extends L{constructor(){super(...arguments);p(this,"color",{r:1,g:1,b:1,a:1,intensity:1});p(this,"cullingMask",_(n.Everything,t))}}h([y(v()),c({label:"light.color",type:g.Color,mode:"hdr",bindPath:"color"})],d.prototype,"color",2);h([y(P(t)),b(f(t)),c({label:"light.culling-mask",type:g.Select,...C(t),bindPath:"cullingMask"})],d.prototype,"cullingMask",2);export{d as L};
1
+ var m=Object.defineProperty;var u=(r,e,o)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o;var p=(r,e,o)=>(u(r,typeof e!="symbol"?e+"":e,o),o);import{a as n,s as y,aD as v,p as c,C as g,l as P,f as b,h as f,g as C,E as L,d as _}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";var x=Object.defineProperty,O=Object.getOwnPropertyDescriptor,h=(r,e,o,l)=>{for(var a=l>1?void 0:l?O(e,o):e,s=r.length-1,i;s>=0;s--)(i=r[s])&&(a=(l?i(e,o,a):i(a))||a);return l&&a&&x(e,o,a),a};const t=[n.Everything,n.Nothing];class d extends L{constructor(){super(...arguments);p(this,"color",{r:1,g:1,b:1,a:1,intensity:1});p(this,"cullingMask",_(n.Everything,t))}}h([y(v()),c({label:"light.color",type:g.Color,mode:"hdr",bindPath:"color"})],d.prototype,"color",2);h([y(P(t)),b(f(t)),c({label:"light.culling-mask",type:g.Select,...C(t),bindPath:"cullingMask"})],d.prototype,"cullingMask",2);export{d as L};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var c=(o,e,t)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(c(o,typeof e!="symbol"?e+"":e,t),t);import{L as g}from"./module-4a37a616.js";import{E as b,p as l,C as a,s}from"./index-3660a664.js";import"./index-365736f7.js";import{c as P}from"./Component-6d1e73e5.js";import"./postmen-c7605b45.js";var d=Object.defineProperty,L=Object.getOwnPropertyDescriptor,n=(o,e,t,y)=>{for(var i=y>1?void 0:y?L(e,t):e,u=o.length-1,m;u>=0;u--)(m=o[u])&&(i=(y?m(e,t,i):m(i))||i);return y&&i&&d(e,t,i),i};let r=class extends b{constructor(e,t){super(e,t);p(this,"resource",null);p(this,"autoPlay",!0);p(this,"isLooping",!0);p(this,"speed",1);p(this,"priority",0)}};n([l({label:"lottie.resource.label",info:"lottie.resource.info",type:a.AssetPicker,assetType:"Lottie",bindPath:"resource"}),s()],r.prototype,"resource",2);n([l({label:"lottie.auto-play.label",info:"lottie.auto-play.info",type:a.Toggle,bindPath:"autoPlay",onChange(o,e,t){t||o.engineObject.pause()}}),s()],r.prototype,"autoPlay",2);n([l({label:"lottie.is-looping.label",info:"lottie.is-looping.info",type:a.Toggle,bindPath:"isLooping"}),s()],r.prototype,"isLooping",2);n([l({label:"lottie.speed.label",info:"lottie.speed.info",type:a.Number,dragStep:.01,bindPath:"speed"}),s()],r.prototype,"speed",2);n([l({label:"lottie.priority.label",info:"lottie.priority.info",type:a.Number,bindPath:"priority"}),s()],r.prototype,"priority",2);r=n([P({type:"LottieAnimation",external:!0,componentsMenu:{group:"2D",label:"component.lottie-animation.title"}})],r);b.registerCustomEngineComponent("LottieAnimation",g);export{r as LottieAnimationComponent};
1
+ var f=Object.defineProperty;var c=(o,e,t)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(c(o,typeof e!="symbol"?e+"":e,t),t);import{L as g}from"./module-5547be1c.js";import{E as b,p as l,C as a,s}from"./index-e44b357e.js";import"./index-debbe073.js";import{c as P}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";var d=Object.defineProperty,L=Object.getOwnPropertyDescriptor,n=(o,e,t,y)=>{for(var i=y>1?void 0:y?L(e,t):e,u=o.length-1,m;u>=0;u--)(m=o[u])&&(i=(y?m(e,t,i):m(i))||i);return y&&i&&d(e,t,i),i};let r=class extends b{constructor(e,t){super(e,t);p(this,"resource",null);p(this,"autoPlay",!0);p(this,"isLooping",!0);p(this,"speed",1);p(this,"priority",0)}};n([l({label:"lottie.resource.label",info:"lottie.resource.info",type:a.AssetPicker,assetType:"Lottie",bindPath:"resource"}),s()],r.prototype,"resource",2);n([l({label:"lottie.auto-play.label",info:"lottie.auto-play.info",type:a.Toggle,bindPath:"autoPlay",onChange(o,e,t){t||o.engineObject.pause()}}),s()],r.prototype,"autoPlay",2);n([l({label:"lottie.is-looping.label",info:"lottie.is-looping.info",type:a.Toggle,bindPath:"isLooping"}),s()],r.prototype,"isLooping",2);n([l({label:"lottie.speed.label",info:"lottie.speed.info",type:a.Number,dragStep:.01,bindPath:"speed"}),s()],r.prototype,"speed",2);n([l({label:"lottie.priority.label",info:"lottie.priority.info",type:a.Number,bindPath:"priority"}),s()],r.prototype,"priority",2);r=n([P({type:"LottieAnimation",external:!0,componentsMenu:{group:"2D",label:"component.lottie-animation.title"}})],r);b.registerCustomEngineComponent("LottieAnimation",g);export{r as LottieAnimationComponent};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var u=(e,t,o)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var p=(e,t,o)=>(u(e,typeof t!="symbol"?t+"":t,o),o);import{j as d,u as m,w as b,x as h,n as w,e as f,o as y}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";var v=Object.defineProperty,D=Object.getOwnPropertyDescriptor,l=(e,t,o,r)=>{for(var n=r>1?void 0:r?D(t,o):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(n=(r?a(t,o,n):a(n))||n);return r&&n&&v(t,o,n),n};let i=class extends d{constructor(t){super(t);p(this,"content","");m(this),this.onDoubleClick=this.onDoubleClick.bind(this)}async initByMain(t){this.content=await t.text()}async initByCreation(){return""}getMainData(){return this.content}onDoubleClick(){b(this.root.projectStore.id,this.id)}};l([h],i.prototype,"content",2);i=l([w({type:"Markdown",label:f("asset.markdown.title"),defaultName:"Document.md",extname:"md",importMenuConfig:{type:y.Add},bundle({content:e}){return{content:new Blob([e],{type:"text/markdown; charset=utf-8"})}}})],i);export{i as MarkdownAsset};
1
+ var c=Object.defineProperty;var u=(e,t,o)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var p=(e,t,o)=>(u(e,typeof t!="symbol"?t+"":t,o),o);import{j as d,u as m,w as b,x as h,n as w,e as f,o as y}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";var v=Object.defineProperty,D=Object.getOwnPropertyDescriptor,l=(e,t,o,r)=>{for(var n=r>1?void 0:r?D(t,o):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(n=(r?a(t,o,n):a(n))||n);return r&&n&&v(t,o,n),n};let i=class extends d{constructor(t){super(t);p(this,"content","");m(this),this.onDoubleClick=this.onDoubleClick.bind(this)}async initByMain(t){this.content=await t.text()}async initByCreation(){return""}getMainData(){return this.content}onDoubleClick(){b(this.root.projectStore.id,this.id)}};l([h],i.prototype,"content",2);i=l([w({type:"Markdown",label:f("asset.markdown.title"),defaultName:"Document.md",extname:"md",importMenuConfig:{type:y.Add},bundle({content:e}){return{content:new Blob([e],{type:"text/markdown; charset=utf-8"})}}})],i);export{i as MarkdownAsset};
@@ -1 +1 @@
1
- var N=Object.defineProperty;var $=(p,e,t)=>e in p?N(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var f=(p,e,t)=>($(p,typeof e!="symbol"?e+"":e,t),t);import{y as j,bD as F,bE as V,bF as U,F as G,ai as K,V as z,b3 as H,b2 as b,j as Q,q as k,u as W,bG as D,bH as A,a1 as m,a2 as T,bI as J,C as O,bJ as w,bK as Y,aE as S,bL as q,e as E,bM as X,K as Z,ae as ee,ah as te,af as C,R as v,_ as ae,z as re,x as L,aC as _,n as se,o as ie}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";import{M as ne}from"./MaterialInspector-237b6a5e.js";import{A as oe}from"./AssetViewer-1073ddb5.js";import{E as g,s as x}from"./shader-data-utils-6ef12596.js";class he extends oe{constructor(){super(...arguments);f(this,"_sphereRenderer",null);f(this,"_particleRenderer",null);f(this,"_asset",null);f(this,"_shaderReactionDisposer",null);f(this,"onShaderChange",()=>{const{_asset:t}=this;t.engineObject.shader.name==="Effect/Particle"?(this._particleRenderer.entity.isActive=!0,this._sphereRenderer.entity.isActive=!1,this._particleRenderer.setMaterial(t.engineObject)):(this._particleRenderer.entity.isActive=!1,this._sphereRenderer.entity.isActive=!0,this._sphereRenderer.setMaterial(t.engineObject))})}setViewAsset(t,r){if(!(t instanceof y))return;const i=r.createChild("material");this._asset=t;const a=this._sphereRenderer=i.createChild("mat").addComponent(j);a.mesh=F.createSphere(r.engine,1,32,!0);const n=this._particleRenderer=i.createChild("pat").addComponent(V);n.generator.main.duration=1e3,n.generator.main.startSpeed.constant=0,this._entity=i,r.addChild(this._entity),this.onShaderChange(),this._shaderReactionDisposer=U(()=>{var o,l;return(l=(o=this._asset)==null?void 0:o.shaderRef)==null?void 0:l.refId},()=>{this.onShaderChange()})}stopViewAsset(){var t;super.stopViewAsset(),(t=this._shaderReactionDisposer)==null||t.call(this),this._shaderReactionDisposer=null,this._asset=null}}class P{static update(e,t){if(!(t instanceof y))return;const r=t.engineObject;if(!r||!r.shader){this.entity&&this.sphereRenderer&&this.particleRenderer&&this.clear();return}this.entity?this.entity.isActive=!0:this.initScene(e),r.shader.name==="Effect/Particle"?(this.sphereRenderer.entity.isActive=!1,this.particleRenderer.entity.isActive=!0,this.particleRenderer.setMaterial(r),this.particleRenderer.generator._playTime=5):(this.particleRenderer.entity.isActive=!1,this.sphereRenderer.entity.isActive=!0,this.sphereRenderer.setMaterial(r))}static clear(){var e,t;(e=this.sphereRenderer)!=null&&e.entity&&(this.sphereRenderer.entity.isActive=!1),(t=this.particleRenderer)!=null&&t.entity&&(this.particleRenderer.entity.isActive=!1),this.entity&&(this.entity.isActive=!1)}static initScene(e){const t=this.entity=e.createChild("material"),r=this.sphereRenderer=t.createChild("mat").addComponent(j);r.mesh=F.createSphere(e.engine,2,64,!0),this.particleRenderer=t.createChild("pat").addComponent(V),this.particleRenderer.bounds.max.set(.5,.5,.5),this.particleRenderer.bounds.min.set(-.5,-.5,-.5)}}f(P,"entity",null),f(P,"sphereRenderer",null),f(P,"particleRenderer",null);function B(p){return p instanceof G?{x:p.x,y:p.y}:p instanceof K?{x:p.x,y:p.y,z:p.z}:p instanceof z?{x:p.x,y:p.y,z:p.z,w:p.w}:p instanceof H?{r:p.r,g:p.g,b:p.b,a:p.a}:p}function pe(p){switch(p){case b.Color:return"Color";case b.Float:return"Float";case b.Int:return"Integer";case b.Matrix:return"Matrix";case b.Texture:return"Texture";case b.TextureArray:return"TextureArray";case b.Vector2:return"Vector2";case b.Vector3:return"Vector3";case b.Vector4:return"Vector4"}}var ce=Object.defineProperty,de=Object.getOwnPropertyDescriptor,I=(p,e,t,r)=>{for(var i=r>1?void 0:r?de(e,t):e,a=p.length-1,n;a>=0;a--)(n=p[a])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ce(e,t,i),i};let y=class extends Q{constructor(e){super(e);f(this,"acceptDragLayer",k.Texture);f(this,"shaderRef",{refId:null});f(this,"shaderDataKeys",new Set);f(this,"formConfig",null);f(this,"_autoSaveSuppressed",!1);W(this),D(this,{proxyConfigs:[]})}static initBuiltinMaterial(e,t){e.shader=t;const r=e.shaderData;switch(r.disableMacro("MATERIAL_NEED_WORLD_POS"),r.disableMacro("MATERIAL_OMIT_NORMAL"),r.disableMacro("MATERIAL_NEED_TILING_OFFSET"),r.disableMacro("MATERIAL_SUN_HIGH_QUALITY"),t.name){case"Unlit":r.enableMacro("MATERIAL_OMIT_NORMAL"),r.enableMacro("MATERIAL_NEED_TILING_OFFSET");break;case"PBR":case"bake-pbr":case"BlinnPhong":r.enableMacro("MATERIAL_NEED_WORLD_POS"),r.enableMacro("MATERIAL_NEED_TILING_OFFSET");break;case"Sky/SkyProcedural":r.enableMacro("MATERIAL_SUN_HIGH_QUALITY");break;case"Effect/Particle":r.enableMacro("MATERIAL_OMIT_NORMAL");break}}setAutoSaveSuppressed(e){this._autoSaveSuppressed=e}setRenderQueueType(e){this.engineObject.shaderData.setInt("renderQueueType",e)}setBlendStateEnabled(e){this.engineObject.shaderData.setInt("blendEnabled",e?1:0)}setDepthWriteEnabled(e){this.engineObject.shaderData.setInt("depthWriteEnabled",e?1:0)}setCullMode(e){this.engineObject.shaderData.setInt("rasterStateCullMode",e)}setBlendMode(e){const t=this.engineObject.shaderData;switch(e){case A.Normal:t.setInt("sourceColorBlendFactor",m.SourceAlpha),t.setInt("destinationColorBlendFactor",m.OneMinusSourceAlpha),t.setInt("sourceAlphaBlendFactor",m.One),t.setInt("destinationAlphaBlendFactor",m.OneMinusSourceAlpha),t.setInt("colorBlendOperation",T.Add),t.setInt("alphaBlendOperation",T.Add);break;case A.Additive:t.setInt("sourceColorBlendFactor",m.SourceAlpha),t.setInt("destinationColorBlendFactor",m.One),t.setInt("sourceAlphaBlendFactor",m.One),t.setInt("destinationAlphaBlendFactor",m.OneMinusSourceAlpha),t.setInt("colorBlendOperation",T.Add),t.setInt("alphaBlendOperation",T.Add);break}}bindShaderAsset(e,t){for(const r of this.shaderDataKeys)this.removePropertyChangeListener(r);return this.shaderDataKeys.clear(),e.onReady().then(async()=>{var i;if(this.isInitCompleted){if(e.shaderScriptRefId){const a=this.root.assetStore.getAsset(e.shaderScriptRefId.refId);a==null||a.onShaderChange(this._engineObject)}else e.builtinUIScript&&e.builtinUIScript.onMaterialShaderSwitched(this._engineObject);t=this._getMainData()}const r=e.properties?J(e.properties):[];e.isBuiltinShader()&&y.initBuiltinMaterial(this.engineObject,e.engineObject),t=t||this._getMainData(),await this._proxyShaderProps(r,t,this.isInitCompleted),this.refreshFormConfig(r,t),this.refreshAnimatableProperties(r),this.shaderRef&&this.root.assetStore.getAssetByRef(this.shaderRef).then(a=>{a!==e&&(a==null||a.removeReferencedMaterial(this))}).catch(()=>{}),e.addReferencedMaterial(this),this.shaderRef={refId:e.id},await this.applyBoundPathChange("shader",O.AssetPicker,this.shaderRef),(i=this.updateThumbnail)==null||i.call(this)})}async _proxyShaderProps(e,t,r=!0){var n;this.proxyConfigs=e;const i=(n=this.extraData)==null?void 0:n.disabledMacros,a=e.map(async o=>{var l;if(this.proxySetter(o),this._virualShaderProps(e),o.bundleType==="macro"){const s=o.macroInfo,h=t.macros.find(c=>c.name===o.prop);if(!w(this,o.prop)){let c;h!=null?(c=h.value,s&&(s.checked=!0)):i!=null&&i.includes(o.prop)?(c=void 0,s&&(s.checked=!1)):c=o.defaultValue,D(this,{[o.prop]:c})}if(r)if(h){const c=h.value??o.defaultValue;c==null?s==null||s.onSwitch(!0,this):await o.onChange(this,o.prop,c)}else!(i!=null&&i.includes(o.prop))&&(s!=null&&s.checked)&&(s==null||s.onSwitch(!0,this))}else{const s=t.shaderData[o.prop];let h=s?s.value:this[o.prop]??o.defaultValue;if(h!=null&&h.refId&&!this.root.assetStore.assets[h.refId]&&(h=void 0),((l=o.uiInfo)==null?void 0:l.type)===g.Color)if(o.uiInfo.mode==="hdr"){const c=h.intensity??1;c!==0&&(h.r/=c,h.g/=c,h.b/=c),h.intensity=c}else h.intensity=1;w(this,o.prop)||D(this,{[o.prop]:h}),r&&this.notifyPropertyChange(o.prop,!1)}});await Promise.all(a)}proxySetter(e){const{prop:t,onChange:r,bundleType:i}=e,a=async(n,o)=>{var s;const l=this._engineObject.shaderData;i==="macro"?l.enableMacro(t,n):await x(this,t,n,e.engineType??((s=e.uiInfo)==null?void 0:s.type)),await r(this,t,n),o!==!1&&!this._autoSaveSuppressed&&(await this.root.assetFacade.persistAssetMain(this.id),this.updateThumbnail())};this.addPropertyChangeListener(t,a),this.shaderDataKeys.add(t)}_virualShaderProps(e){const t=this;e.forEach(r=>{Y(t,r.prop)})}refreshFormConfig(e,t){var i,a,n,o,l;const r={root:[],groups:{}};if(t){for(const s of e)if(!((i=s.uiInfo)!=null&&i.hide)){if((a=s.uiInfo)!=null&&a.group){if((n=s.uiInfo)!=null&&n.group){let h=r.groups[s.uiInfo.group];h||(h={type:O.Group,property:s.uiInfo.group,children:[]},r.groups[s.uiInfo.group]=h);const c=s.uiInfo;c.property=s.prop,s.macroInfo&&(c.macroConfig=s.macroInfo),h.children.push(c)}}else{const h=s.uiInfo;h.property=s.prop,s.macroInfo&&(h.macroConfig=s.macroInfo),r.root.push(h)}s.bundleType==="macro"?this[s.prop]=((o=t.macros.find(h=>h.name===s.prop))==null?void 0:o.value)??s.defaultValue:this[s.prop]=((l=t.shaderData[s.prop])==null?void 0:l.value)??s.defaultValue}}this.formConfig=r}refreshAnimatableProperties(e){var t,r,i;this._additionAnimatableProperties.length=0;for(const a of e){if(!a.uiInfo||a.uiInfo.hide||a.bundleType==="macro")continue;let n={};if((a.setPath||a.getPath||a.valueType||a.interpolationType)&&(n={setPath:a.setPath,getPath:a.getPath,valueType:a.valueType,interpolationType:a.interpolationType}),!n.setPath&&!n.getPath&&a.engineType&&(a.bundleType==="shaderData"||!a.bundleType))switch(a.engineType){case g.Float:n={setPath:`shaderData.setFloat('${a.prop}', $value)`,getPath:`shaderData.getFloat('${a.prop}')`,valueType:S.Float};break;case g.Integer:n={setPath:`shaderData.setInt('${a.prop}', $value)`,getPath:`shaderData.getInt('${a.prop}')`,valueType:S.Float,interpolationType:q.Step};break;case g.Vector2:n={setPath:`shaderData.getVector2('${a.prop}')`,getPath:`shaderData.getVector2('${a.prop}')`,valueType:S.Vector2};break;case g.Vector3:n={setPath:`shaderData.getVector3('${a.prop}')`,getPath:`shaderData.getVector3('${a.prop}')`,valueType:S.Vector3};break;case g.Vector4:n={setPath:`shaderData.getVector4('${a.prop}')`,getPath:`shaderData.getVector4('${a.prop}')`,valueType:S.Vector4};break;case g.Color:n={setPath:`shaderData.getColor('${a.prop}')`,getPath:`shaderData.getColor('${a.prop}')`,valueType:S.Color};break;case g.Boolean:n={setPath:`shaderData.setBoolean('${a.prop}', $value)`,getPath:`shaderData.getBoolean('${a.prop}')`,valueType:S.Boolean};break;case g.Texture:n={setPath:`shaderData.setTexture('${a.prop}', $value)`,getPath:`shaderData.getTexture('${a.prop}')`,valueType:S.ReferResource};break}if(!n.setPath&&!n.getPath){if(a.bundleType==="other")continue;continue}this._additionAnimatableProperties.push({property:a.prop,label:(t=a.uiInfo)!=null&&t.label?E(a.uiInfo.label):a.prop,type:(r=a.uiInfo)==null?void 0:r.type,propertyProxyConfig:n}),(i=a.uiInfo)!=null&&i.label&&(n.label=E(a.uiInfo.label)),X(this,a.prop,n)}}async initByMain(e){var c;const t=JSON.parse(await e.text());let r=t.shaderRef;const i=t.shaderData,a=t.macros;if(!r&&typeof t.shader=="string"){const d=Object.values(this.root.assetStore.assets).find(u=>u.meta.type==="Shader"&&u.meta.builtinShaderName===t.shader);d&&(r={refId:d.id})}if(!r)throw"invalid material";this.shaderRef=r;const n=new Z(this.engine);this.setDragTempEntity(n);const o=await this.root.assetStore.getAssetByRef(r),l=o.engineObject??ee.find("Unlit"),s=new te(this.engine,l);this.bindEngineObject(s);const h=s.shaderData;if(a)for(const d of a)h.enableMacro(d.name,d.value);if(i)for(const d in i){const u=i[d];let R=u.value;if(u.type===g.Color){R={...u.value};const M=u.value.intensity??1;M!==0&&(R.r/=M,R.g/=M,R.b/=M)}x(this,d,R,u.type)}await this.bindShaderAsset(o,t),(c=this.updateThumbnail)==null||c.call(this),await this.applyBoundPathChange("name",O.Input,this.name),this._checkSchemaOnInit(t,o)}_checkSchemaOnInit(e,t){e.shader!==t.engineObject.name&&this.root.assetFacade.persistAssetMain(this.id)}initByEngineObject(e){const t=this;this.bindEngineObject(e),t.shader=e.shader.name,t._name=e.name??"";const i=Object.values(this.root.assetStore.assets).filter(h=>h.meta.type==="Shader"&&!!h.meta.builtinShaderName).find(h=>h.meta.builtinShaderName===e.shader.name);this.shaderRef={refId:i.id};const a=e.shaderData,n=new Set((i.properties??[]).map(h=>h.prop));if(n.has("isTransparent")&&(t.isTransparent=a.getInt("blendEnabled")===1),n.has("material_AlphaCutoff")&&(t.alphaCutoff=a.getFloat("material_AlphaCutoff")),n.has("renderFace"))switch(a.getInt("rasterStateCullMode")){case C.Back:t.renderFace=v.Front;break;case C.Front:t.renderFace=v.Back;break;case C.Off:t.renderFace=v.Double;break}n.has("blendMode")&&(t.blendMode=a.getInt("destinationColorBlendFactor")===m.One?A.Additive:A.Normal),a.getProperties().forEach(h=>{const c=a.getPropertyValue(h);if(c instanceof ae){const d=this.root.assetStore.engineObjectToAssetMap.get(c);this[h.name]=d==null?void 0:d.getCurrentRef()}else this[h.name]=B(c)});const l=this._getMainData(),s=i.properties?[...i.properties]:[];this._proxyShaderProps(s,l,!1),this.bindShaderAsset(i,l)}afterDelete(){var e;(e=this.engineObject)==null||e.destroy(!0)}rename(e){return this.root.assetFacade.persistAssetMain(this.id),super.rename(e)}_getMainData(e){var s,h,c;const t=[],r=(e??this.engineObject).shaderData;r.getMacros(t);const i=t.map(({name:d,value:u})=>u===void 0?{name:d}:{name:d,value:u}),a=[],n={};r.getProperties(a);for(const d of a){let u;if(d.type===b.Texture||d.type===b.TextureArray)u=this[d.name];else{const R=r.getPropertyValue(d);u=B(R),((s=this[d.name])==null?void 0:s.intensity)!=null&&(u.intensity=(h=this[d.name])==null?void 0:h.intensity)}u!=null&&(n[d.name]={type:pe(d.type),value:u})}const o=(c=this.shaderRef)!=null&&c.refId?this.root.assetStore.getAsset(this.shaderRef.refId):void 0,l=!!(o!=null&&o.builtinShaderName);return{name:this.name,shader:this.engineObject.shader.name,macros:i,shaderData:n,...l?{}:{shaderRef:this.shaderRef}}}getMainData(){return JSON.stringify(this._getMainData())}async initByCreation(){var l;const e=new re(this.engine),t=[];e.shaderData.getMacros(t);const r=t.map(({name:s,value:h})=>h===void 0?{name:s}:{name:s,value:h});this.bindEngineObject(e);const i=this.root.assetStore.getAsset("0000501"),a=i!=null&&i.properties?[...i.properties]:[],n={};for(const s of a)s.defaultValue&&(n[s.prop]={value:s.defaultValue,type:s.engineType??((l=s.uiInfo)==null?void 0:l.type)});const o={shaderData:n,name:this.name,shader:e.shader.name,macros:r};return this._proxyShaderProps(a,o,!1),o}async onSubAssetEdit(){var i;const e=await this.root.assetFacade.createAssetByAdd({assetType:"Material",name:`${this._name}-copied`});this.engineObject.cloneTo(e.engineObject),await e.applyBoundPathChange("name",O.Input,e.name),e.initByEngineObject(e.engineObject),e.updateThumbnail(),await this.root.assetFacade.persistAssetMain(e.id);const t=await this.root.assetStore.getAssetByRef({refId:this.mainId}),r=((i=t.engineObject.materials)==null?void 0:i.indexOf(this._engineObject))??-1;r>=0&&await t.replaceMaterial(r,e.getCurrentRef()),this.root.assetStore.selectAsset(e.id)}saveMainImmediately(){return!this.engineObject||!this.engineObject.shaderData?Promise.resolve(void 0):(this.root.projectStore.setSyncStatus("syncing"),super.saveMainImmediately().then(e=>(e&&this.root.projectStore.setSyncStatus("success"),e)).catch(e=>{throw this.root.projectStore.setSyncStatus("error"),e}))}async _onDrop(e,t){var i,a;const r="material_BaseTexture";if(r in this){const n=t.getCurrentRef();this[r]=n;const o=this.root.assetStore.getAsset((i=this.shaderRef)==null?void 0:i.refId),l=(a=o==null?void 0:o.properties)==null?void 0:a.find(s=>s.prop===r);l&&await l.onChange(this,r,n),await this.root.assetFacade.persistAssetMain(this.id)}this.dropping=!1}async onDropToViewport(){const{sceneStore:e,sceneUIStore:t}=this.root,r=t.hoveredEntityId;if(r){const i=e.getEntityModel(r);if(i){const a=i.getComponentByTypeName("MeshRenderer"),n=i.getComponentByTypeName("SkinnedMeshRenderer"),o=a||n;o&&this.root.componentFacade.updateComponent(i.id,o.id,{material:this.getCurrentRef()})}}this.root.projectStore.currentViewport.viewport.onDrop()}};I([L],y.prototype,"shaderRef",2);I([L.ref],y.prototype,"formConfig",2);I([_],y.prototype,"bindShaderAsset",1);I([_],y.prototype,"_proxyShaderProps",1);I([_],y.prototype,"proxySetter",1);I([_],y.prototype,"_virualShaderProps",1);I([_],y.prototype,"refreshAnimatableProperties",1);I([_],y.prototype,"_onDrop",1);y=I([se({type:"Material",label:E("asset.material.title"),loaderType:"Material",extname:"mat",importMenuConfig:{type:ie.Add},customInspector:ne,viewer:he,thumbnail:P,dragLayer:k.Material})],y);const Ie=Object.freeze(Object.defineProperty({__proto__:null,get MaterialAsset(){return y}},Symbol.toStringTag,{value:"Module"}));export{y as M,he as a,Ie as b};
1
+ var N=Object.defineProperty;var $=(p,e,t)=>e in p?N(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var f=(p,e,t)=>($(p,typeof e!="symbol"?e+"":e,t),t);import{y as j,bD as F,bE as V,bF as U,F as G,ai as K,V as z,b3 as H,b2 as b,j as Q,q as k,u as W,bG as D,bH as A,a1 as m,a2 as T,bI as J,C as O,bJ as w,bK as Y,aE as S,bL as q,e as E,bM as X,K as Z,ae as ee,ah as te,af as C,R as v,_ as ae,z as re,x as L,aC as _,n as se,o as ie}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";import{M as ne}from"./MaterialInspector-23ea0240.js";import{A as oe}from"./AssetViewer-d2c63b00.js";import{E as g,s as x}from"./shader-data-utils-000170ae.js";class he extends oe{constructor(){super(...arguments);f(this,"_sphereRenderer",null);f(this,"_particleRenderer",null);f(this,"_asset",null);f(this,"_shaderReactionDisposer",null);f(this,"onShaderChange",()=>{const{_asset:t}=this;t.engineObject.shader.name==="Effect/Particle"?(this._particleRenderer.entity.isActive=!0,this._sphereRenderer.entity.isActive=!1,this._particleRenderer.setMaterial(t.engineObject)):(this._particleRenderer.entity.isActive=!1,this._sphereRenderer.entity.isActive=!0,this._sphereRenderer.setMaterial(t.engineObject))})}setViewAsset(t,r){if(!(t instanceof y))return;const i=r.createChild("material");this._asset=t;const a=this._sphereRenderer=i.createChild("mat").addComponent(j);a.mesh=F.createSphere(r.engine,1,32,!0);const n=this._particleRenderer=i.createChild("pat").addComponent(V);n.generator.main.duration=1e3,n.generator.main.startSpeed.constant=0,this._entity=i,r.addChild(this._entity),this.onShaderChange(),this._shaderReactionDisposer=U(()=>{var o,l;return(l=(o=this._asset)==null?void 0:o.shaderRef)==null?void 0:l.refId},()=>{this.onShaderChange()})}stopViewAsset(){var t;super.stopViewAsset(),(t=this._shaderReactionDisposer)==null||t.call(this),this._shaderReactionDisposer=null,this._asset=null}}class P{static update(e,t){if(!(t instanceof y))return;const r=t.engineObject;if(!r||!r.shader){this.entity&&this.sphereRenderer&&this.particleRenderer&&this.clear();return}this.entity?this.entity.isActive=!0:this.initScene(e),r.shader.name==="Effect/Particle"?(this.sphereRenderer.entity.isActive=!1,this.particleRenderer.entity.isActive=!0,this.particleRenderer.setMaterial(r),this.particleRenderer.generator._playTime=5):(this.particleRenderer.entity.isActive=!1,this.sphereRenderer.entity.isActive=!0,this.sphereRenderer.setMaterial(r))}static clear(){var e,t;(e=this.sphereRenderer)!=null&&e.entity&&(this.sphereRenderer.entity.isActive=!1),(t=this.particleRenderer)!=null&&t.entity&&(this.particleRenderer.entity.isActive=!1),this.entity&&(this.entity.isActive=!1)}static initScene(e){const t=this.entity=e.createChild("material"),r=this.sphereRenderer=t.createChild("mat").addComponent(j);r.mesh=F.createSphere(e.engine,2,64,!0),this.particleRenderer=t.createChild("pat").addComponent(V),this.particleRenderer.bounds.max.set(.5,.5,.5),this.particleRenderer.bounds.min.set(-.5,-.5,-.5)}}f(P,"entity",null),f(P,"sphereRenderer",null),f(P,"particleRenderer",null);function B(p){return p instanceof G?{x:p.x,y:p.y}:p instanceof K?{x:p.x,y:p.y,z:p.z}:p instanceof z?{x:p.x,y:p.y,z:p.z,w:p.w}:p instanceof H?{r:p.r,g:p.g,b:p.b,a:p.a}:p}function pe(p){switch(p){case b.Color:return"Color";case b.Float:return"Float";case b.Int:return"Integer";case b.Matrix:return"Matrix";case b.Texture:return"Texture";case b.TextureArray:return"TextureArray";case b.Vector2:return"Vector2";case b.Vector3:return"Vector3";case b.Vector4:return"Vector4"}}var ce=Object.defineProperty,de=Object.getOwnPropertyDescriptor,I=(p,e,t,r)=>{for(var i=r>1?void 0:r?de(e,t):e,a=p.length-1,n;a>=0;a--)(n=p[a])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ce(e,t,i),i};let y=class extends Q{constructor(e){super(e);f(this,"acceptDragLayer",k.Texture);f(this,"shaderRef",{refId:null});f(this,"shaderDataKeys",new Set);f(this,"formConfig",null);f(this,"_autoSaveSuppressed",!1);W(this),D(this,{proxyConfigs:[]})}static initBuiltinMaterial(e,t){e.shader=t;const r=e.shaderData;switch(r.disableMacro("MATERIAL_NEED_WORLD_POS"),r.disableMacro("MATERIAL_OMIT_NORMAL"),r.disableMacro("MATERIAL_NEED_TILING_OFFSET"),r.disableMacro("MATERIAL_SUN_HIGH_QUALITY"),t.name){case"Unlit":r.enableMacro("MATERIAL_OMIT_NORMAL"),r.enableMacro("MATERIAL_NEED_TILING_OFFSET");break;case"PBR":case"bake-pbr":case"BlinnPhong":r.enableMacro("MATERIAL_NEED_WORLD_POS"),r.enableMacro("MATERIAL_NEED_TILING_OFFSET");break;case"Sky/SkyProcedural":r.enableMacro("MATERIAL_SUN_HIGH_QUALITY");break;case"Effect/Particle":r.enableMacro("MATERIAL_OMIT_NORMAL");break}}setAutoSaveSuppressed(e){this._autoSaveSuppressed=e}setRenderQueueType(e){this.engineObject.shaderData.setInt("renderQueueType",e)}setBlendStateEnabled(e){this.engineObject.shaderData.setInt("blendEnabled",e?1:0)}setDepthWriteEnabled(e){this.engineObject.shaderData.setInt("depthWriteEnabled",e?1:0)}setCullMode(e){this.engineObject.shaderData.setInt("rasterStateCullMode",e)}setBlendMode(e){const t=this.engineObject.shaderData;switch(e){case A.Normal:t.setInt("sourceColorBlendFactor",m.SourceAlpha),t.setInt("destinationColorBlendFactor",m.OneMinusSourceAlpha),t.setInt("sourceAlphaBlendFactor",m.One),t.setInt("destinationAlphaBlendFactor",m.OneMinusSourceAlpha),t.setInt("colorBlendOperation",T.Add),t.setInt("alphaBlendOperation",T.Add);break;case A.Additive:t.setInt("sourceColorBlendFactor",m.SourceAlpha),t.setInt("destinationColorBlendFactor",m.One),t.setInt("sourceAlphaBlendFactor",m.One),t.setInt("destinationAlphaBlendFactor",m.OneMinusSourceAlpha),t.setInt("colorBlendOperation",T.Add),t.setInt("alphaBlendOperation",T.Add);break}}bindShaderAsset(e,t){for(const r of this.shaderDataKeys)this.removePropertyChangeListener(r);return this.shaderDataKeys.clear(),e.onReady().then(async()=>{var i;if(this.isInitCompleted){if(e.shaderScriptRefId){const a=this.root.assetStore.getAsset(e.shaderScriptRefId.refId);a==null||a.onShaderChange(this._engineObject)}else e.builtinUIScript&&e.builtinUIScript.onMaterialShaderSwitched(this._engineObject);t=this._getMainData()}const r=e.properties?J(e.properties):[];e.isBuiltinShader()&&y.initBuiltinMaterial(this.engineObject,e.engineObject),t=t||this._getMainData(),await this._proxyShaderProps(r,t,this.isInitCompleted),this.refreshFormConfig(r,t),this.refreshAnimatableProperties(r),this.shaderRef&&this.root.assetStore.getAssetByRef(this.shaderRef).then(a=>{a!==e&&(a==null||a.removeReferencedMaterial(this))}).catch(()=>{}),e.addReferencedMaterial(this),this.shaderRef={refId:e.id},await this.applyBoundPathChange("shader",O.AssetPicker,this.shaderRef),(i=this.updateThumbnail)==null||i.call(this)})}async _proxyShaderProps(e,t,r=!0){var n;this.proxyConfigs=e;const i=(n=this.extraData)==null?void 0:n.disabledMacros,a=e.map(async o=>{var l;if(this.proxySetter(o),this._virualShaderProps(e),o.bundleType==="macro"){const s=o.macroInfo,h=t.macros.find(c=>c.name===o.prop);if(!w(this,o.prop)){let c;h!=null?(c=h.value,s&&(s.checked=!0)):i!=null&&i.includes(o.prop)?(c=void 0,s&&(s.checked=!1)):c=o.defaultValue,D(this,{[o.prop]:c})}if(r)if(h){const c=h.value??o.defaultValue;c==null?s==null||s.onSwitch(!0,this):await o.onChange(this,o.prop,c)}else!(i!=null&&i.includes(o.prop))&&(s!=null&&s.checked)&&(s==null||s.onSwitch(!0,this))}else{const s=t.shaderData[o.prop];let h=s?s.value:this[o.prop]??o.defaultValue;if(h!=null&&h.refId&&!this.root.assetStore.assets[h.refId]&&(h=void 0),((l=o.uiInfo)==null?void 0:l.type)===g.Color)if(o.uiInfo.mode==="hdr"){const c=h.intensity??1;c!==0&&(h.r/=c,h.g/=c,h.b/=c),h.intensity=c}else h.intensity=1;w(this,o.prop)||D(this,{[o.prop]:h}),r&&this.notifyPropertyChange(o.prop,!1)}});await Promise.all(a)}proxySetter(e){const{prop:t,onChange:r,bundleType:i}=e,a=async(n,o)=>{var s;const l=this._engineObject.shaderData;i==="macro"?l.enableMacro(t,n):await x(this,t,n,e.engineType??((s=e.uiInfo)==null?void 0:s.type)),await r(this,t,n),o!==!1&&!this._autoSaveSuppressed&&(await this.root.assetFacade.persistAssetMain(this.id),this.updateThumbnail())};this.addPropertyChangeListener(t,a),this.shaderDataKeys.add(t)}_virualShaderProps(e){const t=this;e.forEach(r=>{Y(t,r.prop)})}refreshFormConfig(e,t){var i,a,n,o,l;const r={root:[],groups:{}};if(t){for(const s of e)if(!((i=s.uiInfo)!=null&&i.hide)){if((a=s.uiInfo)!=null&&a.group){if((n=s.uiInfo)!=null&&n.group){let h=r.groups[s.uiInfo.group];h||(h={type:O.Group,property:s.uiInfo.group,children:[]},r.groups[s.uiInfo.group]=h);const c=s.uiInfo;c.property=s.prop,s.macroInfo&&(c.macroConfig=s.macroInfo),h.children.push(c)}}else{const h=s.uiInfo;h.property=s.prop,s.macroInfo&&(h.macroConfig=s.macroInfo),r.root.push(h)}s.bundleType==="macro"?this[s.prop]=((o=t.macros.find(h=>h.name===s.prop))==null?void 0:o.value)??s.defaultValue:this[s.prop]=((l=t.shaderData[s.prop])==null?void 0:l.value)??s.defaultValue}}this.formConfig=r}refreshAnimatableProperties(e){var t,r,i;this._additionAnimatableProperties.length=0;for(const a of e){if(!a.uiInfo||a.uiInfo.hide||a.bundleType==="macro")continue;let n={};if((a.setPath||a.getPath||a.valueType||a.interpolationType)&&(n={setPath:a.setPath,getPath:a.getPath,valueType:a.valueType,interpolationType:a.interpolationType}),!n.setPath&&!n.getPath&&a.engineType&&(a.bundleType==="shaderData"||!a.bundleType))switch(a.engineType){case g.Float:n={setPath:`shaderData.setFloat('${a.prop}', $value)`,getPath:`shaderData.getFloat('${a.prop}')`,valueType:S.Float};break;case g.Integer:n={setPath:`shaderData.setInt('${a.prop}', $value)`,getPath:`shaderData.getInt('${a.prop}')`,valueType:S.Float,interpolationType:q.Step};break;case g.Vector2:n={setPath:`shaderData.getVector2('${a.prop}')`,getPath:`shaderData.getVector2('${a.prop}')`,valueType:S.Vector2};break;case g.Vector3:n={setPath:`shaderData.getVector3('${a.prop}')`,getPath:`shaderData.getVector3('${a.prop}')`,valueType:S.Vector3};break;case g.Vector4:n={setPath:`shaderData.getVector4('${a.prop}')`,getPath:`shaderData.getVector4('${a.prop}')`,valueType:S.Vector4};break;case g.Color:n={setPath:`shaderData.getColor('${a.prop}')`,getPath:`shaderData.getColor('${a.prop}')`,valueType:S.Color};break;case g.Boolean:n={setPath:`shaderData.setBoolean('${a.prop}', $value)`,getPath:`shaderData.getBoolean('${a.prop}')`,valueType:S.Boolean};break;case g.Texture:n={setPath:`shaderData.setTexture('${a.prop}', $value)`,getPath:`shaderData.getTexture('${a.prop}')`,valueType:S.ReferResource};break}if(!n.setPath&&!n.getPath){if(a.bundleType==="other")continue;continue}this._additionAnimatableProperties.push({property:a.prop,label:(t=a.uiInfo)!=null&&t.label?E(a.uiInfo.label):a.prop,type:(r=a.uiInfo)==null?void 0:r.type,propertyProxyConfig:n}),(i=a.uiInfo)!=null&&i.label&&(n.label=E(a.uiInfo.label)),X(this,a.prop,n)}}async initByMain(e){var c;const t=JSON.parse(await e.text());let r=t.shaderRef;const i=t.shaderData,a=t.macros;if(!r&&typeof t.shader=="string"){const d=Object.values(this.root.assetStore.assets).find(u=>u.meta.type==="Shader"&&u.meta.builtinShaderName===t.shader);d&&(r={refId:d.id})}if(!r)throw"invalid material";this.shaderRef=r;const n=new Z(this.engine);this.setDragTempEntity(n);const o=await this.root.assetStore.getAssetByRef(r),l=o.engineObject??ee.find("Unlit"),s=new te(this.engine,l);this.bindEngineObject(s);const h=s.shaderData;if(a)for(const d of a)h.enableMacro(d.name,d.value);if(i)for(const d in i){const u=i[d];let R=u.value;if(u.type===g.Color){R={...u.value};const M=u.value.intensity??1;M!==0&&(R.r/=M,R.g/=M,R.b/=M)}x(this,d,R,u.type)}await this.bindShaderAsset(o,t),(c=this.updateThumbnail)==null||c.call(this),await this.applyBoundPathChange("name",O.Input,this.name),this._checkSchemaOnInit(t,o)}_checkSchemaOnInit(e,t){e.shader!==t.engineObject.name&&this.root.assetFacade.persistAssetMain(this.id)}initByEngineObject(e){const t=this;this.bindEngineObject(e),t.shader=e.shader.name,t._name=e.name??"";const i=Object.values(this.root.assetStore.assets).filter(h=>h.meta.type==="Shader"&&!!h.meta.builtinShaderName).find(h=>h.meta.builtinShaderName===e.shader.name);this.shaderRef={refId:i.id};const a=e.shaderData,n=new Set((i.properties??[]).map(h=>h.prop));if(n.has("isTransparent")&&(t.isTransparent=a.getInt("blendEnabled")===1),n.has("material_AlphaCutoff")&&(t.alphaCutoff=a.getFloat("material_AlphaCutoff")),n.has("renderFace"))switch(a.getInt("rasterStateCullMode")){case C.Back:t.renderFace=v.Front;break;case C.Front:t.renderFace=v.Back;break;case C.Off:t.renderFace=v.Double;break}n.has("blendMode")&&(t.blendMode=a.getInt("destinationColorBlendFactor")===m.One?A.Additive:A.Normal),a.getProperties().forEach(h=>{const c=a.getPropertyValue(h);if(c instanceof ae){const d=this.root.assetStore.engineObjectToAssetMap.get(c);this[h.name]=d==null?void 0:d.getCurrentRef()}else this[h.name]=B(c)});const l=this._getMainData(),s=i.properties?[...i.properties]:[];this._proxyShaderProps(s,l,!1),this.bindShaderAsset(i,l)}afterDelete(){var e;(e=this.engineObject)==null||e.destroy(!0)}rename(e){return this.root.assetFacade.persistAssetMain(this.id),super.rename(e)}_getMainData(e){var s,h,c;const t=[],r=(e??this.engineObject).shaderData;r.getMacros(t);const i=t.map(({name:d,value:u})=>u===void 0?{name:d}:{name:d,value:u}),a=[],n={};r.getProperties(a);for(const d of a){let u;if(d.type===b.Texture||d.type===b.TextureArray)u=this[d.name];else{const R=r.getPropertyValue(d);u=B(R),((s=this[d.name])==null?void 0:s.intensity)!=null&&(u.intensity=(h=this[d.name])==null?void 0:h.intensity)}u!=null&&(n[d.name]={type:pe(d.type),value:u})}const o=(c=this.shaderRef)!=null&&c.refId?this.root.assetStore.getAsset(this.shaderRef.refId):void 0,l=!!(o!=null&&o.builtinShaderName);return{name:this.name,shader:this.engineObject.shader.name,macros:i,shaderData:n,...l?{}:{shaderRef:this.shaderRef}}}getMainData(){return JSON.stringify(this._getMainData())}async initByCreation(){var l;const e=new re(this.engine),t=[];e.shaderData.getMacros(t);const r=t.map(({name:s,value:h})=>h===void 0?{name:s}:{name:s,value:h});this.bindEngineObject(e);const i=this.root.assetStore.getAsset("0000501"),a=i!=null&&i.properties?[...i.properties]:[],n={};for(const s of a)s.defaultValue&&(n[s.prop]={value:s.defaultValue,type:s.engineType??((l=s.uiInfo)==null?void 0:l.type)});const o={shaderData:n,name:this.name,shader:e.shader.name,macros:r};return this._proxyShaderProps(a,o,!1),o}async onSubAssetEdit(){var i;const e=await this.root.assetFacade.createAssetByAdd({assetType:"Material",name:`${this._name}-copied`});this.engineObject.cloneTo(e.engineObject),await e.applyBoundPathChange("name",O.Input,e.name),e.initByEngineObject(e.engineObject),e.updateThumbnail(),await this.root.assetFacade.persistAssetMain(e.id);const t=await this.root.assetStore.getAssetByRef({refId:this.mainId}),r=((i=t.engineObject.materials)==null?void 0:i.indexOf(this._engineObject))??-1;r>=0&&await t.replaceMaterial(r,e.getCurrentRef()),this.root.assetStore.selectAsset(e.id)}saveMainImmediately(){return!this.engineObject||!this.engineObject.shaderData?Promise.resolve(void 0):(this.root.projectStore.setSyncStatus("syncing"),super.saveMainImmediately().then(e=>(e&&this.root.projectStore.setSyncStatus("success"),e)).catch(e=>{throw this.root.projectStore.setSyncStatus("error"),e}))}async _onDrop(e,t){var i,a;const r="material_BaseTexture";if(r in this){const n=t.getCurrentRef();this[r]=n;const o=this.root.assetStore.getAsset((i=this.shaderRef)==null?void 0:i.refId),l=(a=o==null?void 0:o.properties)==null?void 0:a.find(s=>s.prop===r);l&&await l.onChange(this,r,n),await this.root.assetFacade.persistAssetMain(this.id)}this.dropping=!1}async onDropToViewport(){const{sceneStore:e,sceneUIStore:t}=this.root,r=t.hoveredEntityId;if(r){const i=e.getEntityModel(r);if(i){const a=i.getComponentByTypeName("MeshRenderer"),n=i.getComponentByTypeName("SkinnedMeshRenderer"),o=a||n;o&&this.root.componentFacade.updateComponent(i.id,o.id,{material:this.getCurrentRef()})}}this.root.projectStore.currentViewport.viewport.onDrop()}};I([L],y.prototype,"shaderRef",2);I([L.ref],y.prototype,"formConfig",2);I([_],y.prototype,"bindShaderAsset",1);I([_],y.prototype,"_proxyShaderProps",1);I([_],y.prototype,"proxySetter",1);I([_],y.prototype,"_virualShaderProps",1);I([_],y.prototype,"refreshAnimatableProperties",1);I([_],y.prototype,"_onDrop",1);y=I([se({type:"Material",label:E("asset.material.title"),loaderType:"Material",extname:"mat",importMenuConfig:{type:ie.Add},customInspector:ne,viewer:he,thumbnail:P,dragLayer:k.Material})],y);const Ie=Object.freeze(Object.defineProperty({__proto__:null,get MaterialAsset(){return y}},Symbol.toStringTag,{value:"Module"}));export{y as M,he as a,Ie as b};
@@ -1 +1 @@
1
- var E=Object.defineProperty;var L=(d,e,t)=>e in d?E(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var j=(d,e,t)=>(L(d,typeof e!="symbol"?e+"":e,t),t);import{aH as x,aP as N,aJ as S,aM as $,av as s,aI as M,C as n,b7 as V,aw as F,bz as B,aO as f,aK as A,bA as z,e as O}from"./index-3660a664.js";import{u as T}from"./index-365736f7.js";import"./postmen-c7605b45.js";import{I as W}from"./IconPointFilled-dbf63b5c.js";const H=x(W,{marginRight:"-$1",variants:{checked:{true:{color:"$green10"}}}}),J=x(N,{width:"100%",border:"none",position:"relative",whiteSpace:"pre-wrap",boxShadow:"$2","& > svg":{marginRight:"$1"}});function b(d){return S(function(t){const{inspectorConfig:r,macroConfig:c,...p}=t,{model:i}=p;let{models:g}=p;const{checked:u,onSwitch:h}=c,{type:m,...a}=r,[o,l]=$.useState(u);$.useEffect(()=>{l(u)},[u]),g=g||[i];const R=()=>{const I=!o;if(h)for(const k of g)h(I,k);l(I)},v=r.label;return s.jsxs(M,{direction:"column",fullWidth:!0,children:[m!==n.Null&&o&&V.createElement(d,{...p,inspectorConfig:{...a,type:m}}),s.jsx(F,{label:o?"":v,children:s.jsx(J,{size:"sm",variant:"subtle",startSlot:s.jsx(H,{size:"12px",checked:o}),onClick:R,children:o?"Enabled ":"Disabled"})})]})})}const K=x(M),U=x(B,{backgroundColor:"$gray1",height:"2px !important"});function q(d){const{inspectorConfig:e,models:t,onModelChange:r,model:c,macroConfig:p}=d,{type:i,property:g,info:u}=e,{t:h}=A(),m=!c&&t&&t.length>1;if(m&&!t.find(y=>e.when?e.when(y):!0)||e.when&&!e.when(c))return null;const a=p?w.getRegisteredMacroComponent(i):w.getRegisteredComponent(i);if(!a)return console.warn(`缺少${i}类型的组件`),null;let o=e.disabled;!m&&c.getEditable&&(o=c.getEditable(e.property)===!1);const l=typeof e.label=="string"?h(e.label):e.label;let R=e.options;R&&(R=R.map(y=>({label:typeof y.label=="string"?h(y.label):y.label,value:y.value})));const v={...e,label:l,info:u,options:R,disabled:o},{triggerAfterInit:I,customComponent:k,...P}=v;return s.jsx(a,{inspectorConfig:P,macroConfig:p,models:t,model:c,onModelChange:r},g)}const C=class C{static registerComponent(e,t){this.components[e]=t}static getRegisteredComponent(e){return C.components[e]}static getRegisteredMacroComponent(e){return C.macroComponents[e]}};j(C,"components",f.getRegisteredComponents()),j(C,"macroComponents",{[n.Color]:b(f.getRegisteredComponent(n.Color)),[n.Vector4]:b(f.getRegisteredComponent(n.Vector4)),[n.Vector3]:b(f.getRegisteredComponent(n.Vector3)),[n.Vector2]:b(f.getRegisteredComponent(n.Vector2)),[n.Number]:b(f.getRegisteredComponent(n.Number)),[n.AssetPicker]:b(f.getRegisteredComponent(n.AssetPicker)),[n.Boolean]:b(f.getRegisteredComponent(n.Boolean)),[n.Null]:b(f.getRegisteredComponent(n.Null))}),j(C,"Item",S(q)),j(C,"List",S(function(t){const{configs:r,models:c,css:p,onModelChange:i,model:g,children:u,fullWidth:h=!1,withSeparator:m}=t;return r!=null&&r.length&&r.sort((a,o)=>{const l=a.priority??0;return(o.priority??0)-l}),r?s.jsxs(K,{css:p,className:"shader-inspector-form",fullWidth:h,children:[r.map(a=>s.jsxs($.Fragment,{children:[s.jsx(C.Item,{inspectorConfig:a,macroConfig:a.macroConfig,model:g,models:c,onModelChange:i},a.property),m&&s.jsx(U,{})]},a.property)),u]}):null}));let w=C;const G=x("div",{backgroundColor:"$appBg",width:"100%"}),Q=x("div",{backgroundColor:"$panelBg",borderRadius:"0 0 $2 $2",overflow:"hidden",paddingBottom:"$1"}),X=x("div",{width:"100%",backgroundColor:"$gray3",paddingBottom:"$0_5"}),Y=x(B,{backgroundColor:"$appBg",height:"2px !important"}),Z=d=>{var a;const{asset:e}=d,t=e.formConfig,{assetStore:r,inspectorFacade:c}=T(),{i18n:p}=A(),i=r.getAsset(e.shaderRef.refId),g=i==null?void 0:i.name,u=Object.values(r.assets).filter(o=>o.meta.type==="Shader"&&o.meta.utility!=="error"),h=()=>{r.selectAsset(e.shaderRef.refId)},m=(o,l)=>{c.assetChange(e.id,o,l)};if(t.root)for(const o of t.root){const l=o.comments;l&&(o.info=l[p.language]??l.default??void 0)}return s.jsxs(G,{children:[s.jsx(X,{children:s.jsx(z,{label:O("asset.shader.title"),assets:u,disabled:!!(i!=null&&i.isSubAsset)||e.isSubAsset||!e.getEditable(),value:g,dropLayer:0,onSelect:async o=>{await e.bindShaderAsset(o,e._getMainData()),await c.assetChanges(e.id,{shaderRef:e.shaderRef,shader:e.shader})},onLocate:h})}),((a=t.root)==null?void 0:a.length)>0&&s.jsx(Q,{children:s.jsx(w.List,{model:e,onModelChange:m,configs:t.root,withSeparator:!1})}),s.jsx(Y,{}),s.jsx(w.List,{model:e,onModelChange:m,configs:Object.values(t.groups)})]})},ne=S(Z);export{ne as M};
1
+ var E=Object.defineProperty;var L=(d,e,t)=>e in d?E(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var j=(d,e,t)=>(L(d,typeof e!="symbol"?e+"":e,t),t);import{aH as x,aP as N,aJ as S,aM as $,av as s,aI as M,C as n,b7 as V,aw as F,bz as B,aO as f,aK as A,bA as z,e as O}from"./index-e44b357e.js";import{u as T}from"./index-debbe073.js";import"./postmen-443b3e5f.js";import{I as W}from"./IconPointFilled-bad94cf1.js";const H=x(W,{marginRight:"-$1",variants:{checked:{true:{color:"$green10"}}}}),J=x(N,{width:"100%",border:"none",position:"relative",whiteSpace:"pre-wrap",boxShadow:"$2","& > svg":{marginRight:"$1"}});function b(d){return S(function(t){const{inspectorConfig:r,macroConfig:c,...p}=t,{model:i}=p;let{models:g}=p;const{checked:u,onSwitch:h}=c,{type:m,...a}=r,[o,l]=$.useState(u);$.useEffect(()=>{l(u)},[u]),g=g||[i];const R=()=>{const I=!o;if(h)for(const k of g)h(I,k);l(I)},v=r.label;return s.jsxs(M,{direction:"column",fullWidth:!0,children:[m!==n.Null&&o&&V.createElement(d,{...p,inspectorConfig:{...a,type:m}}),s.jsx(F,{label:o?"":v,children:s.jsx(J,{size:"sm",variant:"subtle",startSlot:s.jsx(H,{size:"12px",checked:o}),onClick:R,children:o?"Enabled ":"Disabled"})})]})})}const K=x(M),U=x(B,{backgroundColor:"$gray1",height:"2px !important"});function q(d){const{inspectorConfig:e,models:t,onModelChange:r,model:c,macroConfig:p}=d,{type:i,property:g,info:u}=e,{t:h}=A(),m=!c&&t&&t.length>1;if(m&&!t.find(y=>e.when?e.when(y):!0)||e.when&&!e.when(c))return null;const a=p?w.getRegisteredMacroComponent(i):w.getRegisteredComponent(i);if(!a)return console.warn(`缺少${i}类型的组件`),null;let o=e.disabled;!m&&c.getEditable&&(o=c.getEditable(e.property)===!1);const l=typeof e.label=="string"?h(e.label):e.label;let R=e.options;R&&(R=R.map(y=>({label:typeof y.label=="string"?h(y.label):y.label,value:y.value})));const v={...e,label:l,info:u,options:R,disabled:o},{triggerAfterInit:I,customComponent:k,...P}=v;return s.jsx(a,{inspectorConfig:P,macroConfig:p,models:t,model:c,onModelChange:r},g)}const C=class C{static registerComponent(e,t){this.components[e]=t}static getRegisteredComponent(e){return C.components[e]}static getRegisteredMacroComponent(e){return C.macroComponents[e]}};j(C,"components",f.getRegisteredComponents()),j(C,"macroComponents",{[n.Color]:b(f.getRegisteredComponent(n.Color)),[n.Vector4]:b(f.getRegisteredComponent(n.Vector4)),[n.Vector3]:b(f.getRegisteredComponent(n.Vector3)),[n.Vector2]:b(f.getRegisteredComponent(n.Vector2)),[n.Number]:b(f.getRegisteredComponent(n.Number)),[n.AssetPicker]:b(f.getRegisteredComponent(n.AssetPicker)),[n.Boolean]:b(f.getRegisteredComponent(n.Boolean)),[n.Null]:b(f.getRegisteredComponent(n.Null))}),j(C,"Item",S(q)),j(C,"List",S(function(t){const{configs:r,models:c,css:p,onModelChange:i,model:g,children:u,fullWidth:h=!1,withSeparator:m}=t;return r!=null&&r.length&&r.sort((a,o)=>{const l=a.priority??0;return(o.priority??0)-l}),r?s.jsxs(K,{css:p,className:"shader-inspector-form",fullWidth:h,children:[r.map(a=>s.jsxs($.Fragment,{children:[s.jsx(C.Item,{inspectorConfig:a,macroConfig:a.macroConfig,model:g,models:c,onModelChange:i},a.property),m&&s.jsx(U,{})]},a.property)),u]}):null}));let w=C;const G=x("div",{backgroundColor:"$appBg",width:"100%"}),Q=x("div",{backgroundColor:"$panelBg",borderRadius:"0 0 $2 $2",overflow:"hidden",paddingBottom:"$1"}),X=x("div",{width:"100%",backgroundColor:"$gray3",paddingBottom:"$0_5"}),Y=x(B,{backgroundColor:"$appBg",height:"2px !important"}),Z=d=>{var a;const{asset:e}=d,t=e.formConfig,{assetStore:r,inspectorFacade:c}=T(),{i18n:p}=A(),i=r.getAsset(e.shaderRef.refId),g=i==null?void 0:i.name,u=Object.values(r.assets).filter(o=>o.meta.type==="Shader"&&o.meta.utility!=="error"),h=()=>{r.selectAsset(e.shaderRef.refId)},m=(o,l)=>{c.assetChange(e.id,o,l)};if(t.root)for(const o of t.root){const l=o.comments;l&&(o.info=l[p.language]??l.default??void 0)}return s.jsxs(G,{children:[s.jsx(X,{children:s.jsx(z,{label:O("asset.shader.title"),assets:u,disabled:!!(i!=null&&i.isSubAsset)||e.isSubAsset||!e.getEditable(),value:g,dropLayer:0,onSelect:async o=>{await e.bindShaderAsset(o,e._getMainData()),await c.assetChanges(e.id,{shaderRef:e.shaderRef,shader:e.shader})},onLocate:h})}),((a=t.root)==null?void 0:a.length)>0&&s.jsx(Q,{children:s.jsx(w.List,{model:e,onModelChange:m,configs:t.root,withSeparator:!1})}),s.jsx(Y,{}),s.jsx(w.List,{model:e,onModelChange:m,configs:Object.values(t.groups)})]})},ne=S(Z);export{ne as M};
@@ -1,4 +1,4 @@
1
- import{f0 as Or,av as i,aH as T,aM as a,gA as dt,ev as Nc,b7 as pe,gB as $c,gC as Oc,gD as Dc,gE as jc,gF as Lc,gG as kc,gH as Fc,gI as Uc,gJ as Gc,gK as Kc,d3 as k,d5 as me,ba as Ne,b8 as $e,bd as ee,gL as ln,gM as Dr,gN as Bc,gO as Wc,gP as Vc,gQ as Hc,b9 as U,d2 as jr,bc as F,bb as y,d4 as xt,d6 as Lr,d7 as Mt,gR as kr,gS as Fr,gT as Ur,gU as J,gV as Gr,gW as Kr,gX as Br,gY as Wr,gZ as Vr,g_ as Hr,b4 as dn,b5 as fn,d8 as wt,g$ as Oe,d9 as Yr,da as ge,h0 as pn,db as Xr,h1 as mn,dc as zr,dd as St,h2 as Yc,h3 as $t,h4 as Ot,h5 as Dt,h6 as Re,h7 as nr,h8 as jt,h9 as Lt,ha as kt,hb as Ft,hc as Ut,hd as rr,bi as Xc,he as zc}from"./index-3660a664.js";/**
1
+ import{f0 as Or,av as i,aH as T,aM as a,gA as dt,ev as Nc,b7 as pe,gB as $c,gC as Oc,gD as Dc,gE as jc,gF as Lc,gG as kc,gH as Fc,gI as Uc,gJ as Gc,gK as Kc,d3 as k,d5 as me,ba as Ne,b8 as $e,bd as ee,gL as ln,gM as Dr,gN as Bc,gO as Wc,gP as Vc,gQ as Hc,b9 as U,d2 as jr,bc as F,bb as y,d4 as xt,d6 as Lr,d7 as Mt,gR as kr,gS as Fr,gT as Ur,gU as J,gV as Gr,gW as Kr,gX as Br,gY as Wr,gZ as Vr,g_ as Hr,b4 as dn,b5 as fn,d8 as wt,g$ as Oe,d9 as Yr,da as ge,h0 as pn,db as Xr,h1 as mn,dc as zr,dd as St,h2 as Yc,h3 as $t,h4 as Ot,h5 as Dt,h6 as Re,h7 as nr,h8 as jt,h9 as Lt,ha as kt,hb as Ft,hc as Ut,hd as rr,bi as Xc,he as zc}from"./index-e44b357e.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.
@@ -1 +1 @@
1
- var E=Object.defineProperty;var U=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>(U(n,typeof e!="symbol"?e+"":e,t),t);import{bN as v,bO as g,bw as T,a4 as i,bP as u,av as c,aN as b,y as f,bQ as p,j as x,n as C,e as V,q as N}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";import{F as d}from"./index-75e7d483.js";import{M as m}from"./MeshThumbnail-d8ee2674.js";import{A as M}from"./AssetViewer-1073ddb5.js";import{e as A}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";class O{static createMesh(e,t){const s=new v(e);return O.setMeshData(s,t),s}static setMeshData(e,t){var s,r;return e.setPositions([...t.positions]),e.setNormals(t.normals),e.setUVs(t.uvs),t.uv1&&e.setUVs(t.uv1,1),t.uv2&&e.setUVs(t.uv2,2),t.uv3&&e.setUVs(t.uv3,3),t.uv4&&e.setUVs(t.uv4,4),t.uv5&&e.setUVs(t.uv5,5),t.uv6&&e.setUVs(t.uv6,6),t.uv7&&e.setUVs(t.uv7,7),t.bounds?(e.bounds.min.copyFrom(t.bounds.min),e.bounds.max.copyFrom(t.bounds.max)):O.calculateBounds(t.positions,e.bounds),(s=t.blendShapes)==null||s.forEach(o=>{const l=new g(o.name);o.frames.forEach(a=>{l.addFrame(a.weight,a.positions,a.normals,a.uvs)}),e.addBlendShape(l)}),(r=t.subMeshes)==null||r.forEach(o=>{e.addSubMesh(o)}),t.indices&&(t.positions.length<=65535?e.setIndices(new Uint16Array(t.indices)):e.setIndices(new Uint32Array(t.indices))),e.uploadData(!1),e}static calculateBounds(e,t){const{min:s,max:r}=t,o=e.length;s.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<o;l++){const a=e[l];s.x=Math.min(a.x,s.x),s.y=Math.min(a.y,s.y),s.z=Math.min(a.z,s.z),r.x=Math.max(a.x,r.x),r.y=Math.max(a.y,r.y),r.z=Math.max(a.z,r.z)}}}class R extends T{constructor(e,t){super(e),this.meshData=t}restoreContent(){O.setMeshData(this.resource,this.meshData)}}var y=(n=>(n.POSITION="Position",n.NORMAL="Normal",n.COLOR_0="Color",n.TANGENT="Tangent",n.WEIGHTS_0="BoneWeight",n.JOINTS_0="BoneIndex",n.TEXCOORD_0="UV",n.TEXCOORD_1="UV1",n.TEXCOORD_2="UV2",n.TEXCOORD_3="UV3",n.TEXCOORD_4="UV4",n.TEXCOORD_5="UV5",n.TEXCOORD_6="UV6",n.TEXCOORD_7="UV7",n))(y||{});const X=["POSITION","NORMAL","COLOR_0","TANGENT","WEIGHTS_0","JOINTS_0","TEXCOORD_0","TEXCOORD_1","TEXCOORD_2","TEXCOORD_3","TEXCOORD_4","TEXCOORD_5","TEXCOORD_6","TEXCOORD_7"],L={[i.Float]:"4 bytes",[i.Vector2]:"8 bytes",[i.Vector3]:"12 bytes",[i.Vector4]:"16 bytes",[i.Byte4]:"4 bytes",[i.UByte4]:"4 bytes",[i.NormalizedByte4]:"4 bytes",[i.NormalizedUByte4]:"4 bytes",[i.NormalizedShort2]:"4 bytes",[i.NormalizedShort4]:"8 bytes",[i.Short2]:"4 bytes",[i.UShort2]:"4 bytes",[i.NormalizedUShort2]:"4 bytes",[i.Short4]:"8 bytes",[i.UShort4]:"8 bytes",[i.NormalizedUShort4]:"8 bytes"};u.Triangles+"",u.TriangleStrip+"",u.TriangleFan+"",u.LineLoop+"",u.LineStrip+"",u.Lines+"",u.Points+"";function w(n){switch(n.topology){case u.Triangles:return`${n.count/3} triangles`;case u.TriangleFan:case u.TriangleStrip:return`${n.count-2} triangles`;case u.Lines:return`${n.count/2} lines`;case u.LineStrip:return`${n.count-1} lines`;case u.LineLoop:return`${n.count} lines`;case u.Points:return`${n.count} points`}}function I(n){if(n instanceof Uint8Array)return"Uint8";if(n instanceof Uint16Array)return"Uint16";if(n instanceof Uint32Array)return"Uint32"}const S=n=>{const e=n.asset.engineObject,t=e.vertexCount,s=e.getIndices(),r=e.subMeshes;return c.jsxs(c.Fragment,{children:[c.jsx(b,{title:`Vertices: ${t}`,defaultOpen:!0,children:X.map(o=>e.vertexElements.find(l=>l.semantic===o)).filter(o=>o!=null).map(o=>c.jsx(d,{label:y[o.attribute],value:`${i[o.format]} (${L[o.format]})`},o.attribute))}),s?c.jsx(b,{title:`Indices: ${s.length}`,defaultOpen:!0,children:c.jsx(d,{label:"Format",value:I(s)})}):null,c.jsx(b,{title:`SubMesh: ${r.length}`,defaultOpen:!0,children:r.map((o,l)=>c.jsx(d,{label:`# ${l}`,value:w(o)},l))})]})};class j extends M{setViewAsset(e,t){const s=t.createChild("mesh_entity"),r=s.addComponent(f);r.mesh=e.engineObject;const o=new p(e.engine);o.baseColor.set(.5,.5,.5,1),r.setMaterial(o),this._entity=s}}var B=Object.defineProperty,F=Object.getOwnPropertyDescriptor,z=(n,e,t,s)=>{for(var r=s>1?void 0:s?F(e,t):e,o=n.length-1,l;o>=0;o--)(l=n[o])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&B(e,t,r),r};let h=class extends x{constructor(e){super(e);_(this,"meshData",null)}beforeDelete(){return null}afterDelete(){return null}async initByMain(e){const{engine:t}=this,s=JSON.parse(await e.text());this.meshData=s;const r=new v(t);O.setMeshData(r,s),t.resourceManager.addContentRestorer(new R(r,s)),this.bindEngineObject(r),this._releaseMeshCache()}initByEngineObject(e){this.bindEngineObject(e),this._name=e.name,this.meshData={positions:[],subMeshes:[]}}_releaseMeshCache(){const e=this.engineObject;e._verticesUint8=null,e._indices=null,e._verticesFloat32=null,e._positions=null,e._tangents=null,e._normals=null,e._colors=null,e._uv=null,e._uv1=null,e._uv2=null,e._uv3=null,e._uv4=null,e._uv5=null,e._uv6=null,e._uv7=null}};h=z([C({type:"Mesh",label:V("asset.mesh.title"),icon:{},loaderType:"Mesh",extname:"mesh",customInspector:S,viewer:j,thumbnail:m,dragLayer:N.Mesh,async bundle({content:n}){const e=JSON.parse(await n.text()),t=A(e,{type:"Mesh",name:"mesh"});return{content:new Blob([t])}}})],h);export{h as MeshAsset};
1
+ var E=Object.defineProperty;var U=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>(U(n,typeof e!="symbol"?e+"":e,t),t);import{bN as v,bO as g,bw as T,a4 as i,bP as u,av as c,aN as b,y as f,bQ as p,j as x,n as C,e as V,q as N}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";import{F as d}from"./index-7e414715.js";import{M as m}from"./MeshThumbnail-b1283749.js";import{A as M}from"./AssetViewer-d2c63b00.js";import{e as A}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";class O{static createMesh(e,t){const s=new v(e);return O.setMeshData(s,t),s}static setMeshData(e,t){var s,r;return e.setPositions([...t.positions]),e.setNormals(t.normals),e.setUVs(t.uvs),t.uv1&&e.setUVs(t.uv1,1),t.uv2&&e.setUVs(t.uv2,2),t.uv3&&e.setUVs(t.uv3,3),t.uv4&&e.setUVs(t.uv4,4),t.uv5&&e.setUVs(t.uv5,5),t.uv6&&e.setUVs(t.uv6,6),t.uv7&&e.setUVs(t.uv7,7),t.bounds?(e.bounds.min.copyFrom(t.bounds.min),e.bounds.max.copyFrom(t.bounds.max)):O.calculateBounds(t.positions,e.bounds),(s=t.blendShapes)==null||s.forEach(o=>{const l=new g(o.name);o.frames.forEach(a=>{l.addFrame(a.weight,a.positions,a.normals,a.uvs)}),e.addBlendShape(l)}),(r=t.subMeshes)==null||r.forEach(o=>{e.addSubMesh(o)}),t.indices&&(t.positions.length<=65535?e.setIndices(new Uint16Array(t.indices)):e.setIndices(new Uint32Array(t.indices))),e.uploadData(!1),e}static calculateBounds(e,t){const{min:s,max:r}=t,o=e.length;s.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<o;l++){const a=e[l];s.x=Math.min(a.x,s.x),s.y=Math.min(a.y,s.y),s.z=Math.min(a.z,s.z),r.x=Math.max(a.x,r.x),r.y=Math.max(a.y,r.y),r.z=Math.max(a.z,r.z)}}}class R extends T{constructor(e,t){super(e),this.meshData=t}restoreContent(){O.setMeshData(this.resource,this.meshData)}}var y=(n=>(n.POSITION="Position",n.NORMAL="Normal",n.COLOR_0="Color",n.TANGENT="Tangent",n.WEIGHTS_0="BoneWeight",n.JOINTS_0="BoneIndex",n.TEXCOORD_0="UV",n.TEXCOORD_1="UV1",n.TEXCOORD_2="UV2",n.TEXCOORD_3="UV3",n.TEXCOORD_4="UV4",n.TEXCOORD_5="UV5",n.TEXCOORD_6="UV6",n.TEXCOORD_7="UV7",n))(y||{});const X=["POSITION","NORMAL","COLOR_0","TANGENT","WEIGHTS_0","JOINTS_0","TEXCOORD_0","TEXCOORD_1","TEXCOORD_2","TEXCOORD_3","TEXCOORD_4","TEXCOORD_5","TEXCOORD_6","TEXCOORD_7"],L={[i.Float]:"4 bytes",[i.Vector2]:"8 bytes",[i.Vector3]:"12 bytes",[i.Vector4]:"16 bytes",[i.Byte4]:"4 bytes",[i.UByte4]:"4 bytes",[i.NormalizedByte4]:"4 bytes",[i.NormalizedUByte4]:"4 bytes",[i.NormalizedShort2]:"4 bytes",[i.NormalizedShort4]:"8 bytes",[i.Short2]:"4 bytes",[i.UShort2]:"4 bytes",[i.NormalizedUShort2]:"4 bytes",[i.Short4]:"8 bytes",[i.UShort4]:"8 bytes",[i.NormalizedUShort4]:"8 bytes"};u.Triangles+"",u.TriangleStrip+"",u.TriangleFan+"",u.LineLoop+"",u.LineStrip+"",u.Lines+"",u.Points+"";function w(n){switch(n.topology){case u.Triangles:return`${n.count/3} triangles`;case u.TriangleFan:case u.TriangleStrip:return`${n.count-2} triangles`;case u.Lines:return`${n.count/2} lines`;case u.LineStrip:return`${n.count-1} lines`;case u.LineLoop:return`${n.count} lines`;case u.Points:return`${n.count} points`}}function I(n){if(n instanceof Uint8Array)return"Uint8";if(n instanceof Uint16Array)return"Uint16";if(n instanceof Uint32Array)return"Uint32"}const S=n=>{const e=n.asset.engineObject,t=e.vertexCount,s=e.getIndices(),r=e.subMeshes;return c.jsxs(c.Fragment,{children:[c.jsx(b,{title:`Vertices: ${t}`,defaultOpen:!0,children:X.map(o=>e.vertexElements.find(l=>l.semantic===o)).filter(o=>o!=null).map(o=>c.jsx(d,{label:y[o.attribute],value:`${i[o.format]} (${L[o.format]})`},o.attribute))}),s?c.jsx(b,{title:`Indices: ${s.length}`,defaultOpen:!0,children:c.jsx(d,{label:"Format",value:I(s)})}):null,c.jsx(b,{title:`SubMesh: ${r.length}`,defaultOpen:!0,children:r.map((o,l)=>c.jsx(d,{label:`# ${l}`,value:w(o)},l))})]})};class j extends M{setViewAsset(e,t){const s=t.createChild("mesh_entity"),r=s.addComponent(f);r.mesh=e.engineObject;const o=new p(e.engine);o.baseColor.set(.5,.5,.5,1),r.setMaterial(o),this._entity=s}}var B=Object.defineProperty,F=Object.getOwnPropertyDescriptor,z=(n,e,t,s)=>{for(var r=s>1?void 0:s?F(e,t):e,o=n.length-1,l;o>=0;o--)(l=n[o])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&B(e,t,r),r};let h=class extends x{constructor(e){super(e);_(this,"meshData",null)}beforeDelete(){return null}afterDelete(){return null}async initByMain(e){const{engine:t}=this,s=JSON.parse(await e.text());this.meshData=s;const r=new v(t);O.setMeshData(r,s),t.resourceManager.addContentRestorer(new R(r,s)),this.bindEngineObject(r),this._releaseMeshCache()}initByEngineObject(e){this.bindEngineObject(e),this._name=e.name,this.meshData={positions:[],subMeshes:[]}}_releaseMeshCache(){const e=this.engineObject;e._verticesUint8=null,e._indices=null,e._verticesFloat32=null,e._positions=null,e._tangents=null,e._normals=null,e._colors=null,e._uv=null,e._uv1=null,e._uv2=null,e._uv3=null,e._uv4=null,e._uv5=null,e._uv6=null,e._uv7=null}};h=z([C({type:"Mesh",label:V("asset.mesh.title"),icon:{},loaderType:"Mesh",extname:"mesh",customInspector:S,viewer:j,thumbnail:m,dragLayer:N.Mesh,async bundle({content:n}){const e=JSON.parse(await n.text()),t=A(e,{type:"Mesh",name:"mesh"});return{content:new Blob([t])}}})],h);export{h as MeshAsset};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var c=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>(c(r,typeof e!="symbol"?e+"":e,t),t);import{p as n,C as d,s as p,f as v,aE as P,E as b,v as y,x as u,aC as w}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";var M=Object.defineProperty,O=Object.getOwnPropertyDescriptor,i=(r,e,t,l)=>{for(var a=l>1?void 0:l?O(e,t):e,h=r.length-1,m;h>=0;h--)(m=r[h])&&(a=(l?m(e,t,a):m(a))||a);return l&&a&&M(e,t,a),a};class o extends b{constructor(){super(...arguments);s(this,"mesh",null);s(this,"material",{refId:"0000200"});s(this,"receiveShadows",!0);s(this,"castShadows",!0);s(this,"priority",0);s(this,"materialOpen",!1)}setMaterialOpen(t){this.materialOpen=t}}i([n({type:d.AssetPicker,assetType:["Mesh"],label:"mesh-renderer.mesh.title",info:"mesh-renderer.mesh.info",bindPath:"mesh"}),p()],o.prototype,"mesh",2);i([n({type:d.AssetPicker,assetType:"Material",label:"mesh-renderer.material.title",info:"mesh-renderer.material.info",customFilter:r=>{var e;return((e=r.engineObject.shader)==null?void 0:e.name)!=="Effect/Particle"}}),v({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:P.ReferResource,getEngineValue:r=>r.getMaterial()}),p()],o.prototype,"material",2);i([n({label:"mesh-renderer.receive-shadows.title",info:"mesh-renderer.receive-shadows.info",bindPath:"receiveShadows"}),y(),p()],o.prototype,"receiveShadows",2);i([n({label:"mesh-renderer.cast-shadows.title",info:"mesh-renderer.cast-shadows.info",bindPath:"castShadows"}),y(),p()],o.prototype,"castShadows",2);i([n({label:"mesh-renderer.priority.title",info:"mesh-renderer.priority.info",bindPath:"priority"}),p()],o.prototype,"priority",2);i([u],o.prototype,"materialOpen",2);i([w],o.prototype,"setMaterialOpen",1);export{o as M};
1
+ var f=Object.defineProperty;var c=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>(c(r,typeof e!="symbol"?e+"":e,t),t);import{p as n,C as d,s as p,f as v,aE as P,E as b,v as y,x as u,aC as w}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";var M=Object.defineProperty,O=Object.getOwnPropertyDescriptor,i=(r,e,t,l)=>{for(var a=l>1?void 0:l?O(e,t):e,h=r.length-1,m;h>=0;h--)(m=r[h])&&(a=(l?m(e,t,a):m(a))||a);return l&&a&&M(e,t,a),a};class o extends b{constructor(){super(...arguments);s(this,"mesh",null);s(this,"material",{refId:"0000200"});s(this,"receiveShadows",!0);s(this,"castShadows",!0);s(this,"priority",0);s(this,"materialOpen",!1)}setMaterialOpen(t){this.materialOpen=t}}i([n({type:d.AssetPicker,assetType:["Mesh"],label:"mesh-renderer.mesh.title",info:"mesh-renderer.mesh.info",bindPath:"mesh"}),p()],o.prototype,"mesh",2);i([n({type:d.AssetPicker,assetType:"Material",label:"mesh-renderer.material.title",info:"mesh-renderer.material.info",customFilter:r=>{var e;return((e=r.engineObject.shader)==null?void 0:e.name)!=="Effect/Particle"}}),v({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:P.ReferResource,getEngineValue:r=>r.getMaterial()}),p()],o.prototype,"material",2);i([n({label:"mesh-renderer.receive-shadows.title",info:"mesh-renderer.receive-shadows.info",bindPath:"receiveShadows"}),y(),p()],o.prototype,"receiveShadows",2);i([n({label:"mesh-renderer.cast-shadows.title",info:"mesh-renderer.cast-shadows.info",bindPath:"castShadows"}),y(),p()],o.prototype,"castShadows",2);i([n({label:"mesh-renderer.priority.title",info:"mesh-renderer.priority.info",bindPath:"priority"}),p()],o.prototype,"priority",2);i([u],o.prototype,"materialOpen",2);i([w],o.prototype,"setMaterialOpen",1);export{o as M};
@@ -1 +1 @@
1
- import{aJ as l,aM as c,av as m,aO as f,p as h}from"./index-3660a664.js";import{u as d}from"./index-365736f7.js";import{c as u}from"./Component-6d1e73e5.js";import"./postmen-c7605b45.js";import{c as M}from"./createOnModelChange-c010a049.js";import{R}from"./ReferencedMaterial-f7ea80fb.js";import{M as v}from"./MeshRendererBaseComponent-8fd1f0df.js";import"./MaterialInspector-237b6a5e.js";import"./IconPointFilled-dbf63b5c.js";import"./createReactComponent-d9f8b1af.js";const x=l(function(o){const[r,s]=c.useState(null),e=o.data,{assetStore:t,inspectorFacade:n}=d();return c.useEffect(()=>{t.getAssetByRef(e.material).then(a=>{s(a)})},[e.material]),m.jsxs(m.Fragment,{children:[m.jsx(f.List,{model:e,configs:e.formSchema.items,onModelChange:M("component",e.id,n,e)}),r&&m.jsx(R,{materialAsset:r})]})});var C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,i=(o,r,s,e)=>{for(var t=e>1?void 0:e?j(r,s):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(t=(e?a(r,s,t):a(t))||t);return e&&t&&C(r,s,t),t};let p=class extends v{constructor(o,r){super(o,r)}};i([h({assetType:["PrimitiveMesh","Mesh"]})],p.prototype,"mesh",2);p=i([u({type:"MeshRenderer",customInspector:x,componentsMenu:{label:"component.renderer.mesh.title"}})],p);export{p as MeshRendererComponent};
1
+ import{aJ as l,aM as c,av as m,aO as f,p as h}from"./index-e44b357e.js";import{u as d}from"./index-debbe073.js";import{c as u}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";import{c as M}from"./createOnModelChange-e65da908.js";import{R}from"./ReferencedMaterial-831d0583.js";import{M as v}from"./MeshRendererBaseComponent-5621d663.js";import"./MaterialInspector-23ea0240.js";import"./IconPointFilled-bad94cf1.js";import"./createReactComponent-cb70ea50.js";const x=l(function(o){const[r,s]=c.useState(null),e=o.data,{assetStore:t,inspectorFacade:n}=d();return c.useEffect(()=>{t.getAssetByRef(e.material).then(a=>{s(a)})},[e.material]),m.jsxs(m.Fragment,{children:[m.jsx(f.List,{model:e,configs:e.formSchema.items,onModelChange:M("component",e.id,n,e)}),r&&m.jsx(R,{materialAsset:r})]})});var C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,i=(o,r,s,e)=>{for(var t=e>1?void 0:e?j(r,s):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(t=(e?a(r,s,t):a(t))||t);return e&&t&&C(r,s,t),t};let p=class extends v{constructor(o,r){super(o,r)}};i([h({assetType:["PrimitiveMesh","Mesh"]})],p.prototype,"mesh",2);p=i([u({type:"MeshRenderer",customInspector:x,componentsMenu:{label:"component.renderer.mesh.title"}})],p);export{p as MeshRendererComponent};
@@ -1 +1 @@
1
- var r=Object.defineProperty;var c=(i,e,t)=>e in i?r(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>(c(i,typeof e!="symbol"?e+"":e,t),t);import{y as h,z as o,R as d}from"./index-3660a664.js";class a{static update(e,t){this.entity?this.entity.isActive=!0:this.initScene(e),this.meshRenderer.mesh=t.engineObject}static clear(){this.entity.isActive=!1}static initScene(e){const t=this.entity=e.createChild("mesh");t.transform.setRotation(16,-47.4,-16.7),this.meshRenderer=t.addComponent(h);const s=new o(e.engine);s.baseColor.set(.7,.7,.7,1),s.metallic=0,s.renderFace=d.Double,this.meshRenderer.setMaterial(s)}}n(a,"entity"),n(a,"meshRenderer");export{a as M};
1
+ var r=Object.defineProperty;var c=(i,e,t)=>e in i?r(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>(c(i,typeof e!="symbol"?e+"":e,t),t);import{y as h,z as o,R as d}from"./index-e44b357e.js";class a{static update(e,t){this.entity?this.entity.isActive=!0:this.initScene(e),this.meshRenderer.mesh=t.engineObject}static clear(){this.entity.isActive=!1}static initScene(e){const t=this.entity=e.createChild("mesh");t.transform.setRotation(16,-47.4,-16.7),this.meshRenderer=t.addComponent(h);const s=new o(e.engine);s.baseColor.set(.7,.7,.7,1),s.metallic=0,s.renderFace=d.Double,this.meshRenderer.setMaterial(s)}}n(a,"entity"),n(a,"meshRenderer");export{a as M};
@@ -1,4 +1,4 @@
1
- var ea=Object.defineProperty;var ta=(a,e,t)=>e in a?ea(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var S=(a,e,t)=>(ta(a,typeof e!="symbol"?e+"":e,t),t);import{bB as Ve,b8 as Ee,av as l,aw as ae,b7 as we,cb as ve,bT as lt,bU as je,cc as ie,ca as le,eW as me,aJ as X,aM as F,aO as aa,aK as K,bm as ze,cm as ee,bk as ct,fa as Ce,fb as de,bA as ra,bX as na,bI as _,fc as sa,bD as At,fd as oa,fe as ia,ff as la,fg as ca,fh as pa,fi as q,aH as ua,fj as ma,aI as Vt,aL as Ct,fk as da,fl as fa,fm as fe,dr as ha,c8 as Te,c9 as Le,c5 as ge,ce as Ot,b3 as Et,cf as wt,f7 as ya,E as ba,C as R,fn as W,fo as D,fp as be,bl as va,e as m,x as J,f as A,aE as ga,p as C,s as O}from"./index-3660a664.js";import{u as It}from"./index-365736f7.js";import{c as xa}from"./Component-6d1e73e5.js";import"./postmen-c7605b45.js";import{c as Sa}from"./createOnModelChange-c010a049.js";import{R as Pa}from"./ReferencedMaterial-f7ea80fb.js";import"./TextureAsset-d88af413.js";import"./GlTFAsset-5c8e7813.js";import"./MaterialAsset-c83c7d3d.js";import{MeshAsset as Ma}from"./MeshAsset-1c11d7ab.js";import"./AnimatorControllerAsset-23cceb12.js";import"./AnimationClipAsset-f96e0e56.js";import{I as za}from"./ShaderChunkAsset-a42443fc.js";import"./AmbientLightAsset-02786385.js";import"./SpineSkeletonDataAsset-fff17383.js";import"./FontAsset-8367aad9.js";import"./SceneAsset-1e802e29.js";import"./ShaderAsset-256afb00.js";import"./PrimitiveMesh-388f3f36.js";import"./XRReferenceImageAsset-d6d8e59c.js";import"./PrefabAsset-a6750aec.js";import"./PhysicsMaterialAsset-7e86c718.js";import"./RenderTargetAsset-c48990a4.js";import"./AudioAsset-6218f2bb.js";import"./index-eb74362c.js";import"./MarkdownAsset-58491579.js";import{I as Ca}from"./IconPlus-5fbc029e.js";import{B as rt}from"./index-8e169cc2.js";import{c as Oa}from"./createReactComponent-d9f8b1af.js";import"./MaterialInspector-237b6a5e.js";import"./IconPointFilled-dbf63b5c.js";import"./ktx2-encoder-e9b1c83a.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-3bc02b10.js";import"./AssetViewer-1073ddb5.js";import"./glTFIO-45ff9a17.js";import"./shader-data-utils-6ef12596.js";import"./index-75e7d483.js";import"./MeshThumbnail-d8ee2674.js";import"./bundlers-9b0d37fc.js";import"./module-4a37a616.js";import"./module-81a206c0.js";import"./ShaderUIScriptAsset-5acb02f5.js";import"./FormItemArray-53c58844.js";import"./Accordion-75b7b34e.js";import"./module-1c91b4e1.js";import"./Menu-a427d272.js";/**
1
+ var ea=Object.defineProperty;var ta=(a,e,t)=>e in a?ea(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var S=(a,e,t)=>(ta(a,typeof e!="symbol"?e+"":e,t),t);import{bB as Ve,b8 as Ee,av as l,aw as ae,b7 as we,cb as ve,bT as lt,bU as je,cc as ie,ca as le,eW as me,aJ as X,aM as F,aO as aa,aK as K,bm as ze,cm as ee,bk as ct,fa as Ce,fb as de,bA as ra,bX as na,bI as _,fc as sa,bD as At,fd as oa,fe as ia,ff as la,fg as ca,fh as pa,fi as q,aH as ua,fj as ma,aI as Vt,aL as Ct,fk as da,fl as fa,fm as fe,dr as ha,c8 as Te,c9 as Le,c5 as ge,ce as Ot,b3 as Et,cf as wt,f7 as ya,E as ba,C as R,fn as W,fo as D,fp as be,bl as va,e as m,x as J,f as A,aE as ga,p as C,s as O}from"./index-e44b357e.js";import{u as It}from"./index-debbe073.js";import{c as xa}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";import{c as Sa}from"./createOnModelChange-e65da908.js";import{R as Pa}from"./ReferencedMaterial-831d0583.js";import"./TextureAsset-9cd94531.js";import"./GlTFAsset-83e8190e.js";import"./MaterialAsset-0b9d7eba.js";import{MeshAsset as Ma}from"./MeshAsset-85e99837.js";import"./AnimatorControllerAsset-6cc04274.js";import"./AnimationClipAsset-b084da2a.js";import{I as za}from"./ShaderChunkAsset-e3487bd1.js";import"./AmbientLightAsset-e34de607.js";import"./SpineSkeletonDataAsset-0dffbb4d.js";import"./FontAsset-6e9c0549.js";import"./SceneAsset-d05b1a79.js";import"./ShaderAsset-370b6f1c.js";import"./PrimitiveMesh-70c93e7e.js";import"./XRReferenceImageAsset-79e78558.js";import"./PrefabAsset-265f6f48.js";import"./PhysicsMaterialAsset-cb9afb6e.js";import"./RenderTargetAsset-b810caf3.js";import"./AudioAsset-9c715952.js";import"./index-ea7fe254.js";import"./MarkdownAsset-b42846c0.js";import{I as Ca}from"./IconPlus-172c6c17.js";import{B as rt}from"./index-f7bd6fef.js";import{c as Oa}from"./createReactComponent-cb70ea50.js";import"./MaterialInspector-23ea0240.js";import"./IconPointFilled-bad94cf1.js";import"./ktx2-encoder-522fc017.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-71e5a4e7.js";import"./AssetViewer-d2c63b00.js";import"./glTFIO-45ff9a17.js";import"./shader-data-utils-000170ae.js";import"./index-7e414715.js";import"./MeshThumbnail-b1283749.js";import"./bundlers-9b0d37fc.js";import"./module-5547be1c.js";import"./module-57b6e417.js";import"./ShaderUIScriptAsset-ebf57ceb.js";import"./FormItemArray-b2a3d249.js";import"./Accordion-f938dadf.js";import"./module-5906e0d4.js";import"./Menu-05c1f0a4.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.
@@ -1 +1 @@
1
- var y=Object.defineProperty;var M=(t,i,e)=>i in t?y(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var r=(t,i,e)=>(M(t,typeof i!="symbol"?i+"":i,e),e);import{j as h,P as a,k as d,p as l,C as b,m,n as v,e as C,o as F,q as P}from"./index-3660a664.js";import"./index-365736f7.js";import"./postmen-c7605b45.js";var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,c=(t,i,e,n)=>{for(var o=n>1?void 0:n?g(i,e):i,p=t.length-1,u;p>=0;p--)(u=t[p])&&(o=(n?u(i,e,o):u(o))||o);return n&&o&&f(i,e,o),o};let s=class extends h{constructor(i){super(i);r(this,"dynamicFriction",.6);r(this,"staticFriction",.6);r(this,"bounciness",0);r(this,"frictionCombine",a.Average);r(this,"bounceCombine",a.Average)}async initByMain(i){const e=JSON.parse(await i.text()),n=new d;n.dynamicFriction=this.dynamicFriction=e.dynamicFriction,n.staticFriction=this.staticFriction=e.staticFriction,n.bounciness=this.bounciness=e.bounciness,n.frictionCombine=this.frictionCombine=e.frictionCombine,n.bounceCombine=this.bounceCombine=e.bounceCombine,this.bindEngineObject(n)}async initByCreation(){return this.getMainData()}destroy(){var i;super.destroy(),(i=this.engineObject)==null||i.destroy()}};c([l({type:b.Number,label:"DynamicFriction",bindPath:"dynamicFriction"}),m()],s.prototype,"dynamicFriction",2);c([l({type:b.Number,label:"StaticFriction",bindPath:"staticFriction"}),m()],s.prototype,"staticFriction",2);c([l({type:b.Number,min:0,max:1,label:"Bounciness",bindPath:"bounciness"}),m()],s.prototype,"bounciness",2);c([l({type:b.Select,label:"FrictionCombine",bindPath:"frictionCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),m()],s.prototype,"frictionCombine",2);c([l({type:b.Select,label:"BounceCombine",bindPath:"bounceCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),m()],s.prototype,"bounceCombine",2);s=c([v({type:"PhysicsMaterial",label:C("asset.physics-material.title"),extname:"physMat",importMenuConfig:{type:F.Add},dragLayer:P.PhysicsMaterial,async bundle({content:t}){return{content:t}}})],s);export{s as PhysicsMaterialAsset};
1
+ var y=Object.defineProperty;var M=(t,i,e)=>i in t?y(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var r=(t,i,e)=>(M(t,typeof i!="symbol"?i+"":i,e),e);import{j as h,P as a,k as d,p as l,C as b,m,n as v,e as C,o as F,q as P}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,c=(t,i,e,n)=>{for(var o=n>1?void 0:n?g(i,e):i,p=t.length-1,u;p>=0;p--)(u=t[p])&&(o=(n?u(i,e,o):u(o))||o);return n&&o&&f(i,e,o),o};let s=class extends h{constructor(i){super(i);r(this,"dynamicFriction",.6);r(this,"staticFriction",.6);r(this,"bounciness",0);r(this,"frictionCombine",a.Average);r(this,"bounceCombine",a.Average)}async initByMain(i){const e=JSON.parse(await i.text()),n=new d;n.dynamicFriction=this.dynamicFriction=e.dynamicFriction,n.staticFriction=this.staticFriction=e.staticFriction,n.bounciness=this.bounciness=e.bounciness,n.frictionCombine=this.frictionCombine=e.frictionCombine,n.bounceCombine=this.bounceCombine=e.bounceCombine,this.bindEngineObject(n)}async initByCreation(){return this.getMainData()}destroy(){var i;super.destroy(),(i=this.engineObject)==null||i.destroy()}};c([l({type:b.Number,label:"DynamicFriction",bindPath:"dynamicFriction"}),m()],s.prototype,"dynamicFriction",2);c([l({type:b.Number,label:"StaticFriction",bindPath:"staticFriction"}),m()],s.prototype,"staticFriction",2);c([l({type:b.Number,min:0,max:1,label:"Bounciness",bindPath:"bounciness"}),m()],s.prototype,"bounciness",2);c([l({type:b.Select,label:"FrictionCombine",bindPath:"frictionCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),m()],s.prototype,"frictionCombine",2);c([l({type:b.Select,label:"BounceCombine",bindPath:"bounceCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),m()],s.prototype,"bounceCombine",2);s=c([v({type:"PhysicsMaterial",label:C("asset.physics-material.title"),extname:"physMat",importMenuConfig:{type:F.Add},dragLayer:P.PhysicsMaterial,async bundle({content:t}){return{content:t}}})],s);export{s as PhysicsMaterialAsset};
@@ -1 +1 @@
1
- var pe=Object.defineProperty;var de=(o,e,t)=>e in o?pe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(de(o,typeof e!="symbol"?e+"":e,t),t);import{aJ as j,aK as z,av as l,bm as X,cm as P,bk as se,eD as I,dr as re,bA as ye,q as me,cB as K,eE as $,eF as G,eG as L,eH as J,bI as N,f as he,aE as ue,s as y,p as m,e as r,E as ae,eI as W,eJ as S,eK as B,C as h,eL as Y,eM as fe,eN as Z,e1 as le,eO as be,eP as ge,bq as Ce,cz as Q,bs as xe,bt as Se}from"./index-3660a664.js";import{r as H}from"./index-365736f7.js";import{c as F}from"./Component-6d1e73e5.js";import"./postmen-c7605b45.js";import{F as Pe}from"./FormItemArray-53c58844.js";const je={BoxColliderShape:["size","isTrigger","position","rotation","material"],CapsuleColliderShape:["radius","height","upAxis","isTrigger","position","rotation","material"],PlaneColliderShape:["isTrigger","position","rotation","material"],SphereColliderShape:["radius","isTrigger","position","rotation","material"]};function ve(o){const e={};return Object.keys(o.props).forEach(t=>{je[o.class].includes(t)&&(e[t]=o.props[t])}),e}const ze=async(o,e,t)=>{const i=o.engineObject,n=i.shapes;if(n.length===t.length&&t.every((s,a)=>Oe(s.class,n[a]))){for(let s=0;s<t.length;s++)await k(n[s],t[s]),ee(n[s],t[s]);return}i.clearShapes();for(let s=0;s<t.length;s++){const a=t[s],d=_e(a);await k(d,a),ee(d,a),i.addShape(d)}};async function k(o,e){const t=e.props.material;if(t!=null&&t.refId)try{const i=await H.assetStore.getAssetByRef(t);i!=null&&i.engineObject&&(o.material=i.engineObject)}catch(i){console.error(i)}}function Oe(o,e){switch(o){case"BoxColliderShape":return e instanceof J;case"CapsuleColliderShape":return e instanceof L;case"PlaneColliderShape":return e instanceof G;case"SphereColliderShape":return e instanceof $;default:return!1}}function _e(o){switch(o.class){case"BoxColliderShape":return new J;case"CapsuleColliderShape":return new L;case"PlaneColliderShape":return new G;case"SphereColliderShape":return new $}}function ee(o,e){const t=e.props;if(o instanceof J&&t.size){const s=o.size;s.copyFrom(t.size),o.size=s}else o instanceof L?(t.radius!==void 0&&(o.radius=t.radius),t.height!==void 0&&(o.height=t.height),t.upAxis!==void 0&&(o.upAxis=t.upAxis)):o instanceof $&&t.radius!==void 0&&(o.radius=t.radius);o.isTrigger=t.isTrigger;const i=o.position;i.copyFrom(t.position),o.position=i;const n=o.rotation;n.copyFrom(t.rotation),o.rotation=n}const De=o=>o.map(e=>{if(e instanceof J)return{class:"BoxColliderShape",props:{isTrigger:e.isTrigger,size:{x:e.size.x,y:e.size.y,z:e.size.z},position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof L)return{class:"CapsuleColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,height:e.height,upAxis:e.upAxis,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof G)return{class:"PlaneColliderShape",props:{isTrigger:e.isTrigger,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof $)return{class:"SphereColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}}}),Te=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(X,{label:t("physics.shape.box.size.title"),info:t("physics.shape.box.size.info"),min:0,value:{x:o.props.size.x,y:o.props.size.y,z:o.props.size.z},onChange:(i,n)=>{const s=i==null?void 0:i[n];typeof s=="number"&&e(a=>{a.props.size={...a.props.size,[n]:s}})}})})}),we=j(()=>l.jsx(l.Fragment,{})),Ae=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(P,{label:t("physics.shape.sphere.radius.title"),info:t("physics.shape.sphere.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}})})}),Me=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsxs(l.Fragment,{children:[l.jsx(P,{label:t("physics.shape.capsule.radius.title"),info:t("physics.shape.capsule.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}}),l.jsx(P,{label:t("physics.shape.capsule.height.title"),info:t("physics.shape.capsule.height.info"),value:o.props.height,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.height=i})}}),l.jsx(se,{label:t("physics.shape.capsule.up-axis.title"),info:t("physics.shape.capsule.up-axis.info"),options:[{label:"X",value:I.X},{label:"Y",value:I.Y},{label:"Z",value:I.Z}],value:o.props.upAxis,onChange:i=>{e(n=>{n.props.upAxis=i})}})]})}),Fe={BoxColliderShape:Te,CapsuleColliderShape:Me,PlaneColliderShape:we,SphereColliderShape:Ae},q={BoxColliderShape:{class:"BoxColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},size:{x:1,y:1,z:1},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},CapsuleColliderShape:{class:"CapsuleColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,height:2,upAxis:I.Y,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},PlaneColliderShape:{class:"PlaneColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},SphereColliderShape:{class:"SphereColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}}},Ve=j(({item:o,onItemChange:e})=>{var d;const{t}=z(),i=Fe[o.class],n=H.assetStore,s=Object.values(n.assets).filter(c=>c.getMetaConfig().type==="PhysicsMaterial"),a=n.assets[(d=o.props.material)==null?void 0:d.refId];return l.jsxs(l.Fragment,{children:[l.jsx(re,{label:t("physics.collider.trigger.title"),info:t("physics.collider.trigger.info"),value:o.props.isTrigger,onChange:c=>{e(f=>{f.props.isTrigger=c})}}),l.jsx(ye,{label:t("physics.collider.material.title"),info:t("physics.collider.material.info"),dropLayer:me.PhysicsMaterial,value:a==null?void 0:a.name,assets:s,onSelect:c=>{e(f=>{f.props.material=c.getCurrentRef()})},onLocate:()=>{a&&a.id&&n.selectAsset(a.id)}}),l.jsx(i,{item:o,onItemChange:e}),l.jsx(X,{label:t("physics.collider.local-position.title"),info:t("physics.collider.local-position.info"),value:{x:o.props.position.x,y:o.props.position.y,z:o.props.position.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.position={...b.props.position,[f]:u}})}}),l.jsx(X,{label:t("physics.collider.rotation.title"),info:t("physics.collider.rotation.info"),value:{x:o.props.rotation.x,y:o.props.rotation.y,z:o.props.rotation.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.rotation={...b.props.rotation,[f]:u}})}})]})}),Be=j(({collider:o,item:e,index:t,onModelChange:i})=>{const{t:n}=z(),s=[{label:n("physics.shape.box.title"),value:"BoxColliderShape"},{label:n("physics.shape.capsule.title"),value:"CapsuleColliderShape"}];o.engineObject instanceof K||(s.push({label:n("physics.shape.plane.title"),value:"PlaneColliderShape"}),s.push({label:n("physics.shape.sphere.title"),value:"SphereColliderShape"}));const d=c=>{const f=o.colliderShapes,u=N(f),b=u[t];b&&(c(b),i==null||i("colliderShapes",u))};return l.jsxs(l.Fragment,{children:[l.jsx(se,{label:n("physics.shape.type.title"),info:n("physics.shape.type.info"),value:e.class,options:s,onChange:c=>{q[c].class!==e.class&&d(u=>{Object.assign(u,N(q[c]))})}}),l.jsx(Ve,{item:e,onItemChange:d})]})}),Ee=j(({model:o,inspectorConfig:e,onModelChange:t})=>{const{label:i}=e,n=o.colliderShapes,{t:s}=z(),a=d=>{const c=N(n);d(c),t==null||t("colliderShapes",c)};return l.jsx(Pe,{label:i,items:n.map((d,c)=>({removable:!0,children:l.jsx(Be,{collider:o,item:d,index:c,onModelChange:t}),id:`${c}`,name:s("physics.shape.item-name",{index:c})})),addable:!0,onAdd:()=>{a(d=>{d.push(N(q.BoxColliderShape))})},onDelete:d=>{a(c=>{c.splice(+d.id,1)})},addItemText:s("physics.shape.add")})});var Ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,$e=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ne(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ie(e,t,n),n};class R extends ae{constructor(){super(...arguments);p(this,"colliderShapes",[])}}$e([he({engineKey:"addShape",editorKey:"colliderShapes",getPath:"shapes",valueType:ue.Object,getEngineValue:o=>o.shapes,getEditorValue:De}),y({type:"methods",key:"colliderShapes",canonicalizeToProps:!0,onSerialize:o=>o.map(e=>({$type:e.class,...ve(e)})),onDeserialize:o=>o.map(e=>{const{$type:t,...i}=e;return{class:t,props:i}})}),m({label:r("physics.collider.title"),info:r("physics.collider.info"),customComponent:Ee,onChange:ze})],R.prototype,"colliderShapes",2);var Le=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Re=(o,e,t,i)=>{for(var n=i>1?void 0:i?Je(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Le(e,t,n),n};let te=class extends R{constructor(o,e){super(o,e)}};te=Re([F({type:"StaticCollider",componentsMenu:{group:"physics",label:"component.static-collider.title"}})],te);const ie=o=>Object.keys(S).filter(e=>(o&S[e])!==0).map(e=>String(S[e])),Xe=j(({model:o,onModelChange:e})=>{const t=n=>{const a=n.map(d=>parseInt(d)).reduce((d,c)=>d|c,S.None);e==null||e("constraints",a)},{t:i}=z();return l.jsxs(l.Fragment,{children:[l.jsx(W,{label:i("physics.collider-constraints.freeze-position.title"),info:i("physics.collider-constraints.freeze-position.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezePositionX.toString(),label:"X"},{value:S.FreezePositionY.toString(),label:"Y"},{value:S.FreezePositionZ.toString(),label:"Z"}],onChange:t}),l.jsx(W,{label:i("physics.collider-constraints.freeze-rotation.title"),info:i("physics.collider-constraints.freeze-rotation.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezeRotationX.toString(),label:"X"},{value:S.FreezeRotationY.toString(),label:"Y"},{value:S.FreezeRotationZ.toString(),label:"Z"}],onChange:t})]})});var Ke=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,C=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ye(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ke(e,t,n),n};let g=class extends R{constructor(e,t){super(e,t);p(this,"isKinematic",!1);p(this,"collisionDetectionMode",B.Discrete);p(this,"constraints",S.None);p(this,"mass",1);p(this,"useGravity",!0);p(this,"linearDamping",0);p(this,"angularDamping",.05);p(this,"automaticCenterOfMass",!0);p(this,"centerOfMass",{x:0,y:0,z:0});p(this,"automaticInertiaTensor",!0);p(this,"inertiaTensor",{x:1,y:1,z:1});p(this,"linearVelocity",{x:0,y:0,z:0});p(this,"angularVelocity",{x:0,y:0,z:0});p(this,"maxAngularVelocity",100);p(this,"maxDepenetrationVelocity",10000000331813535e16);p(this,"sleepThreshold",.005);p(this,"solverIterations",4)}onEnabled(){this._applyEditorRuntimeState()}onInitComplete(){this._applyEditorRuntimeState()}rebindEngineObject(e){super.rebindEngineObject(e),this._applyEditorRuntimeState()}_applyEditorRuntimeState(){this.applyBoundPathChange("enabled",h.Toggle,!1)}};C([y(),m({label:r("physics.dynamic-collider.kinematic.title"),info:r("physics.dynamic-collider.kinematic.info"),type:h.Boolean,bindPath:"isKinematic"})],g.prototype,"isKinematic",2);C([y(),m({label:r("physics.dynamic-collider.collision-detection-mode.title"),type:h.Select,bindPath:"collisionDetectionMode",options:[{label:r("physics.dynamic-collider.collision-detection-mode.discrete"),value:B.Discrete},{label:r("physics.dynamic-collider.collision-detection-mode.continuous"),value:B.Continuous},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-dynamic"),value:B.ContinuousDynamic},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-speculative"),value:B.ContinuousSpeculative}]})],g.prototype,"collisionDetectionMode",2);C([y(),m({label:r("physics.dynamic-collider.constraints.title"),info:r("physics.dynamic-collider.constraints.info"),customComponent:Xe,bindPath:"constraints"})],g.prototype,"constraints",2);C([y(),m({label:r("physics.dynamic-collider.mass.title"),info:r("physics.dynamic-collider.mass.info"),bindPath:"mass",min:0,type:h.Number})],g.prototype,"mass",2);C([y(),m({label:r("physics.dynamic-collider.gravity.title"),info:r("physics.dynamic-collider.gravity.info"),bindPath:"useGravity",type:h.Boolean})],g.prototype,"useGravity",2);C([y(),m({label:r("physics.dynamic-collider.linear-damping.title"),info:r("physics.dynamic-collider.linear-damping.info"),bindPath:"linearDamping",min:0,type:h.Number})],g.prototype,"linearDamping",2);C([y(),m({label:r("physics.dynamic-collider.angular-damping.title"),info:r("physics.dynamic-collider.angular-damping.info"),bindPath:"angularDamping",min:0,type:h.Number})],g.prototype,"angularDamping",2);C([y(),m({label:r("physics.dynamic-collider.automatic-center-of-mass.title"),info:r("physics.dynamic-collider.automatic-center-of-mass.info"),bindPath:"automaticCenterOfMass",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.centerOfMass;o.centerOfMass={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticCenterOfMass",2);C([y(),m({label:r("physics.dynamic-collider.center-of-mass.title"),info:r("physics.dynamic-collider.center-of-mass.info"),type:h.Vector3,bindPath:"centerOfMass",when:o=>!o.automaticCenterOfMass})],g.prototype,"centerOfMass",2);C([y(),m({label:r("physics.dynamic-collider.automatic-inertia-tensor.title"),info:r("physics.dynamic-collider.automatic-inertia-tensor.info"),bindPath:"automaticInertiaTensor",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.inertiaTensor;o.inertiaTensor={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticInertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.inertia-tensor.title"),info:r("physics.dynamic-collider.inertia-tensor.info"),type:h.Vector3,bindPath:"inertiaTensor",when:o=>!o.automaticInertiaTensor})],g.prototype,"inertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.linear-velocity.title"),info:r("physics.dynamic-collider.linear-velocity.info"),type:h.Vector3,bindPath:"linearVelocity"})],g.prototype,"linearVelocity",2);C([y(),m({label:r("physics.dynamic-collider.angular-velocity.title"),info:r("physics.dynamic-collider.angular-velocity.info"),type:h.Vector3,bindPath:"angularVelocity"})],g.prototype,"angularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-angular-velocity.title"),info:r("physics.dynamic-collider.max-angular-velocity.info"),bindPath:"maxAngularVelocity",min:0,type:h.Number})],g.prototype,"maxAngularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-depenetration-velocity.title"),info:r("physics.dynamic-collider.max-depenetration-velocity.info"),bindPath:"maxDepenetrationVelocity",min:0,type:h.Number})],g.prototype,"maxDepenetrationVelocity",2);C([y(),m({label:r("physics.dynamic-collider.sleep-threshold.title"),info:r("physics.dynamic-collider.sleep-threshold.info"),bindPath:"sleepThreshold",min:0,type:h.Number})],g.prototype,"sleepThreshold",2);C([y(),m({label:r("physics.dynamic-collider.solver-iterations.title"),info:r("physics.dynamic-collider.solver-iterations.info"),bindPath:"solverIterations",min:0,max:10,dragStep:1,type:h.Slider})],g.prototype,"solverIterations",2);g=C([F({type:"DynamicCollider",componentsMenu:{group:"physics",label:"component.dynamic-collider.title"}})],g);var qe=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,E=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ge(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&qe(e,t,n),n};let M=class extends R{constructor(e,t){super(e,t);p(this,"stepOffset",.5);p(this,"upDirection",{x:0,y:1,z:0});p(this,"slopeLimit",45);p(this,"nonWalkableMode",Y.PreventClimbing)}async bindEngineObject(e){await super.bindEngineObject(e),e.enabled=!1}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1}};E([y(),m({label:r("physics.character.step-offset.title"),info:r("physics.character.step-offset.info"),bindPath:"stepOffset",min:0,type:h.Number})],M.prototype,"stepOffset",2);E([y(),m({label:r("physics.character.up-direction.title"),info:r("physics.character.up-direction.info"),type:h.Vector3,bindPath:"upDirection"})],M.prototype,"upDirection",2);E([y(),m({label:r("physics.character.slop-limit.title"),info:r("physics.character.slop-limit.info"),bindPath:"slopeLimit",min:0,max:180,type:h.Number})],M.prototype,"slopeLimit",2);E([y(),m({label:r("physics.character.non-walkable-mode.title"),info:r("physics.character.non-walkable-mode.info"),bindPath:"nonWalkableMode",type:h.Select,options:[{label:r("physics.character.non-walkable-mode.prevent-climbing"),value:Y.PreventClimbing},{label:r("physics.character.non-walkable-mode.prevent-climbing-and-force-sliding"),value:Y.PreventClimbingAndForceSliding}]})],M.prototype,"nonWalkableMode",2);M=E([F({type:"CharacterController",componentsMenu:{label:r("component.physics.character.title"),group:"physics"}})],M);const Ze=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,disabled:a,info:d}=e,{ownerId:c}=t[n]||{},f=c&&o.model.root.sceneStore.getEntityModel(c),u=O=>{const _=O?H.sceneStore.getEntityModel(O):null,U=(_==null?void 0:_.getComponentByTypeName("DynamicCollider"))||(_==null?void 0:_.getComponentByTypeName("StaticCollider")),ce=U?{ownerId:O,componentId:U.id}:null;i==null||i(n,ce)},{t:b}=z(),x=Array.from(t.root.sceneStore.iterateEntityModels(),([,O])=>O);return l.jsx(l.Fragment,{children:l.jsx(fe,{label:b(s),info:b(d),entities:x,value:c,disabled:a,customFilter:O=>{let _=null;return t.entityModelId!==O.id&&(_=O.getComponentByTypeName("DynamicCollider")||O.getComponentByTypeName("StaticCollider")),_},displayValue:f==null?void 0:f.name,placeholder:b("physics.collider-picker.placeholder"),onSelect:u,onLocate:()=>{o.model.root.sceneStore.selectEntity(c)},onDelete:()=>{u(null)}})})});var He=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,T=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ue(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&He(e,t,n),n};class v extends ae{constructor(){super(...arguments);p(this,"connectedCollider",null);p(this,"anchor",{x:0,y:0,z:0});p(this,"automaticConnectedAnchor",!0);p(this,"connectedAnchor",{x:0,y:0,z:0});p(this,"breakForce",Number.MAX_VALUE);p(this,"breakTorque",Number.MAX_VALUE);p(this,"massScale",1);p(this,"connectedMassScale",1)}async applyBoundPathChange(t,i,n){var s,a;if(t==="connectedCollider"){const d=n,c=((a=(s=this.root.sceneStore.getEntityModel(d==null?void 0:d.ownerId))==null?void 0:s.getComponentById(d==null?void 0:d.componentId))==null?void 0:a.engineObject)??null;await super.applyBoundPathChange(t,i,c);return}await super.applyBoundPathChange(t,i,n)}}T([y(),m({label:r("physics.joint.connected-collider.title"),info:r("physics.joint.connected-collider.info"),customComponent:Ze,bindPath:"connectedCollider"})],v.prototype,"connectedCollider",2);T([y(),m({label:r("physics.joint.anchor.title"),type:h.Vector3,bindPath:"anchor",onChange(o,e,t){if(o.automaticConnectedAnchor){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"anchor",2);T([y(),m({label:r("physics.joint.automatic-connected-anchor.title"),type:h.Boolean,bindPath:"automaticConnectedAnchor",onChange(o,e,t){if(t){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"automaticConnectedAnchor",2);T([y(),m({label:r("physics.joint.connected-anchor.title"),type:h.Vector3,bindPath:"connectedAnchor",when:o=>!o.automaticConnectedAnchor})],v.prototype,"connectedAnchor",2);T([y(),m({label:r("physics.joint.break-force.title"),type:h.Number,bindPath:"breakForce"})],v.prototype,"breakForce",2);T([y(),m({label:r("physics.joint.break-torque.title"),type:h.Number,bindPath:"breakTorque"})],v.prototype,"breakTorque",2);T([y(),m({label:r("physics.joint.mass-scale.title"),type:h.Number,bindPath:"massScale"})],v.prototype,"massScale",2);T([y(),m({label:r("physics.joint.connected-mass-scale.title"),type:h.Number,bindPath:"connectedMassScale"})],v.prototype,"connectedMassScale",2);var We=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,ke=(o,e,t,i)=>{for(var n=i>1?void 0:i?Qe(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&We(e,t,n),n};let oe=class extends v{constructor(o,e){super(o,e)}};oe=ke([F({type:"FixedJoint",componentsMenu:{label:r("component.physics.fixed-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],oe);const et=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useLimits,c=t.useSpring,f=t[n],u=f.props,{t:b}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:b(s),info:b(a),children:[l.jsx(P,{label:b("physics.joint-limits.min"),value:u.min,onChange:x=>{u.max<x&&(u.max=x),u.min=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.max"),value:u.max,onChange:x=>{x<u.min&&(x=u.min),u.max=x,i(n,f)}}),c?l.jsxs(l.Fragment,{children:[l.jsx(P,{label:b("physics.joint-limits.stiffness"),value:u.stiffness,onChange:x=>{u.stiffness=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.damping"),value:u.damping,onChange:x=>{u.damping=x,i(n,f)}})]}):l.jsx(P,{label:b("physics.joint-limits.contact-distance"),value:u.contactDistance,onChange:x=>{u.contactDistance=x,i(n,f)}})]}):null})}),tt=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useMotor,c=t[n],f=c.props,{t:u}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:u(s),info:u(a),children:[l.jsx(P,{label:u("physics.joint-motor.target-velocity"),value:f.targetVelocity,onChange:b=>{f.targetVelocity=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.force-limit"),value:f.forceLimit,onChange:b=>{f.forceLimit=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.gear-ratio"),value:f.gearRatio,onChange:b=>{f.gearRatio=b,i(n,c)}}),l.jsx(re,{label:u("physics.joint-motor.free-spin"),value:f.freeSpin,onChange:b=>{f.freeSpin=b,i(n,c)}})]}):null})});var it=Object.defineProperty,ot=Object.getOwnPropertyDescriptor,A=(o,e,t,i)=>{for(var n=i>1?void 0:i?ot(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&it(e,t,n),n};let D=class extends v{constructor(e,t){super(e,t);p(this,"axis",{x:1,y:0,z:0});p(this,"useLimits",!1);p(this,"useSpring",!1);p(this,"limits",{class:"JointLimits",props:{max:0,min:0,contactDistance:-1,stiffness:0,damping:0}});p(this,"useMotor",!1);p(this,"motor",{class:"JointMotor",props:{targetVelocity:0,forceLimit:Number.MAX_VALUE,gearRatio:1,freeSpin:!1}})}async applyBoundPathChange(e,t,i){if(e==="limits"){const n=this._buildLimitsFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}if(e==="motor"){const n=this._buildMotorFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}await super.applyBoundPathChange(e,t,i)}_buildLimitsFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new be;return i.max=t.max,i.min=t.min,i.contactDistance=t.contactDistance,i.stiffness=t.stiffness,i.damping=t.damping,i}_buildMotorFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new ge;return i.targetVelocity=t.targetVelocity,i.forceLimit=t.forceLimit,i.gearRatio=t.gearRatio,i.freeSpin=t.freeSpin,i}};A([y(),m({label:r("physics.hinge-joint.axis.title"),type:h.Vector3,bindPath:"axis"})],D.prototype,"axis",2);A([y(),m({label:r("physics.hinge-joint.use-limits.title"),type:h.Boolean,bindPath:"useLimits"})],D.prototype,"useLimits",2);A([y(),m({label:r("physics.hinge-joint.use-spring.title"),type:h.Boolean,bindPath:"useSpring"})],D.prototype,"useSpring",2);A([y(),m({label:r("physics.hinge-joint.limits.title"),customComponent:et,bindPath:"limits"})],D.prototype,"limits",2);A([y(),m({label:r("physics.hinge-joint.use-motor.title"),type:h.Boolean,bindPath:"useMotor"})],D.prototype,"useMotor",2);A([y(),m({label:r("physics.hinge-joint.motor.title"),customComponent:tt,bindPath:"motor"})],D.prototype,"motor",2);D=A([F({type:"HingeJoint",componentsMenu:{label:r("component.physics.hinge-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],D);var nt=Object.defineProperty,st=Object.getOwnPropertyDescriptor,V=(o,e,t,i)=>{for(var n=i>1?void 0:i?st(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&nt(e,t,n),n};let w=class extends v{constructor(e,t){super(e,t);p(this,"spring",10);p(this,"damper",.2);p(this,"minDistance",0);p(this,"maxDistance",0);p(this,"tolerance",.025)}};V([y(),m({label:r("physics.spring-joint.spring.title"),type:h.Number,bindPath:"spring"})],w.prototype,"spring",2);V([y(),m({label:r("physics.spring-joint.damper.title"),type:h.Number,bindPath:"damper"})],w.prototype,"damper",2);V([y(),m({label:r("physics.spring-joint.min-distance.title"),type:h.Number,bindPath:"minDistance"})],w.prototype,"minDistance",2);V([y(),m({label:r("physics.spring-joint.max-distance.title"),type:h.Number,bindPath:"maxDistance"})],w.prototype,"maxDistance",2);V([y(),m({label:r("physics.spring-joint.tolerance.title"),type:h.Number,bindPath:"tolerance"})],w.prototype,"tolerance",2);w=V([F({type:"SpringJoint",componentsMenu:{label:r("component.physics.spring-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],w);class rt extends Ce{constructor(){super(...arguments);p(this,"_isPlaying",!1)}onPlay(t){this._isPlaying=t,this._toggleAll(t)}onAddComponent(t){!this._isPlaying&&(t instanceof Q||t instanceof K)&&(t.enabled=!1)}_toggleAll(t){var a;const i=(a=this.engine.sceneManager.activeScene)==null?void 0:a.rootEntities;if(!i)return;const n=[],s=[];i.forEach(d=>{d.getComponentsIncludeChildren(Q,n),d.getComponentsIncludeChildren(K,s)}),n.forEach(d=>{d.enabled=t}),s.forEach(d=>{d.enabled=t})}}var at=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,ct=(o,e,t,i)=>{for(var n=i>1?void 0:i?lt(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&at(e,t,n),n};let ne=class{constructor(){p(this,"script")}init(){this.script=xe.addScript(rt)}};ne=ct([Se({type:"physicsStore"})],ne);export{M as C,g as D,oe as F,D as H,ne as P,te as S,w as a};
1
+ var pe=Object.defineProperty;var de=(o,e,t)=>e in o?pe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(de(o,typeof e!="symbol"?e+"":e,t),t);import{aJ as j,aK as z,av as l,bm as X,cm as P,bk as se,eD as I,dr as re,bA as ye,q as me,cB as K,eE as $,eF as G,eG as L,eH as J,bI as N,f as he,aE as ue,s as y,p as m,e as r,E as ae,eI as W,eJ as S,eK as B,C as h,eL as Y,eM as fe,eN as Z,e1 as le,eO as be,eP as ge,bq as Ce,cz as Q,bs as xe,bt as Se}from"./index-e44b357e.js";import{r as H}from"./index-debbe073.js";import{c as F}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";import{F as Pe}from"./FormItemArray-b2a3d249.js";const je={BoxColliderShape:["size","isTrigger","position","rotation","material"],CapsuleColliderShape:["radius","height","upAxis","isTrigger","position","rotation","material"],PlaneColliderShape:["isTrigger","position","rotation","material"],SphereColliderShape:["radius","isTrigger","position","rotation","material"]};function ve(o){const e={};return Object.keys(o.props).forEach(t=>{je[o.class].includes(t)&&(e[t]=o.props[t])}),e}const ze=async(o,e,t)=>{const i=o.engineObject,n=i.shapes;if(n.length===t.length&&t.every((s,a)=>Oe(s.class,n[a]))){for(let s=0;s<t.length;s++)await k(n[s],t[s]),ee(n[s],t[s]);return}i.clearShapes();for(let s=0;s<t.length;s++){const a=t[s],d=_e(a);await k(d,a),ee(d,a),i.addShape(d)}};async function k(o,e){const t=e.props.material;if(t!=null&&t.refId)try{const i=await H.assetStore.getAssetByRef(t);i!=null&&i.engineObject&&(o.material=i.engineObject)}catch(i){console.error(i)}}function Oe(o,e){switch(o){case"BoxColliderShape":return e instanceof J;case"CapsuleColliderShape":return e instanceof L;case"PlaneColliderShape":return e instanceof G;case"SphereColliderShape":return e instanceof $;default:return!1}}function _e(o){switch(o.class){case"BoxColliderShape":return new J;case"CapsuleColliderShape":return new L;case"PlaneColliderShape":return new G;case"SphereColliderShape":return new $}}function ee(o,e){const t=e.props;if(o instanceof J&&t.size){const s=o.size;s.copyFrom(t.size),o.size=s}else o instanceof L?(t.radius!==void 0&&(o.radius=t.radius),t.height!==void 0&&(o.height=t.height),t.upAxis!==void 0&&(o.upAxis=t.upAxis)):o instanceof $&&t.radius!==void 0&&(o.radius=t.radius);o.isTrigger=t.isTrigger;const i=o.position;i.copyFrom(t.position),o.position=i;const n=o.rotation;n.copyFrom(t.rotation),o.rotation=n}const De=o=>o.map(e=>{if(e instanceof J)return{class:"BoxColliderShape",props:{isTrigger:e.isTrigger,size:{x:e.size.x,y:e.size.y,z:e.size.z},position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof L)return{class:"CapsuleColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,height:e.height,upAxis:e.upAxis,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof G)return{class:"PlaneColliderShape",props:{isTrigger:e.isTrigger,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof $)return{class:"SphereColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}}}),Te=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(X,{label:t("physics.shape.box.size.title"),info:t("physics.shape.box.size.info"),min:0,value:{x:o.props.size.x,y:o.props.size.y,z:o.props.size.z},onChange:(i,n)=>{const s=i==null?void 0:i[n];typeof s=="number"&&e(a=>{a.props.size={...a.props.size,[n]:s}})}})})}),we=j(()=>l.jsx(l.Fragment,{})),Ae=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(P,{label:t("physics.shape.sphere.radius.title"),info:t("physics.shape.sphere.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}})})}),Me=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsxs(l.Fragment,{children:[l.jsx(P,{label:t("physics.shape.capsule.radius.title"),info:t("physics.shape.capsule.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}}),l.jsx(P,{label:t("physics.shape.capsule.height.title"),info:t("physics.shape.capsule.height.info"),value:o.props.height,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.height=i})}}),l.jsx(se,{label:t("physics.shape.capsule.up-axis.title"),info:t("physics.shape.capsule.up-axis.info"),options:[{label:"X",value:I.X},{label:"Y",value:I.Y},{label:"Z",value:I.Z}],value:o.props.upAxis,onChange:i=>{e(n=>{n.props.upAxis=i})}})]})}),Fe={BoxColliderShape:Te,CapsuleColliderShape:Me,PlaneColliderShape:we,SphereColliderShape:Ae},q={BoxColliderShape:{class:"BoxColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},size:{x:1,y:1,z:1},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},CapsuleColliderShape:{class:"CapsuleColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,height:2,upAxis:I.Y,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},PlaneColliderShape:{class:"PlaneColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},SphereColliderShape:{class:"SphereColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}}},Ve=j(({item:o,onItemChange:e})=>{var d;const{t}=z(),i=Fe[o.class],n=H.assetStore,s=Object.values(n.assets).filter(c=>c.getMetaConfig().type==="PhysicsMaterial"),a=n.assets[(d=o.props.material)==null?void 0:d.refId];return l.jsxs(l.Fragment,{children:[l.jsx(re,{label:t("physics.collider.trigger.title"),info:t("physics.collider.trigger.info"),value:o.props.isTrigger,onChange:c=>{e(f=>{f.props.isTrigger=c})}}),l.jsx(ye,{label:t("physics.collider.material.title"),info:t("physics.collider.material.info"),dropLayer:me.PhysicsMaterial,value:a==null?void 0:a.name,assets:s,onSelect:c=>{e(f=>{f.props.material=c.getCurrentRef()})},onLocate:()=>{a&&a.id&&n.selectAsset(a.id)}}),l.jsx(i,{item:o,onItemChange:e}),l.jsx(X,{label:t("physics.collider.local-position.title"),info:t("physics.collider.local-position.info"),value:{x:o.props.position.x,y:o.props.position.y,z:o.props.position.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.position={...b.props.position,[f]:u}})}}),l.jsx(X,{label:t("physics.collider.rotation.title"),info:t("physics.collider.rotation.info"),value:{x:o.props.rotation.x,y:o.props.rotation.y,z:o.props.rotation.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.rotation={...b.props.rotation,[f]:u}})}})]})}),Be=j(({collider:o,item:e,index:t,onModelChange:i})=>{const{t:n}=z(),s=[{label:n("physics.shape.box.title"),value:"BoxColliderShape"},{label:n("physics.shape.capsule.title"),value:"CapsuleColliderShape"}];o.engineObject instanceof K||(s.push({label:n("physics.shape.plane.title"),value:"PlaneColliderShape"}),s.push({label:n("physics.shape.sphere.title"),value:"SphereColliderShape"}));const d=c=>{const f=o.colliderShapes,u=N(f),b=u[t];b&&(c(b),i==null||i("colliderShapes",u))};return l.jsxs(l.Fragment,{children:[l.jsx(se,{label:n("physics.shape.type.title"),info:n("physics.shape.type.info"),value:e.class,options:s,onChange:c=>{q[c].class!==e.class&&d(u=>{Object.assign(u,N(q[c]))})}}),l.jsx(Ve,{item:e,onItemChange:d})]})}),Ee=j(({model:o,inspectorConfig:e,onModelChange:t})=>{const{label:i}=e,n=o.colliderShapes,{t:s}=z(),a=d=>{const c=N(n);d(c),t==null||t("colliderShapes",c)};return l.jsx(Pe,{label:i,items:n.map((d,c)=>({removable:!0,children:l.jsx(Be,{collider:o,item:d,index:c,onModelChange:t}),id:`${c}`,name:s("physics.shape.item-name",{index:c})})),addable:!0,onAdd:()=>{a(d=>{d.push(N(q.BoxColliderShape))})},onDelete:d=>{a(c=>{c.splice(+d.id,1)})},addItemText:s("physics.shape.add")})});var Ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,$e=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ne(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ie(e,t,n),n};class R extends ae{constructor(){super(...arguments);p(this,"colliderShapes",[])}}$e([he({engineKey:"addShape",editorKey:"colliderShapes",getPath:"shapes",valueType:ue.Object,getEngineValue:o=>o.shapes,getEditorValue:De}),y({type:"methods",key:"colliderShapes",canonicalizeToProps:!0,onSerialize:o=>o.map(e=>({$type:e.class,...ve(e)})),onDeserialize:o=>o.map(e=>{const{$type:t,...i}=e;return{class:t,props:i}})}),m({label:r("physics.collider.title"),info:r("physics.collider.info"),customComponent:Ee,onChange:ze})],R.prototype,"colliderShapes",2);var Le=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Re=(o,e,t,i)=>{for(var n=i>1?void 0:i?Je(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Le(e,t,n),n};let te=class extends R{constructor(o,e){super(o,e)}};te=Re([F({type:"StaticCollider",componentsMenu:{group:"physics",label:"component.static-collider.title"}})],te);const ie=o=>Object.keys(S).filter(e=>(o&S[e])!==0).map(e=>String(S[e])),Xe=j(({model:o,onModelChange:e})=>{const t=n=>{const a=n.map(d=>parseInt(d)).reduce((d,c)=>d|c,S.None);e==null||e("constraints",a)},{t:i}=z();return l.jsxs(l.Fragment,{children:[l.jsx(W,{label:i("physics.collider-constraints.freeze-position.title"),info:i("physics.collider-constraints.freeze-position.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezePositionX.toString(),label:"X"},{value:S.FreezePositionY.toString(),label:"Y"},{value:S.FreezePositionZ.toString(),label:"Z"}],onChange:t}),l.jsx(W,{label:i("physics.collider-constraints.freeze-rotation.title"),info:i("physics.collider-constraints.freeze-rotation.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezeRotationX.toString(),label:"X"},{value:S.FreezeRotationY.toString(),label:"Y"},{value:S.FreezeRotationZ.toString(),label:"Z"}],onChange:t})]})});var Ke=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,C=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ye(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ke(e,t,n),n};let g=class extends R{constructor(e,t){super(e,t);p(this,"isKinematic",!1);p(this,"collisionDetectionMode",B.Discrete);p(this,"constraints",S.None);p(this,"mass",1);p(this,"useGravity",!0);p(this,"linearDamping",0);p(this,"angularDamping",.05);p(this,"automaticCenterOfMass",!0);p(this,"centerOfMass",{x:0,y:0,z:0});p(this,"automaticInertiaTensor",!0);p(this,"inertiaTensor",{x:1,y:1,z:1});p(this,"linearVelocity",{x:0,y:0,z:0});p(this,"angularVelocity",{x:0,y:0,z:0});p(this,"maxAngularVelocity",100);p(this,"maxDepenetrationVelocity",10000000331813535e16);p(this,"sleepThreshold",.005);p(this,"solverIterations",4)}onEnabled(){this._applyEditorRuntimeState()}onInitComplete(){this._applyEditorRuntimeState()}rebindEngineObject(e){super.rebindEngineObject(e),this._applyEditorRuntimeState()}_applyEditorRuntimeState(){this.applyBoundPathChange("enabled",h.Toggle,!1)}};C([y(),m({label:r("physics.dynamic-collider.kinematic.title"),info:r("physics.dynamic-collider.kinematic.info"),type:h.Boolean,bindPath:"isKinematic"})],g.prototype,"isKinematic",2);C([y(),m({label:r("physics.dynamic-collider.collision-detection-mode.title"),type:h.Select,bindPath:"collisionDetectionMode",options:[{label:r("physics.dynamic-collider.collision-detection-mode.discrete"),value:B.Discrete},{label:r("physics.dynamic-collider.collision-detection-mode.continuous"),value:B.Continuous},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-dynamic"),value:B.ContinuousDynamic},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-speculative"),value:B.ContinuousSpeculative}]})],g.prototype,"collisionDetectionMode",2);C([y(),m({label:r("physics.dynamic-collider.constraints.title"),info:r("physics.dynamic-collider.constraints.info"),customComponent:Xe,bindPath:"constraints"})],g.prototype,"constraints",2);C([y(),m({label:r("physics.dynamic-collider.mass.title"),info:r("physics.dynamic-collider.mass.info"),bindPath:"mass",min:0,type:h.Number})],g.prototype,"mass",2);C([y(),m({label:r("physics.dynamic-collider.gravity.title"),info:r("physics.dynamic-collider.gravity.info"),bindPath:"useGravity",type:h.Boolean})],g.prototype,"useGravity",2);C([y(),m({label:r("physics.dynamic-collider.linear-damping.title"),info:r("physics.dynamic-collider.linear-damping.info"),bindPath:"linearDamping",min:0,type:h.Number})],g.prototype,"linearDamping",2);C([y(),m({label:r("physics.dynamic-collider.angular-damping.title"),info:r("physics.dynamic-collider.angular-damping.info"),bindPath:"angularDamping",min:0,type:h.Number})],g.prototype,"angularDamping",2);C([y(),m({label:r("physics.dynamic-collider.automatic-center-of-mass.title"),info:r("physics.dynamic-collider.automatic-center-of-mass.info"),bindPath:"automaticCenterOfMass",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.centerOfMass;o.centerOfMass={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticCenterOfMass",2);C([y(),m({label:r("physics.dynamic-collider.center-of-mass.title"),info:r("physics.dynamic-collider.center-of-mass.info"),type:h.Vector3,bindPath:"centerOfMass",when:o=>!o.automaticCenterOfMass})],g.prototype,"centerOfMass",2);C([y(),m({label:r("physics.dynamic-collider.automatic-inertia-tensor.title"),info:r("physics.dynamic-collider.automatic-inertia-tensor.info"),bindPath:"automaticInertiaTensor",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.inertiaTensor;o.inertiaTensor={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticInertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.inertia-tensor.title"),info:r("physics.dynamic-collider.inertia-tensor.info"),type:h.Vector3,bindPath:"inertiaTensor",when:o=>!o.automaticInertiaTensor})],g.prototype,"inertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.linear-velocity.title"),info:r("physics.dynamic-collider.linear-velocity.info"),type:h.Vector3,bindPath:"linearVelocity"})],g.prototype,"linearVelocity",2);C([y(),m({label:r("physics.dynamic-collider.angular-velocity.title"),info:r("physics.dynamic-collider.angular-velocity.info"),type:h.Vector3,bindPath:"angularVelocity"})],g.prototype,"angularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-angular-velocity.title"),info:r("physics.dynamic-collider.max-angular-velocity.info"),bindPath:"maxAngularVelocity",min:0,type:h.Number})],g.prototype,"maxAngularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-depenetration-velocity.title"),info:r("physics.dynamic-collider.max-depenetration-velocity.info"),bindPath:"maxDepenetrationVelocity",min:0,type:h.Number})],g.prototype,"maxDepenetrationVelocity",2);C([y(),m({label:r("physics.dynamic-collider.sleep-threshold.title"),info:r("physics.dynamic-collider.sleep-threshold.info"),bindPath:"sleepThreshold",min:0,type:h.Number})],g.prototype,"sleepThreshold",2);C([y(),m({label:r("physics.dynamic-collider.solver-iterations.title"),info:r("physics.dynamic-collider.solver-iterations.info"),bindPath:"solverIterations",min:0,max:10,dragStep:1,type:h.Slider})],g.prototype,"solverIterations",2);g=C([F({type:"DynamicCollider",componentsMenu:{group:"physics",label:"component.dynamic-collider.title"}})],g);var qe=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,E=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ge(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&qe(e,t,n),n};let M=class extends R{constructor(e,t){super(e,t);p(this,"stepOffset",.5);p(this,"upDirection",{x:0,y:1,z:0});p(this,"slopeLimit",45);p(this,"nonWalkableMode",Y.PreventClimbing)}async bindEngineObject(e){await super.bindEngineObject(e),e.enabled=!1}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1}};E([y(),m({label:r("physics.character.step-offset.title"),info:r("physics.character.step-offset.info"),bindPath:"stepOffset",min:0,type:h.Number})],M.prototype,"stepOffset",2);E([y(),m({label:r("physics.character.up-direction.title"),info:r("physics.character.up-direction.info"),type:h.Vector3,bindPath:"upDirection"})],M.prototype,"upDirection",2);E([y(),m({label:r("physics.character.slop-limit.title"),info:r("physics.character.slop-limit.info"),bindPath:"slopeLimit",min:0,max:180,type:h.Number})],M.prototype,"slopeLimit",2);E([y(),m({label:r("physics.character.non-walkable-mode.title"),info:r("physics.character.non-walkable-mode.info"),bindPath:"nonWalkableMode",type:h.Select,options:[{label:r("physics.character.non-walkable-mode.prevent-climbing"),value:Y.PreventClimbing},{label:r("physics.character.non-walkable-mode.prevent-climbing-and-force-sliding"),value:Y.PreventClimbingAndForceSliding}]})],M.prototype,"nonWalkableMode",2);M=E([F({type:"CharacterController",componentsMenu:{label:r("component.physics.character.title"),group:"physics"}})],M);const Ze=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,disabled:a,info:d}=e,{ownerId:c}=t[n]||{},f=c&&o.model.root.sceneStore.getEntityModel(c),u=O=>{const _=O?H.sceneStore.getEntityModel(O):null,U=(_==null?void 0:_.getComponentByTypeName("DynamicCollider"))||(_==null?void 0:_.getComponentByTypeName("StaticCollider")),ce=U?{ownerId:O,componentId:U.id}:null;i==null||i(n,ce)},{t:b}=z(),x=Array.from(t.root.sceneStore.iterateEntityModels(),([,O])=>O);return l.jsx(l.Fragment,{children:l.jsx(fe,{label:b(s),info:b(d),entities:x,value:c,disabled:a,customFilter:O=>{let _=null;return t.entityModelId!==O.id&&(_=O.getComponentByTypeName("DynamicCollider")||O.getComponentByTypeName("StaticCollider")),_},displayValue:f==null?void 0:f.name,placeholder:b("physics.collider-picker.placeholder"),onSelect:u,onLocate:()=>{o.model.root.sceneStore.selectEntity(c)},onDelete:()=>{u(null)}})})});var He=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,T=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ue(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&He(e,t,n),n};class v extends ae{constructor(){super(...arguments);p(this,"connectedCollider",null);p(this,"anchor",{x:0,y:0,z:0});p(this,"automaticConnectedAnchor",!0);p(this,"connectedAnchor",{x:0,y:0,z:0});p(this,"breakForce",Number.MAX_VALUE);p(this,"breakTorque",Number.MAX_VALUE);p(this,"massScale",1);p(this,"connectedMassScale",1)}async applyBoundPathChange(t,i,n){var s,a;if(t==="connectedCollider"){const d=n,c=((a=(s=this.root.sceneStore.getEntityModel(d==null?void 0:d.ownerId))==null?void 0:s.getComponentById(d==null?void 0:d.componentId))==null?void 0:a.engineObject)??null;await super.applyBoundPathChange(t,i,c);return}await super.applyBoundPathChange(t,i,n)}}T([y(),m({label:r("physics.joint.connected-collider.title"),info:r("physics.joint.connected-collider.info"),customComponent:Ze,bindPath:"connectedCollider"})],v.prototype,"connectedCollider",2);T([y(),m({label:r("physics.joint.anchor.title"),type:h.Vector3,bindPath:"anchor",onChange(o,e,t){if(o.automaticConnectedAnchor){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"anchor",2);T([y(),m({label:r("physics.joint.automatic-connected-anchor.title"),type:h.Boolean,bindPath:"automaticConnectedAnchor",onChange(o,e,t){if(t){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"automaticConnectedAnchor",2);T([y(),m({label:r("physics.joint.connected-anchor.title"),type:h.Vector3,bindPath:"connectedAnchor",when:o=>!o.automaticConnectedAnchor})],v.prototype,"connectedAnchor",2);T([y(),m({label:r("physics.joint.break-force.title"),type:h.Number,bindPath:"breakForce"})],v.prototype,"breakForce",2);T([y(),m({label:r("physics.joint.break-torque.title"),type:h.Number,bindPath:"breakTorque"})],v.prototype,"breakTorque",2);T([y(),m({label:r("physics.joint.mass-scale.title"),type:h.Number,bindPath:"massScale"})],v.prototype,"massScale",2);T([y(),m({label:r("physics.joint.connected-mass-scale.title"),type:h.Number,bindPath:"connectedMassScale"})],v.prototype,"connectedMassScale",2);var We=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,ke=(o,e,t,i)=>{for(var n=i>1?void 0:i?Qe(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&We(e,t,n),n};let oe=class extends v{constructor(o,e){super(o,e)}};oe=ke([F({type:"FixedJoint",componentsMenu:{label:r("component.physics.fixed-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],oe);const et=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useLimits,c=t.useSpring,f=t[n],u=f.props,{t:b}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:b(s),info:b(a),children:[l.jsx(P,{label:b("physics.joint-limits.min"),value:u.min,onChange:x=>{u.max<x&&(u.max=x),u.min=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.max"),value:u.max,onChange:x=>{x<u.min&&(x=u.min),u.max=x,i(n,f)}}),c?l.jsxs(l.Fragment,{children:[l.jsx(P,{label:b("physics.joint-limits.stiffness"),value:u.stiffness,onChange:x=>{u.stiffness=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.damping"),value:u.damping,onChange:x=>{u.damping=x,i(n,f)}})]}):l.jsx(P,{label:b("physics.joint-limits.contact-distance"),value:u.contactDistance,onChange:x=>{u.contactDistance=x,i(n,f)}})]}):null})}),tt=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useMotor,c=t[n],f=c.props,{t:u}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:u(s),info:u(a),children:[l.jsx(P,{label:u("physics.joint-motor.target-velocity"),value:f.targetVelocity,onChange:b=>{f.targetVelocity=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.force-limit"),value:f.forceLimit,onChange:b=>{f.forceLimit=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.gear-ratio"),value:f.gearRatio,onChange:b=>{f.gearRatio=b,i(n,c)}}),l.jsx(re,{label:u("physics.joint-motor.free-spin"),value:f.freeSpin,onChange:b=>{f.freeSpin=b,i(n,c)}})]}):null})});var it=Object.defineProperty,ot=Object.getOwnPropertyDescriptor,A=(o,e,t,i)=>{for(var n=i>1?void 0:i?ot(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&it(e,t,n),n};let D=class extends v{constructor(e,t){super(e,t);p(this,"axis",{x:1,y:0,z:0});p(this,"useLimits",!1);p(this,"useSpring",!1);p(this,"limits",{class:"JointLimits",props:{max:0,min:0,contactDistance:-1,stiffness:0,damping:0}});p(this,"useMotor",!1);p(this,"motor",{class:"JointMotor",props:{targetVelocity:0,forceLimit:Number.MAX_VALUE,gearRatio:1,freeSpin:!1}})}async applyBoundPathChange(e,t,i){if(e==="limits"){const n=this._buildLimitsFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}if(e==="motor"){const n=this._buildMotorFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}await super.applyBoundPathChange(e,t,i)}_buildLimitsFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new be;return i.max=t.max,i.min=t.min,i.contactDistance=t.contactDistance,i.stiffness=t.stiffness,i.damping=t.damping,i}_buildMotorFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new ge;return i.targetVelocity=t.targetVelocity,i.forceLimit=t.forceLimit,i.gearRatio=t.gearRatio,i.freeSpin=t.freeSpin,i}};A([y(),m({label:r("physics.hinge-joint.axis.title"),type:h.Vector3,bindPath:"axis"})],D.prototype,"axis",2);A([y(),m({label:r("physics.hinge-joint.use-limits.title"),type:h.Boolean,bindPath:"useLimits"})],D.prototype,"useLimits",2);A([y(),m({label:r("physics.hinge-joint.use-spring.title"),type:h.Boolean,bindPath:"useSpring"})],D.prototype,"useSpring",2);A([y(),m({label:r("physics.hinge-joint.limits.title"),customComponent:et,bindPath:"limits"})],D.prototype,"limits",2);A([y(),m({label:r("physics.hinge-joint.use-motor.title"),type:h.Boolean,bindPath:"useMotor"})],D.prototype,"useMotor",2);A([y(),m({label:r("physics.hinge-joint.motor.title"),customComponent:tt,bindPath:"motor"})],D.prototype,"motor",2);D=A([F({type:"HingeJoint",componentsMenu:{label:r("component.physics.hinge-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],D);var nt=Object.defineProperty,st=Object.getOwnPropertyDescriptor,V=(o,e,t,i)=>{for(var n=i>1?void 0:i?st(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&nt(e,t,n),n};let w=class extends v{constructor(e,t){super(e,t);p(this,"spring",10);p(this,"damper",.2);p(this,"minDistance",0);p(this,"maxDistance",0);p(this,"tolerance",.025)}};V([y(),m({label:r("physics.spring-joint.spring.title"),type:h.Number,bindPath:"spring"})],w.prototype,"spring",2);V([y(),m({label:r("physics.spring-joint.damper.title"),type:h.Number,bindPath:"damper"})],w.prototype,"damper",2);V([y(),m({label:r("physics.spring-joint.min-distance.title"),type:h.Number,bindPath:"minDistance"})],w.prototype,"minDistance",2);V([y(),m({label:r("physics.spring-joint.max-distance.title"),type:h.Number,bindPath:"maxDistance"})],w.prototype,"maxDistance",2);V([y(),m({label:r("physics.spring-joint.tolerance.title"),type:h.Number,bindPath:"tolerance"})],w.prototype,"tolerance",2);w=V([F({type:"SpringJoint",componentsMenu:{label:r("component.physics.spring-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],w);class rt extends Ce{constructor(){super(...arguments);p(this,"_isPlaying",!1)}onPlay(t){this._isPlaying=t,this._toggleAll(t)}onAddComponent(t){!this._isPlaying&&(t instanceof Q||t instanceof K)&&(t.enabled=!1)}_toggleAll(t){var a;const i=(a=this.engine.sceneManager.activeScene)==null?void 0:a.rootEntities;if(!i)return;const n=[],s=[];i.forEach(d=>{d.getComponentsIncludeChildren(Q,n),d.getComponentsIncludeChildren(K,s)}),n.forEach(d=>{d.enabled=t}),s.forEach(d=>{d.enabled=t})}}var at=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,ct=(o,e,t,i)=>{for(var n=i>1?void 0:i?lt(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&at(e,t,n),n};let ne=class{constructor(){p(this,"script")}init(){this.script=xe.addScript(rt)}};ne=ct([Se({type:"physicsStore"})],ne);export{M as C,g as D,oe as F,D as H,ne as P,te as S,w as a};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var c=(o,t,e)=>t in o?m(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var a=(o,t,e)=>(c(o,typeof t!="symbol"?t+"":t,e),e);import{s as f,p as h,C as g}from"./index-3660a664.js";import"./index-365736f7.js";import{c as b}from"./Component-6d1e73e5.js";import"./postmen-c7605b45.js";import{L as u}from"./LightBaseComponent-545c5ee8.js";var P=Object.defineProperty,d=Object.getOwnPropertyDescriptor,l=(o,t,e,p)=>{for(var n=p>1?void 0:p?d(t,e):t,i=o.length-1,r;i>=0;i--)(r=o[i])&&(n=(p?r(t,e,n):r(n))||n);return p&&n&&P(t,e,n),n};let s=class extends u{constructor(t,e){super(t,e);a(this,"distance",60)}};l([f(),h({type:g.Number,bindPath:"distance",label:"light.point.distance.label",info:"light.point.distance.info"})],s.prototype,"distance",2);s=l([b({type:"PointLight",componentsMenu:{group:"light",label:"component.light.point.title"}})],s);export{s as PointLightComponent};
1
+ var m=Object.defineProperty;var c=(o,t,e)=>t in o?m(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var a=(o,t,e)=>(c(o,typeof t!="symbol"?t+"":t,e),e);import{s as f,p as h,C as g}from"./index-e44b357e.js";import"./index-debbe073.js";import{c as b}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";import{L as u}from"./LightBaseComponent-b4854e8a.js";var P=Object.defineProperty,d=Object.getOwnPropertyDescriptor,l=(o,t,e,p)=>{for(var n=p>1?void 0:p?d(t,e):t,i=o.length-1,r;i>=0;i--)(r=o[i])&&(n=(p?r(t,e,n):r(n))||n);return p&&n&&P(t,e,n),n};let s=class extends u{constructor(t,e){super(t,e);a(this,"distance",60)}};l([f(),h({type:g.Number,bindPath:"distance",label:"light.point.distance.label",info:"light.point.distance.info"})],s.prototype,"distance",2);s=l([b({type:"PointLight",componentsMenu:{group:"light",label:"component.light.point.title"}})],s);export{s as PointLightComponent};
@@ -1,4 +1,4 @@
1
- var R=Object.defineProperty;var $=(e,s,o)=>s in e?R(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o;var x=(e,s,o)=>($(e,typeof s!="symbol"?s+"":s,o),o);import{aM as _,av as l,aP as q,e as u,aw as G,aI as w,de as J,aL as A,aJ as N,df as z,dg as Q,dh as W,di as H,bm as K,dj as U,dk as X,dl as Y,bA as Z,q as ee,dm as te,dn as se,dp as oe,bk as re,t as ne,dq as ae,dr as ce,ds as le,cm as ie,dt as fe,du as pe,bI as me,E as ue,a as T,s as C,p as k,C as D,l as be,g as de}from"./index-3660a664.js";import{u as he}from"./index-365736f7.js";import{c as ye}from"./Component-6d1e73e5.js";import"./postmen-c7605b45.js";import{I as ge}from"./IconPlus-5fbc029e.js";import{D as Pe,M as je}from"./Menu-a427d272.js";import{c as B}from"./createReactComponent-d9f8b1af.js";import{A as xe,a as Ee}from"./Accordion-75b7b34e.js";/**
1
+ var R=Object.defineProperty;var $=(e,s,o)=>s in e?R(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o;var x=(e,s,o)=>($(e,typeof s!="symbol"?s+"":s,o),o);import{aM as _,av as l,aP as q,e as u,aw as G,aI as w,de as J,aL as A,aJ as N,df as z,dg as Q,dh as W,di as H,bm as K,dj as U,dk as X,dl as Y,bA as Z,q as ee,dm as te,dn as se,dp as oe,bk as re,t as ne,dq as ae,dr as ce,ds as le,cm as ie,dt as fe,du as pe,bI as me,E as ue,a as T,s as C,p as k,C as D,l as be,g as de}from"./index-e44b357e.js";import{u as he}from"./index-debbe073.js";import{c as ye}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";import{I as ge}from"./IconPlus-172c6c17.js";import{D as Pe,M as je}from"./Menu-05c1f0a4.js";import{c as B}from"./createReactComponent-cb70ea50.js";import{A as xe,a as Ee}from"./Accordion-f938dadf.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.