var w=Object.defineProperty;var C=(n,e,t)=>e in n?w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var c=(n,e,t)=>(C(n,typeof e!="symbol"?e+"":e,t),t);import{aJ as V,bm as P,aK as D,av as l,bn as O,aL as A,bo as B,p as f,e as p,C as T,s as u,E as M}from"./index-03b6134d.js";import"./index-0a53aaef.js";import"./postmen-9e6354af.js";function F(n){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...n,children:l.jsx("path",{fill:"currentColor",d:"M3 9a1 1 0 0 0 1-1V5a1 1 0 0 1 1-1h3a1 1 0 0 0 0-2H5a3 3 0 0 0-3 3v3a1 1 0 0 0 1 1m5 11H5a1 1 0 0 1-1-1v-3a1 1 0 0 0-2 0v3a3 3 0 0 0 3 3h3a1 1 0 0 0 0-2m9-7a1 1 0 0 0 0-2h-1.14A4 4 0 0 0 13 8.14V7a1 1 0 0 0-2 0v1.14A4 4 0 0 0 8.14 11H7a1 1 0 0 0 0 2h1.14A4 4 0 0 0 11 15.86V17a1 1 0 0 0 2 0v-1.14A4 4 0 0 0 15.86 13Zm-5 1a2 2 0 1 1 2-2a2 2 0 0 1-2 2m9 1a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1h-3a1 1 0 0 0 0 2h3a3 3 0 0 0 3-3v-3a1 1 0 0 0-1-1M19 2h-3a1 1 0 0 0 0 2h3a1 1 0 0 1 1 1v3a1 1 0 0 0 2 0V5a3 3 0 0 0-3-3"})})}const I=V(P),S=V(({inspectorConfig:n,models:e,onModelChange:t,model:o})=>{const{label:r,property:a,disabled:h}=n,{t:v}=D(),g=!o;e=e||[o];const d=e[0],E=o.root.sceneStore.rootEntity.children,z=e.map(i=>i.id);function _(i){const b=d.engineObject,y=o.root.sceneStore.getEntityModel(i);if(!y)return;const j=y.engineObject.getComponent(B);b.lookAt(j.worldPosition),d.syncRotation()}return l.jsx(I,{disabled:h,label:v(r),value:g?{x:null,y:null,z:null}:o[a],onChange:(i,b)=>{e.forEach(y=>y[a]=i),t&&t(a,i)},formEndSlot:l.jsx(O,{trigger:l.jsx(A,{variant:"subtle",corner:!0,children:l.jsx(F,{style:{width:"13px",height:"13px"}})}),disabledEntities:z,entities:E,label:r,onSelect:_})})});var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,x=(n,e,t,o)=>{for(var r=o>1?void 0:o?R(e,t):e,a=n.length-1,h;a>=0;a--)(h=n[a])&&(r=(o?h(e,t,r):h(r))||r);return o&&r&&H(e,t,r),r},s;const m=(s=class extends M{constructor(){super(...arguments);c(this,"position",{x:0,y:0,z:0});c(this,"rotation",{x:0,y:0,z:0});c(this,"scale",{x:1,y:1,z:1})}static equalVector3(t,o){return t.x===o.x&&t.y===o.y&&t.z===o.z}static roundToThreeDecimal(t){return Math.round(t*1e3)/1e3}static roundVector2(t,o){return o.x=this.roundToThreeDecimal(t.x),o.y=this.roundToThreeDecimal(t.y),o}static copyVector2(t,o){o.x=t.x,o.y=t.y}static roundVector3(t,o){return o.x=this.roundToThreeDecimal(t.x),o.y=this.roundToThreeDecimal(t.y),o.z=this.roundToThreeDecimal(t.z),o}static copyVector3(t,o){o.x=t.x,o.y=t.y,o.z=t.z}syncTransformToEditor(t){this._syncTransformToEditor("position",t.position),this._syncTransformToEditor("rotation",t.rotation),this._syncTransformToEditor("scale",t.scale)}_syncTransformToEditor(t,o){const r=this[t],a=s.roundVector3(o,s._tempVector3);s.equalVector3(a,r)||(s.copyVector3(a,r),this.notifyPropertyChange(t,!1))}},c(s,"_tempVector2",{x:0,y:0}),c(s,"_tempVector3",{x:0,y:0,z:0}),s);x([f({label:p("transform.position.title"),info:p("transform.position.info"),type:T.Vector3,bindPath:"position"}),u()],m.prototype,"position",2);x([f({label:p("transform.rotation.title"),info:p("transform.rotation.info"),customComponent:S,type:T.Vector3,bindPath:"rotation"}),u()],m.prototype,"rotation",2);x([f({label:p("transform.scale.title"),info:p("transform.scale.info"),type:T.Vector3,constrainable:!0,bindPath:"scale"}),u()],m.prototype,"scale",2);let Z=m;export{Z as T};
