import{definePlugin}from"../../core/extension";export default definePlugin("space",{setup(a,b){return{render:(a,c={})=>{if(!a)throw Error("\u672A\u627E\u5230\u6A21\u578B\u7EC4\u4EF6");let{url:d=a.model.url,replace:e=!1}=c;return b.loadOption(d).then(c=>b.createComponent(c,d).then(b=>{let c=a;if(b.model.matrix.compose(c.model.position,c.model.quaternion,c.model.scale),!0===e){if(!c.parent)throw Error("\u5F53\u524D\u6A21\u578B\u7EC4\u4EF6\u6CA1\u6709\u7236\u7EC4\u4EF6");let a=c.parent;a.add(b),c.removeFromParent()}else c.add(b);return b}))}}},render(){},destroyed(){}});