var y=Object.defineProperty;var j=(s,e,r)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var c=(s,e,r)=>(j(s,typeof e!="symbol"?e+"":e,r),r);import{aJ as m,bm as v,aK as b,av as t,aw as S,ay as d,aH as f,aI as g,aM as u,aO as k,aN as B,f as O,p as h,C as F,s as R}from"./index-03b6134d.js";import{u as I}from"./index-0a53aaef.js";import{c as M}from"./Component-3cb422ab.js";import"./postmen-9e6354af.js";import{c as E}from"./createOnModelChange-73358d10.js";import{M as _}from"./MaterialInspector-21fc5b67.js";import{M as z}from"./MeshRendererBaseComponent-2af8db12.js";import"./IconPointFilled-f8224625.js";import"./createReactComponent-fcd6848b.js";const x=m(v),P=m(({model:s,inspectorConfig:e,onModelChange:r})=>{const{disabled:n,property:o}=e,{t:i}=b();return t.jsxs(t.Fragment,{children:[t.jsx(S,{label:i(e.label),info:i(e.info),fieldCss:{minHeight:"$5"},children:t.jsx(d,{size:"sm",selectable:!0,code:!0,children:null})}),t.jsx(x,{label:"        ",disabled:n,value:s[o].min,onChange:a=>{r==null||r(o,{...s[o],min:a})},formEndSlot:t.jsx(d,{size:"sm",selectable:!0,code:!0,children:i("skinned-mesh-renderer.local-bounds.min.label")})}),t.jsx(x,{label:"        ",disabled:n,value:s[o].max,onChange:a=>{r==null||r(o,{...s[o],max:a})},formEndSlot:t.jsx(d,{size:"sm",selectable:!0,code:!0,children:i("skinned-mesh-renderer.local-bounds.max.label")})})]})}),C=f("div",{marginLeft:"5px"}),T=f(g,{border:"1px solid $gray6",borderRadius:"$2",padding:"$0_5",color:"$gray11",cursor:"pointer"}),$=m(function(s){const e=s.data,{t:r}=b();return t.jsxs(T,{align:"v",children:[t.jsx("img",{src:e.thumbnailUrl,alt:"Material Thumbnail",width:"20px",height:"20px"}),t.jsxs(C,{children:[r("skinned-mesh-renderer.material.label"),"(",e.name,")"]})]})}),w=m(function(s){const[e,r]=u.useState(null),n=s.data,{assetStore:o,inspectorFacade:i}=I();return u.useEffect(()=>{o.getAssetByRef(n.material).then(a=>{r(a)})},[n.material]),t.jsxs(t.Fragment,{children:[t.jsx(k.List,{model:n,configs:n.formSchema.items,onModelChange:E("component",n.id,i,n)}),e&&t.jsx(B,{nesting:!0,title:t.jsx($,{data:e}),open:n.materialOpen,onOpenChange:a=>{n.setMaterialOpen(a)},children:t.jsx(_,{asset:e})})]})});var H=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(s,e,r,n)=>{for(var o=n>1?void 0:n?V(e,r):e,i=s.length-1,a;i>=0;i--)(a=s[i])&&(o=(n?a(e,r,o):a(o))||o);return n&&o&&H(e,r,o),o};let l=class extends z{constructor(e,r){super(e,r);c(this,"rootBone",null);c(this,"localBounds",{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}})}};p([O({getEngineValue:s=>{var e;return(e=s.skin)==null?void 0:e.rootBone}}),h({label:"skinned-mesh-renderer.skin.root-bone.label",info:"skinned-mesh-renderer.skin.root-bone.info",type:F.EntityPicker,disabled:!0})],l.prototype,"rootBone",2);p([h({label:"skinned-mesh-renderer.local-bounds.title",info:"skinned-mesh-renderer.local-bounds.info",customComponent:P,type:"BoundingBox"}),R()],l.prototype,"localBounds",2);l=p([M({type:"SkinnedMeshRenderer",customInspector:w,componentsMenu:{label:"component.renderer.skinned-mesh.title"}})],l);export{l as SkinnedMeshRendererComponent};
