import{$ as e,C as t,E as n,Ft as r,K as i,et as a,p as o,q as s,rt as c,u as l,w as u}from"./three.module-BFsVh7r1.js";var d=class extends i{constructor(e){super(e),this.debug=!1,this.group=null,this.materials=[],this.meshes=[]}load(e,n,r,i){let a=this,o=this.path===``?s.extractUrlBase(e):this.path,c=new t(this.manager);c.setPath(this.path),c.setResponseType(`arraybuffer`),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(t){try{n(a.parse(t,o))}catch(t){i?i(t):console.error(t),a.manager.itemError(e)}},r,i)}parse(e,t){this.group=new n,this.materials=[],this.meshes=[],this.readFile(e,t);for(let e=0;ee.byteLength&&this.debugMessage(`Bad chunk size for chunk at `+t)}readChunk(){if(this.endOfChunk)return null;try{let t=new e(this.data,this.position,this.debugMessage);return this.position+=t.size,t}catch{return this.debugMessage(`Unable to read chunk at `+this.position),null}}get hexId(){return this.id.toString(16)}get endOfChunk(){return this.position>=this.end}readByte(){let e=this.data.getUint8(this.position,!0);return this.position+=1,e}readFloat(){try{let e=this.data.getFloat32(this.position,!0);return this.position+=4,e}catch(e){return this.debugMessage(e+` `+this.position+` `+this.data.byteLength),0}}readInt(){let e=this.data.getInt32(this.position,!0);return this.position+=4,e}readShort(){let e=this.data.getInt16(this.position,!0);return this.position+=2,e}readDWord(){let e=this.data.getUint32(this.position,!0);return this.position+=4,e}readWord(){let e=this.data.getUint16(this.position,!0);return this.position+=2,e}readString(){let e=``,t=this.readByte();for(;t;)e+=String.fromCharCode(t),t=this.readByte();return e}},p=19789,m=15786,h=49725,g=2,_=16,v=17,y=18,b=19,x=48,S=49,C=15677,w=15678,T=256,E=45055,D=40960,O=40976,k=40992,A=41008,j=41024,M=41040,N=41089,P=41091,F=41093,I=41095,L=41472,R=41488,z=41520,B=41476,V=41728,H=41812,U=41814,W=41816,G=41818,K=16384,q=16640,J=16656,Y=16672,X=16688,Z=16704,Q=16736;export{d as TDSLoader};