1import{et as I,ev as E,eW as R,eX as B,eY as U,eZ as j,e_ as g,e$ as A,f0 as D,f1 as w,dR as v,f2 as _,dK as k,A as K,f3 as N,f4 as M,f5 as C,f6 as V,eV as W,f7 as $}from"./runtime-updater-6QPW4RJT-zi3fHHTA.js";import"./index-Dqt4EOsp.js";var P=class extends R(U,B){constructor(e,o,a){super(),this.isComponentObject=!0,o.type==="Instance"&&typeof e=="string"&&(o=this.transformAssignData(o,a)),this.super_Entity(e,o),this.objectHelper.update()}get isComponentRoot(){return this.data.type==="Component"&&typeof this.identity=="string"}get isInstanceRoot(){return this.data.type==="Instance"&&typeof this.identity=="string"}transformAssignData(e,o){let a=j.getComponentData({scene:o.scene.data,shared:o.shared.data},e.component);if(a){let n,s;for(let i of g.rootOverrideProps)e[i]===void 0?(n===void 0&&(n={...e}),n[i]=a.data[i]):(s===void 0&&(s={}),s[i]=e[i],n===void 0&&(n={...e}),n[i]=A.apply(a.data[i],e[i]));return this.overrideData=s,n}return{...D.defaultData,...e,...w(D.defaultData,g.rootOverrideProps)}}updateByOp(e,o,a,n){let s;if(this.isInstanceRoot&&!n){if(o=this.transformAssignData(o,a),e.type===0&&e.path.length===0&&this.component)for(let i of g.rootOverrideProps)i in e.props&&e.props[i]===void 0&&(s===void 0&&(s={...e,props:{...e.props}}),s.props[i]=this.component.data[i]);else if(e.type===0&&e.path.length>0&&g.rootOverrideProps.includes(e.path[0])){let i=e.path[0];s===void 0&&(s={...e,path:[],props:{[i]:o[i]}})}}super.updateByOp(s??e,o,a,n)}updateState(e,o){this.updateState_Entity(e,o)}expandInstanceChildren(e){let o=this.data;if(this.component===void 0){let a=e.scene.find(o.component)??null,n=!1;if(a!==this.oldComponent){if(this.oldComponent){let s=0;for(let i of this.children){if(!v.is(i))break;e.scene.disposeAndUnregisterEntityRecursivelyIfNotReregistered(i),_(i),s+=1}this.children.splice(0,s)}n=!0}if(a){let s={};S(e,[this.uuid],o.overrides,this,a,a,0,n,s);for(let i of this.children)if(v.is(i)){let u=i.data;u.type==="Empty"&&u.animations&&i.traverseEntity(d=>{let y=d.dataPatched;if(d instanceof k&&y.bones&&y.boneInverses){let l=d.dataPatched;if(l.bones&&l.boneInverses){let r=l.bones.map(f=>e.scene.find(s[f])),p=l.boneInverses.map(f=>new K().fromArray(f)),c=new N(r,p);d.bind(c,d.bindMatrix)}}else d.matrixAutoUpdate=!0})}}this.oldComponent=this.component}}};function O(e,o,a,n){return e.component===o&&$(e.identity,n)?e.overrideData===a?2:1:0}function S(e,o,a,n,s,i,u,d,y){if(u>50)return!1;if(n.component!==s){if(n.component){let r=n.component.instances.indexOf(n);r>=0&&n.component.instances.splice(r,1)}s.instances.find(r=>r===n)||s.instances.push(n),n.component=s}s instanceof P&&s.isInstanceRoot&&s.expandInstanceChildren(e);let l=0;for(let r of s.children)if(v.is(r)){let p=[...o,...typeof r.identity=="string"?[r.identity]:r.identity],c=M.resolve(a,p,1);c!=null&&!(c instanceof C)&&(Object.setPrototypeOf(c,C.prototype),console.error("wrong prototype"));let f,t=null;if(!d){let h=n.children[l];if(t=v.is(h)?h:null,t!==null){let m=O(t,r,c,p);f=m>=1?t.stateSelection:void 0,m!==2&&(t=null)}if(t===null&&(t=e.scene.findInstance(p)??null,t!==null)){let m=O(t,r,c,p);if(f=m>=1?t.stateSelection:void 0,m!==2)t=null;else{let b=t.parent.children.indexOf(t);t.parent.children.splice(b,1),n.children.splice(l,0,t),t.parent===n?b<=l&&console.error("not possible"):(t.parent=n,t.matrixWorldNeedsUpdate=!0,t.resetBBoxNeedsUpdate(),t.updateVisible(),e.pendingDeletes.delete(t))}}}if(t===null){let h=c?A.apply(r.data,c):r.data;V.is(h.type)&&(h={...h,type:"Empty"}),t=W.createEntity(p,h,e),t.overrideData=c,n.add(t),n.children.splice(n.children.length-1,1),n.children.splice(l,0,t),t.updateState(t.data,e),f&&t.changeSelectedState(f,e),e.scene.registerInstanceAndSetUuid(t)}t.isBone&&(y[t.identity[t.identity.length-1]]=t.uuid),l+=1,S(e,o,a,t,r,i,u+1,d,y)}if(!d){let r=l;for(;;){let p=n.children[l];if(!v.is(p))break;e.pendingDeletes.add(p),l+=1}n.children.splice(r,l-r)}return!0}var x=(e,o,a)=>new P(e,o,a);I("Component",x),I("Instance",x),E("components");
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.